$(document).ready(function(){

	$("#contact form").submit(function(){

		var str = $(this).serialize();
		$.ajax({
			type: "POST",
			url: "./contact/contact.php",
			data: str,
			success: function(msg){
				$("#answer").html('');
				$("#answer").show();
				$("#answer").ajaxComplete(function(event, request, settings){
					if(msg == 'OK'){
						result = '<div class="notification-ok"><span>Your message has been sent. Thank you!</span></div>';
						$("#contact form fieldset").hide();
					}else{
						result = msg;
					}
					$(this).html(result);
				});
			}
		});

		return false;

	});

});