var inmenu=false;
var lastmenu=0;
function Menu(current,IsResize) {
   if (!document.getElementById) return;
   inmenu=true;
   oldmenu=lastmenu;
   lastmenu=current;
   if (oldmenu) Erase(oldmenu);
   m=document.getElementById("menu-" + current);
   box=document.getElementById(current);
r= m.offsetLeft;
d=m.offsetTop+m.offsetHeight;
   while(m=m.offsetParent)
{
r+=m.offsetLeft; }
   
   m=document.getElementById("menu-" + current);
   while(m=m.offsetParent)d+=m.offsetTop;
   box.style.top= d   
   box.style.backgroundColor="#66cccc";
   box.style.left= r+"px";   
   if(IsResize)
   {
   box.style.width="140px";
   }else
   {
   box.style.width="200px";
   }
   
   document.getElementById(current).style.display='';
}

function Erase(current) {
   if (!document.getElementById) return;
   if (inmenu && lastmenu==current) {
     return;
   }
   m=document.getElementById("menu-" + current);
   box=document.getElementById(current);
  document.getElementById(current).style.display='none';

}


function Timeout(current) {
   inmenu=false;
   window.setTimeout("Erase('" + current + "')",600) ;
}

function Highlight(menu,item) {
   if (!document.getElementById) return;
   inmenu=true;
   lastmenu=menu;
   obj=document.getElementById(item);
 obj.style.backgroundColor="#006699"; 
}

function UnHighlight(menu,item) {
   if (!document.getElementById) return;
   Timeout(menu);
   obj=document.getElementById(item);
   obj.style.backgroundColor="#66cccc";  
}