﻿
//check if JS is enabled and then hide answers and change icons to + signs
window.onload = initAll;
function initAll() {
	if (document.getElementById) {
		formatFAQ();
	}
	else {
		//do nothing
	}
}
function formatFAQ() {
	for (i = 0; i < document.getElementsByTagName('dt').length; i++) {
		document.getElementsByTagName('dt').item(i).className = 'hasJS';
	}
	for (i = 0; i < document.getElementsByTagName('dd').length; i++) {
		document.getElementsByTagName('dd').item(i).style.display = 'none';
	}
}
//toggles the visibility of the answers and toggles +/- icons
function toggleFAQ(my_id) {
	answer = (document.getElementById(my_id).style.display == 'none') ? 'block' : 'none';
	document.getElementById(my_id).style.display = answer;

	offImg = "url(/graphics/FAQ/icon_minus.gif)"
	onImg = "url(/graphics/FAQ/icon_plus.gif)"
	qicon = (document.getElementById("Q" + my_id).style.backgroundImage == offImg) ? onImg : offImg;
	document.getElementById("Q" + my_id).style.backgroundImage = qicon;
	return false;
}
