﻿/*MS 2011-12-16*/
var startPopupStatus = 0;

function openStartPagePopup() {
    $("#Popupbg").css({ "opacity": "0.7", "height": $(document).height() });
    $("#Popupbg").click(function() { $("#Popupbg").hide(); $("#Popup").hide(); });
    $("#Popup").click(function() { $("#Popupbg").hide(); $("#Popup").hide(); });
    $("#PopupClose").click(function() { $("#Popupbg").hide(); $("#Popup").hide(); });
    $(document).keypress(function(e) { if (e.keyCode == 27 && startPopupStatus == 1) $("#Popupbg").hide(); $("#Popup").hide(); });

    $("#Popupbg").show();
    $("#Popup").show();
}

function closeStartPagePopup() {
    $("#Popupbg").hide();
    $("#Popup").hide();
}

function setCookie(cName, expireHours) {
    console.log(cName);
    var exdate = new Date();
    exdate.setHours(exdate.getDate() + expireHours);
    document.cookie = cName + "=1" + ((expireHours == null) ? "" : ";expires=" + exdate.toGMTString());

    console.log(document.cookie.length);
}

function getCookie(cName) {
    console.log(cName);
    if (document.cookie.length > 0) {
        var cStart = document.cookie.indexOf(cName + "=");
        if (cStart != -1) {
            cStart = cStart + cName.length + 1;
            var cEnd = document.cookie.indexOf(";", cStart);
            if (cEnd == -1) cEnd = document.cookie.length;
            return unescape(document.cookie.substring(cStart, cEnd));
        }
    }
    return "";
}


/*---END--- MS 2011-12-16 ---END---*/
