var imagenum = 1;		// Numéro de la première image à afficher
var imagemax = 10;		// Nombre d’images du fondu (important)
var imagepos = 0;		// in opacity %
var imagestep = 0.024;		// % d’opacité a ajouter à chaque séquence d’avancement
var imagespeed = 50;	// temps entre chaque séquence d’avancement
var imagesleep = 5000;	// temps de pause en millisecondes pour chaque image

var firstimage = 0;
var nextimage = 0;
var jumpto = 0; // Choisir l’image de départ
var randomimg = 1; // 1 = images au hasard, 0 = images à la suite

function stepforwardopc() {
	imagepos += imagestep;
	if (imagepos > 1) imagepos = 1;
	if (firstimage == 0) firstimage = document.getElementById("photo"+imagenum);
	if (nextimage == 0) {
		if (jumpto == 0) i = imagenum+1; else i = jumpto;
		if (i > imagemax) i = 1;
		nextimage = document.getElementById("photo"+i);
		nextimage.style.display = '';
	}
	imageposinverted = 1-imagepos
	if (firstimage.filters) firstimage.style.filter = 'alpha(opacity='+(imageposinverted*100)+')'; else firstimage.style.opacity = imageposinverted;
	if (nextimage.filters) nextimage.style.filter = 'alpha(opacity='+(imagepos*100)+')'; else nextimage.style.opacity = imagepos;
	if (imagepos == 1) {
		if (jumpto == 0) imagenum++; else imagenum = jumpto;
		if (randomimg) {
			do { jumpto = 1+Math.floor(Math.random()*imagemax); } while (jumpto == imagenum);
		} else jumpto = 0;
		if (imagenum > imagemax) imagenum = 1;
		firstimage = 0; nextimage = 0;
		imagepos = 0;
		window.setTimeout("stepforwardopc()",imagesleep);
	} else window.setTimeout("stepforwardopc()",imagespeed);
}

if (randomimg) jumpto = 2+Math.floor(Math.random()*(imagemax-1));
