
function jGUI_Table(tableID, tableSfx, rowCount)
{
	return new __Table(tableID, tableSfx, rowCount);
}

function __Table(tableID, tableSfx, rowCount)
{
	this.id = tableID;
	this.sfx = tableSfx;
	this.me = get_obj(this.id);
	
	this.__currentRowNum = -1;
	this.__rowCount = rowCount;
	this.__rows = Array();
	
	for(var i = 0; i < rowCount; i++)
	{
		this.__rows.push(null);
	}

	this.getRow = __table_get_row;
	this.setCurrentRow = __table_set_current_row;
	this.getCurrentRow = __table_get_current_row;
}

function __table_set_current_row(rowNum)
{
	this.__currentRowNum = rowNum;
}

//function __table_get_current_row_num()
//{
//	this.__currentRowNum;
//}

function __table_get_current_row()
{
	return this.getRow(this.__currentRowNum);
}

function __table_get_row(rowNum)
{
	var ret = this.__rows[rowNum];
	if(ret == null)
	{
		ret = new __TableRow(this, rowNum);
		this.__rows[rowNum] = ret;
	}
	return ret;
}

function __TableRow(table, rowNum)
{
	this.table = table;
	this.id = table.id + "_" + rowNum;
	this.me = get_obj(this.id);
	this.rowNum = rowNum;

	this.__currentColNum = -1;
	this.__cols = Array();

	this.setCurrentCol = __table_row_set_current_col;
	this.getCurrentCol = __table_row_get_current_col;
	this.getCol = __table_row_get_col;
}

function __table_row_set_current_col(colNum)
{
	this.__currentColNum = colNum;
}

function __table_row_get_current_col()
{
	return this.getCol(this.__currentColNum);
}

function __table_row_get_col(colNum)
{
	var ret = this.__cols[colNum];
	if(ret == null)
	{
		ret = new __TableCol(this.table, this, colNum);
		this.__cols[colNum] = ret;
	}
	return ret;
}

function __TableCol(table, row, colNum)
{
	this.table = table;
	this.row = row
	this.id = this.row.id + "_" + colNum;
	this.me = get_obj(this.id);
	this.colNum = colNum;
	
	this.getElement = __table_col_get_element;
}

function __table_col_get_element(elementID)
{
	return new jGUI_Element(elementID + this.table.sfx + "_" + this.row.rowNum + "_" + this.colNum);
}


function g_showBigPict()
{
	var obj = jGUI_Element("ILIST_BIG_PICT2");
	obj.me.src = _tblIList.getCurrentRow().getCurrentCol().getElement("ILIST_BIG_PICT").me.src;
	obj = jGUI_Element("FRAME_ILIST_BIG_PICT");
	var top = _tblIList.getCurrentRow().rowNum * 114 - 70;
	obj.me.style.top = top + "px";
	obj.me.style.display = "";
	return false;
}

function g_hideBigPict()
{
	var obj = jGUI_Element("ILIST_BIG_PICT2");
	obj.me.src = "/picts/progress.png";
	obj =jGUI_Element("FRAME_ILIST_BIG_PICT");
	obj.me.style.display = "none";
	return false;
}
