$(document).ready(function() {
	
	$.fx.off = !$.fx.off;

	// Toggle
	$('.toggle-list h4').click(function() {
		$(this).next().toggle(function(){
			if ($(this).prev().hasClass("open")) {
			      $(this).prev().removeClass("open");
			} else {
				$(this).prev().addClass("open");
			}
		}
		);
		return false;
	}).next().hide();
	
	var interval;
	$('ul#customerCarousel').roundabout({
		minScale: 0.1
	}).hover(
		function() {
			// oh no, it's the cops!
			clearInterval(interval);
		},
		function() {
			// false alarm: PARTY!
			interval = startAutoPlay();
		}
	);
	// let's get this party started
    interval = startAutoPlay();

});

function startAutoPlay() {
	return setInterval(function() {
		$('ul#customerCarousel').roundabout_animateToNextChild();
	}, 3000);
}
