var tplMenuRoot=new Array();
var tplMenuChild=new Array();


tplMenuRoot.Left=function (arg)
{
	var subId, evn, id, url, txt, isActive, subChr, alt;
	var str='<table width="100%" border="0" cellspacing="0" cellpadding="0">';

	var crd='"p.w","0"';
	if(arg.length) var wd=Math.round(100/(arg.length/3));
	else var wd=100;

	for(var i=0; i<arg.length; i++)
	{
		url=arg[i++];
		txt=arg[i++];
		id=arg[i][0];
		isPop=arg[i][1];
		isActive=(CurrPart==url);
		subId=subIdPref+id;

		evn=' onmouseover=overMen(0,0,'+id+','+crd+') onclick="return clickMen(this)" onmouseout=outMen('+id+')';
		str+='<tr><td width="12" background="'+imgPath+'menu_ico_bg.gif" valign="top"><img src="'+imgPath+'menu_ico.jpg" height="18" width="12" /></td><td';
		//if (url) {str+=' style="cursor : hand"'};
		str+=' class="menu" id='+subId+evn+'><a'+url+'>'+txt+'</a></td></tr>';
	}

    
    str+='<tr style="background-image: url('+imgPath+'sub_menu.jpg); background-repeat:no-repeat"><td>&nbsp;</td><td>&nbsp;</td></tr></table>';
	return str;
}

tplMenuChild.Left=function (topId, emb, arg)
{
	var subId, evn, id, url, txt, isPop;
	var wd=155;

	var str='<div id="'+topIdPref+topId+'" class=popMenu onselectstart="return false" ondragstart="return false" style="Z-index:'+(seqItems--)+'">';
	str+='<table border=0 cellspacing=0 cellpadding=0 width="'+wd+'">';

	var crd='"p.w+5",-1';

	for(var i=0; i<arg.length; i++)
	{
		url=arg[i++];
		txt=arg[i++];
		id=arg[i][0];
		isPop=arg[i][1];

		subId=subIdPref+id;
		evn=' onmouseover=overMen('+topId+','+emb+','+id+','+crd+') onclick="return clickMen(this)" onmouseout=outMen('+id+')';

		str+='<tr bgColor=#f0f0f0><td colspan=2><img src="'+imgPath+'1.gif" width=1 height=1></td></tr>';
		str+='<tr  height=16><td'+evn+' id='+subId+' class=menu_child>';
		str+='<a'+url+'>';
		str+=txt;
		str+='</a></td>';
		str+='<td align=right valign=bottom bgcolor="#f0f0f0" width=5><img src="'+imgPath+(isPop? 'spp':'1')+'.gif" width=5 height=16></td></tr>';
        str+='</tr>';
	}
		str+='<tr bgColor=#f0f0f0><td colspan=2><img src="'+imgPath+'1.gif" width=1 height=1></td></tr>';
	str+='</table>';
	str+='</div>';
	return str;
}
