$(function() {  
	$('.error').hide(); //get rid of validation notifications 
   
   
   
	$(".button").click(function() {  
		
     $('.error').hide(); //hide the validation even when the button gets clicked
	 
	 
	 
     var name = $("input#name").val(); //get the value of the field 
	 
     if (name == "") {  //check to see if its empty
	 
	   $("label#name_error").show();  //show the error message
       $("input#name").focus();  //put the curser inside the input field
       return false;  //page does not get sent
	   
     }
	 
	 
     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 inquiry = $("textarea#inquiry").val(); if (inquiry == "") { $("label#inquiry_error").show(); $("textarea#inquiry").focus(); return false; }
	 
	 var dataString = $('form').serialize();
     //alert (dataString);return false;
     $.ajax({  
      type: "POST",  
      url: "contact_poster.php",
      data: dataString,  
      success: function() {
        $('#form_div').html("<div id='message'></div>");  
        $('#message').html("<h1>Inquiry Submitted!</h1>")  
       .append("<p><small>We will be in touch soon!</small></p>")  
       .hide()  
       .fadeIn(1500, function() {  
         $('#message').append("<img id='checkmark' src='images/check.png' />");  
       });  
      }  
	 });  
     return false;  
		
	}); 

	
});
