var effectifLeft = 0;

function effectif (sens, nbr) {
	effectifLeft += (sens*670);
	
	
	$('#effectifHead #contenu2').animate({left: effectifLeft+'px'}, 500);
	
	if (effectifLeft < 0) $('#effectifHead #flecheGauche').html('<a href="javascript:effectif(1, '+nbr+');"><img src="images/effectif/fleche-gauche.png" alt="" /></a>');
	else $('#effectifHead #flecheGauche').html('<img src="images/effectif/fleche-gauche.png" alt="" />');
	
	if (effectifLeft <= (0 - (nbr-1)*670)) $('#effectifHead #flecheDroite').html('<img src="images/effectif/fleche-droite.png" alt="" />');
	else $('#effectifHead #flecheDroite').html('<a href="javascript:effectif(-1, '+nbr+');"><img src="images/effectif/fleche-droite.png" alt="" /></a>');
}



$(document).ready(
	function() {
		var fadein_speed  = 350; /* Vitesse de transition (show) en ms (350 = 0.350s) */
		var fadeout_speed = 150; /* Vitesse de transition (hide) en ms (150 = 0.150s) */
		var opacity_show  = 1;   /* Opacité du background (show) (1 = 100%) */
		var opacity_hide  = 0;   /* Opacité du background (hide) (0 =   0%) */
		
		$('#effectifHead #contenu img').hover(
			function () { // mouse hover
				$(this).css({cursor: 'pointer'});
			}
			,
			function () { // mouse leave  
				$(this).css({cursor: 'auto'});
			}
		);
		
		
		$('#effectifHead #contenu img').click(
			function () {
				var id = $(this).attr('id').substr(26);
				$('.ficheCoureur').css({display: 'none'});
				// $('#ficheCoureur'+id).css({display: 'block'});
				$('#ficheCoureur'+id).fadeTo(fadein_speed, opacity_show);
			}
		);
	}
);
