/*
 * JavaScript Ajax Form
 * (12-DEC-2009)
 * 
 *
 * 
 * 
 *   
 *   
 */

$(document).ready(function(){
  
  //bind form using 'ajaxForm' 
  $('#contact-form').ajaxForm({  
    target:"#hiddenDIV", 
    beforeSubmit:function() {
       $("#msg").html("Sending...");
       $("#msg").css({border:"1px solid #CCCCCC", backgroundColor:"#F2F2F2", paddingTop:"10px", paddingBottom:"10px", marginTop:"10px", marginBottom:"10px"});
    },
    success:function(response) {
      if (response=="success") {
        $("#contact-form").resetForm();
        $("#msg").html("Thank you for your enquiry.");
        
      } else {
        $("#msg").html(  $("#hiddenDIV #content ul").html() );
        $("#hiddenDIV").empty(); 
      }
    }
  });

});
