/* DOM table functions */
/***********************/
	cTable = new cHTMLTable();
	
	function cHTMLTable()
	{
		
	}


	
	/*----------------------------------------------------------------------
		Method:	insertNewTableRow
		Desc:	Insets a new row into a table. Table must have an id
		Note:	Row Definition: 
				aRow = new Array();
				aRow.attributes = {}; //Literal Parameters for attributes for the TR tag
				
				aRow[x] = new Array();
				aRow[x] = new Array();
				aRow[x]['data'] = "abc";	//innerHTML
				aRow[x]['attributes'] = {}; //TD tag attributes, given literal!
	------------------------------------------------------------------------*/
		cHTMLTable.prototype.insertNewTableRow = function(argTableID, argRowDefinition) 
		{
			var oTableRow = null;
			var oTableCell = null;
			var oTableCellTextNode = null;
			
		
			var nTotalRowsInTable = document.getElementById(argTableID).rows.length;
		  
		  //defining and assigning
			oTableRow = document.getElementById(argTableID).insertRow(nTotalRowsInTable);
			for ( strKey in argRowDefinition.attributes ) {
			   oTableRow.setAttribute(strKey, argRowDefinition.attributes[strKey]);
			}
			
			for(i=0; i<argRowDefinition.length; i++)
			{		
				oTableCell = document.createElement("td"); 								//generates a new table cell
				oTableCell.innerHTML =  argRowDefinition[i].data;
				oTableRow.appendChild(oTableCell);
			}
		}
		
		cHTMLTable.prototype.deleteTableRow = function (argTableID, argRowNumber)
		{
			document.getElementById(argTableID).deleteRow(argRowNumber);
		}
		


