var g_selectedQuestion = 0;

function SelectQuestion(questionIndex)
{
	if (g_selectedQuestion)
		GetElement("title" + g_selectedQuestion).className = "";

	GetElement("title" + questionIndex).className = "selected";
	g_selectedQuestion = questionIndex;
}

function CheckForQuestionSelection()
{
	var pageUrl = location.href;
	var anchorBegin = pageUrl.indexOf("#");
	if (anchorBegin != -1)
	{
		var questionIndex = pageUrl.substr(anchorBegin + 1);
		SelectQuestion(questionIndex);
	}
}
$(document).ready(CheckForQuestionSelection);
