	$(function(){
		$("#contact").validate({
			renderInvalid: function(field, errorMsg){
				$("#" + field.attr('name') + "Div").remove();
				field.removeClass("invalid").addClass("invalid").after("<div class='invalid' id='" + field.attr("name") + "Div" + "' title='" + errorMsg + "'>&nbsp;</div>");
				$("#" + field.attr('name') + "Div div.displayContainer").hide();
				// adjust placement of div's after textarea
				if(field.tagName == 'TEXTAREA'){
					var topMargin = $("#" + field.attr('name')).height();
					$("#" + field.attr('name') + "Div").css('marginBottom', topMargin);
				}
			},
			renderValid: function(field){
				$("#" + field.attr('name') + "Div").remove();
				field.removeClass("invalid").after("<div class='valid' id='" + field.attr('name') + "Div" + "'>&nbsp;</div>");
				// adjust placement of div's after textarea
				if(field.tagName == 'TEXTAREA'){
					var topMargin = $("#" + field.attr('name')).height();
					$("#" + field.attr('name') + "Div").css('marginBottom', topMargin);
				}
			},
			highlightError: function(field){
				// hide all error messages
				$("div.invalid div.displayContainer").hide();
				// unhide current message
				$("#" + field.attr("name") + "Div div.displayContainer").show();
			}
		});
		$("textarea").autogrow();
		
	});		