﻿jQuery.fn.extend({
    popup: function(popupId, colseId) {
        jQuery(popupId).show();
    },
    modePopup: function(popupId, colseId) {
        $(this).click(function() {
            getPopupBg();
            $("#popupBg").show();
            $(popupId).show();
        });

        $(colseId).click(function() {
            getPopupBg();
            $(popupId).hide();
            $("#popupBg").hide();
        });
    }
});
function getPopupBg() {
    if ($("#popupBg").length == 0) {
        $("<div id=\"popupBg\"></div>").appendTo("body");
    }


    //    var popWindoBg = document.getElementById("popWindoBg");
    //    if (popWindoBg == null) {
    //        popWindoBg = document.createElement("div");
    //        popWindoBg.id = "popWindoBg";
    //        popWindoBg.className = "popWindowBg";
    //        popWindoBg.style.display = "none";

    //        if (IsIE6() == true) {
    //            var bgIframe = null;
    //            bgIframe = document.createElement("iframe");
    //            bgIframe.setAttribute("src", "");
    //            bgIframe.style.cssText = "position:absolute;top:0px;left:0px;width:100%;height:100%; filter: alpha(opacity=0); opacity: 0; z-index:-1;";
    //            popWindoBg.appendChild(bgIframe);
    //        }
    //        document.body.appendChild(popWindoBg);
    //    }
    //    return popWindoBg;
}

function popupEX() {
    getPopupBg();
    $("#popupBg").show();
    $(".popLogin").show();

    $("#imgClose").click(function() {
        getPopupBg();
        $(".popLogin").hide();
        $("#popupBg").hide();
    });
}
