$(
    function () {
        $( "#left" ).imageScroller( {
            speed:'4000', 
            loading:'Počkejte prosím na načtení fotografií'
        } );
		
        $( "#right" ).imageScroller( {
            speed:'4000', 
            direction:'right'
        } );
		
        $( "#top" ).imageScroller( {
            direction:'top'
        } );

        $( "#bottom" ).imageScroller( {
            speed:'3500', 
            direction:'bottom'
        } );
    }
    );
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-18606451-1']);
_gaq.push(['_trackPageview']);

(function() {
    var ga = document.createElement('script');
    ga.type = 'text/javascript';
    ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0];
    s.parentNode.insertBefore(ga, s);
})();
  
$(document).ready(function() {
    var imgs = $("a[href$=.jpg],a[href$=.JPG]");
    imgs.each(function() {
        var t = $(this);

        if (t.attr("rel") == "" || t.attr("rel") == undefined) {
            t.attr("rel","group1");
        }
    });
    imgs.fancybox({
        titlePosition : 'over'
    });
        
    $(".button_soutez").click(function() {
        $(".podminky").slideToggle(300);
    });
    
    var can = [];
    
    var menu = $("#menu .link");
    
    menu.mouseenter(function(e){
        
        var item = $(this);
        var index = item.index();
        can[index] = true;
        setTimeout(function() {            
            if (can[index] != undefined && can[index]) {
                var podmenu = item.find("ul");
                if (podmenu.length > 0 && !podmenu.is(":animated")) {
                    podmenu.slideDown(150);
                }
                
            }
        },250);
        
    });
    
    menu.mouseleave(function(){    
        var t = $(this);
        var index = t.index();
        var item = t.parent();        
        
        can[index] = false;
        var podmenu = item.find("ul");
        
        podmenu.slideUp(150);
               
    });
});
