function initGallery() {
// GALLERY 1
// We only want these styles applied when javascript is enabled
$('div.navigation').css({'width' : '335px', 'float' : 'left'});
$('div.content').css('display', 'block');

// Initially set opacity on thumbs and add
// additional styling for hover effect on thumbs
var onMouseOutOpacity = 1.0;
$('#thumbs-1 ul.thumbs li').css('opacity', onMouseOutOpacity)
	.hover(
		function () {
			$(this).not('.selected').fadeTo('fast', 0.75);
		}, 
		function () {
			$(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
		}
	);

$(document).ready(function() {
	// Initialize Advanced Galleriffic Gallery
	var galleryAdv = $('#gallery-1').galleriffic('#thumbs-1', {
		delay:                  2000,
		numThumbs:              20,
		preloadAhead:           20,
		enableTopPager:         false,
		enableBottomPager:      false,
		imageContainerSel:      '#slideshow-1',
//		controlsContainerSel:   '#controls-1',
//		captionContainerSel:    '#caption-1',
		loadingContainerSel:    '#loading-1',
		renderSSControls:       false,
		renderNavControls:      false,
//		playLinkText:           'Play Slideshow',
//		pauseLinkText:          'Pause Slideshow',
//		prevLinkText:           '&lsaquo; Previous Photo',
//		nextLinkText:           'Next Photo &rsaquo;',
//		nextPageLinkText:       'Next &rsaquo;',
//		prevPageLinkText:       '&lsaquo; Prev',
		enableHistory:          false,
		autoStart:              false,
		onChange:               function(prevIndex, nextIndex) {
			$('#thumbs-1 ul.thumbs').children()
				.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
				.eq(nextIndex).fadeTo('fast', 1.0);
		},
		onTransitionOut:        function(callback) {
//			$('#caption-1').fadeOut('fast');
			$('#slideshow-1').fadeOut('fast', callback);
		},
		onTransitionIn:         function() {
//			$('#slideshow-1, #caption-1').fadeIn('fast');
			$('#slideshow-1').fadeIn('fast');
		},
		onPageTransitionOut:    function(callback) {
			$('#thumbs-1 ul.thumbs').fadeOut('fast', callback);
		},
		onPageTransitionIn:     function() {
			$('#thumbs-1 ul.thumbs').fadeIn('fast');
		}
	});
});

}