/* <![CDATA[ */
$.fn.clearForm = function() {
  return this.each(function() {
    if (this.tagName.toLowerCase() == "form") {
      return $(":input",this).clearForm();
    }
    switch (this.type) {
      case "password":
      case "textarea":
      case "text":
        this.value = "";
        break;
      case "select-multiple":
      case "select-one":
        this.selectedIndex = -1;
        break;
      case "radio":
      case "checkbox":
        this.checked = false;
        break;
    }
  });
};

 jQuery(document).ready(function(){
                // binds form submission and fields to the validation engine
                jQuery("#QuickQuoteform").validationEngine('attach', { promptPosition : "topLeft"});

				jQuery("#QuickQuoteform").bind("jqv.form.validating", function(event){
					jQuery("#hookError").html("")
				})

				jQuery("#QuickQuoteform").bind("jqv.form.result", function(event , errorFound){
					if(errorFound) jQuery("#hookError").append("There is some problems with your form");
				});
				jQuery('a#after_order_Message_close').click(function(){
					jQuery('#Email_Template' ).hide().remove();
					jQuery('#Email_Message'  ).hide().remove();
					jQuery("#QuickQuoteform").clearForm();
					});

});
/* ]]> */

