var curDown = null;
function Toggle(d, expand) {
	if (arguments.length == 1) {
		expand = false;
	}
	
	// If something else is currently down, hide it
	if (curDown != null && curDown != d) {
		document.getElementById("div" + curDown).style.display = "none";
	}
	
	// Get the div and expand or hide it
	var div = document.getElementById("div" + d).style;
	if (div.display == "none" || expand) {
		div.display = "block";
		curDown = d;
	} else {
		div.display = "none";
		curDown = null;
	}
}

function ToggleAll(expand) {
	for (var i = 0; i < 7; ++i) {
		Toggle(i, expand);
	}
}
