﻿function getFlashVersion() {
    // ie 
    try {
        try {
            var axo = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.6');
            try { axo.AllowScriptAccess = 'always'; }
            catch (e) { return '6,0,0'; }
        } catch (e) { }
        return new ActiveXObject('ShockwaveFlash.ShockwaveFlash').GetVariable('$version').replace(/\D+/g, ',').match(/^,?(.+),?$/)[1];
        // other browsers 
    } catch (e) {
        try {
            if (navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin) {
                return (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]).description.replace(/\D+/g, ",").match(/^,?(.+),?$/)[1];
            }
        } catch (e) { }
    }
    return '0,0,0';
}
function testFlash() {
    var version = getFlashVersion().split(',').shift();
    if (version < 9) {
        alert("Program nie wyświetli opisów szkół.\n1. Sprawdź czy masz włączoną obsługę pluginów w swojej przeglądarce.\n2. Zainstaluj Flash Player w wersji 9.0 lub wyższej.");
        //window.location.href = "http://get.adobe.com/flashplayer";
        window.open().location.href = "http://get.adobe.com/flashplayer";
        //window.open(href="http://get.adobe.com/flashplayer", target="_blank");
    } 
}
