add: setSomeElement(elementId, replaceString) 
context: function insertAt(elementId, replaceString) {  //inserts given text at selection or cursor position  textarea = document.getElementById(elementId);  var toBeReplaced = /text|page|area_name/;//substrings in replaceString to be replaced by the selection if a selection was done  if (textarea.setSelectionRange) {    //Mozilla    var selectionStart = textarea.selectionStart;    var selectionEnd = textarea.selectionEnd;    if (selectionStart != selectionEnd) { // has there been a selection	var newString = replaceString.replace(toBeReplaced, textarea.value.substring(selectionStart, selectionEnd));    	textarea.value = textarea.value.substring(0, selectionStart)                  + newString                  + textarea.value.substring(selectionEnd);      setSelectionRange(textarea, selectionStart, selectionStart + newString.length);    }    else  {// set caret       textarea.value = textarea.value.substring(0, selectionStart)                  + replaceString                  + textarea.value.substring(selectionEnd);      setCaretToPos(textarea, selectionStart + replaceString.length);    }  }  else if (document.selection) {    //IE    textarea.focus();    var range = document.selection.createRange();    if (range.parentElement() == textarea) {      var isCollapsed = range.text == '';      if (! isCollapsed)  {        range.text = replaceString.replace(toBeReplaced, range.text);        range.moveStart('character', -range.text.length);        range.select();      }	else {		range.text = replaceString;	}    }  }  else {    //alert("don't know yet how to handle insert" + document);	}}
meta: 1064	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1064/52842b54af7b7e07d2d02b31c562f5318d9cc862/tiki-js.js/buggy/tiki/lib/tiki-js.js