$(function() {  
  $(".button_submit").click(function() {  
    // validate and process form here  
  });  
}); 

$(function() {  
  $('.error').hide();  
  $(".button_submit").click(function() {  
    // validate and process form here  
  
    $('.error').hide();  
      var firstname = $("input#firstname").val();  
        if (firstname == "") {  
      $("label#error_firstname").show();  
      $("input#firstname").focus();  
      return false;  
    }  
    
        $('.error').hide();  
      var lastname = $("input#lastname").val();  
        if (lastname == "") {  
      $("label#error_lastname").show();  
      $("input#lastname").focus();  
      return false;  
    } 
        var email = $("input#email").val();  
        if (email == "") {  
      $("label#error_email").show();  
      $("input#email").focus();  
      return false;  
    }  
        var message = $("textarea#message").val();  
        if (message == "") {  
      $("label#error_message").show();  
      $("textarea#message").focus();  
      return false;  
    }  
  
  var dataString = 'first name='+ firstname + '&lastname' + lastname + '&email=' + email + '&message=' + message;  
//alert (dataString);return false;  
$.ajax({  
  type: "POST",  
  url: "bin/contactus.php",  
  data: dataString,  
  success: function() {  
    $('#contactus_form').html("<div id='msg'></div>");  
    $('#msg').html("<h2>Email Submitted!</h2>")  
    .append("<p>Your message will be answered as soon as possible.</p>")  
    .hide()  
    .fadeIn(1500, function() {  
      
    });  
  }  
});  
return false;  
  
  });  
});  
