$(document).ready(function() {
	$("#newAccountForm").validate({
		rules: {
			haslo1: {
				required: true,
				minlength: 5
			},
			haslo2: {
				required: true,
				minlength: 5
			},
			Email: {
				required: true,
				email: true
			}
		},
		messages: {
			haslo1: {
				required: "Proszę wpisać hasło.",
				minlength: "Proszę wpisać co najmniej 5 znaków."
			},
			haslo2: {
				required: "Proszę wpisać hasło.",
				minlength: "Proszę wpisać co najmniej 5 znaków."
			},
			Email: {
				required: "Proszę wpisać adres email.",
				email: "Proszę wpisać adres email."
			}
		},
		errorPlacement: function(error, element) {
			error.appendTo(element.parent("td").parent("tr").prev("tr").find("td.error"));
		}
	});
});
