function Left(str, n)
{
	if (n <= 0)     // Invalid bound, return blank string
		return "";
	else if (n > String(str).length)   // Invalid bound, return
		return str;                // entire string
	else // Valid bound, return appropriate substring
		return String(str).substring(0,n);
}



function viewAnswer(param)
{
	idPath = eval('document.all.'+param)
	
	if (idPath.style.display == 'block')
	{
	//closing so we don't want to open afterwards
	var closing = 1;
	}
	
//	Close all questions, before	opening the requested one
	for(i = 0; i < document.all.length; i++)
	{
		if (Left(document.all(i).id,6) == "answer")
		{
			if (document.all(i).style.display == 'block')
			{
				document.all(i).style.display = 'none'
			}
		}
	}

// open requested one
	if (closing != 1)
	{
		idPath.style.display = 'block'
	}
}
