function mycarousel_initCallback(carousel) {
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
    $('.img-nav .circle-nav a').bind('click', function() {
        carousel.scroll($.jcarousel.intval($(this).text()));
        return false;
    });
    
    $('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    $('#mycarousel-previous').bind('click', function() {
        carousel.prev();
        return false;
    });
};

function mycarousel_itemVisibleInCallbackAfterAnimation(carousel, item, idx, state) {
	$(".img-nav a").removeClass('active');
	$("#carousel_"+idx).addClass('active');
};