$(document).ready(function () {
    $('form#contactform').attr("action","");
    $('input#send').click(function () {$(this).validatesend();return false;});
});
Cufon.replace('h4.contact');
Cufon.replace('label.contact',{fontSize:'16px'});
Cufon.replace('label.contacttextarea',{fontSize:'16px'});
var sendingsmall = false;
$.fn.validatesend = function () {
if (sendingsmall == false) {
        var nm = $('input#name').val();
        var em = $('input#email').val();
        var su = $('input#sum').val();
        var ms = $('textarea#message').val();
        if (nm == "") {alert('Please enter your name.');$('input#name').focus();}
        else if (em == "") {alert('Please enter your email (or phone number).');$('input#email').focus();}
        else if (ms == "") {alert('Please enter your message.');$('textarea#message').focus();}
        else if (su == "") {alert('Please enter the answer of the sum.');$('input#sum').focus();}
        else {
            sendingsmall = false;
            var loadUrl = '/contact/compile.php';
            $.post(loadUrl,{ajax:'true',email:em,name:nm,message:ms,sum:su,hd2n:$("#hd2n").val()},function(responseText) {if (responseText == 'true') {$('form#contactform').html('<span class="spanresponse" style="width:90%;color:#FB6960;">Thank you for your message! We will be in touch shortly.</span>');Cufon.replace('span.spanresponse');Cufon.now();} else if (responseText.indexOf('sumans') > -1) {alert('Please enter the correct answer');$('#sum').focus().css("background-color","#CC3333");} else {alert("Sorry, there was an error submitting your message. Please call us to get in touch.");}},"html");
        }
}
return false;
}