CKEDITOR.dialog.add("checkspell",function(x){var w=CKEDITOR.tools.getNextNumber(),v="cke_frame_"+w,u="cke_data_"+w,t="cke_error_"+w,s,r=document.location.protocol||"http:",q=x.lang.spellCheck.notAvailable,p='<textarea style="display: none" id="'+u+'" rows="10" cols="40"> </textarea><div id="'+t+'" style="display:none;color:red;font-size:16px;font-weight:bold;padding-top:160px;text-align:center;z-index:11;"></div><iframe src="" style="width:100%;background-color:#f1f1e3;" frameborder="0" name="'+v+'" id="'+v+'" allowtransparency="1"></iframe>',o=x.config.wsc_customLoaderScript||r+"//loader.webspellchecker.net/sproxy_fck/sproxy.php?plugin=fck2&customerid="+x.config.wsc_customerId+"&cmd=script&doc=wsc&schema=22";if(x.config.wsc_customLoaderScript){q+='<p style="color:#000;font-size:11px;font-weight: normal;text-align:center;padding-top:10px">'+x.lang.spellCheck.errorLoading.replace(/%s/g,x.config.wsc_customLoaderScript)+"</p>"}function n(a,c){var b=0;return function(){if(typeof window.doSpell=="function"){if(typeof s!="undefined"){window.clearInterval(s)}m(a)}else{if(b++==180){window._cancelOnError(c)}}}}window._cancelOnError=function(a){if(typeof window.WSC_Error=="undefined"){CKEDITOR.document.getById(v).setStyle("display","none");var b=CKEDITOR.document.getById(t);b.setStyle("display","block");b.setHtml(a||x.lang.spellCheck.notAvailable)}};function m(a){var d=new window._SP_FCK_LangCompare(),c=CKEDITOR.getUrl(x.plugins.wsc.path+"dialogs/"),b=c+"tmpFrameset.html";window.gFCKPluginName="wsc";d.setDefaulLangCode(x.config.defaultLanguage);window.doSpell({ctrl:u,lang:x.config.wsc_lang||d.getSPLangCode(x.langCode),intLang:x.config.wsc_uiLang||d.getSPLangCode(x.langCode),winType:v,onCancel:function(){a.hide()},onFinish:function(e){x.focus();a.getParentEditor().setData(e.value);a.hide()},staticFrame:b,framesetPath:b,iframePath:c+"ciframe.html",schemaURI:c+"wsc.css",userDictionaryName:x.config.wsc_userDictionaryName,customDictionaryName:x.config.wsc_customDictionaryIds&&x.config.wsc_customDictionaryIds.split(","),domainName:x.config.wsc_domainName});CKEDITOR.document.getById(t).setStyle("display","none");CKEDITOR.document.getById(v).setStyle("display","block")}return{title:x.config.wsc_dialogTitle||x.lang.spellCheck.title,minWidth:485,minHeight:380,buttons:[CKEDITOR.dialog.cancelButton],onShow:function(){var a=this.getContentElement("general","content").getElement();a.setHtml(p);a.getChild(2).setStyle("height",this._.contentSize.height+"px");if(typeof window.doSpell!="function"){CKEDITOR.document.getHead().append(CKEDITOR.document.createElement("script",{attributes:{type:"text/javascript",src:o}}))}var b=x.getData();CKEDITOR.document.getById(u).setValue(b);s=window.setInterval(n(this,q),250)},onHide:function(){window.ooo=undefined;window.int_framsetLoaded=undefined;window.framesetLoaded=undefined;window.is_window_opened=false},contents:[{id:"general",label:x.config.wsc_dialogTitle||x.lang.spellCheck.title,padding:0,elements:[{type:"html",id:"content",html:""}]}]}});CKEDITOR.dialog.on("resize",function(g){var f=g.data,j=f.dialog;if(j._.name=="checkspell"){var i=j.getContentElement("general","content").getElement(),h=i&&i.getChild(2);h&&h.setSize("height",f.height);h&&h.setSize("width",f.width)}});