


//================================================================
var IE = typeof window.attachEvent != "undefined" ;
var FF = typeof window.addEventListener != "undefined" ;

if (FF) {
	window.addEventListener("load", init, false);
}
if (IE) {
	window.attachEvent("onload", init);
}

function init() {
	var photos=document.getElementsByTagName("img");
	for (i = 0 ; i < photos.length ; i++) {
		if (photos[i].className == "vignette") {
			photos[i].title = photos[i].alt ; 
			
			if(FF) {photos[i].addEventListener("click", changePhoto, false)};
			if(IE) {photos[i].attachEvent("onclick", changePhoto);};
			
		} ;
	}
}

function changePhoto(e) {
	if(!e){
		e = window.event;
	}
	var monElement = (e.target)? e.target:e.srcElement
	var alt = monElement.alt ;
	var p = alt.indexOf("_") ;
	var radical = alt.slice(0,p) ;	
	var url = "../photos/" + radical + "_500.jpg" ;	
	var cible = document.getElementById("grandePhoto") ;
	cible.src = url ;
}


