
function GalerieINO(sElementID, sClasseActive) {
	this.eGalerie;
	
	if ( this.eGalerie = document.getElementById(sElementID) ) {
		this.appliquerFonctions = GalerieINO_appliquerFonctions;
		this.afficherPhoto      = GalerieINO_afficherPhoto;
		
		this.ePhoto       = this.eGalerie.getElementsByTagName("img")[0];
		this.eThumbnails  = this.eGalerie.getElementsByTagName("div")[0];
		this.classeActive = sClasseActive;
		this.thumbActif;
		
		this.appliquerFonctions();
	}
}


function GalerieINO_appliquerFonctions() {
	var aThumbs = this.eThumbnails.getElementsByTagName("a");
	for ( var cThumbs = 0; cThumbs < aThumbs.length; cThumbs++ ) {
		var thumb = aThumbs[cThumbs].parentNode;
		thumb.refObject = this;
		thumb.onclick = function () { this.refObject.afficherPhoto(this); return false; };
	}
	aThumbs[0].parentNode.onclick();
}


function GalerieINO_afficherPhoto(eElement) {
	if ( this.thumbActif && this.thumbactif != eElement )
			this.thumbActif.className = "";
	
	this.thumbActif = eElement;
	this.thumbActif.className = this.classeActive;
	this.ePhoto.src = this.thumbActif.getElementsByTagName("img")[0].src;
}