// JavaScript Document

var n = 0;
var ImgDiapo = new Array();

// 1 / 24	
// images/diapo/photo1.jpg
for (i=0;i<=23;i++) {	// 23 egal nombre d'image - une
	if(i==0){	// if parce que la premiere image ne porte pas le numero 0
		ImgDiapo[i] = "photo1.jpg";
	}else {
		var u=i+1;
		ImgDiapo[i] = "photo"+u+".jpg";	
	}
}
var NbrImg = (ImgDiapo.length - 1);

function diaporama(d) {
	var imgNumero = document.getElementById('photo').src;

	n = n + d;
	if (n < 0) {
		n = NbrImg;
	}
	if (n > NbrImg) {
		n = 0;
	} 
	document.getElementById('photo').src = "images/diapo/"+ImgDiapo[n];
	if(n==0) {
		affichagep("legende1");
	} else {
		var nleg=n+1;
		affichagep("legende"+nleg);
	}

}

/*
<img src="imgage1.jpg" name="Myimg" id="Myimg">

<a href="javascript:Diapo(-1)">Precedente</a>  <a href="javascript:Diapo(+1)">Suivante</a>	
*/


function diapo_txt(nom){
window.document.getElementById('photo').src="images/diapo/"+nom+".jpg";
}


function affichagep(divtexte){
   
    var nb=25; // nombres d'éléments
    var nom="legende"; //nom générique des éléments Eafficher
    var tableau = new Array();
	var compteur;
   
    for(i=0;i<nb;i++)
    {
        tableau[i]=nom+i;
       dv =document.getElementById(tableau[i]);
        if(dv!=null) dv.style.display='none';
    }
		
    document.getElementById(divtexte).style.display='block';
}
/*
// lecture en avant
	if (direction=="avant") {
		if (total>=compteur) total=0;
		alert(total);
		document.getElementById(id).src=chemin+nom[total++];
	}

// lecture en arriere
	if (direction=="arriere") {
		if (total<=-1 || total>compteur) total=nom.length-1;
		alert(total);
//		alert(nom.length);
		document.getElementById(id).src=chemin+nom[total--];
	}


*/

	function pop(lienimg){

	var settitle;
	var setimg;

	settitle = "<html><head><title>Azoline</title></head>";
	setimg = "<img src='" + lienimg + "' />";

fenetre = window.open("","Azoline","toolbar=0,menubar=0,location=0,scrollbars=0,width=541,height=371");
fenetre.document.open();
fenetre.document.write(settitle);
fenetre.document.write('<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">');
fenetre.document.write("<html><body><head><style>*{margin:0px;}</style></head></body></html>");
fenetre.document.write(setimg);
fenetre.document.write('</body></html>');
fenetre.document.close();
}