var menuId = '';
var timerId = '';

function showMenu(id)
{
	initHide();
	
	menuId = id;
	
	menuElem = document.getElementById('sm-'+id);
	
	if(menuElem)
	menuElem.style.display = 'block';
}

function hideMenu()
{
	timerId = setTimeout('initHide()', 200);
}

function initHide()
{
	if(menuId)
	{
		menuElem = document.getElementById('sm-'+menuId);
	
		if(menuElem)
		menuElem.style.display = 'none';
		
		menuId = '';
	}
}

function holdMenu()
{
	if(menuId && timerId)
	clearTimeout(timerId);
	
	timerId = '';
}

var subMenuId = '';
var subTimerId = '';

function showSubMenu(id)
{
	initHideSub();
	
	subMenuId = id;
	
	subMenuElem = document.getElementById('sm-'+id);
	
	if(subMenuElem)
	subMenuElem.style.display = 'block';
}

function hideSubMenu()
{
	subTimerId = setTimeout('initHideSub()', 200);
}

function initHideSub()
{
	if(subMenuId)
	{
		subMenuElem = document.getElementById('sm-'+subMenuId);
	
		if(subMenuElem)
		subMenuElem.style.display = 'none';
		
		subMenuId = '';
	}
}

function holdSubMenu()
{
	if(subMenuId && subTimerId)
	clearTimeout(subTimerId);
	
	subTimerId = '';
}




