///////////////////////////////////////////////////////////////////////////////
// Class:				Browser
// 
// Description:	This class is an abstraction of the client's browser.
//
// Created:			05/23/01 Shawn Mckee, Getronics
///////////////////////////////////////////////////////////////////////////////
function Browser() {
	// Determine the browser's shortname.
	if (navigator.appName == "Netscape") this.shortName = "ns";
	else if (navigator.appName == "Microsoft Internet Explorer") this.shortName = "ie";
	else this.shortName = navigator.appName;

	// Get the browser version number.
	if (this.shortName == "ns") this.versionNumber = parseFloat(navigator.appVersion);
	if (this.shortName == "ie") {
		var IEOffset = navigator.userAgent.indexOf("MSIE ");
		this.versionNumber = parseFloat(navigator.userAgent.substring(IEOffset + 5, navigator.userAgent.indexOf(";", IEOffset)));		
	}
	
	// Set flags indicating which browser is being used.
	this.isNS = (this.shortName == "ns" && this.versionNumber >= 4);
	this.isNS4 = (this.shortName == "ns" && (Math.floor(this.versionNumber) == 4));
	this.isNS6 = (navigator.userAgent.indexOf("Netscape6"));
	this.isIE = (this.shortName == "ie" && this.versionNumber >= 4);
	this.isIE4 = (navigator.userAgent.indexOf("MSIE 4") > 0);
	this.isIE5 = (navigator.userAgent.indexOf("MSIE 5") > 0);
	this.isIE55 = (navigator.userAgent.indexOf("MSIE 5.5") > 0);	
}
var browser = new Browser();

