<!--
// JavaScript Document
var x = 0, y = 0; // default values
var winPopped = false;

function getResized(target){
	if(target== null){
		target = this;
	}else{
		target = eval('parent.'+target);
	}
	if (document.all) {
		x = target.screenLeft;
		y = target.screenTop;
	} else if (document.layers) {
		x = target.screenX;
		y = target.screenY;
	}
}
//getResized();
function getCentered(w,h){
	// get the width of the display
	screen_width=window.screen.width 
	screen_height=window.screen.height 

	// determine the requested placement
	x = Math.round((screen_width-w)/2) 
	y = Math.round((screen_height-h)/2)
}
var remoteWindow;
function popWin(theURL,winName,w,h,features,posTarget) {
		if(remoteWindow){
			remoteWindow.close();
		}
		//getResized(posTarget);
		getCentered(w,h);
	
 		remoteWindow = window.open(theURL,winName,'width='+w+',height='+h+','+ features +',top='+y+',screenY='+y+',left='+x+',screenX='+x);
		if (remoteWindow.opener == null) remoteWindow.opener = self;
		remoteWindow.focus();
}

function popWinCentered(theURL,winName,w,h,features) {
		// get the width of the display
		var screen_width=window.screen.width 
		var screen_height=window.screen.height 

		// determine the requested placement
		var x = Math.round((screen_width-w)/2) 
		var y = Math.round((screen_height-h)/2) 

		if(remoteWindows[winName]){
			remoteWindows[winName].close();
		}
 		remoteWindows[winName] = window.open(theURL,winName,features + ",width="+w+",height="+h+',top='+y+',screenY='+y+',left='+x+',screenX='+x);
		if (remoteWindows[winName].opener == null) remoteWindows[winName].opener = self;
		remoteWindows[winName].focus();
}
//-->