function initCarousel_html_carousel() {
	carousel = new Carousel(thebarid, {animParameters:{duration:0.5}, buttonStateHandler:buttonStateHandler, nextElementID:thenextid, prevElementID:theprevid, size:31});
}

Event.observe(window, 'load', initCarousel_html_carousel);

function buttonStateHandler(button, enabled) {
	if (button == theprevid) 
		$(theprevid).src = enabled ? previmg1 : previmg2
	else 
		$(thenextid).src = enabled ? nextimg1 : nextimg2
}

function animHandler(carouselID, status, direction) {
	var region = $(carouselID).down(".carousel-clip-region")
	if (status == "before") {
		Effect.Fade(region, {to: 0.3, queue: { position:'end', scope: "carousel" }, duration: 0.2})
	}
	if (status == "after") {
		Effect.Fade(region, {to: 1, queue: { position:'end', scope: "carousel" }, duration: 0.2})
	}
}