
var flashVersion = 0;
		
function isDefined(property) {
  return (typeof property != 'undefined');
}

function getFlashVersion() {
   var latestFlashVersion = 9;
   var agent = navigator.userAgent.toLowerCase(); 
   
   if (agent.indexOf("mozilla/3") != -1 && agent.indexOf("msie") == -1) {
	  flashVersion = 0;
   }

   if (navigator.plugins != null && navigator.plugins.length > 0) { 
	  var flashPlugin = navigator.plugins['Shockwave Flash'];
	  if (typeof flashPlugin == 'object') { 
	     //alert(flashPlugin.description);
		 flashVersion=flashPlugin.description.match(/ [0-9]{1,}\./gi);
		 if(flashVersion[0].length>0) {
		 	flashVersion=flashVersion[0].substring(1,flashVersion[0].length-1);
		 }
		 /*
         for (var i = latestFlashVersion; i >= 3; i--) {
			if (flashPlugin.description.indexOf(i + '.') != -1) {
               flashVersion = i;
               alert(flashVersion);
			   break;
            }
         }
		 */
		 //alert(flashVersion);
      }
   }else if (agent.indexOf("msie") != -1 && parseInt(navigator.appVersion) >= 4 && agent.indexOf("win")!=-1 && agent.indexOf("16bit")==-1) {
	  var doc = '<scr' + 'ipt language="VBScript"\> \n';
	  
      doc += 'On Error Resume Next \n';
      doc += 'Dim obFlash \n';
      doc += 'For i = ' + latestFlashVersion + ' To 3 Step -1 \n';
      doc += '   Set obFlash = CreateObject("ShockwaveFlash.ShockwaveFlash." & i) \n';
	  doc += '   If IsObject(obFlash) Then \n';
	  doc += '      flashVersion = i \n';
      doc += '      Exit For \n';
      doc += '   End If \n';
      doc += 'Next \n';
      doc += '</scr' + 'ipt\> \n';
      document.write(doc);
   }else {
      flashVersion = flashVersion_DONTKNOW;
   }
   
   return flashVersion;
}

flashVersion_DONTKNOW = -1;
		
var myFlashVersion = getFlashVersion();

