/* Damian Gajda 1999. Based on Eric Krock code.
   Permission granted to reuse and distribute.
*/

function checkIE(inputData){
if (inputData == '4'){
	var re = /.*(MSIE 4\.).*/;
}
if (inputData == '5'){
	var re = /.*(MSIE 5\.0).*/;
}
	re.exec(navigator.userAgent);
	var ver = RegExp.$1;
	if (ver == "") {
		return false;
	} else {
		return true;
	}
}

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.nav4up = this.nav && (this.major >= 4);
	this.navonly = this.nav && (this.major < 5);

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

	this.ie     = (agt.indexOf("msie") != -1);
	this.ie4	= this.ie && (checkIE('4') == true);
	this.ie4and5= this.ie && (checkIE('4') == true || checkIE('5') == true);
	this.ie4up  = this.ie  && (this.major >= 4);

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

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

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