﻿function displayToggle(){
     // calls the toggle all off function 
     // to turn all the answers off when the page is loaded     
     toggleAllOff(); 
}

function toggleAnswer(obj) {
	var next = obj.nextSibling;
	// if it gets to a non-element node, go to the next 
	while(next.nodeType != 1) next=next.nextSibling; 
	next.className=((next.className=="faqhide") ? "faqshow" : "faqhide");
}

// function for the link that turns them all off
function toggleAllOff(){
     for (var i = 0; i < answers.length; i++) {
        answers[i].className = 'faqhide';
     }
     return false;
}
        
// function for the link that turns them all on
function toggleAllOn(){
     for (var i = 0; i < answers.length; i++) {
        answers[i].className = 'faqshow';
     }
     return false;
}

var questions = document.getElementsByTagName('dt');
var answers = document.getElementsByTagName('dd');
