$(function(){
	$('.error').hide();
	$(".button").click(function(){
	//validate and process here
	
		$('.error').hide();
			var name = $("input#name").val();
				if(name == "Name"){
				$("label#name_error").show();
				$("input#name").focus();
				return false;
				}
			var email = $("input#email").val();
			if (email == "Email") {
				$("label#email_error").show();
				$("input#email").focus();
				return false;
				}
			var content = $("textarea#content").val();
			if (content == "Type your message here...") {
				$("label#content_error").show();
				$("textarea#content").focus();
				return false;
				}
			
			var dataString = 'name=' + name + '&email=' + email + '&content=' + content;
			$.ajax({
				type: "POST",
				url: "includes/email/email.php",
				data: dataString,
				success: function() {
					$('#contact_form').html("<div id='message'></div>");
					$('#message').html("<h2>Message Sent!</h2>")
					.append("<p>Thank you for your interest. We will be in touch with you shortly.")
					.hide()
					.fadeIn(1500, function() {
						$('#message');
				});
			}
	});
	return false;
});
});
