$(document).ready(function(){
$("#contact_form").validate({

showErrors: function() {
	for ( var i = 0; this.errorList[i]; i++ ) {
		this.settings.highlight.call( this, this.errorList[i].element,
this.settings.errorClass );
}
                
	if (this.settings.unhighlight) {
                        
	for ( var i = 0, elements = this.validElements(); elements[i]; i++ ) {
                                
	this.settings.unhighlight.call( this, elements[i],
this.settings.errorClass );
                       
	}
                
	}
        
	},

highlight: function(element, errorClass) {
     $(element).addClass(errorClass);
  },
  unhighlight: function(element, errorClass) {
     $(element).removeClass(errorClass);
  },

rules: {

	name: {
		required: true,
		minlength: 2,
		maxlength: 55,
	},

	email: {
		required: true,
		email: true,
	},

	inquiry: {
		required: true,
		minlength: 5,
		maxlength: 1024,
	},
},

invalidHandler: function(form, validator) {
      
			var errors = validator.numberOfInvalids();
      
			if (errors) {
        
			alert("Whoops, please go back and fill in the form fields highlighted in red.")
      
				}
    
				}

});
});