// fancybox
$(document).ready(function() {
	/*
	*   Examples - images
	*/

	$("#baner_left").fancybox({
											'autoScale'		: false,
		});
	$("#sportowy_dentysta").fancybox({
											'autoScale'		: false,
											'margin'			: 10
		});

});

function pokaz_opis(id) {
  document.getElementById(id).style.display="block";
}
function ukryj_opis(id) {
  document.getElementById(id).style.display="none";
}

function dodaj_plik(kontener){
	var znacznik = document.createElement('input');
	znacznik.setAttribute('type', 'file');
	znacznik.setAttribute('name', 'plik_z_grafika[]');
	znacznik.className = 'formularz';
	var kontener = document.getElementById(kontener);
	kontener.appendChild(znacznik);
}

// initialise plugins
jQuery(function(){
	jQuery('ul.sf-menu').superfish({ 
            delay:       1000,                            // one second delay on mouseout 
            animation:   {opacity:'show',height:'show'},  // fade-in and slide-down animation 
            speed:       'fast',                          // faster animation speed 
            autoArrows:  false,                           // disable generation of arrow mark-up 
            dropShadows: true                            // disable drop shadows 
        }); 
});

// wakidacja formularza
$.validator.setDefaults({
	highlight: function(input) {
		$(input).addClass("zaznaczony");
	},
	unhighlight: function(input) {
		$(input).removeClass("zaznaczony");
	}
});

$(document).ready(function() {
            $("#form1").validate({
                submitHandler:function(form) {
                    SubmittingForm();
                },
                rules: {
                    imie: "required",       // simple rule, converted to {required:true}
                    nazwisko: "required",       // simple rule, converted to {required:true}
                    email: {                // compound rule
															required: true,
															email: true
													 },
                    daneVAT: "required",       // simple rule, converted to {required:true}
                    nip: 	 {                // compound rule
															required: true,
													 }
                }
            });
        });
//--------------zgloszenie---------------
$(document).ready(function() {
            $("#form2").validate({
                submitHandler:function(form) {
                    SubmittingForm();
                },
                rules: {
                    termin: "required"      // simple rule, converted to {required:true}
 												},
               messages: {
								 					termin:{
																				required: "<br>** wybierz termin **"
																			}
                					}
            });
        });

//--------------newsletter---------------
$(document).ready(function() {
            $("#form3").validate({
                submitHandler:function(form) {
                    SubmittingForm();
                },
                 rules: {
                   email: {                // compound rule
															required: true,
															email: true
													 }
								 }
            });
        });



