// extend the current rules with new groovy ones
	
	// this one requires the text "buga", we define a default message, too
	$.validator.addMethod("buga", function(value) {
		return value == "buga";
	}, 'Please enter "buga"!');
	
	// this one requires the value to be the same as the first parameter
	$.validator.methods.equal = function(value, element, param) {
		return value == param;
	};
	
	$.meta.setType("attr", "valide");

	$().ready(function() {
		var validator = $("#formcontact").validate({
			debug: false,
			errorElement: "em",
			errorContainer: $("#warning"),
			showErrors: function(errors, errorList) {
				//$("#summary").html("Your form contains " + errorList.length + " errors, see details below.");
				validator.defaultShowErrors();
			},
			errorPlacement: function(error, element) {
				error.appendTo( element.parent("div"));
			},
			success: function(label) {
				label.text("ok!").addClass("success");
			}
		});
		
		var i = 0;
		$("#add").click(function() {
			$("<div><label>plus...</label><input test='required:true' name='list" + i++ + "' /></div>")
				.appendTo("#formLocation");
			validator.refresh();
		});
	});