function change_value(that)
{ alert(that.value);   
	thatGlobe = that;
//	handleTable = document.getElementById("write_tenants");
	cellHandle = that.parentNode;
	columnIndex = cellHandle.cellIndex;
	rowHandle = cellHandle.parentNode;

	selectedCell = rowHandle.cells[columnIndex-1];

	rowIndex = rowHandle.rowIndex;

	selectedCell.removeChild[selectedCell.firstChild];
	inputHandle = document.createElement('input');
	inputHandle.setAttribute('type','text');
	selectedCell.appendChild(inputHandle);
	
	that.setAttribute('value','update');
	that.setAttribute['onClick','update()'];//ff and safari
        that.onclick = function() {update();};//ie

}

function update()
{ 
	text = inputHandle.value;
	selectedCell.removeChild[selectedCell.firstChild];
	selectedCell.innerHTML = text;
	
	outputIdName = "output" + rowIndex;
	hiddenHandle = document.getElementById(outputIdName);

	hiddenHandle = document.getElementById(outputIdName);	
	hiddenHandle.setAttribute('value',text);
	
	thatGlobe.setAttribute('value','edit');
	thatGlobe.setAttribute('onclick','change_value(this)');
        thatGlobe.onclick = function() {change_value(this);};
}
