// JavaScript Document

var FAQIntervals = new Array();

function goFAQ(aName)
{
	var divId = aName+'div';
	
	$("html").animate({scrollTop : $("#"+divId).offset().top-20}, 500, "swing", function(){
		goFAQHighlight(divId);
	});	
}

function goFAQHighlight(divId) {
	document.getElementById(divId).className = 'FAQDivFocussed';
	var FAQInterval = setInterval(function(){
		var target = $(":first-child", $("#"+divId));
		if(!target.data("highlight")) {
			target.css("textDecoration", "underline");
			target.data("highlight", true);
		}
		else {
			target.css("textDecoration", "none");
			target.data("highlight", false);
		}
	}, 500);
	
	setTimeout(function(){
		clearInterval(FAQInterval);
		$(":first-child", $("#"+divId)).css("textDecoration", "none");
		setTimeout(function() {
			document.getElementById(divId).className = "FAQDivDefault";
		}, 3000);
	}, 3000);
}
