var ul = document.getElementById("whoShouldParticipate").getElementsByTagName("ul")[0];
var linkCollection = ul.getElementsByTagName("a");

var liZindex = 99;
var activedivZindex = 200;
var activeliZindex = 199;

for (i=0; i < linkCollection.length; i++) {
	var link = linkCollection[i];
	link.onclick = function() {
		showBox(this);
		return false;
	}
}

var h4Collection = ul.getElementsByTagName("h4");
for (i=0; i < h4Collection.length; i++) {
	var link = h4Collection[i];
	link.onclick = function() {
		closeBox(this);
		return false;
	}
}

function showBox(linkNode) {
	closeAllBoxes(linkNode);
	var div = linkNode.parentNode.getElementsByTagName("div")[0];
	div.style.zIndex = activeliZindex;
	div.parentNode.style.zIndex = activedivZindex;
	div.style.display = "block";
}

function closeBox(linkNode) {
	var div = linkNode.parentNode;
	div.style.display = "none";
}

function closeAllBoxes(linkNode) {
	var divs = linkNode.parentNode.parentNode.getElementsByTagName("div");
	for (i=0; i < divs.length; i++ ) {
		divs[i].style.display = "none";
		divs[i].parentNode.style.zIndex = liZindex;
	}
}

