/* (c) 2009 Jean Luc BIELLMANN - EES - contact@adressesetservices.com */

var numpict = 0;
var smoothOpacity=1.;
var pictLoaded = new Array();
function smoothHide () {
	smoothOpacity-=0.02;
	$('diapo').style.opacity=smoothOpacity;
	if (smoothOpacity>0.)
		setTimeout(smoothHide,10);
	else {
		numpict = (++numpict)%(picts.length);
		var img = E('img',{src:picts[numpict]});
		$('diapo').src = pictLoaded[numpict].src;
		smoothShow();			
	}
}
function smoothShow () {
	smoothOpacity+=0.02;
	$('diapo').style.opacity=smoothOpacity;
	if (smoothOpacity<1.)
		setTimeout(smoothShow,10);
}
function smoothInit () {
	$A(picts).each(function (pict) {
		var img = E('img',{src:picts[numpict]});
		numpict = (++numpict)%(picts.length);
		pictLoaded.push(img);
	});		
	setInterval(smoothHide,5000);
}
