function wopen(url, name, w, h)
{
// Fudge factors for window decoration space.
 // In my tests these work well on all platforms & browsers.
w += 32;
h += 96;
 var win = window.open(url,
  name,
  'width=' + w + ', height=' + h + ', ' +
  'location=no, menubar=no, ' +
  'status=no, toolbar=no, scrollbars=no, resizable=no');
 win.resizeTo(w, h);
 win.focus();
}


	
var putItThere = null;
var chasm = screen.availWidth;
var mount = screen.availHeight; //chasm and mount help calculate the center of the screen
	
function popupwindow (URL,popupWidth,popupHeight,name) 
{
			
if (popupWidth > chasm) {
popupWidth = chasm - 10;
}
if (popupHeight > mount) {
popupHeight = mount - 40;
}
			
putItThere = window.open(URL,name,"width=" + popupWidth + ",height=" + popupHeight + ",toolbar=$popwin_toolbar,directories=$popwin_directories,location=$popwin_location,status=$popwin_status,menubar=$popwin_menubar,resizable=$popwin_resizable,scrollbars=$popwin_scrollbars,left=" + ((chasm - popupWidth - 10) * .5) + ",top=" + ((mount - popupHeight - 30) * .5) + ",screenX=" + ((chasm - popupWidth - 10) * .5) + ",screenY=" + ((mount - popupHeight - 30) * .5));
}