    /*
function featured_carousel_initCallback(carousel) {
        // Disable autoscrolling if the user clicks the prev or next button.
        carousel.buttonNext.bind('click', function() {
            carousel.startAuto(3);
        });
        
        .jcarousel-control a.bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });
    

        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();
        });
    };
*/

function featured_carousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
        return false;
    });
    
    
    $('.jcarousel-control a').click(function()
{
  $('.jcarousel-control a').removeClass('active');
  $(this).addClass('active');
});

    jQuery('.jcarousel-scroll select').bind('change', function() {
        carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
        return false;
    });

    jQuery('#featured_carousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#featured_carousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};



    jQuery(document).ready(function() {
    jQuery('#featured_carousel').jcarousel({
            auto: 7,
            scroll: 1,
            wrap: 'last',
            initCallback: featured_carousel_initCallback,
            itemVisibleInCallback: {
            onAfterAnimation: function(c, o, i, s) {
            --i;
              jQuery('.jcarousel-control a').removeClass('active');
              jQuery('.jcarousel-control a:eq('+i+')').addClass('active');
            }
		   }
        });
    });

  

