$(function() {
	$('.error').hide();
	$(".button").click(function() {
		$('.error').hide();
			var name = $("input#name").val();
				if (name == "") {
			$("label#name_error").show();
			$("input#name").focus();
			return false;
		}
				var email = $("input#email").val();
				if (email == "") {
			$("label#email_error").show();
			$("input#email").focus();
			return false;
		}
				var phone = $("input#phone").val();
				if (phone == "") {
			$("label#phone_error").show();
			$("input#phone").focus();
			return false;
		}
				var comment = $("textarea#comment").val();
				var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone + '&comment=' + comment;
				$.ajax({
			type: "POST",
			url: "bin/process.php",
			data: dataString,
			success: function() {
				$('#contact').html("<div id='message'></div>");
				$('#message').html("<img id='checkmark' src='img/check.png' />")
				.append("<h2>Thanks!</h2>")
				.append("<p>We will get back to you as soon as possible.</p>")
				.hide()
				.fadeIn(1000, function() {
				});
			}
		});
	return false;
	});
});