﻿/**
 * Dynamically generates new carousel objects based on the name argument passed into the load function
 *
 */
CarouselLoader = Class.create();
Object.extend(CarouselLoader.prototype, {

	/**
	*	define member vars for this class
	*
	*/
	initialize: function() {

	},
	
	load: function(carouselName, direction, width, height) {
	
		var newCarousel = {};
		var element = $(carouselName);
		
		if(element == null) alert('CarouselLoader.load - ' + carouselName + " is null!");
		
		newCarousel = new Carousel(carouselName, element, width, height, this, {
			setSize: 2,
			duration: .4,
			direction: direction,
			itemParser: function(item) {
				
			},
			setItemEvents: function(carousel, itemElement, carouselItem, observer) {
				
			},
			allowAutoLoopOnSet: true,
			allowAutoLoopOnIndividual: true
		});
		newCarousel.load();
						
	}
	
	
	
});
