	
	var disp_visible = 'block';
	var disp_hidden = 'none';
	var menu_visible = '';
	
	function MenuShow(m)
	{
		var div = document.getElementById(m);
		if (div)
		{
			div.refCount = 0;
			div.style.display = disp_visible;
			if (menu_visible != m && menu_visible != '')
			{
				MenuHide(menu_visible);
			}
			menu_visible = m;
			MenuEnter(m);
		}
	}
	
	function MenuEnter(m)
	{
		var div = document.getElementById(m);
		if (div)
		{
			if (div.style.display == disp_visible)
				div.refCount++;
		}
	}
	
	function MenuExit(m)
	{
		var div = document.getElementById(m);
		if (div)
		{
			if (div.style.display == disp_visible)
			{
				div.refCount--;
				if (div.refCount <= 0)
					setTimeout('MenuHide(\'' + m + '\');', 150);
			}
		}
	}
	
	function MenuHide(m)
	{
		var div = document.getElementById(m);
		if (div)
		{
			if (div.refCount <= 0)
			{
				div.style.display = disp_hidden;
				div.refCount = 0;
				
				if (menu_visible == m)
					menu_visible = '';
			}
		}
	}
