// Include this on your page to make the prototype's in place text areas (1.6.x) auto growing.
//
// 2008 Thilo Utke (upstream-berlin.com)
Ajax.InPlaceEditor.prototype.createEditField = function() {
  var text = (this.options.loadTextURL ? this.options.loadingText : this.getText());
  var fld;
  if (1 >= this.options.rows && !/\r|\n/.test(this.getText())) {
    fld = document.createElement('input');
    fld.type = 'text';
    var size = this.options.size || this.options.cols || 0;
    if (0 < size) fld.size = size;
  } else {
    fld = document.createElement('textarea');
    fld.rows = (1 >= this.options.rows ? this.options.autoRows : this.options.rows);
	  fld.onfocus = function(){
	 	  while (fld.scrollHeight > fld.clientHeight && !window.opera) {
    	  fld.rows += 1;
		  }
	  }
	  
	  fld.onkeypress = function(){
  	  if (fld.scrollHeight > fld.clientHeight && !window.opera)
      		fld.rows += 1;
    }
    fld.cols = this.options.cols || 40;
  }
  fld.name = this.options.paramName;
  fld.value = text;
  fld.className = 'editor_field';
  if (this.options.submitOnBlur)
    fld.onblur = this._boundSubmitHandler;
  this._controls.editor = fld;
  if (this.options.loadTextURL)
    this.loadExternalText();
  this._form.appendChild(this._controls.editor);
}