$().ready(function(){
  $("#ajax-contact-form").submit(function(){
    $('.button_send_shell').addClass('button_send_shell_loading');
    var str = $(this).serialize();
    $.ajax({
      type: "POST",
      url: "contact-post.php",
      data: str,
      success: function(msg){ // request success
        $("#contact-form-feedback").ajaxComplete(function(event, request, settings){ // on ajax complete
          if(msg == 'OK'){ 
            result = '<h3 class="feedback_text feedback_ok">Your message has been sent. Thank you!</h3>';
            $("#contact-form-shell").hide();
          }
          else{
            result = msg;
          }
          $('.button_send_shell').removeClass('button_send_shell_loading');
          $(this).html(result);
          $(this).show();
        });
      }
    });
    return false;
  });
});

