/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


 $(document).ready(function(){
     
 		var required = "To pole jest wymagane";
 		var evt = $.browser.msie ? "click" : "change";
				var doValidacji = {
					rules: {
                        platnosc: {
                            required:true
                        },
                        policy: {
                            required:true
                        },
                        wysylka: {
                            required:true
                        },
						kontakt_email: {
							required: true,
							email: true
						},
						kontakt_imie: {
							required: true,
							minlength: 2
						},
						kontakt_nazwisko: {
							required: true,
							minlength: 2
						},
//						kontakt_telefon: {
//							required: true,
//							minlength: 9
//						},
						wysylka_adres: {
							required: true,
							minlength: 4
						},
						wysylka_kod_pocztowy: {
							required: true,
							postCode: true
						},
						wysylka_miejscowosc: {
							required: true,
							minlength: 3
						}
					},
					messages: {
                        platnosc: {
                            required: "Wybierz formę płatności"
                        },
                        policy: {
                            required: 'Musisz wyrazić zgodę'
                        },
                        wysylka: {
                            required: 'Wybierz formę wysyłki'
                        },
						kontakt_email: {
							required: "To pole jest wymagane",
							email: "Proszę podać właściwy email"
						},
						kontakt_imie: {
							required: "To pole jest wymagane",
							minlength: "Proszę podać właściwe imię!"
						},
						kontakt_nazwisko: {
							required: "To pole jest wymagane",
							minlength: "Proszę podać właściwe nazwisko!"
						},
//						kontakt_telefon: {
//							required: "Pole wymagane ze względu na obsługę kurierską",
//							minlength: "Proszę podać właściwy numer telefonu!"
//						},
						wysylka_adres: {
							required: "To pole jest wymagane",
							minlength: "Proszę podać właściwy numer telefonu!"
						},
                        wysylka_kod_pocztowy: {
							required: "To pole jest wymagane",
							postCode: "Proszę podać właściwy kod pocztowy"
						},
                        wysylka_miejscowosc: {
							required: "To pole jest wymagane",
							minlength: "Proszę podać właściwą miejscowość!"
						}

					}
				};


		$("#dalej_st1").click( function () {
            
			$("#order_form-step1 form").validate(doValidacji);
		});


});

