  var tdEditModusValue='';
  var tdEditModusCellID='';
  function tdEditCellModus(rid,cid,calign,carid,carcreated,fieldname) {
    if (!carid)
      return false;
    if (!carcreated)
      return false;
    if (!fieldname)
      return false;

    cellid ='r'+rid+'c'+cid;      
    if (tdEditModusCellID == cellid)
      return false;
    if (tdEditModusCellID != "")
      document.getElementById(tdEditModusCellID).innerHTML = tdEditModusValue;
      
    tdEditModusCellID = cellid;				

    var cell = document.getElementById(cellid);    
    tdEditModusValue = cell.innerHTML;

    tdEditModusValue = tdEditModusValue.replace("&nbsp;","");
    tdEditModusValue = tdEditModusValue.replace(".","");
    if (tdEditModusValue.indexOf('checkbox')>-1) {
      return true;
    }
    var editContent = "<input class=\'inputboxInset"+calign+"\' type=\'text\' id=\'editCell\' style=\'width:100%\' value=\'" + tdEditModusValue + "\' onblur=\'if (numeric(this,false,0)) tdSaveCellModus(this,"+carid+","+carcreated+",\""+fieldname+"\");else this.value=number_format(\""+tdEditModusValue+"\",0,\"\",\"\");\'>";
    cell.innerHTML = editContent;    
    document.getElementById('editCell').focus();
  }  
  function tdSaveCellModus(element,carid,carcreated,fieldname) {  
    var cell          = document.getElementById(tdEditModusCellID);        
    var elementValue  = number_format(element.value,0,'','.');
    var elementCell   = document.getElementById('editCell');
    var updatecar     = true;
    tdEditModusCellID = '';
    if (element.value!=tdEditModusValue) {
      if (typeof tdSaveCellModusCheck=="function") 
        updatecar = tdSaveCellModusCheck(cell,elementValue);
      if (updatecar)
        tdSaveCell(carid,carcreated,fieldname,elementValue);
    }
    if (updatecar)
      cell.innerHTML = elementValue+'&nbsp;';
    else
      cell.innerHTML = tdEditModusValue+'&nbsp;';
  }
  function tdSaveCell(carid,carcreated,fieldname,fieldvalue) {  
    var carid;
    var carcreated;
    var fieldname;
    if (isNaN(carid)) return false;
    if (isNaN(carcreated)) return false;    
    fc_form2popup('up_car_via_tbl.php?carid='+carid+'&carcreated='+carcreated+'&fieldname='+fieldname+'&fieldvalue='+fieldvalue,winpopS,'xCarAnalyserCarUpdate','iframecmd');        
    return true;
  }
