// Open a window at the center of the screen
function openCenteredWindow(url, name, width, height, extra) {
	var x=0, y = 0;
	if (screen) {
		x = Math.floor((screen.availWidth-width)/2);
		y = Math.floor((screen.availHeight-height)/2);
		//alert('x' + x + ' y ' +y);
	}

	if (typeof(extra) == 'undefined') {
		extra = 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0	';	
	}
	window.open(url, '', 'height='+height+',width='+width+',top='+y+',left='+x+', '+extra);
	
}

function open_window(page,w,h) {
		var ww = (screen.width-w)/2;
		window.open(page, "CtrlWindow", "top=200,left="+ww+",width="+w+",height="+h+",buttons=no,scrollbars=yes,location=no,menubar=no,resizable=yes,status=no,directories=no,toolbar=no");
}