var currentMenuId = 'navHome';
function startList(elem) {
//if (document.all&&document.getElementById) {
if (document.getElementById) {
  navRoot = document.getElementById(elem);
  for (i=0; i<navRoot.childNodes.length; i++) {
    node = navRoot.childNodes[i];
    if (node.nodeName=="LI") {
    node.onmouseover = function() {
      document.getElementById(currentMenuId).className="";
      if(this.className != "navCurrent") {
        this.className+=" navOver";
        this.className+=" navCurrent";
        currentMenuId = this.id;
      }
    }
    node.onmouseout = function() {
      document.getElementById(currentMenuId).className += "navCurrent";
    }
   }
  }
 }
}

function getCurrentMenuId() {
if (document.getElementById) {
  if(document.getElementById("navCont")) {
    navRoot = document.getElementById("navCont");
    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI") {
        if (node.id.indexOf("navCurrent") > -1) {
          currentMenuId = node.id;
        }
      }
    }
    return currentMenuId;
    }
  }
}

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(getCurrentMenuId);
addLoadEvent(function() {
  startList('navCont');
});
