function HighlightTable(tableID, objectName)
	{
	this.table = document.getElementById(tableID);
	this.objectName = objectName;
	
	if(typeof HighlightTable.initialised == "undefined")
		{
		HighlightTable.prototype.init = function(rowNumber)
			{
			for(var i = 0; i < this.table.rows.length; i++)
				{
				for(var n = 0; n < this.table.rows[i].cells.length; n++)
					{
					var cell = this.table.rows[i].cells[n];

					if(cell.tagName == "TD" && cell.innerHTML.trim().match(/nbsp/) == null)
						{
						//cell.setAttribute("onmouseover", objectName + ".highlightCell(" + i + ", " + n + ")");
						//cell.setAttribute("onmouseout", objectName + ".clearColumns()");
						
						cell.onmouseover = new Function(objectName + ".highlightCell(" + i + ", " + n + ")");
						cell.onmouseout = new Function(objectName + ".clearColumns()");
						}
					}
				}
			}
		
		HighlightTable.prototype.clearColumns = function()
			{
			for(var i = 0; i < this.table.rows.length; i++)
				{
				for(var n = 0; n < this.table.rows[i].cells.length; n++)
					{
					this.table.rows[i].cells[n].style.background = "none";
					this.table.rows[i].cells[n].style.border = "none";
					}
				}
			}
		
		HighlightTable.prototype.highlightCell = function(rowNumber, columnNumber)
			{
			this.clearColumns();

			for(var i = 0; i <= rowNumber; i++)
				{
				var row = this.table.rows[i];
				
				this.colourCell(row.cells[columnNumber]);

				if(i == rowNumber)
					{
					for(var n = 0; n < columnNumber; n++)
						{
						this.colourCell(row.cells[n]);
						}
					
					row.cells[columnNumber].style.background = "#555";
					}
				}
			}
		
		HighlightTable.prototype.colourCell = function(cell)
			{
			if(cell.tagName == "TH")
				{
				cell.style.background = "#2E4784";
				}
			else
				{
				cell.style.background = "#333";
				}
			}
		}
	
	this.initialised = true;
	
	this.init();
	}

function main()
	{
	skillTable = new HighlightTable("skill_table", "skillTable");
	}

addEvent(window, "load", main);