// javascript taken from live site so that faq's show correctly
function showFAQ(e) {
	obj = (!window.event) ? e.target:window.event.srcElement;
	while (obj && obj.className != "FAQ_largeItem" && obj.className != "FAQ_smallItem") {
		obj = obj.parentNode;
	}
	
	if (!obj) return;

	if (obj.className != "FAQ_largeItem") {
		if (document.getElementById("currentFAQ")) {
			document.getElementById("currentFAQ").className = "FAQ_smallItem";
			document.getElementById("currentFAQ").id = "";
		}
		obj.className = "FAQ_largeItem";
		obj.id = "currentFAQ"

		// hitbox
		doMetric(obj.childNodes[0].nodeValue);
	} else {
		obj.className = "FAQ_smallItem";
		obj.id = "";
	}
}

// hitbox custom metric 12
function doMetric(question) {
	if (question!=undefined) {
		var hb12 = question.replace(/\ /g, "+");
		hb12 = hb12.replace(/\?/g, "");
		hb12 = hbx.pn + '|' + hb12;
		_hbSet('cv.c12', hb12);
		_hbSend();
	}
}

function initFAQ() {
	myDivs = document.getElementsByTagName("div");
	for (x=0;x<myDivs.length;x++) {
		if (myDivs[x].className == "FAQ_smallItem") {
			if (document.addEventListener) {
				myDivs[x].addEventListener("click",showFAQ,false);
			} else {
				window.event.cancelBubble = true;
				myDivs[x].attachEvent("onclick",showFAQ);
			}
		}
	}
}

function addLoadEvent(func) {
	var oldonload = window.onload;
	if (typeof window.onload != 'function') {
		window.onload = func;
	} else {
		window.onload = function() {
			if (oldonload) {
				oldonload();
			}
			func();
		}
	}
}
addLoadEvent(initFAQ);
