init = function() {
  if (document.getElementById) {
    // main menu
    var menu = document.getElementById("menu");
    if (window.curTopicL1 && menu && menu.getElementsByTagName("UL")[0]) {
      var rootlist = menu.getElementsByTagName("UL")[0];
      for (i=0, m=rootlist.childNodes.length; i<m; i++) {
        var node1 = rootlist.childNodes[i];
        if (node1.nodeName=="LI" && node1.id==curTopicL1) {
            node1.className = "level1sel";
            var ul2 = node1.getElementsByTagName("UL")[0];
            if (ul2) { ul2.className=""; }
            if (curTopicL2 && ul2) {
              for (j=0, n=ul2.childNodes.length; j<n; j++) {
                var node2 = ul2.childNodes[j];
                if (node2.nodeName=="LI" && node2.id==curTopicL2) {
                  node2.className = "level2sel";
                  if (node2.getElementsByTagName("UL")[0]) { node2.getElementsByTagName("UL")[0].className=""; }
                }
              }
            }
        }
      }
    }
    // prior menu
    var menu2 = document.getElementById("header");
    if (window.project && menu2 && menu2.getElementsByTagName("UL")[0]) {
      rootlist = menu2.getElementsByTagName("UL")[0];
      for (i=0, m=rootlist.childNodes.length; i<m; i++) {
        node1 = rootlist.childNodes[i];
        if (node1.nodeName=="LI" && node1.id==project) {
          node1.className = "current";
        }
      }
    }
  }
}
window.onload=init;
//addEvent(window, 'load', init, false);
