/*
function Permut (link,titre,datatype) { 
	var big_photo = document.getElementById('big_pict') ;
	var titre_photo = document.getElementById('photo').getElementsByTagName('dt')[0] ;
//    if (document.images) { 
//        if (document.images[img].permloaded) { 
//            if (flag==1)  document.images[img].src = document.images[img].perm.src1
//            else { 
//            if (flag==2)  document.images[img].src = document.images[img].perm.src2
//            else { 
//            if (flag==3)  document.images[img].src = document.images[img].perm.src3
//            else { 
//            if (flag==4)  document.images[img].src = document.images[img].perm.src4
//            else document.images[img].src = document.images[img].perm.oldsrc   }  } }         
//                     
//        } 
//    } 
			big_photo.data = link; // On change l'attribut src de l'image en le remplaçant par la valeur du lien
						big_photo.src = link;
			big_photo.alt = titre; // On change son titre
						big_photo.type = datatype; // On change son titre
			titre_photo.firstChild.nodeValue = titre; // On change le texte de titre de la photo
} 
*/

function preloadPermut () { 
	var photos = document.getElementById('galerie_mini') ;
	// On récupère l'élément ayant pour id galerie_mini
	var liens = photos.getElementsByTagName('a') ;
	// On récupère dans une variable tous les liens contenu dans galerie_mini
	var big_photo = document.getElementById('big_pict') ;
	// Ici c'est l'élément ayant pour id big_pict qui est récupéré, c'est notre photo en taille normale
	var titre_photo = document.getElementById('photo').getElementsByTagName('dt')[0] ;
	// Et enfin le titre de la photo de taille normale
//    if (document.images) { 
//        img.onload = null; 
//        img.perm = new Image (); 
//        img.perm.oldsrc = img.src; 
//        img.perm.src1 = adresse1;
//        img.perm.src2 = adresse2;
//        img.perm.src3 = adresse3;
//        img.perm.src4 = adresse4;
//        img.permloaded = true; 
//        
//    } 

			big_photo.data = liens[0].href; // On change l'attribut src de l'image en le remplaçant par la valeur du lien
			big_photo.src = liens[0].href;
			big_photo.alt = liens[0].title; // On change son titre
			big_photo.datatype = liens[0].type;
			big_photo.height=liens[0].height;
			titre_photo.firstChild.nodeValue = liens[0].title; // On change le texte
	for (var i = 0 ; i < liens.length ; ++i) {
		// Au clique sur ces liens 
		liens[i].onclick = function() {
		big_photo.data=this.href;
				big_photo.src=this.href;
				big_photo.datatype=this.type;
				big_photo.width=this.height;
				titre_photo.firstChild.nodeValue = this.title; 
			return false; }
// 					liens[i].onmouseover = function() {
// 		big_photo.data=this.href;
// 				big_photo.src=this.href;
// 								big_photo.datatype=this.type;
// 				titre_photo.firstChild.nodeValue = this.title; 
// 		 }
	}
}
window.onload=preloadPermut;


