function performOnload() {
   externalLinks();
   bookmarkLink();
}

function externalLinks() {
   if (!document.getElementsByTagName) return;
   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.target = "_blank";
      }
   }
}

function onhover(navid) {
   var anchors = document.getElementsByTagName("div");
   for (var i=0; i<anchors.length; i++) {
      var anchor = anchors[i];
      if (anchor.getAttribute("id")) {
         var divid = anchor.getAttribute("id");
         if ( divid == "nav0" || divid == "nav1" || divid == "nav2" || divid == "nav3" || divid == "nav4" || divid == "nav5" )  { 
            if (divid == "nav" + navid) { 
               setstyle (anchor, divid, "secnavshow")
            } else {
               setstyle (anchor, divid, "secnavhide");
            }
         }
      }
   }
}

function setstyle (anchor, divid, style) {
   var browser = navigator.appName;
   if (browser == "Microsoft Internet Explorer") {
      anchor.setAttribute("className", style);
   } else {
      anchor.setAttribute("class", style);
   }
}

function bookmarkstats () {
   window.open('bookmark?url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title), 
      'bookmarkWindow', 'scrollbars=0, location=1, status=1, width=600, height=500, left=200, top=100, screenX=200, screenY=100');
}

function bookmarkLink() {
   if (!document.getElementsByTagName) return;
   var anchors = document.getElementsByTagName("a");
   for (var i=0; i<anchors.length; i++) {
      var anchor = anchors[i];
      if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "bookmark") {
         anchor.removeAttribute("href");
         anchor.setAttribute("onclick","bookmarkstats()");
      }
   }
}

