
function diaporama(objId)
{
	displayImg(objId);
	
	
	
}


function displayImg(objId)
{	
	document.getElementById(objId).src = im[index].src;


	document.getElementById(objId).style.opacity = opacity;
	document.getElementById(objId).style.filter = "alpha(opacity="+(opacity*100)+")";
	

	index++;
	if(index>=im.length)
		index = 0;

	FonduPos(objId);

}


function FonduPos(objId)
{
	fonduPosTimer = setInterval('startFondu("'+objId+'")',10);
}


function startFondu(objId)
{
	opacity =opacity + 0.01;
	if(opacity>=1)
	{
		opacity = 1;

		document.getElementById(objId).style.opacity = opacity;
		document.getElementById(objId).style.filter = "alpha(opacity="+(opacity*100)+")";

		clearInterval(fonduPosTimer);
		
		displayTimer = setTimeout('FonduMin("'+objId+'")',2000);
	}
	document.getElementById(objId).style.opacity = opacity;
	document.getElementById(objId).style.filter = "alpha(opacity="+(opacity*100)+")";
	
	
}


function FonduMin(objId)
{
	fonduMinTimer = setInterval('endFondu("'+objId+'")',10);
}


function endFondu(objId)
{
	opacity =opacity - 0.01;
	if(opacity<=0)
	{
		opacity = 0;

		document.getElementById(objId).style.opacity = opacity;
		document.getElementById(objId).style.filter = "alpha(opacity="+(opacity*100)+")";

		clearInterval(fonduMinTimer);

		displayImg(objId);
	}
	document.getElementById(objId).style.opacity = opacity;
	document.getElementById(objId).style.filter = "alpha(opacity="+(opacity*100)+")";
	
}
