
// Mail Form                   
$(document).ready(function(){

$("#ajax-contact-form").submit(function(){
	var str = $(this).serialize();
		$.ajax({
        type: "POST",
        url: "/mailform/contact.php",
        data: str,
        success: function(msg){
                
        $("#note").ajaxComplete(function(event, request, settings){
            
			if(msg == '<h2>Your message has been sent. Thank you!</h2>') // Message Sent? Show the 'Thank You' message and hide the form
				{
				result = '<h2>Your message has been sent. Thank you!</h2>';
				$("#fields").hide();
				}
				
				else
				{
				result = msg;
				}
				
				$(this).html(result);
				
				});
				
			}
            
		});
            
   		 return false;
            
    });
            
});
            

