/*requires jquery-ui.js & jquery.validate.js */

jQuery.validator.addMethod("invalidchars", function(value, element) {
	return value == '' || /^[^=<>\^~`\|\]\[\{\}]+$/i.test(value);
}, "'=<>^~`|][{}' characters are invalid");

$().ready(function() {     
    $("label.error").hide();
       //$(".required").prev("label").addClass("required");   
	$(':input, texarea').addClass("invalidchars");   
	// validate form when it is submitted   
    $("#submitform").validate({ 		 				   
		 errorLabelContainer: "#messageBox",
         wrapper: "li",					  
	     messages: { 
	     	accept_conditions: "A quote cannot be issued until you check the box acknowledging you have read and accepted the statements listed on the page" 
	  	}, 						  
	  	submitHandler:function(form) { 			    
			//if (!$.cookie('accept_terms')){  
            //  $.cookie('accept_terms', 'yes', 48, { path: '/' });	 	
	        //}					 	    	
        	form.submit();
   	  	}
    });      
});