(function(){var A=function(B){return{title:B.lang.vbulletin.image_settings,onShow:function(){var F=CKEDITOR.dialog.getCurrent();var E=F.getParentEditor();var C={ajax:1,attachmentid:E.current_attachmentid,"do":"loadimageconfig",allowsmilie:1,securitytoken:E.config.vbulletin.securitytoken,posthash:E.config.vbulletin.attachinfo.posthash,poststarttime:E.config.vbulletin.attachinfo.poststarttime,contentid:E.config.vbulletin.contentid};var J=CKEDITOR.vbajax.open({url:"ajax.php",type:"POST",data:C,async:false,dataType:"xml"}).responseXML;if(J==null||J.firstChild==null){F.hide();return }var G=fetch_tags(J,"alignment")[0];if(G&&G.firstChild){var D=F.getContentElement("attachmentConfig","alignment");D.setValue(G.firstChild.nodeValue)}var L=fetch_tags(J,"size")[0];if(L&&L.firstChild){var D=F.getContentElement("attachmentConfig","size");D.setValue(L.firstChild.nodeValue)}var H=fetch_tags(J,"title")[0];if(H&&H.firstChild){var D=F.getContentElement("attachmentConfig","title");D.setValue(H.firstChild.nodeValue)}var I=fetch_tags(J,"description")[0];if(I&&I.firstChild){var D=F.getContentElement("attachmentConfig","description");D.setValue(I.firstChild.nodeValue)}var K=fetch_tags(J,"styles")[0];if(K&&K.firstChild){var D=F.getContentElement("attachmentConfig","styles");D.setValue(K.firstChild.nodeValue)}},onOk:function(){var I=CKEDITOR.dialog.getCurrent();var G=I.getParentEditor();var E={ajax:1,attachmentid:G.current_attachmentid,"do":"saveimageconfig",securitytoken:G.config.vbulletin.securitytoken,posthash:G.config.vbulletin.attachinfo.posthash,poststarttime:G.config.vbulletin.attachinfo.poststarttime,contentid:G.config.vbulletin.contentid};var J=I.getContentElement("attachmentConfig","alignment");if(J.getValue()){E.alignment=J.getValue()}var P=I.getContentElement("attachmentConfig","size");if(P.getValue()){E.size=P.getValue()}var L=I.getContentElement("attachmentConfig","title");if(L.getValue()){E.title=L.getValue()}var M=I.getContentElement("attachmentConfig","description");if(M.getValue()){E.description=M.getValue()}var O=I.getContentElement("attachmentConfig","styles");if(O.getValue()){E.styles=O.getValue()}var F=G.document.getById("vbattach_"+G.current_attachmentid);if(F){F.removeClass("size_thumbnail");F.removeClass("size_medium");F.removeClass("size_large");F.removeClass("size_fullsize");F.removeClass("align_left");F.removeClass("align_center");F.removeClass("align_right");for(var K in F.$.style){try{if(typeof (F.$.style[K])=="string"){F.setStyle(K,"")}}catch(H){}}if(J.getValue()){F.addClass("align_"+PHP.htmlspecialchars(J.getValue()))}if(P.getValue()){F.addClass("size_"+PHP.htmlspecialchars(P.getValue()))}if(O.getValue()){var C=O.getValue().split(";");for(var D=0;D<C.length;D++){if(C[D]){var N=C[D].split(":");if(N.length==2){F.setStyle(PHP.htmlspecialchars(N[0]),PHP.htmlspecialchars(N[1]))}}}}}CKEDITOR.vbajax.open({url:"ajax.php",type:"POST",data:E,dataType:"xml"})},minWidth:"600",minHeight:"230",contents:[{id:"attachmentConfig",elements:[{type:"radio",id:"alignment",label:B.lang.vbulletin.alignment,labelLayout:"horizontal",items:[[B.lang.vbulletin.none,"0"],[B.lang.common.alignLeft,"left"],[B.lang.common.alignCenter,"center"],[B.lang.common.alignRight,"right"]]},{type:"radio",id:"size",label:B.lang.vbulletin.size,labelLayout:"horizontal",items:[[B.lang.vbulletin.thumbnail,"thumbnail"],[B.lang.vbulletin.medium,"medium"],[B.lang.vbulletin.large,"large"],[B.lang.vbulletin.fullsize,"fullsize"]]},{type:"text",id:"title",label:B.lang.vbulletin.title,labelLayout:"horizontal"},{type:"textarea",id:"description",label:B.lang.vbulletin.description,labelLayout:"horizontal"},{type:"text",id:"styles",label:B.lang.common.styles,labelLayout:"horizontal"}]}]}};CKEDITOR.dialog.add("attachment",function(B){return A(B)})})();