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

function showMenu(id)
{
	initHide();
	
	if(id != menuId)
	clearTimeout(timerId);
	
	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 = '';
}
