// JavaScript Document
function faq() {
	//find the faq list
	var faqs = document.getElementById("faqs");
	//Find the questions by IDent H3 tags
	var allQuestions = faqs.getElementsByTagName("h5");
	//loop thru all questions
	for (var i=0; i<allQuestions.length; i++){
		//hide the answer associated with each question
		allQuestions[i].parentNode.getElementsByTagName("div")[0].style.display = "none";
		//apply an onclick event to each question
		allQuestions[i].onclick = function() {
			//find the answer associated to question
			var answer = this.parentNode.getElementsByTagName("div")[0];
			//toggle the display of the answer on and off onclick
			if(answer.style.display == "none") {
			   answer.style.display = "block";
			}else{
			   answer.style.display = "none";
			}
		}
	}
}

function closefaq() {
		//find the faq list
	var faqs = document.getElementById("faqs");
	//Find the questions by IDent H3 tags
	var allQuestions = faqs.getElementsByTagName("h5");
	//loop thru all questions
	for (var i=0; i<allQuestions.length; i++){
		//hide the answer associated with each question
		allQuestions[i].parentNode.getElementsByTagName("div")[0].style.display = "none";
		//apply an onclick event to each question
	}
}

function openallfaq() {
		//find the faq list
	var faqs = document.getElementById("faqs");
	//Find the questions by IDent H3 tags
	var allQuestions = faqs.getElementsByTagName("h5");
	//loop thru all questions
	for (var i=0; i<allQuestions.length; i++){
		//hide the answer associated with each question
		allQuestions[i].parentNode.getElementsByTagName("div")[0].style.display = "block";
		//apply an onclick event to each question
	}
}