function animation_carousel(){

		width = 400;

		NbElement = 3;

		marginleft = $(".carousel").css('marginLeft');

		marginleft = parseInt(marginleft.substr(0,(marginleft.length)-2)); 
		
		Cpt = (marginleft/(width))*(-1);

		if(Cpt < (NbElement-1) ) { 

				Cpt++;  		 

		}else{ 

				Cpt = 0;		 

		}
		 		 
		// Mouvement du carrousel en arrière-plan
		 
		$(".carousel").animate({

			marginLeft : - (width*Cpt)  	 

			});		

		for(i=1;i<4;i++){

			$("#alaune"+i+"").html('<a href="javascript:changeAlaune('+i+')" ><img  src="'+themeUrl+'/assets/css/images/pm6_styleselect3.png" class="no-border" /></a>');
		}

		Nav = Cpt+1;
		
		$("#alaune"+Nav+"").html('<a href="javascript:changeAlaune('+Nav+')" ><img src="'+themeUrl+'/assets/css/images/pm6_styleselect.png" class="no-border" /></a>');
		
	 }


function changeAlaune(indice){  
	
		clearInterval(interval_animation);
		
		Cpt = indice-1;
		
		width = 400;

		$(".carousel").animate({

			marginLeft : - (width*Cpt)
			  	 
		});		

		for(i=1;i<4;i++){

			$("#alaune"+i+"").html('<a href="javascript:changeAlaune('+i+')" ><img  src="'+themeUrl+'/assets/css/images/pm6_styleselect3.png" class="no-border" /></a>');
		}

		Nav = Cpt+1;
		
		$("#alaune"+Nav+"").html('<a href="javascript:changeAlaune('+Nav+')" ><img src="'+themeUrl+'/assets/css/images/pm6_styleselect.png" class="no-border" /></a>');
	
		interval_animation = setInterval("animation_carousel()",7000);
		
}

    

jQuery(document).ready(function(){
		
	if(jQuery("#carousel").size()>0){
		
	    interval_animation = setInterval("animation_carousel()",7000);

	    // Lire la suite et bordure miniature article
	    $('.zonecliquable').mouseenter(function() {
	    
	    	// Si autre que Internet Explorer (6,7,8)
	    	if(!$.browser.msie) {$(this).find('em').stop().animate({opacity: 1,marginTop: '-80'},300)}
	      
	    	$(this).find('div.post_left a.miniature span').stop().animate({opacity: 0.7}, 200)
	    
	    }).mouseleave(function(e){
	     
	    	// Si autre que Internet Explorer (6,7,8)
	    	if(!$.browser.msie) {$(this).find('em').stop().animate({opacity: 0,marginTop: '0'},300)}
	      
	    	$(this).find('div.post_left a.miniature span').stop().animate({opacity: 0.2}, 200)
	   
	    });   
	}
	    
});

 

 
