function Row(parent_div, div_id, row_xml, fields)
{
	this.div_id = div_id;

	var div = document.getElementById(div_id);
	if(div)
		div.parentNode.removeChild(div);

	this.div_row = document.createElement("div");
	this.div_row.setAttribute("id", div_id);
	this.div_row.className = "show_row";

	this.cells = new Array()

	var i = 0;
	while(row_xml.getElementsByTagName("cell")[i])
	{
		var cell = row_xml.getElementsByTagName("cell")[i];

		var name = cell.getElementsByTagName("name")[0].firstChild.nodeValue;
		var value = cell.getElementsByTagName("value")[0].firstChild.nodeValue;
	
		this.cells[i] = new Cell(this.div_row, this.div_id + "[" + i + "]", name, value, fields[i]);
		i++;
	}

	if(parent_div)
		parent_div.appendChild(this.div_row);
}

Row.prototype = 
{
	show: function(type)
	{
		var xobj = new xObject(this.div_row, 1);
		var filo = new xFuncFILO;

		filo.add(function() { xobj.setBgColor("#123456", 10, filo); }, this);
		filo.add(function() { xobj.setBgColor("#EEEEEE", 10, filo); }, this);
		filo.next();
		var i = 0;

		while(this.cells[i])
			this.cells[i++].show(type);

		if(type == "in")
		{
			var submit = document.createElement("input");
			submit.setAttribute("type", "button");
			submit.value = "Editar";
			submit.setAttribute("id", this.div_id + "_submit");

			this.div_row.appendChild(submit);
		}

	},

	resize: function()
	{
		var i = 0;
		while(this.cells[i])
			this.cells[i++].resize();
	},

	reset: function()
	{
	}
}
		

	
