//odezvy
		function header_jquery_fotogalerie_initCallback(carousel)
		{			
			//najetí myší zastaví pohyb
			carousel.clip.hover(
				function(){
					carousel.stopAuto();
				},
				function(){
					carousel.startAuto();
				}
			);
		};	
		
		function getUrlVars()
		{
		    var vars = [], hash;
		    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
		    for(var i = 0; i < hashes.length; i++)
		    {
				hash = hashes[i].split('=');
		        vars.push(hash[0]);
		        vars[hash[0]] = hash[1];
		    }
		    return vars;
		};
	
        $(document).ready(
			function(){				
				//auto scrolování				
				$('#header_jquery_fotogalerie').jcarousel({
					animation: 'slow',
					auto: 4,
					scroll: 1,
					wrap: 'circular',
					initCallback: header_jquery_fotogalerie_initCallback
				});		
				
				var fadeLength = 150;
				var fadeOpacity = 0.66;						
				
				//přípona png				 
				$(".replace_png").hover(
      				function () {
       				$(this).fadeTo(fadeLength, fadeOpacity);			    
						$(this).attr("src", $(this).attr("src").replace(".png", "_hover.png"));
						$(this).fadeTo(fadeLength, 1);
					}, 
      				function () {	
						$(this).attr("src", $(this).attr("src").replace("_hover.png", ".png"));
      				}
    			);   
				
				//menu středová lišta	
				$(".menu_middle_items_img").hover(
      				function () {
       				$(this).fadeTo(fadeLength, fadeOpacity);			    
						$(this).attr("src", $(this).attr("src").replace(".png", "_hover.png"));
						$(this).fadeTo(fadeLength, 1);
					}, 
      				function () {	
						$(this).attr("src", $(this).attr("src").replace("_hover.png", ".png"));
      				}
    			);   	
				
				//přípona jpg				 
				$(".replace_jpg").hover(
      				function () {
						$(this).attr("src", $(this).attr("src").replace(".jpg", "_hover.jpg"));
					}, 
      				function () {	
						$(this).attr("src", $(this).attr("src").replace("_hover.jpg", ".jpg"));
      				}
    			); 
				
				
				//schování menu
				$(".content_menu_category").hide();
				//schování alertu pro javascript
				$("#javascript_alert").hide();
				//událost kliku na menu
				$(".content_menu_podnadpis").click(
					function(){						
						var id = $(this).attr("id").replace("head", "sub");
						//schování všech ostatních menu krome práve zobrazovaného
						for (var a=1;a<=12;a++){
							if (id.replace("sub", "")==a)
								continue;
							$("#sub"+a).hide();
						}
						$('#'+id).toggle(300);
					}
				);	
				
				//zjistí se, jestli není zvolená kategorie, která by mela být vždy zobrazena po nactení
				var selectedcategory = getUrlVars()["list"];
				$("#sub"+selectedcategory).show();
			}
		);	

