  function hideall() {
    toggle("m1","none");
    toggle("m2","none");
    toggle("m3","none");
    toggle("m4","none");
    toggle("m5","none");
    toggle("m6","none");
  }

  function toggle(name, flag){
    var x = document.getElementById(name);
    if (x != null){
      x.style.display = flag;
    }

    var cn = "menu";
    if (flag == "block")
      cn = "menusel";

    x = document.getElementById("m"+name);
    if (x != null){
      x.className = cn;
    }

    cn = "ma";
    if (flag == "block")
      cn = "masel";
    x = document.getElementById("a"+name);
    if (x != null){
      x.className = cn;
    }
  }

 function toggleit(name, flag){
    var x = document.getElementById(name);
    if (x == null)
      return;
      
    if (x.getAttribute("save") == null){
      x.style.display = flag;
      return;
    } 
    
    if (x.getAttribute("save") != "Y"){
      x.style.display = flag;
    }
 }

 function saveit(name){
    var x = document.getElementById(name);
    if (x == null)
      return;

    if (x.getAttribute("save") == null){
      x.setAttribute("save","Y");
      return;
    }
    
    if (x.getAttribute("save") == "Y") {
      x.setAttribute("save","N");
    } else {
      x.setAttribute("save","Y");
    }
  }

  function actsub() {
    toggle("submenu","block");
    var x = document.location.hash;
    if (x == null) return;
    if (x.length < 4) return;
    if (x.substring(1,3) != 'go') return;
    hideall();
    toggle(x.substring(3, x.length),'block');
  }
  
  function highlight(foo) {
    if (foo.className == "menuspec")
      foo.className = "menuhovspec";
    else
      foo.className = "menuhov";
    var nl = foo.getElementsByTagName("a");
    for(var i=0; i<nl.length; i++) {
      nl.item(i).className = "masel";
    }
  }

  function unhighlight(foo) {
    if (foo.className == "menuhovspec")
      foo.className = "menuspec";
    else
      foo.className = "menu";
    var nl = foo.getElementsByTagName("a");
    for(var i=0; i<nl.length; i++) {
      nl.item(i).className = "ma";
    }
  }

  function docell(foo) {
    var nl = foo.getElementsByTagName("a");
    for(var i=0; i<nl.length; i++) {
      if (nl.item(i).onclick != null) {
        nl.item(i).onclick();
      } else {
        document.location = nl.item(i).href;
      }
    }
  }
