(function(){function a(c){var d=this.att,e=c&&c.hasAttribute(d)&&c.getAttribute(d)||'';if(e!==undefined)this.setValue(e);};function b(){var c;for(var d=0;d<arguments.length;d++){if(arguments[d] instanceof CKEDITOR.dom.element){c=arguments[d];break;}}if(c){var e=this.att,f=this.getValue();if(f)c.setAttribute(e,f);else c.removeAttribute(e,f);}};CKEDITOR.plugins.add('dialogadvtab',{createAdvancedTab:function(c,d){if(!d)d={id:1,dir:1,classes:1,styles:1};var e=c.lang.common,f={id:'advanced',label:e.advancedTab,title:e.advancedTab,elements:[{type:'vbox',padding:1,children:[]}]},g=[];if(d.id||d.dir){if(d.id)g.push({id:'advId',att:'id',type:'text',label:e.id,setup:a,commit:b});if(d.dir)g.push({id:'advLangDir',att:'dir',type:'select',label:e.langDir,'default':'',style:'width:100%',items:[[e.notSet,''],[e.langDirLTR,'ltr'],[e.langDirRTL,'rtl']],setup:a,commit:b});f.elements[0].children.push({type:'hbox',widths:['50%','50%'],children:[].concat(g)});}if(d.styles||d.classes){g=[];if(d.styles)g.push({id:'advStyles',att:'style',type:'text',label:e.styles,'default':'',getStyle:function(h,i){var j=this.getValue().match(new RegExp(h+'\\s*:s*([^;]*)','i'));return j?j[1]:i;},updateStyle:function(h,i){var j=this.getValue();if(j)j=j.replace(new RegExp('\\s*'+h+'s*:[^;]*(?:$|;s*)','i'),'').replace(/^[;\s]+/,'').replace(/\s+$/,'');if(i){j&&!/;\s*$/.test(j)&&(j+='; ');j+=h+': '+i;}this.setValue(j,1);},setup:a,commit:b});if(d.classes)g.push({type:'hbox',widths:['45%','55%'],children:[{id:'advCSSClasses',att:'class',type:'text',label:e.cssClasses,'default':'',setup:a,commit:b}]});f.elements[0].children.push({type:'hbox',widths:['50%','50%'],children:[].concat(g)});}return f;}});})();
