var t=false,current;
function setupmenu() {
 if(!document.getElementsByTagName) return;
 its=document.getElementsByTagName("li");
  for(i=0;i<its.length;i++) {
 if(its[i].className!="menu") continue;
 thislink=findchild(its[i],"A");
thislink.onmouseover=showmenu;
thislink.onmouseout=startmenu;
if(ul=findchild(its[i],"UL")) {
 ul.style.display="none";

for(k=0;k<ul.childNodes.length;k++) {
 ul.childNodes[k].onmouseover=resetmenu;
 ul.childNodes[k].onmouseout=startmenu;
    }
  }
}
 }
function findchild(obj,tag) {
ck=obj.childNodes;
for(a=0;a<ck.length;a++) {
if (ck[a].nodeName==tag) return ck[a];
 }
  return false;
}

function showmenu(e) {
if(!e) var e=window.event;
thelink=(e.target) ? e.target : e.srcElement;
resetmenu();
if(current) hidemenu(current);
thelink=thelink.parentNode;
current=thelink;
ul=findchild(thelink,"UL");
if(!ul) return;
ul.style.display="block";
}

function hidemenu(thelink) {
ul=findchild(thelink,"UL");
if(!ul) return;
ul.style.display="none";
}

function resetmenu() {
if(t) window.clearTimeout(t);
}

function startmenu() {
t=window.setTimeout("hidemenu(current)",200);
}


