 
  $(function() {
    $('.error').hide();
    $(".button").click(function() {
      // validate and process form here

      $('.error').hide();
  	  var name = $("input#name").val();
  		if (name == "") {
        //$("label#name_error").show();
		$("label#name_error").slideDown("slow");
        $("input#name").focus();
        return false;
      }
  		var email = $("input#email").val();
  		if (email == "" ) {
        $("label#email_error").slideDown("slow");
        $("input#email").focus();
        return false;
      }
  		var phone = $("input#phone").val();
  		if (phone == "") {
        $("label#phone_error").slideDown("slow");
        $("input#phone").focus();
        return false;
      }
	  var captcha = $("input#captcha").val();
	  var expectedvalue= document.getElementById('expected').value;
	    if (captcha != expectedvalue ) {
		  $("label#captcha_error").slideDown("slow");
		  $("input#captcha").focus();
		  return false;
	    }
	  
	  var request = $("textarea#request").val();
  		if (request == "") {
        $("label#request_error").slideDown("slow");
        $("input#request").focus();
        return false;
      }

      var dataString = 'name='+ name + '&email=' + email + '&phone=' + phone + '&request=' + request;
   
  //alert ("Getting here!" + $_SESSION['expect']);
//  return false;

  $.ajax({
    type: "POST",
    url: "bin/processForm.php",
    data: dataString,
    success: function() {
	  $('#contact_form').fadeOut();
      $('#messageSent').fadeIn();
	  if( !$isIE6 ){
	    $('#contactFormSpace').delay(2000).slideUp('slow'); 
	  }
    },
	error: function() {
	  $('#contact_form').fadeOut();
	  $('#errorOccurred').fadeIn();	
	  
	  if( !$isIE6 ){
	    $('#contactFormSpace').delay(2000).slideUp('slow'); 
	  }
	}
  });
  return false;
    });
  });
  
  
