//Checks if menu is collapsed or expanded and then expands or collapses accordingly. 

function Toggle(which, under) {
var visible = document.getElementById (which).style.display != "none"
//This is the div that should be expanded or collapsed.
var obj = document.getElementById (which)
//This is the div that is clicked to change the plus/minus sign.
var sub1 = document.getElementById (under)

if(obj.style.display = "none") {
obj.style.display = "block"
sub1.innerText = "- "
}

if(visible) {
obj.style.display ="none"
sub1.innerText = "+ "
}
}

//Collapses the menu completely when called.
function close() {
divs = document.getElementsByTagName("div");
keys = document.getElementsByTagName("span");

for (i=0; i<divs.length; i++) 
divs[i].style.display="none";

for (i=0; i<keys.length; i++) 
keys[i].innerText ="+"
}