CKEDITOR.DIALOG_RESIZE_NONE=0;CKEDITOR.DIALOG_RESIZE_WIDTH=1;CKEDITOR.DIALOG_RESIZE_HEIGHT=2;CKEDITOR.DIALOG_RESIZE_BOTH=3;(function(){function a(B){return!!this._.tabs[B][0].$.offsetHeight;};function b(){var F=this;var B=F._.currentTabId,C=F._.tabIdList.length,D=CKEDITOR.tools.indexOf(F._.tabIdList,B)+C;for(var E=D-1;E>D-C;E--){if(a.call(F,F._.tabIdList[E%C]))return F._.tabIdList[E%C];}return null;};function c(){var F=this;var B=F._.currentTabId,C=F._.tabIdList.length,D=CKEDITOR.tools.indexOf(F._.tabIdList,B);for(var E=D+1;E<D+C;E++){if(a.call(F,F._.tabIdList[E%C]))return F._.tabIdList[E%C];}return null;};CKEDITOR.dialog=function(B,C){var D=CKEDITOR.dialog._.dialogDefinitions[C];D=CKEDITOR.tools.extend(D(B),e);D=CKEDITOR.tools.clone(D);D=new i(this,D);var E=CKEDITOR.document,F=B.theme.buildDialog(B);this._={editor:B,element:F.element,name:C,contentSize:{width:0,height:0},size:{width:0,height:0},updateSize:false,contents:{},buttons:{},accessKeyMap:{},tabs:{},tabIdList:[],currentTabId:null,currentTabIndex:null,pageCount:0,lastTab:null,tabBarMode:false,focusList:[],currentFocusIndex:0,hasFocus:false};this.parts=F.parts;CKEDITOR.tools.setTimeout(function(){B.fire('ariaWidget',this.parts.contents);},0,this);this.parts.dialog.setStyles({position:CKEDITOR.env.ie6Compat?'absolute':'fixed',top:0,left:0,visibility:'hidden'});CKEDITOR.event.call(this);this.definition=D=CKEDITOR.fire('dialogDefinition',{name:C,definition:D},B).definition;if(D.onLoad)this.on('load',D.onLoad);if(D.onShow)this.on('show',D.onShow);if(D.onHide)this.on('hide',D.onHide);if(D.onOk)this.on('ok',function(R){if(D.onOk.call(this,R)===false)R.data.hide=false;});if(D.onCancel)this.on('cancel',function(R){if(D.onCancel.call(this,R)===false)R.data.hide=false;});var G=this,H=function(R){var S=G._.contents,T=false;for(var U in S)for(var V in S[U]){T=R.call(this,S[U][V]);if(T)return;}};this.on('ok',function(R){H(function(S){if(S.validate){var T=S.validate(this);if(typeof T=='string'){alert(T);T=false;}if(T===false){if(S.select)S.select();else S.focus();R.data.hide=false;R.stop();return true;}}});},this,null,0);this.on('cancel',function(R){H(function(S){if(S.isChanged()){if(!confirm(B.lang.common.confirmCancel))R.data.hide=false;return true;}});},this,null,0);this.parts.close.on('click',function(R){if(this.fire('cancel',{hide:true}).hide!==false)this.hide();R.data.preventDefault();},this);function I(){var R=G._.focusList;R.sort(function(U,V){if(U.tabIndex!=V.tabIndex)return V.tabIndex-U.tabIndex;else return U.focusIndex-V.focusIndex;
});var S=R.length;for(var T=0;T<S;T++)R[T].focusIndex=T;};function J(R){var S=G._.focusList,T=R?1:-1;if(S.length<1)return;var U=G._.currentFocusIndex;try{S[U].getInputElement().$.blur();}catch(X){}var V=(U+T+S.length)%S.length,W=V;while(!S[W].isFocusable()){W=(W+T+S.length)%S.length;if(W==V)break;}S[W].focus();if(S[W].type=='text')S[W].select();};this.changeFocus=J;var K;function L(R){var W=this;if(G!=CKEDITOR.dialog._.currentTop)return;var S=R.data.getKeystroke(),T=B.lang.dir=='rtl';K=0;if(S==9||S==CKEDITOR.SHIFT+9){var U=S==CKEDITOR.SHIFT+9;if(G._.tabBarMode){var V=U?b.call(G):c.call(G);G.selectPage(V);G._.tabs[V][0].focus();}else J(!U);K=1;}else if(S==CKEDITOR.ALT+121&&!G._.tabBarMode&&G.getPageCount()>1){G._.tabBarMode=true;G._.tabs[G._.currentTabId][0].focus();K=1;}else if((S==37||S==39)&&G._.tabBarMode){V=S==(T?39:37)?b.call(G):c.call(G);G.selectPage(V);G._.tabs[V][0].focus();K=1;}else if((S==13||S==32)&&G._.tabBarMode){W.selectPage(W._.currentTabId);W._.tabBarMode=false;W._.currentFocusIndex=-1;J(true);K=1;}if(K){R.stop();R.data.preventDefault();}};function M(R){K&&R.data.preventDefault();};var N=this._.element;this.on('show',function(){N.on('keydown',L,this,null,0);if(CKEDITOR.env.opera||CKEDITOR.env.gecko&&CKEDITOR.env.mac)N.on('keypress',M,this);});this.on('hide',function(){N.removeListener('keydown',L);if(CKEDITOR.env.opera||CKEDITOR.env.gecko&&CKEDITOR.env.mac)N.removeListener('keypress',M);});this.on('iframeAdded',function(R){var S=new CKEDITOR.dom.document(R.data.iframe.$.contentWindow.document);S.on('keydown',L,this,null,0);});this.on('show',function(){var V=this;I();if(B.config.dialog_startupFocusTab&&G._.tabIdList.length>1){G._.tabBarMode=true;G._.tabs[G._.currentTabId][0].focus();}else if(!V._.hasFocus){V._.currentFocusIndex=-1;if(D.onFocus){var R=D.onFocus.call(V);R&&R.focus();}else J(true);if(V._.editor.mode=='wysiwyg'&&CKEDITOR.env.ie){var S=B.document.$.selection,T=S.createRange();if(T)if(T.parentElement&&T.parentElement().ownerDocument==B.document.$||T.item&&T.item(0).ownerDocument==B.document.$){var U=document.body.createTextRange();U.moveToElementText(V.getElement().getFirst().$);U.collapse(true);U.select();}}}},this,null,4294967295);if(CKEDITOR.env.ie6Compat)this.on('load',function(R){var S=this.getElement(),T=S.getFirst();T.remove();T.appendTo(S);},this);k(this);l(this);new CKEDITOR.dom.text(D.title,CKEDITOR.document).appendTo(this.parts.title);for(var O=0;O<D.contents.length;O++)this.addPage(D.contents[O]);this.parts.tabs.on('click',function(R){var U=this;
var S=R.data.getTarget();if(S.hasClass('cke_dialog_tab')){var T=S.$.id;U.selectPage(T.substr(0,T.lastIndexOf('_')));if(U._.tabBarMode){U._.tabBarMode=false;U._.currentFocusIndex=-1;J(true);}R.data.preventDefault();}},this);var P=[],Q=CKEDITOR.dialog._.uiElementBuilders.hbox.build(this,{type:'hbox',className:'cke_dialog_footer_buttons',widths:[],children:D.buttons},P).getChild();this.parts.footer.setHtml(P.join(''));for(O=0;O<Q.length;O++)this._.buttons[Q[O].id]=Q[O];};function d(B,C,D){this.element=C;this.focusIndex=D;this.tabIndex=0;this.isFocusable=function(){return!C.getAttribute('disabled')&&C.isVisible();};this.focus=function(){B._.currentFocusIndex=this.focusIndex;this.element.focus();};C.on('keydown',function(E){if(E.data.getKeystroke() in {32:1,13:1})this.fire('click');});C.on('focus',function(){this.fire('mouseover');});C.on('blur',function(){this.fire('mouseout');});};CKEDITOR.dialog.prototype={destroy:function(){this.hide();this._.element.remove();},resize:(function(){return function(B,C){var D=this;if(D._.contentSize&&D._.contentSize.width==B&&D._.contentSize.height==C)return;CKEDITOR.dialog.fire('resize',{dialog:D,skin:D._.editor.skinName,width:B,height:C},D._.editor);D._.contentSize={width:B,height:C};D._.updateSize=true;};})(),getSize:function(){var D=this;if(!D._.updateSize)return D._.size;var B=D._.element.getFirst(),C=D._.size={width:B.$.offsetWidth||0,height:B.$.offsetHeight||0};D._.updateSize=!C.width||!C.height;return C;},move:(function(){var B;return function(C,D){var G=this;var E=G._.element.getFirst();if(B===undefined)B=E.getComputedStyle('position')=='fixed';if(B&&G._.position&&G._.position.x==C&&G._.position.y==D)return;G._.position={x:C,y:D};if(!B){var F=CKEDITOR.document.getWindow().getScrollPosition();C+=F.x;D+=F.y;}E.setStyles({left:(C>0?C:0)+'px',top:(D>0?D:0)+'px'});};})(),getPosition:function(){return CKEDITOR.tools.extend({},this._.position);},show:function(){var B=this._.editor;if(B.mode=='wysiwyg'&&CKEDITOR.env.ie){var C=B.getSelection();C&&C.lock();}var D=this._.element,E=this.definition;if(!(D.getParent()&&D.getParent().equals(CKEDITOR.document.getBody())))D.appendTo(CKEDITOR.document.getBody());else D.setStyle('display','block');if(CKEDITOR.env.gecko&&CKEDITOR.env.version<10900){var F=this.parts.dialog;F.setStyle('position','absolute');setTimeout(function(){F.setStyle('position','fixed');},0);}this.resize(E.minWidth,E.minHeight);this.selectPage(this.definition.contents[0].id);this.reset();if(CKEDITOR.dialog._.currentZIndex===null)CKEDITOR.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex;
this._.element.getFirst().setStyle('z-index',CKEDITOR.dialog._.currentZIndex+=10);if(CKEDITOR.dialog._.currentTop===null){CKEDITOR.dialog._.currentTop=this;this._.parentDialog=null;p(this._.editor);D.on('keydown',t);D.on(CKEDITOR.env.opera?'keypress':'keyup',u);for(var G in {keyup:1,keydown:1,keypress:1})D.on(G,A);}else{this._.parentDialog=CKEDITOR.dialog._.currentTop;var H=this._.parentDialog.getElement().getFirst();H.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);CKEDITOR.dialog._.currentTop=this;}v(this,this,'\x1b',null,function(){this.getButton('cancel')&&this.getButton('cancel').click();});this._.hasFocus=false;CKEDITOR.tools.setTimeout(function(){var I=CKEDITOR.document.getWindow().getViewPaneSize(),J=this.getSize();this.move((I.width-E.minWidth)/2,(I.height-J.height)/2);this.parts.dialog.setStyle('visibility','');this.fireOnce('load',{});this.fire('show',{});this._.editor.fire('dialogShow',this);this.foreach(function(K){K.setInitValue&&K.setInitValue();});},100,this);},foreach:function(B){var E=this;for(var C in E._.contents)for(var D in E._.contents[C])B(E._.contents[C][D]);return E;},reset:(function(){var B=function(C){if(C.reset)C.reset();};return function(){this.foreach(B);return this;};})(),setupContent:function(){var B=arguments;this.foreach(function(C){if(C.setup)C.setup.apply(C,B);});},commitContent:function(){var B=arguments;this.foreach(function(C){if(C.commit)C.commit.apply(C,B);});},hide:function(){if(!this.parts.dialog.isVisible())return;this.fire('hide',{});this._.editor.fire('dialogHide',this);var B=this._.element;B.setStyle('display','none');this.parts.dialog.setStyle('visibility','hidden');w(this);while(CKEDITOR.dialog._.currentTop!=this)CKEDITOR.dialog._.currentTop.hide();if(!this._.parentDialog)q();else{var C=this._.parentDialog.getElement().getFirst();C.setStyle('z-index',parseInt(C.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2));}CKEDITOR.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){CKEDITOR.dialog._.currentZIndex=null;B.removeListener('keydown',t);B.removeListener(CKEDITOR.env.opera?'keypress':'keyup',u);for(var D in {keyup:1,keydown:1,keypress:1})B.removeListener(D,A);var E=this._.editor;E.focus();if(E.mode=='wysiwyg'&&CKEDITOR.env.ie){var F=E.getSelection();F&&F.unlock(true);}}else CKEDITOR.dialog._.currentZIndex-=10;delete this._.parentDialog;this.foreach(function(G){G.resetInitValue&&G.resetInitValue();});},addPage:function(B){var N=this;var C=[],D=B.label?' title="'+CKEDITOR.tools.htmlEncode(B.label)+'"':'',E=B.elements,F=CKEDITOR.dialog._.uiElementBuilders.vbox.build(N,{type:'vbox',className:'cke_dialog_page_contents',children:B.elements,expand:!!B.expand,padding:B.padding,style:B.style||'width: 100%; height: 100%;'},C),G=CKEDITOR.dom.element.createFromHtml(C.join(''));
G.setAttribute('role','tabpanel');var H=CKEDITOR.env,I=B.id+'_'+CKEDITOR.tools.getNextNumber(),J=CKEDITOR.dom.element.createFromHtml(['<a class="cke_dialog_tab"',N._.pageCount>0?' cke_last':'cke_first',D,!!B.hidden?' style="display:none"':'',' id="',I,'"',H.gecko&&H.version>=10900&&!H.hc?'':' href="javascript:void(0)"',' tabIndex="-1"',' hidefocus="true"',' role="tab">',B.label,'</a>'].join(''));G.setAttribute('aria-labelledby',I);N._.tabs[B.id]=[J,G];N._.tabIdList.push(B.id);!B.hidden&&N._.pageCount++;N._.lastTab=J;N.updateStyle();var K=N._.contents[B.id]={},L,M=F.getChild();while(L=M.shift()){K[L.id]=L;if(typeof L.getChild=='function')M.push.apply(M,L.getChild());}G.setAttribute('name',B.id);G.appendTo(N.parts.contents);J.unselectable();N.parts.tabs.append(J);if(B.accessKey){v(N,N,'CTRL+'+B.accessKey,y,x);N._.accessKeyMap['CTRL+'+B.accessKey]=B.id;}},selectPage:function(B){var G=this;for(var C in G._.tabs){var D=G._.tabs[C][0],E=G._.tabs[C][1];if(C!=B){D.removeClass('cke_dialog_tab_selected');E.hide();}E.setAttribute('aria-hidden',C!=B);}var F=G._.tabs[B];F[0].addClass('cke_dialog_tab_selected');F[1].show();G._.currentTabId=B;G._.currentTabIndex=CKEDITOR.tools.indexOf(G._.tabIdList,B);},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?'add':'remove')+'Class']('cke_single_page');},hidePage:function(B){var D=this;var C=D._.tabs[B]&&D._.tabs[B][0];if(!C||D._.pageCount==1)return;else if(B==D._.currentTabId)D.selectPage(b.call(D));C.hide();D._.pageCount--;D.updateStyle();},showPage:function(B){var D=this;var C=D._.tabs[B]&&D._.tabs[B][0];if(!C)return;C.show();D._.pageCount++;D.updateStyle();},getElement:function(){return this._.element;},getName:function(){return this._.name;},getContentElement:function(B,C){var D=this._.contents[B];return D&&D[C];},getValueOf:function(B,C){return this.getContentElement(B,C).getValue();},setValueOf:function(B,C,D){return this.getContentElement(B,C).setValue(D);},getButton:function(B){return this._.buttons[B];},click:function(B){return this._.buttons[B].click();},disableButton:function(B){return this._.buttons[B].disable();},enableButton:function(B){return this._.buttons[B].enable();},getPageCount:function(){return this._.pageCount;},getParentEditor:function(){return this._.editor;},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement();},addFocusable:function(B,C){var E=this;if(typeof C=='undefined'){C=E._.focusList.length;E._.focusList.push(new d(E,B,C));}else{E._.focusList.splice(C,0,new d(E,B,C));
for(var D=C+1;D<E._.focusList.length;D++)E._.focusList[D].focusIndex++;}}};CKEDITOR.tools.extend(CKEDITOR.dialog,{add:function(B,C){if(!this._.dialogDefinitions[B]||typeof C=='function')this._.dialogDefinitions[B]=C;},exists:function(B){return!!this._.dialogDefinitions[B];},getCurrent:function(){return CKEDITOR.dialog._.currentTop;},okButton:(function(){var B=function(C,D){D=D||{};return CKEDITOR.tools.extend({id:'ok',type:'button',label:C.lang.common.ok,'class':'cke_dialog_ui_button_ok',onClick:function(E){var F=E.data.dialog;if(F.fire('ok',{hide:true}).hide!==false)F.hide();}},D,true);};B.type='button';B.override=function(C){return CKEDITOR.tools.extend(function(D){return B(D,C);},{type:'button'},true);};return B;})(),cancelButton:(function(){var B=function(C,D){D=D||{};return CKEDITOR.tools.extend({id:'cancel',type:'button',label:C.lang.common.cancel,'class':'cke_dialog_ui_button_cancel',onClick:function(E){var F=E.data.dialog;if(F.fire('cancel',{hide:true}).hide!==false)F.hide();}},D,true);};B.type='button';B.override=function(C){return CKEDITOR.tools.extend(function(D){return B(D,C);},{type:'button'},true);};return B;})(),addUIElement:function(B,C){this._.uiElementBuilders[B]=C;}});CKEDITOR.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};CKEDITOR.event.implementOn(CKEDITOR.dialog);CKEDITOR.event.implementOn(CKEDITOR.dialog.prototype,true);var e={resizable:CKEDITOR.DIALOG_RESIZE_BOTH,minWidth:600,minHeight:400,buttons:[CKEDITOR.dialog.okButton,CKEDITOR.dialog.cancelButton]};CKEDITOR.env.mac&&e.buttons.reverse();var f=function(B,C,D){for(var E=0,F;F=B[E];E++){if(F.id==C)return F;if(D&&F[D]){var G=f(F[D],C,D);if(G)return G;}}return null;},g=function(B,C,D,E,F){if(D){for(var G=0,H;H=B[G];G++){if(H.id==D){B.splice(G,0,C);return C;}if(E&&H[E]){var I=g(H[E],C,D,E,true);if(I)return I;}}if(F)return null;}B.push(C);return C;},h=function(B,C,D){for(var E=0,F;F=B[E];E++){if(F.id==C)return B.splice(E,1);if(D&&F[D]){var G=h(F[D],C,D);if(G)return G;}}return null;},i=function(B,C){this.dialog=B;var D=C.contents;for(var E=0,F;F=D[E];E++)D[E]=new j(B,F);CKEDITOR.tools.extend(this,C);};i.prototype={getContents:function(B){return f(this.contents,B);},getButton:function(B){return f(this.buttons,B);},addContents:function(B,C){return g(this.contents,B,C);},addButton:function(B,C){return g(this.buttons,B,C);},removeContents:function(B){h(this.contents,B);},removeButton:function(B){h(this.buttons,B);}};function j(B,C){this._={dialog:B};CKEDITOR.tools.extend(this,C);
};j.prototype={get:function(B){return f(this.elements,B,'children');},add:function(B,C){return g(this.elements,B,C,'children');},remove:function(B){h(this.elements,B,'children');}};function k(B){var C=null,D=null,E=B.getElement().getFirst(),F=B.getParentEditor(),G=F.config.dialog_magnetDistance,H=F.skin.margins||[0,0,0,0];if(typeof G=='undefined')G=20;function I(K){var L=B.getSize(),M=CKEDITOR.document.getWindow().getViewPaneSize(),N=K.data.$.screenX,O=K.data.$.screenY,P=N-C.x,Q=O-C.y,R,S;C={x:N,y:O};D.x+=P;D.y+=Q;if(D.x+H[3]<G)R=-H[3];else if(D.x-H[1]>M.width-L.width-G)R=M.width-L.width+H[1];else R=D.x;if(D.y+H[0]<G)S=-H[0];else if(D.y-H[2]>M.height-L.height-G)S=M.height-L.height+H[2];else S=D.y;B.move(R,S);K.data.preventDefault();};function J(K){CKEDITOR.document.removeListener('mousemove',I);CKEDITOR.document.removeListener('mouseup',J);if(CKEDITOR.env.ie6Compat){var L=o.getChild(0).getFrameDocument();L.removeListener('mousemove',I);L.removeListener('mouseup',J);}};B.parts.title.on('mousedown',function(K){B._.updateSize=true;C={x:K.data.$.screenX,y:K.data.$.screenY};CKEDITOR.document.on('mousemove',I);CKEDITOR.document.on('mouseup',J);D=B.getPosition();if(CKEDITOR.env.ie6Compat){var L=o.getChild(0).getFrameDocument();L.on('mousemove',I);L.on('mouseup',J);}K.data.preventDefault();},B);};function l(B){var C=B.definition,D=C.minWidth||0,E=C.minHeight||0,F=C.resizable,G=B.getParentEditor().skin.margins||[0,0,0,0];function H(S,T){S.y+=T;};function I(S,T){S.x2+=T;};function J(S,T){S.y2+=T;};function K(S,T){S.x+=T;};var L=null,M=null,N=B._.editor.config.magnetDistance,O=['tl','t','tr','l','r','bl','b','br'];function P(S){var T=S.listenerData.part,U=B.getSize();M=B.getPosition();CKEDITOR.tools.extend(M,{x2:M.x+U.width,y2:M.y+U.height});L={x:S.data.$.screenX,y:S.data.$.screenY};CKEDITOR.document.on('mousemove',Q,B,{part:T});CKEDITOR.document.on('mouseup',R,B,{part:T});if(CKEDITOR.env.ie6Compat){var V=o.getChild(0).getFrameDocument();V.on('mousemove',Q,B,{part:T});V.on('mouseup',R,B,{part:T});}S.data.preventDefault();};function Q(S){var T=S.data.$.screenX,U=S.data.$.screenY,V=T-L.x,W=U-L.y,X=CKEDITOR.document.getWindow().getViewPaneSize(),Y=S.listenerData.part;if(Y.search('t')!=-1)H(M,W);if(Y.search('l')!=-1)K(M,V);if(Y.search('b')!=-1)J(M,W);if(Y.search('r')!=-1)I(M,V);L={x:T,y:U};var Z,aa,ab,ac;if(M.x+G[3]<N)Z=-G[3];else if(Y.search('l')!=-1&&M.x2-M.x<D+N)Z=M.x2-D;else Z=M.x;if(M.y+G[0]<N)aa=-G[0];else if(Y.search('t')!=-1&&M.y2-M.y<E+N)aa=M.y2-E;else aa=M.y;if(M.x2-G[1]>X.width-N)ab=X.width+G[1];
else if(Y.search('r')!=-1&&M.x2-M.x<D+N)ab=M.x+D;else ab=M.x2;if(M.y2-G[2]>X.height-N)ac=X.height+G[2];else if(Y.search('b')!=-1&&M.y2-M.y<E+N)ac=M.y+E;else ac=M.y2;B.move(Z,aa);B.resize(ab-Z,ac-aa);S.data.preventDefault();};function R(S){CKEDITOR.document.removeListener('mouseup',R);CKEDITOR.document.removeListener('mousemove',Q);if(CKEDITOR.env.ie6Compat){var T=o.getChild(0).getFrameDocument();T.removeListener('mouseup',R);T.removeListener('mousemove',Q);}};};var m,n={},o;function p(B){var C=CKEDITOR.document.getWindow(),D=B.config.dialog_backgroundCoverColor||'white',E=B.config.dialog_backgroundCoverOpacity,F=B.config.baseFloatZIndex,G=CKEDITOR.tools.genKey(D,E,F),H=n[G];if(!H){var I=['<div style="position: ',CKEDITOR.env.ie6Compat?'absolute':'fixed','; z-index: ',F,'; top: 0px; left: 0px; ',!CKEDITOR.env.ie6Compat?'background-color: '+D:'','" class="cke_dialog_background_cover">'];if(CKEDITOR.env.ie6Compat){var J=CKEDITOR.env.isCustomDomain(),K="<html><body style=\\'background-color:"+D+";\\'></body></html>";I.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:');I.push('void((function(){document.open();'+(J?"document.domain='"+document.domain+"';":'')+"document.write( '"+K+"' );"+'document.close();'+'})())');I.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>');}I.push('</div>');H=CKEDITOR.dom.element.createFromHtml(I.join(''));H.setOpacity(E!=undefined?E:0.5);H.appendTo(CKEDITOR.document.getBody());n[G]=H;}else H.show();o=H;var L=function(){var O=C.getViewPaneSize();H.setStyles({width:O.width+'px',height:O.height+'px'});},M=function(){var O=C.getScrollPosition(),P=CKEDITOR.dialog._.currentTop;H.setStyles({left:O.x+'px',top:O.y+'px'});do{var Q=P.getPosition();P.move(Q.x,Q.y);}while(P=P._.parentDialog)};m=L;C.on('resize',L);L();if(CKEDITOR.env.ie6Compat){var N=function(){M();arguments.callee.prevScrollHandler.apply(this,arguments);};C.$.setTimeout(function(){N.prevScrollHandler=window.onscroll||(function(){});window.onscroll=N;},0);M();}};function q(){if(!o)return;var B=CKEDITOR.document.getWindow();o.hide();B.removeListener('resize',m);if(CKEDITOR.env.ie6Compat)B.$.setTimeout(function(){var C=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=C||null;},0);m=null;};function r(){for(var B in n)n[B].remove();n={};};var s={},t=function(B){var C=B.data.$.ctrlKey||B.data.$.metaKey,D=B.data.$.altKey,E=B.data.$.shiftKey,F=String.fromCharCode(B.data.$.keyCode),G=s[(C?'CTRL+':'')+(D?'ALT+':'')+(E?'SHIFT+':'')+F];
if(!G||!G.length)return;G=G[G.length-1];G.keydown&&G.keydown.call(G.uiElement,G.dialog,G.key);B.data.preventDefault();},u=function(B){var C=B.data.$.ctrlKey||B.data.$.metaKey,D=B.data.$.altKey,E=B.data.$.shiftKey,F=String.fromCharCode(B.data.$.keyCode),G=s[(C?'CTRL+':'')+(D?'ALT+':'')+(E?'SHIFT+':'')+F];if(!G||!G.length)return;G=G[G.length-1];if(G.keyup){G.keyup.call(G.uiElement,G.dialog,G.key);B.data.preventDefault();}},v=function(B,C,D,E,F){var G=s[D]||(s[D]=[]);G.push({uiElement:B,dialog:C,key:D,keyup:F||B.accessKeyUp,keydown:E||B.accessKeyDown});},w=function(B){for(var C in s){var D=s[C];for(var E=D.length-1;E>=0;E--){if(D[E].dialog==B||D[E].uiElement==B)D.splice(E,1);}if(D.length===0)delete s[C];}},x=function(B,C){if(B._.accessKeyMap[C])B.selectPage(B._.accessKeyMap[C]);},y=function(B,C){},z={27:1,13:1},A=function(B){if(B.data.getKeystroke() in z)B.data.stopPropagation();};(function(){CKEDITOR.ui.dialog={uiElement:function(B,C,D,E,F,G,H){if(arguments.length<4)return;var I=(E.call?E(C):E)||'div',J=['<',I,' '],K=(F&&F.call?F(C):F)||{},L=(G&&G.call?G(C):G)||{},M=(H&&H.call?H.call(this,B,C):H)||'',N=this.domId=L.id||CKEDITOR.tools.getNextNumber()+'_uiElement',O=this.id=C.id,P;L.id=N;var Q={};if(C.type)Q['cke_dialog_ui_'+C.type]=1;if(C.className)Q[C.className]=1;var R=L['class']&&L['class'].split?L['class'].split(' '):[];for(P=0;P<R.length;P++){if(R[P])Q[R[P]]=1;}var S=[];for(P in Q)S.push(P);L['class']=S.join(' ');if(C.title)L.title=C.title;var T=(C.style||'').split(';');for(P in K)T.push(P+':'+K[P]);if(C.hidden)T.push('display:none');for(P=T.length-1;P>=0;P--){if(T[P]==='')T.splice(P,1);}if(T.length>0)L.style=(L.style?L.style+'; ':'')+T.join('; ');for(P in L)J.push(P+'="'+CKEDITOR.tools.htmlEncode(L[P])+'" ');J.push('>',M,'</',I,'>');D.push(J.join(''));(this._||(this._={})).dialog=B;if(typeof C.isChanged=='boolean')this.isChanged=function(){return C.isChanged;};if(typeof C.isChanged=='function')this.isChanged=C.isChanged;CKEDITOR.event.implementOn(this);this.registerEvents(C);if(this.accessKeyUp&&this.accessKeyDown&&C.accessKey)v(this,B,'CTRL+'+C.accessKey);var U=this;B.on('load',function(){if(U.getInputElement())U.getInputElement().on('focus',function(){B._.tabBarMode=false;B._.hasFocus=true;U.fire('focus');},U);});if(this.keyboardFocusable){this.tabIndex=C.tabIndex||0;this.focusIndex=B._.focusList.push(this)-1;this.on('focus',function(){B._.currentFocusIndex=U.focusIndex;});}CKEDITOR.tools.extend(this,C);},hbox:function(B,C,D,E,F){if(arguments.length<4)return;
this._||(this._={});var G=this._.children=C,H=F&&F.widths||null,I=F&&F.height||null,J={},K,L=function(){var N=['<tbody><tr class="cke_dialog_ui_hbox">'];for(K=0;K<D.length;K++){var O='cke_dialog_ui_hbox_child',P=[];if(K===0)O='cke_dialog_ui_hbox_first';if(K==D.length-1)O='cke_dialog_ui_hbox_last';N.push('<td class="',O,'" role="presentation" ');if(H){if(H[K])P.push('width:'+CKEDITOR.tools.cssLength(H[K]));}else P.push('width:'+Math.floor(100/D.length)+'%');if(I)P.push('height:'+CKEDITOR.tools.cssLength(I));if(F&&F.padding!=undefined)P.push('padding:'+CKEDITOR.tools.cssLength(F.padding));if(P.length>0)N.push('style="'+P.join('; ')+'" ');N.push('>',D[K],'</td>');}N.push('</tr></tbody>');return N.join('');},M={role:'presentation'};F&&F.align&&(M.align=F.align);CKEDITOR.ui.dialog.uiElement.call(this,B,F||{type:'hbox'},E,'table',J,M,L);},vbox:function(B,C,D,E,F){if(arguments.length<3)return;this._||(this._={});var G=this._.children=C,H=F&&F.width||null,I=F&&F.heights||null,J=function(){var K=['<table role="presentation" cellspacing="0" border="0" '];K.push('style="');if(F&&F.expand)K.push('height:100%;');K.push('width:'+CKEDITOR.tools.cssLength(H||'100%'),';');K.push('"');K.push('align="',CKEDITOR.tools.htmlEncode(F&&F.align||(B.getParentEditor().lang.dir=='ltr'?'left':'right')),'" ');K.push('><tbody>');for(var L=0;L<D.length;L++){var M=[];K.push('<tr><td role="presentation" ');if(H)M.push('width:'+CKEDITOR.tools.cssLength(H||'100%'));if(I)M.push('height:'+CKEDITOR.tools.cssLength(I[L]));else if(F&&F.expand)M.push('height:'+Math.floor(100/D.length)+'%');if(F&&F.padding!=undefined)M.push('padding:'+CKEDITOR.tools.cssLength(F.padding));if(M.length>0)K.push('style="',M.join('; '),'" ');K.push(' class="cke_dialog_ui_vbox_child">',D[L],'</td></tr>');}K.push('</tbody></table>');return K.join('');};CKEDITOR.ui.dialog.uiElement.call(this,B,F||{type:'vbox'},E,'div',null,{role:'presentation'},J);}};})();CKEDITOR.ui.dialog.uiElement.prototype={getElement:function(){return CKEDITOR.document.getById(this.domId);},getInputElement:function(){return this.getElement();},getDialog:function(){return this._.dialog;},setValue:function(B){this.getInputElement().setValue(B);this.fire('change',{value:B});return this;},getValue:function(){return this.getInputElement().getValue();},isChanged:function(){return false;},selectParentTab:function(){var E=this;var B=E.getInputElement(),C=B,D;while((C=C.getParent())&&C.$.className.search('cke_dialog_page_contents')==-1){}if(!C)return E;D=C.getAttribute('name');
if(E._.dialog._.currentTabId!=D)E._.dialog.selectPage(D);return E;},focus:function(){this.selectParentTab().getInputElement().focus();return this;},registerEvents:function(B){var C=/^on([A-Z]\w+)/,D,E=function(G,H,I,J){H.on('load',function(){G.getInputElement().on(I,J,G);});};for(var F in B){if(!(D=F.match(C)))continue;if(this.eventProcessors[F])this.eventProcessors[F].call(this,this._.dialog,B[F]);else E(this,this._.dialog,D[1].toLowerCase(),B[F]);}return this;},eventProcessors:{onLoad:function(B,C){B.on('load',C,this);},onShow:function(B,C){B.on('show',C,this);},onHide:function(B,C){B.on('hide',C,this);}},accessKeyDown:function(B,C){this.focus();},accessKeyUp:function(B,C){},disable:function(){var B=this.getInputElement();B.setAttribute('disabled','true');B.addClass('cke_disabled');},enable:function(){var B=this.getInputElement();B.removeAttribute('disabled');B.removeClass('cke_disabled');},isEnabled:function(){return!this.getInputElement().getAttribute('disabled');},isVisible:function(){return this.getInputElement().isVisible();},isFocusable:function(){if(!this.isEnabled()||!this.isVisible())return false;return true;}};CKEDITOR.ui.dialog.hbox.prototype=CKEDITOR.tools.extend(new CKEDITOR.ui.dialog.uiElement(),{getChild:function(B){var C=this;if(arguments.length<1)return C._.children.concat();if(!B.splice)B=[B];if(B.length<2)return C._.children[B[0]];else return C._.children[B[0]]&&C._.children[B[0]].getChild?C._.children[B[0]].getChild(B.slice(1,B.length)):null;}},true);CKEDITOR.ui.dialog.vbox.prototype=new CKEDITOR.ui.dialog.hbox();(function(){var B={build:function(C,D,E){var F=D.children,G,H=[],I=[];for(var J=0;J<F.length&&(G=F[J]);J++){var K=[];H.push(K);I.push(CKEDITOR.dialog._.uiElementBuilders[G.type].build(C,G,K));}return new CKEDITOR.ui.dialog[D.type](C,I,H,E,D);}};CKEDITOR.dialog.addUIElement('hbox',B);CKEDITOR.dialog.addUIElement('vbox',B);})();CKEDITOR.dialogCommand=function(B){this.dialogName=B;};CKEDITOR.dialogCommand.prototype={exec:function(B){B.openDialog(this.dialogName);},canUndo:false,editorFocus:CKEDITOR.env.ie||CKEDITOR.env.webkit};(function(){var B=/^([a]|[^a])+$/,C=/^\d*$/,D=/^\d*(?:\.\d+)?$/;CKEDITOR.VALIDATE_OR=1;CKEDITOR.VALIDATE_AND=2;CKEDITOR.dialog.validate={functions:function(){return function(){var K=this;var E=K&&K.getValue?K.getValue():arguments[0],F=undefined,G=CKEDITOR.VALIDATE_AND,H=[],I;for(I=0;I<arguments.length;I++){if(typeof arguments[I]=='function')H.push(arguments[I]);else break;}if(I<arguments.length&&typeof arguments[I]=='string'){F=arguments[I];
I++;}if(I<arguments.length&&typeof arguments[I]=='number')G=arguments[I];var J=G==CKEDITOR.VALIDATE_AND?true:false;for(I=0;I<H.length;I++){if(G==CKEDITOR.VALIDATE_AND)J=J&&H[I](E);else J=J||H[I](E);}if(!J){if(F!==undefined)alert(F);if(K&&(K.select||K.focus))K.select||K.focus();return false;}return true;};},regex:function(E,F){return function(){var H=this;var G=H&&H.getValue?H.getValue():arguments[0];if(!E.test(G)){if(F!==undefined)alert(F);if(H&&(H.select||H.focus))if(H.select)H.select();else H.focus();return false;}return true;};},notEmpty:function(E){return this.regex(B,E);},integer:function(E){return this.regex(C,E);},number:function(E){return this.regex(D,E);},equals:function(E,F){return this.functions(function(G){return G==E;},F);},notEqual:function(E,F){return this.functions(function(G){return G!=E;},F);}};CKEDITOR.on('instanceDestroyed',function(E){if(CKEDITOR.tools.isEmpty(CKEDITOR.instances)){var F;while(F=CKEDITOR.dialog._.currentTop)F.hide();r();}var G=E.editor._.storedDialogs;for(var H in G)G[H].destroy();});})();})();CKEDITOR.tools.extend(CKEDITOR.editor.prototype,{openDialog:function(a,b){var c=CKEDITOR.dialog._.dialogDefinitions[a],d=this.skin.dialog;if(typeof c=='function'&&d._isLoaded){var e=this._.storedDialogs||(this._.storedDialogs={}),f=e[a]||(e[a]=new CKEDITOR.dialog(this,a));b&&b.call(f,f);f.show();return f;}else if(c=='failed')throw new Error('[CKEDITOR.dialog.openDialog] Dialog "'+a+'" failed when loading definition.');var g=CKEDITOR.document.getBody(),h=g.$.style.cursor,i=this;g.setStyle('cursor','wait');function j(l){var m=CKEDITOR.dialog._.dialogDefinitions[a],n=i.skin.dialog;if(!n._isLoaded||k&&typeof l=='undefined')return;if(typeof m!='function')CKEDITOR.dialog._.dialogDefinitions[a]='failed';i.openDialog(a,b);g.setStyle('cursor',h);};if(typeof c=='string'){var k=1;CKEDITOR.scriptLoader.load(CKEDITOR.getUrl(c),j);}CKEDITOR.skins.load(this,'dialog',j);return null;}});CKEDITOR.plugins.add('dialog',{requires:['dialogui']});
