var flashMode = false;
var flashVersion = 0;
function initFlashDetection(maxflashVersion, flashOn) {
	if (flashOn)	 {
		if (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"] && navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
			if (navigator.plugins && navigator.plugins["Shockwave Flash"] && (versionIndex = navigator.plugins["Shockwave Flash"].description.indexOf(".")) != - 1) {
				var versionString = navigator.plugins["Shockwave Flash"].description.substring(versionIndex-2, versionIndex);
				flashVersion = parseInt( versionString );
				flashMode = ( flashVersion >= maxflashVersion );
			}
		}
		else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
						 && (navigator.userAgent.indexOf("Windows 95")>=0
						 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0 )) {
			try {
				document.write('<SCRIPT LANGUAGE=VBScript\> \n');
				document.write('on error resume next \n');
				document.write('tryVersion='+maxflashVersion+' \n');
				document.write('do while ((tryVersion > 1) And (Not(flashmode)))\n');
				document.write('objectName="ShockwaveFlash.ShockwaveFlash."+FormatNumber(tryVersion,0) \n');
				document.write('flashMode = (IsObject(CreateObject( objectName )))\n');
				//document.write('alert(objectName) \n');
				//document.write('alert(flashMode) \n');
				document.write('tryVersion=tryVersion-1 \n');
				document.write('loop\n');
				document.write('flashVersion=tryVersion+1 \n');
				document.write('</SCRIPT\> \n');
			}
			catch (err) {
				flashMode = false;
				flashVersion = 0;
			}
		}
	} else {
		flashMode = false;
		flashVersion = 0;
	}
}