$(document).ready( function() {
    $("#clientForm").validate({
    	
    	rules: {
    		cemail: {
    			required: true,
    			email: true,
    			remote: "/client/checkemail"
    		},
    		cpassword: {
				required: true,
				minlength: 5
			},
			crepassword: {
				required: true,
				minlength: 5,
				equalTo: "#cpassword"
			},
			cfirstname: {
				required: true,
				minlength: 2
			},
			czipcode: {
				zipcode2: "#idCountry"
			},
			clastname: {
				required: true,
				minlength: 2
			},
			cstreet: {
				required: true,
				minlength: 2
			},
			ccity: {
				required: true,
				minlength: 2
			}
    	},    	
    	messages: {
    		cemail: {
    			required: "Proszę podać adres e-mail",
    			email: "Proszę podać poprawny adres e-mail",
    			remote: "Podany adres e-mail jest już zarejestrowany"
    		},
    		cpassword: {
    		    required: "Proszę podać hasło",
    		    minlength: "Zbyt krótkie hasło (min. 5 znaków)"
    		},
    		crepassword: {
    		    required: "Proszę podać ponownie hasło",
    		    minlength: "Proszę podać to samo hasło",
    		    equalTo: "Proszę podać to samo hasło"
    		},
    		czipcode: {
				zipcode2: "Proszę podać prawidłowy kod pocztowy",
				required: "Proszę podać prawidłowy kod pocztowy"
			},
    		cfirstname: {
    		    required: "Proszę podać imię",
				minlength: "Proszę podać imię"
    		},
    		cphone: {
    		    phone: "Proszę podać numer telefonu"
    		},
    		clastname: {
    		    required: "Proszę podać nazwisko",
				minlength: "Proszę podać nazwisko"
    		},
    		cstreet: {
    		    required: "Proszę podać ulice",
				minlength: "Proszę podać ulice"
    		},
    		ccity: {
    		    required: "Proszę podać miejscowość",
				minlength: "Proszę podać miejscowość"
    		}
    	}
    	
    });} );

