		jQuery(function(){
			jQuery('ul.sf-menu').superfish();
		});
    $(document).ready(function(){ 
        $(document).pngFix(); 
    }); 
	
$(window).load(function() {
	$('#slider').nivoSlider({
		effect:'fade', //Specify sets like: 'fold,fade,sliceDown'
		slices:18,
		animSpeed:500, //Slide transition speed
		pauseTime:7000,
		startSlide:0, //Set starting Slide (0 index)
		directionNav:true, //Next & Prev
		directionNavHide:true, //Only show on hover
		controlNav:true, //1,2,3...
		controlNavThumbs:false, //Use thumbnails for Control Nav
      controlNavThumbsFromRel:true, //Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', //Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
		keyboardNav:true, //Use left & right arrows
		pauseOnHover:true, //Stop animation while hovering
		manualAdvance:false, //Force manual transitions
		captionOpacity:0.8 //Universal caption opacity
	});
});	


$.validator.setDefaults({
	submitHandler: function() 
			{ 
			var name = $('input[name=name]');
			var email = $('input[name=email]');
			var text = $('textarea[name=text]');
			var tel = $('input[name=tel]');
			var firma = $('input[name=firma]');
			var data = 'name=' + name.val() + '&firma=' + firma.val() + '&tel=' + tel.val() + '&email=' + email.val() + '&text='  + encodeURIComponent(text.val());
			$.ajax({
			url: "contact.php",	
			type: "get",	
			data: data,				
			cache: false,
			beforeSend: function(){
							$('#contact-load').css('visibility','visible');
                            $('#contact-load').fadeIn();
			},

			success: function(data){
							$('#contact-load').fadeOut();
							$('#poszlo').css('visibility','visible');
                            $('#poszlo').fadeIn();
							$('#poszlo').delay(4000).fadeOut();
                            }

			}); 
			return false;
			}
});
