$(document).ready(function(){
	
	$('#signup_status').text("");
	$('#contact_status').text("");
	
	$("input#email").focusin(function(){
		$('#signup_status').text("");
	});
	
	// Contact Form
	$("form#contact").submit(function() {
		$("#contact_status").text("");
		$("#contact_status").show();
		//alert('button pressed');
		// we want to store the values from the form input box, then send via ajax below
		var first = $('#first').attr('value');
		var last = $('#last').attr('value');
		var email = $('#contactemail').attr('value');
		var phone = $('#phone').attr('value');
		var message = $('#message').attr('value');
		
			$.ajax({
				type: "POST",
				url: "contact2.php",
				data: "first=" + first + "&last=" + last + "&email="+ email + "&phone=" + phone + "&message=" + message,
				success: function(result){
					//alert(email);
					$("#contact_status").text(result);
				}
			});
		return false;
	});
	
	
	// Sign Up Form
	$("form#signup").submit(function() {
		$("#signup_status").text("");
		$("#signup_status").show();
		//alert('button pressed');
		// we want to store the values from the form input box, then send via ajax below
		var email = $('#signupemail').attr('value');
			$.ajax({
				type: "POST",
				url: "signup.php",
				data: "email="+ email,
				success: function(result){
					//alert(result);
					$("#signup_status").text(result);
				}
			});
		return false;
	});
});
