﻿
$(".popupLayer span.close").live("click", function () {
    $(this).parent().css({ left: "20px" }).hide();
    $(this).parent().find("input[type=text]").each(function () { $(this).val(""); });
    $(this).parent().find("textarea").each(function () { $(this).val(""); });
    $(".error, .successful").html("");
    $("td[id^=dt_]").html("");
});

function ShowPopup(containerId, that) {
    var myTop = 200;
    var myLeft = 200;
    
    if ($("#" + containerId).length > 0) {
        if (that.offset() != null) { myTop = that.offset().top - 100;myTop = Math.abs(myTop); }
        myLeft = (screen.width / 2) - (parseInt($("#" + containerId).width(), 10)/2);

        $("#" + containerId).show().css({ top: myTop, left : myLeft });
        /*$("#" + containerId).animate({ left: myLeft }, 200, function () {
        });*/

    }
}
