function ui_fix_textarea() {
  var ta_list = document.getElementsByTagName("TEXTAREA"); 
  for (var ta_index = 0; ta_index < ta_list.length; ta_index++) { 
    var ta = ta_list[ta_index];
    if (ta.scrollHeight > ta.offsetHeight) {
      if (ta.offsetHeight < 350) {
        if (ta.scrollHeight < 350) {
          ta.style.height = ta.scrollHeight+"px";
        } else {
          ta.style.height = "400px";
        }
      }
    }
  }
  window.setTimeout("ui_fix_textarea()", 100);
}
window.setTimeout("ui_fix_textarea()", 100);
