/*
 * Intro script
 *
 * (c) 2009 KAOH WebServices
 *
 * Using:
 * jQuery JavaScript Library by John Resig
 * jQuery Galleriffic plugin by Trent Foley (http://trentacular.com)
 */
var gallery;
$(document).ready(function() {
	/* Start the intro */
	var gallery_first_time = true;
	gallery = $('.gallery-image').galleriffic('.gallery-thumbs', {
		delay:                  3000,
		numThumbs:              4,
		preloadAhead:           -1,
		enableTopPager:         false,
		enableBottomPager:      false,
		imageContainerSel:      '.gallery-image',
		renderSSControls:       false,
		renderNavControls:      false,
		enableHistory:          false,
		autoStart:              true,
		onTransitionOut:        function(callback) { if(gallery_first_time) { gallery_first_time = false; setTimeout(function() { gallery.settings.delay = 5600; }, 0); } else { $('.gallery-image').fadeOut(2800, callback); } },
		onTransitionIn:         function() { $('.gallery-image a').removeAttr('href').removeAttr('title'); $('.gallery-image img').removeAttr('alt'); $('.gallery-image').fadeIn(2800); },
	});
	$('.gallery-image').fadeOut(0, function() {$(this).fadeIn(2800)});
});

