$(function() {
 
	// On ne doit charger le caroussel qu'une fois.
	// On indique donc si celui-ci a été chargé
	isRound = false;
 
	// if the function argument is given to overlay,
	// it is assumed to be the onBeforeLoad event listener
	$("#gloveLeftArea").overlay({
 		expose: 'DarkBlue',
		onLoad: function() {
			// Affiche le caroussel
			if (!isRound) {
				$('ul#myRoundabout').roundabout();
			}
			isRound = true;
		}
 	});
	$("#gloveRightArea").overlay({
 		expose: 'DarkBlue',
		onLoad: function() {
			// Affiche le caroussel
			if (!isRound) {
				$('ul#myRoundabout').roundabout();
			}
			isRound = true;
		}
 	});
	$("#capArea").overlay({
 		expose: 'DarkBlue'
 	});
		
	//Interval de rotation du portfolio
	var interval;	
 
	// let's get this party started
	interval = startAutoPlay();
	
	//Rotation auto du portfolio
	function startAutoPlay() {
		return setInterval(function() {
			$('ul').roundabout_animateToNextChild();
		}, 3000);
	}
});
