$(document).ready(function()
{
	$("form.validated").each(function() {
		$(this).validate({
			invalidHandler: function(e, validator) {
				var errors = validator.numberOfInvalids();
				if (errors) {$(this).find("#errors").show();} 
				else {$(this).find("#errors").hide();}
	
				if ($(".anythingSlider").length) {reset_panel($("li.panel:last"));}
			},
			errorPlacement: function(error, element) {
				if (element.attr("type") == "radio" && element.parent().find("span.error").length == 0) {
					element.before('<span class="error">Required</span>');
				}
				return true;
			},
			focusInvalid: false
		})
	});
});
