/** toggleDisplay - takes an HTML element and toggles the display between 'none' and 'block'
 *
 *	@param		elementID - the id of the element to be toggled
 *
 */
function toggleDisplay(elementID)
{
	divObject = document.getElementById(elementID);
	if(divObject.style.display != "none")
	{
		divObject.style.display = "none";
	}
	else
	{
		divObject.style.display = "block";
	}
	
}

/** whiteBlocks - will change the backgroundColor to white for all the items in the passed array which holds element id's
 *
 *	@param			blockArray - an array with element id's as its values
 *
 */
function whiteBlocks(blockArray)
{
	for(i = 0; i < blockArray.length; i++)
	{
		document.getElementById(blockArray[i]).style.backgroundColor = '#FFFFFF';
	}
}
function highlightBlock(blockID,focusID,blockArray)
{
	whiteBlocks(blockArray);
	document.getElementById(blockID).style.backgroundColor = '#E8E3D3';
	if(focusID != ""){document.getElementById(focusID).focus();}
}

function hideBlocks(blockArray)
{
	for(i = 0; i < blockArray.length; i++)
	{
		document.getElementById(blockArray[i]).style.display = 'none';
	}
}
function showBlock(blockID,blockArray)
{
	hideBlocks(blockArray);
	document.getElementById(blockID).style.display = 'block';
}

Array.prototype.contains = function(element)
{
	for(var h = 0; h < this.length; h++)
	{
		if(this[h] == element)
		{
			return true
		}
	}
	return false;
}