(function(){CKEDITOR.dialog.add("esp_attachment",function(c){var e=/^(_(?:self|top|parent|blank))$/;var b=function(q,n){var j=n?n.getAttribute("href"):"",p,o,l,k={};k.type="url";k.url=j;if(n){var r=n.getAttribute("target");k.target={};if(r){var h=r.match(e);if(h){k.target.type=k.target.name=r}else{k.target.type="frame";k.target.name=r}}var s=this;k.title=n.getAttribute("title")}var f=q.document.getElementsByTag("img"),t=new CKEDITOR.dom.nodeList(q.document.$.anchors),g=k.anchors=[];for(var m=0;m',n.document);r=n.getSelection();k.moveChildren(m);k.copyAttributes(m,{name:1});m.replace(k);k=m;r.selectElement(k)}k.setAttributes(j);k.removeAttributes(p);if(k.getAttribute("title")){k.setHtml(k.getAttribute("title"))}if(k.getAttribute("name")){k.addClass("cke_anchor")}else{k.removeClass("cke_anchor")}if(this.fakeObj){n.createFakeElement(k,"cke_anchor","anchor").replace(this.fakeObj)}delete this._.selectedElement}},contents:[{label:c.lang.common.generalTab,id:"info",accessKey:"I",elements:[{type:"vbox",padding:0,children:[{type:"html",html:""+CKEDITOR.tools.htmlEncode(c.lang.esp_attachment.url)+""},{type:"hbox",widths:["320px","80px"],align:"right",children:[{id:"txtUrl",type:"text",label:"",validate:CKEDITOR.dialog.validate.notEmpty(c.lang.flash.validateSrc),setup:function(f){if(f.url){this.setValue(f.url)}this.select()},commit:function(f){f.url=this.getValue()}},{type:"button",id:"browse",filebrowser:"info:txtUrl",hidden:true,align:"center",label:c.lang.esp_attachment.browseServer}]}]},{type:"vbox",padding:0,children:[{id:"txtAlt",type:"text",label:c.lang.esp_attachment.name,setup:function(f){if(f.title){this.setValue(f.title)}},commit:function(f){f.title=this.getValue()}}]},{type:"hbox",widths:["50%","50%"],children:[{type:"select",id:"linkTargetType",label:c.lang.link.target,"default":"notSet",style:"width : 100%;",items:[[c.lang.esp_attachment.link.targetNotSet,"notSet"],[c.lang.esp_attachment.link.targetFrame,"frame"],[c.lang.esp_attachment.link.targetNew,"_blank"],[c.lang.esp_attachment.link.targetTop,"_top"],[c.lang.esp_attachment.link.targetSelf,"_self"],[c.lang.esp_attachment.link.targetParent,"_parent"]],onChange:d,setup:function(f){if(f.target){this.setValue(f.target.type)}},commit:function(f){if(!f.target){f.target={}}f.target.type=this.getValue()}},{type:"text",id:"linkTargetName",label:c.lang.link.targetFrameName,"default":"",setup:function(f){if(f.target){this.setValue(f.target.name)}},commit:function(f){if(!f.target){f.target={}}f.target.name=this.getValue()}}]}]}]}})})();