 $(document).ready(function(){

		function home_menu() {
		$(".menu_home_pasik").animate({width: "477px", opacity: "0.70"},  3000);
		setTimeout(function(){
			$(".menu_home").animate({opacity: "1"}, 1000);
			},
			3000);
		}
		
		function home_backgrounds() {
		$('.home' + n ).fadeIn(1500);
		$('.home' + n ).fadeOut(2000, home_backgrounds );
		n++;
		if ( n > 4 ) { n=1; }
		} 
		
		
		function private_gallery_next() {
		if ( s == 24 ) { $('.photo23' ).fadeOut(1500); s=1;   }
		$('.photo' + (s - 1) ).fadeOut(1500);
		$('.photo' + s ).fadeIn(1500);
		s++;
		
		if ( s == 1 ) { $('.photo23' ).fadeOut(1500);   }
		if ( s > 24 ) { s=1; };
		
		}  
		
		function private_gallery_prev() {
		$('.photo' + (s - 1) ).fadeOut(1500);
		$('.photo' + (s - 2) ).fadeIn(1500);
		s--;	
		if ( s == 1 ) { $('.photo23' ).fadeIn(1500); };
		if ( s < 2 ) {  s=24; };
		}  
		
		function bio_next() {
		if ( e < 5 ) {$(".bio_article").scrollTo($('#bio' + e ), 1000); e++; };
		if ( e == 5 ) {$(".next").fadeOut(500);   } ;
		$(".prev").fadeIn(500);
     	}
		
		function bio_prev() {
		if ( e > 2 ) {e--; $(".bio_article").scrollTo($('#bio' + (e - 1) ), 1000);  };
		if ( e == 2  ) {$(".prev").fadeOut(500);   } ;
		$(".next").fadeIn(500);
     	}
		
		
		function news_next() {
		if ( news < 5 ) {$(".news_holder").scrollTo($('#news_' + news ), 1000); news++; };
		if ( news == 5 ) {$(".next").fadeOut(500);   } ;
		$(".prev").fadeIn(500);
     	}
		
		function news_prev() {
		if ( news > 2 ) {news--; $(".news_holder").scrollTo($('#news_' + (news - 1) ), 1000);  };
		if ( news == 2  ) {$(".prev").fadeOut(500);   } ;
		$(".next").fadeIn(500);
     	}
		
		var news=5;
		var e=2;
		
		
		var n=1;
		var s=5;

		$(".navigation").localScroll({
		   target:".bio_article"
		});
		$(".navigation .prev").fadeOut(1);
		$(".navigation .prev").click(function() {
				bio_prev();
				$(this).css({'color':'#ffffff'});
				$(".next").css({'color':'#a39d9d'});
		});
		
		$(".navigation .next").click(function() {
				bio_next();
				$(this).css({'color':'#ffffff'});
				$(".prev").css({'color':'#a39d9d'});
		});
		
		
		
		$(".sprava").css("opacity","0")
		$(".sprava p").css("opacity","0")
		
		$(".sprava").hover(function() {
				$(this).stop().animate({opacity: "0.95"}, 200);
				$(".sprava p").stop().animate({opacity: "0.95"}, 200);
		},  
		function() {  
				$(this).stop().animate({opacity: "0.01"}, 1000);
				$(".sprava p").stop().animate({opacity: "0.01"}, 1000);
		});
		
		
		
		
		
		$(".news_navigation").localScroll({
		   target:".news_holder"
		});
		
		
		
		$(".news_navigation .next").fadeOut(1);
		$(".news_navigation .prev").click(function() {
				news_prev();
				$(this).css({'color':'#ffffff'});
				$(".next").css({'color':'#a39d9d'});
		});
		
		$(".news_navigation .next").click(function() {
				news_next();
				$(this).css({'color':'#ffffff'});
				$(".prev").css({'color':'#a39d9d'});
		});
		
		
		
		
		
		$(".menu_home_pasik").css("width","0").css("opacity","0");
		$(".menu_home").css("opacity","0");
	
	
		home_menu();
		home_backgrounds();
		
		$(".photo4").fadeIn(1500);
		
		$("#gallery_next").click(function() {
			private_gallery_next();
		});
		
		$("#gallery_prev").click(function() {
			 private_gallery_prev();
		});
		
		
		
	
});

