var timeoutID ;

function affiche(n_aff, n_tot) {
  
	window.clearTimeout(timeoutID);

	cache(n_tot);

	largeur_onglet=100;

	flargeur = document.body.clientWidth;
    

	if(n_aff<=(n_tot/2)) {
	poslayer = flargeur/2-((n_tot/2)-(n_aff-1))*largeur_onglet;
	}

	if(n_aff>(n_tot/2)) {
	poslayer = flargeur/2+((n_aff-1)-(n_tot/2))*largeur_onglet;
	}

	document.all["layer"+n_aff].style.left=poslayer;
	document.all["layer"+n_aff].style.visibility='visible';
 }



 function timer(n_tot) {


    timeoutID = window.setTimeout("window.cache("+n_tot+")",1000);

 }

 function stoptimer() {

	window.clearTimeout(timeoutID)

 }

 function cache(n_tot) {


m=1;

while(m<=n_tot) {
document.all["layer"+m].style.visibility='hidden';
m=m+1;
}

window.clearTimeout(timeoutID);
 }