
/*
Credits: Bit Repository

URL: http://www.bitrepository.com
*/

$(document).ready(function(){
$("form").submit(function(){

var str = $("form").serialize();

   $.ajax({
   type: "POST",
   url: "new-home/send_mail.php",
   data: str,
   success: function(msg){

$("#notification").ajaxComplete(function(event, request, settings){

// Message Sent? Show the 'Thank You' message and hide the form

if(msg == 'OK')
{
result =
'<div class="notification_ok"><p>Your message has been sent. Thank you!</p></div>';

$("#fields").css("display", "none");
}
else
{
result = msg;
}

$(this).html(result);

});

}

 });

return false;

});

});

