$(function() {
	
	$('.slideshow .defaultimg').hide();
	$("a.thumb").removeAttr("title");
	$("a.thumb img").removeAttr("alt");
	
	var onMouseOutOpacity = 0.50;
	$('#thumbs ul.thumbs li').opacityrollover({
		mouseOutOpacity:   onMouseOutOpacity,
		mouseOverOpacity:  1.0,
		fadeSpeed:         'fast',
		exemptionSelector: '.selected'
	});
	
	$('div#thumbs').galleriffic({
		delay:                     2500,
		preloadAhead:              -1,
		imageContainerSel:         '#slideshow',
		loadingContainerSel:       '#loading',
		defaultTransitionDuration: 250,
		enableKeyboardNavigation:  true,	
		onSlideChange:             function(prevIndex, nextIndex) {
			this.find('ul.thumbs').children()
				.eq(prevIndex).fadeTo('fast', onMouseOutOpacity).end()
				.eq(nextIndex).fadeTo('fast', 1.0);
		},
		onPageTransitionOut:       function(callback) {
			this.fadeTo('fast', 0.0, callback);
		},
		onPageTransitionIn:        function() {
			this.fadeTo('fast', 1.0);
		}
	});
	
});
