// simulated popup functions


// myID
// myShowID - what button to display
// xPox, yPos - optional
// popupWidth, popupHeight - optional
// focusFieldId - optional: field in which to place focus
// hideElement - optional: element to hide
function PopUp(myId, xPos, yPos, popupWidth, popupHeight, focusFieldId, hideElement, showElement)
{
	obj = document.getElementById(myId);
	//obj_button = document.getElementById(myShowId);
	//obj_button.style.display = "block";
	with( obj.style )
	{
		display = "block";
		
		if (xPos != "" || yPos != "")
			position = "absolute";
		
		if (xPos)
		left = xPos + "px";
		
		if (yPos)
			top = yPos + "px";
		if (popupWidth)
		{
			width = popupWidth + "px";
		}
		if (popupHeight)
		{
			height = popupHeight + "px";
		}
	}
	if (focusFieldId)
	{
		document.getElementById(focusFieldId).focus();
	}
	if (hideElement)
	{
		hideObj = document.getElementById(hideElement);
		// alert('offsetTop=' + hideObj.offsetTop );
		with (hideObj.style)
		{
			display = "none";
		}
	}
	if (showElement)
	{
		showObj = document.getElementById(showElement);
		with (showObj.style)
		{
			display = "block";
		}
	}
}


function UnPop(myId, unhideElement, hideElement)
{
	document.getElementById(myId).style.display = "none";
	
	//document.getElementById(myHideId).style.display = "none";
	if (unhideElement)
	{
		unhideObj = document.getElementById(unhideElement);
		with (unhideObj.style)
		{
			display = "block";
		}
	}
	if (hideElement)
	{
		hideObj = document.getElementById(hideElement);
		with (hideObj.style)
		{
			display = "none";
		}
	}
}


function ClearPop(myId)
{
	document.getElementById(myId).value = '';
}


function Show(myId)
{
	obj = document.getElementById(myId);
	alert('top=' + obj.offsetTop + ' left=' + obj.offsetLeft);
	// alert('parent=' + myId.offsetParent.name);
}

function gotoLink(url)
{
	location.href = url;
}