<!--
totalLay = 10;
menuid = 0;
currSub = 0;
timerId = 0;

function menuHandler(menunum, showflag) {
  if (showflag != 0) { //show menu
	  clearTimeout(timerId);
		showMenu(menunum, showflag)
	}
	else { //hide menu after a few sec
    timerId = setTimeout("showMenu(0, 0)", 500);
	}
}

function showMenu(menunum, showflag) {
	menuid = menunum;
	if (!showflag) {
		if (!menunum) { // hide all if menunum = 0
			for (i=1; i<=totalLay; i++) {
			  	otherLay = document.getElementById("menuLay" + i);
					if (otherLay) otherLay.style.visibility = "hidden";
	  	}
		}
		else { // hide just the specified menu
		 	otherLay = document.getElementById("menuLay" + menunum);
			if (otherLay) otherLay.style.visibility = "hidden";
		}
	}
	if (showflag != 0) { // show the appropriate menu
  	tempLay = document.getElementById("menuLay" + menunum);
		tempLay.style.visibility = "visible";
	}
}

function clearSub(newsub) {
	if(currSub)
		showMenu(currSub, 0);
	currSub = newsub;
}
//-->