var Delaientrephotos = 5;  //EN Secondes !
var compteur = Delaientrephotos;
var goOn = true;
var CombienPhotos = Pix.length;
var NumImgCour = 0;

function chgmtimg() {
	NumImgCour++;
	if (NumImgCour == CombienPhotos) {
		NumImgCour = 0;
	}
	// document.getElementById("diapo").src = Pix[NumImgCour];
	document.getElementById("diapoCell").style.backgroundImage = 'url(' + Pix[NumImgCour] + ')';
	document.getElementById("decompte").value = Delaientrephotos / 1000;
}

function decompte() {
	if (goOn) {
		compteur--;
		if (compteur == 0) {
			if (Delaientrephotos < 1) Delaientrephotos = 1;
			compteur = Delaientrephotos;
			chgmtimg();
		}
		document.getElementById("decompte").value = compteur;
	}
}

function startPix() {
	setInterval("decompte()", 1000);
	//setInterval("chgmtimg()", Delaientrephotos*1000);
}

function getTime() {
now = new Date();
y2k = new Date("Aug 23 2006 17:00:00");
days = (y2k - now) / 1000 / 60 / 60 / 24;
daysRound = Math.floor(days);
hours = (y2k - now) / 1000 / 60 / 60 - (24 * daysRound);
hoursRound = Math.floor(hours);
minutes = (y2k - now) / 1000 /60 - (24 * 60 * daysRound) - (60 * hoursRound);
minutesRound = Math.floor(minutes);
seconds = (y2k - now) / 1000 - (24 * 60 * 60 * daysRound) - (60 * 60 * hoursRound) - (60 * minutesRound);
secondsRound = Math.round(seconds);
daysRound = Math.floor(-1 * days);
hoursRound = Math.floor(24 - hours);
minutesRound = Math.floor(60 - minutes);
secondsRound = Math.round(60 - seconds);
sec = (secondsRound == 1) ? " seconde" : " secondes";
min = (minutesRound == 1) ? " minute, " : " minutes, ";
hr = (hoursRound == 1) ? " heure, " : " heures, ";
dy = (daysRound == 1)  ? " jour, " : " jours, "
document.timeForm.input1.value = "Revenu depuis deja " + daysRound  + dy + hoursRound + hr + minutesRound + min + secondsRound + sec + " !";
newtime = window.setTimeout("getTime();", 1000);
}

