
/* $Id: detect.js 593 2004-01-17 10:18:29Z yu $ */

// Object for checking browser environment.


function BrowserCheck(){
	var b = navigator.appName;
	if (b == "Netscape") this.b = "NN";
	else if (b == "Microsoft Internet Explorer") this.b = "IE";
	else this.b = b;
	this.version = navigator.appVersion;
	this.vSub = navigator.vendorSub;
	this.userAgent = navigator.userAgent;
	this.appVersion = navigator.appVersion;
	this.v = parseInt(this.version);
	this.vs = parseFloat(this.vSub);

	this.NN = (this.b == "NN");
	this.NN3 = (this.b == "NN" && this.v == 3);
	this.NN4 = (this.b == "NN" && this.v == 4);
	this.NN6x = (this.b == "NN" && this.v == 5 && this.vs >= 6.01);
	this.NN6 = (this.b == "NN" && this.v == 5);
	this.NN7 = (this.b == "NN" && this.v == 5 && this.vs >= 7);

	this.IE = (this.b == "IE");
	this.IE3 = (this.userAgent.indexOf('MSIE 3')>0);
	this.IE45 = (this.userAgent.indexOf('MSIE 4.5')>0);
	this.IE401 = (this.userAgent.indexOf('MSIE 4.01')>0);
	this.IE4 = (this.userAgent.indexOf('MSIE 4')>0);
	this.IE51 = (this.userAgent.indexOf('MSIE 5.1')>0);
	this.IE512 = (this.userAgent.indexOf('MSIE 5.12')>0);
	this.IE514 = (this.userAgent.indexOf('MSIE 5.14')>0);
	this.IE52 = (this.userAgent.indexOf('MSIE 5.2')>0);
	this.IE5 = (this.userAgent.indexOf('MSIE 5')>0);
	this.IE6 = (this.userAgent.indexOf('MSIE 6')>0);

	this.Safari = (this.userAgent.indexOf('Safari')>0);
	this.Opera = (this.userAgent.indexOf('Opera')>0);

	this.Win = (this.userAgent.indexOf('Win',0) != -1);
	this.Mac = (this.userAgent.indexOf('Mac',0) != -1);
	this.MacOSX = (this.userAgent.indexOf('Mac OS X',0) != -1);
	if(this.IE512 || this.IE52){
		this.MacOSX=true;
	}
	else if(this.IE514){
		if (navigator.plugins) {
			for (i=0; i < navigator.plugins.length; i++ ) {
				if (navigator.plugins[i].name.indexOf('QuickTime') >= 0 && navigator.plugins[i].filename.indexOf('.plugin')!=-1){
					this.MacOSX=true;
				}
			}
		}
	}
	this.Unix = (this.appVersion.indexOf('X11',0) != -1);
}

var checkB = new BrowserCheck();