document.write('<style>h1,h2,h3,.menu ul li span,.menu ul li .section{visibility:hidden; letter-spacing:0px; } </style>');
$(document).ready(function(){
	$(".title").next("p").addClass("indent");
	$(".title").next("ul").addClass("indent");
	$(".popisok-k-obrazku").next(".item-case").children("p:first").addClass("indent");
	
	$(".item .menu-legend").hover(function(){
		$(this).parents(".item:first").addClass("item-active");
		$(this).children("em").fadeIn("normal");
		if($(this).find("a").attr("href")){
			$(this).css({cursor:"pointer"});
		}
	},function(){
		$(this).parents(".item:first").removeClass("item-active");
		$(this).children("em").fadeOut("normal");
		if($(this).find("a").attr("href")){
		$(this).css({cursor:"pointer"});
		}
	})
	
	
	  var farba = new Array (
			    "modra1",			    
			    "modra2",			    
			    "modra3",			    
			    "zelena1",			    
			    "zelena2",			    
			    "cervena1",			    
			    "cervena2",			    
			    "cervena3",			    
			    "cervena4",			    
			    "hneda1",			    
			    "hneda2",			    
			    "zlta"			    
			  )	

	
	$(".pagemenu ul li span,.menu ul li span,.menu ul li .section").hover(function(){
		$(this).addClass("active");
		var x = Math.floor(Math.random() * farba.length);			
		$(this).parent("li").removeClass().addClass(farba[x]);
},function(){
	$(this).removeClass("active");
		
})


$(".pagemenu ul li ul li a,.menu ul li ul li a").hover(function(){		
	var x = Math.floor(Math.random() * farba.length);			
	$(this).parent("li").removeClass().addClass(farba[x]).addClass("activeparent");;
},function(){
	$(this).parent("li").removeClass();			
})

$(".pagemenu ul li span:not(.activeparent)").parent("li").children("ul").children("li").children("a").hover(function(){
	$(this).parent("li").parent("ul").parent("li:not(.sectionheader)").children("span").addClass("activeparent");
},function(){
	$(this).parent("li").parent("ul").parent("li:not(.sectionheader)").children("span").removeClass("activeparent");
})
$(".pagemenu ul li span:not(.activeparent)").parent("li").hover(function(){
},function(){
	$(this).removeClass();
})

$(".item2 .popisok-k-obrazku,.item2 .menu-legend").hide();
	
	if($(window).height()>$("#site-case").height()-321){
		
		$(".top").hide();
	}
	
	$('a[href*=#]').click(function() {
	    if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'')
	    && location.hostname == this.hostname) {
	var $target = $(this.hash); 
	     $target = $target.length && $target 
	      || $('[name=' + this.hash.slice(1) +']');
	      if ($target.length) {
	       var targetOffset = $target.offset().top;
	        $('html,body')
	        .animate({scrollTop: targetOffset}, 500);
	       return false;
	      }
	    }
	 });

/*	$(".video").each(function(){
		
		$(this).flash({
	        src: "uploads/files/flash/video/player_lite.swf",       
	        height: "358",
	        width: "555",
	        wmode: "transparent",
	        bgcolor: "#ffffff",
	        scale: "noscale",
	        allowFullscree: "true",
	        allowScriptAccess: "sameDomain",
	        flashvars: {		
				// These following lines allows you to customize the main parameters
				
				myVideoPath:$(this).children("a").attr("href"), // The video path (absolute or relative)
				autoStart: "false", // Auto Play (true or false)
				autoLoop: "false", // Auto Loop (true or false)
				soundOff: "false", // Sound Off (true or false)
				player_width: "555", // The width of the player in pixels (it must be the same than SWFObject)
				player_height: "358", // The height of the player in pixels (it must be the same than SWFObject)				
				
				player_bg_color: "0xffffff", // player background
				panel_bg_color: "0xe3e2e2", // panel background
				bt_play_color: "0x212121", // symbol play
				bt_pause_color: "0x212121", // symbol pause
				progress_bar_cursor_color: "0x212121", // progress cursor
				progress_bar_fluid_color: "0x212121", // progress fluid
				progress_bar_buffer_color: "0xe3e2e2", // progress buffer
				progress_bar_bg_color: "0xffffff", // progress background
				bt_volume_on_color: "0x212121", // speaker in state on
				bt_volume_wave_color: "0x212121", // the 3 vertical lines when the speaker is in state on
				bt_volume_off_color: "0x212121", // speaker in state off
				bt_volume_cross_color: "0xff0000" // the cross when the speaker is in state off
			}         
		
		})
	})*/
	

$(".videoplaylist li").hover(function(){

	$(this).addClass("hover")
	
},function(){
	$(this).removeClass("hover")
}).css({cursor:"pointer"});


	$(".videoplaylist li").click(function(){
		$(".videoplaylist li").removeClass("active");
		$(this).addClass("active");
		
		
		$(".videoplayer").flash({
	        src: "uploads/files/flash/video/player_lite.swf",       
	        height: "328",
	        width: "500",
	        wmode: "transparent",
	        bgcolor: "#ffffff",
	        scale: "noscale",
	        allowFullscree: "true",
	        allowScriptAccess: "sameDomain",
	        flashvars: {		
				// These following lines allows you to customize the main parameters
				
				myVideoPath:$(this).find("a").attr("href"), // The video path (absolute or relative)
				autoStart: "true", // Auto Play (true or false)
				autoLoop: "false", // Auto Loop (true or false)
				soundOff: "false", // Sound Off (true or false)
				player_width: "500", // The width of the player in pixels (it must be the same than SWFObject)
				player_height: "328", // The height of the player in pixels (it must be the same than SWFObject)				
				
				player_bg_color: "0xffffff", // player background
				panel_bg_color: "0xe3e2e2", // panel background
				bt_play_color: "0x212121", // symbol play
				bt_pause_color: "0x212121", // symbol pause
				progress_bar_cursor_color: "0x212121", // progress cursor
				progress_bar_fluid_color: "0x212121", // progress fluid
				progress_bar_buffer_color: "0xe3e2e2", // progress buffer
				progress_bar_bg_color: "0xffffff", // progress background
				bt_volume_on_color: "0x212121", // speaker in state on
				bt_volume_wave_color: "0x212121", // the 3 vertical lines when the speaker is in state on
				bt_volume_off_color: "0x212121", // speaker in state off
				bt_volume_cross_color: "0xff0000" // the cross when the speaker is in state off
			}         
		
		})
	});

	$(".audioplaylist li").hover(function(){

		$(this).addClass("hover")
		
	},function(){
		$(this).removeClass("hover")
	}).css({cursor:"pointer"});

		
	$(".audioplaylist li").click(function(){
			$(".audioplaylist li").removeClass("active");
			$(this).addClass("active");		
			
			$(".audioplayer")													
				$('.audioplayer').flash({
				            src: "uploads/files/flash/video/freso_player.swf",
				            height:40 ,
				            width: 720,
				            wmode: "transparent",				            
				            flashvars: {
					ID: "<SONGS><song><url>"+$(this).find("a").attr("href")+"</url><artist></artist><title>"+$(this).find("a").text()+"</title></song></SONGS>"
				}            
			});

		});
	
});

$(window).load(function(){
	$(".audioplaylist li.active").click();
	$(".videoplaylist li.active").click();
	$(".item2 img").each(function(){
		var h = $(this).height();		
		$(this).parents(".item2:first").find(".menu-legend").css({top:(h-60)}).fadeIn("slow");
		$(this).parents(".item2:first").find(".popisok-k-obrazku").css({top:(h-60)}).fadeIn("slow");
	})
	
})

