﻿$(function () {
    $(".showDisclaimer").click(function () {
        $("#popupDisclaimer").show();
        $("#backgroundPopup").show();
        var windowWidth = document.documentElement.clientWidth;
        var windowHeight = document.documentElement.clientHeight;
        var popupHeight = $("#popupDisclaimer").height();
        var popupWidth = $("#popupDisclaimer").width();
        
        //centering  
        $("#popupDisclaimer").css({
            "position": "absolute",
            "top": (windowHeight - popupHeight) / 2, // / 2 
            "left": (windowWidth - popupWidth) / 2
        });
        //only need force for IE6  

        $("#backgroundPopup").css({
            "height": windowHeight
        });
        return false;
    });

    $("#popupDisclaimerClose,#backgroundPopup").click(function () {
        $("#popupDisclaimer").hide();
        $("#backgroundPopup").hide();
    });
    /*
    $("#backgroundPopup").click(function () {
        $("#popupDisclaimer").hide();
        $("#backgroundPopup").hide();
    });
    */
});

