function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });

    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });

    jQuery('#slideshow_promo #buttons a#next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#slideshow_promo #buttons a#prev').bind('click', function() {
        carousel.prev();
        return false;
    });
	
};

function mycarousel_itemLastInCallback(carousel, item, idx, state) {
	if(idx == carousel.size()){
    	jQuery('#slideshow_promo #buttons a#next').addClass('no_click');
	}
	return false;
};

function mycarousel_itemLastOutCallback(carousel, item, idx, state) {
	if(idx == carousel.size()){
    	jQuery('#slideshow_promo #buttons a#next').removeClass('no_click');
		}
	return false;
};


// Ride the carousel...
jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        scroll: 2,
        initCallback: mycarousel_initCallback,
		itemLastInCallback:   mycarousel_itemLastInCallback,
		itemLastOutCallback:   mycarousel_itemLastOutCallback,
        // This tells jCarousel NOT to autobuild prev/next buttons
        buttonNextHTML: null,
        buttonPrevHTML: null,
		itemFallbackDimension: 336
    });
	
	jQuery('#mycarousel ul li').siblings(':last-child').addClass('last-child');
	jQuery("#slideshow_promo_body").css("visibility","visible");
});


