/*
 * Intro script
 *
 * (c) 2009 KAOH WerbServices
 *
 * Using:
 * jQuery JavaScript Library by John Resig
 * jQuery Galleriffic plugin by Trent Foley (http://trentacular.com)
 */

$(document).ready(function() {
	/* Start the intro */
	var gallery_first_time = true;
	var gallery = $('.gallery-image').galleriffic('.gallery-thumbs', {
		delay:                  1000,
		numThumbs:              5,
		preloadAhead:           40, // Set to -1 to preload all images
		enableTopPager:         false,
		enableBottomPager:      false,
		imageContainerSel:      '.gallery-image',
		controlsContainerSel:   '',
		captionContainerSel:    '',
		loadingContainerSel:    '',
		renderSSControls:       false,
		renderNavControls:      false,
		playLinkText:           'Play',
		pauseLinkText:          'Pause',
		prevLinkText:           'Previous',
		nextLinkText:           'Next',
		nextPageLinkText:       'Next &rsaquo;',
		prevPageLinkText:       '&lsaquo; Prev',
		enableHistory:          false,
		autoStart:              true,
		onChange:               undefined, // accepts a delegate like such: function(prevIndex, nextIndex) { ... }
		onTransitionOut:        function(callback) { if(gallery_first_time) {gallery_first_time = false; callback; } else {$('.gallery-image').fadeOut(3000, callback);} }, //undefined, // accepts a delegate like such: function(callback) { ... }
		onTransitionIn:         function() { $('.gallery-image').fadeIn(3000); }, //undefined, // accepts a delegate like such: function() { ... }
		onPageTransitionOut:    undefined, // accepts a delegate like such: function(callback) { ... }
		onPageTransitionIn:     undefined  // accepts a delegate like such: function() { ... }
	});
});
