CKEDITOR.dialog.add("anchor",function(A){var B=function(F,E,C){this.editMode=true;this.editObj=C;var D=this.editObj.getAttribute("name");if(D){this.setValueOf("info","txtName",D)}else{this.setValueOf("info","txtName","")}};return{title:A.lang.anchor.title,minWidth:300,minHeight:60,onOk:function(){var D=this.getValueOf("info","txtName"),E=CKEDITOR.env.ie&&!(CKEDITOR.document.$.documentMode>=8)?A.document.createElement('<a name="'+CKEDITOR.tools.htmlEncode(D)+'">'):A.document.createElement("a");if(this.editMode){this.editObj.copyAttributes(E,{name:1});this.editObj.moveChildren(E)}E.data("cke-saved-name",false);E.setAttribute("name",D);var C=A.createFakeElement(E,"cke_anchor","anchor");if(!this.editMode){A.insertElement(C)}else{C.replace(this.fakeObj);A.getSelection().selectElement(C)}return true},onShow:function(){this.editObj=false;this.fakeObj=false;this.editMode=false;var D=A.getSelection();var C=D.getSelectedElement();if(C&&C.data("cke-real-element-type")&&C.data("cke-real-element-type")=="anchor"){this.fakeObj=C;C=A.restoreRealElement(this.fakeObj);B.apply(this,[A,D,C]);D.selectElement(this.fakeObj)}this.getContentElement("info","txtName").focus()},contents:[{id:"info",label:A.lang.anchor.title,accessKey:"I",elements:[{type:"text",id:"txtName",label:A.lang.anchor.name,required:true,validate:function(){if(!this.getValue()){alert(A.lang.anchor.errorName);return false}return true}}]}]}});