function initCarousel() {
	carouselWidth = 0 ;
	$.each($("#carousel li"), function() {
		carouselWidth += $(this).outerWidth({ margin: true }) ;
	}) ;
	$("#carouselHolder").addClass("js") ;
	$("#carousel ul").width(carouselWidth).css({
		position: "absolute",
		left: 0,
		top: 0
	}) ;
	$("#carousel li").hover(function() {
		$(this).fadeTo("fast", 1) ;
	}, function() {
		$(this).fadeTo("fast", ($(this).hasClass("active") ? 1 : 0.4)) ;
	}).not(".active").fadeTo(0.001, 0.4) ;

	viewportWidth = $("#carousel").outerWidth({ margin: true }) ;

	$(".arrowPrev").mousedown(function() {
		if ($("#carousel ul").css("left").substr(0, $("#carousel ul").css("left").length - 2) < -10) {
			$("#carousel ul").animate({
				left: "+=15"
			}, 500, 'easeInCubic') ;

			to = setTimeout(function() {
				t = setInterval(function() {
					if ($("#carousel ul").css("left").substr(0, $("#carousel ul").css("left").length - 2) < -10) {
						$("#carousel ul").animate({
							left: "+=20"
						}, 200, 'linear') ;
					} else {
						$(".arrowPrev").mouseup() ;
					}
				}, 200) ;
			}, 300) ;
		}
	}).mouseup(function() {
		if (typeof(to) == 'number') clearTimeout(to) ;
		if (typeof(t) == 'number') {
			clearInterval(t) ;
			t = undefined ;
			$("#carousel ul").stop().animate({
				left: "+=15"
			}, 500, 'easeOutCubic') ;
		}
	}) ;
	$(".arrowNext").mousedown(function() {
		if ($("#carousel ul").css("left").substr(0, $("#carousel ul").css("left").length - 2) > -(carouselWidth - viewportWidth - 20)) {
			$("#carousel ul").animate({
				left: "-=15"
			}, 500, 'easeInCubic') ;

			to = setTimeout(function() {
				t = setInterval(function() {
					if ($("#carousel ul").css("left").substr(0, $("#carousel ul").css("left").length - 2) > -(carouselWidth - viewportWidth - 20)) {
						$("#carousel ul").animate({
							left: "-=20"
						}, 200, 'linear') ;
					} else {
						$(".arrowNext").mouseup() ;
					}
				}, 200) ;
			}, 300) ;
		}
	}).mouseup(function() {
		if (typeof(to) == 'number') clearTimeout(to) ;
		if (typeof(t) == 'number') {
			clearInterval(t) ;
			t = undefined ;
			$("#carousel ul").stop().animate({
				left: "-=15"
			}, 500, 'easeOutCubic') ;
		}
	}) ;
	
	$(".arrowPrev, .arrowNext").click(function() {
		return false ;
	}) ;
	
	$("#carouselHolder").css("visibility","visible") ;
} ;
