
var openedWindows = new Array();

function openWindow(name, url, width, height, scrolls) {
	var w = width ? width : 400;
	var h = height ? height : 250;
	var x = (screen.width - w) / 2;
	var y = (screen.height - h) / 2;
	openedWindows[name] = window.open(url, name, "width=" + w + ", height=" + h + ", top=" + y + ", left=" + x + ", directories=no, resizable=no, menubar=no, status=no, titlebar=no, toolbar=no" + (scrolls ? ", scrollbars=" + scrolls : ""));
	openedWindows[name].focus();
}

function showPopup(url, x, y, width, height, features) {
	width = width && width != null ? width : 400;
	height = height && height != null ? height : 400;
	x = x && x != null ? x : (screen.availWidth - width) / 2;
	y = y && y != null ? y : (screen.availHeight - height) / 2;
	features = features && features != null ? features : "scrollbar=yes,resizable=no,menubar=no";
	var wnd = window.open(url, "_blank", "width="+width+",height="+height+",x="+x+",y="+y+","+features);
	wnd.focus();
}
