//$Id: global.js,v 1.3 2008/04/10 22:50:24 nick Exp $
// common functions


function showWindowShade(id, displayMode) // block or none
{
	el = getEl(id);

	if (!el || el.style.display == displayMode)
		return;
	
	if (displayMode == 'block')
	{
		var biggestHeight = document.body.scrollHeight;
		if (getWinHeight() > biggestHeight)
			biggestHeight = getWinHeight();

		el.style.width=document.body.scrollWidth+'px';
		el.style.height=biggestHeight+'px';
	}
	
	el.style.display = displayMode;
}

var gAlertDlgIsModal=0;
function showAlertDlg(html, modal)
{
	gAlertDlgIsModal=modal;
	getEl('alertDlgText').innerHTML=html;
	showWindowShade('messageShade','block');
	displayCenteredDiv('alertDialog');
	if (gAlertDlgIsModal)
		toggleDisplayOff('alertDlgClose');
	else
		toggleDisplayOn('alertDlgClose');
}
function hideAlertDlg(forceClose)
{
	if (gAlertDlgIsModal && !forceClose)
		return;
	showWindowShade('messageShade','none');
	toggleDisplayOff('alertDialog');
}