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.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.flash6 = this._checkflashinstalled(6);
	this.flash5 = this.flash6||this._checkflashinstalled(5);
	this.flash4 = this.flash5||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
		){
			var desc = navigator.plugins["Shockwave for Director"].description;
			if(version==5 && eval(desc.charAt(desc.indexOf("version",0)+"version ".length)) >= 8.5) flashinstalled  = 'true';
			if(version==4 && eval(desc.charAt(desc.indexOf("version",0)+"version ".length)) >= 7) flashinstalled  = 'true';
		}
		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);
}
/*
	FlashInstalled = 'false';
	DirectorInstalled = 'false';
	QuickTimeInstalled = 'false';
	RealPlayerInstalled = 'false';
	RealVideoInstalled = 'false';
	RealG2Installed = 'false';
	
	document.writeln('<script language=\"VBscript\">');
	document.writeln('on error resume next');
	document.writeln('FlashInstalled = IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.' + flash_version + '\"))');
	document.writeln('DirectorInstalled = IsObject(CreateObject(\"SWCtl.SWCtl.' + director_version + '\"))');
	//SWCtl.SWCtl		The generic ActiveX control.
	//SWCtl.SWCtl.1	Shockwave Player, version 6
	//SWCtl.SWCtl.7	Shockwave Player, version 7
	//SWCtl.SWCtl.8	Shockwave Player, version 8
	//more information "http://www.macromedia.com/support/director/ts/documents/shockwave_player_detect.htm"
	
	document.writeln('QuickTimeInstalled = IsObject(CreateObject(\"QuickTimeCheckObject.QuickTimeCheck.1\"))');
	//QuickTimeCheckObject.QuickTimeCheck.1	QuickTime4.1.1 or later
	//more information "http://www.apple.com/quicktime/authoring/qtjavascript.html"
	
	document.writeln('RealPlayerInstalled = IsObject(CreateObject(\"RealPlayer.RealPlayer(tm) ActiveX Control (32-bit)\"))');
	document.writeln('RealVideoInstalled = IsObject(CreateObject(\"RealPlayer.RealVideo.RealVideo(tm) ActiveX Control (32-bit)\"))');
	document.writeln('RealG2Installed = IsObject(CreateObject(\"rmocx.RealPlayer G2 Control\"))');
	//more information "http://www.realnetworks.com"
	
	document.writeln('<\/script>');
	
	alert('Flash' + flash_version + '　' + FlashInstalled);
	alert('Director' + director_version + '　' + DirectorInstalled);
	alert('QuickTime4.1.1 or later　' + QuickTimeInstalled);
	alert('RealPlayer　' + RealPlayerInstalled);
	alert('RealVideo　' + RealVideoInstalled);
	alert('RealG2　' + RealG2Installed);
*/

