function highlight(elem){
	tbl = elem;
	while(tbl.nodeName != "TABLE") tbl = tbl.parentNode;
	tbl.border='1';
	//tbl.style.border = "solid green 3px";
	//tbl.style.border = "solid green 1px";
	//tbl.style.borderStyle = "dotted";
	//tbl.style.borderWidth = "3";
}
function unhighlight(elem){
	tbl = elem;
	while(tbl.nodeName != "TABLE") tbl = tbl.parentNode;
	tbl.border='0';
	//tbl.style.border = "dotted red 1px";
	//tbl.style.borderWidth = "1";
	//tbl.style.borderStyle = "solid";
}
function toggleView(elem){
	tbl = elem;
	col = "#ffffe8";
	while(tbl.nodeName != "TABLE") tbl = tbl.parentNode;
	if(tbl.bgColor == col){
		tbl.bgColor = "#FFFFFF";
		tbl.rows[1].style.visibility = "visible";
	} else {
		tbl.rows[1].style.visibility = "hidden";
		tbl.bgColor = col;
		window.setTimeout("toggleView(document.getElementById(\"" + tbl.id + "\"))", 1000);
	};
}
function collapseView(elem){
	tbl = elem;
	col = "#e0e0e0";
	while(tbl.nodeName != "TABLE") tbl = tbl.parentNode;
	if(tbl.bgColor == col){
		tbl.insertRow(1);
		row  = document.getElementById( "rowOf" + tbl.id );
		names = "";
		for(i = 0; i < row.childNodes.length; i++) names  = names + " " + row.childNodes[i].nodeName;
		//alert(names);
		while(row.childNodes.length >  0) tbl.rows[1].appendChild(row.childNodes[0]);
		document.getElementById("faketable").deleteRow(row.rowIndex);
		tbl.bgColor = "#FFFFFF";
	} else {
		row = document.getElementById("faketable").insertRow(0);
		row.id = "rowOf" + tbl.id;
		while(tbl.rows[1].childNodes.length > 0) row.appendChild(tbl.rows[1].childNodes[0]);
		tbl.bgColor = col;
		tbl.deleteRow(1);
	};
}

