// javascript detection which uses navigator.plugins array
function detectFlash(){	

	if (navigator.plugins){								// navigator.plugins exist?
		if (navigator.plugins["Shockwave Flash 2.0"] 	// yes>> then is Flash 2 
		|| navigator.plugins["Shockwave Flash"]){		// or flash 3+ installed?

			// set convenient references to flash 2 and the plugin description
			var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
			var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
			// a flash plugin-description looks like this: Shockwave Flash 4.0 r5
			// so we can get the major version by grabbing the character before the period
			// note that we don't bother with minor version detection. do that in your movie with $version
			var flashVersion = parseInt(flashDescription.charAt(flashDescription.indexOf(".") - 1));

			flash2Yes = flashVersion == 2;		
			flash3Yes = flashVersion == 3;
			flash4Yes = flashVersion == 4;
			flash5Yes = flashVersion == 5;
			flash6Yes = flashVersion == 6;
		}
	}
	
	for (var i = 2; i <= highestVersion; i++) {	
		if (eval("flash" + i + "Yes") == true) actualVersion = i;
	}

	if (actualVersion >= requiredVersion) { 		// right version

				FlashEnabled = true;

				} else {	// old version or no plugin
				}
}

detectFlash();	// call now
