  $(function() {
    $('.error').hide();
    $(".button").click(function() {
      // validate and process form here

      $('.error').hide();
  	  var question = $("textarea#question").val();
  		if (question == "") {
        $("label#question_error").show();
        $("textarea#question").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;
      }
	// Process PHP
	 var dataString = 'question='+ question + '&email=' + email + '&phone=' + phone;
  //alert (dataString);return false;
	  $.ajax({
		type: "POST",
		url: "bin/process.php",
		data: dataString,
		success: function() {
		  $('#questionForm').html("<div id='message'></div>");
		  $('#message').html("<h2>Contact Form Submitted!</h2>")
		  .append("<p>We will be in touch soon.</p>")
		  .hide()
		  .fadeIn(1500, function() {
			$('#message').append("<img id='checkmark' src='images/check.png' />");
		  });
    }
  });
  return false;

    });
  });
  
