$(window).load(function(){
	$(".carouselContent").each(function(){
		var data = this.moduleProperties;
		var slotId = $(this).parents(".moduleslot:first").attr("id");

		$(".carousel").jCarouselLite({
			btnNext : "#" + slotId + " .next",
			btnPrev : "#" + slotId + " .prev",
			circular: true,
			easing: data.easing,
			scroll: data.scroll,
			speed: data.speed,
			start: 0,
			visible: data.visible,
			
			beforeStart: function(a) {$(a).siblings(a).not(a).css("visibility","visible");},
			afterEnd: function(a) {$(a).siblings(a).not(a).css("visibility","hidden");}

		});
		
		$("li", this).css("visibility","hidden").slice(data.visible,data.visible+data.visible).css("visibility","visible"); 
		
		var description = $(".description", this);
		if (description.length == 1) {
			$("ul a", this).mouseover(function(){
				var itemDescription = $("img:first", this).attr("title");
				description.html(itemDescription);
			});
			$("ul a", this).mouseout(function(){
				description.html("");
			});
		}
	});
});