CKEDITOR.dialog.add("checkbox",function(b){return{title:b.lang.checkboxAndRadio.checkboxTitle,minWidth:350,minHeight:140,onShow:function(){var d=this;delete d.checkbox;var a=d.getParentEditor().getSelection().getSelectedElement();if(a&&a.getAttribute("type")=="checkbox"){d.checkbox=a;d.setupContent(a)}},onOk:function(){var a,f=this.checkbox,e=!f;if(e){a=this.getParentEditor();f=a.document.createElement("input");f.setAttribute("type","checkbox");a.insertElement(f)}this.commitContent({element:f})},contents:[{id:"info",label:b.lang.checkboxAndRadio.checkboxTitle,title:b.lang.checkboxAndRadio.checkboxTitle,startupFocus:"txtName",elements:[{id:"txtName",type:"text",label:b.lang.common.name,"default":"",accessKey:"N",setup:function(a){this.setValue(a.data("cke-saved-name")||a.getAttribute("name")||"")},commit:function(a){var d=a.element;if(this.getValue()){d.data("cke-saved-name",this.getValue())}else{d.data("cke-saved-name",false);d.removeAttribute("name")}}},{id:"txtValue",type:"text",label:b.lang.checkboxAndRadio.value,"default":"",accessKey:"V",setup:function(a){var d=a.getAttribute("value");this.setValue(CKEDITOR.env.ie&&d=="on"?"":d)},commit:function(a){var h=a.element,g=this.getValue();if(g&&!(CKEDITOR.env.ie&&g=="on")){h.setAttribute("value",g)}else{if(CKEDITOR.env.ie){var f=new CKEDITOR.dom.element("input",h.getDocument());h.copyAttributes(f,{value:1});f.replace(h);b.getSelection().selectElement(f);a.element=f}else{h.removeAttribute("value")}}}},{id:"cmbSelected",type:"checkbox",label:b.lang.checkboxAndRadio.selected,"default":"",accessKey:"S",value:"checked",setup:function(a){this.setValue(a.getAttribute("checked"))},commit:function(a){var l=a.element;if(CKEDITOR.env.ie){var k=!!l.getAttribute("checked"),j=!!this.getValue();if(k!=j){var i=CKEDITOR.dom.element.createFromHtml('<input type="checkbox"'+(j?' checked="checked"':"")+"/>",b.document);l.copyAttributes(i,{type:1,checked:1});i.replace(l);b.getSelection().selectElement(i);a.element=i}}else{var h=this.getValue();if(h){l.setAttribute("checked","checked")}else{l.removeAttribute("checked")}}}}]}]}});