// JavaScript Document
function ShowPanel(target, show){
	if (target == null || target == "") return;
	var panel = document.getElementById(target);
	if (panel != null)
		panel.style.display = show ? "block" : "none";
}

hex=255; // Initial color value.
function FadeText(id){ 
	if(hex>0) { //If color is not black yet
		hex-=11; // increase color darkness
		document.getElementById(id).style.color="rgb("+hex+","+hex+","+hex+")";
		setTimeout("FadeText('"+id+"')",20); 
	}
	else
		hex=255; //reset hex value
}

function toggleAll()
{
	var sa = document.getElementById("chkViewAll");
	var ch = sa.checked;
	toggleQuestions(ch);
}

function toggleQuestions(checked)
{
	var secCount = 3;
	var faqEntryCount = 23;
	for(var j=1; j<=secCount; j++)
	{
		for (var i=1; i<=faqEntryCount; i++)
		{
			var title = document.getElementById("title" + j + i);
			if(checked == true)
				expandQuestion("title" + j + i, "question" + j +i, "answer" + j + i);
			else
				collapseQuestion("title" + j + i, "question" + j +i, "answer" + j + i);
		}
	}
	if(checked == false)
	{
	  var sa = document.getElementById("chkViewAll");
		sa.checked = false;
	}
}
function GO_Search()
{
    navigate('Search.aspx?search=' + document.getElementById("txtSearchField").value);
}