// JavaScript Document

//<!--
	var body_height = window.document.height;

	function galerie_popup(url, lstFicStr, max, num, target, srcJS)
	{
		// Transforme la liste des fichiers en tableau.
		tabFic = lstFicStr.replace('/\\\'/g', '\'').split('/');
		
		// Faire des tours quand on arrive aux bords
		if (num == 1) num = max -2;
		else if (num == parseInt(max, 10) -1) num = 2; 
		
		
		html = '<html>\n';
		html+= '	<head>\n';
		html+= '		<title></title>\n';
		html+= '		<script type="text/javascript" src="' + srcJS + '"></script>\n';
		html+= '	</head>\n';
		html+= '	<body marginwidth="0" marginheight="0" topmargin="0" leftmargin="0">\n';
		html+= '			<div style="height:100%;width:40%;position:absolute;cursor:pointer;background-image:url(space.gif);"';
		html+= '				onclick="galerie_popup(\'' + url + '\',\'' + lstFicStr + '\',\'' + max + '\',\'' + (parseInt(num, 10) - 1) + '\',\'_self\',\'' + srcJS + '\');">&nbsp;</div>\n';
		html+= '			<div style="right:0px;height:100%;width:40%;position:absolute;cursor:pointer;background-image:url(space.gif);"';
		html+= '				onclick="galerie_popup(\'' + url + '\',\'' + lstFicStr + '\',\'' + max + '\',\'' + (parseInt(num, 10) + 1) + '\',\'_self\',\'' + srcJS + '\');">&nbsp;</div>\n';
		html+= '			<img ';
		html+= '				name="image" ';
		html+= '				border="0" ';
		html+= '				src="' + url + '/' + tabFic[num] + '" ';
		html+= '				alt="" ';
		html+= '				onload="window.resizeTo(document.image.width+10,document.image.height+25);largeurecran=screen.width;hauteurecran=screen.height;posX=(largeurecran-document.image.width)/2;posY=(hauteurecran-document.image.height)/2;window.moveTo(posX,posY);" ';
		html+= '			/>\n';
		html+= '	</body>\n';
		html+= '</html>\n';
		
		popupImage = window.open('',target,'toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,width=1,height=1');
		popupImage.document.open();
		popupImage.document.write(html);
		popupImage.document.close();
	}
	
	
	function sur_fond(uri, titre)
	{
		body_height = window.document.height;
		
		var sur_fond	= document.getElementById("sur_fond");
		var div				=	document.getElementById("sur_fond_affichage");
		
		
		div.innerHTML = '<div class="gal_view_menu"><a href="javascript:cacher_sur_fond();">Fermer le popup</a></div>';
		div.innerHTML+= '<img src="' + uri + '" alt="Image introuvable" />';


		sur_fond.style.height	= window.document.body.scrollHeight + "px"; 
		sur_fond.style.visibility = 'visible';
	}
	
	function cacher_sur_fond()
	{
		var sur_fond	= document.getElementById("sur_fond");
		var div				=	document.getElementById("sur_fond_affichage");
		
		sur_fond.style.visibility = 'hidden';
		div.innerHTML = '';
	}
	
	function faire_suivre_sur_fond_affichage()
	{
		var div				=	document.getElementById("sur_fond_affichage");
		if (window.scrollY < body_height - div.clientHeight) div.style.top	= window.scrollY + "px";
//		alert (window.scrollY + "\n" + body_height + "\n" + div.clientHeight)
		
//		document.getElementById("sur_fond_affichage").innerHTML = window.pageYOffset + "px";
		
	}
	onscroll = faire_suivre_sur_fond_affichage;
	
	
	
	//-->
	