function InitializeCarousel(speed, timeout, auto){
	$(document).ready(function(){
		$('.ContentCarousel .iw_fw_ContentCarousel_next, .ContentCarousel .iw_fw_ContentCarousel_prev').click(function(){
			var selected = $(this).parents('.ContentCarousel').find('li.selected');
			var indicators = $(this).parents('.ContentCarousel').find('.indicators a');
			var SelectedIndicator = indicators.filter('a.selected');
			
			if($(this).is('.ContentCarousel .iw_fw_ContentCarousel_next')){
				var next = selected.next('li');
				if(!next.length){
					next = $(this).parents('.ContentCarousel').find('li:first');
				}
				
				var NextIndicator = SelectedIndicator.next('a');
				if(!NextIndicator.length){
					NextIndicator = indicators.first();
				}
				
			}else{
				var next = selected.prev('li');
				if(!next.length){
					next = $(this).parents('.ContentCarousel').find('li:last');
				}
				
				var NextIndicator = SelectedIndicator.prev('a');
				if(!NextIndicator.length){
					NextIndicator = indicators.last();
				}
			}
			
			selected.fadeOut(speed).removeClass('selected');
			next.fadeIn(speed).addClass('selected');
			
			SelectedIndicator.removeClass('selected');
			NextIndicator.addClass('selected');
		});
	
	//--------------------------------------------
		
		$('.ContentCarousel .indicators a').click(function(){
			var selected = $('.ContentCarousel .indicators a.selected');
			selected.removeClass('selected');
			$(this).addClass('selected')	
			
			var carousel = $(this).parents('.ContentCarousel');
			var eq = $(this).index('.ContentCarousel .indicators a');
			var next = carousel.find('li').eq(eq); 
			
			if(!next.is('.selected')){
				carousel.find('li.selected').fadeOut(speed).removeClass('selected');	
				next.fadeIn(speed).addClass('selected');
			}
		});
	
	//--------------------------------------------
	
		if(auto){
			InitAutoScroll($('.iw_fw_contentcarousel_container'), timeout);
		}
		
		$('.iw_fw_contentcarousel_container').hover(function(){
			$(this).addClass('AutoScrollDisabled');
		}, function(){
			$(this).removeClass('AutoScrollDisabled');
		});
	
	});
}

	function InitAutoScroll(carousel, timeout){
		if(timeout > 0){
			setTimeout(function(){ 
				if(!carousel.is('.AutoScrollDisabled')){
					carousel.find('.iw_fw_ContentCarousel_next').click();
				}
				InitAutoScroll(carousel, timeout);
			}, timeout);	
		}
	}




