// JavaScript Document for Mt. Washington Benefits page
var x;

var popup = new Array();
popup[0] = 'box0';
popup[1] = 'box1';
popup[2] = 'box2';
popup[3] = 'box3';
popup[4] = 'box4';
popup[5] = 'box5';
popup[6] = 'box6';
popup[7] = 'box7';
popup[8] = 'box8';
popup[9] = 'box9';
popup[10] = 'box10';
popup[11] = 'box11';
popup[12] = 'box12';
popup[13] = 'box13';
popup[14] = 'box14';
popup[15] = 'box15';
popup[16] = 'box16';
popup[17] = 'box17';
popup[18] = 'box18';
popup[19] = 'box19';
popup[20] = 'box20';
popup[21] = 'box21';
popup[22] = 'box22';
popup[23] = 'box23';
popup[24] = 'box24';
popup[25] = 'box25';
popup[26] = 'box26';
popup[27] = 'box27';
popup[28] = 'box28';

//adds CSS stylesheet that hides the elements. Gets rid of flicker before page loads!
(function () {
	var head = document.getElementsByTagName("head")[0];
	if (head) {
		var scriptStyles = document.createElement("link");
		scriptStyles.rel = "stylesheet";
		scriptStyles.type = "text/css";
		scriptStyles.href = "../styles/flicker.css";
		head.appendChild(scriptStyles);
	}
}());

//hides boxes on load
function hideBoxes(){
	for (x in popup){
		document.getElementById(popup[x]).style.display = 'none';
	}
}

// switches the boxes
function showBox(i){
	for (x in popup){
		document.getElementById(popup[x]).style.display = 'none';
	}		
	document.getElementById(popup[i]).style.display = 'block';	
	
}

function closeBox(i){
	document.getElementById(popup[i]).style.display = 'none';	
}


//Learn How box
function hideLearnbox(){
	document.getElementById('learnhow-box').style.display = 'none';
}

function showLearnbox(){
	document.getElementById('learnhow-box').style.display = 'block';
}

function closeLearnbox(){
	document.getElementById('learnhow-box').style.display = 'none';	
}
	
	
