range.text = (beforeSelection ? beforeSelection : "") + (replaceSelection ? replaceSelection : selection) + (afterSelection ? afterSelection : ""); 
range.text = (contentSnippet.beforeSelection ? contentSnippet.beforeSelection : "") + (contentSnippet.replaceSelection ? contentSnippet.replaceSelection : selection) + (contentSnippet.afterSelection ? contentSnippet.afterSelection : ""); 
org.apache.lenya.editors.insertContent = function(    formElement,     beforeSelection,     afterSelection,     replaceSelection) {  /* alert("beforeSelection: '" + beforeSelection + "'\n"      + "afterSelection: '" + afterSelection + "'\n"      + "replaceSelection: '" + replaceSelection + "'\n"  );*/   // Danger, Will Robinson: you are leaving the w3c sector!  // Selections are not properly standardized yet...  formElement.focus();  // Firefox and friends will support this for textareas etc.  if (formElement.selectionStart !== undefined) {    var begin = formElement.selectionStart;    var end = formElement.selectionEnd;    var content = formElement.value;     var selection = content.substring(begin, end);    // alert("Found selection beginning at [" + begin + "], ending at [" + end + "].");    formElement.value = content.substr(0, begin)      + (beforeSelection ? beforeSelection : "")      + (replaceSelection ? replaceSelection : selection)      + (afterSelection ? afterSelection : "")       + content.substr(end);    // update cursor position:    formElement.selectionStart = begin;    formElement.selectionEnd = begin;  } else   // IE does it thusly:  if (document.selection !== undefined) {    alert("Hey, you are using IE, right? Please get in touch with dev@lenya.apache.org to test this feature!");    var range = document.selection.createRange();    var selection = range.text;    range.text = (beforeSelection ? beforeSelection : "")      + (replaceSelection ? replaceSelection : selection)      + (afterSelection ? afterSelection : "");    range.select();  } else {  // for all other browsers, paste the stuff at the end...    alert("Hey, what kind of browser is this? Please get in touch with dev@lenya.apache.org to make this feature work properly for you!");    formElement.value = formElement.value      + (beforeSelection ? beforeSelection : "")      + (replaceSelection ? replaceSelection : selection)      + (afterSelection ? afterSelection : "");  }}
791	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/791/8d636b57b02c44c5b0e3896e7c85e3fddf764fae/org.apache.lenya.editors.js/buggy/src/modules/editors/resources/javascript/org.apache.lenya.editors.js