function toggleNode(obj)
{
	var next = obj.parentNode.nextSibling;
	if (!next)
		return;
	if (next.childNodes.length>1)
		return;
	var oldstate = next.style.display;
	closeSiblings(obj);
	if (oldstate=='none')
		next.style.display='';
	else
		next.style.display='none'
}

function switchNode(obj, state)
{
	var next = obj.parentNode.nextSibling;
	if (!next)
		return;
	if (next.childNodes.length>1)
		return;
	if (state)
		next.style.display=''
	else
		next.style.display='none'
}
function closeSiblings(obj)
{
	var siblings = obj.parentNode.parentNode.childNodes;
	for (var i=0; i<siblings.length; i++)
		switchNode(siblings[i].childNodes[0], false);
}
