/**
 * fonctions pour ouvrir un popup
 */
var querywindow = '';
function open_window(url,x,y) {

    if (!querywindow.closed && querywindow.location) {
        querywindow.focus();
    } else {
    	
    	var l=(screen.width-x)/2;
    	var t=(screen.height-y)/2;    
    	
        querywindow=window.open(url, '','toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=auto,resizable=no,width='+x+',height='+y+',top='+t+',left='+l);
    }

    if (!querywindow.opener) {
        querywindow.opener = self;
    }

    if (window.focus) {
        querywindow.focus();
    }

 //   return false;
}


/** Affichage d'une popup qui se 
 * redimensionne à la taille de l'image
 * et qui se ferme au click
 */  
function afficheImageRedim(chemin,titre) {	
	var html = '<HTML><HEAD><TITLE>'+titre+'</TITLE></HEAD><BODY LEFTMARGIN=0 MARGINWIDTH=0 TOPMARGIN=0 MARGINHEIGHT=0>'+
			'<CENTER><IMG SRC="'+chemin+'" BORDER="0" alt="'+titre+'" name="imageGrande" '+
			' onclick="window.close();" onLoad="window.resizeTo(document.imageGrande.width+14,document.imageGrande.height+58);"/></CENTER></BODY></HTML>';
	popupImage = window.open('','_blank','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=1,width=50,height=50');
	popupImage.document.open();
	popupImage.document.write(html);
	popupImage.document.close();
}
