
//
// 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 = "?";
  
  }

//
// rollover functions //
//

function doMouseOver(theImage) {
	if (document.images) { document[theImage].src = eval(theImage + "_on.src"); }
	}

function doMouseOut(theImage) {
	if (document.images) { document[theImage].src = eval(theImage + "_off.src"); }
	}

//
// 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 addOnload(func){
	if(document.getElementById&&(window.addEventListener||window.attachEvent)){
		var prev=window.onload;
		if(typeof window.onload!='function'){
			window.onload=func;
			}
		else{
			window.onload=function(){prev();func();}
			}
		}
	}


function getById(){
	var elements=new Array();
	for(var counter=0;counter<arguments.length;counter++){
		var arg=arguments[counter];
		if(typeof arg=='string')arg=document.getElementById(arg);
		if(arguments.length==1)return arg;
		elements.push(arg);
		}
	return elements;
	}

//
//
//

