$(document).ready(function () {

    $('.slideshow').cycle({
        fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
        timeout: 3500,
        delay: -500,
        after: onBefore
    });


    //FancyBox
    $("a[rel=GalerieImg], .example1").fancybox({
        'transitionIn': 'elastic',
        'transitionOut': 'elastic',
        'titlePosition': 'over',
        'titleFormat': function (title, currentArray, currentIndex, currentOpts) {
            return '<span id="fancybox-title-over">Image ' + (currentIndex + 1) + ' / ' + currentArray.length + (title.length ? ' &nbsp; ' + title : '') + '</span>';
        }
    });


});

function onBefore(curr, next, opts, fwd) {
    //get the height of the current slide
    var $ht = $(this).height();
    //set the container's height to that of the current slide
    $(this).parent().css("height", $ht);
}
