function mycarousel_initCallback(carousel)
{
	var min = 230;
	var max = 940;
	var dep = 0;

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
		
		/*
		jQuery(this).mousemove(function(e) {
			var deplacement = e.pageX-((max-min)/2+min);
			var position = jQuery('#mycarousel').position();
			var pos_left = position.left;

			if(pos_left <= -151 && deplacement < 0) {
				dep = pos_left+151;
			} else if(pos_left >= -100 && deplacement > 0) {
				dep = pos_left-151;
			}

			jQuery('#mycarousel').stop().animate({'left': dep+'px'}, 'slow');

		});
		*/

    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
    jQuery('#mycarousel').jcarousel({
        auto: 2,
        wrap: 'last',
        initCallback: mycarousel_initCallback,
		scroll: 1
    });

	jQuery('#mycarousel li a').css({'opacity': '0.3'});
	jQuery('#mycarousel li a').hover(function() {
		jQuery(this).css({'opacity': '0'});
	}, function() {
		jQuery(this).css({'opacity': '0.3'});
	});
});
