rem: store = (textarea.text.length - 1) + ":" + (textarea.text.length - 1) 
add: store = "0:0"; 
context: function addAttachment(textareaid, formid, editcontrolid, type) {  var textarea;  var editcontrol;  var form;  var store;  if ( document.all ) {    textarea = document.all[textareaid];    editcontrol = document.all[editcontrolid];    form = document.all[formid];  } else {    textarea = document.getElementById(textareaid);    editcontrol = document.getElementById(editcontrolid);    form = document.getElementById(formid);  }      if (typeof(textarea.caretPos) != "undefined" && typeof(textarea.createTextRange) != "undefined")  {    var duplicate = textarea.caretPos.duplicate();    var textareaRange = textarea.createTextRange();    textareaRange.select();    textareaRange = document.selection.createRange().duplicate();    duplicate.select();    var length = duplicate.text.length;    duplicate.setEndPoint("StartToStart", textareaRange); 	    var endPoint = duplicate.text.length;    var startPoint = endPoint - length;    store = startPoint + ":" + endPoint;  } else if (typeof(textarea.selectionStart) != "undefined") {    store = textarea.selectionStart + ":" + textarea.selectionEnd;  } else {    store = (textarea.text.length - 1) + ":" + (textarea.text.length - 1)  }  editcontrol.innerHTML += "<input type='hidden' name='save' value='Attach" + type + "'/><input type='hidden' name='caretPosition' value='"+ store + "'/>";  form.submit();}
meta: 2039	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/2039/385f89868453c96c1d331d0467b9038850142d8f/stateswitcher.js/clean/rwiki-tool/tool/src/webapp/scripts/stateswitcher.js