
	













function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
 
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
 
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};





jQuery(document).ready(function() {
    jQuery('#galeria').jcarousel({
        scroll: 1,
    });
    jQuery('#galeria2').jcarousel();
    jQuery('#galeria3').jcarousel();
    jQuery('#galeria4').jcarousel();
    jQuery('#galeria5').jcarousel();
    jQuery('#galeriaauto').jcarousel({
        auto: 4,
        scroll: 1,
        wrap: 'last',
        initCallback: mycarousel_initCallback
    });
    jQuery("").jcarousel();
});








$(document).ready(function(){	

    		var topPanel	= $("#topPanel"),
				panelHandle	= $("#topPanelHandle"),
				height		= 0,
				wrapHeight	= 0,
				imgs		= topPanel.find("img"),
				imgsNum		= imgs.length,
				readyImg	= 0;
        			
			// If there are images in the toppanel
			// load them before initializing the toggle effect
			if( imgsNum ){
				imgs.each(function(){
					$(this).load(function(){
						readyImg++;
						initTopPanel();
					});
				});
			}else{
				initTopPanel();
			}
			
			function initTopPanel(){
				if( imgsNum === readyImg ){
					height		= topPanel.height();
					
					topPanel.css({ display : "block" });
					wrapHeight	= topPanel.find(".wrap").height();
					
					topPanel.css({
						marginTop	: -height,
						height		: height,
						display		: "block",
						overflow	: "visible"
					});
					
					topPanel.find(".wrap").css({
						height		: wrapHeight,
						display		: "block",
						overflow	: "visible"
					});
					
					// Open / Close Panel
					panelHandle.click(function(){
						if( !$(this).hasClass("close") ){
							topPanel.animate({
								marginTop	: 0
							}, 350, function(){
								panelHandle.addClass("close")
							});
						}else{
							topPanel.animate({
								marginTop	: -height
							}, 350, function(){
								panelHandle.removeClass("close")
							});
						}
					});
					
					// Open the panel by clicking on a link that point to #topPanel
					$('a[href="#topPanel"]').click(function(){
						$('html, body').animate({  
							scrollTop: 0  
						}, 300);
						panelHandle.trigger("click");
						return false;
					});
				}
			}
		
		

   });












$(window).load(function()
{
	//this is intended to wait for all the images to load before running the slideshow
	init_slideshow()
})
init_slideshow = function()
{
	$('#slides').cycle({
		fx:'fade',
		timeout:8000,
		pager:'#slide_navigation',
		after:update_slide_caption,
		before:fade_slide_caption
	})
}
fade_slide_caption = function(next, previous)
{
	caption_container = $('#project_caption')
	caption_container.fadeOut('fast')
}
update_slide_caption = function(next, previous)
{
	caption_container = $('#project_caption')

	caption = $('span.slide_caption', previous)
	caption_container.fadeIn('fast')
	caption_container.html(caption.html())
	
}




		$(document).ready(function(){
			// Lets make the top panel toggle based on the click of the show/hide link	
      $("#top-panel").hide();
			
			$("#rezervacia-footer, #zavriet-rezervacia, #rezervacia-kontakt").live('click',function(){
                // Toggle the bar up 
                $("#top-panel").slideToggle();	
                // Settings
                var el = $(".shText");  
                // Lets us know whats inside the element
                var state = $(".shText").html();
                // Change the state  
                state = (state == 'Hide' ? 'Show' : 'Hide');					
                // Finally change whats insdide the element ID
                el.replaceWith(state); 
            }); // end sub panel click function
//        }); // end on DOM
        



//		$(document).ready(function() {
 
			$.featureList(
				$("#mapaTxt tr.trLink"),
				$("#mapaImg li"), {
					start_item	:	0
				}
			);
 
			/*
			
			// Alternative
 
			
			$('#tabs li a').featureList({
				output			:	'#output li',
				start_item		:	1
			});
 
			*/
 
		});

    $(document).ready(function(){
			$("a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
		});
