

function preload(fichier) 
	{
		tabimg=new load(fichier);
		setTimeout("Verifie()",200);
	}

function load() 
	{
		if (document.images) 
			{
				this.length=load.arguments.length;
				for (var i=0;i<this.length;i++) 
					{
				              this[i+1]=new Image();
				              this[i+1].src=load.arguments[i];
				         }
			}
	}
function Verifie() 
	{
		var ok=1;
		if (document.images) 
			{
				for (var i=0;i<tabimg.length;i++) 
					{
				     		if (!(tabimg[i+1].complete)) {ok=0}
					}
			}
		if (ok) {}
		else {setTimeout("Verifie()",200)}
	}

	
function chgImg(direction)
	{
		if (document.images)
			{
				ImgNum = ImgNum + direction;
				if (ImgNum > ImgLength)
					{ ImgNum = 0;}
				if (ImgNum < 0)
					{ ImgNum = ImgLength;}
				preload(NewImg[ImgNum]);

				applyeffect();
				document.slideshow.src = NewImg[ImgNum];
	   			playeffect();
			}
	}

function lecture() 
	{
		 if (lock == true)
			{// on est sur PAUSE et on passe en LECTURE
				lock = false;
				run = setInterval("chgImg(1)", delay);
	   		}
	}
function pause() 
	{
		 if (lock == false)
	   		{
	   			lock = true;
				window.clearInterval(run);
	   		}
	}
function applyeffect()
	{
		if (document.all && slideshow.filters)
			{
				//Math.floor(Math.random()*23)
				slideshow.filters.revealTrans.Transition=12
				slideshow.filters.revealTrans.stop()
				slideshow.filters.revealTrans.apply()
			}
	}

function playeffect()
	{
		if (document.all && slideshow.filters)
		slideshow.filters.revealTrans.play()
	}




