NS4 = (document.layers) ? 1 : 0;
IE4 = (document.all) ? 1 : 0;
ver4 = (NS4 || IE4) ? 1 : 0;

function findObject(id)
{
  if(document.getElementById)
      return document.getElementById(id);
  if(document.all)
      return document.all[id];
  return { style: {} };
}

function doOver(obj1)
{
	obj1.blur()
	obj1.className='se1'
}

function doOut(obj1)
{
	obj1.blur()
	obj1.className=''
}

function doDwon(obj1)
{
	obj1.blur()
	obj1.className='se2'
}
///////////////////////多级菜单关合///////////////////////////
function expandit(obj0,obj1)
{
        obj1.style.display = (obj1.style.display == "none" ) ? "" : "none";
        obj0.all.tags('img')[0].src = (obj1.style.display == "none" ) ? "images/close.gif" : "images/open.gif";
}
///////////////////////多级菜单链接///////////////////////////
function framego(obj,url){
	if(url==""){
		eval(siteenginetargetframe).location='images/back.gif';
		return false;
	}
	var i;
	eval(siteenginetargetframe).location=url;
	allspan=siteengine.all.tags('span');
	for(i=0;i<allspan.length;i++)
	{
		allspan[i].style.backgroundColor=menubgcolor;
		allspan[i].style.color=menutxtcolor;
	}
	obj.style.backgroundColor =seltxtbgcolor;
	obj.style.color=seltxtcolor;
}
///////////////////////多级菜单建立///////////////////////////
function buildmenu()
{
	var menuwant=0;
	var menunow=0;
	var i,themenu,folder=0;

	document.write("<TABLE id='siteengine' border=0 cellspacing=0 cellpadding=0>");
	for(i=0;i<menu.length;i++)
	{
		if(menu[i]==null)continue;
		themenu=menu[i].split(",");
		menuwant=themenu[0];
		while(menuwant!=menunow){
			if(menuwant>menunow){
				folder+=1;
				document.write("<tr style='display:none' id='folder"+folder+"'><td>&nbsp;</td><td style='CURSOR:hand'><TABLE border=0 cellspacing=0 cellpadding=0>");
				menunow+=1;
			}
			if(menuwant<menunow){
				document.write("</table></td></tr>");
				menunow-=1;
			}
		};
		if(menu[i+1]!=null&&menu[i+1].split(",")[0]>menunow)
		{
			document.write("<tr style='CURSOR:hand' id='icon"+(folder+1)+"' onclick=expandit(this,folder"+(folder+1)+")>");
			document.write("<td><img src='images/close.gif'>&nbsp;</td>");
		}
		else
		{
			document.write("<tr>");
			document.write("<td><img src='images/item.gif'>&nbsp;&nbsp;</td>");
		}
		document.write("<td valign=bottom><span onmouseover='doOver(this)' onmouseout='doOut(this)' onmousedown='doDwon(this)'><nobr>");
		document.write(themenu[1]+"</nobr></span></td></tr>");
	}
	document.write("</TABLE>");
	while(menuwant>0)
	{
		document.write("</td></tr></table>");
		menuwant-=1;
	};
	framego(siteengine.all.tags('span')[0],menu[0].split(",")[2]);
}
/////////////////////执行部分////////////////////////////
try{
buildmenu();
}catch(e){}