<!--//
function initLienImg() { 
db=!Doc_Popup_Img.documentElement.clientWidth?Doc_Popup_Img.body:Doc_Popup_Img.documentElement		// correction IE6 
My_Img=Doc_Popup_Img.getElementById('popup_img_box'); lx=Doc_Popup_Img.getElementById('popup_header_title') 

addEvent(lx,"mousedown",	function()	{dx=px-My_Img.offsetLeft;dy=py-My_Img.offsetTop;drag=1;}) 
addEvent(lx,"mouseup",	function()	{drag=0}) 
addEvent(Doc_Popup_Img,"mousemove",	controle_position) 
  
// Création de l'image 
im1=Doc_Popup_Img.createElement("img");My_Img.appendChild(im1); 
	if (gk) im1.style.marginBottom=-4+"px";		// correction Gecko 

// Ecriture des évènements 
l=Doc_Popup_Img.getElementsByTagName('a'); 
	for (var i=0;i<l.length;++i) { 
	
	// Ajoute onclick=My_Img_Big dans les liens image 
	result=l[i].href.search(/.jpg$|.jpeg$|.png$|.gif$/i); 
		if (result!=-1) { l[i].onclick=My_Img_Big; } 
	} 
} 
 
 
function controle_position(e) { 
sx=gk?pageXOffset:db.scrollLeft;	 	//scroll h 
sy=gk?pageYOffset:db.scrollTop;			//scroll v 
px=gk?e.pageX:event.clientX+sx;		//curseur x 
py=gk?e.pageY:event.clientY+sy; 		//curseur y 
	if (drag) { with(My_Img.style) {left=px-dx+"px";top=py-dy+"px"};return false } 
} 
 
 
// Pour IE, cache les <select> 
function voirSelect(v) { 
elem=document.getElementsByTagName('select');
	if (!gk) { for(i=0;i<elem.length;i++)elem[i].style.visibility=v; } 
} 


// Renvoi image et title dans le calque. 
function My_Img_Big() { 
fx=gk?innerWidth-20:db.clientWidth	//l fenêtre 
fy=gk?innerHeight:db.clientHeight  		//h fenêtre 
// Charge l'image dans le cache du navigateur. 
im=new Image();im.src=this.href; 
this.style.color=Doc_Popup_Img.vlinkColor;txt=this.title;
voirSelect('hidden');
// Montre la fausse fenêtre avec image vide. 
with (im1) { src=null;width=height=0 }
with (My_Img.style) { display="block";top=sy+2+'px' }; 
lx.firstChild.data="Loading";
actif=setTimeout('controleChargement()',300) 
// Désactive l'action normale du lien HTML 
;return false 
} 


// Controle du chargement de l'image 
function controleChargement() { 
clearTimeout(actif);lx.firstChild.data+="."; 
	if (im.complete) { // image complètement chargée
	lx.firstChild.data=txt;
  		with (im1) { src=im.src;width=im.width;height=im.height;
  		// L'image ne dépasse pas la fenêtre: 
  			if (im.width>=fx) { im.height*=(fx-20)/im.width;im.width=fx-20; } 
  			if (im.height>=fy) { im.width*=(fy-30)/im.height;im.height=fy-30; } 
  		}; 
	}
	else actif=setTimeout('controleChargement()',1000) 
} 

    
function addEvent (obj,evType,fn,capt) { 	// Ajoute un événement sans écraser l'éxistant. 
	if (obj.addEventListener) { obj.addEventListener(evType,fn,capt);return true; } 	// NS6+ 
	else if (obj.attachEvent) obj.attachEvent("on"+evType,fn) 	// IE 5+ 
	else { return false; } 
}

  
// Initialisation 
Doc_Popup_Img=document;gk=window.Event?1:0 	/*Gecko*/; 
dx=dy=e=drag=cr=0 


// Création de la pseudo popup : 
Doc_Popup_Img.write('<div id="popup_img_box"><div id="popup_header"><p id="popup_header_title" style="text-align: right;">titre <a title="" onclick="voirSelect(\'visible\');My_Img.style.display=\'none\'" style="cursor: pointer; margin-left: 10px; ">X</a></p></div></div>'); 
initLienImg()
//--> 