/**
* alert message stuff
*/
function showAlertMessage(alertText)
{
	var newText = '';
	while (newText != alertText) {
		newText = alertText;
		alertText = alertText.replace("\r\n", "<br />");
		alertText = alertText.replace("\n", "<br />");
		alertText = alertText.replace("\r", "<br />");
	}
	document.getElementById('alertText').innerHTML = alertText;	
	document.getElementById('alertBoxLayer').style.display='block';
	document.getElementById('alertButton').style.display='block';
	var h = document.getElementById('alertText').clientHeight;
	if (h != 0) {
		document.getElementById('alertBox').style.height = (h+48)+"px";
		var h1 = document.getElementById('alertBox').clientHeight;
	}
	if (window.reDisplaySelectboxes)
	{
		reDisplaySelectboxes();
	}
}
function hideAlertMessage()
{
	document.getElementById('alertBoxLayer').style.display='none';
	document.getElementById('alertButton').style.display='none';
	document.getElementById('confirmButton').style.display='none';
	if (window.reDisplaySelectboxes)
	{
		reDisplaySelectboxes();
	}
}
function conflictWithAlertLayer(left, width, top, height)
{
	var layerLeft = document.getElementById('alertBox').offsetLeft;
	var layerTop = document.getElementById('alertBox').offsetTop + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
	var layerWidth = document.getElementById('alertBox').offsetWidth;
	var layerHeight = document.getElementById('alertBox').offsetHeight;
	//window.status = ((layerLeft < left && layerTop < top && layerLeft + layerWidth > left && layerTop + layerHeight > top) 				 + " " + 				(layerLeft < left + width && layerTop < top && layerLeft + layerWidth > left + width && layerTop + layerHeight > top) 				 + " " + 				(layerLeft < left + width && layerTop < top + height && layerLeft + layerWidth > left + width && layerTop + layerHeight > top + height) 				 + " " +  (layerLeft < left && layerTop < top + height && layerLeft + layerWidth > left && layerTop + layerHeight > top + height) + " " + layerTop+ " " + top + " "  + height);

	return (layerLeft < left && layerTop < top && layerLeft + layerWidth > left && layerTop + layerHeight > top
			||
			layerLeft < left + width && layerTop < top && layerLeft + layerWidth > left + width && layerTop + layerHeight > top
			||
			layerLeft < left + width && layerTop - 18 < top + height && layerLeft + layerWidth > left + width && layerTop + layerHeight > top + height
			||
			layerLeft < left && layerTop - 18 < top + height && layerLeft + layerWidth > left && layerTop + layerHeight > top + height
			);
	//return document.getElementById('alertBoxLayer').style.display == 'block';
}