$(document).ready(function(){

//-----------------------------------------------
	
	$('.iw_fw_AutoScrolledContentCarousel').each(function(){
		var caro = $(this);
		
		var time = caro.find('.AutoScroll').val();
		if(time !== 'false'){	
			var speed = caro.find('.AnimationSpeed').val();
		    time = parseInt(time) + parseInt(speed);
			
			var tt = timeout(time, caro);
		
			caro.hover(function(){
				caro.removeClass('iw_fw_AutoScrolledContentCarousel');
			}, function(){
				caro.addClass('iw_fw_AutoScrolledContentCarousel');
				clearTimeout(tt);
				tt = timeout(time, caro);
			});
			
		}
	});

//-----------------------------------------------

	function timeout(time, caro){
		return tt = setTimeout(function(){ 
			if(caro.is('.iw_fw_AutoScrolledContentCarousel')){
				caro.find('.iw_fw_ContentCarousel_next').click();
				timeout(time, caro);
			}
		}, time);
	}
    
});




