function mycarousel_initCallback(carousel) {

	var paused = 0;
	
	/*
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.stopAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.stopAuto(0);
    });
	
	/*
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
    */
    
    
    $('.pause').bind('click', function() { 
	    if (paused) {
	    	carousel.startAuto(10);
	    	paused = 0; 
	    	$('#paused').removeClass('pause-active');
	    	$('#paused').addClass('pause');
	    	$('#paused').attr('title','pause');
	    } else { 
	    	carousel.startAuto(0);
	    	paused = 1;
	    	$('#paused').removeClass('pause');
	    	$('#paused').addClass('pause-active');
	    	$('#paused').attr('title','play');
	    }
	    return false;
	 });
  
    $('.carousel-nav-numbers a').bind('click', function() {
    	if (paused == 1) {
    		carousel.startAuto(0);
    	}
        carousel.scroll($.jcarousel.intval($(this).text()));
        return false;
    });
    
    $('.next-arrow').bind('click', function() {
    	if (paused == 1) {
    		carousel.startAuto(0);
    	}
        carousel.next();
        return false;
    });

    $('.prev-arrow').bind('click', function() {
	    if (paused == 1) {
    		carousel.startAuto(0);
    	}
        carousel.prev();
        return false;
    });
};

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


