// starting the script on page load

$(document).ready(function(){
	
    $('.slideshow').cycle({
		fx: 'fade', 
		speed: 4000, 
		timeout: 4000 	
	});		
	
	if($("#nav")) {
		$("#nav dd").hide();
		$("#nav dt strong").click(function() {
			if(this.className.indexOf("clicked") != -1) {
				$(this).parent().next().slideUp(200);
				$(this).removeClass("clicked");
			}
			else {
				$("#nav dt strong").removeClass();
				$(this).addClass("clicked");
				$("#nav dd:visible").slideUp(200);
				$(this).parent().next().slideDown(500);
			}
			return false;
		});
	}
	
	$("a[rel=foto-group]").fancybox({
		'transitionIn'		: 'none',
		'transitionOut'		: 'none',
		'titlePosition' 	: 'over',
		'titleFormat'		: function(title, currentArray, currentIndex, currentOpts) {
			return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
		}
	});	
	
	
	// oblacek po rezervaci zajezdu
	//if(document.getElementById('cloud').style.display == 'block'){
		//$('#cloud').delay(2000).fadeOut(1000);
	//}
	
	// obecny oblacek
	//if(document.getElementById('cloud-general').style.display == 'block'){
		//$('#cloud-general').delay(2000).fadeOut(1000);
	//}	

});


