
function showPhoto(Obj,categorie,intitule) {
	
	var Url = Obj.src;
	var recherche = Url.lastIndexOf("/");
 	var nomImg = Url.substring(eval(recherche+1),Url.length);
	var nomImgSsExt = nomImg.substring(0,eval(nomImg.length-4));
	
	var encart = window.parent.window.document.getElementById('references');
	encart.style.backgroundImage='url(../references/'+categorie+'/grand_format/'+nomImgSsExt+'.jpg)';	
	
	window.parent.window.document.getElementById('intitule').firstChild.deleteData(0,99999);
	var divIntitule = window.parent.window.document.getElementById('intitule').firstChild.insertData(0,intitule);
	
}


// Ouverture de PopUp pour les images très grand formats
function PopUpImg(Obj) {
	
	// Récupération de la <div>
	var DivIntitule = document.getElementById('intitule');	
	var Intitule = DivIntitule.firstChild.data;
	
	var Args  = 'width=600,';
		Args += 'height=400,';
		Args += 'dependent=yes,';
		Args += 'location=no,';
		Args += 'menubar=no,';
		Args += 'resizable=no,';
		Args += 'scrollbars=no,'; 	
		Args += 'status=no,'; 	
		Args += 'toolbar=no';	
	
	window.open('popupimg.php?nom='+Intitule, 'PopUp', Args);//
}

// Insertion de l'image dans la popup
function GetImg() {
		
	// Récupération de la <div>
	var DivImg = opener.document.getElementById('references');
	var ImgGdFormatCSS = DivImg.style.backgroundImage;
	
	// Création de l'url de l'image de popup
	var ImgName = (ImgGdFormatCSS.substring(4,eval(ImgGdFormatCSS.length-1))).replace(/grand_format/,"popup");
	var ImgNew = new Image();
		ImgNew.src = ImgName;
	
	var ImgPlace = document.getElementsByTagName("body")[0].appendChild(ImgNew);
	
}


// Redimensionnement de la PopUp suivant la taille de l'image
function resizePopUp() {
	var Obj = document.getElementsByTagName('img')[0]; 
	if(Obj.complete == false)
		{void(0);}
	else
		{
		WindowWidth = Obj.width;
		WindowHeight = Obj.height;
		window.resizeTo(eval(WindowWidth+9),eval(WindowHeight+28));
		window.moveTo(eval(eval(screen.width/2)-eval(WindowWidth/2)), eval(eval(screen.height/2)-eval(WindowHeight/2)));
		window.clearInterval(boucle);
		}
}


// Script de défilement des vignettes
function defiler(sens) {
	if (pos==1 && sens==-1) {
		window.archi.scrollTo((eval(nb*larg)*2),0);
		pos=nb+1;
	} else {
		if (pos==nb+1 && sens==1) {
			window.archi.scrollTo(0,0);
			pos=1;
		}
	}
	direction = eval(sens);
	x=0;
	
	if(NavName.substring(0,3) == "Mic")
		{
		for (i=0; i<larg ; i++)
			{window.archi.scrollBy(direction,0);}
		}
	else
		{
		while(x != larg)
			{
			actif = setTimeout("window.archi.scrollBy("+direction+",0)",10);
			x++;
			}
		}
	
	pos+=sens;	
}

function defilermulti(sens,nombre) {
	for (j=0; j<nombre; j++) {
		defiler(sens);
	}
}


