/* redimensionne la page en plein Žcran */

function pleinEcran ()
{
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
}


/* fonctions du diaporama*/


// dŽfinition des variables standards

var timeDelay = 4000;

var stop=false;
var pause = null;

var path = "images\/diaporama\/";

/* ˆ dŽfinir dans la page du diaporama

var Pix = new Array
(
"cartel-general.jpg"
,"cartel-cicatricesscars.jpg"
);
var howMany = Pix.length;

var PicCurrentNum = 0;
var PicCurrent = new Image();
PicCurrent.src = path+Pix[PicCurrentNum];

*/

// les fonctions


function loadPause() {
pause = setTimeout('boucle()', timeDelay);
}

function startPix() {

PicCurrentNum++;
if (PicCurrentNum == howMany) {
PicCurrentNum = 0;
}
PicCurrent.src = path+Pix[PicCurrentNum];
document["ChangingPix"].src = PicCurrent.src;
isPixComplete();
}

function isPixComplete() {
if (PicCurrent.complete == true)
{
pause = setTimeout('boucle()', timeDelay);
}
else {
waitPix();
}
}

function waitPix() {
pause = setTimeout('isPixComplete()', 200);
}

function boucle() {
startPix();
}

// controlleur du diaporama

function togglestop() {
stop = !(stop);
if (!stop) {
startPix();
document["Controller"].src = "boutons/pause.gif";
} else {
document["Controller"].src = "boutons/play.gif";
clearTimeout(pause); 
}
}


/*
// les fonctions diaporama ˆ tempo alŽatoire


function loadPauseAlea() {
pause = setTimeout('boucleAlea()', timeDelay);
}

function startPixAlea() {

PicCurrentNum++;
if (PicCurrentNum == howMany) {
PicCurrentNum = 0;
}
PicCurrent.src = path+Pix[PicCurrentNum];
document["ChangingPix"].src = PicCurrent.src;

// Pour diaporama a tempo aleatoire

timeDelay = 1+Math.round(Math.random()*rangeDelay);
timeDelay *= 1000;

pause = setTimeout('boucleAlea()', timeDelay);
}

function boucleAlea() {
startPixAlea();
}

function togglestopAlea() {
stop = !(stop);
if (!stop) {
startPixAlea();
document["Controller"].src = "boutons/pause.gif";
} else {
document["Controller"].src = "boutons/play.gif";
clearTimeout(pause); 
}
}

*/


/* 
Ajouter dans le corps de la page quelque chose comme:

<img name="ChangingPix" src="images/diaporama/cartel-general.jpg"> 
<p><img name="Controller" height="20" width="20" src="boutons/pause.gif" border="0" onclick="togglestop()">
							
*/
							
