var NeededFlashVersion  = 6;
var CurrentFlashVersion = false;
var CorrectFlashVersion = false;
var foundFlash2 = false;
var foundFlash3 = false;
var foundFlash4 = false;
var foundFlash5 = false;
var foundFlash6 = false;

if (is.ie && is.win) {
    document.write('<SCR'+'IPT LANGUAGE=VBScript\> \n');
    document.write('on error resume next \n');
    document.write('foundFlash2 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
    document.write('foundFlash3 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
    document.write('foundFlash4 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
    document.write('foundFlash5 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');  
    document.write('foundFlash6 = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');  
    document.write('</SCR'+'IPT\> \n');
}

function detectFlash () {
    // For all browsers than the IE
    if (navigator.plugins && navigator.plugins["Shockwave Flash"]) { 
        Flash = navigator.plugins["Shockwave Flash"];
        if (Flash.description) {
            FlashDescription = Flash.description;
            CurrentFlashVersion = FlashDescription.charAt(FlashDescription.indexOf('.')-1);
        }
    
        if (navigator.plugins["Shockwave Flash 2.0"]) {
            CurrentFlashVersion = 2;
        }

        if (CurrentFlashVersion == 2) {foundFlash2 = true;}
        if (CurrentFlashVersion == 3) {foundFlash3 = true;}
        if (CurrentFlashVersion == 4) {foundFlash4 = true;}
        if (CurrentFlashVersion == 5) {foundFlash5 = true;}
        if (CurrentFlashVersion == 6) {foundFlash6 = true;}
        
    }
    // For the IE
    if (!CurrentFlashVersion) {
        if (foundFlash2 == true) {CurrentFlashVersion = 2;}
        if (foundFlash3 == true) {CurrentFlashVersion = 3;}
        if (foundFlash4 == true) {CurrentFlashVersion = 4;}
        if (foundFlash5 == true) {CurrentFlashVersion = 5;}
        if (foundFlash6 == true) {CurrentFlashVersion = 6;}
    }

    if (CurrentFlashVersion >= NeededFlashVersion) {
        CorrectFlashVersion = true;
    }

}

detectFlash(); 