
$(document).ready(function(){
    $(".menu > ul > li > a.active").parent().addClass('active');
    
    $(".menu > ul > li").each(function(){
        if($(this).children("ul").length){
            $(this).hover(
                function(){
                    $(this).dropShadow();
                    $(this).children("ul").dropShadow();
                    //$(".menu > ul > li.active").removeShadow().addClass("disshadow");
                }, 
                function(){
                    $(this).removeShadow()
                    $(this).children("ul").removeShadow()
                });
        }else{
            if(!$(this).hasClass("active"))
                $(this).hover(
                    function(){
                        $(this).dropShadow();
                        //$(".menu > ul > li.active").removeShadow().addClass("disshadow");
                    }, 
                    function(){
                        $(this).removeShadow()                        
                    });
        }
        
    });
    
    $(".menu > ul > li.active").dropShadow();


    

    if($('.slideshow2').length){
        $('.slideshow2')
            .cycle({
                fx: 'fade',
                after:   onAfter,
                prev: '#prev',
                next: '#next'
            });
        $('#opis').html($(".slideshow2 img").first().attr('alt'));
    }


    if($('#carousel').length)
        jQuery('#carousel').jcarousel({
            vertical: true,
            scroll: 2
        });
    
    if($('#carousel1').length)
        jQuery('#carousel1').jcarousel({
            vertical: true,
            scroll: 2
        });
});

function onAfter() { 
    $('#opis').html(this.alt); 
}

$(window).load(function(){
    if($('.slideshow').length){
        $('.slideshow')
            .cycle({
                fx: 'fade',
                pager:  '#nav',
                after:   onAfter
            });
        $('#opis').html($(".slideshow img").first().attr('alt'));
    }
});
