function do_animation(c)
{
	$(".img_animation:eq("+c+")").fadeTo(300,0.60);
	$(".img_animation:eq("+c+")").fadeTo(300,1.00);
//	$(".img_animation:eq("+c+")").animate({opacity:1}, 10000, "linear", do_animation());
	$(".img_animation:eq("+c+")").fadeTo(1000,1.00);	
	timeoutstring="$('.img_animation:eq("+c+")').fadeTo(1000,1.00, do_animation(";
	if(c>3)
		timeoutstring=timeoutstring+"0));"
	else
		timeoutstring=timeoutstring+(c+1)+"));"
	setTimeout(timeoutstring, 2000);	
}


jQuery(document).ready(
	function(){

		$(".enterleave").click( function(e) {
		if($(this).attr("target")=="_blank")
			window.open($(this).attr("href"));
		else
			window.location.href= $(this).attr("href");
		});
	
		$(".enterleave").bind("mouseenter",function() {
			btn_on=$(this).children(".btn_on");
			texte_btn=$(this).children(".texte_btn");
			if(btn_on.queue("fx")==undefined)
			{
				l=0;
			}
			else
			{
				l=btn_on.queue("fx").length;
			}
			if(l==0)
			{
				btn_on.fadeOut("normal");
			}
			if(texte_btn.queue("fx")==undefined)
			{
				l=0;
			}
			else
			{
				l=texte_btn.queue("fx").length;
			}
			if(l==0)
			{
				texte_btn.effect("bounce", { times: 3 }, 300);
			}
		 });
	
		$(".enterleave").bind("mouseleave",function() {
			btn_on=$(this).children(".btn_on");
			btn_on.fadeIn("normal");
		});


		$(".promo_haut").corner("5px");
		
		$("a.bouton").corner("5px");


// a l'ouverture de la page. animation sur les petites photos	
	do_animation(0);

});


