function addOverHandlers(root) {
  if (!root) return;
  for (var i = 0; i < root.childNodes.length; i++) {
    var node = root.childNodes[i];
    if (node.nodeName == "LI") {
      node.onmouseover = function() {
        this.className += " over";
      }
      node.onmouseout = function() {
        this.className = this.className.replace(" over", "");
      }
      node = node.getElementsByTagName("UL")[0];      
      if (node) {
        addOverHandlers(node);
      }
    }
  }
}

window.onload = function() {
  if (document.all && document.getElementById) {
    addOverHandlers(document.getElementById("m1"));
  }
}
