

function lib_bwcheck() {
	this.ver = navigator.appVersion;
	this.agent = navigator.userAgent;
	this.dom = (document.getElementById) ? true : false;
	this.version = "";
	this.rev = "";
	var ix = this.ver.indexOf("MSIE ");
	if (ix > -1 && this.dom) {
		var endIx = this.ver.indexOf(";", ix);
		this.version = this.ver.substring(ix+5, endIx);
		var verMajor = parseInt(this.version);
		this.ie5x = (verMajor == 5);
		this.ie55 = (this.ver.substr(ix,3) == "5.5");
		this.ie6 = (verMajor >= 6);
		this.ie7 = (verMajor >= 7);
	}
	this.ie4x = (document.all && !this.dom);
	this.ie = (this.ie4x || this.ie5x || this.ie6);

	this.mac = (this.agent.indexOf("Mac") > -1);
	ix = this.ver.indexOf("Opera ");
	if (ix > -1) this.op5 = (parseInt(this.ver.substr(ix+6)) >= 5);

	this.ns6 = (this.dom && parseInt(this.ver) >= 5);
	if (this.ns6) {
		var endIx = this.agent.indexOf(") Gecko");
		var begIx = this.agent.lastIndexOf(" ", endIx) + 1;
		if (this.agent.substr(begIx,3) == "rv:") begIx += 3;
		this.rev = this.agent.substring(begIx,endIx);

		if (this.agent.indexOf("Netscape") > -1) {
			this.mz = false;
			ix = this.agent.indexOf("Netscape");
			this.version = this.agent.substr(this.agent.indexOf("/",ix) + 1);
			ix = this.version.indexOf(" ");
			if (ix > 0) this.version = this.version.substr(0,ix);
			var verMajor = parseInt(this.version);
			this.ns60 = (this.version.substr(0,3) == "6.0");
			this.ns6x = (this.version.substr(0,2) == "6.");
			this.ns70 = (this.version.substr(0,3) == "7.0");
			this.ns7 = (verMajor >= 7);
			this.ns8 = (verMajor >= 8);
		} else {
			this.mz = true;
			ix = this.agent.indexOf("Firefox");
			if (ix >= 0) {
				this.version = this.agent.substr(this.agent.indexOf("/",ix) + 1);
				ix = this.version.indexOf(" ");
				if (ix > 0) this.version = this.version.substr(0,ix);
			} else {
				this.version = "0";
			}
			this.ns60 = (this.rev.substr(0,3) == "0.6");
			this.ns6x = (this.rev.substr(0,2) == "0.");
			this.ns70 = (this.rev.substr(0,3) == "1.0" || this.rev.substr(0,3) == "1.1");
			this.ns7 = (parseInt(this.rev) >= 1);
		}
	}
	else this.ns60 = this.ns6x = this.ns70 = this.mz = false;
	this.ns4x = (document.layers && !this.dom);
	if (this.ns4x) {
		ix = this.agent.indexOf("Mozilla/") + 8;
		this.rev = this.agent.substr(ix);
		ix = this.rev.indexOf(" ");
		if (ix > 0) this.rev = this.rev.substr(0,ix);
		this.version = this.rev;
	}
	this.bw = (this.ie6 || this.ie5x || this.ie4x || this.ns4x || this.ns6 || this.op5 || this.dom);
	return this;
}

