var subWindow;
var iW;
var iH;
//gets top and left positions based on user's resolution so hint window is centered.
iW = (window.screen.width/2) - (250 + 10); //half the screen width minus half the new window width (plus 5 pixel borders).
iH = (window.screen.height/2) - (275 + 50); //half the screen height minus half the new window height (plus title and status bars).
function openWindow(url) {
	if (!subWindow || subWindow.closed) {
	subWindow = 
	window.open(url,"uploadstats","status=no,toolbar=no,resizable=yes,height=115,width=335,left=" + iW + ",top=" + iH + ",screenX=" + iW + ",screenY=" + iH + ",scrollbars=yes");
	} else {
	subWindow.close();
	subWindow = 
	window.open(url,"uploadstats","status=no,toolbar=no,resizable=yes,height=115,width=335,left=" + iW + ",top=" + iH + ",screenX=" + iW + ",screenY=" + iH + ",scrollbars=yes");
	}
	return true;
}
function closeWindow() {
	if (!subWindow || subWindow.closed) {
	} else {
	subWindow.close();
	}
}



var secondWindow;
var iWidth;
var iHeight;
iWidth = (window.screen.width/2) - (325 + 10);
iHeight = (window.screen.height/2) - (250 + 50);

function newWin(url) {
	if (!secondWindow || secondWindow.closed) {
	secondWindow = 
	window.open("global/format.htm?x=t"+url,"_blank","status=yes,toolbar=no,resizable=yes,height=500,width=650,left=" + iWidth + ",top=" + iHeight + ",screenX=" + iWidth + ",screenY=" + iHeight + ",scrollbars=yes");
	} else {
	secondWindow.close();
	secondWindow = 
	window.open("global/format.htm?x=t"+url,"_blank","status=yes,toolbar=no,resizable=yes,height=500,width=650,left=" + iWidth + ",top=" + iHeight + ",screenX=" + iWidth + ",screenY=" + iHeight + ",scrollbars=yes");
	}
	return false;
}