// -------------------------------------------------------------------------- \\
// WDSBrowser.js
// jsLibrary javascript file
// -------------------------------------------------------------------------- \\
//
// -------------------------------------------------------------------------- \\

// -------------------------------------------------------------------------- \\
// WDSBrowser
// -------------------------------------------------------------------------- \\
// Class WDSBrowser ... constructor
// -------------------------------------------------------------------------- \\
function WDSBrowser () {
	var agent  = navigator.userAgent.toLowerCase();
	
	// attributes
	this.major = parseInt(navigator.appVersion);
	this.mac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
	this.minor = parseFloat(navigator.appVersion);
	this.ns    = ((agent.indexOf('mozilla') != -1) && 
		((agent.indexOf('spoofer')  ==   -1) && (agent.indexOf('compatible') == -1)));
	this.ns4   = (this.ns && (this.major == 4));
	this.ns6   = (this.ns && (this.major >= 5));
	this.opera = (agent.indexOf("opera") != -1);
	this.ie    = (agent.indexOf("msie") != -1);
	this.ie3   = (this.ie && (this.major  < 4));
	this.ie4   = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") == -1));
	this.ie5   = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") != -1));
	this.ie55  = (this.ie && (this.major == 4) && (agent.indexOf("msie 5.5") != -1));
	this.ie6  = (this.ie && (agent.indexOf("msie 6.0")!=-1) );
	this.NG = (this.ns && (this.major >= 5)) || (this.ie && (this.major == 4) && (agent.indexOf("msie 5.0") != -1)) || (this.ie && (this.major == 4) && (agent.indexOf("msie 5.5") != -1)) || (this.ie && (agent.indexOf("msie 6.0")!=-1) )
}

// set as a singleton
var WDSBrowser = new WDSBrowser();

// -------------------------------------------------------------------------- \\
// Overriding getElementById
// -------------------------------------------------------------------------- \\
if (document.all && !document.getElementById) {
	document.getElementById = function(id) { return(document.all(id)); }
	document.getElementsByTagName= function(id) { return(document.all.tags(id)); }
}
if (document.layers) {
	document.getElementById = function(id) { return(document.layers[id]); }
}

