window.addEvent("domready", checkCarousel);
//put 'var doCarousel = 1;' in a script tag on a page that you want it to do this

function checkCarousel() {
    if (window.doCarousel)
    {
//		new Accordion($$(".accordion_toggler"), $$(".accordion_content")); //makes first element visible
		var myAcc = new Accordion($$(".accordion_toggler"), $$(".accordion_content"), {start:'all-close'}); //closes all accordians
		
		var exampleCarousel = new iCarousel("examples", {
			idPrevious: "examples_previous",
			idNext: "examples_next",
			idToggle: "undefined",
			item: {
				klass: "exampleItem",
				size: 526 //size of slider window example?
	
			},
			animation: {
				type: "scroll",
				duration: 1000,
				amount: 1
			}
		});
	
		$("thumb0").addEvent("click", function(event){new Event(event).stop();exampleCarousel.goTo(0)});
		$("thumb1").addEvent("click", function(event){new Event(event).stop();exampleCarousel.goTo(1)});
		$("thumb2").addEvent("click", function(event){new Event(event).stop();exampleCarousel.goTo(2)});
		$("thumb3").addEvent("click", function(event){new Event(event).stop();exampleCarousel.goTo(3)});
		//$("thumb4").addEvent("click", function(event){new Event(event).stop();exampleCarousel.goTo(4)});
		//$("thumb5").addEvent("click", function(event){new Event(event).stop();exampleCarousel.goTo(5)});
	    //$("thumb6").addEvent("click", function(event){new Event(event).stop();exampleCarousel.goTo(6)});
		
		
		
		var IBECarousel = new iCarousel("examples2", {
			idPrevious: "examples2_previous",
			idNext: "examples2_next",
			idToggle: "undefined",
			item: {
				klass: "examples2Item",
				size: 300 //size of slider window example?
	
			},
			animation: {
				type: "scroll",
				duration: 1000,
				amount: 1
			}
		});
		
		$("IBEthumb0").addEvent("click", function(event){new Event(event).stop();IBECarousel.goTo(0)});
		$("IBEthumb1").addEvent("click", function(event){new Event(event).stop();IBECarousel.goTo(1)});
		$("IBEthumb2").addEvent("click", function(event){new Event(event).stop();IBECarousel.goTo(2)});		
	}
}

