// ======================= TABLE ROW ROLLOVER EFFECT =============================== */
/* FAQ() written by meg for edendesign.
	searches for div with classname "questionbox" and applies behaviour to first link 
	element within list item with classname "showanswer" or "hideanswer".
	link behaviour toggles "showanswer" and "hideanswer" of parent list item when clicked. 
*/

function FAQ() {
	this.faqArr = new Array;
	var startNode = document.getElementById("content");
	this.startDivs = startNode.getElementsByTagName("div");
	for (var t=0;t<this.startDivs.length;t++) {
		if (this.startDivs[t].className == "questionbox") {
			this.listItems = this.startDivs[t].getElementsByTagName("li");
			for (var f=0; f < this.listItems.length; f++ ) {
				if ((this.listItems[f].className == "showanswer") || (this.listItems[f].className == "hideanswer"))
				this.faqArr[this.faqArr.length] = new openCloser(this, this.listItems[f], this.listItems[f].getElementsByTagName("a")[0]);
			}
		}
	}
}
openCloser = function(faq, faqItem, question) {
	this.faq = faq;
	this.faqItem = faqItem;
	this.question = question;
	this.question.openCloser = this;
	this.question.onclick = function() {
		this.openCloser.toggle();
		//placeDezeDiv(); //added by bart so the "Deze Links" div repositions on menu expand/contract
		//closeMsgDiv(); // close msgDiv see default.js
		return false;
	}
}
openCloser.prototype.toggle = function() {
	if (this.faqItem.className != "hideanswer") {
		this.faqItem.className = "hideanswer";
	}
	else {
		this.faqItem.className = "showanswer";
		//measure this click as pageview in HBX
		var hbxpagename = this.question.getAttribute('href');
		if(hbxpagename != null)
		{
			var faqisat = hbxpagename.indexOf("/faq");
			if(faqisat != -1)
			{
				hbxpagename = hbxpagename.substring(faqisat);
				_hbPageView(hbxpagename, 'abFaqItem');
			}
		}
	}
}

// ======================= END TABLE ROW ROLLOVER EFFECT =============================== */




/* ============== ADD EVENT ========================== */
addEvent(window,'load',FAQ);
