How can I execute a function that will run while the client is waiting for the server response? Here is my code. I looked up and found a .load() function, but how does that fit into this? Any help would be great! Thanks

    type: "POST",
    url: "mail.php",
    data: {name: name.val(), email: email.val(), phone: phone.val(), subject: subject.val(), message: message.val()}
        alert("Your message was sent. We will be in contact with you shortly.");

You mean for example if you want to show a spinning gif while submitting data? Here is an example I have used many times. ajaxStart().

$("#img1").click(function () {

$("#div1").ajaxStart(function () {
        $("#progress").css("display", "block");

Excellent. Glad to hear.