var openDivID=-1;
var closeId=0;
var navRoot;
var startList = function(){
        if (document.getElementById("head")) {
                navRoot = document.getElementById("head");
                 var node;
                for (var i=0; i<navRoot.childNodes.length; i++) {
                        node = navRoot.childNodes[i];
                        if (node.nodeName=="DIV") {
                                 node.setAttribute("num", i);
                                node.onmouseover=function(){openDiv(this);};
                                node.onmouseout=function() {closeRelay(this.getAttribute("num"));};
                        }
                }
        }
};
function openDiv(obj){
        window.clearInterval(closeId);
         var i=obj.getAttribute("num");
         if(openDivID!=i){
                 if(openDivID>=0)closeDiv(navRoot.childNodes[openDivID]);
                 navRoot.childNodes[i].className+=" over";
                 openDivID=i;
         }
};
function closeDiv(obj){
        obj.className="";
         openDivID=-1;
};
function closeRelay(id){
        closeId=window.setTimeout(function(){closeDiv(navRoot.childNodes[id])}, 100);
};
window.onload=startList;