var divs = document.getElementsByTagName("DIV");
var quesCount = -1;
var answers = [];
var questions = [];
for(i=0;i<divs.length;i++) // Loop over ever div
{
	if(divs[i].className.match(/faq/)) // The div surrounds a whole question/answer
	{
		var divCh = divs[i].childNodes;
		for(j=0; j<divCh.length; j++)
		{
			if(divCh[j].nodeType == '1') // node is an element, not text
			{
				if(divCh[j].className.match(/question/)) // div is a question
				{
					quesCount++;
					var quesStr = "ques"+quesCount;
					questions[questions.length] = quesStr;
					answers[quesStr] = [];
					try
					{
						divCh[j].style.cursor = "pointer";
					}
					catch(e)
					{
						divCh[j].style.cursor = "hand";
					}
					divCh[j].id = quesStr;
					divCh[j].onclick = function()
					{
						for(k=0; k<questions.length; k++)
						{
							// This is the question the user clicked
							if(questions[k] == this.id)
							{
								for(m=0; m<answers[questions[k]].length; m++)
								{
									if(answers[questions[k]][m].style.display == "none")
									{
										// Show the answer if it was hidden
										answers[questions[k]][m].style.display = "block";
									}
									else
									{
										// Hide the answer if it was already shown
										answers[questions[k]][m].style.display = "none";
									}
								}
							}
							else
							{
								// Hide all the other answers
								for(m=0; m<answers[questions[k]].length; m++)
								{
									answers[questions[k]][m].style.display = "none";
								}
							}
						}
					}
				}
				else // element is part of the answer to this question
				{
					answers[quesStr][answers[quesStr].length] = divCh[j];
				}
			}
		}
	}
}
function showAll()
{
	for(i=0; i<questions.length; i++)
	{
		for(j=0; j<answers[questions[i]].length; j++)
		{
			answers[questions[i]][j].style.display = "block";
		}
	}
}
function hideAll()
{
	for(i=0; i<questions.length; i++)
	{
		for(j=0; j<answers[questions[i]].length; j++)
		{
			answers[questions[i]][j].style.display = "none";
		}
	}
}
hideAll();
document.getElementById("faqhelp").style.display = "block";
	