﻿var hTimeOut, nbDiv = 0, divAAfficher = 2, divAffiche = 1, bPause = !1, effetFondu = "vide", opaciteAfficher, opaciteMasquer, debutFondu = 100; function fondu(a) { 0 == nbDiv && !isNaN(a) && (nbDiv = a); opaciteMasquer = debutFondu; opaciteAfficher = 0; if (document.getElementById("img" + divAAfficher)) document.getElementById("img" + divAAfficher).style.zIndex = "1", document.getElementById("img" + divAAfficher).style.visibility = "visible", setOpacity("img" + divAAfficher, 0), "vide" == effetFondu && (effetFondu = window.setInterval("lancerFondu()", 10)) } function lancerFondu() { opaciteMasquer -= 5; opaciteAfficher += 5; 100 == opaciteAfficher ? (document.getElementById("img" + divAffiche).style.visibility = "hidden", document.getElementById("img" + divAffiche).style.zIndex = "1", setOpacity("img" + divAffiche, debutFondu), divAffiche = divAAfficher, divAAfficher += 1, divAAfficher > nbDiv && (divAAfficher = 1), window.clearInterval(effetFondu), effetFondu = "vide", bPause || (hTimeOut = setTimeout("fondu()", 5E3))) : (setOpacity("img" + divAffiche, opaciteMasquer), setOpacity("img" + divAAfficher, opaciteAfficher)) } function setOpacity(a, b) { if (document.getElementById(a)) { var c = document.getElementById(a).style; c.opacity = b / 100; c.MozOpacity = b / 100; c.KhtmlOpacity = b / 100; c.filter = "alpha(opacity=" + b + ")" } } function aller(a) { clearTimeout(hTimeOut); clearTimeout(effetFondu); effetFondu = "vide"; document.getElementById("img" + divAffiche).style.visibility = "hidden"; document.getElementById("img" + divAffiche).style.zIndex = "1"; setOpacity("img" + divAffiche, debutFondu); divAffiche = divAAfficher = a + 1; document.getElementById("img" + divAAfficher).style.visibility = "visible"; document.getElementById("img" + divAAfficher).style.zIndex = "1"; setOpacity("img" + divAAfficher, debutFondu) } function reprendre() { bPause = !1; divAffiche = divAAfficher; divAAfficher += 1; divAAfficher > nbDiv && (divAAfficher = 1); fondu() };
