function chooseIndArea(theLink)
{
	theLink = (theLink) ? theLink : this;
	theLink.findPos = findPos;
	theLink.findPos();
	indDiv = document.getElementById("indAreas");
	indDiv.style.display = 'block';
	indDiv.style.top = theLink.posTop + 25 + "px";
	indDiv.style.left = theLink.posLeft + "px";
	// Below: we don't use "addEvent". Otherwise the event will be added everytime we click on the link!
	theLink.onblur=hideIndArea;
}

function hideIndArea()
{
	// Set a little delay to prevent the div to be hidden before the browser fires the link!
	setTimeout("indDiv.style.display='none';",200);
}

function showHideDet(mySpan)
{
	myDiv = mySpan.parentNode;
	myTable = myDiv.getElementsByTagName("table")[0];
	if (myTable.style.display=='block') {myTable.style.display='none'; myDiv.style.background='none'; mySpan.style.backgroundImage='url("../images/ico_ar_rx.gif")';}
	else {myTable.style.display='block'; myDiv.style.background='#e0e0e0'; mySpan.style.backgroundImage='url("../images/ico_ar_dn.gif")';}
}

function showHideLoading(what2do)
{
	/* THIS is the current Window object, or the Opener Window object, when this function is called from a popup */
	myIframe = this.document.getElementById("loadingIframe");
	myDiv = this.document.getElementById("loadingDiv");
	mySpan = this.document.getElementById("loadingSpan");

	currTop = (this.innerHeight) ? this.pageYOffset : ( (document.documentElement && document.documentElement.scrollTop) ? this.document.documentElement.scrollTop : ((document.body) ? this.document.body.scrollTop : "") );

	/*** Height of the current window's inner area: IE=document.documentElement.clientHeight, Moz=document.body.clientHeight; ***/
	/*** Height of the whole page content: IE=document.body.scrollHeight, Moz=document.documentElement.scrollHeight; ***/
	myWinHeight = (document.all) ? this.document.body.scrollHeight : this.document.documentElement.scrollHeight;
	myWinWidth = (document.all) ? this.document.body.scrollWidth : this.document.documentElement.scrollWidth-16;
	
	if (what2do == 2) { myIframe.style.display="none"; myDiv.style.display="none"; mySpan.style.display="none"; }
	else
	{
		// First of all, let's prepare the loadingIframe (to for select-one fields and other Iframes to stay on the background)
		myIframe.style.filter = "alpha(opacity=0)";
		myIframe.style.MozOpacity = 0;
		myIframe.style.opacity = 0;
		myIframe.style.height = myWinHeight + "px";
		myIframe.style.width = myWinWidth + "px";

		// Then, prepare loadingDiv and loadingSpan
		myDiv.style.filter = "alpha(opacity=60)";
		myDiv.style.MozOpacity = 0.6;
		myDiv.style.opacity = 0.6;
		myDiv.style.height = myIframe.style.height;

		mySpan.style.left = (myWinWidth/2 - 80) + "px";
		mySpan.style.top = (currTop+200) + "px";

		myIframe.style.display="block";
		myDiv.style.display="block";
		mySpan.style.display="block";
	}
}
document.write('<iframe id="loadingIframe"></iframe> <div id="loadingDiv"></div> <span id="loadingSpan"><img src="/images/ico_load.gif"/> Loading...</span>');

function showBalance()
{
	myBal=document.getElementById("balance");
	myBal.style.display = (myBal.style.display=='block') ? "none" : "block";
}

