function ShowPopUp(PopUpId)
{
    var width  = $("#"+PopUpId).width();
    var height = $("#"+PopUpId).height();
    var left   = (screen.width  - width)/2;
    var top    = (screen.height - height * 2)/2;
    
    $("#"+PopUpId).css("left", left);
    $("#"+PopUpId).css("top", top);
    $("#Background").css("height", document.body.clientHeight + 10);

    $("#Background").css('opacity',0).fadeTo("fast", 0.60, function(){
            $("#"+PopUpId).fadeIn("fast");
        });
}

function HidePopUp()
{
    $(".PopUp").each(function(){
        if ($(this).css("display")=="block")
        {
            $(this).fadeOut("fast", function(){$("#Background").fadeOut("fast");});
        }
    })
}
