/* Damian Gajda 1999. Based on Eric Krock code.
   Permission granted to reuse and distribute.
   $Id: browser.js,v 1.3 2002/09/20 11:34:28 olaf Exp $
*/

function browserVersion() {
	var agt = navigator.userAgent.toLowerCase();

	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);

	this.nav    = ((agt.indexOf('mozilla')!=-1) && ((agt.indexOf('spoofer')==-1) && (agt.indexOf('compatible') == -1)));
	this.nav4   = this.nav && (this.major == 4);
	this.nav4up = this.nav && (this.major >= 4);
	this.navonly = (this.nav && (agt.indexOf(";nav") != -1));

	this.gecko	= (agt.indexOf("gecko") != -1);

	this.ie         = (agt.indexOf("msie") != -1);
	this.ie4        = (agt.indexOf("msie 4.")!= -1);
	this.ie4up      = (this.ie && (this.major >= 4));
	this.ie5        = (agt.indexOf("msie 5.0")!= -1);
	this.ie5up      = (agt.indexOf("msie 5.")!= -1);
	this.ie55       = (agt.indexOf("msie 5.5")!= -1);
	this.ie6        = (agt.indexOf("msie 6.")!= -1);
	this.ie55up     = (this.ie55 || this.ie6);

	this.opera = (agt.indexOf("opera") != -1);

	this.ver4up = (this.ie4up || this.nav4up );
	}

var bv = new browserVersion();
var browser = bv;

