/*
	Amicale Des Diagonalistes
	Fichiers des focntions JavaScript
	JPB 10/04/2005

	References		Fonction
	ouvre_popup()		Ouvre une popup en fonction de la taille de l'ecran
*/

function ouvre_popup(page,arg,lx,ly) 
	{
	var AutoClose = false;
	var x=(screen.availWidth-lx)/2;
	var y=(screen.availHeight-ly)/2;
	var opt = arg + ",top=" + y + ",left=" + x ;
	window.open(page,'',opt);
	}



//tempsFermeture = 10;
// Fermer le PopUp après 10 de secondes?
// Mettre 0 pour ne pas fermer le PopUp
// Voir la difference entre screen.availWidth et screen.width sur : http://fr.selfhtml.org/javascript/objets/screen.htm
// ou sur http://aliasdmc.free.fr/coursjavas/cours_javascript86.html , la difference etant au niveau des barres de taches

function DisplayImage(url, width , height) 	
	{
	// var top = (screen.height - height) / 2;
	var top = ( screen.availHeight - height) / 2;
	// var left = (screen.width - width) / 2;
	var left = ( screen.availWidth - width) / 2;
	pFenetre = "resizable=0, scrollbars=0, left=" + left + ",top=" + top + ",width=" + width + ",height=" + height;
	//toolbar=0, location=0, directories=0, status=0, scrollbars=0, resizable=0, copyhistory=0, menuBar=0, width=600, height=600, left=10, top=20
	preview = window.open( url , '', pFenetre);
	// setTimeout('top.close();', 10);
	//if (tempsFermeture) setTimeout("pub.close();", tempsFermeture*1000);
	}

function PopUp( pagename , x , y ) 
	{
	url = "affiche_popup.php?name=" + pagename + "&coordx=" + x + "&coordy=" + y ;
	width = x + 20 ; // largeur du PopUp en pixels
	height = y + 30 ; // hauteur du PopUp en pixels
	delay = 0; // temps en seconde avant l'ouverture du PopUp
	DisplayImage(url, width, height);
	// timer = setTimeout("Debute(url, width, height)", delay*1000);
	}
