var screenwidth = screen.availWidth;
var screenheight = screen.availHeight;
var popupwin = null;
var winwidth = null;
var winheight = null;
function openwindow (url,winwidth,winheight,wintimeout) {
	if (wintimeout == "timeout") { setTimeout("closewindow()",4750); }
	popupwin = window.open(
		url,
		'Window',
		'dependent,' +
		'top=' + ((screenheight - winheight - 30) * .5) + ',' +
		'left=' + ((screenwidth - winwidth - 10) * .5) + ',' +
		'width=' + winwidth + ',' +
		'height=' + winheight
	);
}
function closewindow() { if (popupwin != null && popupwin.open) popupwin.close(); }
window.onfocus=closewindow;
