/**
 * Utilities for standard window actions such as popping up a window.
 * 
 */
function WindowUtils() { // optionally pass a querystring to parse
	this.popup=popup;
}

/**
 * Opens a popup window
 */
function popup(url, w, h, name) {

	var width = 800;
	var height = 600;
	var screenw = screen.availWidth;
	var screenh = screen.availHeight;
	
	width = w;
	height = h;

	var leftPos = (screenw-width)/2, topPos = (screenh-height)/2;
	var params = "toolbar=1,location=0,directories=0,status=1,menubar=0,scrollbars=1,resizable=0,width=" + width + ",height=" + height + ",top=" + topPos + ",left=" + leftPos;
	newWindow=window.open(url,name, params);
	if (newWindow.opener == null) newWindow.opener = self;
	newWindow.focus();

	//return (newWindow);
}