function openWindow(url, name, w, h, x, y) {
	if(window.name == name) {
		if(url) window.location.href = url;
		return true;
	}
	screenw = screen.availWidth - 10;
	screenh = screen.availHeight - 36;
	if(w > screenw) w = screenw;
	if(h > screenh) h = screenh;
	if((x == null) || (y == null) || (x < 0) || (y < 0) || (x > screenw - w) || (y > screenh - h)) {
		x = (screenw - w) / 2;
		y = (screenh - h) / 2;
	}
	popupWin = window.open(url, name, 'width='+w+',height='+h+',left='+x+',top='+y+',titlebar=no,toolbars=no,location=no,menubar=no,status=no,statusbar=no,scrollbars=no,resizable=no');
	popupWin.focus();
}
