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