// browser sniffer
function Is () {
	// convert all characters to lowercase to simplify testing
	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) && (agt.indexOf('opera')==-1)
				   && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
	this.nav4    = ( this.nav && (this.major == 4) );
	this.nav4up  = (this.nav && (this.major >= 4));
	this.navonly = (this.nav && ((agt.indexOf(";nav") != -1) 
				   || (agt.indexOf("; nav") != -1)) );
	this.nav6    = (this.nav && (this.major == 5));
	this.nav6up  = (this.nav && (this.major >= 5));
	this.gecko   = (agt.indexOf('gecko') != -1);
	this.ie      = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	this.ie3     = (this.ie && (this.major < 4));
	this.ie4     = (this.ie && (this.major == 4) && (agt.indexOf("msie 5")==-1)
				   && (agt.indexOf("msie 6")==-1));
	this.ie4up   = (this.ie  && (this.major >= 4));
	this.ie5     = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0")!=-1) );
	this.ie5_5   = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.5") !=-1));
	this.ie6     = (this.ie && (this.major == 6) && (agt.indexOf("msie 6.0") != -1));
	this.ie5up   = (this.ie  && !this.ie3 && !this.ie4 && !this.ie6);
	this.ie5_5up = (this.ie && !this.ie3 && !this.ie4 && !this.ie5);
	this.ie6up   = (this.ie && !this.ie3 && !this.ie4 && !this.ie5 && !this.ie5_5);
	this.safari  = (agt.indexOf("safari") != -1);
	this.opera   = (agt.indexOf('opera') != -1);
	this.ie7 = (this.ie && (this.major == 4) && (agt.indexOf("msie 7.") != -1) );
	this.ie7up = (this.ie6up && !this.ie6);
	this.win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
	this.win95 = ((agt.indexOf("win95")!=-1) || (agt.indexOf("windows 95")!=-1));
	this.win16 = ((agt.indexOf("win16")!=-1) 
				 || (agt.indexOf("16bit")!=-1) || (agt.indexOf("windows 3.1")!=-1) 
				 || (agt.indexOf("windows 16-bit")!=-1) );
	this.win31 = ((agt.indexOf("windows 3.1")!=-1) || (agt.indexOf("win16")!=-1) 
				 || (agt.indexOf("windows 16-bit")!=-1));
	this.win98 = ((agt.indexOf("win98")!=-1) || (agt.indexOf("windows 98")!=-1));
	this.winnt = ((agt.indexOf("winnt")!=-1) || (agt.indexOf("windows nt")!=-1));
	this.win32 = (this.win95 || this.winnt || this.win98 
				 || ((this.major >= 4) && (navigator.platform == "Win32")) 
				 || (agt.indexOf("win32")!=-1) || (agt.indexOf("32bit")!=-1));
	this.winme = ((agt.indexOf("win 9x 4.90")!=-1));
	this.win2k = ((agt.indexOf("windows nt 5.0")!=-1));
	this.mac    = (agt.indexOf("mac")!=-1);
	this.mac68k = (this.mac && ((agt.indexOf("68k")!=-1) 
				  || (agt.indexOf("68000")!=-1)));
	this.macppc = (this.mac && ((agt.indexOf("ppc")!=-1) 
				  || (agt.indexOf("powerpc")!=-1)));
}

var is;
is = new Is();

// Opera check
var opAgt=navigator.userAgent.toLowerCase();
var is_opera = (opAgt.indexOf("opera") != -1);

