// JavaScript Document

			   
$(function() {  
	$('.error').hide();	   
  $(".btn").click(function() {  
    // validate and process form here  
	
	$('.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();
			var comments = $("textarea#comments").val();

	var dataString = 'name=' + name + '&email=' + email + '&phone=' + phone + '&comments=' + comments;
	//alert (dataString);return false;
	$.ajax({
		   type: "POST",
		   url: "bin/process.php",
		   data: dataString,
		   success: function() {
			   $('#subContactForm').animate({height: "220px"}, 1000);
			   $('#formWrapper').html("<div id='message'></div>");
			   $('#message').html("<h2>Contact Form Submitted</h2>")
			   
			   .append("<p>Thank you for your enquiry, we shall contact you at the earliest opportunity</p>")
			   .hide()
			   $('#message').append("<img id='checkmark' src='assets/mailSent_img.png' />")
			   .fadeIn(1500, function() {
          
        });
		   	  }
		   });
	return false;
  });  
});  



