// JavaScript Document
function init(){
$(".anim").css("opacity",0);
$("#pub5").css("opacity",0);
$("#pub2").css("opacity",0);
clignote(0);
timer=setInterval("lanceanim()",1500);
timer2=setTimeout('changefoot()',15000);
}

liencontact=function(){
window.location.href="planning/interfaceacces.php";
}

clignote=function(a){
if(a<1){
$("#pub2").animate({ 
      opacity: 1
      },600,"",function(){
$(this).animate({ 
	   opacity: 0
      },700,"",function(){
		  clignote(a+1);
	  }
	  );
	  });
} else {
$("#pub2").animate({ 
      opacity: 1
      },600,"",function(){
	fenmouv();
	}
	  );
}
}

clignotefl=function(){
$("#pub5").animate({ 
      opacity: 1
      },800,"",function(){
$(this).animate({ 
	   opacity: 0
      },800,"",function(){
		  clignotefl();
	  }
	  );
	  });
}

fenmouv=function(){
$("#pub2").animate({ 
      marginLeft: '6px',
	  marginTop: '6px'
      },1100,"",function(){
	$("#pub4").slideDown("slow");
	clignotefl();
	  }
)
}

changefoot= function(){

inifoot=inifoot+1; if(inifoot>7){inifoot=0;}
$("#textfoot").animate({ 
        opacity: 0
      }, 1000,"",function () {var htmfoot=$("#footer span").eq(inifoot).html();
$("#textfoot").html(htmfoot);
$("#textfoot").animate({ 
        opacity: 1
      },1000,"",function () {timer=setTimeout('changefoot()',15000);});});
}


function lanceanim(){
	b=Math.random();
	c=Math.random();
	d=Math.random();
a=Math.floor(8.5*Math.random());
allume(a);
}



function allume(a){
$(".anim").eq(a).animate({ 
        opacity: 1
      },400,"",function(){setTimeout('eteint('+a+')',2000);});
}
function eteint(a){
$(".anim").eq(a).animate({ 
        opacity: 0
      }, 300,"","");
}
