NEW_CKEDITOR.dialog.add("specialchar",(function(e){var t,n,a,l,i,o,r,s=e.lang.specialchar;return a=function(n){var a;"a"==(n=n.data?n.data.getTarget():new NEW_CKEDITOR.dom.element(n)).getName()&&(a=n.getChild(0).getHtml())&&(n.removeClass("edi_light_background"),t.hide(),(n=e.document.createElement("span")).setHtml(a),e.insertText(n.getText()))},l=NEW_CKEDITOR.tools.addFunction(a),o=function(e,a){var l;if("span"==(a=a||e.data.getTarget()).getName()&&(a=a.getParent()),"a"==a.getName()&&(l=a.getChild(0).getHtml())){n&&i(null,n);var o=t.getContentElement("info","htmlPreview").getElement();t.getContentElement("info","charPreview").getElement().setHtml(l),o.setHtml(NEW_CKEDITOR.tools.htmlEncode(l)),a.getParent().addClass("edi_light_background"),n=a}},i=function(e,a){"span"==(a=a||e.data.getTarget()).getName()&&(a=a.getParent()),"a"==a.getName()&&(t.getContentElement("info","charPreview").getElement().setHtml("&nbsp;"),t.getContentElement("info","htmlPreview").getElement().setHtml("&nbsp;"),a.getParent().removeClass("edi_light_background"),n=void 0)},r=NEW_CKEDITOR.tools.addFunction((function(t){var n,l=(t=new NEW_CKEDITOR.dom.event(t)).getTarget();n=t.getKeystroke();var r="rtl"==e.lang.dir;switch(n){case 38:(n=l.getParent().getParent().getPrevious())&&((n=n.getChild([l.getParent().getIndex(),0])).focus(),i(null,l),o(null,n)),t.preventDefault();break;case 40:(n=l.getParent().getParent().getNext())&&(n=n.getChild([l.getParent().getIndex(),0]))&&1==n.type&&(n.focus(),i(null,l),o(null,n)),t.preventDefault();break;case 32:a({data:t}),t.preventDefault();break;case r?37:39:(n=l.getParent().getNext())?1==(n=n.getChild(0)).type?(n.focus(),i(null,l),o(null,n),t.preventDefault(!0)):i(null,l):(n=l.getParent().getParent().getNext())&&((n=n.getChild([0,0]))&&1==n.type?(n.focus(),i(null,l),o(null,n),t.preventDefault(!0)):i(null,l));break;case r?39:37:(n=l.getParent().getPrevious())?((n=n.getChild(0)).focus(),i(null,l),o(null,n),t.preventDefault(!0)):(n=l.getParent().getParent().getPrevious())?((n=n.getLast().getChild(0)).focus(),i(null,l),o(null,n),t.preventDefault(!0)):i(null,l)}})),{title:s.title,minWidth:430,minHeight:280,buttons:[NEW_CKEDITOR.dialog.cancelButton],charColumns:17,onLoad:function(){for(var t,n,a=this.definition.charColumns,i=e.config.specialChars,o=NEW_CKEDITOR.tools.getNextId()+"_specialchar_table_label",d=['<table role="listbox" aria-labelledby="'+o+'" style="width: 320px; height: 100%; border-collapse: separate;" align="center" cellspacing="2" cellpadding="2" border="0">'],g=0,c=i.length;g<c;){d.push('<tr role="presentation">');for(var u=0;u<a;u++,g++)if(t=i[g]){t instanceof Array?(n=t[1],t=t[0]):(n=t.replace("&","").replace(";","").replace("#",""),n=s[n]||t);var p="edi_specialchar_label_"+g+"_"+NEW_CKEDITOR.tools.getNextNumber();d.push('<td class="edi_dark_background" style="cursor: default" role="presentation"><a href="javascript: void(0);" role="option" aria-posinset="'+(g+1)+'"',' aria-setsize="'+c+'"',' aria-labelledby="'+p+'"',' class="edi_specialchar" title="',NEW_CKEDITOR.tools.htmlEncode(n),'" onkeydown="NEW_CKEDITOR.tools.callFunction( '+r+', event, this )" onclick="NEW_CKEDITOR.tools.callFunction('+l+', this); return false;" tabindex="-1"><span style="margin: 0 auto;cursor: inherit">'+t+'</span><span class="edi_voice_label" id="'+p+'">'+n+"</span></a></td>")}d.push("</tr>")}d.push("</tbody></table>",'<span id="'+o+'" class="edi_voice_label">'+s.options+"</span>"),this.getContentElement("info","charContainer").getElement().setHtml(d.join(""))},contents:[{id:"info",label:e.lang.common.generalTab,title:e.lang.common.generalTab,padding:0,align:"top",elements:[{type:"hbox",align:"top",widths:["320px","90px"],children:[{type:"html",id:"charContainer",html:"",onMouseover:o,onMouseout:i,focus:function(){var e=this.getElement().getElementsByTag("a").getItem(0);setTimeout((function(){e.focus(),o(null,e)}),0)},onShow:function(){var e=this.getElement().getChild([0,0,0,0,0]);setTimeout((function(){e.focus(),o(null,e)}),0)},onLoad:function(e){t=e.sender}},{type:"hbox",align:"top",widths:["100%"],children:[{type:"vbox",align:"top",children:[{type:"html",html:"<div></div>"},{type:"html",id:"charPreview",className:"edi_dark_background",style:"border:1px solid #eeeeee;font-size:28px;height:40px;width:70px;padding-top:9px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"<div>&nbsp;</div>"},{type:"html",id:"htmlPreview",className:"edi_dark_background",style:"border:1px solid #eeeeee;font-size:14px;height:20px;width:70px;padding-top:2px;font-family:'Microsoft Sans Serif',Arial,Helvetica,Verdana;text-align:center;",html:"<div>&nbsp;</div>"}]}]}]}]}]}}));