

function carousel_itemVisibleInCallbackBeforeAnimation(carousel, state, item) {
	$("#" + item).addClass('active');
};

function carousel_itemVisibleInCallbackAfterAnimation(carousel, state, item) {

};

function carousel_itemVisibleOutCallbackBeforeAnimation(carousel, state, item) {
	$("#" + item).removeClass('active');
};

function carousel_itemVisibleOutCallbackAfterAnimation(carousel, state, item) {

};

function carousel_initCallback(carousel) {
    jQuery('#controls a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr('id')));
        return false;
    });

    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });
}



jQuery(document).ready(function() {
    jQuery('#carousel').jcarousel({
    	vertical: true,
		scroll: 1,
		visible: 1,
		auto: 10,
		animation: 1000,
		wrap: 'last',
		itemVisibleInCallback: {
            onBeforeAnimation: carousel_itemVisibleInCallbackBeforeAnimation,
            onAfterAnimation:  carousel_itemVisibleInCallbackAfterAnimation
        },
		itemVisibleOutCallback: {
            onBeforeAnimation: carousel_itemVisibleOutCallbackBeforeAnimation,
            onAfterAnimation:  carousel_itemVisibleOutCallbackAfterAnimation
        },
		initCallback: carousel_initCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null

    });
});
