$( document ).ready( function(){
	$('.slides ul').jcarousel({
		scroll: 1,
		auto: 5,	/* delay in seconds */
		wrap: 'both',
		animation: "slow",
		initCallback: _init_carousel,
		buttonNextHTML: null,
		buttonPrevHTML: null
	});	/* docs: http://sorgalla.com/projects/jcarousel/ */

});

function _init_carousel(carousel) {
	$('.slider-nav .next').bind('click', function() {
		carousel.next();
		carousel.startAuto(0);
		return false;
	});
	
	$('.slider-nav .prev').bind('click', function() {
		carousel.prev();
		carousel.startAuto(0);
		return false;
	});


    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });

};

