// JavaScript Document
var t=false, current;
function SetupMenu()
{
   if (!document.getElementsByTagName)
      return;
   items=document.getElementsByTageName("li");
   for (i=0; i<item.length; i++)
   {
      if(item[i].className!="menu")
         continue;
      thelink=findChild(item[i], "A");
      thelink.onmouseover=ShowMenu;
      thelink.onmouseout=StartTimer;
      
      if (ul=findChild(item[i], "UL"))
      {
         ul.style.display="none";
         for(j=0; j<ul.childNode.length; j++)
         {
            ul.childNode[i].onmouseover=ResetTimer;
            ul.childNode[j].onmouseout=StartTimer;
         }
      }   
   }   

}

function findChild(obj, tag)
{
  cn=obj.childNodes;
  for (k=0; k<cn.length; k++)
  {
     if (cn[k].nodeName==tag)
        return ch[k];
  }
  return false;
}

function ShowMenu(e)
{
  if (!e) var e=window.event;
     thislink=(e.target) ? e.target: e.srcElement;
  resetTimer();
 
  if (current) HideMenu (current);
     current=thislink;
  ul=findChild(thislink, "UL");
  if (!ul)
     return;
  ul.style.display="block";               
}

function HideMenu(thelinke)
{
   ul=findChild(thelink, "UL");
   if (!ul)
      return;
   ul.style.display="none";   
}

function ResetTimer()
}
  if (t) window.clearTimeout(t);
}

function StartTimer()
{
  t=window.setTimeout("HideMenu(current)",200);
}  

window.onload=SetupMenu;