
var Kaliop_MyCarousel_Helper = {
    Instance: null,
    init: function()
    {
	  jQuery('#mycarousel').jcarousel({
		scroll : 1, 
		visible : 1, 
		wrap: 'circular',
		setupCallback: Kaliop_MyCarousel_Helper.initCallback,
		auto: 5 //nb seconds between auto scroll
	  });
    },
    
    initCallback: function(carousel){
	  Kaliop_MyCarousel_Helper.Instance = carousel;
	  // Disable autoscrolling if the user clicks the prev or next button.
	  /*carousel.buttonNext.bind('click', function() {
		carousel.startAuto(0);
	  });*/
    
	 /* carousel.buttonPrev.bind('click', function() {
		carousel.startAuto(0);
	  });*/
    
	  // Pause autoscrolling if the user moves with the cursor over the clip.
	  
	  
	  Kaliop_MyCarousel_Helper.Instance.clip.hover(function() {
		Kaliop_MyCarousel_Helper.Instance.stopAuto();
	  }, function() {
		Kaliop_MyCarousel_Helper.Instance.startAuto();
	  });
    }
};

// VISIONNEUSE
$(document).ready(function(){
	// This initialises carousels on the container elements specified, in this case, carousel1.
	$('#carousel1').CloudCarousel(
		{
             minScale:0.25
            ,reflHeight: 36
            ,reflGap: -2
            ,reflOpacity: 0.5
			,titleBox: $('#title-text')
			,altBox: $('#alt-text')
			,relBox: $('#rel-text')
			,buttonLeft: $('#left-but')
			,buttonRight: $('#right-but')
            ,xRadius: 325   
            ,yRadius: 60    
            ,xPos: 352      
			,yPos: 20       
            ,speed:0.2      
            ,bringToFront: true 
            //,mouseWheel:true
        }
	);
    
    Kaliop_MyCarousel_Helper.init();
});
