function submitFrom() {
  var d = $("#contact_form").serialize()
  $("#spinner").show()
  
  $.ajax({
    type: "POST",
    url: "/contact.php",
    data: d,
    success: function(msg){
      $("#spinner").hide()
      
      if(msg.match(/^OK/) != null) {
        $("#message_box").html('<div class="msg">'+$("#message_success").html()+'</div>')
        $('#contact_form').clearForm()
      } else {
        $("#message_box").html('<div class="msg">'+$("#message_error").html()+'</div>')
      }
    }
  });

  $("#verification_image").attr("src" ,"securimage/securimage_show.php?sid=" + Math.random())
  $("#code").val("")

  return false;
}

$.fn.clearForm = function() {
  return this.each(function() {
 var type = this.type, tag = this.tagName.toLowerCase();
 if (tag == 'form')
   return $(':input',this).clearForm();
 if (type == 'text' || type == 'password' || tag == 'textarea')
   this.value = '';
 else if (type == 'checkbox' || type == 'radio')
   this.checked = false;
 else if (tag == 'select')
   this.selectedIndex = -1;
  });
};
