// Flash Version Detector  v1.1.5
// http://www.dithered.com/javascript/flash_detect/index.html
// code by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
// with VBScript code from Alastair Hamilton

var flashVersion = 0;
function getFlashVersion() {
        var agent = navigator.userAgent.toLowerCase();	
	 if (navigator.appVersion.indexOf("MSIE") != -1 && navigator.appVersion.indexOf("Windows") != -1) {
		flashVersion=0;
		result = false;
		for(var i = 15; i >= 3 && result != true; i--){
			try{
				execScript('on error resume next: result = IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))','VBScript');
			}
			catch(e){}
				flashVersion = i;
		}
		document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
		document.write('on error resume next \n');
		document.write('hasFlash = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash." & required))) \n');
		document.write('<'+'/scr' + 'ipt\> \n');
	} else {
		var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"])?navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin:0;
		if (plugin) {
			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(".") - 2) + flashDescription.charAt(flashDescription.indexOf(".") - 1));
			
		}
	}

                
        // WebTV 2.5 supports flash 3
         if (agent.indexOf("webtv/2.5") != -1) flashVersion = 3;

        // older WebTV supports flash 2
       if (agent.indexOf("webtv") != -1) flashVersion = 2;

        // Can't detect in all other cases
      //alert(flashVersion);
        return flashVersion;
}

flashVersion_DONTKNOW = -1;
