  $(function() {
    $('.contactError').hide();
    $(".submit").click(function() {
      // validate and process form here
      
      $('.contactEerror').hide();
  	  var firstname = $("input#firstname").val();
  		if (firstname == "") {
        $("#name_error").show();
        $("input#firstname").focus();
        return false;
      }
  		var email = $("input#email").val();
  		if ((email == "")||(email.indexOf('@') < 0) || ((email.charAt(email.length-4) != '.') && (email.charAt(email.length-3) != '.'))) {
        $("#email_error").show();
        $("input#email").focus();
        return false;
      }	
	var lastname = $("input#lastname").val(); 
	var phonenumber = $("input#phonenumber").val(); 
	var company = $("input#company").val(); 
	var learn = $("input#learn").val();    
	var location = $("input#location").val();
	var message = $("textarea#message").val();
  
  var dataString = 'firstname='+ firstname + '&lastname=' + lastname + '&phonenumber='+ phonenumber + '&email=' + email + '&company=' + company + '&location=' + location + '&learn=' + learn + '&message=' + message;
  //alert (dataString);return false;
  $.ajax({
    type: "POST",
    url: "process.php",
    data: dataString,
    success: function() {
      $('#contactform').html("<div id='success'></div>");
      $('#success').html("<h4>Contact Form Submitted!</h4><p>Thanks! Please enjoy the rest of the Website.</p>")
      .hide()
      .fadeIn(1500);
    }
  });
  return false;
	  
    });
  });
