
function photo_initCallback(photos) {

    photos.buttonNext.bind('click', function() {
        photos.startAuto(0);
    });

    photos.buttonPrev.bind('click', function() {
        photos.startAuto(0);
    });

    photos.clip.hover(function() {
        photos.stopAuto();
    }, function() {
        photos.startAuto();
    });
    
};

jQuery(document).ready(function() {

    // ColorBox
    jQuery("a[rel='gallery'],a[rel='altGallery']").colorbox({ slideshow: true, slideshowAuto: false, slideshowSpeed: 3500, 'next': 'Slijedeæa', 'previous': 'Prethodna', 'close': 'Zatvori', current: 'Slika {current} od {total}', slideshowStart: "start", slideshowStop: "stop" });
    
    // JCarousel
    jQuery('#photo-gallery').jcarousel({
        auto: 6,
        scroll: 1,
        wrap: 'last',
        initCallback: photo_initCallback
    });

});


//Initialize first demo:
ddaccordion.init({
    headerclass: "ddHeader", //Shared CSS class name of headers group
    contentclass: "ddContainer", //Shared CSS class name of contents group
    revealtype: "click", //Reveal content when user clicks or onmouseover the header? Valid value: "click" or "mouseover"
    collapseprev: true, //Collapse previous content (so only one open at any time)? true/false 
    defaultexpanded: [1], //index of content(s) open by default [index1, index2, etc]. [] denotes no content.
    animatedefault: false, //Should contents open by default be animated into view?
    persiststate: false, //persist state of opened contents within browser session?
    toggleclass: ["", "openpet"], //Two CSS classes to be applied to the header when it's collapsed and expanded, respectively ["class1", "class2"]
    togglehtml: ["none", "", ""], //Additional HTML added to the header when it's collapsed and expanded, respectively  ["position", "html1", "html2"] (see docs)
    animatespeed: "normal", //speed of animation: "fast", "normal", or "slow"
    oninit: function(expandedindices) { //custom code to run when headers have initalized
        //do nothing
    },
    onopenclose: function(header, index, state, isuseractivated) { //custom code to run whenever a header is opened or closed
        //do nothing
    }
})
