/*function popupResize(myimage,title) {
	html = '';
		
	popup=window.open('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
	//popup.document.open();
	popup.document.write(html);
	//popup.document.focus();
	//popup.document.close()
}*/

function popupCouverture(URL) {
  var features = "toolbar=no,location=no,directories=no,menuBar=no,scrollbars=no,resizable=no";
  window.open("popupcover.php?img="+URL,"couverture",features);
}

/* BACKUP */
/*function popupResize(myimage,title) {
	html = '<html><head><title>' + title + '</title></head>' +
	'<body style="margin:0px;">' +
	'<div align="center"><img src="' + myimage + '" border="0" name="image" onLoad="window.resizeTo(document.image.width+13,document.image.height+80)"><br>' +
	'<a href="javascript:window.close();"><span style="font-family:Arial, Helvetica, sans-serif; font-size:12px; color:#999; text-decoration:none;">Fermer</span></a>' +
	'</div></body></html>';
		
	popup=window.open('','image','toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0');
	popup.document.open();
	popup.document.write(html);
	popup.document.focus();
	popup.document.close()
}*/

function OuvrirFenetre(nom,largeur,hauteur,monmenubar,resizable,monscrollbars,monstatus,montoolbar) {
	
	//eval(defaults(arguments, '', 100, 100, 0, 0, 0, 0, 0));
	
	var texte = "width=" + largeur + ",height=" + hauteur + ",menubar=" + monmenubar + ",resizable=" + resizable + ",scrollbars=" + monscrollbars + ",status=" + monstatus + ",toolbar=" + montoolbar;
	var ecranL=screen.width;
	var ecranH=screen.height;
	var nom_fenetre = "fenetre_" + Math.floor(Math.random()*101);
	
	if(hauteur == 0) {
   		hauteur = (ecranH-80);
   		deplaceH = 0;
   	} else
   		deplaceH=((ecranH/2)-(hauteur/2));  

	if(largeur == 0)
   		largeur = (ecranL-80);

	var deplaceL=((ecranL/2)-(largeur/2));	
	childWin=window.open(nom, nom_fenetre, texte);

	if (childWin.opener == null) childWin.opener = self;

	//si contenu d'un autre domaine, bug sécurité IE!!
	
	
	
	if (/Firefox[\/\s](\d+\.\d+)/.test(navigator.userAgent) || nom.indexOf('http') == -1){
		childWin.moveTo(deplaceL, deplaceH);
	}
	
	childOpen = true;
	childWin.focus();
	return;
}
