Software: Apache/2.2.3 (CentOS). PHP/5.1.6 uname -a: Linux mx-ll-110-164-51-230.static.3bb.co.th 2.6.18-194.el5PAE #1 SMP Fri Apr 2 15:37:44 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/libexec/webmin/file/xinha/ drwxr-xr-x |
Viewing file: XinhaCore.js (91.56 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) | /* This compressed file is part of Xinha. For uncompressed sources, forum, and bug reports, go to xinha.org */ /* This file is part of version 0.96beta2 released Fri, 20 Mar 2009 11:01:14 +0100 */ /* The URL of the most recent uncompressed version of this file is http://svn.xinha.org/trunk/XinhaCore.js */ /*-------------------------------------------------------------------------- -- Xinha (is not htmlArea) - http://xinha.org -- -- Use of Xinha is granted by the terms of the htmlArea License (based on -- BSD license) please read license.txt in this package for details. -- -- Copyright (c) 2005-2009 Xinha Developer Team and contributors -- -- Xinha was originally based on work by Mihai Bazon which is: -- Copyright (c) 2003-2004 dynarch.com. -- Copyright (c) 2002-2003 interactivetools.com, inc. -- This copyright notice MUST stay intact for use. -------------------------------------------------------------------------*/ Xinha.version={Release:"0.96beta2",Head:"$HeadURL: http://svn.xinha.org/trunk/XinhaCore.js $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),Date:"$LastChangedDate: 2009-03-19 22:40:09 +0100 (Do, 19. Mär 2009) $".replace(/^[^:]*:\s*([0-9\-]*) ([0-9:]*) ([+0-9]*) \((.*)\)\s*\$/,"$4 $2 $3"),Revision:"$LastChangedRevision: 1170 $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1"),RevisionBy:"$LastChangedBy: ray $".replace(/^[^:]*:\s*(.*)\s*\$$/,"$1")};Xinha._resolveRelativeUrl=function(d,c){if(c.match(/^([^:]+\:)?\/\//)){return c}else{var a=d.split("/");if(a[a.length-1]===""){a.pop()}var e=c.split("/");if(e[0]=="."){e.shift()}while(e[0]==".."){a.pop();e.shift()}return a.join("/")+"/"+e.join("/")}};if(typeof _editor_url=="string"){_editor_url=_editor_url.replace(/\x2f*$/,"/");if(!_editor_url.match(/^([^:]+\:)?\//)){(function(){var a=window.location.toString().replace(/\?.*$/,"").split("/");a.pop();_editor_url=Xinha._resolveRelativeUrl(a.join("/"),_editor_url)})()}}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 '/xinha/', 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"}if(typeof _editor_skin!=="string"){_editor_skin=""}if(typeof _editor_icons!=="string"){_editor_icons=""}var __xinhas=[];Xinha.agt=navigator.userAgent.toLowerCase();Xinha.is_ie=((Xinha.agt.indexOf("msie")!=-1)&&(Xinha.agt.indexOf("opera")==-1));Xinha.ie_version=parseFloat(Xinha.agt.substring(Xinha.agt.indexOf("msie")+5));Xinha.is_opera=(Xinha.agt.indexOf("opera")!=-1);if(Xinha.is_opera&&Xinha.agt.match(/opera[\/ ]([0-9.]+)/)){Xinha.opera_version=parseFloat(RegExp.$1)}else{Xinha.opera_version=0}Xinha.is_khtml=(Xinha.agt.indexOf("khtml")!=-1);Xinha.is_webkit=(Xinha.agt.indexOf("applewebkit")!=-1);Xinha.webkit_version=parseInt(navigator.appVersion.replace(/.*?AppleWebKit\/([\d]).*?/,"$1"),10);Xinha.is_safari=(Xinha.agt.indexOf("safari")!=-1);Xinha.is_chrome=(Xinha.agt.indexOf("chrome")!=-1);Xinha.is_mac=(Xinha.agt.indexOf("mac")!=-1);Xinha.is_mac_ie=(Xinha.is_ie&&Xinha.is_mac);Xinha.is_win_ie=(Xinha.is_ie&&!Xinha.is_mac);Xinha.is_gecko=(navigator.product=="Gecko")||Xinha.is_opera;Xinha.is_real_gecko=(navigator.product=="Gecko"&&!Xinha.is_webkit);Xinha.is_ff3=Xinha.is_real_gecko&&parseInt(navigator.productSub,10)>=2007121016;Xinha.is_ff2=Xinha.is_real_gecko&&parseInt(navigator.productSub,10)<2007121016;Xinha.isRunLocally=document.URL.toLowerCase().search(/^file:/)!=-1;Xinha.is_designMode=(typeof document.designMode!="undefined"&&!Xinha.is_ie);Xinha.checkSupportedBrowser=function(){return Xinha.is_real_gecko||(Xinha.is_opera&&Xinha.opera_version>=9.2)||Xinha.ie_version>=5.5||Xinha.webkit_version>=522};Xinha.isSupportedBrowser=Xinha.checkSupportedBrowser();if(Xinha.isRunLocally&&Xinha.isSupportedBrowser){alert('Xinha *must* be installed on a web server. Locally opened files (those that use the "file://" protocol) cannot properly function. Xinha will try to initialize but may not be correctly loaded.')}function Xinha(a,c){if(!Xinha.isSupportedBrowser){return}if(!a){throw new Error("Tried to create Xinha without textarea specified.")}if(typeof c=="undefined"){this.config=new Xinha.Config()}else{this.config=c}if(typeof a!="object"){a=Xinha.getElementById("textarea",a)}this._textArea=a;this._textArea.spellcheck=false;Xinha.freeLater(this,"_textArea");this._initial_ta_size={w:a.style.width?a.style.width:(a.offsetWidth?(a.offsetWidth+"px"):(a.cols+"em")),h:a.style.height?a.style.height:(a.offsetHeight?(a.offsetHeight+"px"):(a.rows+"em"))};if(document.getElementById("loading_"+a.id)||this.config.showLoading){if(!document.getElementById("loading_"+a.id)){Xinha.createLoadingMessage(a)}this.setLoadingMessage(Xinha._lc("Constructing object"))}this._editMode="wysiwyg";this.plugins={};this._timerToolbar=null;this._timerUndo=null;this._undoQueue=[this.config.undoSteps];this._undoPos=-1;this._customUndo=true;this._mdoc=document;this.doctype="";this.__htmlarea_id_num=__xinhas.length;__xinhas[this.__htmlarea_id_num]=this;this._notifyListeners={};var b={right:{on:true,container:document.createElement("td"),panels:[]},left:{on:true,container:document.createElement("td"),panels:[]},top:{on:true,container:document.createElement("td"),panels:[]},bottom:{on:true,container:document.createElement("td"),panels:[]}};for(var d in b){if(!b[d].container){continue}b[d].div=b[d].container;b[d].container.className="panels panels_"+d;Xinha.freeLater(b[d],"container");Xinha.freeLater(b[d],"div")}this._panels=b;this._statusBar=null;this._statusBarTree=null;this._statusBarTextMode=null;this._statusBarItems=[];this._framework={};this._htmlArea=null;this._iframe=null;this._doc=null;this._toolBar=this._toolbar=null;this._toolbarObjects={};this.plugins.Events={name:"Events",developer:"The Xinha Core Developer Team",instance:c.Events}}Xinha.onload=function(){};Xinha.init=function(){Xinha.onload()};Xinha.RE_tagName=/(<\/|<)\s*([^ \t\n>]+)/ig;Xinha.RE_doctype=/(<!doctype((.|\n)*?)>)\n?/i;Xinha.RE_head=/<head>((.|\n)*?)<\/head>/i;Xinha.RE_body=/<body[^>]*>((.|\n|\r|\t)*?)<\/body>/i;Xinha.RE_Specials=/([\/\^$*+?.()|{}\[\]])/g;Xinha.escapeStringForRegExp=function(a){return a.replace(Xinha.RE_Specials,"\\$1")};Xinha.RE_email=/^[_a-z\d\-\.]{3,}@[_a-z\d\-]{2,}(\.[_a-z\d\-]{2,})+$/i;Xinha.RE_url=/(https?:\/\/)?(([a-z0-9_]+:[a-z0-9_]+@)?[a-z0-9_\-]{2,}(\.[a-z0-9_\-]{2,}){2,}(:[0-9]+)?(\/\S+)*)/i;Xinha.Config=function(){this.version=Xinha.version.Revision;this.width="auto";this.height="auto";this.sizeIncludesBars=true;this.sizeIncludesPanels=true;this.panel_dimensions={left:"200px",right:"200px",top:"100px",bottom:"100px"};this.iframeWidth=null;this.statusBar=true;this.htmlareaPaste=false;this.mozParaHandler="best";this.getHtmlMethod="DOMwalk";this.undoSteps=20;this.undoTimeout=500;this.changeJustifyWithDirection=false;this.fullPage=false;this.pageStyle="";this.pageStyleSheets=[];this.baseHref=null;this.expandRelativeUrl=true;this.stripBaseHref=true;this.stripSelfNamedAnchors=true;this.only7BitPrintablesInURLs=true;this.sevenBitClean=false;this.specialReplacements={};this.inwardHtml=function(c){return c};this.outwardHtml=function(c){return c};this.autofocus=false;this.killWordOnPaste=true;this.makeLinkShowsTarget=true;this.charSet=(typeof document.characterSet!="undefined")?document.characterSet:document.charset;this.browserQuirksMode=null;this.imgURL="images/";this.popupURL="popups/";this.htmlRemoveTags=null;this.flowToolbars=true;this.toolbarAlign="left";this.showLoading=false;this.stripScripts=true;this.convertUrlsToLinks=true;this.colorPickerCellSize="6px";this.colorPickerGranularity=18;this.colorPickerPosition="bottom,right";this.colorPickerWebSafe=false;this.colorPickerSaveColors=20;this.fullScreen=false;this.fullScreenMargins=[0,0,0,0];this.toolbar=[["popupeditor"],["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],["separator","forecolor","hilitecolor","textindicator"],["separator","subscript","superscript"],["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],["separator","insertorderedlist","insertunorderedlist","outdent","indent"],["separator","inserthorizontalrule","createlink","insertimage","inserttable"],["linebreak","separator","undo","redo","selectall","print"],(Xinha.is_gecko?[]:["cut","copy","paste","overwrite","saveas"]),["separator","killword","clearfonts","removeformat","toggleborders","splitblock","lefttoright","righttoleft"],["separator","htmlmode","showhelp","about"]];this.fontname={"— font —":"",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={"— size —":"","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={"— format —":"","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.dialogOptions={centered:true,greyout:true,closeOnEscape:true};this.Events={};this.customSelects={};this.debug=false;this.URIs={blank:_editor_url+"popups/blank.html",link:_editor_url+"modules/CreateLink/link.html",insert_image:_editor_url+"modules/InsertImage/insert_image.html",insert_table:_editor_url+"modules/InsertTable/insert_table.html",select_color:_editor_url+"popups/select_color.html",help:_editor_url+"popups/editor_help.html"};this.btnList={bold:["Bold",Xinha._lc({key:"button_bold",string:["ed_buttons_main.png",3,2]},"Xinha"),false,function(c){c.execCommand("bold")}],italic:["Italic",Xinha._lc({key:"button_italic",string:["ed_buttons_main.png",2,2]},"Xinha"),false,function(c){c.execCommand("italic")}],underline:["Underline",Xinha._lc({key:"button_underline",string:["ed_buttons_main.png",2,0]},"Xinha"),false,function(c){c.execCommand("underline")}],strikethrough:["Strikethrough",Xinha._lc({key:"button_strikethrough",string:["ed_buttons_main.png",3,0]},"Xinha"),false,function(c){c.execCommand("strikethrough")}],subscript:["Subscript",Xinha._lc({key:"button_subscript",string:["ed_buttons_main.png",3,1]},"Xinha"),false,function(c){c.execCommand("subscript")}],superscript:["Superscript",Xinha._lc({key:"button_superscript",string:["ed_buttons_main.png",2,1]},"Xinha"),false,function(c){c.execCommand("superscript")}],justifyleft:["Justify Left",["ed_buttons_main.png",0,0],false,function(c){c.execCommand("justifyleft")}],justifycenter:["Justify Center",["ed_buttons_main.png",1,1],false,function(c){c.execCommand("justifycenter")}],justifyright:["Justify Right",["ed_buttons_main.png",1,0],false,function(c){c.execCommand("justifyright")}],justifyfull:["Justify Full",["ed_buttons_main.png",0,1],false,function(c){c.execCommand("justifyfull")}],orderedlist:["Ordered List",["ed_buttons_main.png",0,3],false,function(c){c.execCommand("insertorderedlist")}],unorderedlist:["Bulleted List",["ed_buttons_main.png",1,3],false,function(c){c.execCommand("insertunorderedlist")}],insertorderedlist:["Ordered List",["ed_buttons_main.png",0,3],false,function(c){c.execCommand("insertorderedlist")}],insertunorderedlist:["Bulleted List",["ed_buttons_main.png",1,3],false,function(c){c.execCommand("insertunorderedlist")}],outdent:["Decrease Indent",["ed_buttons_main.png",1,2],false,function(c){c.execCommand("outdent")}],indent:["Increase Indent",["ed_buttons_main.png",0,2],false,function(c){c.execCommand("indent")}],forecolor:["Font Color",["ed_buttons_main.png",3,3],false,function(c){c.execCommand("forecolor")}],hilitecolor:["Background Color",["ed_buttons_main.png",2,3],false,function(c){c.execCommand("hilitecolor")}],undo:["Undoes your last action",["ed_buttons_main.png",4,2],false,function(c){c.execCommand("undo")}],redo:["Redoes your last action",["ed_buttons_main.png",5,2],false,function(c){c.execCommand("redo")}],cut:["Cut selection",["ed_buttons_main.png",5,0],false,function(d,c){d.execCommand(c)}],copy:["Copy selection",["ed_buttons_main.png",4,0],false,function(d,c){d.execCommand(c)}],paste:["Paste from clipboard",["ed_buttons_main.png",4,1],false,function(d,c){d.execCommand(c)}],selectall:["Select all",["ed_buttons_main.png",3,5],false,function(c){c.execCommand("selectall")}],inserthorizontalrule:["Horizontal Rule",["ed_buttons_main.png",6,0],false,function(c){c.execCommand("inserthorizontalrule")}],createlink:["Insert Web Link",["ed_buttons_main.png",6,1],false,function(c){c._createLink()}],insertimage:["Insert/Modify Image",["ed_buttons_main.png",6,3],false,function(c){c.execCommand("insertimage")}],inserttable:["Insert Table",["ed_buttons_main.png",6,2],false,function(c){c.execCommand("inserttable")}],htmlmode:["Toggle HTML Source",["ed_buttons_main.png",7,0],true,function(c){c.execCommand("htmlmode")}],toggleborders:["Toggle Borders",["ed_buttons_main.png",7,2],false,function(c){c._toggleBorders()}],print:["Print document",["ed_buttons_main.png",8,1],false,function(c){if(Xinha.is_gecko){c._iframe.contentWindow.print()}else{c.focusEditor();print()}}],saveas:["Save as","ed_saveas.png",false,function(c){c.execCommand("saveas",false,"noname.htm")}],about:["About this editor",["ed_buttons_main.png",8,2],true,function(c){c.getPluginInstance("AboutBox").show()}],showhelp:["Help using editor",["ed_buttons_main.png",9,2],true,function(c){c.execCommand("showhelp")}],splitblock:["Split Block","ed_splitblock.gif",false,function(c){c._splitBlock()}],lefttoright:["Direction left to right",["ed_buttons_main.png",0,2],false,function(c){c.execCommand("lefttoright")}],righttoleft:["Direction right to left",["ed_buttons_main.png",1,2],false,function(c){c.execCommand("righttoleft")}],overwrite:["Insert/Overwrite","ed_overwrite.gif",false,function(c){c.execCommand("overwrite")}],wordclean:["MS Word Cleaner",["ed_buttons_main.png",5,3],false,function(c){c._wordClean()}],clearfonts:["Clear Inline Font Specifications",["ed_buttons_main.png",5,4],true,function(c){c._clearFonts()}],removeformat:["Remove formatting",["ed_buttons_main.png",4,4],false,function(c){c.execCommand("removeformat")}],killword:["Clear MSOffice tags",["ed_buttons_main.png",4,3],false,function(c){c.execCommand("killword")}]};this.iconList={dialogCaption:_editor_url+"images/xinha-small-icon.gif",wysiwygmode:[_editor_url+"images/ed_buttons_main.png",7,1]};for(var b in this.btnList){var a=this.btnList[b];if(typeof a!="object"){continue}if(typeof a[1]!="string"){a[1][0]=_editor_url+this.imgURL+a[1][0]}else{a[1]=_editor_url+this.imgURL+a[1]}a[0]=Xinha._lc(a[0])}};Xinha.Config.prototype.registerIcon=function(b,a){this.iconList[b]=a};Xinha.Config.prototype.registerButton=function(f,d,e,a,c,b){if(typeof f=="string"){this.btnList[f]=[d,e,a,c,b]}else{if(typeof f=="object"){this.btnList[f.id]=[f.tooltip,f.image,f.textMode,f.action,f.context]}else{alert("ERROR [Xinha.Config::registerButton]:\ninvalid arguments");return false}}};Xinha.prototype.registerPanel=function(c,b){if(!c){c="right"}this.setLoadingMessage("Register "+c+" panel ");var a=this.addPanel(c);if(b){b.drawPanelIn(a)}};Xinha.Config.prototype.registerDropdown=function(a){this.customSelects[a.id]=a};Xinha.Config.prototype.hideSomeButtons=function(b){var f=this.toolbar;for(var e=f.length;--e>=0;){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)}}}};Xinha.Config.prototype.addToolbarElement=function(d,h,k){var p=this.toolbar;var q,g,f,e,c;var n=false;var b=false;var t=0;var l=0;var m=0;var r=false;var s=false;if((d&&typeof d=="object")&&(d.constructor==Array)){n=true}if((h&&typeof h=="object")&&(h.constructor==Array)){b=true;t=h.length}if(n){for(g=0;g<d.length;++g){if((d[g]!="separator")&&(d[g].indexOf("T[")!==0)){c=d[g]}}}else{c=d}for(g=0;g<p.length;++g){q=p[g];for(f=0;f<q.length;++f){if(q[f]==c){return}}}for(g=0;!s&&g<p.length;++g){q=p[g];for(f=0;!s&&f<q.length;++f){if(b){for(e=0;e<t;++e){if(q[f]==h[e]){if(e===0){s=true;f--;break}else{m=g;l=f;t=e}}}}else{if(q[f]==h){s=true;break}}}}if(!s&&b){if(h.length!=t){f=l;q=p[m];s=true}}if(s){if(k===0){if(n){q[f]=d[d.length-1];for(g=d.length-1;--g>=0;){q.splice(f,0,d[g])}}else{q[f]=d}}else{if(k<0){f=f+k+1}else{if(k>0){f=f+k}}if(n){for(g=d.length;--g>=0;){q.splice(f,0,d[g])}}else{q.splice(f,0,d)}}}else{p[0].splice(0,0,"separator");if(n){for(g=d.length;--g>=0;){p[0].splice(0,0,d[g])}}else{p[0].splice(0,0,d)}}};Xinha.Config.prototype.removeToolbarElement=Xinha.Config.prototype.hideSomeButtons;Xinha.replaceAll=function(a){var c=document.getElementsByTagName("textarea");for(var b=c.length;b>0;new Xinha(c[--b],a).generate()){}};Xinha.replace=function(c,b){var a=Xinha.getElementById("textarea",c);return a?new Xinha(a,b).generate():null};Xinha.prototype._createToolbar=function(){this.setLoadingMessage(Xinha._lc("Create Toolbar"));var b=this;var c=document.createElement("div");this._toolBar=this._toolbar=c;c.className="toolbar";c.unselectable="1";c.align=this.config.toolbarAlign;Xinha.freeLater(this,"_toolBar");Xinha.freeLater(this,"_toolbar");var a=null;var d={};this._toolbarObjects=d;this._createToolbar1(b,c,d);this._htmlArea.appendChild(c);return c};Xinha.prototype._setConfig=function(a){this.config=a};Xinha.prototype._rebuildToolbar=function(){this._createToolbar1(this,this._toolbar,this._toolbarObjects);if(Xinha._currentlyActiveEditor){if(Xinha._currentlyActiveEditor==this){this.activateEditor()}}else{this.disableToolbar()}};Xinha._createToolbarBreakingElement=function(){var a=document.createElement("div");a.style.height="1px";a.style.width="1px";a.style.lineHeight="1px";a.style.fontSize="1px";a.style.clear="both";return a};Xinha.prototype._createToolbar1=function(m,p,s){while(p.lastChild){p.removeChild(p.lastChild)}var d;if(m.config.flowToolbars){p.appendChild(Xinha._createToolbarBreakingElement())}function l(){if(typeof d!="undefined"&&d.childNodes.length===0){return}var i=document.createElement("table");i.border="0px";i.cellSpacing="0px";i.cellPadding="0px";if(m.config.flowToolbars){if(Xinha.is_ie){i.style.styleFloat="left"}else{i.style.cssFloat="left"}}p.appendChild(i);var j=document.createElement("tbody");i.appendChild(j);d=document.createElement("tr");j.appendChild(d);i.className="toolbarRow"}l();function c(u,t){var j=this[u];var i=this.element;if(j!=t){switch(u){case"enabled":if(t){Xinha._removeClass(i,"buttonDisabled");i.disabled=false}else{Xinha._addClass(i,"buttonDisabled");i.disabled=true}break;case"active":if(t){Xinha._addClass(i,"buttonPressed")}else{Xinha._removeClass(i,"buttonPressed")}break}this[u]=t}}function b(x){var C=null;var t=null;var u=null;var z=m.config.customSelects;var j=null;var B="";switch(x){case"fontsize":case"fontname":case"formatblock":C=m.config[x];u=x;break;default:u=x;var A=z[u];if(typeof A!="undefined"){C=A.options;j=A.context;if(typeof A.tooltip!="undefined"){B=A.tooltip}}else{alert("ERROR [createSelect]:\nCan't find the requested dropdown definition")}break}if(C){t=document.createElement("select");t.title=B;t.style.width="auto";t.name=x;var w={name:x,element:t,enabled:true,text:false,cmd:u,state:c,context:j};Xinha.freeLater(w);s[x]=w;for(var v in C){if(typeof C[v]!="string"){continue}var y=document.createElement("option");y.innerHTML=Xinha._lc(v);y.value=C[v];t.appendChild(y)}Xinha._addEvent(t,"change",function(){m._comboSelected(t,x)})}return t}function q(i){var u,t,v=null;switch(i){case"separator":if(m.config.flowToolbars){l()}u=document.createElement("div");u.className="separator";break;case"space":u=document.createElement("div");u.className="space";break;case"linebreak":l();return false;case"textindicator":u=document.createElement("div");u.appendChild(document.createTextNode("A"));u.className="indicator";u.title=Xinha._lc("Current style");v={name:i,element:u,enabled:true,active:false,text:false,cmd:"textindicator",state:c};Xinha.freeLater(v);s[i]=v;break;default:t=m.config.btnList[i]}if(!u&&t){u=document.createElement("a");u.style.display="block";u.href="javascript:void(0)";u.style.textDecoration="none";u.title=t[0];u.className="button";u.style.direction="ltr";v={name:i,element:u,enabled:true,active:false,text:t[2],cmd:t[3],state:c,context:t[4]||null};Xinha.freeLater(u);Xinha.freeLater(v);s[i]=v;u.ondrag=function(){return false};Xinha._addEvent(u,"mouseout",function(x){if(v.enabled){Xinha._removeClass(u,"buttonActive");if(v.active){Xinha._addClass(u,"buttonPressed")}}});Xinha._addEvent(u,"mousedown",function(x){if(v.enabled){Xinha._addClass(u,"buttonActive");Xinha._removeClass(u,"buttonPressed");Xinha._stopEvent(Xinha.is_ie?window.event:x)}});Xinha._addEvent(u,"click",function(x){x=x||window.event;m.btnClickEvent={clientX:x.clientX,clientY:x.clientY};if(v.enabled){Xinha._removeClass(u,"buttonActive");if(Xinha.is_gecko){m.activateEditor()}v.cmd(m,v.name,v,x);Xinha._stopEvent(x)}});var w=Xinha.makeBtnImg(t[1]);var j=w.firstChild;Xinha.freeLater(w);Xinha.freeLater(j);u.appendChild(w);v.imgel=j;v.swapImage=function(x){if(typeof x!="string"){j.src=x[0];j.style.position="relative";j.style.top=x[2]?("-"+(18*(x[2]+1))+"px"):"-18px";j.style.left=x[1]?("-"+(18*(x[1]+1))+"px"):"-18px"}else{v.imgel.src=x;j.style.top="0px";j.style.left="0px"}}}else{if(!u){u=b(i)}}return u}var k=true;for(var h=0;h<this.config.toolbar.length;++h){if(!k){}else{k=false}if(this.config.toolbar[h]===null){this.config.toolbar[h]=["separator"]}var r=this.config.toolbar[h];for(var f=0;f<r.length;++f){var a=r[f];var n;if(/^([IT])\[(.*?)\]/.test(a)){var e=RegExp.$1=="I";var o=RegExp.$2;if(e){o=Xinha._lc(o)}n=document.createElement("td");d.appendChild(n);n.className="label";n.innerHTML=o}else{if(typeof a!="function"){var g=q(a);if(g){n=document.createElement("td");n.className="toolbarElement";d.appendChild(n);n.appendChild(g)}else{if(g===null){alert("FIXME: Unknown toolbar item: "+a)}}}}}}if(m.config.flowToolbars){p.appendChild(Xinha._createToolbarBreakingElement())}return p};Xinha.makeBtnImg=function(b,c){if(!c){c=document}if(!c._xinhaImgCache){c._xinhaImgCache={};Xinha.freeLater(c._xinhaImgCache)}var d=null;if(Xinha.is_ie&&((!c.compatMode)||(c.compatMode&&c.compatMode=="BackCompat"))){d=c.createElement("span")}else{d=c.createElement("div");d.style.position="relative"}d.style.overflow="hidden";d.style.width="18px";d.style.height="18px";d.className="buttonImageContainer";var a=null;if(typeof b=="string"){if(c._xinhaImgCache[b]){a=c._xinhaImgCache[b].cloneNode()}else{if(Xinha.ie_version<7&&/\.png$/.test(b[0])){a=c.createElement("span");a.style.display="block";a.style.width="18px";a.style.height="18px";a.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b+'")';a.unselectable="on"}else{a=c.createElement("img");a.src=b}}}else{if(c._xinhaImgCache[b[0]]){a=c._xinhaImgCache[b[0]].cloneNode()}else{if(Xinha.ie_version<7&&/\.png$/.test(b[0])){a=c.createElement("span");a.style.display="block";a.style.width="18px";a.style.height="18px";a.style.filter='progid:DXImageTransform.Microsoft.AlphaImageLoader(src="'+b[0]+'")';a.unselectable="on"}else{a=c.createElement("img");a.src=b[0]}a.style.position="relative"}a.style.top=b[2]?("-"+(18*(b[2]+1))+"px"):"-18px";a.style.left=b[1]?("-"+(18*(b[1]+1))+"px"):"-18px"}d.appendChild(a);return d};Xinha.prototype._createStatusBar=function(){this.setLoadingMessage(Xinha._lc("Create Statusbar"));var b=document.createElement("div");b.style.position="relative";b.className="statusBar";b.style.width="100%";Xinha.freeLater(this,"_statusBar");var d=document.createElement("div");d.className="statusBarWidgetContainer";d.style.position="absolute";d.style.right="0";d.style.top="0";d.style.padding="3px 3px 3px 10px";b.appendChild(d);var e=document.createElement("span");e.className="statusBarTree";e.innerHTML=Xinha._lc("Path")+": ";this._statusBarTree=e;Xinha.freeLater(this,"_statusBarTree");b.appendChild(e);var c=document.createElement("span");c.innerHTML=Xinha._lc("You are in TEXT MODE. Use the [<>] button to switch back to WYSIWYG.");c.style.display="none";this._statusBarTextMode=c;Xinha.freeLater(this,"_statusBarTextMode");b.appendChild(c);b.style.whiteSpace="nowrap";var a=this;this.notifyOn("before_resize",function(f,g){a._statusBar.style.width=null});this.notifyOn("resize",function(f,g){if(Xinha.is_ie&&Xinha.ie_version==6){a._statusBar.style.width="100%"}else{var h=g.width;a._statusBar.style.width=h+"px"}});this.notifyOn("modechange",function(f,l){for(var h in a._statusWidgets){var k=a._statusWidgets[h];for(var g=0;g<k.modes.length;g++){if(k.modes[g]==l.mode){var j=true}}if(typeof j=="undefined"){k.block.style.display="none"}else{k.block.style.display=""}}});if(!this.config.statusBar){b.style.display="none"}return b};Xinha.prototype.registerStatusWidget=function(e,c){c=c||["wysiwyg"];if(!this._statusWidgets){this._statusWidgets={}}var d=document.createElement("div");d.className="statusBarWidget";d=this._statusBar.firstChild.appendChild(d);var b=false;for(var a=0;a<c.length;a++){if(c[a]==this._editMode){b=true}}d.style.display=b==true?"":"none";this._statusWidgets[e]={block:d,modes:c};return d};Xinha.prototype.generate=function(){if(!Xinha.isSupportedBrowser){return}var w;var d=this;var e;var n=false;var a=document.getElementsByTagName("link");if(!document.getElementById("XinhaCoreDesign")){_editor_css=(typeof _editor_css=="string")?_editor_css:"Xinha.css";for(w=0;w<a.length;w++){if((a[w].rel=="stylesheet")&&(a[w].href==_editor_url+_editor_css)){n=true}}if(!n){Xinha.loadStyle(_editor_css,null,"XinhaCoreDesign",true)}}if(_editor_skin!==""&&!document.getElementById("XinhaSkin")){n=false;for(w=0;w<a.length;w++){if((a[w].rel=="stylesheet")&&(a[w].href==_editor_url+"skins/"+_editor_skin+"/skin.css")){n=true}}if(!n){Xinha.loadStyle("skins/"+_editor_skin+"/skin.css",null,"XinhaSkin")}}var f=function(){d.generate()};if(Xinha.is_ie){e=_editor_url+"modules/InternetExplorer/InternetExplorer.js";if(!Xinha.loadPlugins([{plugin:"InternetExplorer",url:e}],f)){return false}if(!this.plugins.InternetExplorer){d._browserSpecificPlugin=d.registerPlugin("InternetExplorer")}}else{if(Xinha.is_webkit){e=_editor_url+"modules/WebKit/WebKit.js";if(!Xinha.loadPlugins([{plugin:"WebKit",url:e}],f)){return false}if(!this.plugins.Webkit){d._browserSpecificPlugin=d.registerPlugin("WebKit")}}else{if(Xinha.is_opera){e=_editor_url+"modules/Opera/Opera.js";if(!Xinha.loadPlugins([{plugin:"Opera",url:e}],f)){return false}if(!this.plugins.Opera){d._browserSpecificPlugin=d.registerPlugin("Opera")}}else{if(Xinha.is_gecko){e=_editor_url+"modules/Gecko/Gecko.js";if(!Xinha.loadPlugins([{plugin:"Gecko",url:e}],f)){return false}if(!this.plugins.Gecko){d._browserSpecificPlugin=d.registerPlugin("Gecko")}}}}}if(typeof Dialog=="undefined"&&!Xinha._loadback(_editor_url+"modules/Dialogs/dialog.js",f,this)){return false}if(typeof Xinha.Dialog=="undefined"&&!Xinha._loadback(_editor_url+"modules/Dialogs/XinhaDialog.js",f,this)){return false}e=_editor_url+"modules/FullScreen/full-screen.js";if(!Xinha.loadPlugins([{plugin:"FullScreen",url:e}],f)){return false}e=_editor_url+"modules/ColorPicker/ColorPicker.js";if(!Xinha.loadPlugins([{plugin:"ColorPicker",url:e}],f)){return false}else{if(typeof Xinha.getPluginConstructor("ColorPicker")!="undefined"&&!this.plugins.colorPicker){d.registerPlugin("ColorPicker")}}var o=d.config.toolbar;for(w=o.length;--w>=0;){for(var v=o[w].length;--v>=0;){switch(o[w][v]){case"popupeditor":if(!this.plugins.FullScreen){d.registerPlugin("FullScreen")}break;case"insertimage":e=_editor_url+"modules/InsertImage/insert_image.js";if(typeof Xinha.prototype._insertImage=="undefined"&&!Xinha.loadPlugins([{plugin:"InsertImage",url:e}],f)){return false}else{if(typeof Xinha.getPluginConstructor("InsertImage")!="undefined"&&!this.plugins.InsertImage){d.registerPlugin("InsertImage")}}break;case"createlink":e=_editor_url+"modules/CreateLink/link.js";if(typeof Xinha.getPluginConstructor("Linker")=="undefined"&&!Xinha.loadPlugins([{plugin:"CreateLink",url:e}],f)){return false}else{if(typeof Xinha.getPluginConstructor("CreateLink")!="undefined"&&!this.plugins.CreateLink){d.registerPlugin("CreateLink")}}break;case"inserttable":e=_editor_url+"modules/InsertTable/insert_table.js";if(!Xinha.loadPlugins([{plugin:"InsertTable",url:e}],f)){return false}else{if(typeof Xinha.getPluginConstructor("InsertTable")!="undefined"&&!this.plugins.InsertTable){d.registerPlugin("InsertTable")}}break;case"about":e=_editor_url+"modules/AboutBox/AboutBox.js";if(!Xinha.loadPlugins([{plugin:"AboutBox",url:e}],f)){return false}else{if(typeof Xinha.getPluginConstructor("AboutBox")!="undefined"&&!this.plugins.AboutBox){d.registerPlugin("AboutBox")}}break}}}if(Xinha.is_gecko&&d.config.mozParaHandler!="built-in"){if(!Xinha.loadPlugins([{plugin:"EnterParagraphs",url:_editor_url+"modules/Gecko/paraHandlerBest.js"}],f)){return false}if(!this.plugins.EnterParagraphs){d.registerPlugin("EnterParagraphs")}}var E=this.config.getHtmlMethod=="TransformInnerHTML"?_editor_url+"modules/GetHtml/TransformInnerHTML.js":_editor_url+"modules/GetHtml/DOMwalk.js";if(!Xinha.loadPlugins([{plugin:"GetHtmlImplementation",url:E}],f)){return false}else{if(!this.plugins.GetHtmlImplementation){d.registerPlugin("GetHtmlImplementation")}}function s(i){return i.textContent||i.text}if(_editor_skin){this.skinInfo={};var u=Xinha._geturlcontent(_editor_url+"skins/"+_editor_skin+"/skin.xml",true);if(u){var p=u.getElementsByTagName("meta");for(w=0;w<p.length;w++){this.skinInfo[p[w].getAttribute("name")]=p[w].getAttribute("value")}var B=u.getElementsByTagName("recommendedIcons");if(!_editor_icons&&B.length&&s(B[0])){_editor_icons=s(B[0])}}}if(_editor_icons){var m=Xinha._geturlcontent(_editor_url+"iconsets/"+_editor_icons+"/iconset.xml",true);if(m){var F=m.getElementsByTagName("icon");var C,t,r,c,l,k;for(w=0;w<F.length;w++){C=F[w];t=C.getAttribute("id");if(C.getElementsByTagName(_editor_lang).length){C=C.getElementsByTagName(_editor_lang)[0]}else{C=C.getElementsByTagName("default")[0]}r=s(C.getElementsByTagName("path")[0]);r=(!/^\//.test(r)?_editor_url:"")+r;c=C.getAttribute("type");if(c=="map"){l=parseInt(s(C.getElementsByTagName("x")[0]),10);k=parseInt(s(C.getElementsByTagName("y")[0]),10);if(this.config.btnList[t]){this.config.btnList[t][1]=[r,l,k]}if(this.config.iconList[t]){this.config.iconList[t]=[r,l,k]}}else{if(this.config.btnList[t]){this.config.btnList[t][1]=r}if(this.config.iconList[t]){this.config.iconList[t]=r}}}}}this.setLoadingMessage(Xinha._lc("Generate Xinha framework"));this._framework={table:document.createElement("table"),tbody:document.createElement("tbody"),tb_row:document.createElement("tr"),tb_cell:document.createElement("td"),tp_row:document.createElement("tr"),tp_cell:this._panels.top.container,ler_row:document.createElement("tr"),lp_cell:this._panels.left.container,ed_cell:document.createElement("td"),rp_cell:this._panels.right.container,bp_row:document.createElement("tr"),bp_cell:this._panels.bottom.container,sb_row:document.createElement("tr"),sb_cell:document.createElement("td")};Xinha.freeLater(this._framework);var b=this._framework;b.table.border="0";b.table.cellPadding="0";b.table.cellSpacing="0";b.tb_row.style.verticalAlign="top";b.tp_row.style.verticalAlign="top";b.ler_row.style.verticalAlign="top";b.bp_row.style.verticalAlign="top";b.sb_row.style.verticalAlign="top";b.ed_cell.style.position="relative";b.tb_row.appendChild(b.tb_cell);b.tb_cell.colSpan=3;b.tp_row.appendChild(b.tp_cell);b.tp_cell.colSpan=3;b.ler_row.appendChild(b.lp_cell);b.ler_row.appendChild(b.ed_cell);b.ler_row.appendChild(b.rp_cell);b.bp_row.appendChild(b.bp_cell);b.bp_cell.colSpan=3;b.sb_row.appendChild(b.sb_cell);b.sb_cell.colSpan=3;b.tbody.appendChild(b.tb_row);b.tbody.appendChild(b.tp_row);b.tbody.appendChild(b.ler_row);b.tbody.appendChild(b.bp_row);b.tbody.appendChild(b.sb_row);b.table.appendChild(b.tbody);var D=b.table;this._htmlArea=D;Xinha.freeLater(this,"_htmlArea");D.className="htmlarea";b.tb_cell.appendChild(this._createToolbar());var g=document.createElement("iframe");g.src=this.popupURL(d.config.URIs.blank);g.id="XinhaIFrame_"+this._textArea.id;b.ed_cell.appendChild(g);this._iframe=g;this._iframe.className="xinha_iframe";Xinha.freeLater(this,"_iframe");var A=this._createStatusBar();this._statusBar=b.sb_cell.appendChild(A);var q=this._textArea;q.parentNode.insertBefore(D,q);q.className="xinha_textarea";Xinha.removeFromParent(q);b.ed_cell.appendChild(q);Xinha.addDom0Event(this._textArea,"click",function(){if(Xinha._currentlyActiveEditor!=this){d.updateToolbar()}return true});if(q.form){Xinha.prependDom0Event(this._textArea.form,"submit",function(){d.firePluginEvent("onBeforeSubmit");d._textArea.value=d.outwardHtml(d.getHTML());return true});var h=q.value;Xinha.prependDom0Event(this._textArea.form,"reset",function(){d.setHTML(d.inwardHtml(h));d.updateToolbar();return true});if(!q.form.xinha_submit){try{q.form.xinha_submit=q.form.submit;q.form.submit=function(){this.onsubmit();this.xinha_submit()}}catch(z){}}}Xinha.prependDom0Event(window,"unload",function(){d.firePluginEvent("onBeforeUnload");q.value=d.outwardHtml(d.getHTML());if(!Xinha.is_ie){D.parentNode.replaceChild(q,D)}return true});q.style.display="none";d.initSize();this.setLoadingMessage(Xinha._lc("Finishing"));d._iframeLoadDone=false;if(Xinha.is_opera){d.initIframe()}else{Xinha._addEvent(this._iframe,"load",function(i){if(!d._iframeLoadDone){d._iframeLoadDone=true;d.initIframe()}return true})}};Xinha.prototype.initSize=function(){this.setLoadingMessage(Xinha._lc("Init editor size"));var c=this;var b=null;var a=null;switch(this.config.width){case"auto":b=this._initial_ta_size.w;break;case"toolbar":b=this._toolBar.offsetWidth+"px";break;default:b=/[^0-9]/.test(this.config.width)?this.config.width:this.config.width+"px";break}a=this.config.height=="auto"?this._initial_ta_size.h:/[^0-9]/.test(this.config.height)?this.config.height:this.config.height+"px";this.sizeEditor(b,a,this.config.sizeIncludesBars,this.config.sizeIncludesPanels);this.notifyOn("panel_change",function(){c.sizeEditor()})};Xinha.prototype.sizeEditor=function(d,o,a,c){if(this._risizing){return}this._risizing=true;var l=this._framework;this.notifyOf("before_resize",{width:d,height:o});this.firePluginEvent("onBeforeResize",d,o);this._iframe.style.height="100%";this._textArea.style.height="1px";this._iframe.style.width="";this._textArea.style.width="";if(a!==null){this._htmlArea.sizeIncludesToolbars=a}if(c!==null){this._htmlArea.sizeIncludesPanels=c}if(d){this._htmlArea.style.width=d;if(!this._htmlArea.sizeIncludesPanels){var k=this._panels.right;if(k.on&&k.panels.length&&Xinha.hasDisplayedChildren(k.div)){this._htmlArea.style.width=(this._htmlArea.offsetWidth+parseInt(this.config.panel_dimensions.right,10))+"px"}var p=this._panels.left;if(p.on&&p.panels.length&&Xinha.hasDisplayedChildren(p.div)){this._htmlArea.style.width=(this._htmlArea.offsetWidth+parseInt(this.config.panel_dimensions.left,10))+"px"}}}if(o){this._htmlArea.style.height=o;if(!this._htmlArea.sizeIncludesToolbars){this._htmlArea.style.height=(this._htmlArea.offsetHeight+this._toolbar.offsetHeight+this._statusBar.offsetHeight)+"px"}if(!this._htmlArea.sizeIncludesPanels){var f=this._panels.top;if(f.on&&f.panels.length&&Xinha.hasDisplayedChildren(f.div)){this._htmlArea.style.height=(this._htmlArea.offsetHeight+parseInt(this.config.panel_dimensions.top,10))+"px"}var n=this._panels.bottom;if(n.on&&n.panels.length&&Xinha.hasDisplayedChildren(n.div)){this._htmlArea.style.height=(this._htmlArea.offsetHeight+parseInt(this.config.panel_dimensions.bottom,10))+"px"}}}d=this._htmlArea.offsetWidth;o=this._htmlArea.offsetHeight;var j=this._panels;var i=this;var b=1;function h(q){if(j[q].on&&j[q].panels.length&&Xinha.hasDisplayedChildren(j[q].container)){j[q].container.style.display="";return true}else{j[q].container.style.display="none";return false}}if(h("left")){b+=1}if(h("right")){b+=1}l.tb_cell.colSpan=b;l.tp_cell.colSpan=b;l.bp_cell.colSpan=b;l.sb_cell.colSpan=b;if(!l.tp_row.childNodes.length){Xinha.removeFromParent(l.tp_row)}else{if(!Xinha.hasParentNode(l.tp_row)){l.tbody.insertBefore(l.tp_row,l.ler_row)}}if(!l.bp_row.childNodes.length){Xinha.removeFromParent(l.bp_row)}else{if(!Xinha.hasParentNode(l.bp_row)){l.tbody.insertBefore(l.bp_row,l.ler_row.nextSibling)}}if(!this.config.statusBar){Xinha.removeFromParent(l.sb_row)}else{if(!Xinha.hasParentNode(l.sb_row)){l.table.appendChild(l.sb_row)}}l.lp_cell.style.width=this.config.panel_dimensions.left;l.rp_cell.style.width=this.config.panel_dimensions.right;l.tp_cell.style.height=this.config.panel_dimensions.top;l.bp_cell.style.height=this.config.panel_dimensions.bottom;l.tb_cell.style.height=this._toolBar.offsetHeight+"px";l.sb_cell.style.height=this._statusBar.offsetHeight+"px";var m=o-this._toolBar.offsetHeight-this._statusBar.offsetHeight;if(h("top")){m-=parseInt(this.config.panel_dimensions.top,10)}if(h("bottom")){m-=parseInt(this.config.panel_dimensions.bottom,10)}this._iframe.style.height=m+"px";var e=d;if(h("left")){e-=parseInt(this.config.panel_dimensions.left,10)}if(h("right")){e-=parseInt(this.config.panel_dimensions.right,10)}var g=this.config.iframeWidth?parseInt(this.config.iframeWidth,10):null;this._iframe.style.width=(g&&g<e)?g+"px":e+"px";this._textArea.style.height=this._iframe.style.height;this._textArea.style.width=this._iframe.style.width;this.notifyOf("resize",{width:this._htmlArea.offsetWidth,height:this._htmlArea.offsetHeight});this.firePluginEvent("onResize",this._htmlArea.offsetWidth,this._htmlArea.offsetWidth);this._risizing=false};Xinha.prototype.registerPanel=function(c,b){if(!c){c="right"}this.setLoadingMessage("Register "+c+" panel ");var a=this.addPanel(c);if(b){b.drawPanelIn(a)}};Xinha.prototype.addPanel=function(a){var b=document.createElement("div");b.side=a;if(a=="left"||a=="right"){b.style.width=this.config.panel_dimensions[a];if(this._iframe){b.style.height=this._iframe.style.height}}Xinha.addClasses(b,"panel");this._panels[a].panels.push(b);this._panels[a].div.appendChild(b);this.notifyOf("panel_change",{action:"add",panel:b});this.firePluginEvent("onPanelChange","add",b);return b};Xinha.prototype.removePanel=function(a){this._panels[a.side].div.removeChild(a);var c=[];for(var b=0;b<this._panels[a.side].panels.length;b++){if(this._panels[a.side].panels[b]!=a){c.push(this._panels[a.side].panels[b])}}this._panels[a.side].panels=c;this.notifyOf("panel_change",{action:"remove",panel:a});this.firePluginEvent("onPanelChange","remove",a)};Xinha.prototype.hidePanel=function(a){if(a&&a.style.display!="none"){try{var c=this.scrollPos(this._iframe.contentWindow)}catch(b){}a.style.display="none";this.notifyOf("panel_change",{action:"hide",panel:a});this.firePluginEvent("onPanelChange","hide",a);try{this._iframe.contentWindow.scrollTo(c.x,c.y)}catch(b){}}};Xinha.prototype.showPanel=function(a){if(a&&a.style.display=="none"){try{var c=this.scrollPos(this._iframe.contentWindow)}catch(b){}a.style.display="";this.notifyOf("panel_change",{action:"show",panel:a});this.firePluginEvent("onPanelChange","show",a);try{this._iframe.contentWindow.scrollTo(c.x,c.y)}catch(b){}}};Xinha.prototype.hidePanels=function(b){if(typeof b=="undefined"){b=["left","right","top","bottom"]}var c=[];for(var a=0;a<b.length;a++){if(this._panels[b[a]].on){c.push(b[a]);this._panels[b[a]].on=false}}this.notifyOf("panel_change",{action:"multi_hide",sides:b});this.firePluginEvent("onPanelChange","multi_hide",b)};Xinha.prototype.showPanels=function(c){if(typeof c=="undefined"){c=["left","right","top","bottom"]}var a=[];for(var b=0;b<c.length;b++){if(!this._panels[c[b]].on){a.push(c[b]);this._panels[c[b]].on=true}}this.notifyOf("panel_change",{action:"multi_show",sides:c});this.firePluginEvent("onPanelChange","multi_show",c)};Xinha.objectProperties=function(c){var b=[];for(var a in c){b[b.length]=a}return b};Xinha.prototype.editorIsActivated=function(){try{return Xinha.is_designMode?this._doc.designMode=="on":this._doc.body.contentEditable}catch(a){return false}};Xinha._someEditorHasBeenActivated=false;Xinha._currentlyActiveEditor=null;Xinha.prototype.activateEditor=function(){if(this.currentModal){return}if(Xinha._currentlyActiveEditor){if(Xinha._currentlyActiveEditor==this){return true}Xinha._currentlyActiveEditor.deactivateEditor()}if(Xinha.is_designMode&&this._doc.designMode!="on"){try{if(this._iframe.style.display=="none"){this._iframe.style.display="";this._doc.designMode="on";this._iframe.style.display="none"}else{this._doc.designMode="on"}}catch(a){}}else{if(Xinha.is_ie&&this._doc.body.contentEditable!==true){this._doc.body.contentEditable=true}}Xinha._someEditorHasBeenActivated=true;Xinha._currentlyActiveEditor=this;var b=this;this.enableToolbar()};Xinha.prototype.deactivateEditor=function(){this.disableToolbar();if(Xinha.is_designMode&&this._doc.designMode!="off"){try{this._doc.designMode="off"}catch(a){}}else{if(!Xinha.is_designMode&&this._doc.body.contentEditable!==false){this._doc.body.contentEditable=false}}if(Xinha._currentlyActiveEditor!=this){return}Xinha._currentlyActiveEditor=false};Xinha.prototype.initIframe=function(){this.disableToolbar();var g=null;var f=this;try{if(f._iframe.contentDocument){this._doc=f._iframe.contentDocument}else{this._doc=f._iframe.contentWindow.document}g=this._doc;if(!g){if(Xinha.is_gecko){setTimeout(function(){f.initIframe()},50);return false}else{alert("ERROR: IFRAME can't be initialized.")}}}catch(e){setTimeout(function(){f.initIframe()},50)}Xinha.freeLater(this,"_doc");g.open("text/html","replace");var d="",a;if(f.config.browserQuirksMode===false){a='<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">'}else{if(f.config.browserQuirksMode===true){a=""}else{a=Xinha.getDoctype(document)}}if(!f.config.fullPage){d+=a+"\n";d+="<html>\n";d+="<head>\n";d+='<meta http-equiv="Content-Type" content="text/html; charset='+f.config.charSet+'">\n';if(typeof f.config.baseHref!="undefined"&&f.config.baseHref!==null){d+='<base href="'+f.config.baseHref+'"/>\n'}d+=Xinha.addCoreCSS();if(typeof f.config.pageStyleSheets!=="undefined"){for(var c=0;c<f.config.pageStyleSheets.length;c++){if(f.config.pageStyleSheets[c].length>0){d+='<link rel="stylesheet" type="text/css" href="'+f.config.pageStyleSheets[c]+'">'}}}if(f.config.pageStyle){d+='<style type="text/css">\n'+f.config.pageStyle+"\n</style>"}d+="</head>\n";d+="<body"+(f.config.bodyID?(' id="'+f.config.bodyID+'"'):"")+(f.config.bodyClass?(' class="'+f.config.bodyClass+'"'):"")+">\n";d+=f.inwardHtml(f._textArea.value);d+="</body>\n";d+="</html>"}else{d=f.inwardHtml(f._textArea.value);if(d.match(Xinha.RE_doctype)){f.setDoctype(RegExp.$1)}var b=d.match(/<link\s+[\s\S]*?["']\s*\/?>/gi);d=d.replace(/<link\s+[\s\S]*?["']\s*\/?>\s*/gi,"");if(b){d=d.replace(/<\/head>/i,b.join("\n")+"\n</head>")}}g.write(d);g.close();if(this.config.fullScreen){this._fullScreen()}this.setEditorEvents();if((typeof f.config.autofocus!="undefined")&&((f.config.autofocus==f._textArea.id)||f.config.autofocus==true)){f.activateEditor();f.focusEditor()}};Xinha.prototype.whenDocReady=function(a){var b=this;if(this._doc&&this._doc.body){a()}else{setTimeout(function(){b.whenDocReady(a)},50)}};Xinha.prototype.setMode=function(b){var a;if(typeof b=="undefined"){b=this._editMode=="textmode"?"wysiwyg":"textmode"}switch(b){case"textmode":this.firePluginEvent("onBeforeMode","textmode");this._toolbarObjects.htmlmode.swapImage(this.config.iconList.wysiwygmode);this.setCC("iframe");a=this.outwardHtml(this.getHTML());this.setHTML(a);this.deactivateEditor();this._iframe.style.display="none";this._textArea.style.display="";if(this.config.statusBar){this._statusBarTree.style.display="none";this._statusBarTextMode.style.display=""}this.findCC("textarea");this.notifyOf("modechange",{mode:"text"});this.firePluginEvent("onMode","textmode");break;case"wysiwyg":this.firePluginEvent("onBeforeMode","wysiwyg");this._toolbarObjects.htmlmode.swapImage([this.imgURL("images/ed_buttons_main.png"),7,0]);this.setCC("textarea");a=this.inwardHtml(this.getHTML());this.deactivateEditor();this.setHTML(a);this._iframe.style.display="";this._textArea.style.display="none";this.activateEditor();if(this.config.statusBar){this._statusBarTree.style.display="";this._statusBarTextMode.style.display="none"}this.findCC("iframe");this.notifyOf("modechange",{mode:"wysiwyg"});this.firePluginEvent("onMode","wysiwyg");break;default:alert("Mode <"+b+"> not defined!");return false}this._editMode=b};Xinha.prototype.setFullHTML=function(c){var a=RegExp.multiline;RegExp.multiline=true;if(c.match(Xinha.RE_doctype)){this.setDoctype(RegExp.$1)}RegExp.multiline=a;if(0){if(c.match(Xinha.RE_head)){this._doc.getElementsByTagName("head")[0].innerHTML=RegExp.$1}if(c.match(Xinha.RE_body)){this._doc.getElementsByTagName("body")[0].innerHTML=RegExp.$1}}else{var d=this.editorIsActivated();if(d){this.deactivateEditor()}var b=/<html>((.|\n)*?)<\/html>/i;c=c.replace(b,"$1");this._doc.open("text/html","replace");this._doc.write(c);this._doc.close();if(d){this.activateEditor()}this.setEditorEvents();return true}};Xinha.prototype.setEditorEvents=function(){var a=this;var b=this._doc;a.whenDocReady(function(){Xinha._addEvents(b,["mousedown"],function(){a.activateEditor();return true});if(Xinha.is_ie){Xinha._addEvent(a._doc.getElementsByTagName("html")[0],"click",function(){if(a._iframe.contentWindow.event.srcElement.tagName.toLowerCase()=="html"){var e=a._doc.body.createTextRange();e.collapse();e.select()}return true})}Xinha._addEvents(b,["keydown","keypress","mousedown","mouseup","drag"],function(e){return a._editorEvent(Xinha.is_ie?a._iframe.contentWindow.event:e)});for(var c in a.plugins){var d=a.plugins[c].instance;Xinha.refreshPlugin(d)}if(typeof a._onGenerate=="function"){a._onGenerate()}Xinha.addDom0Event(window,"resize",function(f){if(Xinha.ie_version>7&&!window.parent){if(a.execResize){a.sizeEditor();a.execResize=false}else{a.execResize=true}}else{a.sizeEditor()}});a.removeLoadingMessage()})};Xinha.getPluginConstructor=function(a){return Xinha.plugins[a]||window[a]};Xinha.prototype.registerPlugin=function(){if(!Xinha.isSupportedBrowser){return}var c=arguments[0];if(c===null||typeof c=="undefined"||(typeof c=="string"&&Xinha.getPluginConstructor(c)=="undefined")){return false}var a=[];for(var b=1;b<arguments.length;++b){a.push(arguments[b])}return this.registerPlugin2(c,a)};Xinha.prototype.registerPlugin2=function(c,a){if(typeof c=="string"&&typeof Xinha.getPluginConstructor(c)=="function"){var d=c;c=Xinha.getPluginConstructor(c)}if(typeof c=="undefined"){return false}if(!c._pluginInfo){c._pluginInfo={name:d}}var f=new c(this,a);if(f){var g={};var e=c._pluginInfo;for(var b in e){g[b]=e[b]}g.instance=f;g.args=a;this.plugins[c._pluginInfo.name]=g;return f}else{Xinha.debugMsg("Can't register plugin "+c.toString()+".","warn")}};Xinha.getPluginDir=function(b,a){if(Xinha.externalPlugins[b]){return Xinha.externalPlugins[b][0]}if(a||(Xinha.getPluginConstructor(b)&&(typeof Xinha.getPluginConstructor(b).supported!="undefined")&&!Xinha.getPluginConstructor(b).supported)){return _editor_url+"unsupported_plugins/"+b}return _editor_url+"plugins/"+b};Xinha.loadPlugin=function(d,e,a){if(!Xinha.isSupportedBrowser){return}Xinha.setLoadingMessage(Xinha._lc("Loading plugin $plugin="+d+"$"));if(typeof Xinha.getPluginConstructor(d)!="undefined"){if(e){e(d)}return true}Xinha._pluginLoadStatus[d]="loading";function c(j,m){var l,i,k,h;switch(j){case"start":l="old_naming";i=Xinha.getPluginDir(m);k=m+".js";break;case"old_naming":l="unsupported";i=Xinha.getPluginDir(m);k=m.replace(/([a-z])([A-Z])([a-z])/g,function(p,o,n,q){return o+"-"+n.toLowerCase()+q}).toLowerCase()+".js";h="You are using an obsolete naming scheme for the Xinha plugin "+m+". Please rename "+k+" to "+m+".js";break;case"unsupported":l="unsupported_old_name";i=Xinha.getPluginDir(m,true);k=m+".js";h="You are using the unsupported Xinha plugin "+m+". If you wish continued support, please see http://trac.xinha.org/ticket/1297";break;case"unsupported_old_name":l="";i=Xinha.getPluginDir(m,true);k=m.replace(/([a-z])([A-Z])([a-z])/g,function(p,o,n,q){return o+"-"+n.toLowerCase()+q}).toLowerCase()+".js";h="You are using the unsupported Xinha plugin "+m+". If you wish continued support, please see http://trac.xinha.org/ticket/1297";break;default:Xinha._pluginLoadStatus[m]="failed";Xinha.debugMsg("Xinha was not able to find the plugin "+m+". Please make sure the plugin exists.","warn");return}var g=i+"/"+k;function f(n){Xinha.getPluginConstructor(n).supported=j.indexOf("unsupported")!==0;e(n)}Xinha._loadback(g,f,this,m);Xinha.ping(g,function(){if(h){Xinha.debugMsg(h)}},function(){Xinha.removeFromParent(document.getElementById(g));c(l,m)})}if(!a){if(Xinha.externalPlugins[d]){Xinha._loadback(Xinha.externalPlugins[d][0]+Xinha.externalPlugins[d][1],e,this,d)}else{var b=this;c("start",d)}}else{Xinha._loadback(a,e,this,d)}return false};Xinha._pluginLoadStatus={};Xinha.externalPlugins={};Xinha.plugins={};Xinha.loadPlugins=function(c,f,d){if(!Xinha.isSupportedBrowser){return}var b,e;for(e=0;e<c.length;e++){if(typeof c[e]=="object"){b=c[e].url.match(/(.*)(\/[^\/]*)$/);Xinha.externalPlugins[c[e].plugin]=[b[1],b[2]];c[e]=c[e].plugin}}var h=true;var a=Xinha.cloneObject(c);for(e=0;e<a.length;e++){var g=a[e];if(g=="FullScreen"&&!Xinha.externalPlugins.FullScreen){continue}if(typeof Xinha._pluginLoadStatus[g]=="undefined"){Xinha.loadPlugin(g,function(i){Xinha.setLoadingMessage(Xinha._lc("Finishing"));if(typeof Xinha.getPluginConstructor(i)!="undefined"){Xinha._pluginLoadStatus[i]="ready"}else{Xinha._pluginLoadStatus[i]="failed"}},d);h=false}else{if(Xinha._pluginLoadStatus[g]=="loading"){h=false}}}if(h){return true}if(f){setTimeout(function(){if(Xinha.loadPlugins(c,f)){f()}},50)}return h};Xinha.refreshPlugin=function(a){if(a&&typeof a.onGenerate=="function"){a.onGenerate()}if(a&&typeof a.onGenerateOnce=="function"){a._ongenerateOnce=a.onGenerateOnce;delete (a.onGenerateOnce);a._ongenerateOnce();delete (a._ongenerateOnce)}};Xinha.prototype.firePluginEvent=function(b){var e=[];for(var c=1;c<arguments.length;c++){e[c-1]=arguments[c]}for(c in this.plugins){var d=this.plugins[c].instance;if(d==this._browserSpecificPlugin){continue}if(d&&typeof d[b]=="function"){var a=(c=="Events")?this:d;if(d[b].apply(a,e)){return true}}}d=this._browserSpecificPlugin;if(d&&typeof d[b]=="function"){if(d[b].apply(d,e)){return true}}return false};Xinha.loadStyle=function(d,f,g,a){var b=_editor_url||"";if(f){b=Xinha.getPluginDir(f)+"/"}b+=d;if(/^\//.test(d)){b=d}var c=document.getElementsByTagName("head")[0];var e=document.createElement("link");e.rel="stylesheet";e.href=b;e.type="text/css";if(g){e.id=g}if(a&&c.getElementsByTagName("link")[0]){c.insertBefore(e,c.getElementsByTagName("link")[0])}else{c.appendChild(e)}};Xinha.prototype.debugTree=function(){var c=document.createElement("textarea");c.style.width="100%";c.style.height="20em";c.value="";function b(d,e){for(;--d>=0;){c.value+=" "}c.value+=e+"\n"}function a(e,h){var d=e.tagName.toLowerCase(),f;var g=Xinha.is_ie?e.scopeName:e.prefix;b(h,"- "+d+" ["+g+"]");for(f=e.firstChild;f;f=f.nextSibling){if(f.nodeType==1){a(f,h+2)}}}a(this._doc.body,0);document.body.appendChild(c)};Xinha.getInnerText=function(c){var a="",b;for(b=c.firstChild;b;b=b.nextSibling){if(b.nodeType==3){a+=b.data}else{if(b.nodeType==1){a+=Xinha.getInnerText(b)}}}return a};Xinha.prototype._wordClean=function(){var e=this;var c={empty_tags:0,cond_comm:0,mso_elmts:0,mso_class:0,mso_style:0,mso_xmlel:0,orig_len:this._doc.body.innerHTML.length,T:new Date().getTime()};var h={empty_tags:"Empty tags removed: ",cond_comm:"Conditional comments removed",mso_elmts:"MSO invalid elements removed",mso_class:"MSO class names removed: ",mso_style:"MSO inline style removed: ",mso_xmlel:"MSO XML elements stripped: "};function a(){var j="Xinha word cleaner stats: \n\n";for(var k in c){if(h[k]){j+=h[k]+c[k]+"\n"}}j+="\nInitial document length: "+c.orig_len+"\n";j+="Final document length: "+e._doc.body.innerHTML.length+"\n";j+="Clean-up took "+((new Date().getTime()-c.T)/1000)+" seconds";alert(j)}function i(j){var k=j.className.replace(/(^|\s)mso.*?(\s|$)/ig," ");if(k!=j.className){j.className=k;if(!/\S/.test(j.className)){j.removeAttribute("className");++c.mso_class}}}function f(k){var l=k.style.cssText.split(/\s*;\s*/);for(var j=l.length;--j>=0;){if(/^mso|^tab-stops/i.test(l[j])||/^margin\s*:\s*0..\s+0..\s+0../i.test(l[j])){++c.mso_style;l.splice(j,1)}}k.style.cssText=l.join("; ")}function d(j){if(("link"==j.tagName.toLowerCase()&&(j.attributes&&/File-List|Edit-Time-Data|themeData|colorSchemeMapping/.test(j.attributes.rel.nodeValue)))||/^(style|meta)$/i.test(j.tagName)){Xinha.removeFromParent(j);++c.mso_elmts;return true}return false}function b(j){if(/^(a|span|b|strong|i|em|font|div|p)$/i.test(j.tagName)&&!j.firstChild){Xinha.removeFromParent(j);++c.empty_tags;return true}return false}function g(j){i(j);f(j);var m;for(var l=j.firstChild;l;l=m){m=l.nextSibling;if(l.nodeType==1&&g(l)){if((Xinha.is_ie&&j.scopeName!="HTML")||(!Xinha.is_ie&&/:/.test(l.tagName))){for(var k=l.childNodes&&l.childNodes.length-1;l.childNodes&&l.childNodes.length&&l.childNodes[k];--k){if(l.nextSibling){l.parentNode.insertBefore(l.childNodes[k],l.nextSibling)}else{l.parentNode.appendChild(l.childNodes[k])}}Xinha.removeFromParent(l);continue}if(b(l)){continue}if(d(l)){continue}}else{if(l.nodeType==8){if(/(\s*\[\s*if\s*(([gl]te?|!)\s*)?(IE|mso)\s*(\d+(\.\d+)?\s*)?\]>)/.test(l.nodeValue)){Xinha.removeFromParent(l);++c.cond_comm}}}}return true}g(this._doc.body);this.updateToolbar()};Xinha.prototype._clearFonts=function(){var a=this.getInnerHTML();if(confirm(Xinha._lc("Would you like to clear font typefaces?"))){a=a.replace(/face="[^"]*"/gi,"");a=a.replace(/font-family:[^;}"']+;?/gi,"")}if(confirm(Xinha._lc("Would you like to clear font sizes?"))){a=a.replace(/size="[^"]*"/gi,"");a=a.replace(/font-size:[^;}"']+;?/gi,"")}if(confirm(Xinha._lc("Would you like to clear font colours?"))){a=a.replace(/color="[^"]*"/gi,"");a=a.replace(/([^\-])color:[^;}"']+;?/gi,"$1")}a=a.replace(/(style|class)="\s*"/gi,"");a=a.replace(/<(font|span)\s*>/gi,"");this.setHTML(a);this.updateToolbar()};Xinha.prototype._splitBlock=function(){this._doc.execCommand("formatblock",false,"div")};Xinha.prototype.forceRedraw=function(){this._doc.body.style.visibility="hidden";this._doc.body.style.visibility=""};Xinha.prototype.focusEditor=function(){switch(this._editMode){case"wysiwyg":try{if(Xinha._someEditorHasBeenActivated){this.activateEditor();this._iframe.contentWindow.focus()}}catch(a){}break;case"textmode":try{this._textArea.focus()}catch(b){}break;default:alert("ERROR: mode "+this._editMode+" is not defined")}return this._doc};Xinha.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--}};Xinha.prototype.undo=function(){if(this._undoPos>0){var a=this._undoQueue[--this._undoPos];if(a){this.setHTML(a)}else{++this._undoPos}}};Xinha.prototype.redo=function(){if(this._undoPos<this._undoQueue.length-1){var a=this._undoQueue[++this._undoPos];if(a){this.setHTML(a)}else{--this._undoPos}}};Xinha.prototype.disableToolbar=function(c){if(this._timerToolbar){clearTimeout(this._timerToolbar)}if(typeof c=="undefined"){c=[]}else{if(typeof c!="object"){c=[c]}}for(var b in this._toolbarObjects){var a=this._toolbarObjects[b];if(c.contains(b)){continue}if(typeof a.state!="function"){continue}a.state("enabled",false)}};Xinha.prototype.enableToolbar=function(){this.updateToolbar()};Xinha.prototype.updateToolbar=function(noStatus){if(this.suspendUpdateToolbar){return}var doc=this._doc;var text=(this._editMode=="textmode");var ancestors=null;if(!text){ancestors=this.getAllAncestors();if(this.config.statusBar&&!noStatus){while(this._statusBarItems.length){var item=this._statusBarItems.pop();item.el=null;item.editor=null;item.onclick=null;item.oncontextmenu=null;item._xinha_dom0Events.click=null;item._xinha_dom0Events.contextmenu=null;item=null}this._statusBarTree.innerHTML=Xinha._lc("Path")+": ";for(var i=ancestors.length;--i>=0;){var el=ancestors[i];if(!el){continue}var a=document.createElement("a");a.href="javascript:void(0);";a.el=el;a.editor=this;this._statusBarItems.push(a);Xinha.addDom0Event(a,"click",function(){this.blur();this.editor.selectNodeContents(this.el);this.editor.updateToolbar(true);return false});Xinha.addDom0Event(a,"contextmenu",function(){this.blur();var info="Inline style:\n\n";info+=this.el.style.cssText.split(/;\s*/).join(";\n");alert(info);return false});var txt=el.tagName.toLowerCase();switch(txt){case"b":txt="strong";break;case"i":txt="em";break;case"strike":txt="del";break}if(typeof el.style!="undefined"){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)))}Xinha.freeLater(a)}}}for(var cmd in this._toolbarObjects){var btn=this._toolbarObjects[cmd];var inContext=true;if(typeof btn.state!="function"){continue}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=0;k<ancestors.length;++k){if(!ancestors[k]){continue}if(match||(ancestors[k].tagName.toLowerCase()==context)){inContext=true;var contextSplit=null;var att=null;var comp=null;var attVal=null;for(var ka=0;ka<attrs.length;++ka){contextSplit=attrs[ka].match(/(.*)(==|!=|===|!==|>|>=|<|<=)(.*)/);att=contextSplit[1];comp=contextSplit[2];attVal=contextSplit[3];if(!eval(ancestors[k][att]+comp+attVal)){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":if(!text){try{var value=(""+doc.queryCommandValue(cmd)).toLowerCase();if(!value){btn.element.selectedIndex=0;break}var options=this.config[cmd];var sIndex=0;for(var j in options){if((j.toLowerCase()==value)||(options[j].substr(0,value.length).toLowerCase()==value)){btn.element.selectedIndex=sIndex;throw"ok"}++sIndex}btn.element.selectedIndex=0}catch(ex){}}break;case"formatblock":var blocks=[];for(var indexBlock in this.config.formatblock){if(typeof this.config.formatblock[indexBlock]=="string"){blocks[blocks.length]=this.config.formatblock[indexBlock]}}var deepestAncestor=this._getFirstAncestor(this.getSelection(),blocks);if(deepestAncestor){for(var x=0;x<blocks.length;x++){if(blocks[x].toLowerCase()==deepestAncestor.tagName.toLowerCase()){btn.element.selectedIndex=x}}}else{btn.element.selectedIndex=0}break;case"textindicator":if(!text){try{var style=btn.element.style;style.backgroundColor=Xinha._makeColor(doc.queryCommandValue(Xinha.is_ie?"backcolor":"hilitecolor"));if(/transparent/i.test(style.backgroundColor)){style.backgroundColor=Xinha._makeColor(doc.queryCommandValue("backcolor"))}style.color=Xinha._makeColor(doc.queryCommandValue("forecolor"));style.fontFamily=doc.queryCommandValue("fontname");style.fontWeight=doc.queryCommandState("bold")?"bold":"normal";style.fontStyle=doc.queryCommandState("italic")?"italic":"normal"}catch(ex){}}break;case"htmlmode":btn.state("active",text);break;case"lefttoright":case"righttoleft":var eltBlock=this.getParentElement();while(eltBlock&&!Xinha.isBlockElement(eltBlock)){eltBlock=eltBlock.parentNode}if(eltBlock){btn.state("active",(eltBlock.style.direction==((cmd=="righttoleft")?"rtl":"ltr")))}break;default:cmd=cmd.replace(/(un)?orderedlist/i,"insert$1orderedlist");try{btn.state("active",(!text&&doc.queryCommandState(cmd)))}catch(ex){}break}}if(this._customUndo&&!this._timerUndo){this._undoTakeSnapshot();var editor=this;this._timerUndo=setTimeout(function(){editor._timerUndo=null},this.config.undoTimeout)}this.firePluginEvent("onUpdateToolbar")};Xinha.getEditor=function(c){for(var a=__xinhas.length;a--;){var b=__xinhas[a];if(b&&(b._textArea.id==c||b._textArea.name==c||b._textArea==c)){return b}}return null};Xinha.prototype.getPluginInstance=function(a){if(this.plugins[a]){return this.plugins[a].instance}else{return null}};Xinha.prototype.getAllAncestors=function(){var c=this.getParentElement();var b=[];while(c&&(c.nodeType==1)&&(c.tagName.toLowerCase()!="body")){b.push(c);c=c.parentNode}b.push(this._doc.body);return b};Xinha.prototype._getFirstAncestor=function(e,d){var c=this.activeElement(e);if(c===null){try{c=(Xinha.is_ie?this.createRange(e).parentElement():this.createRange(e).commonAncestorContainer)}catch(b){return null}}if(typeof d=="string"){d=[d]}while(c){if(c.nodeType==1){if(d===null){return c}for(var a=0;a<d.length;++a){if(typeof d[a]=="string"&&d[a]==c.tagName.toLowerCase()){return c}else{if(typeof d[a]=="function"&&d[a](this,c)){return c}}}if(c.tagName.toLowerCase()=="body"){break}if(c.tagName.toLowerCase()=="table"){break}}c=c.parentNode}return null};Xinha.prototype._getAncestorBlock=function(b){var a=(Xinha.is_ie?this.createRange(b).parentElement:this.createRange(b).commonAncestorContainer);while(a&&(a.nodeType==1)){switch(a.tagName.toLowerCase()){case"div":case"p":case"address":case"blockquote":case"center":case"del":case"ins":case"pre":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":case"h7":return a;case"body":case"noframes":case"dd":case"li":case"th":case"td":case"noscript":return null;default:break}}return null};Xinha.prototype._createImplicitBlock=function(b){var c=this.getSelection();if(Xinha.is_ie){c.empty()}else{c.collapseToStart()}var a=this.createRange(c)};Xinha.prototype.surroundHTML=function(c,b){var a=this.getSelectedHTML();this.insertHTML(c+a+b)};Xinha.prototype.hasSelectedText=function(){return this.getSelectedHTML()!==""};Xinha.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":if(!c){this.updateToolbar();break}if(!Xinha.is_gecko||c!=="blockquote"){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")}break}};Xinha.prototype._colorSelector=function(h){var g=this;if(Xinha.is_gecko){try{g._doc.execCommand("useCSS",false,false);g._doc.execCommand("styleWithCSS",false,true)}catch(e){}}var d=g._toolbarObjects[h].element;var f;if(h=="hilitecolor"){if(Xinha.is_ie){h="backcolor";f=Xinha._colorToRgb(g._doc.queryCommandValue("backcolor"))}else{f=Xinha._colorToRgb(g._doc.queryCommandValue("hilitecolor"))}}else{f=Xinha._colorToRgb(g._doc.queryCommandValue("forecolor"))}var b=function(i){g._doc.execCommand(h,false,i)};if(Xinha.is_ie){var a=g.createRange(g.getSelection());b=function(i){a.select();g._doc.execCommand(h,false,i)}}var c=new Xinha.colorPicker({cellsize:g.config.colorPickerCellSize,callback:b,granularity:g.config.colorPickerGranularity,websafe:g.config.colorPickerWebSafe,savecolors:g.config.colorPickerSaveColors});c.open(g.config.colorPickerPosition,d,f)};Xinha.prototype.execCommand=function(h,f,g){var e=this;this.focusEditor();h=h.toLowerCase();if(this.firePluginEvent("onExecCommand",h,f,g)){this.updateToolbar();return false}switch(h){case"htmlmode":this.setMode();break;case"hilitecolor":case"forecolor":this._colorSelector(h);break;case"createlink":this._createLink();break;case"undo":case"redo":if(this._customUndo){this[h]()}else{this._doc.execCommand(h,f,g)}break;case"inserttable":this._insertTable();break;case"insertimage":this._insertImage();break;case"showhelp":this._popupDialog(e.config.URIs.help,null,this);break;case"killword":this._wordClean();break;case"cut":case"copy":case"paste":this._doc.execCommand(h,f,g);if(this.config.killWordOnPaste){this._wordClean()}break;case"lefttoright":case"righttoleft":if(this.config.changeJustifyWithDirection){this._doc.execCommand((h=="righttoleft")?"justifyright":"justifyleft",f,g)}var a=(h=="righttoleft")?"rtl":"ltr";var d=this.getParentElement();while(d&&!Xinha.isBlockElement(d)){d=d.parentNode}if(d){if(d.style.direction==a){d.style.direction=""}else{d.style.direction=a}}break;case"justifyleft":case"justifyright":h.match(/^justify(.*)$/);var c=this.activeElement(this.getSelection());if(c&&c.tagName.toLowerCase()=="img"){c.align=c.align==RegExp.$1?"":RegExp.$1}else{this._doc.execCommand(h,f,g)}break;default:try{this._doc.execCommand(h,f,g)}catch(b){if(this.config.debug){alert(b+"\n\nby execCommand("+h+");")}}break}this.updateToolbar();return false};Xinha.prototype._editorEvent=function(b){var a=this;if(typeof a._textArea["on"+b.type]=="function"){a._textArea["on"+b.type](b)}if(this.isKeyEvent(b)){if(a.firePluginEvent("onKeyPress",b)){return false}if(this.isShortCut(b)){this._shortCuts(b)}}if(b.type=="mousedown"){if(a.firePluginEvent("onMouseDown",b)){return false}}if(a._timerToolbar){clearTimeout(a._timerToolbar)}if(!this.suspendUpdateToolbar){a._timerToolbar=setTimeout(function(){a.updateToolbar();a._timerToolbar=null},250)}};Xinha.prototype._shortCuts=function(b){var a=this.getKey(b).toLowerCase();var d=null;var c=null;switch(a){case"b":d="bold";break;case"i":d="italic";break;case"u":d="underline";break;case"s":d="strikethrough";break;case"l":d="justifyleft";break;case"e":d="justifycenter";break;case"r":d="justifyright";break;case"j":d="justifyfull";break;case"z":d="undo";break;case"y":d="redo";break;case"v":d="paste";break;case"n":d="formatblock";c="p";break;case"0":d="killword";break;case"1":case"2":case"3":case"4":case"5":case"6":d="formatblock";c="h"+a;break}if(d){this.execCommand(d,false,c);Xinha._stopEvent(b)}};Xinha.prototype.convertNode=function(a,c){var b=this._doc.createElement(c);while(a.firstChild){b.appendChild(a.firstChild)}return b};Xinha.prototype.scrollToElement=function(b){if(!b){b=this.getParentElement();if(!b){return}}var a=Xinha.getElementTopLeft(b);this._iframe.contentWindow.scrollTo(a.left,a.top)};Xinha.prototype.getEditorContent=function(){return this.outwardHtml(this.getHTML())};Xinha.prototype.setEditorContent=function(a){this.setHTML(this.inwardHtml(a))};Xinha.updateTextareas=function(){var b;for(var a=0;a<__xinhas.length;a++){b=__xinhas[a];b._textArea.value=b.getEditorContent()}};Xinha.prototype.getHTML=function(){var a="";switch(this._editMode){case"wysiwyg":if(!this.config.fullPage){a=Xinha.getHTML(this._doc.body,false,this).trim()}else{a=this.doctype+"\n"+Xinha.getHTML(this._doc.documentElement,true,this)}break;case"textmode":a=this._textArea.value;break;default:alert("Mode <"+this._editMode+"> not defined!");return false}return a};Xinha.prototype.outwardHtml=function(c){for(var b in this.plugins){var d=this.plugins[b].instance;if(d&&typeof d.outwardHtml=="function"){c=d.outwardHtml(c)}}c=c.replace(/<(\/?)b(\s|>|\/)/ig,"<$1strong$2");c=c.replace(/<(\/?)i(\s|>|\/)/ig,"<$1em$2");c=c.replace(/<(\/?)strike(\s|>|\/)/ig,"<$1del$2");c=c.replace(/(<[^>]*on(click|mouse(over|out|up|down))=['"])if\(window\.parent && window\.parent\.Xinha\)\{return false\}/gi,"$1");var a=location.href.replace(/(https?:\/\/[^\/]*)\/.*/,"$1")+"/";c=c.replace(/https?:\/\/null\//g,a);c=c.replace(/((href|src|background)=[\'\"])\/+/ig,"$1"+a);c=this.outwardSpecialReplacements(c);c=this.fixRelativeLinks(c);if(this.config.sevenBitClean){c=c.replace(/[^ -~\r\n\t]/g,function(e){return(e!=Xinha.cc)?"&#"+e.charCodeAt(0)+";":e})}c=c.replace(/(<script[^>]*((type=[\"\']text\/)|(language=[\"\'])))(freezescript)/gi,"$1javascript");if(this.config.fullPage){c=Xinha.stripCoreCSS(c)}if(typeof this.config.outwardHtml=="function"){c=this.config.outwardHtml(c)}return c};Xinha.prototype.inwardHtml=function(b){for(var a in this.plugins){var c=this.plugins[a].instance;if(c&&typeof c.inwardHtml=="function"){b=c.inwardHtml(b)}}b=b.replace(/<(\/?)del(\s|>|\/)/ig,"<$1strike$2");b=b.replace(/(<[^>]*on(click|mouse(over|out|up|down))=["'])/gi,"$1if(window.parent && window.parent.Xinha){return false}");b=this.inwardSpecialReplacements(b);b=b.replace(/(<script[^>]*((type=[\"\']text\/)|(language=[\"\'])))(javascript)/gi,"$1freezescript");var d=new RegExp("((href|src|background)=['\"])/+","gi");b=b.replace(d,"$1"+location.href.replace(/(https?:\/\/[^\/]*)\/.*/,"$1")+"/");b=this.fixRelativeLinks(b);if(this.config.fullPage){b=Xinha.addCoreCSS(b)}if(typeof this.config.inwardHtml=="function"){b=this.config.inwardHtml(b)}return b};Xinha.prototype.outwardSpecialReplacements=function(b){for(var a in this.config.specialReplacements){var e=this.config.specialReplacements[a];var d=a;if(typeof e.replace!="function"||typeof d.replace!="function"){continue}var c=new RegExp(Xinha.escapeStringForRegExp(e),"g");b=b.replace(c,d.replace(/\$/g,"$$$$"))}return b};Xinha.prototype.inwardSpecialReplacements=function(b){for(var a in this.config.specialReplacements){var e=a;var d=this.config.specialReplacements[a];if(typeof e.replace!="function"||typeof d.replace!="function"){continue}var c=new RegExp(Xinha.escapeStringForRegExp(e),"g");b=b.replace(c,d.replace(/\$/g,"$$$$"))}return b};Xinha.prototype.fixRelativeLinks=function(g){if(typeof this.config.expandRelativeUrl!="undefined"&&this.config.expandRelativeUrl){if(g==null){return""}var a=g.match(/(src|href)="([^"]*)"/gi);var j=document.location.href;if(a){var d,k,l,m,c;for(var f=0;f<a.length;++f){d=a[f].match(/(src|href)="([^"]*)"/i);k=d[2].match(/\.\.\//g);if(k){l=new RegExp("(.*?)(([^/]*/){"+k.length+"})[^/]*$");m=j.match(l);c=d[2].replace(/(\.\.\/)*/,m[1]);g=g.replace(new RegExp(Xinha.escapeStringForRegExp(d[2])),c)}}}}if(typeof this.config.stripSelfNamedAnchors!="undefined"&&this.config.stripSelfNamedAnchors){var e=new RegExp('((href|src|background)=")('+Xinha.escapeStringForRegExp(window.unescape(document.location.href.replace(/&/g,"&")))+")([#?][^'\" ]*)","g");g=g.replace(e,"$1$4")}if(typeof this.config.stripBaseHref!="undefined"&&this.config.stripBaseHref){var h=null;if(typeof this.config.baseHref!="undefined"&&this.config.baseHref!==null){h=new RegExp('((href|src|background|action)=")('+Xinha.escapeStringForRegExp(this.config.baseHref.replace(/([^\/]\/)(?=.+\.)[^\/]*$/,"$1"))+")","g");g=g.replace(h,"$1")}h=new RegExp('((href|src|background|action)=")('+Xinha.escapeStringForRegExp(document.location.href.replace(/^(https?:\/\/[^\/]*)(.*)/,"$1"))+")","g");g=g.replace(h,"$1")}return g};Xinha.prototype.getInnerHTML=function(){if(!this._doc.body){return""}var a="";switch(this._editMode){case"wysiwyg":if(!this.config.fullPage){a=this._doc.body.innerHTML}else{a=this.doctype+"\n"+this._doc.documentElement.innerHTML}break;case"textmode":a=this._textArea.value;break;default:alert("Mode <"+this._editMode+"> not defined!");return false}return a};Xinha.prototype.setHTML=function(a){if(!this.config.fullPage){this._doc.body.innerHTML=a}else{this.setFullHTML(a)}this._textArea.value=a};Xinha.prototype.setDoctype=function(a){this.doctype=a};Xinha._object=null;Array.prototype.isArray=true;RegExp.prototype.isRegExp=true;Xinha.cloneObject=function(obj){if(!obj){return null}var newObj=obj.isArray?[]:{};if(obj.constructor.toString().match(/\s*function Function\(/)||typeof obj=="function"){newObj=obj}else{if(obj.isRegExp){newObj=eval(obj.toString())}else{for(var n in obj){var node=obj[n];if(typeof node=="object"){newObj[n]=Xinha.cloneObject(node)}else{newObj[n]=node}}}}return newObj};Xinha.flushEvents=function(){var a=0;var c=Xinha._eventFlushers.pop();while(c){try{if(c.length==3){Xinha._removeEvent(c[0],c[1],c[2]);a++}else{if(c.length==2){c[0]["on"+c[1]]=null;c[0]._xinha_dom0Events[c[1]]=null;a++}}}catch(b){}c=Xinha._eventFlushers.pop()}};Xinha._eventFlushers=[];if(document.addEventListener){Xinha._addEvent=function(a,c,b){a.addEventListener(c,b,false);Xinha._eventFlushers.push([a,c,b])};Xinha._removeEvent=function(a,c,b){a.removeEventListener(c,b,false)};Xinha._stopEvent=function(a){a.preventDefault();a.stopPropagation()}}else{if(document.attachEvent){Xinha._addEvent=function(a,c,b){a.attachEvent("on"+c,b);Xinha._eventFlushers.push([a,c,b])};Xinha._removeEvent=function(a,c,b){a.detachEvent("on"+c,b)};Xinha._stopEvent=function(b){try{b.cancelBubble=true;b.returnValue=false}catch(a){}}}else{Xinha._addEvent=function(a,c,b){alert("_addEvent is not supported")};Xinha._removeEvent=function(a,c,b){alert("_removeEvent is not supported")};Xinha._stopEvent=function(a){alert("_stopEvent is not supported")}}}Xinha._addEvents=function(c,a,d){for(var b=a.length;--b>=0;){Xinha._addEvent(c,a[b],d)}};Xinha._removeEvents=function(c,a,d){for(var b=a.length;--b>=0;){Xinha._removeEvent(c,a[b],d)}};Xinha.addOnloadHandler=function(b,a){a=a?a:window;var c=function(){if(arguments.callee.done){return}arguments.callee.done=true;if(Xinha.onloadTimer){clearInterval(Xinha.onloadTimer)}b()};if(Xinha.is_ie){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);c()}});if(document.documentElement.doScroll&&typeof window.frameElement==="undefined"){(function(){if(arguments.callee.done){return}try{document.documentElement.doScroll("left")}catch(d){setTimeout(arguments.callee,0);return}c()})()}}else{if(/applewebkit|KHTML/i.test(navigator.userAgent)){Xinha.onloadTimer=a.setInterval(function(){if(/loaded|complete/.test(a.document.readyState)){c()}},10)}else{a.document.addEventListener("DOMContentLoaded",c,false)}}Xinha._addEvent(a,"load",c)};Xinha.addDom0Event=function(b,c,a){Xinha._prepareForDom0Events(b,c);b._xinha_dom0Events[c].unshift(a)};Xinha.prependDom0Event=function(b,c,a){Xinha._prepareForDom0Events(b,c);b._xinha_dom0Events[c].push(a)};Xinha.getEvent=function(a){return a||window.event};Xinha._prepareForDom0Events=function(a,b){if(typeof a._xinha_dom0Events=="undefined"){a._xinha_dom0Events={};Xinha.freeLater(a,"_xinha_dom0Events")}if(typeof a._xinha_dom0Events[b]=="undefined"){a._xinha_dom0Events[b]=[];if(typeof a["on"+b]=="function"){a._xinha_dom0Events[b].push(a["on"+b])}a["on"+b]=function(e){var c=a._xinha_dom0Events[b];var f=true;for(var d=c.length;--d>=0;){a._xinha_tempEventHandler=c[d];if(a._xinha_tempEventHandler(e)===false){a._xinha_tempEventHandler=null;f=false;break}a._xinha_tempEventHandler=null}return f};Xinha._eventFlushers.push([a,b])}};Xinha.prototype.notifyOn=function(b,a){if(typeof this._notifyListeners[b]=="undefined"){this._notifyListeners[b]=[];Xinha.freeLater(this,"_notifyListeners")}this._notifyListeners[b].push(a)};Xinha.prototype.notifyOf=function(c,a){if(this._notifyListeners[c]){for(var b=0;b<this._notifyListeners[c].length;b++){this._notifyListeners[c][b](c,a)}}};Xinha._blockTags=" body form textarea fieldset ul ol dl li div p h1 h2 h3 h4 h5 h6 quote pre table thead tbody tfoot tr td th iframe address blockquote title meta link style head ";Xinha.isBlockElement=function(a){return a&&a.nodeType==1&&(Xinha._blockTags.indexOf(" "+a.tagName.toLowerCase()+" ")!=-1)};Xinha._paraContainerTags=" body td th caption fieldset div ";Xinha.isParaContainer=function(a){return a&&a.nodeType==1&&(Xinha._paraContainerTags.indexOf(" "+a.tagName.toLowerCase()+" ")!=-1)};Xinha._closingTags=" a abbr acronym address applet b bdo big blockquote button caption center cite code del dfn dir div dl em fieldset font form frameset h1 h2 h3 h4 h5 h6 i iframe ins kbd label legend map menu noframes noscript object ol optgroup pre q s samp script select small span strike strong style sub sup table textarea title tt u ul var ";Xinha.needsClosingTag=function(a){return a&&a.nodeType==1&&(Xinha._closingTags.indexOf(" "+a.tagName.toLowerCase()+" ")!=-1)};Xinha.htmlEncode=function(a){if(!a){return""}if(typeof a.replace=="undefined"){a=a.toString()}a=a.replace(/&/ig,"&");a=a.replace(/</ig,"<");a=a.replace(/>/ig,">");a=a.replace(/\xA0/g," ");a=a.replace(/\x22/g,""");return a};Xinha.prototype.stripBaseURL=function(a){if(this.config.baseHref===null||!this.config.stripBaseHref){return a}var c=this.config.baseHref.replace(/^(https?:\/\/[^\/]+)(.*)$/,"$1");var b=new RegExp(c);return a.replace(b,"")};if(typeof String.prototype.trim!="function"){String.prototype.trim=function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}}Xinha._makeColor=function(c){if(typeof c!="number"){return c}var e=c&255;var d=(c>>8)&255;var a=(c>>16)&255;return"rgb("+e+","+d+","+a+")"};Xinha._colorToRgb=function(c){if(!c){return""}var h,f,a;function e(b){return(b<16)?("0"+b.toString(16)):b.toString(16)}if(typeof c=="number"){h=c&255;f=(c>>8)&255;a=(c>>16)&255;return"#"+e(h)+e(f)+e(a)}if(c.substr(0,3)=="rgb"){var d=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/;if(c.match(d)){h=parseInt(RegExp.$1,10);f=parseInt(RegExp.$2,10);a=parseInt(RegExp.$3,10);return"#"+e(h)+e(f)+e(a)}return null}if(c.substr(0,1)=="#"){return c}return null};Xinha.prototype._popupDialog=function(a,b,c){Dialog(this.popupURL(a),b,c)};Xinha.prototype.imgURL=function(a,b){if(typeof b=="undefined"){return _editor_url+a}else{return Xinha.getPluginDir(b)+"/img/"+a}};Xinha.prototype.popupURL=function(c){var b="";if(c.match(/^plugin:\/\/(.*?)\/(.*)/)){var d=RegExp.$1;var a=RegExp.$2;if(!/\.(html?|php)$/.test(a)){a+=".html"}b=Xinha.getPluginDir(d)+"/popups/"+a}else{if(c.match(/^\/.*?/)||c.match(/^https?:\/\//)){b=c}else{b=_editor_url+this.config.popupURL+c}}return b};Xinha.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};Xinha.prototype._toggleBorders=function(){var b=this._doc.getElementsByTagName("TABLE");if(b.length!==0){if(!this.borders){this.borders=true}else{this.borders=false}for(var a=0;a<b.length;a++){if(this.borders){Xinha._addClass(b[a],"htmtableborders")}else{Xinha._removeClass(b[a],"htmtableborders")}}}return true};Xinha.addCoreCSS=function(b){var a='<style title="XinhaInternalCSS" type="text/css">.htmtableborders, .htmtableborders td, .htmtableborders th {border : 1px dashed lightgrey ! important;}\nhtml, body { border: 0px; } \nbody { background-color: #ffffff; } \nimg, hr { cursor: default } \n</style>\n';if(b&&/<head>/i.test(b)){return b.replace(/<head>/i,"<head>"+a)}else{if(b){return a+b}else{return a}}};Xinha.prototype.addEditorStylesheet=function(a){var b=this._doc.createElement("link");b.rel="stylesheet";b.type="text/css";b.title="XinhaInternalCSS";b.href=a;this._doc.getElementsByTagName("HEAD")[0].appendChild(b)};Xinha.stripCoreCSS=function(a){return a.replace(/<style[^>]+title="XinhaInternalCSS"(.|\n)*?<\/style>/ig,"").replace(/<link[^>]+title="XinhaInternalCSS"(.|\n)*?>/ig,"")};Xinha._removeClass=function(e,d){if(!(e&&e.className)){return}var a=e.className.split(" ");var b=[];for(var c=a.length;c>0;){if(a[--c]!=d){b[b.length]=a[c]}}e.className=b.join(" ")};Xinha._addClass=function(b,a){Xinha._removeClass(b,a);b.className+=" "+a};Xinha.addClasses=function(f,e){if(f!==null){var b=f.className.trim().split(" ");var d=e.split(" ");for(var a=0;a<d.length;a++){var g=false;for(var c=0;g===false&&c<b.length;c++){if(b[c]==d[a]){g=true}}if(g===false){b[b.length]=d[a]}}f.className=b.join(" ").trim()}};Xinha.removeClasses=function(e,d){var g=e.className.trim().split();var f=[];var b=d.trim().split();for(var c=0;c<g.length;c++){var h=false;for(var a=0;a<b.length&&!h;a++){if(g[c]==b[a]){h=true}}if(!h){f[f.length]=g[c]}}return f.join(" ")};Xinha.addClass=Xinha._addClass;Xinha.removeClass=Xinha._removeClass;Xinha._addClasses=Xinha.addClasses;Xinha._removeClasses=Xinha.removeClasses;Xinha._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};Xinha._postback_send_charset=true;Xinha._postback=function(b,g,h,a){var e=null;e=Xinha.getXMLHTTPRequestObject();var d="";if(typeof g=="string"){d=g}else{if(typeof g=="object"){for(var c in g){d+=(d.length?"&":"")+c+"="+encodeURIComponent(g[c])}}}function f(){if(e.readyState==4){if(((e.status/100)==2)||Xinha.isRunLocally&&e.status===0){if(typeof h=="function"){h(e.responseText,e)}}else{if(Xinha._postback_send_charset){Xinha._postback_send_charset=false;Xinha._postback(b,g,h,a)}else{if(typeof a=="function"){a(e)}else{alert("An error has occurred: "+e.statusText+"\nURL: "+b)}}}}}e.onreadystatechange=f;e.open("POST",b,true);e.setRequestHeader("Content-Type","application/x-www-form-urlencoded"+(Xinha._postback_send_charset?"; charset=UTF-8":""));e.send(d)};Xinha._getback=function(b,e,a){var c=null;c=Xinha.getXMLHTTPRequestObject();function d(){if(c.readyState==4){if(((c.status/100)==2)||Xinha.isRunLocally&&c.status===0){e(c.responseText,c)}else{if(typeof a=="function"){a(c)}else{alert("An error has occurred: "+c.statusText+"\nURL: "+b)}}}}c.onreadystatechange=d;c.open("GET",b,true);c.send(null)};Xinha.ping=function(c,b,a){var d=null;d=Xinha.getXMLHTTPRequestObject();function e(){if(d.readyState==4){if(((d.status/100)==2)||Xinha.isRunLocally&&d.status===0){if(b){b(d)}}else{if(a){a(d)}}}}var f=Xinha.is_opera?"GET":"HEAD";d.onreadystatechange=e;d.open(f,c,true);d.send(null)};Xinha._geturlcontent=function(b,a){var c=null;c=Xinha.getXMLHTTPRequestObject();c.open("GET",b,false);c.send(null);if(((c.status/100)==2)||Xinha.isRunLocally&&c.status===0){return(a)?c.responseXML:c.responseText}else{return""}};if(typeof dumpValues=="undefined"){dumpValues=function(c){var b="";for(var d in c){if(window.console&&typeof window.console.log=="function"){if(typeof console.firebug!="undefined"){console.log(c)}else{console.log(d+" = "+c[d]+"\n")}}else{b+=d+" = "+c[d]+"\n"}}if(b){if(document.getElementById("errors")){document.getElementById("errors").value+=b}else{var a=window.open("","debugger");a.document.write("<pre>"+b+"</pre>")}}}}if(!Array.prototype.contains){Array.prototype.contains=function(c){var b=this;for(var a=0;a<b.length;a++){if(c==b[a]){return true}}return false}}if(!Array.prototype.indexOf){Array.prototype.indexOf=function(c){var b=this;for(var a=0;a<b.length;a++){if(c==b[a]){return a}}return null}}if(!Array.prototype.append){Array.prototype.append=function(b){for(var c=0;c<b.length;c++){this.push(b[c])}return this}}if(!Array.prototype.forEach){Array.prototype.forEach=function(d){var a=this.length;if(typeof d!="function"){throw new TypeError()}var b=arguments[1];for(var c=0;c<a;c++){if(c in this){d.call(b,this[c],c,this)}}}}Xinha.getElementsByClassName=function(e,d){if(e.getElementsByClassName){return Array.prototype.slice.call(e.getElementsByClassName(d))}else{var c=e.getElementsByTagName("*");var a=[];var f;for(var b=0;b<c.length;b++){f=c[b].className.split(" ");if(f.contains(d)){a.push(c[b])}}return a}};Xinha.arrayContainsArray=function(d,b){var c=true;for(var a=0;a<b.length;a++){var f=false;for(var e=0;e<d.length;e++){if(d[e]==b[a]){f=true;break}}if(!f){c=false;break}}return c};Xinha.arrayFilter=function(b,d){var c=[];for(var a=0;a<b.length;a++){if(d(b[a])){c[c.length]=b[a]}}return c};Xinha.collectionToArray=function(c){try{return c.length?Array.prototype.slice.call(c):[]}catch(b){}var d=[];for(var a=0;a<c.length;a++){d.push(c.item(a))}return d};Xinha.uniq_count=0;Xinha.uniq=function(a){return a+Xinha.uniq_count++};Xinha._loadlang=function(context,url){var lang;if(typeof _editor_lcbackend=="string"){url=_editor_lcbackend;url=url.replace(/%lang%/,_editor_lang);url=url.replace(/%context%/,context)}else{if(!url){if(context!="Xinha"){url=Xinha.getPluginDir(context)+"/lang/"+_editor_lang+".js"}else{Xinha.setLoadingMessage("Loading language");url=_editor_url+"lang/"+_editor_lang+".js"}}}var langData=Xinha._geturlcontent(url);if(langData!==""){try{eval("lang = "+langData)}catch(ex){alert("Error reading Language-File ("+url+"):\n"+Error.toString());lang={}}}else{lang={}}return lang};Xinha._lc=function(g,b,c){var a,h;if(typeof b=="object"&&b.url&&b.context){a=b.url+_editor_lang+".js";b=b.context}var e=null;if(typeof g=="string"){e=g.match(/\$(.*?)=(.*?)\$/g)}if(e){if(!c){c={}}for(var f=0;f<e.length;f++){var d=e[f].match(/\$(.*?)=(.*?)\$/);c[d[1]]=d[2];g=g.replace(d[0],"$"+d[1])}}if(_editor_lang=="en"){if(typeof g=="object"&&g.string){h=g.string}else{h=g}}else{if(typeof Xinha._lc_catalog=="undefined"){Xinha._lc_catalog=[]}if(typeof b=="undefined"){b="Xinha"}if(typeof Xinha._lc_catalog[b]=="undefined"){Xinha._lc_catalog[b]=Xinha._loadlang(b,a)}var j;if(typeof g=="object"&&g.key){j=g.key}else{if(typeof g=="object"&&g.string){j=g.string}else{j=g}}if(typeof Xinha._lc_catalog[b][j]=="undefined"){if(b=="Xinha"){if(typeof g=="object"&&g.string){h=g.string}else{h=g}}else{return Xinha._lc(g,"Xinha",c)}}else{h=Xinha._lc_catalog[b][j]}}if(typeof g=="object"&&g.replace){c=g.replace}if(typeof c!="undefined"){for(f in c){h=h.replace("$"+f,c[f])}}return h};Xinha.hasDisplayedChildren=function(c){var b=c.childNodes;for(var a=0;a<b.length;a++){if(b[a].tagName){if(b[a].style.display!="none"){return true}}}return false};Xinha._loadback=function(a,f,d,e){if(document.getElementById(a)){return true}var b=!Xinha.is_ie?"onload":"onreadystatechange";var c=document.createElement("script");c.type="text/javascript";c.src=a;c.id=a;if(f){c[b]=function(){if(Xinha.is_ie&&(!/loaded|complete/.test(window.event.srcElement.readyState))){return}f.call(d?d:this,e);c[b]=null}}document.getElementsByTagName("head")[0].appendChild(c);return false};Xinha.makeEditors=function(c,f,g){if(!Xinha.isSupportedBrowser){return}if(typeof f=="function"){f=f()}var e={};var b;for(var a=0;a<c.length;a++){if(typeof c[a]=="string"){b=Xinha.getElementById("textarea",c[a]);if(!b){c[a]=null;continue}}else{if(typeof c[a]=="object"&&c[a].tagName&&c[a].tagName.toLowerCase()=="textarea"){b=c[a];if(!b.id){b.id="xinha_id_"+a}}}var d=new Xinha(b,Xinha.cloneObject(f));d.registerPlugins(g);e[b.id]=d}return e};Xinha.startEditors=function(b){if(!Xinha.isSupportedBrowser){return}for(var a in b){if(b[a].generate){b[a].generate()}}};Xinha.prototype.registerPlugins=function(b){if(!Xinha.isSupportedBrowser){return}if(b){for(var a=0;a<b.length;a++){this.setLoadingMessage(Xinha._lc("Register plugin $plugin","Xinha",{plugin:b[a]}));this.registerPlugin(b[a])}}};Xinha.base64_encode=function(d){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var a="";var l,j,g;var k,h,f,e;var c=0;do{l=d.charCodeAt(c++);j=d.charCodeAt(c++);g=d.charCodeAt(c++);k=l>>2;h=((l&3)<<4)|(j>>4);f=((j&15)<<2)|(g>>6);e=g&63;if(isNaN(j)){f=e=64}else{if(isNaN(g)){e=64}}a=a+b.charAt(k)+b.charAt(h)+b.charAt(f)+b.charAt(e)}while(c<d.length);return a};Xinha.base64_decode=function(d){var b="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";var a="";var l,j,g;var k,h,f,e;var c=0;d=d.replace(/[^A-Za-z0-9\+\/\=]/g,"");do{k=b.indexOf(d.charAt(c++));h=b.indexOf(d.charAt(c++));f=b.indexOf(d.charAt(c++));e=b.indexOf(d.charAt(c++));l=(k<<2)|(h>>4);j=((h&15)<<4)|(f>>2);g=((f&3)<<6)|e;a=a+String.fromCharCode(l);if(f!=64){a=a+String.fromCharCode(j)}if(e!=64){a=a+String.fromCharCode(g)}}while(c<d.length);return a};Xinha.removeFromParent=function(b){if(!b.parentNode){return}var a=b.parentNode;return a.removeChild(b)};Xinha.hasParentNode=function(a){if(a.parentNode){if(a.parentNode.nodeType==11){return false}return true}return false};Xinha.viewportSize=function(b){b=(b)?b:window;var a,c;if(b.innerHeight){a=b.innerWidth;c=b.innerHeight}else{if(b.document.documentElement&&b.document.documentElement.clientHeight){a=b.document.documentElement.clientWidth;c=b.document.documentElement.clientHeight}else{if(b.document.body){a=b.document.body.clientWidth;c=b.document.body.clientHeight}}}return{x:a,y:c}};Xinha.pageSize=function(d){d=(d)?d:window;var a,e;var c=d.document.body.scrollHeight;var b=d.document.documentElement.scrollHeight;if(c>b){a=d.document.body.scrollWidth;e=d.document.body.scrollHeight}else{a=d.document.documentElement.scrollWidth;e=d.document.documentElement.scrollHeight}return{x:a,y:e}};Xinha.prototype.scrollPos=function(b){b=(b)?b:window;var a,c;if(typeof b.pageYOffset!="undefined"){a=b.pageXOffset;c=b.pageYOffset}else{if(b.document.documentElement&&typeof document.documentElement.scrollTop!="undefined"){a=b.document.documentElement.scrollLeft;c=b.document.documentElement.scrollTop}else{if(b.document.body){a=b.document.body.scrollLeft;c=b.document.body.scrollTop}}}return{x:a,y:c}};Xinha.getElementTopLeft=function(a){var c=0;var b=0;if(a.offsetParent){c=a.offsetLeft;b=a.offsetTop;while(a=a.offsetParent){c+=a.offsetLeft;b+=a.offsetTop}}return{top:b,left:c}};Xinha.findPosX=function(a){var b=0;if(a.offsetParent){return Xinha.getElementTopLeft(a).left}else{if(a.x){b+=a.x}}return b};Xinha.findPosY=function(b){var a=0;if(b.offsetParent){return Xinha.getElementTopLeft(b).top}else{if(b.y){a+=b.y}}return a};Xinha.createLoadingMessages=function(b){if(Xinha.loadingMessages||!Xinha.isSupportedBrowser){return}Xinha.loadingMessages=[];for(var a=0;a<b.length;a++){if(!document.getElementById(b[a])){continue}Xinha.loadingMessages.push(Xinha.createLoadingMessage(Xinha.getElementById("textarea",b[a])))}};Xinha.createLoadingMessage=function(a,e){if(document.getElementById("loading_"+a.id)||!Xinha.isSupportedBrowser){return}var d=document.createElement("div");d.id="loading_"+a.id;d.className="loading";d.style.left=(Xinha.findPosX(a)+a.offsetWidth/2)-106+"px";d.style.top=(Xinha.findPosY(a)+a.offsetHeight/2)-50+"px";var c=document.createElement("div");c.className="loading_main";c.id="loading_main_"+a.id;c.appendChild(document.createTextNode(Xinha._lc("Loading in progress. Please wait!")));var b=document.createElement("div");b.className="loading_sub";b.id="loading_sub_"+a.id;e=e?e:Xinha._lc("Loading Core");b.appendChild(document.createTextNode(e));d.appendChild(c);d.appendChild(b);document.body.appendChild(d);Xinha.freeLater(d);Xinha.freeLater(c);Xinha.freeLater(b);return b};Xinha.prototype.setLoadingMessage=function(a,b){if(!document.getElementById("loading_sub_"+this._textArea.id)){return}document.getElementById("loading_main_"+this._textArea.id).innerHTML=b?b:Xinha._lc("Loading in progress. Please wait!");document.getElementById("loading_sub_"+this._textArea.id).innerHTML=a};Xinha.setLoadingMessage=function(a){if(!Xinha.loadingMessages){return}for(var b=0;b<Xinha.loadingMessages.length;b++){Xinha.loadingMessages[b].innerHTML=a}};Xinha.prototype.removeLoadingMessage=function(){if(document.getElementById("loading_"+this._textArea.id)){document.body.removeChild(document.getElementById("loading_"+this._textArea.id))}};Xinha.removeLoadingMessages=function(c){for(var b=0;b<c.length;b++){if(!document.getElementById(c[b])){continue}var a=document.getElementById("loading_"+document.getElementById(c[b]).id);a.parentNode.removeChild(a)}Xinha.loadingMessages=null};Xinha.toFree=[];Xinha.freeLater=function(a,b){Xinha.toFree.push({o:a,p:b})};Xinha.free=function(c,d){if(c&&!d){for(var b in c){Xinha.free(c,b)}}else{if(c){if(d.indexOf("src")==-1){try{c[d]=null}catch(a){}}}}};Xinha.collectGarbageForIE=function(){Xinha.flushEvents();for(var a=0;a<Xinha.toFree.length;a++){Xinha.free(Xinha.toFree[a].o,Xinha.toFree[a].p);Xinha.toFree[a].o=null}};Xinha.prototype.insertNodeAtSelection=function(a){Xinha.notImplemented("insertNodeAtSelection")};Xinha.prototype.getParentElement=function(a){Xinha.notImplemented("getParentElement")};Xinha.prototype.activeElement=function(a){Xinha.notImplemented("activeElement")};Xinha.prototype.selectionEmpty=function(a){Xinha.notImplemented("selectionEmpty")};Xinha.prototype.saveSelection=function(){Xinha.notImplemented("saveSelection")};Xinha.prototype.restoreSelection=function(a){Xinha.notImplemented("restoreSelection")};Xinha.prototype.selectNodeContents=function(a,b){Xinha.notImplemented("selectNodeContents")};Xinha.prototype.insertHTML=function(a){Xinha.notImplemented("insertHTML")};Xinha.prototype.getSelectedHTML=function(){Xinha.notImplemented("getSelectedHTML")};Xinha.prototype.getSelection=function(){Xinha.notImplemented("getSelection")};Xinha.prototype.createRange=function(a){Xinha.notImplemented("createRange")};Xinha.prototype.isKeyEvent=function(a){Xinha.notImplemented("isKeyEvent")};Xinha.prototype.isShortCut=function(a){if(a.ctrlKey&&!a.altKey){return true}return false};Xinha.prototype.getKey=function(a){Xinha.notImplemented("getKey")};Xinha.getOuterHTML=function(a){Xinha.notImplemented("getOuterHTML")};Xinha.getXMLHTTPRequestObject=function(){try{if(typeof XMLHttpRequest!="undefined"&&typeof XMLHttpRequest.constructor=="function"){return new XMLHttpRequest()}else{if(typeof ActiveXObject=="function"){return new ActiveXObject("Microsoft.XMLHTTP")}}}catch(a){Xinha.notImplemented("getXMLHTTPRequestObject")}};Xinha.prototype._activeElement=function(a){return this.activeElement(a)};Xinha.prototype._selectionEmpty=function(a){return this.selectionEmpty(a)};Xinha.prototype._getSelection=function(){return this.getSelection()};Xinha.prototype._createRange=function(a){return this.createRange(a)};HTMLArea=Xinha;Xinha.init();if(Xinha.ie_version<8){Xinha.addDom0Event(window,"unload",Xinha.collectGarbageForIE)}Xinha.debugMsg=function(a,b){if(typeof console!="undefined"&&typeof console.log=="function"){if(b&&b=="warn"&&typeof console.warn=="function"){console.warn(a)}else{if(b&&b=="info"&&typeof console.info=="function"){console.info(a)}else{console.log(a)}}}else{if(typeof opera!="undefined"&&typeof opera.postError=="function"){opera.postError(a)}}};Xinha.notImplemented=function(a){throw new Error("Method Not Implemented","Part of Xinha has tried to call the "+a+" method which has not been implemented.")}; |
:: Command execute :: | |
:: Shadow's tricks :D :: | |
Useful Commands
|
:: Preddy's tricks :D :: | |
Php Safe-Mode Bypass (Read Files)
|
--[ c999shell v. 1.0 pre-release build #16 Modded by Shadow & Preddy | RootShell Security Group | r57 c99 shell | Generation time: 0.0173 ]-- |