$(document).ready(function() {
    $("#slideshow").css("overflow", "hidden");
    $("ul#slides").cycle({
        fx: 'fade',
        pause: 1
    });

    $("ul#baneri").cycle({
        fx: 'fade',
        timeout: 1000,
        pause: 1
    });

    $(".gallery:first a[rel^='prettyPhoto']").prettyPhoto({
        animationSpeed:'slow',
        theme:'facebook',
        slideshow:2000,
        autoplay_slideshow: false
    });
    /*         $(".gallery:gt(0) a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'fast',slideshow:10000});*/

    $("#custom_content a[rel^='prettyPhoto']:first").prettyPhoto({
        custom_markup: '<div id="map_canvas" style="width:260px; height:265px"></div>',
        changepicturecallback: function(){
            initialize();
        }
    });

    $("#custom_content a[rel^='prettyPhoto']:last").prettyPhoto({
        custom_markup: '<div id="bsap_1237859" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6" style="height:260px"></div><div id="bsap_1251710" class="bsarocks bsap_d49a0984d0f377271ccbf01a33f2b6d6"></div>',
        changepicturecallback: function(){
            _bsap.exec();
        }
    });

    $(function(){

        $.datepicker.regional['hr'] = {
            monthNames: ['Siječanj','Veljača','Ožujak','Travanj','Svibanj','Lipanj',
            'Srpanj','Kolovoz','Rujan','Listopad','Studeni','Prosinac'],
            monthNamesShort: ['Sij','Velj','Ožu','Tra','Svi','Lip',
            'Srp','Kol','Ruj','Lis','Stu','Pro'],
            dayNames: ['Nedjelja','Ponedjeljak','Utorak','Srijeda','Četvrtak','Petak','Subota'],
            dayNamesShort: ['Ned','Pon','Uto','Sri','Čet','Pet','Sub'],
            dayNamesMin: ['Ne','Po','Ut','Sr','Če','Pe','Su'],
            weekHeader: 'Tje',
            dateFormat: 'dd.mm.yy.',
            firstDay: 1,
            isRTL: false,
            showMonthAfterYear: false,
            yearSuffix: ''
        };
        $.datepicker.setDefaults($.datepicker.regional['hr']);
        // Datepicker
        $('#datepicker').datepicker({
            inline: true
        });

        //    $( ".selector" ).datepicker({ disabled: true });

        //hover states on the static widgets
        $('#dialog_link, ul#icons li').hover(
            function() {
                $(this).addClass('ui-state-hover');
            },
            function() {
                $(this).removeClass('ui-state-hover');
            }
            );
    });


});


