

//

// browser object //

//

  

// browser object (browserObj) constructor //

function browserObj() {



  // detect browser //

  this.browser = "";

  this.nn = false;

  this.ie = false;

  if (navigator.appName == "Netscape") {

    this.browser = "nn";

    this.nn = true;

    }

  else if (navigator.appName == "Microsoft Internet Explorer") {

    this.browser = "ie";

    this.ie = true;

    }

  else this.browser = "?";

  

  // detect versions //

  this.html = navigator.appVersion.substring(0,1);

  this.version = navigator.appVersion;

  

  // detect platform //

  this.platform = "";

  this.win = false;

  this.mac = false;

  if (navigator.userAgent.indexOf("Win") != -1) {

    this.platform = "win";

    this.win = true;

    }

  else if (navigator.userAgent.indexOf("Mac") != -1) {

    this.platform = "mac";

    this.mac = true;

    }

  else this.platform = "?";

  

  }



//

// ie selection fix //

//

  

function doIESelectionFix() {

  

  if (navigator.appName == "Microsoft Internet Explorer") {

    // defaults the onClick and onDrag events for anchors to blur in IE //

    for (theCounter = 0; theCounter < document.links.length; theCounter++) {

      document.links[theCounter].onclick = function() { if (navigator.appName == "Microsoft Internet Explorer") { this.blur(); } };

      document.links[theCounter].ondrag = function() { if (navigator.appName == "Microsoft Internet Explorer") { this.blur(); } };

      }

    }

  }



//

// netscape resize fix //

//



function WM_netscapeCssFix() {

  /*

    Source: Webmonkey Code Library

    (http://www.hotwired.com/webmonkey/javascript/code_library/)



    Author: Taylor

    Author Email: taylor@wired.com

    Author URL: http://www.taylor.org/

    */



  // This part was inspired by Matthew_Baird@wayfarer.com

  // It gets around another unfortunate bug whereby Netscape 

  // fires a resize event when the scrollbars pop up. This 

  // checks to make sure that the window's available size 

  // has actually changed.

  if (document.WM.WM_netscapeCssFix.initWindowWidth != window.innerWidth || document.WM.WM_netscapeCssFix.initWindowHeight != window.innerHeight) {

    document.location = document.location;

  }

}



function doNetscapeCssFix() {

  // This function checks to make sure the version of Netscape 

  // in use contains the bug; if so, it records the window's 

  // width and height and sets all resize events to be handled 

  // by the WM_netscapeCssFix() function.

  if ((navigator.appName == 'Netscape') && (parseInt(navigator.appVersion) == 4)) {

    if (typeof document.WM == 'undefined'){

      document.WM = new Object;

    }

    if (typeof document.WM.WM_scaleFont == 'undefined') {

      document.WM.WM_netscapeCssFix = new Object;

      document.WM.WM_netscapeCssFix.initWindowWidth = window.innerWidth;

      document.WM.WM_netscapeCssFix.initWindowHeight = window.innerHeight;

    }

    window.onresize = WM_netscapeCssFix;

  }

}



//

//

//



function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      oldonload();
      func();
    }
  }
}

function highlightPage() {
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i<links.length; i++) {
    var linkurl = links[i].getAttribute("href");
    var currenturl = window.location.href;
    if (currenturl.indexOf(linkurl) != -1) {
      links[i].className = "active";
    }
  }
}

addLoadEvent(highlightPage);