var SubMenuHideDelay=300;
var SubMenuHider=new Array();
var PreviousSubMenuID=null;

// Show the sub-menu for the given menu item, if it exists
function ShowSubMenu(MenuID){
	if (SubMenuHider[MenuID]!=null){
		clearTimeout(SubMenuHider[MenuID]);
	}

	MenuDiv=document.getElementById("SubMenu"+MenuID);
	if (MenuDiv!=null){
		MenuDiv.style.visibility="visible";
	}

	PreviousSubMenuID=MenuID;
}

// Hide the sub-menu for the given menu item, if it exists
function HideSubMenu(MenuID){
	MenuDiv=document.getElementById("SubMenu"+MenuID);
	if (MenuDiv!=null){
		MenuDiv.style.visibility="hidden";
	}

	PreviousSubMenuID=null;
}

// Hide the sub-menu for the given menu item, if it exists
function LeaveSubMenu(MenuID){
	if (SubMenuHider[MenuID]!=null){
		clearTimeout(SubMenuHider[MenuID]);
	}
	SubMenuHider[MenuID]=setTimeout("HideSubMenu("+MenuID+");", SubMenuHideDelay);
}