﻿$().ready(function() {
    $().ajaxStart(function() {
        $(".imgajax").show();
        $(".spnajax").html("Processing...").show();
    });
    $().ajaxStop(function() {
        $(".imgajax").fadeOut("slow");
        $(".spnajax").html("Process Complete").fadeOut("slow");
    });
    $("#MasterPageFooter a").unbind().click(function() {
        var url = $(this).attr("href");
        $("#MasterAjaxContent").load(url);
        $(".closemasterajaxcontent").remove();
        $("<hr class=\"closemasterajaxcontent\"/><a class=\"closemasterajaxcontent\">Close</a>").insertBefore("#MasterAjaxContent");
        $(".closemasterajaxcontent").unbind().click(function() {
            $("#MasterAjaxContent").empty();
            $(".closemasterajaxcontent").remove();
            return false;
        });
        return false;
    });
});

function wire_Mailer() {
    $("#btnMailer").unbind().click(function() {
        var postData = $("#frmMailer").serialize();
        $.post("../../MyHandlers/SendMail.ashx?", postData, function(response) {
            alert(response);
            window.location.reload(false);
        });
        return false;
    });
};

function wire_needinfo() {
    $(".needinfo").hover(function() {
        var $div = $(this).next("div.info");
        var offset = $(this).offset();
        $div.css("top", offset.top - $div.height());
        $div.css("left", offset.left + 5);
        $div.corner().show();
    }, function() {
        $(this).next("div.info").hide();
    });
};

function noCache() {
    var date = new Date()
    return "_=" + date.getMilliseconds();
}