function setH2AsButton(){
  var headings = document.getElementById("faq").getElementsByTagName("h2");
  for(var i=0; i< headings.length; i++){
  	var answer = headings[i].nextSibling; while (answer.nodeType != 1){answer = answer.nextSibling;}; answer.style.display = "none"; // hide  all answers
	headings[i].onclick = function(){
	  var div = this.nextSibling; while (div.nodeType != 1){div = div.nextSibling;};  // Gets the next div tag and assign
	  this.className = (this.className == "active" || this.className == "activeHover")? "hover" : "activeHover";
	  div.style.display = (div.style.display == "none")? "block" : "none";
	}
	headings[i].onmouseover = function(){this.className = (this.className == "active" || this.className == "activeHover")? "activeHover" : "hover";}
	headings[i].onmouseout = function(){this.className = (this.className == "active" || this.className == "activeHover")? "active" : "";}
  }
  //Expansion Buttons
  var expandBtn = document.getElementById("faqExpand");
  var collapseBtn = document.getElementById("faqCollapse");
  expandBtn.onmouseover = function(){this.src = "images/faq-expandAll_hover.gif";};
  expandBtn.onmouseout = function(){this.src = "images/faq-expandAll.gif";};
  collapseBtn.onmouseover = function(){this.src = "images/faq-collapseAll_hover.gif";};
  collapseBtn.onmouseout = function(){this.src = "images/faq-collapseAll.gif";};
  collapseBtn.onclick = function(){
    var headings = document.getElementById("faq").getElementsByTagName("h2");
    for(var i=0; i< headings.length; i++){
	  var answer = headings[i].nextSibling; while (answer.nodeType != 1){answer = answer.nextSibling;};answer.style.display = "none";headings[i].className = "";
	}
  }
  expandBtn.onclick = function(){
    var headings = document.getElementById("faq").getElementsByTagName("h2");
    for(var i=0; i< headings.length; i++){
      var answer = headings[i].nextSibling; while (answer.nodeType != 1){answer = answer.nextSibling;}; answer.style.display = "block";headings[i].className = "active";
	}
  }
}
function addLoadEvent(func) {var oldonload = window.onload;if (typeof window.onload != 'function') {window.onload = func;} else {window.onload = function() {if (oldonload) {oldonload();}func();}}}
addLoadEvent(setH2AsButton);
