
	var timershow=Array();
	var timerhide=Array();
	var rightside=780;

	function menushow(name)
	{
	  clearTimeout(timerhide[name]);
	  timershow[name]=setTimeout(function() { bg_menushow(name);},150);
	}

	function menuhide(name)
	{
	  timerhide[name]=setTimeout(function() { bg_menuhide(name);},500);
	}

	function bg_menushow(name)
	{
	  //menuobj=document.getElementById("menu");

	  m=document.getElementById(name);
	  m.style.width='';
	  //m.parentNode.offsetLeft;

	  m.style.display="block";
	  m.style.zIndex="1000";
	  
	  if(m.parentNode.offsetLeft+m.clientWidth>rightside)
		  m.style.left=rightside-m.clientWidth+"px";
	  
	}

	function bg_menuhide(name)
	{
	  m=document.getElementById(name);
	  m.style.display="none";
	  m.style.zIndex="0";
	}
