rem: if(opener == null){ sel = document.selection.createRange(); }else{ sel = opener.document.selection.createRange(); } 
add: sel = document.selection.createRange(); 
context: function insertAtCarret(edid,value){  var field = document.getElementById(edid);  //IE support  if (document.selection) {    field.focus();    if(opener == null){      sel = document.selection.createRange();    }else{      sel = opener.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();  }}
meta: 4895	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4895/7c6f82e59d762d68d99d1a88f449d1035ffa5f76/edit.js/clean/lib/scripts/edit.js