function alertSize() {
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ){
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ){
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
}

function dimControls(dimControlId, timerVar)
{
	if (timerVar) clearTimeout(timerVar);
	
	var dimControl = document.getElementById(dimControlId);
	if (dimControl) setDisabled(dimControl, true);
	return;

	var dimDiv = document.getElementById('DimmedBackground');
	if (dimDiv){
		var myWidth = 0, myHeight = 0;
		if( typeof( window.innerWidth ) == 'number' ){
			//Non-IE
			myWidth = window.innerWidth;
			myHeight = window.innerHeight;
		} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
			//IE 6+ in 'standards compliant mode'
			myWidth = document.documentElement.clientWidth;
			myHeight = document.documentElement.clientHeight;
		} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ){
			//IE 4 compatible
			myWidth = document.body.clientWidth;
			myHeight = document.body.clientHeight;
		}

		var ctlLeft = ctl.offsetLeft + ctl.width / 2 - 20;
		var ctlTop = ctl.offsetTop + 40;

		dimDiv.style.left='0px';
		dimDiv.style.top='0px';
		dimDiv.style.width=myWidth + 'px';
		dimDiv.style.height=myWidth + 'px';
		dimDiv.style.display = 'block';
	}
}

function undimControls(dimControlId, timerVar)
{
	if (timerVar) clearTimeout(timerVar);

	var dimDiv = document.getElementById('DimmedBackground');
	if (dimDiv) dimDiv.style.display = 'none';

	var dimControl = document.getElementById(dimControlId);
	if (dimControl) setDisabled(dimControl, false);
}

function setDisabled(obj, flag)
{
	try {
		obj.disabled = flag;
	}
	catch(E){}
	if (obj.childNodes && obj.childNodes.length > 0)
	{
		for (var x = 0; x < obj.childNodes.length; x++)
			setDisabled(obj.childNodes[x], flag);
	}
}
