<!--

window.onload = function () 
{
	init();
}

function init () {
	if (document.getElementById) {
		var container = document.getElementById('container');   // our big table is all inside the 'container' div
		var all_divs  = container.getElementsByTagName('DIV'); //nodelist of all divs inside container
		window.all_signs = new Array();

		for (var i=0; i < all_divs.length; i++)
		{
			if (all_divs[i].className == "parent")				// we find the "parent" residues
			{
				var children_res = nextElem(all_divs[i]);
				var sign = all_divs[i].getElementsByTagName('IMG')[0];
				window.all_signs[all_signs.length] =sign;

				children_res.style.display = 'none';
				sign.onclick = function (children_res, sign) {		// and make "plus" signs clickable 
					return function () {
						children_res.style.display = children_res.style.display =='none' ? 'block' : 'none';
						//alert("signum src = "+sign.src);
						if (sign.className == "minus") {
							sign.src = 'plus.gif';
							sign.className="plus";
						}
						else if (sign.className == "plus") {
							sign.src = 'minus.gif';
							sign.className="minus";
						}

					}
				}(children_res, sign);
			}
		}
		document.getElementById('collapse').onclick = function () {
			for (var i=0; i< window.all_signs.length; i++)
			{
				if (window.all_signs[i].className == 'minus')	{
					window.all_signs[i].onclick();
				}
			}
		}
		document.getElementById('expand').onclick = function () {
			for (var i=0; i< window.all_signs.length; i++)
			{
				if (window.all_signs[i].className != 'minus')	{
					window.all_signs[i].onclick();
				}
			}
		}

	}
	else {
		return;
	}
}

function nextElem (node) {						// returns next element (i.e. HTML tag) sibling to node or undefined value if none found
	var nextnode = node.nextSibling;
	while (nextnode && (nextnode.nodeType != 1))
	{
		nextnode = nextnode.nextSibling;
	}
	return nextnode;
}


//-->