var getById = (typeof document.getElementById != "undefined");

function ToggleAnswer(iTick, iAnswer)
{
	if (!getById) return;

	var oAnswer = getRef(iAnswer);
	var oTick	= getRef(iTick);

	if (oAnswer.style.display == "block") // Answer is open
	{
		// Close the answer and right-twist the tick
		oAnswer.style.display = "none";
		oTick.src = "images/tick_right.gif";
	}
	else	// Answer is closed
	{
		// Open the answer and down-twist the tick
		oAnswer.style.display = "block";
		oTick.src = "images/tick_down.gif";
	}
}

function getRef(obj)
{
	if (getById)
		return (typeof obj == "string") ? document.getElementById( obj ) : obj;
}