/* <![CDATA[ */
$().ready(function(){
				   
	$("a[rel^='fancybox']").fancybox({
		'zoomSpeedIn': 1000,
		'zoomSpeedOut': 0,
		'overlayShow': true,
		'titlePosition': 'inside',
		'titleFormat' : function(title, currentArray, currentIndex, currentOpts) {
			return title + '<br />Obrázek ' + (currentIndex + 1) + ' / ' + currentArray.length;
		}
	});
	
	$('#det-foto a').append('<span class="zvetsit">Zvětšit fotografii</span>');

	$('.product .product-image a').css('paddingTop', '10px');
	$('.product')
		.bind('mouseover', function (e) {
			$('.product-image a', this).stop().animate({paddingTop: '0'}, {queue: false, duration: 400, easing: "easeInOutExpo"});
		})
		.bind('mouseout', function () {
			$('.product-image a', this).stop().animate({paddingTop: '10px'}, {queue: false, duration: 400, easing: "easeInOutExpo"});
		});
	
	$('table.zebruj > tr:even, table.zebruj > tbody > tr:even').addClass('zebra');
	$('.parametry tr:nth-child(even)').addClass('zebra');
	
	$('table.zebruj tr').hover(
    function() {
     	 $(this).addClass('hover');
   		}, function() {
      	$(this).removeClass('hover');
   		}
  	);
	
	$(".detailform").validate({
		errorElement: "em",
		errorPlacement: function(error, element) {
			element.parent().find(".chyba").html(error);
		},
		meta: "validate"
	});
		
	$("#dotaz form").validate({
	  errorElement: "em",
	  errorPlacement: function(error, element) {
			error.insertAfter(element.next("span"));
		},
		rules: {
			content: "required",
			ch: "deset",
			email: {
				required: true,
				email: true
			}
		},
		messages: {
			content: "<br />Prosíme, zadejte Váš dotaz.",
			email: "<br />Prosíme, zadejte správnou emailovou adresu."
		}
	});
	$.validator.addMethod("deset", function(value) {
		return value == "deset";
	}, '<br />Prosíme, zadejte "deset" bez uvozovek.');
	
	$(".newsletter form").validate({
	  errorElement: "span",
	  errorPlacement: function(error, element) {
			error.insertAfter(element.parent());
		},
		rules: {
			newsletteremail: {
				required: true,
				email: true
			}
		},
		messages: {
			newsletteremail: "E-mail není platný."
		}
	});

});

function zobrazSkryj(idecko){
	el=document.getElementById(idecko).style;
	el.display=(el.display == 'none' || el.display == '') ? 'block' : 'none';
}
/* ]]> */
