﻿function isIE7() {
    var msie = navigator.userAgent.indexOf("MSIE");
    var browserVersion = navigator.userAgent.substring(msie + 5, msie + 6);

    return browserVersion >= "7";
}

function getPopupStyle(width, height, fixedBorder) {
    var diffH = (isIE7()) ? 0 : 40;
    var diffW = isIE7() ? 0 : 8;
    var sFeatures = "dialogWidth: " + String(width + diffW) + "px; dialogHeight: " + String(height + diffH) + "px; status: no; scroll: auto; resizable: " + (fixedBorder == null || !fixedBorder ? "yes" : "no");
    return sFeatures;
}

function pleaseWait() {
        jQuery(document).ready(function($) {
            $(function() {
                $.blockUI({
                    css: {
                        border: 'none',
                        padding: '8px',
                        backgroundColor: '#000',
                        '-webkit-border-radius': '10px',
                        '-moz-border-radius': '10px',
                        opacity: .5,
                        color: '#fff',
                        'font-family': 'Verdana',
                        'font-size': '16px'
                    },
                    message: '<img src="../images/processing.png" style="vertical-align: middle" /><strong>&nbsp;&nbsp;Please Wait! Processing Request...</strong>',
                    timeout: 60000
                });
            });
        });
    return true;
}
