/*
	Set up carousel control buttons
*/
function mycarousel_initCallback(carousel) {
	$('.jcarousel-control a').bind('click', function() {
		carousel.scroll($.jcarousel.intval(jQuery(this).text()));
		return false;
	});
};
/*
	Callback function to update page buttons for slideshow
*/
function mycarousel_itemVisibleInCallback(carousel, item, idx, state) {
	$('.jcarousel-control a').filter(
		function() {
			if ($(this).text() == idx) {
				return true;
			} else {
				return false;
			}
		}).toggleClass('active');
	$('.jcarousel-control a')	.filter(
			function() {
				if ($(this).text() == idx) {
					return true;
				} else {
					return false;
				}
			}).siblings('.active').toggleClass('active');
}

$(document).ready(function() {
    $('#mycarousel').jcarousel({
        // Configuration goes here
		auto: 4,
		animation: 'slow',
		scroll: 1,
		wrap: 'last',
		initCallback: mycarousel_initCallback,
		itemVisibleInCallback: {
			onBeforeAnimation: mycarousel_itemVisibleInCallback
			},
		buttonNextHTML: null,
		buttonPrevHTML: null
    });
});