// V 2.3 | 09.12.2004
var xWin = null;

function xPopup(xPage,xWidth,xHeight,xWinName,xLeft,xTop,xFeatures){
	var xWinLeft;
	var xWinTop;
	(xLeft!=null)?xWinLeft=xLeft : xWinLeft=(screen.width-xWidth)/2;
	(xTop!=null)?xWinTop=xTop : xWinTop=(screen.height-xHeight)/2;
	xSettings='width='+xWidth+',height='+xHeight+',top='+xWinTop+',left='+xWinLeft+','+xFeatures+'';
	xWin=window.open(xPage,xWinName,xSettings);
	if(xWin!=null || xWin != undefined){
		xWin.xParent = self;
		if(parseInt(navigator.appVersion) >= 4){xWin.window.focus();}
	}
}

function xResizeWindow(xWidth,xHeight) { 
	   var NS = (navigator.appName=="Netscape")?true:false; 
       xCurrentWidth = (NS)?window.innerWidth:document.body.clientWidth; 
       xCurrentHeight = (NS)?window.innerHeight:document.body.clientHeight; 
       self.resizeBy(xWidth-xCurrentWidth, xHeight-xCurrentHeight); 
       self.focus(); 
     }; 

function xCenterWindow(xWidth,xHeight) { 
		
		xWinLeft=(screen.width-xWidth)/2;
		xWinTop=(screen.height-xHeight)/2;
		window.moveTo(xWinLeft,xWinTop);
     }; 
// note: 
//	Si 'xLeft' et 'xTop' ont une valeur de null, le popup est automatiquement centré dans le browser. 
// exemple de call:
// xPopup('xPage','320','200','xWinName',null,null,'scrollbars=no,toolbar=no,location=no,status=no,menubar=no,resizable=no,dependent=no');