
var flashVersion = 0;

if(navigator.plugins && navigator.plugins["Shockwave Flash"])
{
	// have plugins array - use this one
	// get version number (will be >= 4)
	flashVersion = parseInt(navigator.plugins["Shockwave Flash"].description.substring(16));
}else{

	// main possibilities are: Mac/IE4.5 (we just handle as if no flash plugin) and Win/IE - check whether that's the case
	var isWin = (navigator.platform.indexOf("Win") != -1);
	var isIE = (navigator.appName.indexOf("Internet Explorer") != -1);

	if(isWin && isIE)
	{
		var flash2Installed = false;    // boolean. true if flash 2 is installed
		var flash3Installed = false;    // boolean. true if flash 3 is installed
		var flash4Installed = false;    // boolean. true if flash 4 is installed
		var flash5Installed = false;    // boolean. true if flash 5 is installed
		var flash6Installed = false;    // boolean. true if flash 6 is installed
		var flash7Installed = false;    // boolean. true if flash 7 is installed
		var flash8Installed = false;    // boolean. true if flash 8 is installed
		var flash9Installed = false;    // boolean. true if flash 9 is installed
		var maxVersion = 9;             // highest version we can actually detect

		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
		document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
		document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
		document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
		document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
		document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
		document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
		document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
		document.write('<\/SCR' + 'IPT\> \n'); // break up end tag so it doesn't end our script

		for(var i=2;i<=maxVersion;i++)
			if(this["flash" + i + "Installed"])
				flashVersion = i;
	}
}

// done. if flashVersion is still 0, then haven't been able to detect flash player for whatever reason
// handle detection results