if(typeof _editor_url=="string"){_editor_url=_editor_url.replace(/\x2f*$/,"/")}else{alert("WARNING: _editor_url is not set!  You should set this variable to the editor files path; it should preferably be an absolute path, like in '/htmlarea', but it can be relative if you prefer.  Further we will try to load the editor files correctly but we'll probably fail.");_editor_url=""}if(typeof _editor_lang=="string"){_editor_lang=_editor_lang.toLowerCase()}else{_editor_lang="en"}function HTMLArea(A,B){if(HTMLArea.checkSupportedBrowser()){if(typeof B=="undefined"){this.config=new HTMLArea.Config()}else{this.config=B}this._htmlArea=null;this._textArea=A;this._editMode="wysiwyg";this.plugins={};this._timerToolbar=null;this._timerUndo=null;this._undoQueue=new Array(this.config.undoSteps);this._undoPos=-1;this._customUndo=false;this._mdoc=document;this.doctype="";this.catchingEventFuncString="";this.isCompleteInitialize=false;this.isCompleteCreateIframe=false;this.colorDefault=""}}(function(){var A=HTMLArea._scripts=[_editor_url+"htmlarea.js",_editor_url+"dialog.js",_editor_url+"popupwin.js",_editor_url+"lang/"+_editor_lang+".js"];var B=document.getElementsByTagName("head")[0]})();HTMLArea.RE_tagName=/(<\/|<)\s*([^ \t\n>]+)/ig;HTMLArea.RE_doctype=/(<!doctype((.|\n)*?)>)\n?/i;HTMLArea.RE_head=/<head>((.|\n)*?)<\/head>/i;HTMLArea.RE_body=/<body>((.|\n)*?)<\/body>/i;HTMLArea.Config=function(){this.version="3.0";this.width="auto";this.height="auto";this.statusBar=true;this.undoSteps=20;this.undoTimeout=500;this.sizeIncludesToolbar=true;this.fullPage=false;this.pageStyle="";this.killWordOnPaste=false;this.baseURL="";if(this.baseURL&&this.baseURL.match(/(.*)\/([^\/]+)/)){this.baseURL=RegExp.$1+"/"}this.imgURL="images/";this.popupURL="popups/";this.basictoolbar=[["fontsize","space","bold","italic","underline","separator","justifyleft","justifycenter","justifyright","justifyfull","htmlmode","fulltoolbar"]];this.fulltoolbar=[["fontname","space","fontsize","space","formatblock","space","bold","italic","underline","strikethrough","separator","subscript","superscript","separator","copy","cut","paste","space","undo","redo"],["justifyleft","justifycenter","justifyright","justifyfull","separator","lefttoright","righttoleft","separator","insertorderedlist","insertunorderedlist","outdent","indent","separator","forecolor","hilitecolor","separator","inserthorizontalrule","createlink","insertimage","inserttable","htmlmode","lesstoolbar"]];var D=false;if(typeof _editor_hasMultiModes!="undefined"){if(_editor_hasMultiModes){D=true}}if(D){this.toolbar=this.basictoolbar}else{this.toolbar=this.fulltoolbar}this.fontname={Arial:"arial,helvetica,sans-serif","Courier New":"courier new,courier,monospace",Georgia:"georgia,times new roman,times,serif",Tahoma:"tahoma,arial,helvetica,sans-serif","Times New Roman":"times new roman,times,serif",Verdana:"verdana,arial,helvetica,sans-serif",impact:"impact",WingDings:"wingdings"};this.fontsize={"1 (8 pt)":"1","2 (10 pt)":"2","3 (12 pt)":"3","4 (14 pt)":"4","5 (18 pt)":"5","6 (24 pt)":"6","7 (36 pt)":"7"};this.formatblock={"Heading 1":"h1","Heading 2":"h2","Heading 3":"h3","Heading 4":"h4","Heading 5":"h5","Heading 6":"h6",Normal:"p",Address:"address",Formatted:"pre"};this.customSelects={};function A(G,E,F){G.execCommand(E)}this.btnList={lesstoolbar:["Basic Toolbar","ed_full_toolbar.gif",false,function(E){E.execCommand("lesstoolbar")}],fulltoolbar:["Full Toolbar","ed_full_toolbar.gif",false,function(E){E.execCommand("fulltoolbar")}],bold:["Bold","ed_format_bold.gif",false,function(E){E.execCommand("bold")}],italic:["Italic","ed_format_italic.gif",false,function(E){E.execCommand("italic")}],underline:["Underline","ed_format_underline.gif",false,function(E){E.execCommand("underline")}],strikethrough:["Strikethrough","ed_format_strike.gif",false,function(E){E.execCommand("strikethrough")}],subscript:["Subscript","ed_format_sub.gif",false,function(E){E.execCommand("subscript")}],superscript:["Superscript","ed_format_sup.gif",false,function(E){E.execCommand("superscript")}],justifyleft:["Justify Left","ed_align_left.gif",false,function(E){E.execCommand("justifyleft")}],justifycenter:["Justify Center","ed_align_center.gif",false,function(E){E.execCommand("justifycenter")}],justifyright:["Justify Right","ed_align_right.gif",false,function(E){E.execCommand("justifyright")}],justifyfull:["Justify Full","ed_align_justify.gif",false,function(E){E.execCommand("justifyfull")}],insertorderedlist:["Ordered List","ed_list_num.gif",false,function(E){E.execCommand("insertorderedlist")}],insertunorderedlist:["Bulleted List","ed_list_bullet.gif",false,function(E){E.execCommand("insertunorderedlist")}],outdent:["Decrease Indent","ed_indent_less.gif",false,function(E){E.execCommand("outdent")}],indent:["Increase Indent","ed_indent_more.gif",false,function(E){E.execCommand("indent")}],forecolor:["Font Color","ed_color_fg.gif",false,function(E){E.execCommand("forecolor")}],hilitecolor:["Background Color","ed_color_bg.gif",false,function(E){E.execCommand("hilitecolor")}],inserthorizontalrule:["Horizontal Rule","ed_hr.gif",false,function(E){E.execCommand("inserthorizontalrule")}],createlink:["Insert Web Link","ed_link.gif",false,function(E){E.execCommand("createlink",true)}],insertimage:["Insert/Modify Image","ed_image.gif",false,function(E){E.execCommand("insertimage")}],inserttable:["Insert Table","insert_table.gif",false,function(E){E.execCommand("inserttable")}],htmlmode:["Toggle HTML Source","ed_html.gif",true,function(E){E.execCommand("htmlmode")}],undo:["Undoes your last action","ed_undo.gif",false,function(E){E.execCommand("undo")}],redo:["Redoes your last action","ed_redo.gif",false,function(E){E.execCommand("redo")}],cut:["Cut selection","ed_cut.gif",false,A],copy:["Copy selection","ed_copy.gif",false,A],paste:["Paste from clipboard","ed_paste.gif",false,A],lefttoright:["Direction left to right","ed_left_to_right.gif",false,function(E){E.execCommand("lefttoright")}],righttoleft:["Direction right to left","ed_right_to_left.gif",false,function(E){E.execCommand("righttoleft")}]};for(var C in this.btnList){var B=this.btnList[C];B[1]=_editor_url+this.imgURL+B[1];if(typeof HTMLArea.I18N.tooltips[C]!="undefined"){B[0]=HTMLArea.I18N.tooltips[C]}}};HTMLArea.Config.prototype.registerButton=function(G,E,F,A,D,C){var B;if(typeof G=="string"){B=G}else{if(typeof G=="object"){B=G.id}else{alert("ERROR [HTMLArea.Config::registerButton]:\ninvalid arguments");return false}}if(typeof this.customSelects[B]!="undefined"){}if(typeof this.btnList[B]!="undefined"){}switch(typeof G){case"string":this.btnList[G]=[E,F,A,D,C];break;case"object":this.btnList[G.id]=[G.tooltip,G.image,G.textMode,G.action,G.context];break}};HTMLArea.Config.prototype.registerDropdown=function(A){if(typeof this.customSelects[A.id]!="undefined"){}if(typeof this.btnList[A.id]!="undefined"){}this.customSelects[A.id]=A};HTMLArea.Config.prototype.hideSomeButtons=function(B){var F=this.toolbar;for(var E in F){var C=F[E];for(var D=C.length;--D>=0;){if(B.indexOf(" "+C[D]+" ")>=0){var A=1;if(/separator|space/.test(C[D+1])){A=2}C.splice(D,A)}}}};HTMLArea.replaceAll=function(A){var C=document.getElementsByTagName("textarea");for(var B=C.length;B>0;(new HTMLArea(C[--B],A)).generate()){}};HTMLArea.replace=function(C,B){var A=HTMLArea.getElementById("textarea",C);return A?(new HTMLArea(A,B)).generate():null};HTMLArea.prototype._createToolbar=function(){var editor=this;var toolbar=document.createElement("div");this._toolbar=toolbar;toolbar.className="toolbar";if(typeof (editor.config)!="undefined"){toolbar.style.width=editor.config.width}if(this.colorDefault!=""){toolbar.style.backgroundColor=this.colorDefault}toolbar.unselectable="1";var tb_row=null;var tb_objects=new Object();this._toolbarObjects=tb_objects;function newLine(){var table=document.createElement("table");table.border="0px";table.cellSpacing="0px";table.cellPadding="0px";table.style.width="auto";toolbar.appendChild(table);var tb_body=document.createElement("tbody");table.appendChild(tb_body);tb_row=document.createElement("tr");tb_body.appendChild(tb_row)}newLine();function setButtonStatus(id,newval){var oldval=this[id];var el=this.element;if(oldval!=newval){switch(id){case"enabled":if(newval){HTMLArea._removeClass(el,"buttonDisabled");el.disabled=false}else{HTMLArea._addClass(el,"buttonDisabled");el.disabled=true}break;case"active":if(newval){HTMLArea._addClass(el,"buttonPressed")}else{HTMLArea._removeClass(el,"buttonPressed")}break}this[id]=newval}}function createSelect(txt){var options=null;var el=null;var cmd=null;var customSelects=editor.config.customSelects;var context=null;switch(txt){case"fontsize":case"fontname":case"formatblock":options=editor.config[txt];cmd=txt;break;default:cmd=txt;var dropdown=customSelects[cmd];if(typeof dropdown!="undefined"){options=dropdown.options;context=dropdown.context}else{alert("ERROR [createSelect]:\nCan't find the requested dropdown definition")}break}if(options){el=document.createElement("select");var obj={name:txt,element:el,enabled:true,text:false,cmd:cmd,state:setButtonStatus,context:context};tb_objects[txt]=obj;for(var i in options){var op=document.createElement("option");op.appendChild(document.createTextNode(i));op.value=options[i];el.appendChild(op)}HTMLArea._addEvent(el,"change",function(){editor._comboSelected(el,txt)})}return el}function createButton(txt){if(txt=="lesstoolbar"&&typeof _editor_hasMultiModes=="undefined"){return null}var el=null;var btn=null;switch(txt){case"separator":el=document.createElement("div");el.className="separator";break;case"space":el=document.createElement("div");el.className="space";break;case"linebreak":newLine();return false;case"textindicator":el=document.createElement("div");el.appendChild(document.createTextNode("A"));el.className="indicator";el.title=HTMLArea.I18N.tooltips.textindicator;var obj={name:txt,element:el,enabled:true,active:false,text:false,cmd:"textindicator",state:setButtonStatus};tb_objects[txt]=obj;break;default:btn=editor.config.btnList[txt]}if(!el&&btn){el=document.createElement("div");el.title=btn[0];el.className="button";if(this.colorDefault!=""){el.style.backgroundColor=this.colorDefault}var obj={name:txt,element:el,enabled:true,active:false,text:btn[2],cmd:btn[3],state:setButtonStatus,context:btn[4]||null};tb_objects[txt]=obj;HTMLArea._addEvent(el,"mouseover",function(){if(obj.enabled){HTMLArea._addClass(el,"buttonHover")}});HTMLArea._addEvent(el,"mouseout",function(){if(obj.enabled){with(HTMLArea){_removeClass(el,"buttonHover");_removeClass(el,"buttonActive");(obj.active)&&_addClass(el,"buttonPressed")}}});HTMLArea._addEvent(el,"mousedown",function(ev){if(obj.enabled){with(HTMLArea){_addClass(el,"buttonActive");_removeClass(el,"buttonPressed");_stopEvent(is_ie?window.event:ev)}}});HTMLArea._addEvent(el,"click",function(ev){if(obj.enabled){with(HTMLArea){_removeClass(el,"buttonActive");_removeClass(el,"buttonHover");obj.cmd(editor,obj.name,obj);_stopEvent(is_ie?window.event:ev)}}});var img=document.createElement("img");img.src=btn[1];img.style.width="18px";img.style.height="18px";var textNode=null;if(txt=="fulltoolbar"){textNode=document.createTextNode("More...")}else{if(txt=="lesstoolbar"){textNode=document.createTextNode("Less...")}}if(textNode){el.style.width="auto";el.style.color="#0000ff";el.appendChild(textNode);img.align="absmiddle"}else{el.appendChild(img)}}else{if(!el){el=createSelect(txt)}}if(el){var tb_cell=document.createElement("td");tb_row.appendChild(tb_cell);tb_cell.appendChild(el)}else{alert("FIXME: Unknown toolbar item: "+txt)}return el}var first=true;for(var i in this.config.toolbar){if(!first){createButton("linebreak")}else{first=false}var group=this.config.toolbar[i];for(var j in group){var code=group[j];if(/^([IT])\[(.*?)\]/.test(code)){var l7ed=RegExp.$1=="I";var label=RegExp.$2;if(l7ed){label=HTMLArea.I18N.custom[label]}var tb_cell=document.createElement("td");tb_row.appendChild(tb_cell);tb_cell.className="label";tb_cell.innerHTML=label}else{createButton(code)}}}if(!this._htmlArea.firstChild){this._htmlArea.appendChild(toolbar)}else{this._htmlArea.insertBefore(toolbar,this._htmlArea.firstChild)}};HTMLArea.prototype._createStatusBar=function(){var A=document.createElement("div");A.className="statusBar";if(this.colorDefault!=""){A.style.backgroundColor=this.colorDefault}if(typeof (editor.config)!="undefined"){A.style.width=editor.config.width}this._htmlArea.appendChild(A);this._statusBar=A;div=document.createElement("span");div.className="statusBarTree";if(this.colorDefault!=""){div.style.backgroundColor=this.colorDefault}div.innerHTML=HTMLArea.I18N.msg.Path+": ";this._statusBarTree=div;this._statusBar.appendChild(div);if(!this.config.statusBar){A.style.display="none"}};HTMLArea.prototype.generate=function(){var editor=this;var textarea=this._textArea;if(typeof textarea=="string"){this._textArea=textarea=HTMLArea.getElementById("textarea",textarea)}this._ta_size={w:textarea.offsetWidth,h:textarea.offsetHeight};textarea.style.display="none";var htmlarea=document.createElement("div");htmlarea.className="htmlarea";if(typeof (editor.config)!="undefined"){htmlarea.style.width=editor.config.width}this._htmlArea=htmlarea;textarea.parentNode.insertBefore(htmlarea,textarea);if(textarea.form){var f=textarea.form;if(typeof f.onsubmit=="function"){var funcref=f.onsubmit;if(typeof f.__msh_prevOnSubmit=="undefined"){f.__msh_prevOnSubmit=[]}f.__msh_prevOnSubmit.push(funcref)}f.onsubmit=function(){editor._textArea.value=editor.getInnerHTML();var a=this.__msh_prevOnSubmit;if(typeof a!="undefined"){for(var i in a){a[i]()}}}}window.onunload=function(){editor._textArea.value=editor.getInnerHTML()};this._createToolbar();var iframe=document.createElement("iframe");htmlarea.appendChild(iframe);this._iframe=iframe;this._createStatusBar();if(!HTMLArea.is_ie){iframe.style.borderWidth="1px"}var height=(this.config.height=="auto"?(this._ta_size.h+"px"):this.config.height);height=parseInt(height);var width=(this.config.width=="auto"?(this._ta_size.w+"px"):this.config.width);width=parseInt(width);if(!HTMLArea.is_ie){height-=2;width-=2}iframe.style.width=width+"px";if(this.config.sizeIncludesToolbar){height-=this._toolbar.offsetHeight;height-=this._statusBar.offsetHeight}if(height<0){height=0}iframe.style.height=height+"px";textarea.style.width=iframe.style.width;textarea.style.height=iframe.style.height;function initIframe(){var doc=editor._iframe.contentWindow.document;if(!doc){if(HTMLArea.is_gecko){setTimeout(initIframe,100);return false}else{alert("ERROR: IFRAME can't be initialized.")}}if(HTMLArea.is_gecko){doc.designMode="on"}editor._doc=doc;if(!editor.config.fullPage){doc.open();var html="<html>\n";html+="<head>\n";if(editor.config.baseURL){html+='<base href="'+editor.config.baseURL+'" />'}html+="<style> html,body { border: 0px; } "+editor.config.pageStyle+"</style>\n";html+="</head>\n";html+="<body>\n";html+=editor._textArea.value;html+="</body>\n";html+="</html>";doc.write(html);doc.close()}else{var html=editor._textArea.value;if(html.match(HTMLArea.RE_doctype)){editor.setDoctype(RegExp.$1);html=html.replace(HTMLArea.RE_doctype,"")}doc.open();doc.write(html);doc.close()}if(HTMLArea.is_ie){doc.body.contentEditable=true}HTMLArea._addEvents(doc,["keydown","keypress","mousedown","mouseup","drag"],function(event){if(editor.catchingEventFuncString!=""){eval(editor.catchingEventFuncString)}return editor._editorEvent(HTMLArea.is_ie?editor._iframe.contentWindow.event:event)});for(var i in editor.plugins){var plugin=editor.plugins[i].instance;if(typeof plugin.onGenerate=="function"){plugin.onGenerate()}}setTimeout(function(){editor.updateToolbar()},250);if(typeof editor.onGenerate=="function"){editor.onGenerate()}editor.isCompleteCreateIframe=true}setTimeout(initIframe,100)};HTMLArea.prototype.setMode=function(B){if(typeof B=="undefined"){B=((this._editMode=="textmode")?"wysiwyg":"textmode")}switch(B){case"textmode":this._textArea.value=this.getInnerHTML();this._iframe.style.display="none";this._textArea.style.display="block";if(this.config.statusBar){this._statusBar.innerHTML=HTMLArea.I18N.msg.TEXT_MODE}break;case"wysiwyg":if(HTMLArea.is_gecko){try{this._doc.designMode="off"}catch(A){}}if(!this.config.fullPage){this._doc.body.innerHTML="";this._doc.write(this.getHTML());this._doc.close()}else{this.setFullHTML(this.getHTML())}this._iframe.style.display="block";this._textArea.style.display="none";if(HTMLArea.is_gecko){try{this._doc.designMode="on"}catch(A){}}if(this.config.statusBar){this._statusBar.innerHTML="";this._statusBar.appendChild(document.createTextNode(HTMLArea.I18N.msg.Path+": "));this._statusBar.appendChild(this._statusBarTree)}break;default:alert("Mode <"+B+"> not defined!");return false}this._editMode=B;this.focusEditor()};HTMLArea.prototype.setFullHTML=function(C){var A=RegExp.multiline;RegExp.multiline=true;if(C.match(HTMLArea.RE_doctype)){this.setDoctype(RegExp.$1);C=C.replace(HTMLArea.RE_doctype,"")}RegExp.multiline=A;if(!HTMLArea.is_ie){if(C.match(HTMLArea.RE_head)){this._doc.getElementsByTagName("head")[0].innerHTML=RegExp.$1}if(C.match(HTMLArea.RE_body)){this._doc.getElementsByTagName("body")[0].innerHTML=RegExp.$1}}else{var B=/<html>((.|\n)*?)<\/html>/i;C=C.replace(B,"$1");this._doc.open();this._doc.write(C);this._doc.close();this._doc.body.contentEditable=true;return true}};HTMLArea.prototype.registerPlugin2=function(plugin,args){if(typeof plugin=="string"){plugin=eval(plugin)}var obj=new plugin(this,args);if(obj){var clone={};var info=plugin._pluginInfo;for(var i in info){clone[i]=info[i]}clone.instance=obj;clone.args=args;this.plugins[plugin._pluginInfo.name]=clone}else{alert("Can't register plugin "+plugin.toString()+".")}};HTMLArea.prototype.registerPlugin=function(){var C=arguments[0];var A=[];for(var B=1;B<arguments.length;++B){A.push(arguments[B])}this.registerPlugin2(C,A)};HTMLArea.loadPlugin=function(D){var A=_editor_url+"plugins/"+D;var C=D.replace(/([a-z])([A-Z])([a-z])/g,function(H,G,F,I){return G+"-"+F.toLowerCase()+I}).toLowerCase()+".js";var B=A+"/"+C;var E=A+"/lang/"+HTMLArea.I18N.lang+".js";HTMLArea._scripts.push(B,E);document.write("<script type='text/javascript' src='"+B+"'><\/script>");document.write("<script type='text/javascript' src='"+E+"'><\/script>")};HTMLArea.loadStyle=function(B,C){var A=_editor_url||"";if(typeof C!="undefined"){A+="plugins/"+C+"/"}A+=B;document.write("<style type='text/css'>@import url("+A+");</style>")};HTMLArea.loadStyle("htmlarea.css");HTMLArea.prototype._wordClean=function(){var A=this.getInnerHTML();if(A.indexOf("class=Mso")>=0){A=A.replace(/\r\n/g," ").replace(/\n/g," ").replace(/\r/g," ").replace(/\&nbsp\;/g," ");A=A.replace(/ class=[^\s|>]*/gi,"").replace(/ style=\"[^>]*\"/gi,"").replace(/ align=[^\s|>]*/gi,"");A=A.replace(/<b [^>]*>/gi,"<b>").replace(/<i [^>]*>/gi,"<i>").replace(/<li [^>]*>/gi,"<li>").replace(/<ul [^>]*>/gi,"<ul>");A=A.replace(/<b>/gi,"<strong>").replace(/<\/b>/gi,"</strong>");A=A.replace(/<em>/gi,"<i>").replace(/<\/em>/gi,"</i>");A=A.replace(/<\?xml:[^>]*>/g,"").replace(/<\/?st1:[^>]*>/g,"").replace(/<\/?[a-z]\:[^>]*>/g,"").replace(/<\/?font[^>]*>/gi,"").replace(/<\/?span[^>]*>/gi," ").replace(/<\/?div[^>]*>/gi," ").replace(/<\/?pre[^>]*>/gi," ").replace(/<\/?h[1-6][^>]*>/gi," ");oldlen=A.length+1;while(oldlen>A.length){oldlen=A.length;A=A.replace(/<([a-z][a-z]*)> *<\/\1>/gi," ").replace(/<([a-z][a-z]*)> *<([a-z][^>]*)> *<\/\1>/gi,"<$2>")}A=A.replace(/<([a-z][a-z]*)><\1>/gi,"<$1>").replace(/<\/([a-z][a-z]*)><\/\1>/gi,"</$1>");A=A.replace(/  */gi," ");this.setHTML(A);this.updateToolbar()}};HTMLArea.prototype.forceRedraw=function(){this._doc.body.style.visibility="hidden";this._doc.body.style.visibility="visible"};HTMLArea.prototype.focusEditor=function(){switch(this._editMode){case"wysiwyg":this._iframe.contentWindow.focus();break;case"textmode":this._textArea.focus();break;default:alert("ERROR: mode "+this._editMode+" is not defined")}return this._doc};HTMLArea.prototype._undoTakeSnapshot=function(){++this._undoPos;if(this._undoPos>=this.config.undoSteps){this._undoQueue.shift();--this._undoPos}var B=true;var A=this.getInnerHTML();if(this._undoPos>0){B=(this._undoQueue[this._undoPos-1]!=A)}if(B){this._undoQueue[this._undoPos]=A}else{this._undoPos--}};HTMLArea.prototype.undo=function(){if(this._undoPos>0){var A=this._undoQueue[--this._undoPos];if(A){this.setHTML(A)}else{++this._undoPos}}};HTMLArea.prototype.redo=function(){if(this._undoPos<this._undoQueue.length-1){var A=this._undoQueue[++this._undoPos];if(A){this.setHTML(A)}else{--this._undoPos}}};HTMLArea.prototype.updateToolbar=function(noStatus){var doc=this._doc;var text=(this._editMode=="textmode");var ancestors=null;if(!text){ancestors=this.getAllAncestors();if(this.config.statusBar&&!noStatus){this._statusBarTree.innerHTML=HTMLArea.I18N.msg.Path+": ";for(var i=ancestors.length;--i>=0;){var el=ancestors[i];if(!el){continue}var a=document.createElement("a");a.href="#";a.el=el;a.editor=this;a.onclick=function(){this.blur();this.editor.selectNodeContents(this.el);this.editor.updateToolbar(true);return false};a.oncontextmenu=function(){this.blur();var info="Inline style:\n\n";info+=this.el.style.cssText.split(/;\s*/).join(";\n");return false};var txt=el.tagName.toLowerCase();a.title=el.style.cssText;if(el.id){txt+="#"+el.id}if(el.className){txt+="."+el.className}a.appendChild(document.createTextNode(txt));this._statusBarTree.appendChild(a);if(i!=0){this._statusBarTree.appendChild(document.createTextNode(String.fromCharCode(187)))}}}}for(var i in this._toolbarObjects){var btn=this._toolbarObjects[i];var cmd=i;var inContext=true;if(btn.context&&!text){inContext=false;var context=btn.context;var attrs=[];if(/(.*)\[(.*?)\]/.test(context)){context=RegExp.$1;attrs=RegExp.$2.split(",")}context=context.toLowerCase();var match=(context=="*");for(var k in ancestors){if(!ancestors[k]){continue}if(match||(ancestors[k].tagName.toLowerCase()==context)){inContext=true;for(var ka in attrs){if(!eval("ancestors[k]."+attrs[ka])){inContext=false;break}}if(inContext){break}}}}btn.state("enabled",(!text||btn.text)&&inContext);if(typeof cmd=="function"){continue}var dropdown=this.config.customSelects[cmd];if((!text||btn.text)&&(typeof dropdown!="undefined")){dropdown.refresh(this);continue}switch(cmd){case"fontname":case"fontsize":case"formatblock":if(!text){try{var value=(""+doc.queryCommandValue(cmd)).toLowerCase();if(!value){break}var options=this.config[cmd];var k=0;for(var j in options){if((j.toLowerCase()==value)||(options[j].substr(0,value.length).toLowerCase()==value)){btn.element.selectedIndex=k;break}++k}}catch(e){}}break;case"textindicator":if(!text){try{with(btn.element.style){backgroundColor=HTMLArea._makeColor(doc.queryCommandValue(HTMLArea.is_ie?"backcolor":"hilitecolor"));if(/transparent/i.test(backgroundColor)){backgroundColor=HTMLArea._makeColor(doc.queryCommandValue("backcolor"))}color=HTMLArea._makeColor(doc.queryCommandValue("forecolor"));fontFamily=doc.queryCommandValue("fontname");fontWeight=doc.queryCommandState("bold")?"bold":"normal";fontStyle=doc.queryCommandState("italic")?"italic":"normal"}}catch(e){}}break;case"htmlmode":btn.state("active",text);break;case"lefttoright":case"righttoleft":var el=this.getParentElement();while(el&&!HTMLArea.isBlockElement(el)){el=el.parentNode}if(el){btn.state("active",(el.style.direction==((cmd=="righttoleft")?"rtl":"ltr")))}break;default:try{btn.state("active",(!text&&doc.queryCommandState(cmd)))}catch(e){}}}if(this._customUndo&&!this._timerUndo){this._undoTakeSnapshot();var editor=this;this._timerUndo=setTimeout(function(){editor._timerUndo=null},this.config.undoTimeout)}for(var i in this.plugins){var plugin=this.plugins[i].instance;if(typeof plugin.onUpdateToolbar=="function"){plugin.onUpdateToolbar()}}this.isCompleteInitialize=true};HTMLArea.prototype.insertNodeAtSelection=function(B){if(!HTMLArea.is_ie){var D=this._getSelection();var A=this._createRange(D);D.removeAllRanges();A.deleteContents();var C=A.startContainer;var F=A.startOffset;switch(C.nodeType){case 3:if(B.nodeType==3){C.insertData(F,B.data);A=this._createRange();A.setEnd(C,F+B.length);A.setStart(C,F+B.length);D.addRange(A)}else{C=C.splitText(F);var E=B;if(B.nodeType==11){E=E.firstChild}C.parentNode.insertBefore(B,C);this.selectNodeContents(E);this.updateToolbar()}break;case 1:var E=B;if(B.nodeType==11){E=E.firstChild}C.insertBefore(B,C.childNodes[F]);this.selectNodeContents(E);this.updateToolbar();break}}else{return null}};HTMLArea.prototype.getParentElement=function(){var B=this._getSelection();var A=this._createRange(B);if(HTMLArea.is_ie){switch(B.type){case"Text":case"None":if(A==null){return A}return A.parentElement();case"Control":return A.item(0);default:return this._doc.body}}else{try{var D=A.commonAncestorContainer;if(!A.collapsed&&A.startContainer==A.endContainer&&A.startOffset-A.endOffset<=1&&A.startContainer.hasChildNodes()){D=A.startContainer.childNodes[A.startOffset]}while(D.nodeType==3){D=D.parentNode}return D}catch(C){return null}}};HTMLArea.prototype.getAllAncestors=function(){var B=this.getParentElement();var A=[];while(B&&(B.nodeType==1)&&(B.tagName.toLowerCase()!="body")){A.push(B);B=B.parentNode}A.push(this._doc.body);return A};HTMLArea.prototype.selectNodeContents=function(B,E){this.focusEditor();this.forceRedraw();var A;var D=(typeof E!="undefined");if(HTMLArea.is_ie){A=this._doc.body.createTextRange();A.moveToElementText(B);(D)&&A.collapse(E);A.select()}else{var C=this._getSelection();A=this._doc.createRange();A.selectNodeContents(B);(D)&&A.collapse(E);C.removeAllRanges();C.addRange(A)}};HTMLArea.prototype.insertHTML=function(C){var E=this._getSelection();var A=this._createRange(E);if(HTMLArea.is_ie){A.pasteHTML(C)}else{var B=this._doc.createDocumentFragment();var F=this._doc.createElement("div");F.innerHTML=C;while(F.firstChild){B.appendChild(F.firstChild)}var D=this.insertNodeAtSelection(B)}};HTMLArea.prototype.surroundHTML=function(C,B){var A=this.getSelectedHTML();this.insertHTML(C+A+B)};HTMLArea.prototype.getSelectedHTML=function(){var C=this._getSelection();var A=this._createRange(C);var B=null;if(HTMLArea.is_ie){B=A.htmlText}else{B=HTMLArea.getHTML(A.cloneContents(),false,this)}return B};HTMLArea.prototype.hasSelectedText=function(){return this.getSelectedHTML()!=""};HTMLArea.prototype._createLink=function(B){var A=this;var C=null;if(typeof B=="undefined"){B=this.getParentElement();if(B&&!/^a$/i.test(B.tagName)){B=null}}if(B){C={f_href:HTMLArea.is_ie?A.stripBaseURL(B.href):B.getAttribute("href"),f_title:B.title,f_target:B.target}}this._popupDialog("link.html",function(G){if(!G){return false}var D=B;if(!D){A._doc.execCommand("createlink",false,G.f_href);D=A.getParentElement();var F=A._getSelection();var E=A._createRange(F);if(!HTMLArea.is_ie){D=E.startContainer;if(!/^a$/i.test(D.tagName)){D=D.nextSibling}}}else{D.href=G.f_href.trim()}if(!/^a$/i.test(D.tagName)){return false}D.target=G.f_target.trim();D.title=G.f_title.trim();A.selectNodeContents(D);A.updateToolbar()},C)};HTMLArea.prototype._insertImage=function(B){var A=this;var C=null;if(typeof B=="undefined"){B=this.getParentElement();if(B&&!/^img$/i.test(B.tagName)){B=null}}if(B){C={f_url:HTMLArea.is_ie?A.stripBaseURL(B.src):B.getAttribute("src"),f_alt:B.alt,f_border:B.border,f_align:B.align,f_vert:B.vspace,f_horiz:B.hspace}}this._popupDialog("insert_image.html",function(H){if(!H){return false}var E=B;if(!E){var G=A._getSelection();var D=A._createRange(G);A._doc.execCommand("insertimage",false,H.f_url);if(HTMLArea.is_ie){E=D.parentElement();if(E.tagName.toLowerCase()!="img"){E=E.previousSibling}}else{E=D.startContainer.previousSibling}}else{E.src=H.f_url}for(field in H){var F=H[field];switch(field){case"f_alt":E.alt=F;break;case"f_border":E.border=parseInt(F||"0");break;case"f_align":E.align=F;break;case"f_vert":E.vspace=parseInt(F||"0");break;case"f_horiz":E.hspace=parseInt(F||"0");break}}},C)};HTMLArea.prototype._insertTable=function(){var C=this._getSelection();var A=this._createRange(C);var B=this;this._popupDialog("insert_table.html",function(D){if(!D){return false}var K=B._doc;var M=K.createElement("table");for(var J in D){var L=D[J];if(!L){continue}switch(J){case"f_width":M.style.width=L+D.f_unit;break;case"f_align":M.align=L;break;case"f_border":M.border=parseInt(L);break;case"f_spacing":M.cellspacing=parseInt(L);break;case"f_padding":M.cellpadding=parseInt(L);break}}var H=K.createElement("tbody");M.appendChild(H);for(var G=0;G<D.f_rows;++G){var I=K.createElement("tr");H.appendChild(I);for(var F=0;F<D.f_cols;++F){var E=K.createElement("td");I.appendChild(E);(HTMLArea.is_gecko)&&E.appendChild(K.createElement("br"))}}if(HTMLArea.is_ie){A.pasteHTML(M.outerHTML)}else{B.insertNodeAtSelection(M)}return true},null)};HTMLArea.prototype._comboSelected=function(B,A){this.focusEditor();var C=B.options[B.selectedIndex].value;switch(A){case"fontname":case"fontsize":this.execCommand(A,false,C);break;case"formatblock":(HTMLArea.is_ie)&&(C="<"+C+">");this.execCommand(A,false,C);break;default:var D=this.config.customSelects[A];if(typeof D!="undefined"){D.action(this)}else{alert("FIXME: combo box "+A+" not implemented")}}};HTMLArea.prototype.execCommand=function(G,E,F){var C=this;this.focusEditor();G=G.toLowerCase();switch(G){case"htmlmode":this.setMode();break;case"hilitecolor":(HTMLArea.is_ie)&&(G="backcolor");case"forecolor":this._popupDialog("select_color.html",function(H){if(H){C._doc.execCommand(G,false,"#"+H)}},HTMLArea._colorToRgb(this._doc.queryCommandValue(G)));break;case"createlink":this._createLink();break;case"popupeditor":HTMLArea._object=this;if(HTMLArea.is_ie){window.open(this.popupURL("fullscreen.html"),"ha_fullscreen","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=640,height=480")}else{window.open(this.popupURL("fullscreen.html"),"ha_fullscreen","toolbar=no,menubar=no,personalbar=no,width=640,height=480,scrollbars=no,resizable=yes")}break;case"undo":case"redo":if(this._customUndo){this[G]()}else{this._doc.execCommand(G,E,F)}break;case"inserttable":this._insertTable();break;case"insertimage":this._insertImage();break;case"about":this._popupDialog("about.html",null,this);break;case"showhelp":window.open(_editor_url+"reference.html","ha_help");break;case"killword":this._wordClean();break;case"fulltoolbar":this._htmlArea.removeChild(this._htmlArea.firstChild);this.config.toolbar=this.config.fulltoolbar;this._createToolbar();break;case"lesstoolbar":this._htmlArea.removeChild(this._htmlArea.firstChild);this.config.toolbar=this.config.basictoolbar;this._createToolbar();break;case"cut":case"copy":case"paste":try{if(this.config.killWordOnPaste){this._wordClean()}this._doc.execCommand(G,E,F)}catch(D){if(HTMLArea.is_gecko){if(confirm("Unprivileged scripts cannot access Cut/Copy/Paste programatically for security reasons.  Click OK to see a technical note at mozilla.org which shows you how to allow a script to access the clipboard.")){window.open("http://mozilla.org/editor/midasdemo/securityprefs.html")}}}break;case"lefttoright":case"righttoleft":var A=(G=="righttoleft")?"rtl":"ltr";var B=this.getParentElement();while(B&&!HTMLArea.isBlockElement(B)){B=B.parentNode}if(B){if(B.style.direction==A){B.style.direction=""}else{B.style.direction=A}}break;default:this._doc.execCommand(G,E,F)}this.updateToolbar();return false};HTMLArea.prototype._editorEvent=function(H){var F=this;var G=(HTMLArea.is_ie&&H.type=="keydown")||(H.type=="keypress");if(G){for(var C in F.plugins){var E=F.plugins[C].instance;if(typeof E.onKeyPress=="function"){E.onKeyPress(H)}}}if(G&&H.ctrlKey){var A=null;var D=null;var J=String.fromCharCode(HTMLArea.is_ie?H.keyCode:H.charCode).toLowerCase();var B=null;var I=null;switch(J){case"a":if(!HTMLArea.is_ie){A=this._getSelection();A.removeAllRanges();D=this._createRange();D.selectNodeContents(this._doc.body);A.addRange(D);HTMLArea._stopEvent(H)}break;case"b":B="bold";break;case"i":B="italic";break;case"u":B="underline";break;case"s":B="strikethrough";break;case"l":B="justifyleft";break;case"e":B="justifycenter";break;case"r":B="justifyright";break;case"j":B="justifyfull";break;case"z":B="undo";break;case"y":B="redo";break;case"v":B="paste";break;case"0":B="killword";break;case"1":case"2":case"3":case"4":case"5":case"6":B="formatblock";I="h"+J;if(HTMLArea.is_ie){I="<"+I+">"}break}if(B){this.execCommand(B,false,I);HTMLArea._stopEvent(H)}}if(F._timerToolbar){clearTimeout(F._timerToolbar)}F._timerToolbar=setTimeout(function(){F.updateToolbar();F._timerToolbar=null},50)};HTMLArea.prototype.getHTML=function(){switch(this._editMode){case"wysiwyg":if(!this.config.fullPage){return HTMLArea.getHTML(this._doc.body,false,this)}else{return this.doctype+"\n"+HTMLArea.getHTML(this._doc.documentElement,true,this)}case"textmode":return this._textArea.value;default:alert("Mode <"+mode+"> not defined!")}return false};HTMLArea.prototype.getInnerHTML=function(){switch(this._editMode){case"wysiwyg":if(!this.config.fullPage){return this._doc.body.innerHTML}else{return this.doctype+"\n"+this._doc.documentElement.innerHTML}case"textmode":return this._textArea.value;default:alert("Mode <"+mode+"> not defined!")}return false};HTMLArea.prototype.setHTML=function(A){switch(this._editMode){case"wysiwyg":if(!this.config.fullPage){this._doc.body.innerHTML=A}else{this._doc.body.innerHTML=A}break;case"textmode":this._textArea.value=A;break;default:alert("Mode <"+mode+"> not defined!")}return false};HTMLArea.prototype.setDoctype=function(A){this.doctype=A};HTMLArea.agt=navigator.userAgent.toLowerCase();HTMLArea.is_ie=((HTMLArea.agt.indexOf("msie")!=-1)&&(HTMLArea.agt.indexOf("opera")==-1));HTMLArea.is_opera=(HTMLArea.agt.indexOf("opera")!=-1);HTMLArea.is_mac=(HTMLArea.agt.indexOf("mac")!=-1);HTMLArea.is_mac_ie=(HTMLArea.is_ie&&HTMLArea.is_mac);HTMLArea.is_win_ie=(HTMLArea.is_ie&&!HTMLArea.is_mac);HTMLArea.is_gecko=(navigator.product=="Gecko");HTMLArea._object=null;HTMLArea.cloneObject=function(C){var A=new Object;if(C.constructor.toString().indexOf("function Array(")==1){A=C.constructor()}if(C.constructor.toString().indexOf("function Function(")==1){A=C}else{for(var D in C){var B=C[D];if(typeof B=="object"){A[D]=HTMLArea.cloneObject(B)}else{A[D]=B}}}return A};HTMLArea.checkSupportedBrowser=function(){if(HTMLArea.is_gecko){if(navigator.productSub<20021201){alert("You need at least Mozilla-1.3 Alpha.\nSorry, your Gecko is not supported.");return false}if(navigator.productSub<20030210){}}return HTMLArea.is_gecko||HTMLArea.is_ie};HTMLArea.prototype._getSelection=function(){if(HTMLArea.is_ie){return this._doc.selection}else{return this._iframe.contentWindow.getSelection()}};HTMLArea.prototype._createRange=function(A){if(HTMLArea.is_ie){try{return A.createRange()}catch(B){return null}}else{this.focusEditor();if(typeof A!="undefined"){try{return A.getRangeAt(0)}catch(B){return this._doc.createRange()}}else{return this._doc.createRange()}}};HTMLArea._addEvent=function(A,C,B){if(HTMLArea.is_ie){A.attachEvent("on"+C,B)}else{A.addEventListener(C,B,true)}};HTMLArea._addEvents=function(C,A,D){for(var B in A){HTMLArea._addEvent(C,A[B],D)}};HTMLArea._removeEvent=function(A,C,B){if(HTMLArea.is_ie){A.detachEvent("on"+C,B)}else{A.removeEventListener(C,B,true)}};HTMLArea._removeEvents=function(C,A,D){for(var B in A){HTMLArea._removeEvent(C,A[B],D)}};HTMLArea._stopEvent=function(A){if(HTMLArea.is_ie){A.cancelBubble=true;A.returnValue=false}else{A.preventDefault();A.stopPropagation()}};HTMLArea._removeClass=function(E,D){if(!(E&&E.className)){return }var A=E.className.split(" ");var B=new Array();for(var C=A.length;C>0;){if(A[--C]!=D){B[B.length]=A[C]}}E.className=B.join(" ")};HTMLArea._addClass=function(B,A){HTMLArea._removeClass(B,A);B.className+=" "+A};HTMLArea._hasClass=function(D,C){if(!(D&&D.className)){return false}var A=D.className.split(" ");for(var B=A.length;B>0;){if(A[--B]==C){return true}}return false};HTMLArea.isBlockElement=function(B){var A=" body form textarea fieldset ul ol dl li div p h1 h2 h3 h4 h5 h6 quote pre table thead tbody tfoot tr td iframe address ";return(A.indexOf(" "+B.tagName.toLowerCase()+" ")!=-1)};HTMLArea.needsClosingTag=function(A){var B=" head script style div span tr td tbody table em strong font a title ";return(B.indexOf(" "+A.tagName.toLowerCase()+" ")!=-1)};HTMLArea.htmlEncode=function(A){A=A.replace(/&/ig,"&amp;");A=A.replace(/</ig,"&lt;");A=A.replace(/>/ig,"&gt;");A=A.replace(/\x22/ig,"&quot;");return A};HTMLArea.getHTML=function(H,B,F){var E="";switch(H.nodeType){case 1:case 11:var G;var D;var K=(H.nodeType==1)?H.tagName.toLowerCase():"";if(HTMLArea.is_ie&&K=="head"){if(B){E+="<head>"}var M=RegExp.multiline;RegExp.multiline=true;var C=H.innerHTML.replace(HTMLArea.RE_tagName,function(P,O,N){return O+N.toLowerCase()});RegExp.multiline=M;E+=C;if(B){E+="</head>"}break}else{if(B){G=(!(H.hasChildNodes()||HTMLArea.needsClosingTag(H)));E="<"+H.tagName.toLowerCase();var L=H.attributes;for(D=0;D<L.length;++D){var I=L.item(D);if(!I.specified){continue}var A=I.nodeName.toLowerCase();if(/_moz|contenteditable|_msh/.test(A)){continue}var J;if(A!="style"){if(typeof H[I.nodeName]!="undefined"&&A!="href"&&A!="src"){J=H[I.nodeName]}else{J=I.nodeValue;if(HTMLArea.is_ie&&(A=="href"||A=="src")){J=F.stripBaseURL(J)}}}else{J=H.style.cssText}if(/(_moz|^$)/.test(J)){continue}E+=" "+A+'="'+J+'"'}E+=G?" />":">"}}for(D=H.firstChild;D;D=D.nextSibling){E+=HTMLArea.getHTML(D,true,F)}if(B&&!G){E+="</"+H.tagName.toLowerCase()+">"}break;case 3:if(!H.previousSibling&&!H.nextSibling&&H.data.match(/^\s*$/i)){E="&nbsp;"}else{E=HTMLArea.htmlEncode(H.data)}break;case 8:E="<!--"+H.data+"-->";break}return E};HTMLArea.prototype.stripBaseURL=function(A){var C=this.config.baseURL;C=C.replace(/[^\/]+$/,"");var B=new RegExp(C);A=A.replace(B,"");C=C.replace(/^(https?:\/\/[^\/]+)(.*)$/,"$1");B=new RegExp(C);return A.replace(B,"")};String.prototype.trim=function(){a=this.replace(/^\s+/,"");return a.replace(/\s+$/,"")};HTMLArea._makeColor=function(B){if(typeof B!="number"){return B}var D=B&255;var C=(B>>8)&255;var A=(B>>16)&255;return"rgb("+D+","+C+","+A+")"};HTMLArea._colorToRgb=function(B){if(!B){return""}function F(G){return(G<16)?("0"+G.toString(16)):G.toString(16)}if(typeof B=="number"){var E=B&255;var D=(B>>8)&255;var A=(B>>16)&255;return"#"+F(E)+F(D)+F(A)}if(B.substr(0,3)=="rgb"){var C=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;if(B.match(C)){var E=parseInt(RegExp.$1);var D=parseInt(RegExp.$2);var A=parseInt(RegExp.$3);return"#"+F(E)+F(D)+F(A)}return null}if(B.substr(0,1)=="#"){return B}return null};HTMLArea.prototype._popupDialog=function(A,B,C){Dialog(this.popupURL(A),B,C)};HTMLArea.prototype.imgURL=function(A,B){if(typeof B=="undefined"){return _editor_url+A}else{return _editor_url+"plugins/"+B+"/img/"+A}};HTMLArea.prototype.popupURL=function(C){var B="";if(C.match(/^plugin:\/\/(.*?)\/(.*)/)){var D=RegExp.$1;var A=RegExp.$2;if(!/\.html$/.test(A)){A+=".html"}B=_editor_url+"plugins/"+D+"/popups/"+A}else{B=_editor_url+this.config.popupURL+C}return B};HTMLArea.getElementById=function(A,E){var C,B,D=document.getElementsByTagName(A);for(B=D.length;--B>=0&&(C=D[B]);){if(C.id==E){return C}}return null};function Dialog(A,B,C){if(typeof C=="undefined"){C=window}Dialog._geckoOpenModal(A,B,C)}Dialog._parentEvent=function(A){if(Dialog._modal&&!Dialog._modal.closed){Dialog._modal.focus();HTMLArea._stopEvent(A)}};Dialog._return=null;Dialog._modal=null;Dialog._arguments=null;Dialog._geckoOpenModal=function(C,E,G){var F=window.open(C,"hadialog","toolbar=no,menubar=no,personalbar=no,width=10,height=10,scrollbars=no,resizable=yes");Dialog._modal=F;Dialog._arguments=G;function B(H){HTMLArea._addEvent(H,"click",Dialog._parentEvent);HTMLArea._addEvent(H,"mousedown",Dialog._parentEvent);HTMLArea._addEvent(H,"focus",Dialog._parentEvent)}function A(H){HTMLArea._removeEvent(H,"click",Dialog._parentEvent);HTMLArea._removeEvent(H,"mousedown",Dialog._parentEvent);HTMLArea._removeEvent(H,"focus",Dialog._parentEvent)}B(window);for(var D=0;D<window.frames.length;B(window.frames[D++])){}Dialog._return=function(I){if(I&&E){E(I)}A(window);for(var H=0;H<window.frames.length;A(window.frames[H++])){}Dialog._modal=null}};function PopupWin(D,G,I,E){this.editor=D;this.handler=I;var F=window.open("","__ha_dialog","toolbar=no,menubar=no,personalbar=no,width=600,height=600,left=20,top=40scrollbars=no,resizable=no");this.window=F;var H=F.document;this.doc=H;var J=this;var A=document.baseURI||document.URL;if(A&&A.match(/(.*)\/([^\/]+)/)){A=RegExp.$1+"/"}if(typeof _editor_url!="undefined"&&!/^\//.test(_editor_url)){A+=_editor_url}else{A=_editor_url}if(!/\/$/.test(A)){A+="/"}this.baseURL=A;H.open();var C="<html><head><title>"+G+"</title>\n";C+="<style type='text/css'>@import url("+A+"htmlarea.css);</style></head>\n";C+="<body class='dialog popupwin' id='--HA-body'></body></html>";H.write(C);H.close();function B(){var K=H.body;if(!K){setTimeout(B,25);return false}F.title=G;H.documentElement.style.padding="0px";H.documentElement.style.margin="0px";var L=H.createElement("div");L.className="content";J.content=L;K.appendChild(L);J.element=K;E(J);F.focus()}B()}PopupWin.prototype.callHandler=function(){var C=["input","textarea","select"];var H=new Object();for(var F in C){var A=C[F];var D=this.content.getElementsByTagName(A);for(var B=0;B<D.length;++B){var E=D[B];var G=E.value;if(E.tagName.toLowerCase()=="input"){if(E.type=="checkbox"){G=E.checked}}H[E.name]=G}}this.handler(this,H);return false};PopupWin.prototype.close=function(){this.window.close()};PopupWin.prototype.addButtons=function(){var A=this;var E=this.doc.createElement("div");this.content.appendChild(E);E.className="buttons";for(var D=0;D<arguments.length;++D){var C=arguments[D];var B=this.doc.createElement("button");E.appendChild(B);B.innerHTML=HTMLArea.I18N.buttons[C];switch(C){case"ok":B.onclick=function(){A.callHandler();A.close();return false};break;case"cancel":B.onclick=function(){A.close();return false};break}}};PopupWin.prototype.showAtElement=function(){var A=this;setTimeout(function(){var B=A.content.offsetWidth+4;var E=A.content.offsetHeight+4;var D=A.content;var C=D.style;C.position="absolute";C.left=(B-D.offsetWidth)/2+"px";C.top=(E-D.offsetHeight)/2+"px";if(HTMLArea.is_gecko){A.window.innerWidth=B;A.window.innerHeight=E}else{A.window.resizeTo(B+8,E+35)}},25)};HTMLArea.I18N={lang:"en",tooltips:{bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",subscript:"Subscript",superscript:"Superscript",justifyleft:"Justify Left",justifycenter:"Justify Center",justifyright:"Justify Right",justifyfull:"Justify Full",orderedlist:"Ordered List",unorderedlist:"Bulleted List",outdent:"Decrease Indent",indent:"Increase Indent",forecolor:"Font Color",hilitecolor:"Background Color",horizontalrule:"Horizontal Rule",createlink:"Insert Web Link",insertimage:"Insert/Modify Image",inserttable:"Insert Table",htmlmode:"Toggle HTML Source",popupeditor:"Enlarge Editor",about:"About this editor",showhelp:"Help using editor",textindicator:"Current style",undo:"Undoes your last action",redo:"Redoes your last action",cut:"Cut selection",copy:"Copy selection",paste:"Paste from clipboard",lefttoright:"Direction left to right",righttoleft:"Direction right to left"},buttons:{ok:"OK",cancel:"Cancel"},msg:{Path:"Path",TEXT_MODE:"You are in TEXT MODE.  Use the [<>] button to switch back to WYSIWYG.","IE-sucks-full-screen":"The full screen mode is known to cause problems with Internet Explorer, due to browser bugs that we weren't able to workaround.  You might experience garbage display, lack of editor functions and/or random browser crashes.  If your system is Windows 9x it's very likely that you'll get a 'General Protection Fault' and need to reboot.\n\nYou have been warned.  Please press OK if you still want to try the full screen editor."},dialogs:{Cancel:"Cancel","Insert/Modify Link":"Insert/Modify Link","New window (_blank)":"New window (_blank)","None (use implicit)":"None (use implicit)",OK:"OK",Other:"Other","Same frame (_self)":"Same frame (_self)","Target:":"Target:","Title (tooltip):":"Title (tooltip):","Top frame (_top)":"Top frame (_top)","URL:":"URL:","You must enter the URL where this link points to":"You must enter the URL where this link points to"}};