function showPopup(popupName, longtext) {
    //alert(longtext);

    //width for IEs is different so we use window width
    if ($.browser.msie) {

        $('.PopupBlockBg').css('width', $(window).width());

        if ($.browser.version == '6.0') {
        // we need to hide footer cause fixed PNG24 image is displayed over popup
            $('.BoxFooter').hide();

        }

    } else {

        $('.PopupBlockBg').css('width', $(document).width()); // width for shadow bg block
    }

    if (longtext == 'long') {

        if ($(document).height() < $('#' + popupName).outerHeight(true)) {

            $('.PopupBlockBg').css('height', $(document).height() + $(document).height() * 0.15 + $('#' + popupName).outerHeight(true) - $(document).height());

        } else {
            // popup heigh <= document height
            $('.PopupBlockBg').css('height', $(document).height());
        }


    } else {

        $('.PopupBlockBg').css('height', $(document).height());
        // if ShortPopup no need to add popup heigh to document height

        var PopupBlockContainerMarginTop = '-' + $('#' + popupName).height() / 2;
        $('#' + popupName)[0].setAttribute('style', 'margin-top:' + PopupBlockContainerMarginTop + 'px');
        // we set margin top = - popup height/2 to put SHORT popup verticaly middle

    }


    $('.PopupBlockBg').show();
    $('#' + popupName).show();
}

function hidePopup(popupName) {
    //alert(popupName);
    $('#' + popupName).hide();
    $('.PopupBlockBg').hide();

    if ($.browser.msie) {

        if ($.browser.version == '6.0') {

            $('.BoxFooter').show();

        }
    }
}
