//YAHOO.util.Event.onContentReady("carousel", start_carousel);
YAHOO.util.Event.onDOMReady(start_carousel);

function start_carousel(ev){
	var website_carousel = new YAHOO.widget.Carousel('pane5', { 
		isCircular: true, 
		carouselEl: "UL", 
		animation: { 
			speed: 0 
		}, 
		autoPlayInterval: 6000, 
		revealAmount: 7.5, 
		numVisible: 4 
	});
	website_carousel.render();
	website_carousel.show();
	website_carousel.startAutoPlay();

	//website_carousel.on('beforePageChange', function(o) {
	//	if (this.get('numPages') == (this.get('currentPage') + 1)) { // if it's the last page.
	//		var animation = this.get('animation'); // get the original animation behaviour.
	//		var animationObj = {speed: 0, effect: YAHOO.util.Easing.easeNone}; // define new animation behaviour.
	//		this.set('animation', animationObj);
	//		this.set('selectedItem', 0);
	//		this.scrollTo(); // scroll to first page.
	//		this.set('animation', animation); // reset to original animation behaviour.
	//	}
	//});
}

