// JavaScript Document

var allPanels = new Array();
allPanels[0] = "health";
allPanels[1] = "life";
allPanels[2] = "guaranteed_issue";
allPanels[3] = "short_term";
allPanels[4] = "dental";
allPanels[5] = "critical_illness";
allPanels[6] = "contact";
allPanels[7] = "online_quote";

function panelOn(triggerName) {
    clearTimeout ( hideTimerId );
	for (i=0; i<=allPanels.length-1; i++) {
		if ( triggerName == allPanels[i] ) {
			var currentPanel = eval("document.getElementById('" + triggerName + "_panel')");
			currentPanel.style.display = "block";
			document.getElementById(allPanels[i]).style.backgroundPosition="bottom left";
		} else {
			panelName = eval("document.getElementById('" + allPanels[i] + "_panel')");
			panelName.style.display = "none";
			document.getElementById(allPanels[i]).style.backgroundPosition="top left";
		}
	}
}

var hideTimerId;

function allOff() {
    doTheThing = "turnThemAllOff()";
    hideTimerId = setTimeout ( doTheThing, 250 );
}

function turnThemAllOff() {
	for (i=0; i<=allPanels.length-1; i++) {
		panelName = eval("document.getElementById('" + allPanels[i] + "_panel')");
		panelName.style.display = "none";
		document.getElementById(allPanels[i]).style.backgroundPosition="0 left";
	}
}