/*
This will go through every div on the page, but you can narrow it down to a parent by changing the line
[ tmp = document.getElementsByTagName('div'); ] to
[ tmp = document.getElementById('parentelementid').getElementsByTagName('div'); ]
*/
function toggleAll(itemname,state){
	tmp = document.getElementsByTagName('div');
	for (i=0;i<tmp.length;i++){
		if (tmp[i].className == itemname) tmp[i].style.display = state;
	}
}

function toggle(idname){
	document.getElementById(idname).style.display = (document.getElementById(idname).style.display == 'none') ? 'block' : 'none';
}

function closeAllToggle(idname){
	origStatus = (document.getElementById(idname).style.display == 'block') ? 'block' : 'none';
	toggleAll('toggle','none');
	if (origStatus=='none') toggle(idname);
}