<?php

function fn_rels_a($aql)
{
	global $asset;
	$list = $aql->Consume(1);

	$rellist = array();
	foreach($list[0]->value as $a)
	{
		$ass = new Asset($a);
		foreach($asset[$ass->id]['relationships'] as $k => $v)
		{
			if ($k == 3) continue;
			if (!in_array($k,$rellist))
			{
				$rellist[] = $k;
			}
		}
	}
		
	$a = new AQLStackElement();
	$a->typename = "rellist";
	$a->islist = true;
	$a->value = $rellist;
	array_push($aql->stack,$a);
}

?>