var tplMenuRoot=new Array();
var tplMenuChild=new Array();

tplMenuRoot.Top=function (arg)
{
	var subId, evn, id, url, txt, isActive, subChr, alt;
	var str='<table border=0 cellspacing=0 cellpadding=0 width=100%><tr>';

	var crd='-15,"22"';
	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+='<td align=center width="'+wd+'%" class=top_menu>&nbsp;<span id='+subId+evn+'><a'+url+'>'+txt+'</a></span>&nbsp;</td>';
	}

	str+='</tr></table>';
	return str;
}

tplMenuChild.Top=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+'">';
	str+='<tr><td colspan=2><img src="'+imgPath+'1.gif" width=1 height=3></td></tr>';

	var crd='"p.w",-1';
	//var lstRel=','+listTop.join(',')+',';

	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=#3650be><td colspan=2><img src="'+imgPath+'1.gif" width=1 height=1></td></tr>';
		str+='<tr><td'+evn+' id='+subId+' class=top_menu_child style="background-image : url('+imgPath+(isPop? 'spp':'1')+'.gif); background-position : right bottom; background-repeat : no-repeat">';
		str+='<a'+url+'>';
		str+=txt;
		str+='</a></td>';
		str+='</tr>';
		str+='<tr bgColor=#152c92><td colspan=2><img src="'+imgPath+'1.gif" width=1 height=1></td></tr>';
	}
		str+='<tr bgColor=#3650be><td colspan=2><img src="'+imgPath+'1.gif" width=1 height=1></td></tr>';
	if(isIE)
		str+='<tr><td><img src="'+imgPath+'1.gif" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+imgPath+'menubot.png\', sizingMethod=\'crop\');cursor:default" width="155" height="10"></td></tr>';
	else
		str+='<tr><td><img src="'+imgPath+'menubot.png" width="155" height="10"></td></tr>';
	str+='</table>';
	str+='</div>';
/*	
	var wnd=window.open('', 'my_wnd');
	wnd.document.clear();
	wnd.document.write(str);
*/
	return str;
}
tplMenuRoot.Left=function (arg)
{
	var subId, evn, id, url, txt, isActive, subChr, alt;
	var str='<table border="0" cellpadding="0" cellspacing="0" width="100%" bgcolor="#f4f4f4" style="border-left : solid 1px #c2c7cb; border-right : solid 1px #c2c7cb">';
	str+='<tr>';
	str+='<td style="padding-bottom :5px"><img src="'+imgPath+'img/1x1.gif" width="100%" height="1" style="background-color : white" /></td>';
	str+='</tr>';

	var crd='"p.w","-2"';
	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';
		if (url) {str+=' style="cursor : hand"'};
		str+=' class=left_menu id='+subId+evn+'><a'+url+'>'+txt+'</a></td></tr>';
	}

	str+='</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+'" bgcolor="#f4f4f4" style="border : solid 1px #c2c7cb;">';

	var crd='"p.w",-1';
	//var lstRel=','+listTop.join(',')+',';

	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><td'+evn+' id='+subId+' class=menu_child>';
		str+='<a'+url+'>';
		str+=txt;
		str+='</a></td>';
	}
		str+='<tr bgColor=#f0f0f0><td colspan=2><img src="'+imgPath+'1.gif" width=1 height=1></td></tr>';
	str+='</table>';
	str+='</div>';
/*	
	var wnd=window.open('', 'my_wnd');
	wnd.document.clear();
	wnd.document.write(str);
*/
	return str;
}