function popup(nom_de_la_page, nom_interne_de_la_fenetre)
{
window.open (nom_de_la_page, nom_interne_de_la_fenetre, config='height=600, width=650, toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, directories=no, status=no')
}

function include(url) 
{ 
	if ( document.all ) 
	{ 
		var xml = new ActiveXObject("Microsoft.XMLHTTP"); 
		xml.Open( "GET", url, false ); 
		xml.Send() 
		document.writeln(xml.responseText); 
	} 
	else 
	{ 
		if ((location.host=='' && url.indexOf(location.protocol)==-1) || url.indexOf(location.host)==-1) 
		{ 
			netscape.security.PrivilegeManager.enablePrivilege("UniversalConnect"); 
		} 

		var dest = new java.net.URL(url); 
		var dis = new java.io.DataInputStream(dest.openStream()); 
		var res = ""; 
		while ((line = dis.readLine()) != null) 
		{ 
			res += line + java.lang.System.getProperty("line.separator"); 
		} 
		dis.close(); 
		document.writeln(res); 
		return res; 
	} 
} 

// ===========================================================
// script: Gerard Ferrandez - Ge-1-doot - October 2005
// http://www.dhteumeuleu.com
// ===========================================================
//
window.onerror = new Function("return true");
var obj = [];
var scr;
var spa;
var img;
var W;
var Wi;
var Hi;
var wi;
var hi;
var Sx;
var Sy;
var M;
var xm;
var ym;
var xb = 0;
var yb = 0;
var ob =  - 1;
var cl = false;

/* needed in standard mode */
px = function(x)
{
	return Math.round(x) + "px";
}

/* center image  - do not resize for perf. reason */
img_center = function(o)
{
	with(img[o])
	{
		style.left = px( - (width - Wi) / 2);
		style.top = px( - (height - Hi) / 2);
	}
}

//////////////////////////////////////////////////////////
var Nx = 3; //size grid x
var Ny = 3; //size grid y
var Tx = 3; // image width
var Ty = 3; // image height
var Mg = 40; // margin
var SP = 1; // speed
//////////////////////////////////////////////////////////

function Cobj(o, x, y)
{
	this.o = o;
	this.ix = Math.min(Nx - Tx, Math.max(0, Math.round(x - (Tx / 2))));
	this.iy = Math.min(Ny - Ty, Math.max(0, Math.round(y - (Ty / 2))));
	this.li = ((this.ix * M + this.ix * Sx) - (x * M + x * Sx)) / SP;
	this.ti = ((this.iy * M + this.iy * Sy) - (y * M + y * Sy)) / SP;
	this.l = 0;
	this.t = 0;
	this.w = 0;
	this.h = 0;
	this.s = 0;
	this.mv = false;
	this.spa = spa[o].style;
	this.img = img[o];
	this.txt = img[o].alt;
	img[o].alt = "";

	/* zooming loop */
	this.zoom = function()
	{
		with(this)
		{
			l += li * s;
			t += ti * s;
			w += wi * s;
			h += hi * s;
			if ((s > 0 && w < Wi) || (s < 0 && w > Sx))
			{
				/* force window.event */
				window.focus();
				/* loop */
				setTimeout("obj[" + o + "].zoom()", 16);
			}
			else
			{
				/* finished */
				mv = false;
				/* set final position */
				if (s > 0)
				{
					l = ix * M + ix * Sx;
					t = iy * M + iy * Sy;
					w = Wi;
					h = Hi;
				}
				else
				{
					l = x * M + x * Sx;
					t = y * M + y * Sy;
					w = Sx;
					h = Sy;
				}
			}
			/* html animation */
			with(spa)
			{
				left = px(l);
				top = px(t);
				width = px(w);
				height = px(h);
				zIndex = Math.round(w);
			}
		}
	}

	this.click = function()
	{
		with(this)
		{
			img_center(o);
			/* zooming logic */
			if ( ! mv || cl)
			{
				if (s > 0)
				{
					if (cl || Math.abs(xm - xb) > Sx * .4 || Math.abs(ym - yb) > Sy * .4)
					{
						s =  - 2;
						mv = true;
						zoom();
						cap.innerHTML = txt;
					}
				}
				else
				{
					if (cl || ob != o)
					{
						if (ob >= 0)
						{
							with(obj[ob])
							{
								s =  - 2;
								mv = true;
								zoom();
							}
						}
						ob = o;
						s = 1;
						xb = xm;
						yb = ym;
						mv = true;
						zoom();
						cap.innerHTML = txt;
					}
				}
			}
		}
	}

	/* hook up events */
	img[o].onmouseover = img[o].onmousemove = img[o].onmouseout = new Function("cl=false;obj[" + o + "].click()");
	img[o].onclick = new Function("cl=true;obj[" + o + "].click()");
	img[o].onload = new Function("img_center(" + o + ")");

	/* initial display */
	this.zoom();
}

/* mouse */
document.onmousemove = function(e)
{
	if ( ! e)
	{
		e = window.event;
	}
	xm = (e.x || e.clientX);
	ym = (e.y || e.clientY);
}

/* init */
function load()
{
	/* html elements */
	scr = document.getElementById("screen");
	spa = scr.getElementsByTagName("span");
	img = scr.getElementsByTagName("img");
	cap = document.getElementById("caption");

	/* mouseover border */
	document.getElementById("border").onmouseover = function()
	{
		cl = true;
		if(ob >= 0 && obj[ob].s > 0) obj[ob].click();
		ob = -1;
	}

	/* global variables */
	W = parseInt(scr.style.width);
	H = parseInt(scr.style.height);
	M = W / Mg;
	Sx = (W - (Nx - 1) * M) / Nx;
	Sy = (H - (Ny - 1) * M) / Ny;
	Wi = Tx * Sx + (Tx - 1) * M;
	Hi = Ty * Sy + (Ty - 1) * M;
	SP = M * Tx * SP;
	wi = (Wi - Sx) / SP;
	hi = (Hi - Sy) / SP;

	/* create objects */
	for (k = 0, i = 0; i < Nx; i ++)
	{
		for (j = 0; j < Ny; j ++)
		{
			obj[k] = new Cobj(k ++, i, j);
		}
	}
}




function displayPics()
{
	var photos = document.getElementById('galerie_mini') ;
	// On récupère l'élément ayant pour id galerie_mini
	var liens = photos.getElementsByTagName('a') ;
	// On récupère dans une variable tous les liens contenu dans galerie_mini
	var big_photo = document.getElementById('big_pict') ;
	// Ici c'est l'élément ayant pour id big_pict qui est récupéré, c'est notre photo en taille normale

	var titre_photo = document.getElementById('photo').getElementsByTagName('dt')[0] ;
	// Et enfin le titre de la photo de taille normale

	// Une boucle parcourant l'ensemble des liens contenu dans galerie_mini
	for (var i = 0 ; i < liens.length ; ++i) {
		// Au clique sur ces liens 
		liens[i].onclick = function() {
			big_photo.src = this.href; // On change l'attribut src de l'image en le remplaçant par la valeur du lien
			big_photo.alt = this.title; // On change son titre
			titre_photo.firstChild.nodeValue = this.title; // On change le texte de titre de la photo
			return false; // Et pour finir on inhibe l'action réelle du lien
		};
	}
}

function visibilite(thingId)
{
var targetElement;
targetElement = document.getElementById(thingId) ;
if (targetElement.style.display == "none")
{
targetElement.style.display = "" ;
} else {
targetElement.style.display = "none" ;
}
}