		var sortedOn = 0;

		function SortTable(sortOn) {
			tbody = table.getElementsByTagName('tbody')[0];
			rows = tbody.getElementsByTagName('tr');

			rowArray = new Array();
			for (var i=0, length=rows.length; i<length; i++) {
				rowArray[i] = new Object;
				rowArray[i].oldIndex = i;
				rowArray[i].value = rows[i].getElementsByTagName('td')[sortOn].	firstChild.nodeValue;
			}

			if (sortOn == sortedOn) {
				rowArray.reverse();
			} else {
				sortedOn = sortOn;
				rowArray.sort(RowCompare);
			}

			newTbody = document.createElement('tbody');
			odd = true;
			for (var i=0, length=rowArray.length; i<length; i++) {
				currRow = rows[rowArray[i].oldIndex].cloneNode(true);
				if( odd ){
					currRow.bgColor="#eeeeee";
				}else{
					currRow.bgColor="#ffffff";
				}
				newTbody.appendChild(currRow);
				odd = !odd;
			}

			table.replaceChild(newTbody, tbody);
		}

		function RowCompare(a, b) {
			aVal = a.value;
			bVal = b.value;
			return (aVal == bVal ? 0 : (aVal > bVal ? 1 : -1));
		}

