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

