var detectableWithVB = false;
var haveFlash = false;
var haveFlashVer = false;
var flash2Installed = false;
var flash3Installed = false;
var flash4Installed = false;
var flash5Installed = false;
var flash6Installed = false;
var flash7Installed = false;
var flash8Installed = false;
// var requiredVersion = 8;
var maxVersion = 8;
var actualVersion = 0;
var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
var VBcode = "";
if (isIE && isWin) {
	VBcode += "<SCR"+"IPT LANGUAGE=VBScript\>\n";
	VBcode += "on error resume next\n";
	VBcode += "detectableWithVB = True\n";
	VBcode += "Function detectFlashActiveXControl()\n";
	VBcode += "	on error resume next\n";
	VBcode += "	flash2Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.2\")))\n";
	VBcode += "	if (flash2Installed) then flashVersion = 2\n";
	VBcode += "	flash3Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.3\")))\n";
	VBcode += "	if (flash3Installed) then flashVersion = 3\n";
	VBcode += "	flash4Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.4\")))\n";
	VBcode += "	if (flash4Installed) then flashVersion = 4\n";
	VBcode += "	flash5Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.5\")))\n";
	VBcode += "	if (flash5Installed) then flashVersion = 5\n";
	VBcode += "	flash6Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.6\")))\n";
	VBcode += "	if (flash6Installed) then flashVersion = 6\n";
	VBcode += "	flash7Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.7\")))\n";
	VBcode += "	if (flash7Installed) then flashVersion = 7\n";
	VBcode += "	flash8Installed = (IsObject(CreateObject(\"ShockwaveFlash.ShockwaveFlash.8\")))\n";
	VBcode += "	if (flash8Installed) then flashVersion = 8\n";
	VBcode += "End Function\n";
	VBcode += "</SCR"+"IPT\>\n";
	document.writeln(VBcode);
}
function flashDetect() {
	if (!requiredVersion) {
		requiredVersion = 6;
	}
	if (navigator.plugins) {
		if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
			haveFlash = true;
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));
			flash2Installed = flashVersion == 2;
			flash3Installed = flashVersion == 3;
			flash4Installed = flashVersion == 4;
			flash5Installed = flashVersion == 5;
			flash6Installed = flashVersion == 6;
			flash7Installed = flashVersion == 7;
			flash8Installed = flashVersion >= 8;
		} else if (detectableWithVB) {
  			detectFlashActiveXControl();
  			if (flash7Installed) haveFlash = true;
  		}
	}
	for (var i = 2; i <= maxVersion; i++) {
		if (eval("flash"+i+"Installed") == true) actualVersion = i;
	}
	if(navigator.userAgent.indexOf("WebTV") != -1) actualVersion = 2;
	haveFlashVer = (actualVersion >= requiredVersion) ? true : false
}
/*
flashDetect();
var l_Alert = "";
l_Alert += "detectableWithVB: "+detectableWithVB+"\n";
l_Alert += "haveFlash: "+haveFlash+"\n";
l_Alert += "maxVersion: "+maxVersion+"\n";
l_Alert += "isIE: "+isIE+"\n";
l_Alert += "isWin: "+isWin+"\n";
l_Alert += "haveFlashVer: "+haveFlashVer+"\n";
l_Alert += "flash2Installed: "+flash2Installed+"\n";
l_Alert += "flash3Installed: "+flash3Installed+"\n";
l_Alert += "flash4Installed: "+flash4Installed+"\n";
l_Alert += "flash5Installed: "+flash5Installed+"\n";
l_Alert += "flash6Installed: "+flash6Installed+"\n";
l_Alert += "flash7Installed: "+flash7Installed+"\n";
l_Alert += "flash8Installed: "+flash8Installed+"\n";
l_Alert += "requiredVersion: "+requiredVersion+"\n";
l_Alert += "maxVersion: "+maxVersion+"\n";
l_Alert += "actualVersion: "+actualVersion+"\n";
alert(l_Alert);
*/