i = 1;

function diaporama(NombreDePhotos) {
   j = NombreDePhotos;
   photoname = photo.src.substring(0, photo.src.indexOf(i+".jpg", 0)) + (i%j+1) + ".jpg";
   photo.src = photoname;
   if (i==j){
       i=1;
   } else {
       i++;
   }
   setTimeout("diaporama(j);", 2000);
}

function agrandissement() {
   photoname = photo.src.substring(0, photo.src.indexOf(".jpg", 0)) + "-gd.jpg";
   document.open(photoname,"_blank","");
}
