function tableRuler() {	
	var i, j, k, trs, tbody, currentSelect = null;

	var tables = document.getElementsByClass('hlite', null, 'table');
	for (i=0;i<tables.length;i++) {
		tbody = tables[i].getElementsByTagName('tbody');
		for (k=0;k<tbody.length;k++) {
			trs = tbody[k].getElementsByTagName('tr');
			for (j=0;j<trs.length;j++) {
				if( j % 2 == 0)	addClass(trs[j], "zebre");
				trs[j].onmousedown = function() {
					if(this != currentSelect) {
						if(currentSelect != null)
							removeClass(currentSelect, "select");

						addClass(this, "select");
						currentSelect = this;
					}
					else {
						removeClass(this, "select");
						currentSelect = null;
					}
				}
			}
		}
	}
}

onDomReady(tableRuler);
