function doClassmagsCarousels() {
	var magazineCarousel = new UI.Carousel("classmagsInterface", {scrollInc: 4});
	var booksCarousel = new UI.Carousel("classmagsBooks");
	
	/** Setup books carousel **/
	booksCarousel.watchNextButton = function (e) {
		// Check if the next button is active
		var nextClassName = "next_button" + booksCarousel.options.disabledButtonSuffix;
		if (!e.element().hasClassName(nextClassName)) {	
			// Enabled, get current indicator number, and advance it by one
			var currentIndicator = $$("div#classmagsBooks div.indicator_bar div.indicator_active").first();
			booksCarousel.setIndicator(parseInt(currentIndicator.identify().substr(currentIndicator.identify().length - 1, 1))+1);
			booksCarousel.stopWatchingButtons();
		}
	}
	
	booksCarousel.watchPreviousButton = function (e) {
		// Check if the previous button is active
		var previousClassName = "previous_button" + booksCarousel.options.disabledButtonSuffix;
		if (!e.element().hasClassName(previousClassName)) {		
			// Enabled, get current indicator number, and reverse it by one
			var currentIndicator = $$("div#classmagsBooks div.indicator_bar div.indicator_active").first();
			booksCarousel.setIndicator(parseInt(currentIndicator.identify().substr(currentIndicator.identify().length - 1, 1))-1);
			booksCarousel.stopWatchingButtons();
		}
	}
	
	var watchPreviousBooksBind = booksCarousel.watchPreviousButton.bindAsEventListener();
	var watchNextBooksBind = booksCarousel.watchNextButton.bindAsEventListener();
	
	booksCarousel.setIndicator = function (num) {
		var num = (num == null) ? 1 : num;
		
		// clear the indicators
		$$("div#classmagsBooks div.indicator_bar").first().childElements().each(function (indicator) {
			indicator.className = "indicator";
		});
		
		$("classmags_book_indicator_"+num).className = "indicator_active";
	}
	
	booksCarousel.buildIndicators = function () {
		var indicators = ((booksCarousel.container.childElements().length) / 4).ceil();
		var indicatorBar = $$("div#classmagsBooks div.indicator_bar").first();
		
		indicators.times(function (index) {
			indicator = new Element("div", {'class': "indicator", id: "classmags_book_indicator_"+(index+1)});
			indicator.style.cursor = "pointer";
			indicatorBar.appendChild(indicator.observe("click", function (e) {
				ind = e.element();
				num = ind.identify().substr(ind.identify().length - 1,1);
				booksCarousel.setIndicator(num);
				booksCarousel.scrollTo((num - 1 ) * 4);
			}));
		});
		
		booksCarousel.setIndicator();
		booksCarousel.watchButtons();
	}
	
	booksCarousel.watchButtons = function () {
		$(booksCarousel.nextButton).observe("click", watchNextBooksBind);
		$(booksCarousel.previousButton).observe("click", watchPreviousBooksBind);
	}
	
	booksCarousel.stopWatchingButtons = function() {
		$(booksCarousel.nextButton).stopObserving("click", watchNextBooksBind);
		$(booksCarousel.previousButton).stopObserving("click", watchPreviousBooksBind);
	}
	
	booksCarousel.observe("scroll:ended", function (e) {
		booksCarousel.updateSize();
		booksCarousel.watchButtons();
	});
	
	booksCarousel.buildIndicators();	

/** setup magazine carousel **/

magazineCarousel.watchNextButton = function (e) {
		// Check if the next button is active
		var nextClassName = "next_button" + magazineCarousel.options.disabledButtonSuffix;
		if (!e.element().hasClassName(nextClassName)) {	
			// Enabled, get current indicator number, and advance it by one
			var currentIndicator = $$("div#classmagsHeader div.indicator_bar div.indicator_active").first();
			magazineCarousel.setIndicator(parseInt(currentIndicator.identify().substr(currentIndicator.identify().length - 1, 1))+1);
			magazineCarousel.stopWatchingButtons();
		}
	}
	
magazineCarousel.watchPreviousButton = function (e) {
		// Check if the previous button is active
		var previousClassName = "previous_button" + magazineCarousel.options.disabledButtonSuffix;
		if (!e.element().hasClassName(previousClassName)) {		
			// Enabled, get current indicator number, and reverse it by one
			var currentIndicator = $$("div#classmagsHeader div.indicator_bar div.indicator_active").first();
			magazineCarousel.setIndicator(parseInt(currentIndicator.identify().substr(currentIndicator.identify().length - 1, 1))-1);
			magazineCarousel.stopWatchingButtons();
		}
	}
	
	var watchPreviousMagazineBind = magazineCarousel.watchPreviousButton.bindAsEventListener();
	var watchNextMagazineBind = magazineCarousel.watchNextButton.bindAsEventListener();
	
	magazineCarousel.setIndicator = function (num) {
		var num = (num == null) ? 1 : num;
		
		// clear the indicators
		$$("div#classmagsHeader div.indicator_bar").first().childElements().each(function (indicator) {
			indicator.className = "indicator";
		});
		
		$("classmags_magazine_indicator_"+num).className = "indicator_active";
	}
	
	magazineCarousel.buildIndicators = function () {
		var indicators = ((magazineCarousel.container.childElements().length) / 4).ceil();
		var indicatorBar = $$("div#classmagsHeader div.indicator_bar").first();
		
		indicators.times(function (index) {
			indicator = new Element("div", {'class': "indicator", id: "classmags_magazine_indicator_"+(index+1)});
			indicator.style.cursor = "pointer";			
			indicatorBar.appendChild(indicator.observe("click", function (e) {
				ind = e.element();
				num = ind.identify().substr(ind.identify().length - 1,1);
				magazineCarousel.setIndicator(num);
				magazineCarousel.scrollTo((num - 1 ) * 4);
			}));
		});
		
		magazineCarousel.setIndicator();
		magazineCarousel.watchButtons();
	}
	
	magazineCarousel.watchButtons = function () {
		$(magazineCarousel.nextButton).observe("click", watchNextMagazineBind);
		$(magazineCarousel.previousButton).observe("click", watchPreviousMagazineBind);
	}
	
	magazineCarousel.stopWatchingButtons = function() {
		$(magazineCarousel.nextButton).stopObserving("click", watchNextMagazineBind);
		$(magazineCarousel.previousButton).stopObserving("click", watchPreviousMagazineBind);
	}
	
	magazineCarousel.observe("scroll:ended", function (e) {
		magazineCarousel.watchButtons();
	});
	
	magazineCarousel.buildIndicators();
	
	if (booksCarousel.elements.size() < 4.5) {
		$(booksCarousel.nextButton).addClassName("next_button"+booksCarousel.options.disabledButtonSuffix);
	}
	if (magazineCarousel.elements.size() < 4.5) {
		$(magazineCarousel.nextButton).addClassName("next_button"+magazineCarousel.options.disabledButtonSuffix);
	}
}