'
var editorHTMLContent=""
+(editor_cssFile?'\n':'')
+''
+'\n'+taContent+'\n';try{editor_cW=$('#'+editor_IFrame)[0].contentWindow;}catch(e){alert('unable to set editor_cW');};editor_d=editor_cW.document;try{editor_d.designMode='on';}catch(e){setTimeout("editor_d.designMode='on';",10);};editor_d.open();editor_d.write(editorHTMLContent);editor_d.close();$(editor_jqTextbox).css('zIndex',2).hide();$('#'+editor_HTML).show();try{if(editor_cW.addEventListener)
editor_cW.addEventListener('keypress',editor_keyboard,true);else{editor_d.body.attachEvent('onpaste',function(){setTimeout('editor_cleanUp()',20);});}}catch(e){};editor_jqTextbox=null;}
function editor_hide(editor_TA){editor_setactive(editor_TA,1);if(editor_Idx>-1)
$('#'+editor_HTML).hide();};function editor_destroy(editor_TA,idForm){editor_setactive(editor_TA,1);if(editor_Idx>-1){try{if(idForm!=''&&idForm!=undefined)$('#'+idForm).bind('submit',syncTextarea);$('#'+editor_HTML).hide();$(editor_jqTextbox).show();try{editor_d.designMode='off';}catch(e){}
$('#'+editor_HTML).replaceWith('');aEditorsList[editor_Idx]='';editor_HTML=null;editor_IFrame=null;editor_IFrameContent=null;editor_PromptDialog=null;editor_cW=null;editor_d=null;editor_Idx=null;}catch(e){};};};function editor_syncall(){for(var i=0;i-1){var t=(window.get_xhtml)?get_xhtml(editor_cW.document.body.innerHTML):editor_cW.document.body.innerHTML;$(editor_jqTextbox).val(editor_cleanup_after_designmode(t));if(nClearHTML==1){editor_cW.document.execCommand('selectall',false,null);editor_cW.document.execCommand('delete',false,null);};};};function editor_html_set(editor_TA,sHTML,nAppend){editor_setactive(editor_TA);if(editor_Idx>-1){editor_cW.document.body.innerHTML=(nAppend==1?editor_cW.document.body.innerHTML:'')+sHTML;};};function editor_resize(editor_TA){editor_jqTextbox='#'+editor_TA;if(!$(editor_jqTextbox).css('rows')<5)$(editor_jqTextbox).css('rows','15');var taWidth=$(editor_jqTextbox).css('width')?$(editor_jqTextbox).css('width'):$(editor_jqTextbox)[0].cols+"ex";var taHeight=$(editor_jqTextbox).css('height')?$(editor_jqTextbox).css('height'):$(editor_jqTextbox)[0].rows+"em";$('#'+editor_HTML).css('width',taWidth).css('height',taHeight);$('#'+editor_idMenu).css('width',taWidth);$('#'+editor_IFrame).css('width',taWidth).css('height',(parseInt(taHeight)-18));};function editor_focus(editor_TA){editor_setactive(editor_TA);};function editor_bold(editor_Idx){editor_setactive(editor_Idx);editor_cmd('bold',false);}
function editor_italic(editor_Idx){editor_setactive(editor_Idx);editor_cmd('italic',false);}
function editor_color(editor_Idx){editor_setactive(editor_Idx);var sColorPicker=editor_colorpicker('editor_setcolor');editor_setdialog('Font Color: '+sColorPicker,100,100);}
function editor_setcolor(sColor){editor_hidedialog();if(rng)rng.select();editor_cW.document.execCommand('forecolor',false,sColor);editor_cW.focus();};function editor_hilite(editor_Idx){editor_setactive(editor_Idx);var sColorPicker=editor_colorpicker('editor_hilitecolor');editor_setdialog('Font Color: '+sColorPicker,100,100);}
function editor_hilitecolor(sColor){editor_hidedialog();if(rng)rng.select();if(!$.browser.msie){try{editor_cW.document.execCommand('hilitecolor',false,sColor);}catch(e){editor_cW.document.execCommand('backcolor',false,sColor);};}else{editor_cW.document.execCommand('backcolor',false,sColor);};editor_cW.focus();};function editor_style(editor_Idx){editor_setactive(editor_Idx);var sStyle='';var sStyleName='';var sStyleHTML='';var aStyles=editor_styles.split(',');for(i=0;i'+sStyleName+'
-
';};editor_setdialog('Styles: '+sStyleHTML,150,130);}
function editor_styleset(sStyle){editor_hidedialog();if(sStyle!='user_normal')
editor_insertHTML("");else
editor_cW.document.execCommand('removeformat',false,null);};function editor_showhtml(editor_Idx){editor_setactive(editor_Idx);$('#'+editor_IFrameContent).html(editor_cleanup4designmode($('#'+editor_TA).val()));$('#'+editor_TA).hide();$('#'+editor_HTML).show();$('#'+editor_IFrame).show();try{editor_d.designMode='on';}catch(e){setTimeout('editor_d.designMode=\'on\';',100);}
editor_cW.focus();}
function editor_showtext(editor_Idx){editor_setactive(editor_Idx);var t=(window.get_xhtml)?get_xhtml(editor_cW.document.body.innerHTML):editor_cW.document.body.innerHTML;$(editor_jqTextbox).val(editor_cleanup_after_designmode(t));$('#'+editor_HTML).hide();$('#'+editor_IFrame).hide();$('#'+editor_TA).show();$('#'+editor_TA)[0].focus();}
function editor_setdialog(sHTML,nWidth,nHeight){$('#'+editor_PromptDialog).html("
');}}
function editor_textbox_insert(html){if(html!=''){var close_tag='';if(html.indexOf('<')==0&&html.indexOf('br')!=1&&html.indexOf('img')!=1)
close_tag=html.replace(/<([a-z0-6]+).*/,"<\/$1>");if(html!=''&&html!='')close_tag+='\n';if(document.selection){sel=document.selection.createRange();sel.text=html+sel.text+close_tag;}else{before=$(editor_jqTextbox)[0].value.slice(0,$(editor_jqTextbox)[0].selectionStart);sel=$(editor_jqTextbox)[0].value.slice($(editor_jqTextbox)[0].selectionStart,$(editor_jqTextbox)[0].selectionEnd);after=$(editor_jqTextbox)[0].value.slice($(editor_jqTextbox)[0].selectionEnd);$(editor_jqTextbox)[0].value=before+html+sel+close+after;$(editor_jqTextbox)[0].focus();}};};function editor_insertHTML(html){if(html!=''){try{if(sel.type&&sel.type!="Text")sel="";editor_cW.document.execCommand("inserthtml",false,html+sel);}catch(e){if(document.selection)
if(papa&&papa.nodeName=='IMG'){papa.outerHTML=html;}
else
if(rng){rng.select();rng.pasteHTML(html+rng.htmlText);}}}
editor_cursorpos();}
function editor_cursorpos(e){if(!e)var e=window.event;if(window.getSelection){sel=editor_cW.getSelection();papa=(e&&e.type=='mouseup')?e.target:(sel.anchorNode.nodeName=='#text')?sel.anchorNode.parentNode:sel.anchorNode;}else{sel=editor_cW.document.selection;rng=sel.createRange();papa=(e&&e.type=='mouseup')?e.srcElement:(sel.type=="Control")?rng.item(0):rng.parentElement();}
var paNode=papa;trail=papa.nodeName;while(!paNode.nodeName.match(/^(HTML|BODY)/)&&paNode.className!="htmleditor_button"){paNode=paNode.parentNode;trail=paNode.nodeName+'>'+trail;}
if(paNode.className=="htmleditor_button")trail=sel=rng=null;var id=paNode.nodeName=="HTML"?paNode.getElementsByTagName("BODY")[0].id:paNode.id.replace("CONTROL","");}
function textSel(){if(sel&&sel.type!="None"){return true;}else{alert(t("First highlight text for this"));return false;}}
function doDbl(){if(papa.nodeName=='IMG')doImage();else if(papa.nodeName=='A')doLink();}
function fGo(id){return'