is = new BrowserCheck();

function BrowserCheck() {
	var b = navigator.appName
	if (b=="Netscape") this.b = "ns"
	else if (b=="Microsoft Internet Explorer") this.b = "ie"
	else this.b = b
	this.version = navigator.appVersion
	this.v = parseInt(this.version);
	this.ns = (this.b=="ns" && this.v>=4)
	this.ns4 = (this.b=="ns" && this.v==4)
	this.ie = (this.b=="ie" && this.v>=4)
	this.ie4 = (this.version.indexOf('MSIE 4')>0)
	this.ie5 = (this.version.indexOf('MSIE 5')>0)
	this.ie6 = (this.version.indexOf('MSIE 6')>0)
	this.ie7 = (this.version.indexOf('MSIE 7')>0)
	// Gecko Opera
	this.NavAnt = navigator.userAgent;
	this.GEK = (this.NavAnt.indexOf("Gecko") != -1);
	this.OPE = (this.NavAnt.indexOf("Opera",0) != -1);

	this.min = (this.ns||this.ie)
	
	this.win = (navigator.appVersion.indexOf("Win",0) != -1)
	this.mac = (navigator.appVersion.indexOf("Mac",0) != -1)
	this._flash_currentver = 10; // for future version
	this._checkflashinstalled = BrowserCheckFlashInstalled;
	
	this.flash7 = this._checkflashinstalled(7);
	this.flash6 = this._checkflashinstalled(6);
	this.flash5 = this._checkflashinstalled(5);
	this.flash4 = this._checkflashinstalled(4);
}

function BrowserCheckFlashInstalled(version) {
	if(this.mac && this.ie4) return true;
	
	flashinstalled = 'false';
	if(this.ie && this.win) {
		var str = "";
		for(var i=version; i<=this._flash_currentver; i++)
		{
			str += 'IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.' + version + '\"))';
			if(i!=this._flash_currentver) str += " Or ";
		}
		document.writeln('<script language=\"VBscript\">');
		document.writeln('on error resume next');
		document.writeln('flashinstalled = ' + str);
		document.writeln('<\/script>');
	/*
	} else if(
		navigator.mimeTypes["application/x-director"] != null &&
		navigator.plugins["Shockwave for Director"] != null) {
			navigator.mimeTypes["application/x-director"] != null &&
			navigator.plugins["Shockwave for Director"] != null) {
			var desc = navigator.plugins["Shockwave for Director"].description;
			if(eval(desc.charAt(desc.indexOf("version",0)+"version ".length)) >= 7) flashinstalled  = 'true';
	*/
	} else {
		for(var i=0; i<navigator.plugins.length; i++)
			if(navigator.plugins[i].name == 'Shockwave Flash')
			{
				var desc = navigator.plugins["Shockwave Flash"].description;
				if(eval(desc.charAt(desc.indexOf("Flash",0)+"Flash ".length)) >= version) flashinstalled  = 'true';
			}
	}
	return eval(flashinstalled);
}
