function mkField( par ){
  var re = mkE( {
    'tag':'input',
    'prop':[ {      
      'type':'text',
      'readOnly':true,
      'Enable':true,
      'style':{
        'backgroundColor':'#ddd',
        'border':'1px solid #999',
        'color':'#000',
        'cursor':'hand',
        'cursor':'pointer'
      },      
      'ondblclick':field_edit_,
      'onblur':field_edit2_,
      'onkeydown':enter,
      'onEnter':field_edit2_, 
      'onEsc':field_edit3_,
      'onfocus':field_edit_,
      'value_':''      
    }, ( par ? par : {} ) ]    
  } );
  if( ! re.Enable ) re.style.backgroundColor = '#ccc';     
  re.Append = field_append_;
  re.Load = field_loading_;
  re.StopLoad = field_stop_loading_;  
  return re;
}
function field_append_( e ){
  if( ! e ) document.body.appendChild( this ); else e.appendChild( this );
}
function field_edit_(){
  if( ! this.Enable ) return false; 
  this.value_ = this.value; 
  this.style.backgroundColor = '#fff';
  this.style.border = '1px solid #00f';
  this.readOnly = false;
}
function field_edit2_(){
  // ON BLUR AND ENTER
  var e = this;
  if( e.readOnly ) return;      
  e.style.backgroundColor = '#ddd';
  e.style.border = '1px solid #999';
  if( e.onChange && ! e.readOnly && e.value != e.value_ ) { e.readOnly = true; e.onChange(); }  
  e.readOnly = true;   
}
function field_edit3_(){
  // ON ESC
  var e = this;     
  e.style.backgroundColor = '#ddd';
  e.style.border = '1px solid #999';
  e.readOnly = true;
  e.value = e.value_;
}
function field_loading_(){
  this.style.backgroundColor = '#ecc';
}
function field_stop_loading_(){
  this.style.backgroundColor = ( this.Enable ? '#ddd' : '#ccc' );
}
