<?php
function fn_zip_aa($aql)
{
	$listcount = 2;
	$list = $aql->Consume(2);
		
	global $db;
	global $assets;
	global $siteroot;
	
	$apool = array();
	
	$indx = 0;
	while(true)
	{
		$any = false;
		for($x = 0;$x<$listcount;$x++)
		{
			if (isset($list[$x]))
			{
				if (isset($list[$x]->value[$indx]))
				{
					$any = true;
					$v = $list[$x]->value[$indx];
					if (!in_array($v,$apool))
						$apool[] = $v;
				}	
			}			
		}
		
		if ($any == false) break;
		$indx++;
	}	
	
	$a = new AQLStackElement();
	$a->typename = "assetlist";
	$a->islist = true;
	$a->value = $apool;
	array_push($aql->stack,$a);
}

function fn_zip_c($aql)
{
	$list = $aql->Consume(1);
	$listcount = 0+$list[0]->value;
	
	$list = $aql->Consume($listcount);
		
	global $db;
	global $assets;
	global $siteroot;
	
	$apool = array();
	
	$indx = 0;
	while(true)
	{
		$any = false;
		for($x = 0;$x<$listcount;$x++)
		{
			if (isset($list[$x]->value[$indx]))
			{
				$any = true;
				$v = $list[$x]->value[$indx];
				if (!in_array($v,$apool))
					$apool[] = $v;
			}			
		}
		
		$indx++;
		if ($any == false) break;
	}	
	
	$a = new AQLStackElement();
	$a->typename = "assetlist";
	$a->islist = true;
	$a->value = $apool;
	array_push($aql->stack,$a);
}

?>