function jCarouselInitCallback(carousel) {
	$("#gallery-carousel-prev").bind("click", function() {
		carousel.prev();
		return false;
	});
	
	$("#gallery-carousel-next").bind("click", function() {
		carousel.next();
		return false;
	});
}

$(function() {
	if ($("#gallery-carousel").length) {
		$("#gallery-carousel a").live("click", function() {
			var previewImageUrl = $(this).attr("href"),
				previewImageDesc = $(this).attr("title");
			
			$("#gallery-carousel-preview").html('<img src="'+previewImageUrl+'" />');
			$("#gallery-carousel-preview-title").html(previewImageDesc);
			
			return false;
		})
		.filter(":first").trigger("click");
		
		$("#gallery-carousel").bxSlider({
			displaySlideQty: 4,
		    moveSlideQty: 4
		});
	}
});
