  function sub_set() {
    if (sub_active != "") {
      document.getElementById(sub_active).className = "page-active"
    }
  }

  function newWindow(file,name,NWwidth,NWheight,center,otherSet) {
    var over = false;
    var position = "";          
    sHeight = screen.height;
    sWidth = screen.width;

    if (NWheight > (sHeight - 25)) {
      NWheight = sHeight - 55;
      NWwidth = NWwidth + 20;
      over = true;
    }
    if (NWwidth > sWidth) {
      NWwidth = sWidth - 10;
      NWheight = NWheight + 20;
      over = true;
    }
    if (center == "yes") {
      LeftPos = (sWidth > 0) ? ((sWidth-NWwidth)/2) : 0;
      TopPos = (sHeight > 0) ? ((sHeight-NWheight)/2) : 0;
      position = ',top='+TopPos+',left='+LeftPos ;
    }
    if ((over) && !(otherSet.indexOf("scrollbars"))) {
      otherSet = otherSet + ",scrollbars";
    }
    settings = 'width='+NWwidth+',height='+NWheight + position + otherSet;
    if (name == "") {
      name = "unnamed";
    }
    window.open(file,name,settings);
  }
