 displayTimeS = 4000;
transitionTimeS = 20;

currentSommaire = 1;
loopSommaire = setTimeout('changeSommaire();',displayTimeS);

function changeSommaire() {
	currentSommaire++;
	if (currentSommaire>nbSommaire) currentSommaire = 1;
	selectSommaireIndex(currentSommaire,transitionTimeS*5);
}

function selectSommaireIndex(index,delay) {
	clearTimeout(loopSommaire);
	oldIndex = 0;
	for (i=1;i<=nbSommaire;i++) {
		if (document.getElementById('Sommaire_on_'+i).style.display != 'none') {
			oldIndex = i;
		}
	}
	setTimeout('fadeSommaire('+index+','+ oldIndex +',10,'+delay+')',delay);
}

function fadeSommaire(index,currentIndex,idx,delay) {
	$("#Sommaire"+currentIndex).removeClass().addClass('transgris'+idx);
	if (idx==0) continueSelectSommaireIndex(index)
	else setTimeout('fadeSommaire('+index+','+currentIndex+','+--idx+','+delay+')',delay);
}


function continueSelectSommaireIndex(index) {
	currentSommaire = index;
	for (i=1;i<=nbSommaire;i++) {
		if (i==index) {
			//$("#Sommaire"+index).css('opacity',100);
			$("#Sommaire"+index).removeClass();
			document.getElementById('Sommaire'+i).style.display = 'block';
			document.getElementById('Sommaire_on_'+i).style.display = 'inline';
			document.getElementById('Sommaire_off_'+i).style.display = 'none';
		} else {
			document.getElementById('Sommaire'+i).style.display = 'none';
			document.getElementById('Sommaire_on_'+i).style.display = 'none';
			document.getElementById('Sommaire_off_'+i).style.display = 'inline';
		}
	}
	loopSommaire = setTimeout('changeSommaire();',displayTimeS);
}

/*

displayTimeS = 4000;
transitionTimeS = 4000;

currentSommaire = 0;
loopSommaire = setTimeout('changeSommaire();',displayTimeS);

function changeSommaire() {
	currentSommaire++;
	if (currentSommaire>nbSommaire) currentSommaire = 1;
	selectSommaireIndex(currentSommaire,transitionTimeS);
}

function selectSommaireIndex(index,delay) {
	clearTimeout(loopSommaire);
	oldIndex = 0;
	for (i=1;i<=nbSommaire;i++)
		if (document.getElementById('Sommaire_on_'+i).style.display != 'none') oldIndex = i;
	fadeSommaire(index,oldIndex,delay);
}

function fadeSommaire(index,currentIndex,delay) {
	$("#Sommaire"+index).fadeTo(displayTimeS,0,continueSelectSommaireIndex(index));
}



function continueSelectSommaireIndex(index) {
	currentSommaire = index;
	for (i=1;i<=nbSommaire;i++) {
		if (i==index) {
			$("#Sommaire"+index).css('opacity',100);
			document.getElementById('Sommaire'+i).style.display = 'block';
			document.getElementById('Sommaire_on_'+i).style.display = 'inline';
			document.getElementById('Sommaire_off_'+i).style.display = 'none';
		} else {
			document.getElementById('Sommaire'+i).style.display = 'none';
			document.getElementById('Sommaire_on_'+i).style.display = 'none';
			document.getElementById('Sommaire_off_'+i).style.display = 'inline';
		}
	}
	loopSommaire = setTimeout('changeSommaire();',displayTimeS);
}





*/
