function tableRows() {
	myTRS = document.getElementsByTagName('tr');
	for(idx in myTRS) {
		if(myTRS[idx].className == 'highlightable') {
			myTRS[idx].onclick = toggleTable;
			myTRS[idx].onmouseover  = highlightMe;
			myTRS[idx].onmouseout = restoreMyColor;
		}
	}
	
	
}

function restoreMyColor() {
	this.style.backgroundColor = '#ffffff';
}

function highlightMe() {
	this.style.backgroundColor = '#f9f6f1';
}


function toggleTable() {
	var other = this.getAttribute('for');
	obj = document.getElementById(other);
	img = document.getElementById(other  + "-img");
	//alert(img.src.indexOf('1') + " - " + img.src);
	img.src = img.src.indexOf('1.gif') != -1 ? img.src.replace('1.gif' , '2.gif') : img.src.replace('2.gif', '1.gif');
	//alert(img.src);
	if(obj.style.display == 'none' || obj.style.display =='')  {
		if(!document.all)
			obj.style.display = 'table-row';
		else
			obj.style.display = 'inline';
	} else {
		obj.style.display = 'none';
		
	}
}

window.onload = tableRows;