1 ////////////////////////////////////////////////////////////////////////////////
3 // Richtext Editor: Fork (RTEF) VERSION: 0.002
5 // For the latest release visit http://richtext.cabspace.com
6 // For support visit http://cabspace.com/forums/?mforum=richtext
8 ////////////////////////////////////////////////////////////////////////////////
10 ////////////////////////////////////////////////////////////////////////////////
14 // Copyright (c) 2006 Timothy Bell
16 // Permission is hereby granted, free of charge, to any person obtaining a copy
17 // of this software and associated documentation files (the "Software"), to deal
18 // in the Software without restriction, including without limitation the rights
19 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20 // copies of the Software, and to permit persons to whom the Software is
21 // furnished to do so, subject to the following conditions:
23 // The above copyright notice and this permission notice shall be included in
24 // all copies or substantial portions of the Software.
26 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
34 ////////////////////////////////////////////////////////////////////////////////
37 var minWidth = 450; // minumum width
38 var wrapWidth = 1245; //width at which all icons will appear on one bar
39 var maxchar = 64000; // maximum number of characters per save
40 var lang = "en"; //xhtml language
41 var lang_direction = "ltr"; //language direction : ltr = left-to-right, rtl = right-to-left
42 var encoding = "utf-8"; //xhtml encoding
43 var zeroBorder = "#c0c0c0"; //guideline color - see showGuidelines()
44 var btnText = "submit"; //Button value for non-designMode() & fullsceen rte
45 var resize_fullsrcreen = true;
46 // (resize_fullsrcreen) limited in that: 1)won't auto wrap icons. 2)won't
47 // shrink to less than (wrapWidth)px if screen was initized over (wrapWidth)px;
49 var keep_absolute = true; // !!!Disabled - see line 456 for details!!!!!
50 // By default IE will try to convery all hyperlinks to absolute paths. By
51 // setting this value to "false" it will retain the relative path.
62 //Init Variables & Attributes
63 var ua = navigator.userAgent.toLowerCase();
64 var isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1))? true:false;
65 var isIE7 = ((isIE) && (ua.indexOf("msie 7.") != -1))? true:false;
66 var isGecko = (ua.indexOf("gecko") != -1)? true:false;
67 var isSafari = (ua.indexOf("safari") != -1)? true:false;
68 var safariVersion = parseFloat(ua.substring(ua.lastIndexOf("safari/") + 7));
69 var isKonqueror = (ua.indexOf("konqueror") != -1)? true:false;
78 var generateXHTML = true;
79 var isRichText = false;
80 //check to see if designMode mode is available
81 //Safari/Konqueror think they are designMode capable even though they are not
82 //if(document.getElementById && document.designMode && !isSafari && !isKonqueror){
83 if(document.getElementById && document.designMode) {
85 } else if ((isSafari && safariVersion >= 312) || isKonqueror) {
86 //Safari 1.3+ is capable of designMode, Safari 1.3 = webkit build 312
89 //for testing standard textarea, uncomment the following line
92 var replacements = new Array (
93 new RegExp(String.fromCharCode(145),'g'), "'",
94 new RegExp(String.fromCharCode(146),'g'), "'",
95 new RegExp("'"), "'",
96 //convert all types of double quotes
97 new RegExp(String.fromCharCode(147),'g'), "\"",
98 new RegExp(String.fromCharCode(148),'g'), "\"",
99 new RegExp("\""), """, //doesn't work
100 //replace carriage returns & line feeds
101 new RegExp("[\r\n]",'g'), " ");
103 function rteSafe(html) {
105 for (i=0; i<replacements.length; i = i+2) {
106 html = html.replace(replacements[i], replacements[i+1]);
112 var nbcommand = 0; // For not duplicating separators when no command between
113 var defaultFont = "Times New Roman, Times, serif";
114 var defaultSize = "13px";
115 var activeCommand = { // Strait-forward HashMap
116 put : function(foo, bar) {this[foo] = bar;},
117 get : function(foo) {return this[foo];}
120 function initTextInput() {
121 activeCommand.put("cut", lblCut);
122 activeCommand.put("copy", lblCopy);
123 activeCommand.put("paste", lblPaste);
124 activeCommand.put("undo", lblUndo);
125 activeCommand.put("redo", lblRedo);
126 activeCommand.put("bold", lblBold);
127 activeCommand.put("italic", lblItalic);
128 activeCommand.put("underline", lblUnderline);
129 activeCommand.put("list", lblUL);
130 activeCommand.put("numbered_list", lblOL);
131 activeCommand.put("indent", lblIndent);
132 activeCommand.put("outdent", lblOutdent);
133 activeCommand.put("replace", lblSearch);
134 activeCommand.put("hyperlink", lblInsertLink);
137 defaultFont = "Arial, Helvetica, sans-serif";
138 initRTE("../rtef/images/", "../rtef/", "", true);
141 function initTextEditor() {
142 activeCommand.put("save", lblSave);
143 // activeCommand.put("print", lblPrint);
144 activeCommand.put("cut", lblCut);
145 activeCommand.put("copy", lblCopy);
146 activeCommand.put("paste", lblPaste);
147 activeCommand.put("undo", lblUndo);
148 activeCommand.put("redo", lblRedo);
149 activeCommand.put("bold", lblBold);
150 activeCommand.put("italic", lblItalic);
151 activeCommand.put("underline", lblUnderline);
152 activeCommand.put("list", lblUL);
153 activeCommand.put("numbered_list", lblOL);
154 activeCommand.put("indent", lblIndent);
155 activeCommand.put("outdent", lblOutdent);
156 activeCommand.put("replace", lblSearch);
157 activeCommand.put("hyperlink", lblInsertLink);
160 defaultFont = "Arial, Helvetica, sans-serif";
161 initRTE("../rtef/images/", "../rtef/", "", true);
164 function addCommand(name, action) {
165 var label = activeCommand.get(name);
167 insertImg(label, name + ".gif", action);
172 function displayTextEditor(inputname, initialtext, width, height) {
173 writeRichText(inputname, rteSafe(initialtext), '', width, height, true, false, false);
177 function initRTE(imgPath, incPath, css, genXHTML){
178 // CM 05/04/05 check args for compatibility with old RTE implementations
179 if (arguments.length == 3) {
180 genXHTML = generateXHTML;
183 imagesPath = imgPath;
184 includesPath = incPath;
186 generateXHTML = genXHTML;
188 document.writeln('<style type="text/css">@import "' + includesPath + 'rte.css";</style>');
191 minWidth = minWidth-48;
192 wrapWidth = wrapWidth-102;
196 function writeRichText(rte, html, css, width, height, buttons, readOnly, fullscreen) {
198 if(allRTEs.length > 0){
202 // CM 06/04/05 stops single quotes from messing everything up
203 html=replaceIt(html,'\'',''');
204 // CM 05/04/05 a bit of juggling for compatibility with old RTE implementations
205 if (arguments.length == 6) {
213 var iconWrapWidth = wrapWidth;
219 readOnly = false; // fullscreen is not readOnly and must show buttons
221 // resize rte on resize if the option resize_fullsrcreen = true.
222 if(isRichText && resize_fullsrcreen) {
223 window.onresize = resizeRTE;
225 document.body.style.margin = "0px";
226 document.body.style.overflow = "hidden";
227 //adjust maximum table widths
230 if(width < iconWrapWidth) {
231 height = (obj_height - 83);
233 height = (obj_height - 55);
235 if (width < minWidth) {
236 document.body.style.overflow = "auto";
238 height = obj_height-22;
240 height = obj_height-24;
247 iconWrapWidth = iconWrapWidth-25;
248 //adjust minimum table widths
249 if(buttons && (width < minWidth)) {
255 tablewidth = width + 4;
265 document.writeln('<span class="rteDiv">');
267 document.writeln('<table class="rteBk" cellpadding=0 cellspacing=0 id="Buttons1_'+rte+'" width="' + tablewidth + '">');
268 document.writeln('<tbody><tr>');
270 if(fullscreen || activeCommand.get("save") != null){
271 document.writeln('<td><input type="image" class="rteImg" src="'+imagesPath+'save.gif" alt="'+lblSave+'" title="'+lblSave+'" onmouseover="this.className=\'rteImgUp\'" onmouseout="this.className=\'rteImg\'" onmousedown="this.className=\'rteImgDn\'" onmouseup="this.className=\'rteImgUp\'" onClick="submitEdit()"></td>');
274 if(!isSafari && !isKonqueror) {
275 addCommand("print","rtePrint('"+rte+"')");
276 // insertImg(lblPrint,"print.gif","rtePrint('"+rte+"')");
278 addCommand("selectall","toggleSelection('"+rte+"')");
279 // insertImg(lblSelectAll,"selectall.gif","toggleSelection('"+rte+"')");
280 addCommand("unformat","rteCommand('"+rte+"','removeformat')");
281 // insertImg(lblUnformat,"unformat.gif","rteCommand('"+rte+"','removeformat')");
284 if(isIE || isSafari || isKonqueror) {
285 addCommand("cut","rteCommand('"+rte+"','cut')");
286 // insertImg(lblCut,"cut.gif","rteCommand('"+rte+"','cut')");
287 addCommand("copy","rteCommand('"+rte+"','copy')");
288 // insertImg(lblCopy,"copy.gif","rteCommand('"+rte+"','copy')");
290 if(isSafari || isKonqueror) {
291 addCommand("paste","rteCommand('"+rte+"','InsertText')");
292 // insertImg(lblPaste,"paste.gif","rteCommand('"+rte+"','InsertText')");
295 addCommand("paste","rteCommand('"+rte+"','paste')");
296 // insertImg(lblPaste,"paste.gif","rteCommand('"+rte+"','paste')");
298 if(!isSafari && !isKonqueror) {
299 addCommand("pastetext","dlgLaunch('"+rte+"','text')");
300 // insertImg(lblPasteText,"pastetext.gif","dlgLaunch('"+rte+"','text')");
301 addCommand("pasteword","dlgLaunch('"+rte+"','word')");
302 // insertImg(lblPasteWord,"pasteword.gif","dlgLaunch('"+rte+"','word')");
305 addCommand("undo","rteCommand('"+rte+"','undo')");
306 // insertImg(lblUndo,"undo.gif","rteCommand('"+rte+"','undo')");
307 addCommand("redo","rteCommand('"+rte+"','redo')");
308 // insertImg(lblRedo,"redo.gif","rteCommand('"+rte+"','redo')");
309 if(!isSafari && !isKonqueror) {
311 // document.writeln('<td>');
312 // document.writeln('<select id="formatblock_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);return false" style="font-size:14px;width:105px;height:20px;margin:1px;">');
313 // document.writeln(lblFormat);
314 // document.writeln('</select></td><td>');
315 // document.writeln('<select id="fontname_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);return false" style="font-size:14px;width:125px;height:20px;margin:1px;">');
316 // document.writeln(lblFont);
317 // document.writeln('</select></td><td>');
318 // document.writeln('<select unselectable="on" id="fontsize_'+rte+'" onchange="selectFont(\''+rte+'\', this.id);return false" style="font-size:14px;width:75px;height:20px;margin:1px;">');
319 // document.writeln(lblSize);
320 // document.writeln('</select></td>');
322 if(tablewidth < iconWrapWidth){
323 document.writeln('<td width="100%"></td></tr></tbody></table>');
324 document.writeln('<table class="rteBk" cellpadding="0" cellspacing="0" id="Buttons2_'+rte+'" width="' + tablewidth + '">');
325 document.writeln('<tbody><tr>');
328 addCommand("bold","rteCommand('"+rte+"','bold')");
329 // insertImg(lblBold,"bold.gif","rteCommand('"+rte+"','bold')");
330 addCommand("italic","rteCommand('"+rte+"','italic')");
331 // insertImg(lblItalic,"italic.gif","rteCommand('"+rte+"','italic')");
332 addCommand("underline","rteCommand('"+rte+"','underline')");
333 // insertImg(lblUnderline,"underline.gif","rteCommand('"+rte+"','underline')");
334 //if(!isSafari && !isKonqueror) insertImg(lblStrikeThrough,"strikethrough.gif","rteCommand('"+rte+"','strikethrough')");
335 //insertImg(lblSuperscript,"superscript.gif","rteCommand('"+rte+"','superscript')");
336 //if(!isSafari && !isKonqueror){
337 //insertImg(lblSubscript,"subscript.gif","rteCommand('"+rte+"','subscript')");
339 //insertImg(lblSubscript,"subscript.gif","rteCommand('"+rte+"','StyleChange',sub)");
342 addCommand("left_just","rteCommand('"+rte+"','justifyleft')");
343 // insertImg(lblAlgnLeft,"left_just.gif","rteCommand('"+rte+"','justifyleft')");
344 addCommand("centre","rteCommand('"+rte+"','justifycenter')");
345 // insertImg(lblAlgnCenter,"centre.gif","rteCommand('"+rte+"','justifycenter')");
346 addCommand("right_just","rteCommand('"+rte+"','justifyright')");
347 // insertImg(lblAlgnRight,"right_just.gif","rteCommand('"+rte+"','justifyright')");
348 addCommand("justifyfull","rteCommand('"+rte+"','justifyfull')");
349 // insertImg(lblJustifyFull,"justifyfull.gif","rteCommand('"+rte+"','justifyfull')");
350 if(!isSafari && !isKonqueror) {
352 addCommand("numbered_list","rteCommand('"+rte+"','insertorderedlist')");
353 // insertImg(lblOL,"numbered_list.gif","rteCommand('"+rte+"','insertorderedlist')");
354 addCommand("list","rteCommand('"+rte+"','insertunorderedlist')");
355 // insertImg(lblUL,"list.gif","rteCommand('"+rte+"','insertunorderedlist')");
356 addCommand("outdent","rteCommand('"+rte+"','outdent')");
357 // insertImg(lblOutdent,"outdent.gif","rteCommand('"+rte+"','outdent')");
358 addCommand("indent","rteCommand('"+rte+"','indent')");
359 // insertImg(lblIndent,"indent.gif","rteCommand('"+rte+"','indent')");
361 addCommand("textcolor","dlgColorPalette('"+rte+"','forecolor')","forecolor_"+rte);
362 // insertImg(lblTextColor,"textcolor.gif","dlgColorPalette('"+rte+"','forecolor')","forecolor_"+rte);
363 addCommand("bgcolor","dlgColorPalette('"+rte+"','hilitecolor')","hilitecolor_"+rte);
364 // insertImg(lblBgColor,"bgcolor.gif","dlgColorPalette('"+rte+"','hilitecolor')","hilitecolor_"+rte);
366 addCommand("hr","rteCommand('"+rte+"','inserthorizontalrule')");
367 // insertImg(lblHR,"hr.gif","rteCommand('"+rte+"','inserthorizontalrule')");
369 addCommand("special_char","dlgLaunch('"+rte+"','char')");
370 // insertImg(lblInsertChar,"special_char.gif","dlgLaunch('"+rte+"','char')");
371 addCommand("hyperlink","dlgLaunch('"+rte+"','link')");
372 // insertImg(lblInsertLink,"hyperlink.gif","dlgLaunch('"+rte+"','link')");
373 addCommand("image","dlgLaunch('"+rte+"','image')");
374 // insertImg(lblAddImage,"image.gif","dlgLaunch('"+rte+"','image')");
375 addCommand("insert_table","dlgLaunch('"+rte+"','table')");
376 // insertImg(lblInsertTable,"insert_table.gif","dlgLaunch('"+rte+"','table')");
379 if(!isSafari && !isKonqueror) {
380 addCommand("replace","dlgLaunch('"+rte+"','replace')");
381 // insertImg(lblSearch,"replace.gif","dlgLaunch('"+rte+"','replace')");
383 addCommand("word_count","countWords('"+rte+"')");
384 // insertImg(lblWordCount,"word_count.gif","countWords('"+rte+"')");
386 addCommand("spellcheck","checkspell()");
387 // insertImg(lblSpellCheck,"spellcheck.gif","checkspell()");
389 document.writeln('<td width="100%"></td></tr></tbody></table>');
391 document.writeln('<iframe id="'+rte+'" width="' + (tablewidth - 2) + 'px" height="' + height + 'px" frameborder=0 style="border: 1px solid #d2d2d2" src="' + includesPath + 'blank.htm" onfocus="dlgCleanUp();"></iframe>');
393 document.writeln('<table id="vs'+rte+'" name="vs'+rte+'" class="rteBk" cellpadding=0 cellspacing=0 border=0 width="' + tablewidth + '"><tr>');
394 document.writeln('<td onclick="toggleHTMLSrc(\''+rte+'\', ' + buttons + ');" nowrap><img class="rteBar" src="'+imagesPath+'bar.gif" alt="" align=absmiddle><span id="imgSrc'+rte+'"><img src="'+imagesPath+'code.gif" alt="" title="" style="margin:1px;" align=absmiddle></span><span id="_xtSrc'+rte+'" style="font-family:tahoma,sans-serif;font-size:12px;color:#0000ff;CURSOR: default;">'+lblModeHTML+'</span></td>');
395 document.writeln('<td width="100%" nowrap> </td></tr></table>');
397 document.writeln('<iframe width="142" height="98" id="cp'+rte+'" src="' + includesPath + 'palette.htm" scrolling="no" frameborder=0 style="margin:0;border:0;visibility:hidden;position:absolute;border:1px solid #cdcdcd;top:-1000px;left:-1000px"></iframe>');
398 document.writeln('<input type="hidden" id="hdn'+rte+'" name="'+rte+'" value="" style="position: absolute;left:-1000px;top:-1000px;">');
400 document.writeln('<input type="hidden" id="size'+rte+'" name="size'+rte+'" value="'+height+'" style="position: absolute;left:-1000px;top:-1000px;">');
402 document.writeln('</span>');
403 document.getElementById('hdn'+rte).value = html;
404 enableDesignMode(rte, html, rte_css, readOnly);
407 if(fullscreen && height > 90) {
408 height = (height - 75);tablewidth=tablewidth-30;
410 // CM non-designMode() UI
411 html = parseBreaks(html);
412 document.writeln('<div style="font:12px Verdana, Arial, Helvetica, sans-serif;width: ' + tablewidth + 'px;padding:15px;">');
414 document.writeln('<div style="color:gray">'+lblnon_designMode+'</div><br>');
415 document.writeln('<input type="radio" name="' + rte + '_autobr" value="1" checked="checked" onclick="autoBRon(\'' + rte + '\');" /> '+lblAutoBR+'<input type="radio" name="' + rte + '_autobr" value="0" onclick="autoBRoff(\'' + rte + '\');" />'+lblRawHTML+'<br>');
416 document.writeln('<textarea name="'+rte+'" id="'+rte+'" style="width: ' + tablewidth + 'px; height: ' + height + 'px;">' + html + '</textarea>');
418 document.writeln('<textarea name="'+rte+'" id="'+rte+'" style="width: ' + tablewidth + 'px; height: ' + height + 'px;" readonly=readonly>' + html + '</textarea>');
420 if(fullscreen) document.writeln('<br><input type="submit" value="'+btnText+'" />');
421 document.writeln('</div>');
425 function insertBar() {
426 document.writeln('<td><img class="rteBar" src="'+imagesPath+'bar.gif" alt=""></td>');
429 function insertSep() {
431 document.writeln('<td><img class="rteSep" src="'+imagesPath+'blackdot.gif" alt=""></td>');
435 function insertImg(name, image, command, id){
438 td = "<td id='"+id+"'>";
440 document.writeln(td+'<img class="rteImg" src="'+imagesPath+image+'" alt="'+name+'" title="'+name+'" onMouseDown="'+command+';return false" onmouseover="this.className=\'rteImgUp\'" onmouseout="this.className=\'rteImg\'" onmousedown="this.className=\'rteImgDn\'" onmouseup="this.className=\'rteImgUp\'"></td>');
443 function enableDesignMode(rte, html, css, readOnly) {
444 var frameHtml = "<html dir='" + lang_direction + "' lang='" + lang + "' id='" + rte + "'>\n<head>\n";
445 frameHtml += "<meta http-equiv='Content-Type' content='text/html; charset=" + encoding + "'>\n";
446 frameHtml += "<meta http-equiv='Content-Language' content='" + lang + "'>\n";
447 //to reference your stylesheet, set href property below to your stylesheet path and uncomment
449 frameHtml += "<link media=\"all\" type=\"text/css\" href=\"" + css + "\" rel=\"stylesheet\">\n";
451 frameHtml += "<style>@charset \"utf-8\"; body {background:#FFFFFF;margin:8px;padding:0px;font-family:"+defaultFont+";font-size:"+defaultSize+";}</style>\n";
453 frameHtml += "</head><body>\n"+html+"\n</body></html>";
454 if(!isSafari && !isKonqueror) var oRTE = returnRTE(rte).document;
456 if(isSafari || isKonqueror) var oRTE = frames[rte].document;
457 oRTE.open("text/html","replace");
458 oRTE.write(frameHtml);
461 oRTE.designMode = "On";
465 // Commented out the following line to confront a bug when loading multiple RTEs on one page in a MOZ browser
466 // Fix provided by "Kings". Safari may have problems with this snytax - unable to test because I don't own a MAC.(Tim Bell)
468 // if(!readOnly) document.getElementById(rte).contentDocument.designMode = "on";
469 if(!readOnly && !isKonqueror && !isSafari) {
470 document.getElementById(rte).contentDocument.designMode = "on"; //RKV
471 addLoadEvent(function() { document.getElementById(rte).contentDocument.designMode = "on"; });
472 } else if(!readOnly) {
473 if (!readOnly) document.getElementById(rte).contentDocument.designMode = "on";
477 if(isSafari || isKonqueror) var oRTE = document.getElementById(rte).contentWindow.document;
478 oRTE.open("text/html","replace");
479 oRTE.write(frameHtml);
481 if(isGecko && !readOnly) {
482 //attach a keyboard handler for gecko browsers to make keyboard shortcuts work
483 oRTE.addEventListener("keypress", geckoKeyPress, true);
484 oRTE.addEventListener("focus", function (){dlgCleanUp();}, false);
487 alert(lblErrorPreload);
490 //gecko may take some time to enable design mode.
491 //Keep looping until able to set.
493 setTimeout("enableDesignMode('"+rte+"', '"+html+"', '"+css+"', "+readOnly+");", 200);
499 setTimeout('showGuidelines("'+rte+'")',300);
502 function addLoadEvent(func) {
503 var oldonload = window.onload;
504 if (typeof window.onload != 'function') {
505 window.onload = func;
507 window.onload = function() {
514 function returnRTE(rte) {
519 rtn = document.getElementById(rte).contentWindow;
524 function updateRTE(rte) {
526 dlgCleanUp(); // Closes Pop-ups
527 stripGuidelines(rte); // Removes Table Guidelines
532 function updateRTEs(){
533 var vRTEs = allRTEs.split(";");
534 for(var i=0; i<vRTEs.length; i++){
539 function parseRTE(rte) {
541 autoBRoff(rte); // sorts out autoBR
544 //check for readOnly mode
545 var readOnly = false;
546 var oRTE = returnRTE(rte);
548 if(oRTE.document.designMode != "On"){
552 if(oRTE.document.designMode != "on"){
556 if(isRichText && !readOnly){
557 //if viewing source, switch back to design view
558 if(document.getElementById("_xtSrc"+rte).innerHTML == lblModeRichText){
559 if(document.getElementById("Buttons1_"+rte)){
560 toggleHTMLSrc(rte, true);
562 toggleHTMLSrc(rte, false);
564 stripGuidelines(rte);
570 function setHiddenVal(rte){
571 //set hidden form field value for current rte
572 var oHdnField = document.getElementById('hdn'+rte);
573 //convert html output to xhtml (thanks Timothy Bell and Vyacheslav Smolin!)
574 if(oHdnField.value==null){
575 oHdnField.value = "";
577 var sRTE = returnRTE(rte).document.body;
580 oHdnField.value = getXHTML(sRTE.innerHTML);
582 oHdnField.value = sRTE.innerHTML;
585 oHdnField.value = sRTE.innerHTML;
587 // fix to replace special characters added here:
588 oHdnField.value = replaceSpecialChars(oHdnField.value);
589 //if there is no content (other than formatting) set value to nothing
590 if(stripHTML(oHdnField.value.replace(" ", " ")) == "" &&
591 oHdnField.value.toLowerCase().search("<hr") == -1 &&
592 oHdnField.value.toLowerCase().search("<img") == -1){
593 oHdnField.value = "";
597 function rteCommand(rte, command, option){
599 //function to perform command
600 var oRTE = returnRTE(rte);
603 oRTE.document.execCommand(command, false, option);
607 // setTimeout("rteCommand('" + rte + "', '" + command + "', '" + option + "');", 10);
611 function toggleHTMLSrc(rte, buttons){
613 //contributed by Bob Hutzel (thanks Bob!)
614 var cRTE = document.getElementById(rte);
615 var hRTE = document.getElementById('hdn'+rte);
616 var sRTE = document.getElementById("size"+rte);
617 var tRTE = document.getElementById("_xtSrc"+rte);
618 var iRTE = document.getElementById("imgSrc"+rte);
619 var oRTE = returnRTE(rte).document;
622 obj_height = parseInt(sRTE.value);
626 if(tRTE.innerHTML == lblModeHTML){
627 //we are checking the box
628 tRTE.innerHTML = lblModeRichText;
629 stripGuidelines(rte);
631 showHideElement("Buttons1_" + rte, "hide", true);
632 if(document.getElementById("Buttons2_"+rte)){
633 showHideElement("Buttons2_" + rte, "hide", true);
634 cRTE.style.height = obj_height+56;
636 cRTE.style.height = obj_height+28;
641 oRTE.body.innerText = hRTE.value;
643 htmlSrc = oRTE.createTextNode(hRTE.value);
644 oRTE.body.innerHTML = "";
645 oRTE.body.appendChild(htmlSrc);
647 iRTE.innerHTML = '<img src="'+imagesPath+'design.gif" alt="Switch Mode" style="margin:1px;" align=absmiddle>';
649 //we are unchecking the box
650 obj_height = parseInt(cRTE.style.height);
651 tRTE.innerHTML = lblModeHTML;
653 showHideElement("Buttons1_" + rte, "show", true);
654 if(document.getElementById("Buttons2_"+rte)){
655 showHideElement("Buttons2_" + rte, "show", true);
656 cRTE.style.height = obj_height-56;
658 cRTE.style.height = obj_height-28;
663 var output = escape(oRTE.body.innerText);
664 output = output.replace("%3CP%3E%0D%0A%3CHR%3E", "%3CHR%3E");
665 output = output.replace("%3CHR%3E%0D%0A%3C/P%3E", "%3CHR%3E");
666 oRTE.body.innerHTML = unescape(output);
667 // Disabled due to flaw in the regular expressions, this fix
668 // does not work with the revamped's enhanced insert link dialog window.
670 // Prevent links from changing to absolute paths
672 var tagfix = unescape(output).match(/<a[^>]*href=(['"])([^\1>]*)\1[^>]*>/ig);
673 var coll = oRTE.body.all.tags('A');
674 for(i=0; i<coll.length; i++){
675 // the 2 alerts below show when we hinder the links from becoming absolute
677 coll[i].href = tagfix[i].replace(/.*href=(['"])([^\1]*)\1.*/i,"$2");
678 //alert(RegExp.$1 + " " + RegExp.$2 + " " + RegExp.$3);
680 var imgfix = unescape(output).match(/<img[^>]*src=['"][^'"]*['"][^>]*>/ig);
681 var coll2 = oRTE.body.all.tags('IMG');
682 for(i=0; i<coll2.length; i++){
683 coll2[i].src = imgfix[i].replace(/.*src=['"]([^'"]*)['"].*/i,"$1");
688 htmlSrc = oRTE.body.ownerDocument.createRange();
689 htmlSrc.selectNodeContents(oRTE.body);
690 oRTE.body.innerHTML = htmlSrc.toString();
692 oRTE.body.innerHTML = replaceSpecialChars(oRTE.body.innerHTML);
694 // (IE Only)This prevents an undo operation from displaying a pervious HTML mode
695 // This resets the undo/redo buffer.
699 iRTE.innerHTML = '<img src="'+imagesPath+'code.gif" alt="Switch Mode" style="margin:1px;" align=absmiddle>';
703 function toggleSelection(rte) {
704 var rng = setRange(rte);
705 var oRTE = returnRTE(rte).document;
709 length1 = rng.text.length;
710 var output = escape(oRTE.body.innerText);
711 output = output.replace("%3CP%3E%0D%0A%3CHR%3E", "%3CHR%3E");
712 output = output.replace("%3CHR%3E%0D%0A%3C/P%3E", "%3CHR%3E");
713 length2 = unescape(output).length;
715 length1 = rng.toString().length;
716 var htmlSrc = oRTE.body.ownerDocument.createRange();
717 htmlSrc.selectNodeContents(oRTE.body);
718 length2 = htmlSrc.toString().length;
720 if(length1 < length2){
721 rteCommand(rte,'selectall','');
724 oRTE.designMode = "off";
725 oRTE.designMode = "on";
727 rteCommand(rte,'unselect','');
732 function dlgColorPalette(rte, command) {
733 //function to display or hide color palettes
735 //get dialog position
736 var oDialog = document.getElementById('cp' + rte);
737 var buttonElement = document.getElementById(command+"_"+rte);
738 var iLeftPos = buttonElement.offsetLeft+5;
739 var iTopPos = buttonElement.offsetTop+53;
740 if (!document.getElementById('Buttons2_'+rte)){
741 iTopPos = iTopPos-28;
743 oDialog.style.left = iLeftPos + "px";
744 oDialog.style.top = iTopPos + "px";
746 if((command == parent.command)&&(rte == currentRTE)){
747 //if current command dialog is currently open, close it
748 if(oDialog.style.visibility == "hidden"){
749 showHideElement(oDialog, 'show', false);
751 showHideElement(oDialog, 'hide', false);
754 //if opening a new dialog, close all others
755 var vRTEs = allRTEs.split(";");
756 for(var i = 0; i<vRTEs.length; i++){
757 showHideElement('cp' + vRTEs[i], 'hide', false);
759 showHideElement(oDialog, 'show', false);
761 //save current values
763 parent.command = command;
766 function dlgLaunch(rte, command) {
767 var selectedText = '';
768 //save current values
769 parent.command = command;
773 InsertChar = popUpWin(includesPath+'insert_char.htm', 'InsertChar', 50, 50, 'status=yes,');
776 InsertTable = popUpWin(includesPath + 'insert_table.htm', 'InsertTable', 50, 50, 'status=yes,');
781 InsertImg = popUpWin(includesPath + 'insert_img.htm','AddImage', 50, 50, 'status=yes,');
784 selectedText = getText(rte);
785 InsertLink = popUpWin(includesPath + 'insert_link.htm', 'InsertLink', 50, 50, 'status=yes,');
786 setFormText("0", selectedText);
789 selectedText = getText(rte);
790 dlgReplace = popUpWin(includesPath + 'replace.htm', 'dlgReplace', 50, 50, 'status=yes,');
791 setFormText("1", selectedText);
794 dlgPasteText = popUpWin(includesPath + 'paste_text.htm', 'dlgPasteText', 50, 50, 'status=yes,');
797 dlgPasteWord = popUpWin(includesPath + 'paste_word.htm', 'dlgPasteWord', 50, 50, 'status=yes,');
802 function getText(rte) {
803 //get currently highlighted text and set link text value
807 rtn = stripHTML(rng.htmlText);
809 rtn = stripHTML(rng.toString());
813 rtn = rtn.replace("'","\\\\\\'");
815 rtn = rtn.replace("'","\\'");
820 function setFormText(popup, content){
821 //set link text value in dialog windows
822 if(content != "undefined")
826 case "0": InsertLink.document.getElementById("linkText").value = content; break;
827 case "1": dlgReplace.document.getElementById("searchText").value = content; break;
830 //may take some time to create dialog window.
831 //Keep looping until able to set.
832 setTimeout("setFormText('"+popup+"','" + content + "');", 10);
837 function dlgCleanUp(){
838 var vRTEs = allRTEs.split(";");
839 for(var i = 0; i < vRTEs.length; i++){
840 showHideElement('cp' + vRTEs[i], 'hide', false);
842 if(InsertChar != null){
846 if(InsertTable != null){
850 if(InsertLink != null){
854 if(InsertImg != null){
858 if(dlgReplace != null){
862 if(dlgPasteText != null){
863 dlgPasteText.close();
866 if(dlgPasteWord != null){
867 dlgPasteWord.close();
872 function popUpWin (url, win, width, height, options) {
874 var leftPos = (screen.availWidth - width) / 2;
875 var topPos = (screen.availHeight - height) / 2;
876 options += 'width=' + width + ',height=' + height + ',left=' + leftPos + ',top=' + topPos;
877 return window.open(url, win, options);
880 function setColor(color) {
881 //function to set color
882 var rte = currentRTE;
883 var parentCommand = parent.command;
885 if(parentCommand == "hilitecolor"){
886 parentCommand = "backcolor";
888 //retrieve selected range
891 rteCommand(rte, parentCommand, color);
892 showHideElement('cp'+rte, "hide", false);
895 function addImage(rte) {
897 //function to add image
898 imagePath = prompt('Enter Image URL:', 'http://');
899 if((imagePath != null)&&(imagePath != "")){
900 rteCommand(rte, 'InsertImage', imagePath);
904 function rtePrint(rte) {
907 document.getElementById(rte).contentWindow.document.execCommand('Print');
909 document.getElementById(rte).contentWindow.print();
913 function selectFont(rte, selectname){
914 //function to handle font changes
915 var idx = document.getElementById(selectname).selectedIndex;
916 // First one is always a label
918 var selected = document.getElementById(selectname).options[idx].value;
919 var cmd = selectname.replace('_'+rte, '');
920 rteCommand(rte, cmd, selected);
921 document.getElementById(selectname).selectedIndex = 0;
925 function insertHTML(html){
926 //function to add HTML -- thanks dannyuk1982
927 var rte = currentRTE;
928 var oRTE = returnRTE(rte);
931 var oRng = oRTE.document.selection.createRange();
932 oRng.pasteHTML(html);
933 oRng.collapse(false);
936 oRTE.document.execCommand('insertHTML', false, html);
940 function replaceHTML(tmpContent, searchFor, replaceWith) {
945 while(tmpContent.toUpperCase().indexOf(searchFor.toUpperCase()) > -1) {
946 runCount = runCount+1;
947 // Get all content before the match
948 intBefore = tmpContent.toUpperCase().indexOf(searchFor.toUpperCase());
949 tmpBefore = tmpContent.substring(0, intBefore);
950 tmpOutput = tmpOutput + tmpBefore;
951 // Get the string to replace
952 tmpOutput = tmpOutput + replaceWith;
953 // Get the rest of the content after the match until
954 // the next match or the end of the content
955 intAfter = tmpContent.length - searchFor.length + 1;
956 tmpContent = tmpContent.substring(intBefore + searchFor.length);
958 return runCount+"|^|"+tmpOutput+tmpContent;
961 function replaceSpecialChars(html){
962 var specials = new Array("¢","€","£","¤","¥","©","®","™","÷","×","±","¼","½","¾","°","¹","²","³","µ","«","»","‘","’","‹","›","‚","„","“","”","¡","¦","§","¬","¯","¶","·","¸","¿","ƒ","—","–","•","…","‰","ª","º","ß","†","‡","ð","Ð","ø","Ø","þ","Þ","œ","Œ","š","Š","´","ˆ","˜","¨","à","á","â","ã","ä","å","æ","À","Á","Â","Ã","Ä","Å","Æ","ç","Ç","è","é","ê","ë","È","É","Ê","Ë","ì","í","î","ï","Ì","Í","Î","Ï","ñ","Ñ","ò","ó","ô","õ","ö","Ò","Ó","Ô","Õ","Ö","ù","ú","û","ü","Ù","Ú","Û","Ü","ý","ÿ","Ý","Ÿ");
963 var unicodes = new Array("\u00a2","\u20ac","\u00a3","\u00a4","\u00a5","\u00a9","\u00ae","\u2122","\u00f7","\u00d7","\u00b1","\u00bc","\u00bd","\u00be","\u00b0","\u00b9","\u00b2","\u00b3","\u00b5","\u00ab","\u00bb","\u2018","\u2019","\u2039","\u203a","\u201a","\u201e","\u201c","\u201d","\u00a1","\u00a6","\u00a7","\u00ac","\u00af","\u00b6","\u00b7","\u00b8","\u00bf","\u0192","\u2014","\u2013","\u2022","\u2026","\u2030","\u00aa","\u00ba","\u00df","\u2020","\u2021","\u00f0","\u00d0","\u00f8","\u00d8","\u00fe","\u00de","\u0153","\u0152","\u0161","\u0160","\u00b4","\u02c6","\u02dc","\u00a8","\u00e0","\u00e1","\u00e2","\u00e3","\u00e4","\u00e5","\u00e6","\u00c0","\u00c1","\u00c2","\u00c3","\u00c4","\u00c5","\u00c6","\u00e7","\u00c7","\u00e8","\u00e9","\u00ea","\u00eb","\u00c8","\u00c9","\u00ca","\u00cb","\u00ec","\u00ed","\u00ee","\u00ef","\u00cc","\u00cd","\u00ce","\u00cf","\u00f1","\u00d1","\u00f2","\u00f3","\u00f4","\u00f5","\u00f6","\u00d2","\u00d3","\u00d4","\u00d5","\u00d6","\u00f9","\u00fa","\u00fb","\u00fc","\u00d9","\u00da","\u00db","\u00dc","\u00fd","\u00ff","\u00dd","\u0178");
964 for(var i=0; i<specials.length; i++){
965 html = replaceIt(html,unicodes[i],specials[i]);
970 function SearchAndReplace(searchFor, replaceWith, matchCase, wholeWord) {
971 var cfrmMsg = lblSearchConfirm.replace("SF",searchFor).replace("RW",replaceWith);
972 var rte = currentRTE;
973 stripGuidelines(rte);
974 var oRTE = returnRTE(rte);
975 var tmpContent = oRTE.document.body.innerHTML.replace("'", "\'").replace('"', '\"');
977 if (matchCase && wholeWord) {
978 strRegex = "/(?!<[^>]*)(\\b(" + searchFor + ")\\b)(?![^<]*>)/g";
980 else if (matchCase) {
981 strRegex = "/(?!<[^>]*)(" + searchFor + ")(?![^<]*>)/g";
983 else if (wholeWord) {
984 strRegex = "/(?!<[^>]*)(\\b(" + searchFor + ")\\b)(?![^<]*>)/gi";
986 strRegex = "/(?!<[^>]*)(" + searchFor + ")(?![^<]*>)/gi";
988 var cmpRegex=eval(strRegex);
990 var tmpNext = tmpContent;
991 var intFound = tmpNext.search(cmpRegex);
992 while(intFound > -1) {
993 runCount = runCount+1;
994 tmpNext = tmpNext.substr(intFound + searchFor.length);
995 intFound = tmpNext.search(cmpRegex);
998 cfrmMsg = cfrmMsg.replace("[RUNCOUNT]",runCount);
999 if(confirm(cfrmMsg)) {
1000 tmpContent=tmpContent.replace(cmpRegex,replaceWith);
1001 oRTE.document.body.innerHTML = tmpContent.replace("\'", "'").replace('\"', '"');
1003 alert(lblSearchAbort);
1005 showGuidelines(rte);
1008 showGuidelines(rte);
1009 alert("["+searchFor+"] "+lblSearchNotFound);
1013 function showHideElement(element, showHide, rePosition){
1014 //function to show or hide elements
1015 //element variable can be string or object
1016 if(document.getElementById(element)){
1017 element = document.getElementById(element);
1019 if(showHide == "show"){
1020 element.style.visibility = "visible";
1022 element.style.position = "relative";
1023 element.style.left = "auto";
1024 element.style.top = "auto";
1026 }else if(showHide == "hide"){
1027 element.style.visibility = "hidden";
1029 element.style.position = "absolute";
1030 element.style.left = "-1000px";
1031 element.style.top = "-1000px";
1036 function setRange(rte){
1037 //function to store range of current selection
1038 var oRTE = returnRTE(rte);
1041 selection = oRTE.document.selection;
1042 if(selection != null){
1043 rng = selection.createRange();
1046 selection = oRTE.getSelection();
1047 rng = selection.getRangeAt(selection.rangeCount - 1).cloneRange();
1052 function stripHTML(strU) {
1054 var strN = strU.replace(/(<([^>]+)>)/ig,"");
1055 //replace carriage returns and line feeds
1056 strN = strN.replace(/\r\n/g," ");
1057 strN = strN.replace(/\n/g," ");
1058 strN = strN.replace(/\r/g," ");
1063 function trim(inputString) {
1064 if (typeof inputString != "string"){
1067 inputString = inputString.replace(/^\s+|\s+$/g, "").replace(/\s{2,}/g, "");
1071 function showGuidelines(rte) {
1072 if(rte.length == 0) rte = currentRTE;
1073 var oRTE = returnRTE(rte);
1074 var tables = oRTE.document.getElementsByTagName("table");
1075 var sty = "dashed 1px "+zeroBorder;
1076 for(var i=0; i<tables.length; i++){
1077 if(tables[i].getAttribute("border") == 0){
1079 var trs = tables[i].getElementsByTagName("tr");
1080 for(var j=0; j<trs.length; j++){
1081 var tds = trs[j].getElementsByTagName("td");
1082 for(var k=0; k<tds.length; k++){
1083 if(j == 0 && k == 0){
1084 tds[k].style.border = sty;
1085 }else if(j == 0 && k != 0){
1086 tds[k].style.borderBottom = sty;
1087 tds[k].style.borderTop = sty;
1088 tds[k].style.borderRight = sty;
1089 }else if(j != 0 && k == 0) {
1090 tds[k].style.borderBottom = sty;
1091 tds[k].style.borderLeft = sty;
1092 tds[k].style.borderRight = sty;
1093 }else if(j != 0 && k != 0) {
1094 tds[k].style.borderBottom = sty;
1095 tds[k].style.borderRight = sty;
1100 tables[i].removeAttribute("border");
1101 tables[i].setAttribute("style","border: " + sty);
1102 tables[i].setAttribute("rules", "all");
1108 function stripGuidelines(rte) {
1109 var oRTE = returnRTE(rte);
1110 var tbls = oRTE.document.getElementsByTagName("table");
1111 for(var j=0; j<tbls.length; j++) {
1112 if(tbls[j].getAttribute("border") == 0 || tbls[j].getAttribute("border") == null){
1114 var tds = tbls[j].getElementsByTagName("td");
1115 for(var k=0; k<tds.length; k++) {
1116 tds[k].removeAttribute("style");
1119 tbls[j].removeAttribute("style");
1120 tbls[j].removeAttribute("rules");
1121 tbls[j].setAttribute("border","0");
1127 function findSize(obj) {
1128 if(obj.length > 0 && document.all) {
1130 } else if(obj.length > 0 && !document.all) {
1131 obj = document.getElementById(obj).contentWindow;
1135 if ( typeof( obj.window.innerWidth ) == 'number' ) {
1137 obj_width = obj.window.innerWidth;
1138 obj_height = obj.window.innerHeight;
1139 } else if( obj.document.documentElement && ( obj.document.documentElement.clientWidth || obj.document.documentElement.clientHeight ) ) {
1140 //IE 6+ in 'standards compliant mode'
1141 obj_width = document.documentElement.clientWidth;
1142 obj_height = document.documentElement.clientHeight;
1143 } else if( obj.document.body && ( obj.document.body.clientWidth || obj.document.body.clientHeight ) ) {
1145 obj_width = obj.document.body.clientWidth;
1146 obj_height = obj.document.body.clientHeight;
1150 function resizeRTE() {
1151 document.body.style.overflow = "hidden";
1152 var rte = currentRTE;
1153 var oRTE = document.getElementById(rte);
1154 var oBut1 = document.getElementById('Buttons1_'+rte);
1156 var oVS = document.getElementById('vs'+rte);
1159 if (width < minWidth){
1160 document.body.style.overflow = "auto";
1163 var height = obj_height - 83;
1164 if (document.getElementById("_xtSrc"+rte).innerHTML == lblModeRichText){
1165 height = obj_height-28;
1166 if (!document.getElementById('Buttons2_'+rte) && width < wrapWidth) {
1167 document.body.style.overflow = "auto";
1170 if (document.getElementById('Buttons2_'+rte)){
1171 document.getElementById('Buttons2_'+rte).style.width = width;
1174 if (document.getElementById('Buttons2_'+rte)) {
1175 document.getElementById('Buttons2_'+rte).style.width = width;
1177 height = obj_height - 55;
1178 if(width < wrapWidth){
1179 document.body.style.overflow = "auto";
1184 if(document.body.style.overflow == "auto" && isIE){
1187 if(document.body.style.overflow == "auto" && !isIE){
1190 oBut1.style.width = width;
1191 oVS.style.width = width;
1192 oRTE.style.width = width-2;
1193 oRTE.style.height = height;
1195 oRTE.contentDocument.designMode = "on";
1199 function replaceIt(string,text,by) {
1200 // CM 19/10/04 custom replace function
1201 var strLength = string.length, _xtLength = text.length;
1202 if ((strLength == 0) || (_xtLength == 0)){
1205 var i = string.indexOf(text);
1206 if ((!i) && (text != string.substring(0,_xtLength))){
1212 var newstr = string.substring(0,i) + by;
1213 if(i+_xtLength < strLength){
1214 newstr += replaceIt(string.substring(i+_xtLength,strLength),text,by);
1219 function countWords(rte){
1221 var words = document.getElementById("hdn"+rte).value;
1222 var str = stripHTML(words);
1223 var chars = trim(words);
1224 chars = chars.length;
1225 chars = maxchar - chars;
1226 str = str+" a "; // word added to avoid error
1227 str = trim(str.replace(/ /gi,' ').replace(/([\n\r\t])/g,' ').replace(/&(.*);/g,' '));
1229 for(x=0;x<str.length;x++){
1230 if(str.charAt(x)==" " && str.charAt(x-1)!=" "){
1234 if(str.charAt(str.length-1) != " "){
1237 count = count - 1; // extra word removed
1240 alarm = "\n\n"+lblCountCharWarn;
1242 alert(lblCountTotal+": "+count+ "\n\n"+lblCountChar+": "+chars+alarm);
1245 //********************
1246 // Non-designMode() Functions
1247 //********************
1248 function autoBRon(rte) {
1249 // CM 19/10/04 used for non RTE browsers to deal with auto <BR> (and clean up other muck)
1250 var oRTE = document.forms[0].elements[rte];
1251 oRTE.value=parseBreaks(oRTE.value);
1252 oRTE.value=replaceIt(oRTE.value,''','\'');
1255 function autoBRoff(rte) {
1256 // CM 19/10/04 used for non RTE browsers to deal with auto <BR> (auto carried out when the form is submitted)
1257 var oRTE = document.forms[0].elements[rte];
1258 oRTE.value=replaceIt(oRTE.value,'\n','<br />');
1259 oRTE.value=replaceIt(oRTE.value,'\'',''');
1262 function parseBreaks(argIn) {
1263 // CM 19/10/04 used for non RTE browsers to deal with auto <BR> (and clean up other muck)
1264 argIn=replaceIt(argIn,'<br>','\n');
1265 argIn=replaceIt(argIn,'<BR>','\n');
1266 argIn=replaceIt(argIn,'<br/>','\n');
1267 argIn=replaceIt(argIn,'<br />','\n');
1268 argIn=replaceIt(argIn,'\t',' ');
1269 argIn=replaceIt(argIn,'\n ','\n');
1270 argIn=replaceIt(argIn,' <p>','<p>');
1271 argIn=replaceIt(argIn,'</p><p>','\n\n');
1272 argIn=replaceIt(argIn,''','\'');
1273 argIn = trim(argIn);
1277 //********************
1278 //Gecko-Only Functions
1279 //********************
1280 function geckoKeyPress(evt) {
1281 //function to add bold, italic, and underline shortcut commands to gecko RTEs
1282 //contributed by Anti Veeranna (thanks Anti!)
1283 var rte = evt.target.id;
1285 var key = String.fromCharCode(evt.charCode).toLowerCase();
1288 case 'b': cmd = "bold"; break;
1289 case 'i': cmd = "italic"; break;
1290 case 'u': cmd = "underline"; break;
1293 rteCommand(rte, cmd, null);
1294 // stop the event bubble
1295 evt.preventDefault();
1296 evt.stopPropagation();
1304 function checkspell() {
1306 //function to perform spell check
1308 var tmpis = new ActiveXObject("ieSpell.ieSpellExtension");
1309 tmpis.CheckAllLinkedDocuments(document);
1312 if(exception.number==-2146827859) {
1313 if(confirm("ieSpell not detected. Click Ok to go to download page.")){
1314 window.open("http://www.iespell.com/download.php","DownLoad");
1317 alert("Error Loading ieSpell: Exception " + exception.number);