function openWindow(url, name, width, height, left, top, popUnder, scrollBars, resizable, menuBar, status, toolBar, location, directories) {
	if (name == null) name = 'OpenWindow';
	if (width == null) width = 600;
	if (height == null) height = 400;
	if (left == null) left = -1;
	if (top == null) top = -1;
	if (popUnder == null) popUnder = false;
	if (scrollBars == null) scrollBars = true;
	if (resizable == null) resizable = true;
	if (menuBar == null) menuBar = false;
	if (status == null) status = false;
	if (toolBar == null) toolBar = false;
	if (location == null) location = false;
	if (directories == null) directories = false;
	
	var xpos = (left >= 0) ? left : ((screen.width - width) / 2);
	var ypos = (top >= 0) ? top : ((screen.height - height) / 2);
	
	var newWindow = window.open(url,name,'menubar=' + yesNo(menuBar) + ',status=' + yesNo(status) + ',scrollbars=' + yesNo(scrollBars) 
		+ ',resizable=' + yesNo(resizable) + ',height=' + height + ',width=' + width + ',left=' + xpos + ',top=' + ypos + ',screenX=' + xpos + ',screenY=' + ypos 
		+ ',toolbar=' + yesNo(toolBar) + ',location=' + yesNo(location) + ',directories=' + yesNo(directories) + '');
	
	if (popUnder) newWindow.blur();
}

function yesNo(value) {
	return value ? 'yes' : 'no';
}

function openHelpWindow(url) {
	openWindow(url, 'Help', 600, 400, -1, -1, false, true, false);
}

function openPrintWindow(url) {
	openWindow(url, 'Print', 600, 500, -1, -1, false, true, false);
}
