cell manipulation

hi, are days i’m trying to solve this problem.
i want to change the color of the text of a cell depending on the value of another cell.

If value mycell < value previouscell --> red ; else green

looking into documentation i have this

function eXcell_form(cell) {
this.base = eXcell_ed;

	if (cell){    
      this.cell = cell;
      this.grid = this.cell.parentNode.grid;
      eXcell_ed.call(this);                                
  }
	this.setValue = function(val) {

                    PreviousVal = ?????
		if (!val || val.toString()._dhx_trim() == ""){
		val = "0";
                    this.cell.style.color = "red";
		}
		if (val < PreviousVal){
		
		this.cell.style.color = "red";
		}
		else{
		this.cell.style.color = "green";
		}
		this.cell.innerHTML = val;
	}
}

eXcell_form.prototype  = new eXcell;

i realy dont konw how to have the PreviousVal, or where i can find documentation to solve this problem

thanks