function displayError(message) {
	dimPage();
	showCentered("errorWindow");
	$("#errorMessage").html(message);
	$("#errorButton").focus();
}

function displayNotification(message) {
	dimPage();
	showCentered("notificationWindow");
	$("#notificationMessage").html(message);
	$("#notificationButton").focus();
}

function displayProgress(message) {
	dimPage();
	showCentered("progressWindow");
	$("#progressMessage").html(message);
	$("#progressButton").focus();
}

function displayLogin() {
	dimPage();
	showCentered("loginWindow");
}

function dimPage() {
	$("#dimArea")
		.show()
		.css({ 'width': "100%", 'height': Math.max($(document).height(), $(window).height()) + "px" })
	;
}

function showCentered(windowId) {
	var windowObj = $("#" + windowId);
	windowObj
		.show()
		.css({ 
			'top': $(window).scrollTop() + ($(window).height() - windowObj.height()) / 2 + "px",
			'left': $(window).scrollLeft() + ($(window).width() - windowObj.width()) / 2 + "px"
		})
	;
}

function releasePage(window) {
	$("#" + window).hide();
	$("#dimArea").hide();
}		


