var sens=1;
//timing du fondu enchain&eacute;
//nb_pas : nombre de changement d'opacit&eacute; successifs durant le foncu encha&icirc;n&eacute;
//time_pas : dur&eacute;e de chaque changement d'opacit&eacute;
var nb_pas=10;
var time_pas=25;
function setOpacity(value) {
	if (sens==2)
	{
		document.getElementById("div_edito_photo1").style.opacity = value/10;
		document.getElementById("div_edito_photo1").style.filter = 'alpha(opacity=' + value*10 + ')';
		document.getElementById("div_edito_photo2").style.opacity = (10-value)/10;
		document.getElementById("div_edito_photo2").style.filter = 'alpha(opacity=' + (10-value)*10 + ')';
	}
	else
	{
		document.getElementById("div_edito_photo2").style.opacity = value/10;
		document.getElementById("div_edito_photo2").style.filter = 'alpha(opacity=' + value*10 + ')';
		document.getElementById("div_edito_photo1").style.opacity = (10-value)/10;
		document.getElementById("div_edito_photo1").style.filter = 'alpha(opacity=' + (10-value)*10 + ')';
	}
}
function time_passing()
{
	//on efface tous les matchs
	for (i=0;i<tab_matchs_du_jour.length;i++) document.getElementById("match_du_jour_"+tab_matchs_du_jour[i]).style.display="none";
	//on d&eacute;fini le match &agrave; afficher
	var id_match_a_afficher=0;
	for (i=0;i<tab_matchs_du_jour_jeton.length;i++)
	{
		if (tab_matchs_du_jour_jeton[i]==1) id_match_a_afficher=i+1;
		//si tous les matchs ont &eacute;t&eacute; affich&eacute;, on reviens au premier
		if (id_match_a_afficher>=tab_matchs_du_jour_jeton.length) id_match_a_afficher=0;
	}
	//on affiche le match du jour suivant
	document.getElementById("match_du_jour_"+tab_matchs_du_jour[id_match_a_afficher]).style.display="block";
	//on modifie la photo /*var lien = tab_liens_matchs_du_jour[id_match_a_afficher];*/
	if (edito_photo!="")
	{
		var lien = edito_url;
		if (tab_photos_matchs_du_jour[id_match_a_afficher]=="") document.getElementById("div_edito_photo"+sens).innerHTML = edito_photo;
		else document.getElementById("div_edito_photo"+sens).innerHTML = tab_photos_matchs_du_jour[id_match_a_afficher];
		for (i=1;i<=nb_pas;i++) setTimeout('setOpacity('+(i*10/nb_pas)+')',time_pas*i);
	}
	//on met &agrave; jour le tableau de jeton
	for (i=0;i<tab_matchs_du_jour_jeton.length;i++) tab_matchs_du_jour_jeton[i]=0;
	tab_matchs_du_jour_jeton[id_match_a_afficher]=1;
	//on change de sens
	sens=sens+1; if (sens==3) sens=1;
	//on attend le prochain changement de match du jour
	setTimeout("time_passing()",time_pass);
}

