// Initially set opacity on thumbs and add
	// additional styling for hover effect on thumbs
	var onMouseOutOpacity = 0.67;
	
	$(document).ready(function() {
		//grey out all the thumbs
		//$('#smallProductGallery ul.thumbs li').css('opacity', onMouseOutOpacity);
		
		$('#smallProductGallery ul.thumbs li').css('opacity', onMouseOutOpacity)
		.hover(
			function () {
				$(this).not('.selected').fadeTo('fast', 1.00);
			}, 
			function () {
				$(this).not('.selected').fadeTo('fast', onMouseOutOpacity);
			}
		);
		// Initialize Advanced Galleriffic Gallery
		var galleryAdv = $('#gallery-adv').galleriffic('#smallProductGallery', {
			delay:                  2000,
			numThumbs:              6,
			preloadAhead:           20,
			enableTopPager:         false,
			enableBottomPager:      true,
			imageContainerSel:      '#slideshow-adv',
			controlsContainerSel:   '#controls-adv',
			captionContainerSel:    '#caption-adv',
			loadingContainerSel:    '#loading-adv',
			renderSSControls:       false,
			renderNavControls:      false,
			playLinkText:           '',
			pauseLinkText:          '',
			prevLinkText:           '',
			nextLinkText:           '',
			nextPageLinkText:       'Next',
			prevPageLinkText:       'Prev',
			enableHistory:          false,
			autoStart:              false,
			onChange:               function(prevIndex, nextIndex) {
				$('#smallProductGallery ul.thumbs').children()
					.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
					.eq(nextIndex).fadeTo('fast', 1.0);
			},
			onTransitionOut:        function(callback) {
				$('#slideshow-adv, #caption-adv').fadeOut('fast', callback);
			},
			onTransitionIn:         function() {
				$('#slideshow-adv, #caption-adv').fadeIn('fast');
			},
			onPageTransitionOut:    function(callback) {
				$('#smallProductGallery ul.thumbs').fadeOut('fast', callback);
			},
			onPageTransitionIn:     function() {
				$('#smallProductGallery ul.thumbs').fadeIn('fast');
			}
		});
		
		$.superbox();
		
		$("#tabs").tabs();

	});

