$(document).ready(function() {
	
	
	
	var $sequence = $('div[class$=photo-box]'), div = 0;
	 
	setTimeout(
				function()
				{	
					$($sequence[div++]).animate({ left: "0px "}, arguments.callee);
				},
				1300
			  );

	
	$().piroBox({
		  my_speed: 400, //animation speed
		  bg_alpha: 0.2, //background opacity
		  slideShow : true, // true == slideshow on, false == slideshow off
		  slideSpeed : 3, //slideshow
		  close_all : '.piro_close, .piro_overlay' // add class .piro_overlay(with comma)if you want overlay click close piroBox
	});

	$("#ie-check").ie6warning();
	
	/*$(".seznambox span", this).click(
		function ()
		{	
			$(".seznam-submenu").toggle("slow");
		}
	);*/
	
//	var vyskaXXX = $(document).height()
//	alert(vyskaXXX);
	
	
	$(".menu-button").hover(
		function()
		{
			var submenu = $("> .submenu", this);
			if ( submenu.css("display") == "none" )
			{
				submenu.fadeIn('fast');
			}
		},
		function()
		{
			$("> .submenu", this).fadeOut('fast');
		}
	);
	
	$(".photo-box").hover(
		function()
		{
			var submenu = $(".slideup-button-center p", this);
			if ( submenu.css("display") == "none" )
			{
				submenu.show('fast');
			}
		},
		function()
		{
			$(".slideup-button-center p", this).hide('fast');
		}
	); 

	$(".slidetabs").tabs(".rotate-index > div", {
	
			// enable "cross-fading" effect
			effect: 'slide',
			fadeOutSpeed: 1000,
			fadeInSpeed: 1000,
		
			// start from the beginning after the last tab
			rotate: true
			
		
		// use the slideshow plugin. It accepts its own configuration
		}).slideshow(
		{
			autoplay: false,
			interval: 3000
		}
	);

	
	// setup ul.tabs to work as tabs for each div directly under div.panes
	$("ul.tabs").tabs("div.panes > .panefaderdiv", 
							
						{
							effect: 'fade'
						}
	);
	

	
	
	
	
	
	
	$(".nahledy-produkt img").click(function() {
	
		// see if same thumb is being clicked
		if ($(this).hasClass("active")) { return; }
	
		// calclulate large image's URL based on the thumbnail URL (flickr specific)
		var url = $(this).attr("src");
		
		// calclulate large image's URL based on the thumbnail URL (flickr specific)
		var alt = $(this).attr("alt");
	
		// get handle to element that wraps the image and make it semi-transparent
		var wrap = $("#image_wrap").fadeTo("medium", 0.5);
	
		// the large image from www.flickr.com
		var img = new Image();
	
	
		// call this function after it's loaded
		img.onload = function() {
	
			// make wrapper fully visible
			wrap.fadeTo("fast", 1);
	
			// change the image
			wrap.find("img").attr("src", url);
			wrap.find("a").attr("href", url);
	
		};
	
		// begin loading the image from www.flickr.com
		img.src = url;
	
		// activate item
		$(".nahledy-produkt img").removeClass("active");
		$(this).addClass("active");
	
	// when page loads simulate a "click" on the first image
	}).filter(":first").click();

	
	
	
	
	
	
	
	
//	$(".fbDarkWidget, .uiBoxWhite, .fbConnectWidgetTopmost").css({
//			"border" : "0px",
//			"border-width" : "0px",
//			"border-color" :"transparent"
//	});

});


