function insertAtCarret(edid,value){  var field = document.getElementById(edid);  //IE support  if (document.selection) {    field.focus();    sel = document.selection.createRange();    sel.text = value;  //MOZILLA/NETSCAPE support  }else if (field.selectionStart || field.selectionStart == '0') {    var startPos  = field.selectionStart;    var endPos    = field.selectionEnd;    var scrollTop = field.scrollTop;    field.value = field.value.substring(0, startPos) +                  value +                  field.value.substring(endPos, field.value.length);    field.focus();    var cPos=startPos+(value.length);    field.selectionStart=cPos;    field.selectionEnd=cPos;    field.scrollTop=scrollTop;  } else {    field.value += "\n"+value;  }  // reposition cursor if possible  if (field.createTextRange){    field.caretPos = document.selection.createRange().duplicate();  }}
2895	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/2895/ef38bfe8bb5e72af7ca6f9b442f1d95dfb1d1e0b/edit.js/buggy/lib/scripts/edit.js