
	var width;
	var height;
	
	// this is needed to dynamically detect the browser type
	ns4 = document.layers;
    ie = document.all;
    moz = document.getElementById && !document.all;
	
	// return a pointer to the object
	function getRef(id){
	 	if (ns4) {
           alert ("Sorry, but NS4 does not support the functionality of this site");
           return false;
        }
        else if (ie) {
           obj = document.all[id];
        }
        else if (moz) {
           obj = document.getElementById(id);
        }		
		
        if (!obj) {
           alert("unrecognized ID");
           return false;
        }		
		return obj;	 
	 }
	 

	 function changeImageSize(obj, clientWidth, clientHeight){
	 
	 //you need to write your own algorithm to calculate the height to be assigned
	 
	 	// get a pointer to the image
	 	var image = getRef(obj);
		
		// change the width (1 éléments en largeur)
		// limite l'effet à une largeur de 100
		if (parseInt(clientHeight) - 250 > 294) {
	   image.height = parseInt(clientHeight) - 250;		}		else {
   	   image.height = 295		}
		
		// change the height (proportionnelle 4/3)
	 	// OLD VERSION image.height = parseInt(clientHeight)-200;
		image.width = image.height*4/3;
	 }
	 

	// show the size //////////////////////////////////////////////////////
	function showSize(){
	
		// le code de la gallerie //////////////////////////////////////////////////////
		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
	
		for(var i = 0 ; i < liens.length ; i++)
		// Une boucle parcourant l'ensemble des liens contenu dans galerie_mini
		{
			liens[i].onclick = function()
			// Au clique sur ces liens
			{
				big_photo.src = this.href ; // On change l'attribut src de l'image en le remplaçant par la valeur du lien
				big_photo.alt = this.title ; // On change son titre
				titre_photo.firstChild.nodeValue = this.title ; // On change le texte de titre de la photo
				return false ; // Et pour finir on inhibe l'action réelle du lien
			}
		}
		
		// appliquer la nouvelle taille ////////////////////////////////////////////////////// 
		// switch DOM depending on client browser
		if(moz){		
			// concatenate the text in the reference of text body passed
			// you can access window width with this.innerWidth
			height = this.innerHeight;
			width = this.innerWidth;
				
		}else if(ie){
			// concatenate the text in the reference of text body passed
			// you can access window width with document.body.clientWidth
			height = document.body.clientHeight;
			width = document.body.clientWidth;
		}
		
		// call the function to change image size, pass img object id, browser width and height
		changeImageSize("big_pict", width, height);
	}


// Il ne reste plus qu'à appeler notre fonction au chargement de la page