/**
 * This method opens a popup window with the given parameters. If popup blockers are on then
 * the window returned will be null.  If so, the error message is displayed.  If it is null,
 * a message is displayed telling the user to enable popups.
 */
function openPopup(target, title, features, errorMessage) {
	var newWindow = window.open(target, title, features);
	if (!newWindow) {
		if (errorMessage) {
			alert(errorMessage);
		}
		else {
			alert("You must have popups enabled in order to view this page.");
		}
	}
	else {
		newWindow.focus();
	}
	return newWindow;
}
