// changes the photo of the diaporama. nom_diapo is the "name" of the img receiving the photos
// set previous = true to go backwards in the mist of pics.
function previous_next_photo(path_photos, nom_diapo, nb_photos, language, previous) {
	tmp = eval("document." + nom_diapo);
	if((tmp.ind_this_photo==undefined) || (tmp.ind_this_photo==null)) {
		tmp.ind_this_photo = (previous==true ? nb_photos : 2);
	} else {
		tmp.ind_this_photo = (previous==true ? (tmp.ind_this_photo-1) : (tmp.ind_this_photo + 1));
	}
	if(tmp.ind_this_photo > nb_photos) {
		tmp.ind_this_photo = 1;
	}
	if(tmp.ind_this_photo <= 0) {
		tmp.ind_this_photo = nb_photos;
	}
	tmp.src = path_photos + nom_diapo + "_" + tmp.ind_this_photo + (language!="" ? ("_" + language) : "") + ".jpg";
}

function create_diapo(mytime,path_photos,nom_diapo,nb_photos,language, objImage) {
	strcmd = "previous_next_photo(\"" + path_photos + "\",\"" + nom_diapo + "\"," + nb_photos + ",\"" + language + "\",false)";
//	alert(strcmd);
	setInterval(strcmd,mytime);
}
