//**GALLERY CODE**//
//-------------------
//Wasabi JQuery logic specific to the image gallery controls

$(document).ready(function()
{

    // gallery in imageDetail page
    if ($("#gallery").length > 0)
    {
        var gallery = $('#gallery').galleriffic('#navigation', {
            delay: 2000,
            numThumbs: 8,
            imageContainerSel: '#slideshow',
            controlsContainerSel: '#controls',
            titleContainerSel: '#image-title',
            descContainerSel: '#image-desc',
            downloadLinkSel: '#download-link',
            renderSSControls: false,
            renderNavControls: true
            //captionContainerSel: '',
            //preloadAhead:         40, // Set to -1 to preload all images
            //enableTopPager:       false,
            //enableBottomPager:    true,
            //prevLinkText:         'Previous',
            //nextLinkText:         'Next',
            //nextPageLinkText:     'Next &rsaquo;',
            //prevPageLinkText:     '&lsaquo; Prev'
        });

        gallery.onFadeOut = function()
        {
            $('#details').fadeOut('fast');
        };
        gallery.onFadeIn = function()
        {
            $('#details').fadeIn('fast');
            var galleryHeight = $('#gallery').height();
            var profileHeight = $('#authorProfile').height();
            var newHeight = galleryHeight - profileHeight - 20;
            $('#author p').height(newHeight);
        };
    };

});