	n=navigator.userAgent;
	w=n.indexOf("MSIE");
	dropdownready=false;
	balloonvisible=false;
	
	function MenuHover(theId){
		if(theId!=hovered)document.getElementById(theId).style.backgroundColor="#FFD200";
	}
	function MenuOut(theId){
		if(theId!=hovered)document.getElementById(theId).style.backgroundColor="";
	}
	function DropDownHover(theId){
		if(document.getElementById(theId))document.getElementById(theId).style.backgroundColor="#EDA100";
		CleanLevel2();
	}
	function DropDownOut(theId){
		if(document.getElementById(theId))document.getElementById(theId).style.backgroundColor="";
	}
	function DropDownHover2(theId){
		if(document.getElementById(theId))document.getElementById(theId).style.backgroundColor="#EDA100";
	}
	function DropDownOut2(theId){
		if(document.getElementById(theId))document.getElementById(theId).style.backgroundColor="";
	}
	function Show(theId){
		if(dropdownready)if(document.getElementById(theId))document.getElementById(theId).style.display="";
	}
	function Hide(theId){
		if(theId=="dropdownmenu")CleanLevel2();
		if(document.getElementById(theId))document.getElementById(theId).style.display="none";
	}
	function ClearFlash(){
		if((w>0)&&(parseInt(n.charAt(w+5))>5)){
			T=["object","embed","applet"];
			for(j=0;j<2;j++){
				E=document.getElementsByTagName(T[j]);
				for(i=0;i<E.length;i++){
					P=E[i].parentNode;
					H=P.innerHTML;
					P.removeChild(E[i]);
					P.innerHTML=H;
				}
			}
		}
	}
	function CleanLevel2(){
		for(var i=0;i<cat.length;i++){
			Hide("dropdownmenu2_"+i);
		}
	}
	function GenerateMenu(){
		if(cat.length>0){
			tempDIV="<table width=\"180\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>";//for shadow level 1
	  		tempDIV+="<table width=\"180\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" bgcolor=\"#FFCC00\" class=\"level1\">";
			for(var a=0;a<cat.length;a++){
				tempDIV+="<tr id=\"level1_"+a+"\">";
				tempDIV+="<td width=\"179\" class=\"level1td\" onmouseover=\"DropDownHover('level1_"+a+"');";
				if(cat[a][2].length>0){
					tempDIV+="Show('dropdownmenu2_"+a+"');";
				}
				tempDIV+="\" onmouseout=\"DropDownOut('level1_"+a+"');\" onClick=\"location.href='product.php?cid="+cat[a][0]+"';\"><img src=\"images/dropdown_arrow.gif\" style=\"margin-right:4px; margin-bottom:1px;\" />"+cat[a][1]+"</td>";
				tempDIV+="<td width=\"1\" bgcolor=\"#FFCC00\" valign=\"top\"><img src=\"images/whitegear_2000.gif\" />";
				tempDIV+="<div class=\"dropdownmenu2\" id=\"dropdownmenu2_"+a+"\" style=\"z-index:"+(a+11)+"; display:none; \">";//div level 2
				tempDIV+="<table width=\"170\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\"><tr><td>";//for shadow level 2
				tempDIV+="<table width=\"170\" bgcolor=\"#006600\" border=\"0\" cellspacing=\"1\" cellpadding=\"0\" class=\"level2\">";
				for(var b=0;b<cat[a][2].length;b++){
					tempDIV+="<tr id=\"level2_"+a+"_"+b+"\"><td class=\"level2td\" onMouseOver=\"DropDownHover2('level2_"+a+"_"+b+"');\" onMouseOut=\"DropDownOut2('level2_"+a+"_"+b+"');\" onClick=\"location.href='product_detail.php?id="+cat[a][2][b][0]+"';\"><img src=\"images/dropdown_arrow.gif\" style=\"margin-right:4px; margin-bottom:1px;\" />"+cat[a][2][b][1]+"</td></tr>";
				}
				tempDIV+="</table>";
				tempDIV+="</td><td class=\"shadow\" width=\"4\" style=\"background:url(images/vshadow.gif); background-repeat:repeat-x;\">&nbsp;</td></tr>";//for shadow level 2
				tempDIV+="<tr><td class=\"shadow\" colspan=\"2\" style=\"height:4px; background:url(images/hshadow.gif); background-repeat:repeat-y;\"><img src=\"images/whitegear_2000.gif\" /></td></tr></table>";//for shadow level 2
				tempDIV+="</div>";//div level 2
				tempDIV+="</td></tr>";
			}
			tempDIV+="</table>";
			tempDIV+="</td><td class=\"shadow\" width=\"4\" style=\"background:url(images/vshadow.gif); background-repeat:repeat-x;\">&nbsp;</td></tr>";//for shadow level 1
			tempDIV+="<tr><td class=\"shadow\" colspan=\"2\" style=\"height:4px; background:url(images/hshadow.gif); background-repeat:repeat-y;\"><img src=\"images/whitegear_2000.gif\" /></td></tr></table>";//for shadow level 1
			document.getElementById("dropdownmenu").innerHTML=tempDIV;
			dropdownready=true;
		}
	}
	function LoadActions(){
		document.getElementById(hovered).style.backgroundColor="#FFD200";
		GenerateMenu();
		ClearFlash();
	}
