if (!contentVersion)
    alert('Szükséges Plugin verzió nincsen definiálva!');

if (!PluginVersion)
    alert('Meglévő Plugin verzió nincsen definiálva!');


/* Mobile Device Detect */
var mobileDevice = '';
/* iPad */
if(navigator.platform.indexOf("iPad") != -1)
    mobileDevice = 'iPad';
/* iPhone */
if(navigator.platform.indexOf("iPhone") != -1)
    mobileDevice = 'iPhone';
/* iPod */
if(navigator.platform.indexOf("iPod") != -1)
    mobileDevice = 'iPod';
/* Android */
if(navigator.platform.indexOf("android") != -1)
    mobileDevice = 'android';

if (mobileDevice != '') {
    PluginVersion = contentVersion;
    Cell = mobileDevice;
}


if (IE6) {
    function questionIE(text) {
        if ( confirm(text) ) {
            window.open('http://get.adobe.com/flashplayer/', '_target');
        } else {
        }
    }

    if ( contentVersion > PluginVersion ) {
        if ( navigator.userLanguage == 'hu' ) {
            questionIE('Az Ön Flash verziója: ' + PluginVersion + '\nSzükséges Flash verzió: ' + contentVersion + '\nFel kívánja telepíteni?');
        }
    }

} else {
    if (!FlashCanPlay && !Cell) {
        $(document).ready(function(){

    // documentum mérete
            var flashInstallHeight = $(document).height();
            var flashInstallWidth = $(document).width();

    // letakaró elem méretezése ablak méretezésekor
            $(window).resize(function(){
                $('#flash-install-overlay').css({height: $(document).height(), width: $(document).width()});
            });

    // letakaró és az információs sávot alkotó html elemek létrehozása balról jobbra a böngészőben való megjelenés alapján
            $('<div>').attr('id', 'flash-install-overlay').appendTo('body');
            $('<div>').attr('id', 'flash-install-background').appendTo('body');
            $('<div>').attr('id', 'flash-install-content').appendTo('#flash-install-background');

            $('<div>').attr('id', 'flash-install-box-en').appendTo('#flash-install-content');
            $('<div>').attr('id', 'flash-install-box-en-text').appendTo('#flash-install-box-en');

            $('<img>').attr({src: 'http://cdn.webshark.hu/gfx/SE/flashInstall/1.0/warning.gif', width: '70', height: '90', alt: ''}).css('float', 'left').appendTo('#flash-install-content');

            $('<div>').attr('id', 'flash-install-box-hu').appendTo('#flash-install-content');
            $('<div>').attr('id', 'flash-install-box-hu-text').appendTo('#flash-install-box-hu');

            $('<img>').attr({src: 'http://cdn.webshark.hu/gfx/SE/flashInstall/1.0/warning.gif', width: '70', height: '90', alt: ''}).css('float', 'left').appendTo('#flash-install-content');

            $('<div>').attr('id', 'flash-install-box-de').appendTo('#flash-install-content');
            $('<div>').attr('id', 'flash-install-box-de-text').appendTo('#flash-install-box-de');

    // létrehozott elemek stílusai
            $('#flash-install-overlay').css({
                'height': flashInstallHeight + 'px',
                'width': flashInstallWidth + 'px',
                'top': '0',
                'left': '0',
                'color': '#000',
                'z-index': '100000',
                'position': 'fixed',
                'background-color': '#000',
                'opacity': '0.5',
                'filter': 'alpha(opacity=50)',
                '-moz-opacity': '0.5'
            });

            $('#flash-install-background').css({
                'height': '90px',
                'width': '100%',
                'top': '-90px',
                'left': '0',
                'color': '#000',
                'z-index': '100001',
                'position': 'fixed',
                'border-bottom': '1px solid #434439',
                'background': 'transparent url("http://cdn.webshark.hu/gfx/SE/flashInstall/1.0/bg.gif") repeat-x 0 0',
                'text-align': 'center'
            });

            $('#flash-install-content').css({
                'height': '90px',
                'width': '710px',
                'z-index': '100002',
                'overflow': 'auto',
                'margin': '0 auto'
            });

    // angol nyelvű box stílusai, tulajdonságai
            $('#flash-install-box-en').css({
                'height': '85px',
                'width': '190px',
                'float': 'left',
                'padding-top': '5px'
            });
            
            $('#flash-install-box-en-text').css({
                'height': '55px',
                'width': '190px',
                'font': '12px "Arial", "Helvetica"',
                'text-align': 'center'
            }).html('Your Flash version: ' + PluginVersion + '<br />Necessary Flash version: ' + contentVersion + '<br />Do you want to install it?');

            $('<a>').attr({href: 'http://get.adobe.com/flashplayer/', target: '_blank', id: 'flash-install-link-install-en'}).css({'outline-style': 'none', 'border': 'none'}).appendTo('#flash-install-box-en');
            $('<img>').attr({src: 'http://cdn.webshark.hu/gfx/SE/flashInstall/1.0/install_en.gif', width: '95', height: '30', alt: 'Install Flash Player', title: 'Install Flash Player', border: '0'}).appendTo('#flash-install-link-install-en');

            $('<img>').attr({src: 'http://cdn.webshark.hu/gfx/SE/flashInstall/1.0/cancel_en.gif', width: '95', height: '30', alt: "I don't want to install Flash Player", title: "I don't want to install Flash Player", border: '0', id: 'flash-install-cancel-en'}).css('cursor', 'pointer').appendTo('#flash-install-box-en');

    // magyar nyelvű box stílusai, tulajdonságai
            $('#flash-install-box-hu').css({
                'height': '85px',
                'width': '190px',
                'float': 'left',
                'padding-top': '5px'
            });

            $('#flash-install-box-hu-text').css({
                'height': '55px',
                'width': '190px',
                'font': '12px "Arial", "Helvetica"',
                'text-align': 'center'
            }).html('Az Ön Flash verziója: ' + PluginVersion + '<br />Szükséges Flash verzió: ' + contentVersion + '<br />Fel kívánja telepíteni?');

            $('<a>').attr({href: 'http://get.adobe.com/flashplayer/', target: '_blank', id: 'flash-install-link-install-hu'}).css({'outline-style': 'none', 'border': 'none'}).appendTo('#flash-install-box-hu');
            $('<img>').attr({src: 'http://cdn.webshark.hu/gfx/SE/flashInstall/1.0/install_hu.gif', width: '95', height: '30', alt: 'Telepítem a Flash Player-t', title: 'Telepítem a Flash Player-t', border: '0'}).appendTo('#flash-install-link-install-hu');

            $('<img>').attr({src: 'http://cdn.webshark.hu/gfx/SE/flashInstall/1.0/cancel_hu.gif', width: '95', height: '30', alt: 'Nem telepítem a Flash Player-t', title: 'Nem telepítem a Flash Player-t', border: '0', id: 'flash-install-cancel-hu'}).css('cursor', 'pointer').appendTo('#flash-install-box-hu');

    // német nyelvű box stílusai, tulajdonságai
            $('#flash-install-box-de').css({
                'height': '85px',
                'width': '190px',
                'float': 'left',
                'padding-top': '5px'
            });

            $('#flash-install-box-de-text').css({
                'height': '55px',
                'width': '190px',
                'font': '12px "Arial", "Helvetica"',
                'text-align': 'center'
            }).html('Ihre Flash version: ' + PluginVersion + '<br />Benötigte Flash version: ' + contentVersion + '<br />Möchten Sie es installieren?');

            $('<a>').attr({href: 'http://get.adobe.com/flashplayer/', target: '_blank', id: 'flash-install-link-install-de'}).css({'outline-style': 'none', 'border': 'none'}).appendTo('#flash-install-box-de');
            $('<img>').attr({src: 'http://cdn.webshark.hu/gfx/SE/flashInstall/1.0/install_de.gif', width: '95', height: '30', alt: 'Installiere den Flash Player', title: 'Installiere den Flash Player', border: '0'}).appendTo('#flash-install-link-install-de');

            $('<img>').attr({src: 'http://cdn.webshark.hu/gfx/SE/flashInstall/1.0/cancel_de.gif', width: '95', height: '30', alt: 'Installiere den Flash Player NICHT', title: 'Installiere den Flash Player NICHT', border: '0', id: 'flash-install-cancel-de'}).css('cursor', 'pointer').appendTo('#flash-install-box-de');

    // nincs telepítés kiválasztása esetén
            $('#flash-install-cancel-en, #flash-install-cancel-hu, #flash-install-cancel-de').click(function () {
                $('#flash-install-background').hide();
                $('#flash-install-overlay').hide();
            });

    // információs sáv animálása betöltődéskor
            $('#flash-install-background').animate({top :'0'}, 1000);

        });
    }
}

