function visit(newURL) {
  if (newURL != "") {
    location.href=newURL
  }
}

var bo_ns_id = 0;

function startIeFix(){
  if(isIE()){
    document.write('<div id="bo_ns_id_' + bo_ns_id + '"><!-- ');
  }
}

function endIeFix(){
  if(isIE()){
    document.write('</div>');
    var theObject = document.getElementById("bo_ns_id_" + bo_ns_id++);
    var theCode = theObject.innerHTML;
    theCode = theCode.substring(4 ,9+theCode.indexOf("</object>"))
    document.write(theCode);
  }
}

function isIE(){
  // only for Win IE 6+
  // But not in Windows 98, Me, NT 4.0, 2000
  var strBrwsr= navigator.userAgent.toLowerCase();
  if(strBrwsr.indexOf("msie") > -1 && strBrwsr.indexOf("mac") < 0){
    if(parseInt(strBrwsr.charAt(strBrwsr.indexOf("msie")+5)) < 6){
      return false;
    }
    if(strBrwsr.indexOf("win98") > -1 ||
       strBrwsr.indexOf("win 9x 4.90") > -1 ||
       strBrwsr.indexOf("winnt4.0") > -1 ||
       strBrwsr.indexOf("windows nt 5.0") > -1)
    {
      return false;
    }
    return true;
  }else{
    return false;
  }
}

  function closeWindow()
  {
    if(tutorialWindow!=null&&tutorialWindow.closed==false)
    tutorialWindow.close()
  }

  NS = (document.layers)?1:0;
  IE = (document.all)?1:0;
  var tutorialWindow=null
function getWindow(me) {
  if(tutorialWindow==null||tutorialWindow.closed==true) {
    tutorialWindow=window.open(me,'test','scrollbars=yes,resizable=yes,screenY=20,screenX=20,status=no,width=650,height=500')
    if(IE)tutorialWindow.moveTo(10,10)
  }	else {
    tutorialWindow.location=me
    setTimeout("tutorialWindow.focus()",500)
  }
}

function submitonce(theform){
//if IE 4+ or NS 6+
if (document.all||document.getElementById){
//screen thru every element in the form, and hunt down "submit" and "reset"
for (i=0;i<theform.length;i++){
var tempobj=theform.elements[i]
if(tempobj.type.toLowerCase()=="submit"||tempobj.type.toLowerCase()=="reset")
//disable em
tempobj.disabled=true
}
}
}

function areyousure(f) {
  if (confirm("You are about to delete something!")) {
    return true;
  } else {
    return false;
  }
}


setExternalLinks=function() {
    if ( !document.getElementsByTagName ) {
        return null;
    }
 
    var anchors = document.getElementsByTagName( "a" );
    for ( var i = 0; i < anchors.length; i++ ) {
        var anchor = anchors[i];
        if ( anchor.getAttribute( "href" ) && anchor.getAttribute( "rel" ) == "external" ) {
            anchor.setAttribute( "target", "_blank" );
        }
    }
}



nav_hover=function() {
  if (document.all&&document.getElementById) {
    if (document.getElementById("hmenuroot")) {
      navRoot = document.getElementById("hmenuroot");
      for (i=0; i<navRoot.childNodes.length; i++) {
        node = navRoot.childNodes[i];
        if (node.nodeName=="LI") {
          node.onmouseover=function() {
            this.className+=" over";
          }
          node.onmouseout=function() {
            this.className=this.className.replace(" over", "");
          }
        }
      }
    }
  }
}

if (document.all&&window.attachEvent) { // IE-Win
    window.attachEvent("onload", nav_hover);
    window.attachEvent("onload", setExternalLinks);
} else if (window.addEventListener) { // Others
    window.addEventListener("load",setExternalLinks,false);
}

// JavaScript Document

startList = function() {
  if (document.all&&document.getElementById) {
    navRoot = document.getElementById("nav");
    for (i=0; i<navRoot.childNodes.length; i++) {
      node = navRoot.childNodes[i];
      if (node.nodeName=="LI") {
        node.onmouseover=function() {
          this.className+=" over";
        }
        node.onmouseout=function() {
          this.className=this.className.replace(" over", "");
        }
      }
    }
  }
}
window.onload=startList;