	
	var timershow=Array();
	var timerhide=Array();
	//var rightside=810;
	var current="";

	function menushow(name)
	{
	  clearTimeout(timerhide[name]);
	  timershow[name]=setTimeout(function() { bg_menushow(name);},1);
	}

	function menuhide(name)
	{
	  timerhide[name]=setTimeout(function() { bg_menuhide(name);},100);
	}

	function bg_menushow(name)
	{	  
	  if(current!=name && current!="")
		  bg_menuhide(current);
	  current=name;		
	  m=document.getElementById(name);
	  //m.style.width='';
	  
	  m.style.display="block";
	  m.style.zIndex="1000";
	  
	  /*mpos=findPos(m);

	  ch=windowSize();
	  s=getScrollXY();  

	  //alert(mpos[1]+":"+s[1]+":"+m.clientHeight+":"+ch[1]);
	  //536:0:284:617
	  if((mpos[1]-s[1])+m.clientHeight>ch[1])
	  {    
		a=((mpos[1]-s[1])+m.clientHeight)-ch[1];
		//alert(a);
	    repos=mpos[1]-a-12;
		//repos=ch[1]-((mpos[1]-s[1])+m.clientHeight);
	    m.style.top=repos+"px";
	  }
	  */
	  
	}

	function bg_menuhide(name)
	{
	  m=document.getElementById(name);
	  m.style.display="none";
	  m.style.zIndex="0";
	  //m.style.top="auto";
	  //m.style.left="-1000px";
	  current="";
	}
