$(function(){var t=$("#contact-form"),s=$(".form-message");$(t).submit(function(e){e.preventDefault();e=$(t).serialize();$.ajax({type:"POST",url:$(t).attr("action"),data:e}).done(function(e){$(s).removeClass("error"),$(s).addClass("success"),$(s).text(e),$("#contact-form input, #contact-form textarea").val("")}).fail(function(e){$(s).removeClass("success"),$(s).addClass("error"),""!==e.responseText?$(s).text(e.responseText):$(s).text("Oops! An error occured and your message could not be sent.")})})});