var activeAnchor = null;
var setActive = function(anchor){
	if(activeAnchor != null)
		activeAnchor.className = activeAnchor.className.replace(/(\s?active)/gi, '');
	if(anchor != null){
		anchor.className += ' active';
		activeAnchor = anchor;
	}
};

window.addEvent("domready", function() {
	var ex6Carousel = new iCarousel("example_6_content", {
		idPrevious: "example_6_previous",
		idNext: "example_6_next",
		idToggle: "undefined",
		item: {
			klass: "example_6_item",
			size: 210
		},
		animation: {
			type: "fadeNscroll",
			duration: 300,
			amount: 1,
			rotate: {  
             type: "auto",  
         	interval: "3000"
			}  
		}
	});

	$("thumb0").addEvent("click", function(event){new Event(event).stop();ex6Carousel.goTo(0); setActive(this);});
	$("thumb1").addEvent("click", function(event){new Event(event).stop();ex6Carousel.goTo(1); setActive(this);});
	$("thumb2").addEvent("click", function(event){new Event(event).stop();ex6Carousel.goTo(2); setActive(this);});
	$("thumb3").addEvent("click", function(event){new Event(event).stop();ex6Carousel.goTo(3); setActive(this);});
	$("thumb4").addEvent("click", function(event){new Event(event).stop();ex6Carousel.goTo(4); setActive(this);});
	$("thumb5").addEvent("click", function(event){new Event(event).stop();ex6Carousel.goTo(5); setActive(this);});
});