// --------------------------------------------------------------------------------
// --                                                         c2004 Dane Summers --
// --------------------------------------------------------------------------------

/* Retrieve information about the browser. 
 * Different browsers support different features; this class
 * will help us with information along those lines.
 */
function Browser() {
	this.version = navigator.appVersion;
	this.agent = navigator.userAgent;
	this.supportsDOM = document.getElementById?1:0;
	this.isOpera5=this.agent.indexOf("Opera 5") > -1;
	this.isIE4=(document.all && !this.supportsDOM && !this.isOpera5) ? 1:0;
	this.isIE5=(this.version.indexOf("MSIE 5") > -1 && this.supportsDOM && !this.isOpera5) ? 1:0; 
	this.isIE6=(this.version.indexOf("MSIE 6") > -1 && this.supportsDOM && !this.isOpera5) ? 1:0;
	this.isIE=(this.isIE4||this.isIE5||this.isIE6);
	this.isMac=this.agent.indexOf("Mac") > -1;
	this.isNS6=(this.supportsDOM && parseInt(this.version) >= 5) ? 1:0; 
	this.isNS4=(document.layers && !this.supportsDOM) ? 1:0;
	this.isNS=(this.isNS4||this.isNS6);
	this.isBW=(this.isIE6 || this.isIE5 || this.isIE4 || this.isNS4 || this.isNS6 || this.isOpera5);

	// TODO detect whether the browser has Java Webstart installed.
	if (this.isIE) {
	}
	if (this.agent.indexOf("Gecko") > -1){
	}
	if (this.isNS) {
	}

	return this;
}

var browserInfo = new Browser(); // Create an object of the browserInfo for other methods to use...
