// photo.js
function photoShow()
{
	// menu
	var photo_menu = document.getElementById('menu') ;
	
	// liste des liens a du menu
	var aliens = photo_menu.getElementsByTagName('a') ;
	
	// affichage photo
	var photo_display = document.getElementById('photo') ;
	
	// grande photo
	var photo_img = photo_display.getElementsByTagName('img')[0] ;
	
	// titre photo
	var titre_photo = photo_display.getElementsByTagName('p')[0];
	
	// lien photo
	var lien_photo = photo_display.getElementsByTagName('a')[0];
	
	// variable pour lien vers image grandeur nature
	var image_path;
	var str_array;
	
	// modifie le lien photo
	lien_photo.onclick = function()
	{
		window.open(this.href, 'Photo', 'toolbar=no, menubar=yes, location=no, resizable=yes, scrollbars=no, status=no'); 
		return false;
	}

			
	for(var i = 0 ; i < aliens.length ; i++)
	// pour tous les liens
	{
		aliens[i].onclick = function()
		// nouvelle action pour clic
		{
			str_array=this.href.split('/');
			image_path="./medium/"+str_array[str_array.length-1]
			//alert(image_path);
			lien_photo.href=image_path;
			photo_img.src = this.href ; // change l'image
			photo_img.alt = this.title ; // change le texte alternatif
			titre_photo.firstChild.nodeValue = this.title ; // change le texte du titre
			return false ; // annule l'action du href initial
		}
	}
	
	
}

// activation au chargement de la page
window.onload = photoShow ;
