// Functions to open and close Marketing Opportunities

function openOffer(theOffer) {
	if(document.getElementById(theOffer).style.display == 'block') {
		document.getElementById(theOffer).style.display = 'none'; 
	}else{
		document.getElementById(theOffer).style.display = 'block';
	}
}
	
function closeOffer(theOffer) {
	document.getElementById(theOffer).style.display = 'none'; 
}

//Create an array
var allPageTags = new Array();

function openAllOffers(theClass) {
//Populate the array with all the page tags
var allPageTags=document.getElementsByTagName("*");
//Cycle through the tags using a for loop
for (i=0; i<allPageTags.length; i++) {
//Pick out the tags with our class name
if (allPageTags[i].className=='offerContainer') {
//Manipulate this in whatever way you want
allPageTags[i].style.display='block';
}
}
document.getElementById('closeAll').style.display = 'block'; 
document.getElementById('expandAll').style.display = 'none'; 
} 

function closeAllOffers(theClass) {
//Populate the array with all the page tags
var allPageTags=document.getElementsByTagName("*");
//Cycle through the tags using a for loop
for (i=0; i<allPageTags.length; i++) {
//Pick out the tags with our class name
if (allPageTags[i].className=='offerContainer') {
//Manipulate this in whatever way you want
allPageTags[i].style.display='none';
}
}
document.getElementById('closeAll').style.display = 'none'; 
document.getElementById('expandAll').style.display = 'block'; 
} 

// Functions to open and close FAQ questions

function openFAQ(divid){
    if(document.getElementById(divid).style.display == 'block'){
      document.getElementById(divid).style.display = 'none';
    }else{
      document.getElementById(divid).style.display = 'block';
    }
  }
  
function openAllFAQ() {
	n = 22; // number of hidden layers
	for(i=1;i<=n;i++){
	document.getElementById('question'+i).style.display = 'block';
	}
	document.getElementById('closeAll').style.display = 'block'; 
	document.getElementById('expandAll').style.display = 'none'; 
}

function closeAllFAQ() {
	n = 22; // number of hidden layers
	for(i=1;i<=n;i++){
	document.getElementById('question'+i).style.display = 'none';
	}
	document.getElementById('closeAll').style.display = 'none'; 
	document.getElementById('expandAll').style.display = 'block'; 
}