function showError(elementId, msgTxt, e)
{
	var xCoord = 0;
	var yCoord = 0;
	var oScreenWidth = 0;
	var oScreenHeight = 0;
	var myElement;
	if (document.layers)
	{
		// old Netscape versions
		myElement = document.elementId;
		if ((myElement == null) || (myElement == "undefined"))
			myElement = document.getElementById(elementId);
		oScreenWidth = window.innerWidth;
		oScreenHeight = window.innerHeight;
		xCoord = e.pageX + 15;
		yCoord = e.pageY
		if (xCoord + 200 + 5 > oScreenWidth)
			xCoord = xCoord - 25;
		if (yCoord + 120 + 15 > oScreenHeight)
			yCoord = yCoord - 15;
	}
	else
	{
		// IE and newer versions of Netscape
		myElement = document.getElementById(elementId);
		if (myElement != null && myElement != "undefined")
		{
			oScreenWidth = document.body.clientWidth;
			oScreenHeight = document.body.clientHeight;
			xCoord = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft + 15;
			yCoord = e.clientY + document.body.scrollTop + document.documentElement.scrollTop
			if (e.clientX + 200 + 5 > oScreenWidth)
				xCoord = xCoord - 25;
			if (e.clientY + 120 + 15 > oScreenHeight)
				yCoord = yCoord - 50;
		}
		else
			alert ("showError() Internal Error: element is undefined!");
	}
	if (xCoord != 0 && yCoord != 0 && myElement != null && myElement != "undefined")
	{
		//myElement.innerHTML = msgTxt;
		if (document.layers)
		{
			if (typeof myElement.style.top != 'number')
				eval("myElement.moveTo(xCoord, yCoord)");
			else
			{
				myElement.style.top = yCoord;
				myElement.style.left = xCoord;
			}
			if ((myElement.style.visibility == null) || (myElement.style.visibility == "undefined"))
				myElement.visibility = 'visible';
			else
				myElement.style.visibility = 'visible';
		}
		else
		{
			myElement.style.top = yCoord + "px";
			myElement.style.left = xCoord + "px";
			myElement.style.visibility = 'visible';
		}
	}
}

function hideError(elementId)
{
	if (document.layers)
	{
	// old Netscape versions
		var myElement = document.divWinMsg;
		if ((myElement == null) || (myElement == "undefined"))
			myElement = document.getElementById(elementId);
		if ((myElement.style.visibility == null) || (myElement.style.visibility == "undefined"))
			myElement.visibility = 'hidden';
		else
		// IE and newer versions of Netscape
			myElement.style.visibility = 'hidden';
	}
	else
		document.getElementById(elementId).style.visibility = 'hidden';
}


function tryModelessWindow (windowId, url, mWidth, mHeight){
	eval('var wHandle = window.open(url,"'+windowId+'","width='+mWidth+'px,height='+mHeight+'px,resizable=1,scrollbars=1")')
	wHandle.focus();
}
function tryModalWindow (windowId, url, mWidth, mHeight){
	eval('window.showModalDialog("'+url+'","'+windowId+'","dialogWidth:'+mWidth+'px;dialogHeight:'+mHeight+'px, status=no")')
}

function showErrorMesg(errorMesg){
	if (errorMesg.length > 0)
		alert("ERROR: " + errorMesg);
}