function _init_slider(carousel) {
	jQuery('#slider-nav a').bind('click', function() {
		var index = jQuery(this).parent().find('a').index(this);
		carousel.scroll( index + 1);
		return false;
	});
};

function _active_slide(carousel, item, idx, state) {
	var index = idx-1;
	jQuery('#slider-nav a').removeClass('active');
	jQuery('#slider-nav a').eq(index).addClass('active');
};

function _init_more_products(carousel) {
	jQuery('.more-nav .next').bind('click', function() {
		carousel.next();
		return false;
	});
	
	jQuery('.more-nav .prev').bind('click', function() {
		carousel.prev();
		return false;
	});
};

jQuery(document).ready(function() {
	
	jQuery("#slider-holder ul").jcarousel({
		scroll: 1,
		auto: 6,
		wrap: 'both',
		initCallback: _init_slider,
		itemFirstInCallback: _active_slide,
		buttonNextHTML: null,
		buttonPrevHTML: null
	});
	
	jQuery(".more-products-holder ul").jcarousel({
		scroll: 2,
		auto: 5,
		wrap: 'both',
		initCallback: _init_more_products,
		buttonNextHTML: null,
		buttonPrevHTML: null
	});
});

