	function tableCallback(col, reverse) {
		initMouseovers();
		setHeaders(col, reverse);
	}

	function initMouseovers() {
		trs = document.getElementsByTagName('TR');
		for (var i=0;i<trs.length;i++) {
			if (trs[i].parentNode.nodeName == 'TBODY' && trs[i].parentNode.id == 'tableBody') {
				trs[i].onmouseover = mouseGoesOver;
				trs[i].onmouseout = mouseGoesOut;
			}
    	}
	}

	function mouseGoesOver(e) {
		this.bgColor='#FFFFCC';
		this.style.cursor='pointer';
		this.style.color='#138BB9';
	}

	function mouseGoesOut(e) {
		this.bgColor='';
		this.style.color='';
	}
	
	var colClsNm = "sortedColumn";
	var colClsNmRev = "reverseSortedColumn";

	// Regular expressions for setting class names.
	var colTest = new RegExp(colClsNm, "gi");

	function setHeaders(col, reverse) {
		tblEl = document.getElementById("tableBody");
		// Find the table header and highlight the column that was sorted.
		var el = tblEl.parentNode.tHead;
		
		// Get the entire row of TH elements.
		rowEl = el.rows[el.rows.length - 1];
		
		// Set (and unset) style classes for each column as above.
		for (i = 0; i < rowEl.cells.length; i++) {
			cellEl = rowEl.cells[i];
			cellEl.className = cellEl.className.replace(colTest, "");
			// Highlight the header of the sorted column.
			if (i == col) {
				if (reverse)
					cellEl.className = colClsNmRev;
				else
					cellEl.className = colClsNm;
			}
		}
	}
