// JavaScript Document

$(document).ready(function() {
	
		$("a.send").fancybox({
			'width'             : '75%',
			'height'            : '75%',
			'autoScale'         : false,
			'transitionIn'      : 'none',
			'transitionOut'     : 'none',
			'type'              : 'iframe'
		});

		//http://www.bxslider.com/
		//detail produktu
		var pocetObrazku = $("#slider1 img").length;	
    //$("span.kuk").text("Počet obrázků je " + pocetObrazku + ".");
		if (pocetObrazku < 5) {
		$('#slider1').bxSlider({
				infiniteLoop: false,
				controls: false,
		    displaySlideQty: 4
		});
		} else {
		$('#slider1').bxSlider({
		    displaySlideQty: 4,
		    moveSlideQty: 2
		});
		}

		
		//http://www.sohtanaka.com/web-design/simple-tabs-w-css-jquery/

		//When page loads...
		$(".tab_content").hide(); //Hide all content
		$("ul.tabs li:first").addClass("active").show(); //Activate first tab
		$(".tab_content:first").show(); //Show first tab content
	
		//On Click Event
		$("ul.tabs li").click(function() {
	
			$("ul.tabs li").removeClass("active"); //Remove any "active" class
			$(this).addClass("active"); //Add "active" class to selected tab
			$(".tab_content").hide(); //Hide all tab content
	
			var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
			$(activeTab).fadeIn(); //Fade in the active ID content
			return false;
		});


		 //alert("OK");
		  
		//prid class poslednimu li v danem ul
		$('ul.ul li:last-child, .menuprint ul li:last-child').addClass("last");

		// animace produkt 
		
			$(".popis-in").css('top', '80px');
						
			$(".zbozi").hover(function () {
				$(this).find(".popis-in").animate({ 
					top: "0"
				}, 200 );
			}, function() {
				$(this).find(".popis-in").animate({ 
					top: "80px"
				}, 300 );
			});

			// animace seradit 

			$(".podle").css('display', 'none');
			$(".razeni").hover(function () {
				$(".podle").fadeIn('fast');
			}, function() {
				$(".podle").fadeOut('fast');
			});

			
		 	$(".img").lightBox();
		 	$(".pager, .detail .nahled").lightBox();
	
			//stridani barvy
			$('.table tr:even').addClass('tr2');
			
			$('.onas:even').addClass('even');
			$('.onas:odd').addClass('odd');
			
      //onmouseover
			$(".table tr").mouseover(function() {
      	$(this).addClass("over");
			});
			$(".table tr").mouseout(function() {
				$(this).removeClass("over");
			});	
				
			

});	


