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