function popupWindow(path, windowWidth, windowHeight)
{
	if (!window.open || !path) return true;

	//adjust width to fit available screen real-estate
	if (screen.availWidth && screen.availHeight)
	{
		windowWidth = Math.min(screen.availWidth - 40, windowWidth);
		windowHeight = Math.min(screen.availHeight - 40, windowHeight);
	}

	popupWin = window.open(path, "", "scrollbars=yes,resizable=yes,status=yes,menubar=yes,width=" + windowWidth + ",height=" + windowHeight);
	if (!popupWin) return true;

	if (popupWin.focus) popupWin.focus();
	return false;
}
