// This routine stretches the size of the dimmer to the entire page.
// It's basically a workaround because there is no way to achieve this with just CSS. IE6 does not behave as expected.
// This assumes and requires that there is a div with an ID of "alertMsg"

function popDialog(name, state) {
	var dimmer = document.getElementById(name + "Msg");
	dimmer.style.width = Math.max(document.body.scrollWidth, winWidth())+"px";
	dimmer.style.height = Math.max(document.body.scrollHeight, winHeight())+"px";
	if(state) {
		dimmer.style.display = "block";
		document.getElementById(name + "Box").style.display = "block";
	} else {
		dimmer.style.display = "none";
		document.getElementById(name + "Box").style.display = "none";
	}
}

function winWidth() {
	if (document.documentElement && (document.documentElement.clientWidth > 0)) {
		return document.documentElement.clientWidth;
	} else if (window.innerWidth) {
		return window.innerWidth;
	} else {
		return document.body.clientWidth;
	}
}

function winHeight() {
	if (window.innerHeight) {
		return window.innerHeight;
	} else if (document.documentElement && (document.documentElement.clientHeight > 0)) {
		return document.documentElement.clientHeight;
	} else {
		return document.body.clientHeight;
	}
}
