var num = 0;
var num2 = 1;
var massimo = 214;
var incremento = -0.05 ;
var coeff = 1 ; //coefficiente di schiarimento

function ruotaFoto() {
  num = (num +1) % (massimo +1);
  document.getElementById('fotoCheCicla').src = num + "_l.jpg" ;
		attesa= window.setTimeout ("ruotaFoto()",5000);
}

function schiarisci() {
  coeff = coeff -0.05 ;
	if (coeff < 0.05) {
	  coeff = 1;
		attesa= window.setTimeout ("ruotaFoto()",250);
	} else {
	  document.getElementById('fotoCheCicla').style.opacity = coeff ;
		attesa= window.setTimeout ("schiarisci()",250);
	}
}


function avvia() {
//  num  = Math.round(massimo * Math.random())
	attesa= window.setTimeout ("ruotaFoto()",1);
}


