usedarray = new Array();
// Array size
function getarraysize(thearray)
{
	for (i = 0; i < thearray.length; i++)
	{
		if ((thearray[i] == "undefined") || (thearray[i] == "") || (thearray[i] == null))
		{
			return i;
		}
	}
	
	return thearray.length;
}        
// Array push
function arraypush(thearray, value)
{
	thearray[getarraysize(thearray)] = value;
}
// Array pop
function arraypop(thearray)
{
	thearraysize = getarraysize(thearray);
	retval = thearray[thearraysize - 1];
	delete thearray[thearraysize - 1];
	return retval;
}
function showHide(entryID, htmlObj, linkType)
{
	extTextDivID = ('extText' + (entryID));
	extLinkDivID = ('extLink' + (entryID));
	
	if (linkType == 'close')
	{
				
			document.getElementById(extTextDivID).style.display = "none";
			document.getElementById(extLinkDivID).style.display = "block";	
				arraypush(usedarray, entryID);			
	}
	else
	{
		document.getElementById(extTextDivID).style.display = "block";
		document.getElementById(extLinkDivID).style.display = "none";
			arraypush(usedarray, entryID);
	
	}
}
// Clear state
function clear_state()
{
	if (usedarray[0])
	{
		while (usedarray[0])
		{
			eID = arraypop(usedarray);
						
			extTextDivID = ('extText' + (eID));
			extLinkDivID = ('extLink' + (eID));
			
			document.getElementById(extTextDivID).style.display = "none";
			document.getElementById(extLinkDivID).style.display = "block";			
		}
	}	
}