// javascript gallery 


// Initially set opacity on thumbs and add
// additional styling for hover effect on thumbs
var onMouseOutOpacity = 0.67;
$('#thumbs-adv ul.thumbs li').css('opacity', onMouseOutOpacity)
	.hover(
		function () {
			$(this).not('.selected').fadeTo('fast', 1.0);
		}, 
		function () {
			$(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
		}
	);

// Galleriffic init settings
$(document).ready(function() {
    var gallery = $('#gallery').galleriffic('#thumbs-container', {
        delay:                  3000,
        numThumbs:              8,
        preloadAhead:           8,
        enableTopPager:         false,
        enableBottomPager:      true,
        imageContainerSel:      '#galleryshow',
        controlsContainerSel:   '#cntrls',
        captionContainerSel:    '#caption',
		renderSSControls:       true,
		renderNavControls:      true,
		playLinkText:           'Play Slideshow',
		pauseLinkText:          'Pause Slideshow',
		prevLinkText:           '&lsaquo; Previous Photo',
		nextLinkText:           'Next Photo &rsaquo;',
		nextPageLinkText:       'Next &rsaquo;',
		prevPageLinkText:       '&lsaquo; Prev',
		enableHistory:          true,
		autoStart:              false,
		onChange:               function(prevIndex, nextIndex) {
			$('#thumbs-container ul.thumbs').children()
				.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
				.eq(nextIndex).fadeTo('fast', 1.0);
		},
		onTransitionOut:        function(callback) {
			$('#galleryshow, #caption-adv').fadeOut('fast', callback);
		},
		onTransitionIn:         function() {
			$('#galleryshow, #caption-adv').fadeIn('fast');
		},
		onPageTransitionOut:    function(callback) {
			$('#thumbs-container ul.thumbs').fadeOut('fast', callback);
		},
		onPageTransitionIn:     function() {
			$('#thumbs-container ul.thumbs').fadeIn('fast');
		}
	});
	
	// Initialize Second Galleriffic Gallery
	var galleryMin = $('#gallery-two').galleriffic('#thumbs-two', {
		imageContainerSel:      '#slideshow-two',
		controlsContainerSel:   '#controls-two'
	});
});
