/**
 * We use the initCallback callback
 * to assign functionality to the controls
 */
function mycarousel_initCallback(carousel) {
    jQuery('#featured-products a.next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#featured-products a.prev').bind('click', function() {
        carousel.prev();
        return false;
    });
};

jQuery(document).ready(function() {

	if(jQuery('#featured-products #product-list-table').length > 0){
    jQuery('#featured-products #product-list-table').jcarousel({
      auto: 5,
      visible: 3,
      scroll: 3,
      wrap: 'circular',
      initCallback: mycarousel_initCallback,
      // This tells jCarousel NOT to autobuild prev/next buttons
      buttonNextHTML: null,
      buttonPrevHTML: null
    });
  }
  
});
