$(document).ready(function() {

    $("#txtName").focus(function() {
        if ($(this).val() == "Your Name") {
            $(this).val("");
        }
    });
    $("#txtEmail").focus(function() {
        if ($(this).val() == "Email Address") {
            $(this).val("");
        }
    });
    $("#txtCompany").focus(function() {
        if ($(this).val() == "Company Name") {
            $(this).val("");
        }
    });
    $("#txtPhone").focus(function() {
        if ($(this).val() == "Phone # w/Area Code") {
            $(this).val("");
        }
    });
    $("#txtProject").focus(function() {
        if ($(this).html() == "Tell Us About Your Project") {
            $(this).html("");
        }
    });
    $("#txtBudget").focus(function() {
        if ($(this).val() == "Your Budget") {
            $(this).val("");
        }
    });
    
    //Blurs
    $("#txtName").blur(function() {
        if ($(this).val() == "") {
            $(this).val("Your Name");
        }
    });
    $("#txtEmail").blur(function() {
        if ($(this).val() == "") {
            $(this).val("Email Address");
        }
    });
    $("#txtCompany").blur(function() {
        if ($(this).val() == "") {
            $(this).val("Company Name");
        }
    });
    $("#txtPhone").blur(function() {
        if ($(this).val() == "") {
            $(this).val("Phone # w/Area Code");
        }
    });
    $("#txtProject").blur(function() {
        if ($(this).val() == "") {
            $(this).html("Tell Us About Your Project");
        }
    });
    $("#txtBudget").blur(function() {
        if ($(this).val() == "") {
            $(this).val("Your Budget");
        }
    });

});

//Button Code
function sendQuote() {
    $("#sending").fadeIn();
    name = $("#txtName").val();
    email = $("#txtEmail").val();
    company = $("#txtCompany").val();
    phone = $("#txtPhone").val();
    project = $("#txtProject").val();
    budget = $("#txtBudget").val();
    
    $.ajax({
        type: "POST",
        url: 'quote.php',
        data: "name="+name+"&email="+email+"&company="+company+"&phone="+phone+"&project="+project+"&budget="+budget,
        success: function(data) {
            $("#sending").fadeOut("fast", function() {
                $("#sent").fadeIn("fast");
            });
        }
    });
    
}
