

function lib_bwcheck(){ //Browsercheck (needed)
	this.ver = navigator.appVersion; this.agent = navigator.userAgent
	this.dom = document.getElementById?1:0
	this.rev = "";
	this.ie5 = (this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie6 = (this.ver.indexOf("MSIE 6")>-1 && this.dom)?1:0;
	this.ie4 = (document.all && !this.dom)?1:0;
	this.ie = this.ie4||this.ie5||this.ie6
	this.mac = this.agent.indexOf("Mac")>-1
	this.op5 = this.agent.indexOf("Opera 5")>-1
	this.ns6 = (this.dom && parseInt(this.ver) >= 5) ?1:0;
	if (this.ns6) {
		if (this.agent.indexOf("Netscape") > -1) {
			// Netscape 6+
			this.mz = false;
			var ix = this.agent.indexOf("Netscape");
			this.rev = this.agent.substr(this.agent.indexOf("/",ix) + 1);
			var ix = this.rev.indexOf(" ");
			if (ix > 0) this.rev = this.rev.substr(0,ix);
			this.ns60 = (this.rev.substr(0,3) == "6.0");
			this.ns6x = (this.rev.substr(0,2) == "6.");
			this.ns70 = (this.rev.substr(0,3) == "7.0");
		} else {
			// Mozilla
			this.mz = true;
			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);
			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");
		}
	}
	else this.ns60 = this.ns6x = this.ns70 = this.mz = false;
	this.ns4 = (document.layers && !this.dom)?1:0;
	if (this.ns4) {
		var ix = this.agent.indexOf("Mozilla/") + 8;
		this.rev = this.agent.substr(ix);
		var ix = this.rev.indexOf(" ");
		if (ix > 0) this.rev = this.rev.substr(0,ix);
	}
	this.bw = (this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5 || this.dom)
	return this
}


