function mycarousel_initCallback(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.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

jQuery(document).ready(function() {
	
	if('#mycarousel')
	{
		$('#mycarousel').css("display","block");
		if(jQuery('#mycarousel').jcarousel)
		{
		    jQuery('#mycarousel').jcarousel({
		        auto: 4, scroll:4, wrap:'both',
		        wrap: 'last',
			  animation: 3500,
		        initCallback: mycarousel_initCallback
		    });
	    }
      }
	
    
	     $('li.jcarousel-item').mouseover(function(){ 
	        $(this).css('background','#9F9F9F none');
	        $(this).children('a').css('color','#ffffff');
	     });  
	     
	      $('li.jcarousel-item').mouseout(function(){ 
	        $(this).css('background','#FFFFFF none');
	         $(this).children('a').css('color','#2E2D2E');
	     });
	     
	     if($('a.hreflot')!=null)
	     {
	         $('a.hreflot').children('div.lot').mouseover(function(){ 
	            $(this).css('background','#9F9F9F none');
	            $(this).css('color','#ffffff');
	            $(this).css('cursor','pointer');
	         });
    	     
	         $('a.hreflot').children('div.lot').mouseout(function(){ 
	            $(this).css('background','#FFFFFF none');
	            $(this).css('color','#2E2D2E');
	         });     
	     }
	     
	     if($('#voirlots')!=null)
	     {
	        $('#voirlots').mouseover(function(){ 
	            $(this).css('background','#9F9F9F none');
	            $(this).children('a').children('span.grie').css('color','#ffffff');
	            $(this).css('cursor','pointer');
	         });
    	     
	         $('#voirlots').mouseout(function(){ 
	            $(this).css('background','transparent none');
	            $(this).children('a').children('span').css('color','#816755');
	            $(this).children('a').children('span.grie').css('color','#575057');
	         });  
	     }
	     
	     if($('div.lotresultat')!=null)
	     {
		   $('div.lotresultat').mouseover(function(){ 
	            $(this).css('background','#9F9F9F none');
	            $(this).css('color','#ffffff');
	            $(this).css('cursor','pointer');
	         });
    	     
	         $('div.lotresultat').mouseout(function(){ 
	            $(this).css('background','transparent none');
	            $(this).css('color','#816755');
	            $(this).css('color','#575057');
	         }); 
	     }
	     
	     if($('div.soustitre').children('h3')!=null)
	     {
			$('div.soustitre').children('h3').css('color','#2E2D2E');
	     }
	
});