		$(function() {			
			$("#navigation div.level1").hover(

				function () {

					$(this).addClass("hover");
				},

				function () {

					$(this).removeClass("hover");

				}

			);


			if ( ! $("body.homepage").length) {
				$("a.fancybox").fancybox({
					'zoomSpeedIn': 300,
					'zoomSpeedOut': 300,
					'overlayShow' :true
				});
			}

			$('.slide-show-title').css('opacity', 0.9);
			$('#navigation ul.level2').css('width', 0);
			$('#navigation ul.level2').css('opacity', 0.9);

			$("#navigation div.level1").hover(
				function() {
					$("#navigation div.hover ul.level2").stop().animate({ width: 225 }, 750);
				},
				function() {
					$("#navigation ul.level2").stop().animate({ width: 0 }, 500);
				}
			);

			$("#gallery img").hover(
				function() {
					$("#gallery img:hover").stop().animate({ opacity: 0.5 }, 500);
				},
				function() {
					$("#gallery img").stop().animate({ opacity: 1.0 }, 500);
				}
			);

			$('#footer img.hover').css('opacity', 0);

			$("#footer div img.hover").hover(
				function() {
					$("#footer div img.hover:hover").stop().animate({ opacity: 1.0 }, 500);
				},
				function() {
					$("#footer div img.hover").stop().animate({ opacity: 0 }, 750);
				}
			);

      // zmena jazyka
      $("#lang_form #select_lang").change(function(){
        $.system.submit("lang_form");
      });
      
		});

function submitform()
		{
 			 document.formular.submit();
		}

function slideSwitch() {
  var $active = $('#slide-show-items div.slide-show-item.active');

  if ( $active.length == 0 ) $active = $('#slide-show-items div.slide-show-item:last');

    var $next = $active.next().length ? $active.next()
        : $('#slide-show-items div.slide-show-item:first');

    $active.addClass('last-active');

    var key = $next.attr("id").substr(6);
    $("#slide-show-pager a").removeClass("current");
    $("#slide-pager-" + key).addClass("current");
    
    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
    });
}

var sliderInterval;

$(function() {
  // spusteni slide intervalu
  if ($("#slide-show-items").length) {
    sliderInterval = setInterval( "slideSwitch()", 5000 );
  }
  
  // kliknuti na konkretni fotku ve slideru
  $("#slide-show-pager a").click(function(){
    clearInterval(sliderInterval);
    
    var key = $(this).attr("id").substr(12);
    
    $("#slide-show-pager a").removeClass("current");
    $("#slide-pager-" + key).addClass("current");
    
    $("#slide-show-items div.slide-show-item").removeClass("active");
    $("#slide-" + key).addClass("active");
    
    sliderInterval = setInterval( "slideSwitch()", 5000 );
    
    return false;
  });
});

