document.getElementsByTagName("html")[0].className = 'JavascriptEnabled';

if (!document.onLoadFunctions) document.onLoadFunctions = new Array();
document.onLoadFunctions.push ( function () {

	function installNode (node) {
		if (!node.className) return;
		var root = node.parentNode;
		while (root && (root.className != 'tv3d' || root.nodeName.toLowerCase() != 'div')) { root = root.parentNode; };
		if (!root) return;
		if (!root.sectionComponents ) root.sectionComponents =new Object();
		if (!root.sectionActiveState) root.sectionActiveState=new Object();
		if (!root.Toggle) root.Toggle = function (sectionId) {
			var mode = this.sectionActiveState[sectionId]=!this.sectionActiveState[sectionId];
			for (i=0; this.sectionComponents[sectionId].length>i; i++)
				this.sectionComponents[sectionId][i].className = mode ? "selected" : "unselected";
		};
		var words = node.className.split (" ");
		var section = words[0];
		if (!root.sections) root.sections= new Array();
		if (!root.sectionComponents [section]) {
			root.sectionComponents [section]=new Array ();
			root.sectionActiveState[section]=false;
			if (words[2] != "fixed") root.sections.push(section);
		}
		if (words[1]=="selected") root.sectionActiveState[section]=true;
		root.sectionComponents[section].push (node);
		node.className = root.sectionActiveState[section] ? 'selected' : 'unselected';
		if (node.firstChild.nodeName=='BUTTON') {
			node.firstChild.href=null;
			node.firstChild.onclick=function (event) {
				root=this.root;
				if (!document.all && event.shiftKey) {
					var mode = root.sectionActiveState[this.section]=!root.sectionActiveState[this.section];
					for (var i=0; root.sectionComponents[this.section].length>i; i++) {
						root.sectionComponents[this.section][i].className=mode ? "selected" : "unselected";
					}
				} else {
					for (var i=0; root.sections.length>i; i++) {
						var section=root.sections[i];
						var mode = section==this.section;
						if (root.sectionActiveState[section]==mode) continue;
						root.sectionActiveState[section]=mode;
						for (var j=0; root.sectionComponents[section].length>j; j++) {
							root.sectionComponents[section][j].className=mode ? "selected" : "unselected";
						}
					}
				}
				return false;
			};
			node.firstChild.root=root;
			node.firstChild.section=section;
		}
	}

	var list = document.getElementsByTagName("tr");
	for (var i=0; i<list.length; i++) { installNode(list[i]); }
	list = document.getElementsByTagName("li");
	for (var i=0; i<list.length; i++) { installNode(list[i]); }
});
