Cufon.replace('.home-section h3', { hover: true });

/********************************************************************************/
/***** IMAGE ROTATOR ***********************************************************/
/******************************************************************************/

var startDelay 	= 20000;
var timeFade	= 3000;
var timeActive	= 20000;
var activeImg	= 0;
var timerStart;
var transition 	= 'off';

$(document).ready(function() {
	timerStart = setTimeout('imageRotator(1)', startDelay);
});

/***** GET THE FUNCTIONS STARTED *****/

function imageRotator(id) {
	if(transition == 'off') {
		transition = 'on';
		
		clearTimeout(timerStart);

		var imageList = $('.intro-sections');
		
		if((id) == imageList.length) {
			var nextStep = 0;
		} else {
			var nextStep = id;
		}
		
		var imageActive	= $(imageList[activeImg]);
		var imageNext	= $(imageList[nextStep]);
		
		$(imageActive).css({'zIndex':'100'});
		$(imageNext).css({'zIndex':'1'});
		
		$(imageNext).show().css({'opacity':0});
		
		$(imageActive).animate({'opacity':0},timeFade)
		.add($(imageNext).animate({'opacity':0.999},timeFade, function() {
				var nextStep2 = nextStep + 1;
				$(imageActive).hide();
				activeImg = nextStep;
				transition = 'off';
				timerStart = setTimeout('imageRotator(' + nextStep2 + ')', timeActive);
			})
		);
	}
}