

//===========================================
//Systeme cronos by LJF
//===========================================
//var cro_Hr="33:40:60";	
//var cro_H="24:60:60";	
var cro_tps_ref = new Date();
cro_tps_ref=cro_tps_ref.getTime();
//cro_start_Dcompte("croname_rumeur",1,cro_Hr);
	//fonction qui remplace le texte d\'un element
function remplace(texte,id_place){
	for (i=0;document.getElementById(id_place+i);i++)
         document.getElementById(id_place+i).innerHTML=texte;
}

function cro_Dcompte(cro_id,cro_base,cro_mode,cro_unitemporel)	{
//if ((TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft <= 0)||(!TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft >= document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth)) {
	//Recuperation de l'heure
	cro_tps_ref2= new Date();
	cro_tps_ref2=cro_tps_ref2.getTime();
	cro_tps_passe=Math.floor((cro_tps_ref2-cro_tps_ref)/1000);
	
	//Decomposition de l'unite temporelle 
	cro_unitemporel=cro_unitemporel.split(":");
	cro_S_max=cro_unitemporel[2];
	cro_M_max=cro_unitemporel[1];
	cro_H_max=cro_unitemporel[0];
	
	//Recuperation du temps en seconde dans l'element
	cro_base=cro_base.split(":");
	cro_base_S=cro_base[0]*cro_M_max*cro_S_max+cro_base[1]*cro_S_max;
	
	if (cro_mode==1) cro_tps=cro_base_S+cro_tps_passe;
	else cro_tps=cro_base_S-cro_tps_passe;
	
	cro_H_act=Math.floor(cro_tps/cro_S_max/cro_M_max);
	cro_M_act=Math.floor((cro_tps-cro_H_act*cro_S_max*cro_M_max)/cro_S_max);
	cro_S_act=cro_tps-cro_H_act*cro_S_max*cro_M_max-cro_M_act*cro_S_max;
	if((cro_H_act>cro_H_max)&&(cro_mode==1))  cro_H_act=0;
		
	if ((cro_tps<=0)&&(cro_mode==0))	remplace("Reload",cro_id);
	else remplace(cro_H_act+":"+cro_M_act,cro_id);
//}	
	
}
function cro_start_Dcompte() {
	cro_base=document.getElementById("croname_rumeur0").innerHTML;
	cro_Dcompte("croname_rumeur",cro_base,1,"33:40:60");
}
//cro_start_Dcompte("Dcompte_Heure",1,cro_Hr);
//cro_start_Dcompte("Dcompte_Heure2",0,cro_Hr);



// WebTicker by Mioplanet
// www.mioplanet.com



TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
 
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "font-family:Arial; font-size:12px; color:#444444";
TICKER_PAUSED = false;

ticker_start();


function ticker_start() {
	var tickerSupported = false;
	TICKER_WIDTH = document.getElementById("TICKER").style.width;
	var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0>";

	// Firefox
	if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
		document.getElementById("TICKER").innerHTML = "<TABLE  cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
		tickerSupported = true;
	}
	// IE
	if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
		document.getElementById("TICKER").innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>";
		tickerSupported = true;
	}
	if(!tickerSupported) document.getElementById("TICKER").outerHTML = ""; 
	else {
		document.getElementById("TICKER").scrollLeft = TICKER_RIGHTTOLEFT ? document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth : 0;
		document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;
		document.getElementById("TICKER").style.display="block";
		TICKER_tick();
	}
}

function TICKER_tick() {
	if(!TICKER_PAUSED) document.getElementById("TICKER").scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
	if(TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft <= 0) {
	 document.getElementById("TICKER").scrollLeft = document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth;
	 cro_start_Dcompte();
	 }
	if(!TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft >= document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth)  {
		document.getElementById("TICKER").scrollLeft = 0;
		cro_start_Dcompte();
	}
	window.setTimeout("TICKER_tick()", 30);
}


