/* Adaptation of David Walsh's Code on http://davidwalsh.name/mootools-slideshow */
function rollOnSlideshow() {
	var showDuration = 4000;
	var container = $('slideshow-container');
	var slides = container.getElements('div.slideHolder');
	var currentIndex = 0;
	
	slides.each(function(slide,i){ 
		if(i > 0) {
			slide.set('opacity',0);
		}
	});
	
	var myInterval = setInterval(function(){
		slides[currentIndex].fade('out');
		slides[currentIndex = currentIndex < slides.length - 1 ? currentIndex+1 : 0].fade('in');		
	},showDuration);
	
	container.onmouseover = function () {
		clearInterval(myInterval);
	}
	
	container.onmouseout = function () {
		myInterval = setInterval(function(){
			slides[currentIndex].fade('out');
			slides[currentIndex = currentIndex < slides.length - 1 ? currentIndex+1 : 0].fade('in');		
		},showDuration);
	}
}
