$(document).ready(function() {
    
    if ($('#histSlideShow').length > 0) {
        $('#histSlideShow').cycle({
            fx:     'fade', 
            speed:  'fast', 
            timeout: 0, 
            next:   '#naviHistNext', 
            prev:   '#naviHistPrev'
        });
    }
    
    if ($('#histIntSlideShow').length > 0) {
        $('#histIntSlideShow').cycle({
            fx:     'fade', 
            speed:  'fast', 
            timeout: 0, 
            next:   '#naviHistIntNext', 
            prev:   '#naviHistIntPrev'
        });
    }
    
    if ($('.galleryImageLink').length > 0) {
        
        $('.galleryImageLink').fancybox({
            'transitionIn'	: 'elastic',
            'transitionOut'	: 'elastic',
            'titlePosition' 	: 'over',
    		'titleFormat'       : function(title, currentArray, currentIndex, currentOpts) {
                if (!title) {
                    title = '';
                }
    		    return '<span id="fancybox-title-over">' +  (currentIndex + 1) + ' / ' + currentArray.length + ' ' + title + '</span>';
    		}

        });
        
    }
    
});


