// Colour my rows and highlight the one the mouse is over
function init(tableID)
{
	ColorRows(tableID);
	HighlightRow();
}

function ColorRows(tableID)
{
	var oTable = document.getElementById(tableID);
	var oRows = oTable.getElementsByTagName("tr");
	var modRemainder;
	var newClass;

	for (var i=0; i<oRows.length; i++)
	{
		if(i == 0) continue;
		modRemainder = i % 2;
		newClass = (modRemainder == 0) ? "rowColor1" : "rowColor2";
		oRows[i].className = newClass;
	}
}

function HighlightRow()
{
	var lastRowClass;
	var oRows = document.getElementsByTagName("tr");
	for (var i=0; i<oRows.length; i++)
	{
		if ((oRows[i].className == "rowColor1") || (oRows[i].className == "rowColor2"))
		{
			oRows[i].onmouseover = function() {
				lastRowClass = this.className;
				this.className = "highlightRow";
		}
			oRows[i].onmouseout = function() {
				this.className = lastRowClass;
				}
		}
	}
}

function confirmAction()
{
	var decision = confirm("This is a permanent delete. Are you sure?");
	if (decision == false){
		return false;
	}
}