function initFlash(e) {
	totalFlashInfoCount = $("mesActusFlash").getElementsByTagName("div").length;
	monTimer=0; flashInfoCounter = 0;			
	Element.insert($("containerFlash"), { bottom: $("mesActusFlash").getElementsByTagName("div")[flashInfoCounter] });
	setTimeout("nextFlashInfo()",6000);	
}
function nextFlashInfo() {	
	if (totalFlashInfoCount < 2) {
		return;
	}
	flashInfoCounter++;
	if(flashInfoCounter == totalFlashInfoCount) { flashInfoCounter=0; }
		// recup de l'element suivant et positionnement apres le flashinfo en cours d'affichage
		Element.insert($("containerFlash"), { bottom: $("mesActusFlash").getElementsByTagName("div")[0] });
		$("containerFlash").childElements()[1].setStyle({"left":"530px"}); 
	monTimer=setInterval("transitionFlashInfo()",15);			
}
function transitionFlashInfo() {
	
	if($("containerFlash").childElements()[1].positionedOffset()[0]>0) {
		var myOffset = Math.ceil(($("containerFlash").childElements()[1].positionedOffset()[0]+30) /10);
		$("containerFlash").childElements()[0].setStyle({"left":$("containerFlash").childElements()[0].positionedOffset()[0]-myOffset+"px"});
		$("containerFlash").childElements()[1].setStyle({"left":$("containerFlash").childElements()[1].positionedOffset()[0]-myOffset+"px"});
	}
	else { 
		Element.insert($("mesActusFlash"), { bottom: $("containerFlash").getElementsByTagName("div")[0] });
		clearInterval(monTimer); 
		setTimeout("nextFlashInfo()",6000);	
	}
}
Event.observe(document,"dom:loaded",initFlash);

