var currentMenu = null;
var timeout = null;

function ShowSubMenu(menu)
{		
	CancelHideMenu(menu);
	if (currentMenu != null && currentMenu != menu)
	{		
		DoHideMenu(currentMenu);				
	}
	document.all["SubMenu" + menu].style.display = "block";
	currentMenu = menu;			
}

function HideSubMenu(menu)
{
	timeout = setTimeout("DoHideMenu(" + menu + ")", 150);							
}

function DoHideMenu(menu)
{
	document.all["SubMenu" + menu].style.display = "none";
	currentMenu = null;
}

function CancelHideMenu(menu)
{
	if (timeout != null)
		clearTimeout(timeout);
	timeout = null;
}


function OpenPopupWindow(href, name, options)
{
	var win = window.open(href, name, options);
	win.focus();
}
