var MooTools={version:"1.11-desmart"};function $defined(A){return(A!=undefined)}function $type(B){if(!$defined(B)){return false}if(B.htmlElement){return"element"}var A=typeof B;if(A=="object"&&B.nodeName){switch(B.nodeType){case 1:return"element";case 3:return(/\S/).test(B.nodeValue)?"textnode":"whitespace"}}if(A=="object"||A=="function"){switch(B.constructor){case Array:return"array";case RegExp:return"regexp";case Class:return"class"}if(typeof B.length=="number"){if(B.item){return"collection"}if(B.callee){return"arguments"}}}return A}function $merge(){var C={};for(var B=0;B<arguments.length;B++){for(var E in arguments[B]){var A=arguments[B][E];var D=C[E];if(D&&$type(A)=="object"&&$type(D)=="object"){C[E]=$merge(D,A)}else{C[E]=A}}}return C}var $extend=function(){var A=arguments;if(!A[1]){A=[this,A[0]]}for(var B in A[1]){A[0][B]=A[1][B]}return A[0]};var $native=function(){for(var B=0,A=arguments.length;B<A;B++){arguments[B].extend=function(C){for(var D in C){if(!this.prototype[D]){this.prototype[D]=C[D]}if(!this[D]){this[D]=$native.generic(D)}}}}};$native.generic=function(A){return function(B){return this.prototype[A].apply(B,Array.prototype.slice.call(arguments,1))}};$native(Function,Array,String,Number);function $chk(A){return !!(A||A===0)}function $pick(B,A){return $defined(B)?B:A}function $random(B,A){return Math.floor(Math.random()*(A-B+1)+B)}function $time(){return new Date().getTime()}function $clear(A){clearTimeout(A);clearInterval(A);return null}var Abstract=function(A){A=A||{};A.extend=$extend;return A};var Window=new Abstract(window);var Document=new Abstract(document);document.head=document.getElementsByTagName("head")[0];window.xpath=!!(document.evaluate);if(window.ActiveXObject){window.ie=window[window.XMLHttpRequest?"ie7":"ie6"]=true}else{if(document.childNodes&&!document.all&&!navigator.taintEnabled){window.webkit=window[window.xpath?"webkit420":"webkit419"]=true}else{if(document.getBoxObjectFor!=null){window.gecko=true}}}window.khtml=window.webkit;Object.extend=$extend;if(typeof HTMLElement=="undefined"){var HTMLElement=function(){};if(window.webkit){document.createElement("iframe")}HTMLElement.prototype=(window.webkit)?window["[[DOMElement.prototype]]"]:{}}HTMLElement.prototype.htmlElement=function(){};if(window.ie6){try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}}var Class=function(B){var A=function(){return(arguments[0]!==null&&this.initialize&&$type(this.initialize)=="function")?this.initialize.apply(this,arguments):this};$extend(A,this);A.prototype=B;A.constructor=Class;return A};Class.empty=function(){};Class.prototype={extend:function(B){var C=new this(null);for(var D in B){var A=C[D];C[D]=Class.Merge(A,B[D])}return new Class(C)},implement:function(){for(var B=0,A=arguments.length;B<A;B++){$extend(this.prototype,arguments[B])}}};Class.Merge=function(C,D){if(C&&C!=D){var B=$type(D);if(B!=$type(C)){return D}switch(B){case"function":var A=function(){this.parent=arguments.callee.parent;return D.apply(this,arguments)};A.parent=C;return A;case"object":return $merge(C,D)}}return D};var Chain=new Class({chain:function(A){this.chains=this.chains||[];this.chains.push(A);return this},callChain:function(){if(this.chains&&this.chains.length){this.chains.shift().delay(10,this)}},clearChain:function(){this.chains=[]}});var Events=new Class({addEvent:function(B,A){if(A!=Class.empty){this.$events=this.$events||{};this.$events[B]=this.$events[B]||[];this.$events[B].include(A)}return this},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].each(function(D){D.create({bind:this,delay:A,"arguments":B})()},this)}return this},removeEvent:function(B,A){if(this.$events&&this.$events[B]){this.$events[B].remove(A)}return this}});var Options=new Class({setOptions:function(){this.options=$merge.apply(null,[this.options].extend(arguments));if(this.addEvent){for(var A in this.options){if($type(this.options[A]=="function")&&(/^on[A-Z]/).test(A)){this.addEvent(A,this.options[A])}}}return this}});Array.extend({forEach:function(C,D){for(var B=0,A=this.length;B<A;B++){C.call(D,this[B],B,this)}},filter:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){if(D.call(E,this[B],B,this)){C.push(this[B])}}return C},map:function(D,E){var C=[];for(var B=0,A=this.length;B<A;B++){C[B]=D.call(E,this[B],B,this)}return C},every:function(C,D){for(var B=0,A=this.length;B<A;B++){if(!C.call(D,this[B],B,this)){return false}}return true},some:function(C,D){for(var B=0,A=this.length;B<A;B++){if(C.call(D,this[B],B,this)){return true}}return false},indexOf:function(C,D){var A=this.length;for(var B=(D<0)?Math.max(0,A+D):D||0;B<A;B++){if(this[B]===C){return B}}return -1},copy:function(D,C){D=D||0;if(D<0){D=this.length+D}C=C||(this.length-D);var A=[];for(var B=0;B<C;B++){A[B]=this[D++]}return A},remove:function(C){var B=0;var A=this.length;while(B<A){if(this[B]===C){this.splice(B,1);A--}else{B++}}return this},contains:function(A,B){return this.indexOf(A,B)!=-1},associate:function(C){var D={},B=Math.min(this.length,C.length);for(var A=0;A<B;A++){D[C[A]]=this[A]}return D},extend:function(C){for(var B=0,A=C.length;B<A;B++){this.push(C[B])}return this},merge:function(C){for(var B=0,A=C.length;B<A;B++){this.include(C[B])}return this},include:function(A){if(!this.contains(A)){this.push(A)}return this},getRandom:function(){return this[$random(0,this.length-1)]||null},getLast:function(){return this[this.length-1]||null}});Array.prototype.each=Array.prototype.forEach;Array.each=Array.forEach;function $A(A){return Array.copy(A)}function $each(C,B,D){if(C&&typeof C.length=="number"&&$type(C)!="object"){Array.forEach(C,B,D)}else{for(var A in C){B.call(D||C,C[A],A)}}}Array.prototype.test=Array.prototype.contains;String.extend({test:function(A,B){return(($type(A)=="string")?new RegExp(A,B):A).test(this)},toInt:function(A){var B=parseInt(this,10);if(true===A&&isNaN(B)){return 0}return B},toFloat:function(){return parseFloat(this)},camelCase:function(){return this.replace(/-\D/g,function(A){return A.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/\w[A-Z]/g,function(A){return(A.charAt(0)+"-"+A.charAt(1).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(A){return A.toUpperCase()})},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s{2,}/g," ").trim()},rgbToHex:function(B){var A=this.match(/\d{1,3}/g);return(A)?A.rgbToHex(B):false},hexToRgb:function(B){var A=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(A)?A.slice(1).hexToRgb(B):false},contains:function(A,B){return(B)?(B+this+B).indexOf(B+A+B)>-1:this.indexOf(A)>-1},escapeRegExp:function(){return this.replace(/([.*+?^${}()|[\]\/\\])/g,"\\$1")}});Array.extend({rgbToHex:function(D){if(this.length<3){return false}if(this.length==4&&this[3]==0&&!D){return"transparent"}var B=[];for(var A=0;A<3;A++){var C=(this[A]-0).toString(16);B.push((C.length==1)?"0"+C:C)}return D?B:"#"+B.join("")},hexToRgb:function(C){if(this.length!=3){return false}var A=[];for(var B=0;B<3;B++){A.push(parseInt((this[B].length==1)?this[B]+this[B]:this[B],16))}return C?A:"rgb("+A.join(",")+")"},max:function(){return(this.length==0)?false:Math.max.apply(Math,this)},min:function(){return(this.length==0)?false:Math.min.apply(Math,this)}});Function.extend({create:function(A){var B=this;A=$merge({bind:B,event:false,"arguments":null,delay:false,periodical:false,attempt:false},A);if($chk(A.arguments)&&$type(A.arguments)!="array"){A.arguments=[A.arguments]}return function(E){var C;if(A.event){E=E||window.event;C=[(A.event===true)?E:new A.event(E)];if(A.arguments){C.extend(A.arguments)}}else{C=A.arguments||arguments}var F=function(){return B.apply($pick(A.bind,B),C)};if(A.delay){return setTimeout(F,A.delay)}if(A.periodical){return setInterval(F,A.periodical)}if(A.attempt){try{return F()}catch(D){return false}}return F()}},pass:function(A,B){return this.create({"arguments":A,bind:B})},attempt:function(A,B){return this.create({"arguments":A,bind:B,attempt:true})()},bind:function(B,A){return this.create({bind:B,"arguments":A})},bindAsEventListener:function(B,A){return this.create({bind:B,event:true,"arguments":A})},delay:function(B,C,A){return this.create({delay:B,bind:C,"arguments":A})()},periodical:function(A,C,B){return this.create({periodical:A,bind:C,"arguments":B})()}});Number.extend({toInt:function(A){var B=parseInt(this,10);if(true===A&&isNaN(B)){return 0}return B},toFloat:function(){return parseFloat(this)},limit:function(B,A){return Math.min(A,Math.max(B,this))},round:function(A){A=Math.pow(10,A||0);return Math.round(this*A)/A},times:function(B){for(var A=0;A<this;A++){B(A)}}});var Element=new Class({initialize:function(D,C){if($type(D)=="string"){if(window.ie&&C&&(C.name||C.type)){var A=(C.name)?' name="'+C.name+'"':"";var B=(C.type)?' type="'+C.type+'"':"";delete C.name;delete C.type;D="<"+D+A+B+">"}D=document.createElement(D)}D=$(D);return(!C||!D)?D:D.set(C)}});var Elements=new Class({initialize:function(A){return(A)?$extend(A,this):this}});Elements.extend=function(A){for(var B in A){this.prototype[B]=A[B];this[B]=$native.generic(B)}};function $(B){if(!B){return null}if(B.htmlElement){return Garbage.collect(B)}if([window,document].contains(B)){return B}var A=$type(B);if(A=="string"){B=document.getElementById(B);A=(B)?"element":false}if(A!="element"){return null}if(B.htmlElement){return Garbage.collect(B)}if(["object","embed"].contains(B.tagName.toLowerCase())){return B}$extend(B,Element.prototype);B.htmlElement=function(){};return Garbage.collect(B)}document.getElementsBySelector=document.getElementsByTagName;function $$(){var D=[];for(var C=0,B=arguments.length;C<B;C++){var A=arguments[C];switch($type(A)){case"element":D.push(A);case"boolean":break;case false:break;case"string":A=document.getElementsBySelector(A,true);default:D.extend(A)}}return $$.unique(D)}$$.unique=function(G){var D=[];for(var C=0,A=G.length;C<A;C++){if(G[C].$included){continue}var B=$(G[C]);if(B&&!B.$included){B.$included=true;D.push(B)}}for(var F=0,E=D.length;F<E;F++){D[F].$included=null}return new Elements(D)};Elements.Multi=function(A){return function(){var D=arguments;var B=[];var G=true;for(var E=0,C=this.length,F;E<C;E++){F=this[E][A].apply(this[E],D);if($type(F)!="element"){G=false}B.push(F)}return(G)?$$.unique(B):B}};Element.extend=function(A){for(var B in A){HTMLElement.prototype[B]=A[B];Element.prototype[B]=A[B];Element[B]=$native.generic(B);var C=(Array.prototype[B])?B+"Elements":B;Elements.prototype[C]=Elements.Multi(B)}};Element.extend({set:function(A){for(var C in A){var B=A[C];switch(C){case"styles":this.setStyles(B);break;case"events":if(this.addEvents){this.addEvents(B)}break;case"properties":this.setProperties(B);break;default:this.setProperty(C,B)}}return this},inject:function(C,A){C=$(C);switch(A){case"before":C.parentNode.insertBefore(this,C);break;case"after":var B=C.getNext();if(!B){C.parentNode.appendChild(this)}else{C.parentNode.insertBefore(this,B)}break;case"top":var D=C.firstChild;if(D){C.insertBefore(this,D);break}default:C.appendChild(this)}return this},injectBefore:function(A){return this.inject(A,"before")},injectAfter:function(A){return this.inject(A,"after")},injectInside:function(A){return this.inject(A,"bottom")},injectTop:function(A){return this.inject(A,"top")},adopt:function(){var A=[];$each(arguments,function(B){A=A.concat(B)});$$(A).inject(this);return this},remove:function(){return this.parentNode.removeChild(this)},clone:function(C){var B=$(this.cloneNode(C!==false));if(!B.$events){return B}B.$events={};for(var A in this.$events){B.$events[A]={keys:$A(this.$events[A].keys),values:$A(this.$events[A].values)}}return B.removeEvents()},replaceWith:function(A){A=$(A);this.parentNode.replaceChild(A,this);return A},appendText:function(A){this.appendChild(document.createTextNode(A));return this},hasClass:function(A){return this.className.contains(A," ")},addClass:function(A){if(!this.hasClass(A)){this.className=(this.className+" "+A).clean()}return this},removeClass:function(A){this.className=this.className.replace(new RegExp("(^|\\s)"+A+"(?:\\s|$)"),"$1").clean();return this},toggleClass:function(A){return this.hasClass(A)?this.removeClass(A):this.addClass(A)},setStyle:function(B,A){switch(B){case"opacity":return this.setOpacity(parseFloat(A));case"float":B=(window.ie)?"styleFloat":"cssFloat"}B=B.camelCase();switch($type(A)){case"number":if(!["zIndex","zoom"].contains(B)){A+="px"}break;case"array":A="rgb("+A.join(",")+")"}this.style[B]=A;return this},setStyles:function(A){switch($type(A)){case"object":Element.setMany(this,"setStyle",A);break;case"string":this.style.cssText=A}return this},setOpacity:function(A){if(A==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(window.ie){this.style.filter=(A==1)?"":"alpha(opacity="+A*100+")"}this.style.opacity=this.$tmp.opacity=A;return this},getStyle:function(C){C=C.camelCase();var A=this.style[C];if(!$chk(A)){if(C=="opacity"){return this.$tmp.opacity}A=[];for(var B in Element.Styles){if(C==B){Element.Styles[B].each(function(F){var E=this.getStyle(F);A.push(parseInt(E)?E:"0px")},this);if(C=="border"){var D=A.every(function(E){return(E==A[0])});return(D)?A[0]:false}return A.join(" ")}}if(C.contains("border")){if(Element.Styles.border.contains(C)){return["Width","Style","Color"].map(function(E){return this.getStyle(C+E)},this).join(" ")}else{if(Element.borderShort.contains(C)){return["Top","Right","Bottom","Left"].map(function(E){return this.getStyle("border"+E+C.replace("border",""))},this).join(" ")}}}if(document.defaultView){A=document.defaultView.getComputedStyle(this,null).getPropertyValue(C.hyphenate())}else{if(this.currentStyle){A=this.currentStyle[C]}}}if(window.ie){A=Element.fixStyle(C,A,this)}if(A&&C.test(/color/i)&&A.contains("rgb")){return A.split("rgb").splice(1,4).map(function(E){return E.rgbToHex()}).join(" ")}return A},getStyles:function(){return Element.getMany(this,"getStyle",arguments)},walk:function(A,C){A+="Sibling";var B=(C)?this[C]:this[A];while(B&&$type(B)!="element"){B=B[A]}return $(B)},getPrevious:function(){return this.walk("previous")},getNext:function(){return this.walk("next")},getFirst:function(){return this.walk("next","firstChild")},getLast:function(){return this.walk("previous","lastChild")},getParent:function(){return $(this.parentNode)},getChildren:function(){return $$(this.childNodes)},hasChild:function(A){return !!$A(this.getElementsByTagName("*")).contains(A)},getProperty:function(D){var B=Element.Properties[D];if(B){return this[B]}var A=Element.PropertiesIFlag[D]||0;if(!window.ie||A){return this.getAttribute(D,A)}var C=this.attributes[D];return(C)?C.nodeValue:null},removeProperty:function(B){var A=Element.Properties[B];if(A){this[A]=""}else{this.removeAttribute(B)}return this},getProperties:function(){return Element.getMany(this,"getProperty",arguments)},setProperty:function(C,B){var A=Element.Properties[C];if(A){this[A]=B}else{this.setAttribute(C,B)}return this},setProperties:function(A){return Element.setMany(this,"setProperty",A)},setHTML:function(){this.innerHTML=$A(arguments).join("");return this},setText:function(B){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){this.styleSheet.cssText=B}else{if(A=="script"){this.setProperty("text",B)}}return this}else{this.removeChild(this.firstChild);return this.appendText(B)}}this[$defined(this.innerText)?"innerText":"textContent"]=B;return this},getText:function(){var A=this.getTag();if(["style","script"].contains(A)){if(window.ie){if(A=="style"){return this.styleSheet.cssText}else{if(A=="script"){return this.getProperty("text")}}}else{return this.innerHTML}}return($pick(this.innerText,this.textContent))},getTag:function(){return this.tagName.toLowerCase()},empty:function(){Garbage.trash(this.getElementsByTagName("*"));return this.setHTML("")}});Element.fixStyle=function(E,A,D){if($chk(parseInt(A))){return A}if(["height","width"].contains(E)){var B=(E=="width")?["left","right"]:["top","bottom"];var C=0;B.each(function(F){C+=D.getStyle("border-"+F+"-width").toInt()+D.getStyle("padding-"+F).toInt()});return D["offset"+E.capitalize()]-C+"px"}else{if(E.test(/border(.+)Width|margin|padding/)){return"0px"}}return A};Element.Styles={border:[],padding:[],margin:[]};["Top","Right","Bottom","Left"].each(function(B){for(var A in Element.Styles){Element.Styles[A].push(A+B)}});Element.borderShort=["borderWidth","borderStyle","borderColor"];Element.getMany=function(B,D,C){var A={};$each(C,function(E){A[E]=B[D](E)});return A};Element.setMany=function(B,D,C){for(var A in C){B[D](A,C[A])}return B};Element.Properties=new Abstract({"class":"className","for":"htmlFor",colspan:"colSpan",rowspan:"rowSpan",accesskey:"accessKey",tabindex:"tabIndex",maxlength:"maxLength",readonly:"readOnly",frameborder:"frameBorder",value:"value",disabled:"disabled",checked:"checked",multiple:"multiple",selected:"selected"});Element.PropertiesIFlag={href:2,src:2};Element.Methods={Listeners:{addListener:function(B,A){if(this.addEventListener){this.addEventListener(B,A,false)}else{this.attachEvent("on"+B,A)}return this},removeListener:function(B,A){if(this.removeEventListener){this.removeEventListener(B,A,false)}else{this.detachEvent("on"+B,A)}return this}}};window.extend(Element.Methods.Listeners);document.extend(Element.Methods.Listeners);Element.extend(Element.Methods.Listeners);var Garbage={elements:[],collect:function(A){if(!A.$tmp){Garbage.elements.push(A);A.$tmp={opacity:1}}return A},trash:function(D){for(var B=0,A=D.length,C;B<A;B++){if(!(C=D[B])||!C.$tmp){continue}if(C.$events){C.fireEvent("trash").removeEvents()}for(var E in C.$tmp){C.$tmp[E]=null}for(var F in Element.prototype){C[F]=null}Garbage.elements[Garbage.elements.indexOf(C)]=null;C.htmlElement=C.$tmp=C=null}Garbage.elements.remove(null)},empty:function(){Garbage.collect(window);Garbage.collect(document);Garbage.trash(Garbage.elements)}};window.addListener("beforeunload",function(){window.addListener("unload",Garbage.empty);if(window.ie){window.addListener("unload",CollectGarbage)}});var Event=new Class({initialize:function(C){if(C&&C.$extended){return C}this.$extended=true;C=C||window.event;this.event=C;this.type=C.type;this.target=C.target||C.srcElement;if(this.target.nodeType==3){this.target=this.target.parentNode}this.shift=C.shiftKey;this.control=C.ctrlKey;this.alt=C.altKey;this.meta=C.metaKey;if(["DOMMouseScroll","mousewheel"].contains(this.type)){this.wheel=(C.wheelDelta)?C.wheelDelta/120:-(C.detail||0)/3}else{if(this.type.contains("key")){this.code=C.which||C.keyCode;for(var B in Event.keys){if(Event.keys[B]==this.code){this.key=B;break}}if(this.type=="keydown"){var A=this.code-111;if(A>0&&A<13){this.key="f"+A}}this.key=this.key||String.fromCharCode(this.code).toLowerCase()}else{if(this.type.test(/(click|mouse|menu)/)){this.page={x:C.pageX||C.clientX+document.documentElement.scrollLeft,y:C.pageY||C.clientY+document.documentElement.scrollTop};this.client={x:C.pageX?C.pageX-window.pageXOffset:C.clientX,y:C.pageY?C.pageY-window.pageYOffset:C.clientY};this.rightClick=(C.which==3)||(C.button==2);switch(this.type){case"mouseover":this.relatedTarget=C.relatedTarget||C.fromElement;break;case"mouseout":this.relatedTarget=C.relatedTarget||C.toElement}this.fixRelatedTarget()}}}return this},stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});Event.fix={relatedTarget:function(){if(this.relatedTarget&&this.relatedTarget.nodeType==3){this.relatedTarget=this.relatedTarget.parentNode}},relatedTargetGecko:function(){try{Event.fix.relatedTarget.call(this)}catch(A){this.relatedTarget=this.target}}};Event.prototype.fixRelatedTarget=(window.gecko)?Event.fix.relatedTargetGecko:Event.fix.relatedTarget;Event.keys=new Abstract({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Element.Methods.Events={addEvent:function(C,B){this.$events=this.$events||{};this.$events[C]=this.$events[C]||{keys:[],values:[]};if(this.$events[C].keys.contains(B)){return this}this.$events[C].keys.push(B);var A=C;var D=Element.Events[C];if(D){if(D.add){D.add.call(this,B)}if(D.map){B=D.map}if(D.type){A=D.type}}if(!this.addEventListener){B=B.create({bind:this,event:true})}this.$events[C].values.push(B);return(Element.NativeEvents.contains(A))?this.addListener(A,B):this},removeEvent:function(C,B){if(!this.$events||!this.$events[C]){return this}var F=this.$events[C].keys.indexOf(B);if(F==-1){return this}var A=this.$events[C].keys.splice(F,1)[0];var E=this.$events[C].values.splice(F,1)[0];var D=Element.Events[C];if(D){if(D.remove){D.remove.call(this,B)}if(D.type){C=D.type}}return(Element.NativeEvents.contains(C))?this.removeListener(C,E):this},addEvents:function(A){return Element.setMany(this,"addEvent",A)},removeEvents:function(A){if(!this.$events){return this}if(!A){for(var B in this.$events){this.removeEvents(B)}this.$events=null}else{if(this.$events[A]){this.$events[A].keys.each(function(C){this.removeEvent(A,C)},this);this.$events[A]=null}}return this},fireEvent:function(C,B,A){if(this.$events&&this.$events[C]){this.$events[C].keys.each(function(D){D.create({bind:this,delay:A,"arguments":B})()},this)}return this},cloneEvents:function(C,A){if(!C.$events){return this}if(!A){for(var B in C.$events){this.cloneEvents(C,B)}}else{if(C.$events[A]){C.$events[A].keys.each(function(D){this.addEvent(A,D)},this)}}return this}};window.extend(Element.Methods.Events);document.extend(Element.Methods.Events);Element.extend(Element.Methods.Events);Element.Events=new Abstract({mouseenter:{type:"mouseover",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseenter",A)}}},mouseleave:{type:"mouseout",map:function(A){A=new Event(A);if(A.relatedTarget!=this&&!this.hasChild(A.relatedTarget)){this.fireEvent("mouseleave",A)}}},mousewheel:{type:(window.gecko)?"DOMMouseScroll":"mousewheel"}});Element.NativeEvents=["click","dblclick","mouseup","mousedown","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","keydown","keypress","keyup","load","unload","beforeunload","resize","move","focus","blur","change","submit","reset","select","error","abort","contextmenu","scroll"];Function.extend({bindWithEvent:function(B,A){return this.create({bind:B,"arguments":A,event:Event})}});Elements.extend({filterByTag:function(A){return new Elements(this.filter(function(B){return(Element.getTag(B)==A)}))},filterByClass:function(A,C){var B=this.filter(function(D){return(D.className&&D.className.contains(A," "))});return(C)?B:new Elements(B)},filterById:function(C,B){var A=this.filter(function(D){return(D.id==C)});return(B)?A:new Elements(A)},filterByAttribute:function(B,A,D,E){var C=this.filter(function(F){var G=Element.getProperty(F,B);if(!G){return false}if(!A){return true}switch(A){case"=":return(G==D);case"*=":return(G.contains(D));case"^=":return(G.substr(0,D.length)==D);case"$=":return(G.substr(G.length-D.length)==D);case"!=":return(G!=D);case"~=":return G.contains(D," ")}return false});return(E)?C:new Elements(C)}});function $E(A,B){return($(B)||document).getElement(A)}function $ES(A,B){return($(B)||document).getElementsBySelector(A)}$$.shared={regexp:/^(\w*|\*)(?:#([\w-]+)|\.([\w-]+))?(?:\[(\w+)(?:([!*^$]?=)["']?([^"'\]]*)["']?)?])?$/,xpath:{getParam:function(B,D,E,C){var A=[D.namespaceURI?"xhtml:":"",E[1]];if(E[2]){A.push('[@id="',E[2],'"]')}if(E[3]){A.push('[contains(concat(" ", @class, " "), " ',E[3],' ")]')}if(E[4]){if(E[5]&&E[6]){switch(E[5]){case"*=":A.push("[contains(@",E[4],', "',E[6],'")]');break;case"^=":A.push("[starts-with(@",E[4],', "',E[6],'")]');break;case"$=":A.push("[substring(@",E[4],", string-length(@",E[4],") - ",E[6].length,' + 1) = "',E[6],'"]');break;case"=":A.push("[@",E[4],'="',E[6],'"]');break;case"!=":A.push("[@",E[4],'!="',E[6],'"]')}}else{A.push("[@",E[4],"]")}}B.push(A.join(""));return B},getItems:function(B,E,G){var F=[];var A=document.evaluate(".//"+B.join("//"),E,$$.shared.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null);for(var D=0,C=A.snapshotLength;D<C;D++){F.push(A.snapshotItem(D))}return(G)?F:new Elements(F.map($))}},normal:{getParam:function(A,C,E,B){if(B==0){if(E[2]){var D=C.getElementById(E[2]);if(!D||((E[1]!="*")&&(Element.getTag(D)!=E[1]))){return false}A=[D]}else{A=$A(C.getElementsByTagName(E[1]))}}else{A=$$.shared.getElementsByTagName(A,E[1]);if(E[2]){A=Elements.filterById(A,E[2],true)}}if(E[3]){A=Elements.filterByClass(A,E[3],true)}if(E[4]){A=Elements.filterByAttribute(A,E[4],E[5],E[6],true)}return A},getItems:function(A,B,C){return(C)?A:$$.unique(A)}},resolver:function(A){return(A=="xhtml")?"http://www.w3.org/1999/xhtml":false},getElementsByTagName:function(D,C){var E=[];for(var B=0,A=D.length;B<A;B++){E.extend(D[B].getElementsByTagName(C))}return E}};$$.shared.method=(window.xpath)?"xpath":"normal";Element.Methods.Dom={getElements:function(A,H){var C=[];A=A.trim().split(" ");for(var E=0,D=A.length;E<D;E++){var F=A[E];var G=F.match($$.shared.regexp);if(!G){break}G[1]=G[1]||"*";var B=$$.shared[$$.shared.method].getParam(C,this,G,E);if(!B){break}C=B}return $$.shared[$$.shared.method].getItems(C,this,H)},getElement:function(A){return $(this.getElements(A,true)[0]||false)},getElementsBySelector:function(A,E){var D=[];A=A.split(",");for(var C=0,B=A.length;C<B;C++){D=D.concat(this.getElements(A[C],true))}return(E)?D:$$.unique(D)}};Element.extend({getElementById:function(C){var B=document.getElementById(C);if(!B){return false}for(var A=B.parentNode;A!=this;A=A.parentNode){if(!A){return false}}return B},getElementsByClassName:function(A){return this.getElements("."+A)}});document.extend(Element.Methods.Dom);Element.extend(Element.Methods.Dom);Element.extend({getValue:function(){switch(this.getTag()){case"select":var A=[];$each(this.options,function(B){if(B.selected){A.push($pick(B.value,B.text))}});return(this.multiple)?A:A[0];case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break}case"textarea":return this.value}return false},getFormElements:function(){return $$(this.getElementsByTagName("input"),this.getElementsByTagName("select"),this.getElementsByTagName("textarea"))},toQueryString:function(){var A=[];this.getFormElements().each(function(D){var C=D.name;var E=D.getValue();if(E===false||!C||D.disabled){return }var B=function(F){A.push(C+"="+encodeURIComponent(F))};if($type(E)=="array"){E.each(B)}else{B(E)}});return A.join("&")}});Element.extend({scrollTo:function(A,B){this.scrollLeft=A;this.scrollTop=B},getSize:function(){return{scroll:{x:this.scrollLeft,y:this.scrollTop},size:{x:this.offsetWidth,y:this.offsetHeight},scrollSize:{x:this.scrollWidth,y:this.scrollHeight}}},getPosition:function(A){A=A||[];var B=this,D=0,C=0;do{D+=B.offsetLeft||0;C+=B.offsetTop||0;B=B.offsetParent}while(B);A.each(function(E){D-=E.scrollLeft||0;C-=E.scrollTop||0});return{x:D,y:C}},getTop:function(A){return this.getPosition(A).y},getLeft:function(A){return this.getPosition(A).x},getCoordinates:function(B){var A=this.getPosition(B);var C={width:this.offsetWidth,height:this.offsetHeight,left:A.x,top:A.y};C.right=C.left+C.width;C.bottom=C.top+C.height;return C}});Element.Events.domready={add:function(B){if(window.loaded){B.call(this);return }var A=function(){if(window.loaded){return }window.loaded=true;window.timer=$clear(window.timer);this.fireEvent("domready")}.bind(this);if(document.readyState&&window.webkit){window.timer=function(){if(["loaded","complete"].contains(document.readyState)){A()}}.periodical(50)}else{if(document.readyState&&window.ie){if(!$("ie_ready")){var C=(window.location.protocol=="https:")?"://0":"javascript:void(0)";document.write('<script id="ie_ready" defer src="'+C+'"><\/script>');$("ie_ready").onreadystatechange=function(){if(this.readyState=="complete"){A()}}}}else{window.addListener("load",A);document.addListener("DOMContentLoaded",A)}}}};window.onDomReady=function(A){return this.addEvent("domready",A)};window.extend({getWidth:function(){if(this.webkit419){return this.innerWidth}if(this.opera){return document.body.clientWidth}return document.documentElement.clientWidth},getHeight:function(){if(this.webkit419){return this.innerHeight}if(this.opera){return this.innerHeight}return document.documentElement.clientHeight},getScrollWidth:function(){if(this.ie){return Math.max(document.documentElement.offsetWidth,document.documentElement.scrollWidth)}if(this.webkit){return document.body.scrollWidth}return document.documentElement.scrollWidth},getScrollHeight:function(){if(this.ie){return Math.max(document.documentElement.offsetHeight,document.documentElement.scrollHeight)}if(this.webkit){return document.body.scrollHeight}return document.documentElement.scrollHeight},getScrollLeft:function(){return this.pageXOffset||document.documentElement.scrollLeft},getScrollTop:function(){return this.pageYOffset||document.documentElement.scrollTop},getSize:function(){return{size:{x:this.getWidth(),y:this.getHeight()},scrollSize:{x:this.getScrollWidth(),y:this.getScrollHeight()},scroll:{x:this.getScrollLeft(),y:this.getScrollTop()}}},getPosition:function(){return{x:0,y:0}}});var Fx={};Fx.Base=new Class({options:{onStart:Class.empty,onComplete:Class.empty,onCancel:Class.empty,transition:function(A){return -(Math.cos(Math.PI*A)-1)/2},duration:500,unit:"px",wait:true,fps:50},initialize:function(A){this.element=this.element||null;this.setOptions(A);if(this.options.initialize){this.options.initialize.call(this)}},step:function(){var A=$time();if(A<this.time+this.options.duration){this.delta=this.options.transition((A-this.time)/this.options.duration);this.setNow();this.increase()}else{this.stop(true);this.set(this.to);this.fireEvent("onComplete",this.element,10);this.callChain()}},set:function(A){this.now=A;this.increase();return this},setNow:function(){this.now=this.compute(this.from,this.to)},compute:function(B,A){return(A-B)*this.delta+B},start:function(B,A){if(!this.options.wait){this.stop()}else{if(this.timer){return this}}this.from=B;this.to=A;this.change=this.to-this.from;this.time=$time();this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);this.fireEvent("onStart",this.element);return this},stop:function(A){if(!this.timer){return this}this.timer=$clear(this.timer);if(!A){this.fireEvent("onCancel",this.element)}return this},custom:function(B,A){return this.start(B,A)},clearTimer:function(A){return this.stop(A)}});Fx.Base.implement(new Chain,new Events,new Options);Fx.CSS={select:function(B,C){if(B.test(/color/i)){return this.Color}var A=$type(C);if((A=="array")||(A=="string"&&C.contains(" "))){return this.Multi}return this.Single},parse:function(C,D,A){if(!A.push){A=[A]}var F=A[0],E=A[1];if(!$chk(E)){E=F;F=C.getStyle(D)}var B=this.select(D,E);return{from:B.parse(F),to:B.parse(E),css:B}}};Fx.CSS.Single={parse:function(A){return parseFloat(A)},getNow:function(C,B,A){return A.compute(C,B)},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=Math.round(C)}return C+A}};Fx.CSS.Multi={parse:function(A){return A.push?A:A.split(" ").map(function(B){return parseFloat(B)})},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[B]=C.compute(E[B],D[B])}return A},getValue:function(C,A,B){if(A=="px"&&B!="opacity"){C=C.map(Math.round)}return C.join(A+" ")+A}};Fx.CSS.Color={parse:function(A){return A.push?A:A.hexToRgb(true)},getNow:function(E,D,C){var A=[];for(var B=0;B<E.length;B++){A[B]=Math.round(C.compute(E[B],D[B]))}return A},getValue:function(A){return"rgb("+A.join(",")+")"}};Fx.Style=Fx.Base.extend({initialize:function(B,C,A){this.element=$(B);this.property=C;this.parent(A)},hide:function(){return this.set(0)},setNow:function(){this.now=this.css.getNow(this.from,this.to,this)},set:function(A){this.css=Fx.CSS.select(this.property,A);return this.parent(this.css.parse(A))},start:function(C,B){if(this.timer&&this.options.wait){return this}var A=Fx.CSS.parse(this.element,this.property,[C,B]);this.css=A.css;return this.parent(A.from,A.to)},increase:function(){this.element.setStyle(this.property,this.css.getValue(this.now,this.options.unit,this.property))}});Element.extend({effect:function(B,A){return new Fx.Style(this,B,A)}});Fx.Styles=Fx.Base.extend({initialize:function(B,A){this.element=$(B);this.parent(A)},setNow:function(){for(var A in this.from){this.now[A]=this.css[A].getNow(this.from[A],this.to[A],this)}},set:function(C){var A={};this.css={};for(var B in C){this.css[B]=Fx.CSS.select(B,C[B]);A[B]=this.css[B].parse(C[B])}return this.parent(A)},start:function(C){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var E={},D={};for(var B in C){var A=Fx.CSS.parse(this.element,B,C[B]);E[B]=A.from;D[B]=A.to;this.css[B]=A.css}return this.parent(E,D)},increase:function(){for(var A in this.now){this.element.setStyle(A,this.css[A].getValue(this.now[A],this.options.unit,A))}}});Element.extend({effects:function(A){return new Fx.Styles(this,A)}});Fx.Elements=Fx.Base.extend({initialize:function(B,A){this.elements=$$(B);this.parent(A)},setNow:function(){for(var C in this.from){var F=this.from[C],E=this.to[C],B=this.css[C],A=this.now[C]={};for(var D in F){A[D]=B[D].getNow(F[D],E[D],this)}}},set:function(G){var B={};this.css={};for(var D in G){var F=G[D],C=this.css[D]={},A=B[D]={};for(var E in F){C[E]=Fx.CSS.select(E,F[E]);A[E]=C[E].parse(F[E])}}return this.parent(B)},start:function(D){if(this.timer&&this.options.wait){return this}this.now={};this.css={};var I={},J={};for(var E in D){var G=D[E],A=I[E]={},H=J[E]={},C=this.css[E]={};for(var B in G){var F=Fx.CSS.parse(this.elements[E],B,G[B]);A[B]=F.from;H[B]=F.to;C[B]=F.css}}return this.parent(I,J)},increase:function(){for(var C in this.now){var A=this.now[C],B=this.css[C];for(var D in A){this.elements[C].setStyle(D,B[D].getValue(A[D],this.options.unit,D))}}}});Fx.Scroll=Fx.Base.extend({options:{overflown:[],offset:{x:0,y:0},wheelStops:true},initialize:function(B,A){this.now=[];this.element=$(B);this.bound={stop:this.stop.bind(this,false)};this.parent(A);if(this.options.wheelStops){this.addEvent("onStart",function(){document.addEvent("mousewheel",this.bound.stop)}.bind(this));this.addEvent("onComplete",function(){document.removeEvent("mousewheel",this.bound.stop)}.bind(this))}},setNow:function(){for(var A=0;A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A])}},scrollTo:function(B,F){if(this.timer&&this.options.wait){return this}var D=this.element.getSize();var C={x:B,y:F};for(var E in D.size){var A=D.scrollSize[E]-D.size[E];if($chk(C[E])){C[E]=($type(C[E])=="number")?C[E].limit(0,A):A}else{C[E]=D.scroll[E]}C[E]+=this.options.offset[E]}return this.start([D.scroll.x,D.scroll.y],[C.x,C.y])},toTop:function(){return this.scrollTo(false,0)},toBottom:function(){return this.scrollTo(false,"full")},toLeft:function(){return this.scrollTo(0,false)},toRight:function(){return this.scrollTo("full",false)},toElement:function(B){var A=this.element.getPosition(this.options.overflown);var C=$(B).getPosition(this.options.overflown);return this.scrollTo(C.x-A.x,C.y-A.y)},increase:function(){this.element.scrollTo(this.now[0],this.now[1])}});Fx.Slide=Fx.Base.extend({options:{mode:"vertical"},initialize:function(B,A){this.element=$(B);this.wrapper=new Element("div",{styles:$extend(this.element.getStyles("margin"),{overflow:"hidden"})}).injectAfter(this.element).adopt(this.element);this.element.setStyle("margin",0);this.setOptions(A);this.now=[];this.parent(this.options);this.open=true;this.addEvent("onComplete",function(){this.open=(this.now[0]===0)});if(window.webkit419){this.addEvent("onComplete",function(){if(this.open){this.element.remove().inject(this.wrapper)}})}},setNow:function(){for(var A=0;A<2;A++){this.now[A]=this.compute(this.from[A],this.to[A])}},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},slideIn:function(A){this[A||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[0,this.offset])},slideOut:function(A){this[A||this.options.mode]();return this.start([this.element.getStyle(this.margin).toInt(),this.wrapper.getStyle(this.layout).toInt()],[-this.offset,0])},hide:function(A){this[A||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(A){this[A||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(A){if(this.wrapper.offsetHeight==0||this.wrapper.offsetWidth==0){return this.slideIn(A)}return this.slideOut(A)},increase:function(){this.element.setStyle(this.margin,this.now[0]+this.options.unit);this.wrapper.setStyle(this.layout,this.now[1]+this.options.unit)}});Fx.Transition=function(B,A){A=A||[];if($type(A)!="array"){A=[A]}return $extend(B,{easeIn:function(C){return B(C,A)},easeOut:function(C){return 1-B(1-C,A)},easeInOut:function(C){return(C<=0.5)?B(2*C,A)/2:(2-B(2*(1-C),A))/2}})};Fx.Transitions=new Abstract({linear:function(A){return A}});Fx.Transitions.extend=function(A){for(var B in A){Fx.Transitions[B]=new Fx.Transition(A[B]);Fx.Transitions.compat(B)}};Fx.Transitions.compat=function(A){["In","Out","InOut"].each(function(B){Fx.Transitions[A.toLowerCase()+B]=Fx.Transitions[A]["ease"+B]})};Fx.Transitions.extend({Pow:function(B,A){return Math.pow(B,A[0]||6)},Expo:function(A){return Math.pow(2,8*(A-1))},Circ:function(A){return 1-Math.sin(Math.acos(A))},Sine:function(A){return 1-Math.sin((1-A)*Math.PI/2)},Back:function(B,A){A=A[0]||1.618;return Math.pow(B,2)*((A+1)*B-A)},Bounce:function(D){var C;for(var B=0,A=1;1;B+=A,A/=2){if(D>=(7-4*B)/11){C=-Math.pow((11-6*B-11*D)/4,2)+A*A;break}}return C},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2])});Fx.Transitions.compat(B)});var Drag={};Drag.Base=new Class({options:{handle:false,unit:"px",onStart:Class.empty,onBeforeStart:Class.empty,onComplete:Class.empty,onSnap:Class.empty,onDrag:Class.empty,limit:false,modifiers:{x:"left",y:"top"},grid:false,snap:6},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.handle=$(this.options.handle)||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.bound={start:this.start.bindWithEvent(this),check:this.check.bindWithEvent(this),drag:this.drag.bindWithEvent(this),stop:this.stop.bind(this)};this.attach();if(this.options.initialize){this.options.initialize.call(this)}},attach:function(){this.handle.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handle.removeEvent("mousedown",this.bound.start);return this},start:function(C){this.fireEvent("onBeforeStart",this.element);this.mouse.start=C.page;var A=this.options.limit;this.limit={x:[],y:[]};for(var D in this.options.modifiers){if(!this.options.modifiers[D]){continue}this.value.now[D]=this.element.getStyle(this.options.modifiers[D]).toInt();this.mouse.pos[D]=C.page[D]-this.value.now[D];if(A&&A[D]){for(var B=0;B<2;B++){if($chk(A[D][B])){this.limit[D][B]=($type(A[D][B])=="function")?A[D][B]():A[D][B]}}}}this.fireEvent("onStart",[this.element,C]);if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}document.addListener("mousemove",this.bound.check);document.addListener("mouseup",this.bound.stop);C.stop()},check:function(A){var B=Math.round(Math.sqrt(Math.pow(A.page.x-this.mouse.start.x,2)+Math.pow(A.page.y-this.mouse.start.y,2)));if(B>this.options.snap){document.removeListener("mousemove",this.bound.check);document.addListener("mousemove",this.bound.drag);this.drag(A);this.fireEvent("onSnap",this.element)}A.stop()},drag:function(A){this.out=false;this.mouse.now=A.page;for(var B in this.options.modifiers){if(!this.options.modifiers[B]){continue}this.value.now[B]=this.mouse.now[B]-this.mouse.pos[B];if(this.limit[B]){if($chk(this.limit[B][1])&&(this.value.now[B]>this.limit[B][1])){this.value.now[B]=this.limit[B][1];this.out=true}else{if($chk(this.limit[B][0])&&(this.value.now[B]<this.limit[B][0])){this.value.now[B]=this.limit[B][0];this.out=true}}}if(this.options.grid[B]){this.value.now[B]-=(this.value.now[B]%this.options.grid[B])}this.element.setStyle(this.options.modifiers[B],this.value.now[B]+this.options.unit)}this.fireEvent("onDrag",this.element);A.stop()},stop:function(){document.removeListener("mousemove",this.bound.check);document.removeListener("mousemove",this.bound.drag);document.removeListener("mouseup",this.bound.stop);this.fireEvent("onComplete",this.element)}});Drag.Base.implement(new Events,new Options);Element.extend({makeResizable:function(A){return new Drag.Base(this,$merge({modifiers:{x:"width",y:"height"}},A))}});Drag.Move=Drag.Base.extend({options:{droppables:[],container:false,overflown:[]},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.droppables=$$(this.options.droppables);this.container=$(this.options.container);this.position={element:this.element.getStyle("position"),container:false};if(this.container){this.position.container=this.container.getStyle("position")}if(!["relative","absolute","fixed"].contains(this.position.element)){this.position.element="absolute"}var D=this.element.getStyle("top").toInt();var C=this.element.getStyle("left").toInt();if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){D=$chk(D)?D:this.element.getTop(this.options.overflown);C=$chk(C)?C:this.element.getLeft(this.options.overflown)}else{D=$chk(D)?D:0;C=$chk(C)?C:0}this.element.setStyles({top:D,left:C,position:this.position.element});this.parent(this.element)},start:function(C){this.overed=null;if(this.container){var A=this.container.getCoordinates();var B=this.element.getCoordinates();if(this.position.element=="absolute"&&!["relative","absolute","fixed"].contains(this.position.container)){this.options.limit={x:[A.left,A.right-B.width],y:[A.top,A.bottom-B.height]}}else{this.options.limit={y:[0,A.height-B.height],x:[0,A.width-B.width]}}}this.parent(C)},drag:function(A){this.parent(A);var B=this.out?false:this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=B){if(this.overed){this.overed.fireEvent("leave",[this.element,this])}this.overed=B?B.fireEvent("over",[this.element,this]):null}return this},checkAgainst:function(B){B=B.getCoordinates(this.options.overflown);var A=this.mouse.now;return(A.x>B.left&&A.x<B.right&&A.y<B.bottom&&A.y>B.top)},stop:function(){if(this.overed&&!this.out){this.overed.fireEvent("drop",[this.element,this])}else{this.element.fireEvent("emptydrop",this)}this.parent();return this}});Element.extend({makeDraggable:function(A){return new Drag.Move(this,A)}});var XHR=new Class({options:{method:"post",async:true,onRequest:Class.empty,onSuccess:Class.empty,onFailure:Class.empty,urlEncoded:true,encoding:"utf-8",autoCancel:false,headers:{}},setTransport:function(){this.transport=(window.XMLHttpRequest)?new XMLHttpRequest():(window.ie?new ActiveXObject("Microsoft.XMLHTTP"):false);return this},initialize:function(A){this.setTransport().setOptions(A);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers={};if(this.options.urlEncoded&&this.options.method=="post"){var B=(this.options.encoding)?"; charset="+this.options.encoding:"";this.setHeader("Content-type","application/x-www-form-urlencoded"+B)}if(this.options.initialize){this.options.initialize.call(this)}},onStateChange:function(){if(this.transport.readyState!=4||!this.running){return }this.running=false;var A=0;try{A=this.transport.status}catch(B){}if(this.options.isSuccess.call(this,A)){this.onSuccess()}else{this.onFailure()}this.transport.onreadystatechange=Class.empty},isSuccess:function(A){return((A>=200)&&(A<300))},onSuccess:function(){this.response={text:this.transport.responseText,xml:this.transport.responseXML};this.fireEvent("onSuccess",[this.response.text,this.response.xml]);this.callChain()},onFailure:function(){this.fireEvent("onFailure",this.transport)},setHeader:function(A,B){this.headers[A]=B;return this},send:function(A,C){if(this.options.autoCancel){this.cancel()}else{if(this.running){return this}}this.running=true;if(C&&this.options.method=="get"){A=A+(A.contains("?")?"&":"?")+C;C=null}this.transport.open(this.options.method.toUpperCase(),A,this.options.async);this.transport.onreadystatechange=this.onStateChange.bind(this);if((this.options.method=="post")&&this.transport.overrideMimeType){this.setHeader("Connection","close")}$extend(this.headers,this.options.headers);for(var B in this.headers){try{this.transport.setRequestHeader(B,this.headers[B])}catch(D){}}this.fireEvent("onRequest");this.transport.send($pick(C,null));return this},cancel:function(){if(!this.running){return this}this.running=false;this.transport.abort();this.transport.onreadystatechange=Class.empty;this.setTransport();this.fireEvent("onCancel");return this}});XHR.implement(new Chain,new Events,new Options);var Ajax=XHR.extend({options:{data:null,update:null,onComplete:Class.empty,evalScripts:false,evalResponse:false},initialize:function(B,A){this.addEvent("onSuccess",this.onComplete);this.setOptions(A);this.options.data=this.options.data||this.options.postBody;if(!["post","get"].contains(this.options.method)){this._method="_method="+this.options.method;this.options.method="post"}this.parent();this.setHeader("X-Requested-With","XMLHttpRequest");this.setHeader("Accept","text/javascript, text/html, application/xml, text/xml, */*");this.url=B},onComplete:function(){if(this.options.update){$(this.options.update).empty().setHTML(this.response.text)}if(this.options.evalScripts||this.options.evalResponse){this.evalScripts()}this.fireEvent("onComplete",[this.response.text,this.response.xml],20)},request:function(A){A=A||this.options.data;switch($type(A)){case"element":A=$(A).toQueryString();break;case"object":A=Object.toQueryString(A)}if(this._method){A=(A)?[this._method,A].join("&"):this._method}return this.send(this.url,A)},evalScripts:function(){var B,A;if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){A=this.response.text}else{A=[];var C=/<script[^>]*>([\s\S]*?)<\/script>/gi;while((B=C.exec(this.response.text))){A.push(B[1])}A=A.join("\n")}if(A){(window.execScript)?window.execScript(A):window.setTimeout(A,0)}},getHeader:function(A){try{return this.transport.getResponseHeader(A)}catch(B){}return null}});Object.toQueryString=function(B){var C=[];for(var A in B){C.push(encodeURIComponent(A)+"="+encodeURIComponent(B[A]))}return C.join("&")};Element.extend({send:function(A){return new Ajax(this.getProperty("action"),$merge({data:this.toQueryString()},A,{method:"post"})).request()}});var Cookie=new Abstract({options:{domain:false,path:false,duration:false,secure:false},set:function(C,D,B){B=$merge(this.options,B);D=encodeURIComponent(D);if(B.domain){D+="; domain="+B.domain}if(B.path){D+="; path="+B.path}if(B.duration){var A=new Date();A.setTime(A.getTime()+B.duration*24*60*60*1000);D+="; expires="+A.toGMTString()}if(B.secure){D+="; secure"}document.cookie=C+"="+D;return $extend(B,{key:C,value:D})},get:function(A){var B=document.cookie.match("(?:^|;)\\s*"+A.escapeRegExp()+"=([^;]*)");return B?decodeURIComponent(B[1]):false},remove:function(B,A){if($type(B)=="object"){this.set(B.key,"",$merge(B,{duration:-1}))}else{this.set(B,"",$merge(A,{duration:-1}))}}});var Json={specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\","&":"%26"},toString:function(B){switch($type(B)){case false:return"null";case"number":return isFinite(B)?String(B):"null";case"boolean":return String(B);case"string":return'"'+B.replace(/([\x00-\x1f\\"+])/g,function(F,E){var G=Json.specialChars[E];if(G){return G}G=E.charCodeAt();return"\\u00"+Math.floor(G/16).toString(16)+(G%16).toString(16)})+'"';case"arguments":case"array":return"["+$A(B).map(Json.toString).remove(false).join(",")+"]";case"object":var A=[];for(var D in B){var C=Json.toString(B[D]);if(C){A.push(Json.toString(D)+":"+C)}}return"{"+A.join(",")+"}"}return false},evaluate:function(str,secure){return(($type(str)!="string")||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?false:eval("("+str+")")}};Json.Remote=XHR.extend({initialize:function(B,A){this.url=B;this.addEvent("onSuccess",this.onComplete);this.parent(A);this.setHeader("X-Request","JSON")},send:function(A){return this.parent(this.url,"json="+Json.toString(A))},onComplete:function(){this.fireEvent("onComplete",[Json.evaluate(this.response.text,this.options.secure)])}});var Asset=new Abstract({javascript:function(C,B){B=$merge({onload:Class.empty},B);var A=new Element("script",{src:C}).addEvents({load:B.onload,readystatechange:function(){if(this.readyState=="complete"){this.fireEvent("load")}}});delete B.onload;return A.setProperties(B).inject(document.head)},css:function(B,A){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:B},A)).inject(document.head)},image:function(C,B){B=$merge({onload:Class.empty,onabort:Class.empty,onerror:Class.empty},B);var D=new Image();D.src=C;var A=new Element("img",{src:C});["load","abort","error"].each(function(E){var F=B["on"+E];delete B["on"+E];A.addEvent(E,function(){this.removeEvent(E,arguments.callee);F.call(this)})});if(D.width&&D.height){A.fireEvent("load",A,1)}return A.setProperties(B)},images:function(D,C){C=$merge({onComplete:Class.empty,onProgress:Class.empty},C);if(!D.push){D=[D]}var A=[];var B=0;D.each(function(F){var E=new Asset.image(F,{onload:function(){C.onProgress.call(this,B);B++;if(B==D.length){C.onComplete()}}});A.push(E)});return new Elements(A)}});var Hash=new Class({length:0,initialize:function(A){this.obj=A||{};this.setLength()},get:function(A){return(this.hasKey(A))?this.obj[A]:null},hasKey:function(A){return(A in this.obj)},set:function(A,B){if(!this.hasKey(A)){this.length++}this.obj[A]=B;return this},setLength:function(){this.length=0;for(var A in this.obj){this.length++}return this},remove:function(A){if(this.hasKey(A)){delete this.obj[A];this.length--}return this},each:function(A,B){$each(this.obj,A,B)},extend:function(A){$extend(this.obj,A);return this.setLength()},merge:function(){this.obj=$merge.apply(null,[this.obj].extend(arguments));return this.setLength()},empty:function(){this.obj={};this.length=0;return this},keys:function(){var A=[];for(var B in this.obj){A.push(B)}return A},values:function(){var A=[];for(var B in this.obj){A.push(this.obj[B])}return A}});function $H(A){return new Hash(A)}Hash.Cookie=Hash.extend({initialize:function(B,A){this.name=B;this.options=$extend({autoSave:true},A||{});this.load()},save:function(){if(this.length==0){Cookie.remove(this.name,this.options);return true}var A=Json.toString(this.obj);if(A.length>4096){return false}Cookie.set(this.name,A,this.options);return true},load:function(){this.obj=Json.evaluate(Cookie.get(this.name),true)||{};this.setLength()}});Hash.Cookie.Methods={};["extend","set","merge","empty","remove"].each(function(A){Hash.Cookie.Methods[A]=function(){Hash.prototype[A].apply(this,arguments);if(this.options.autoSave){this.save()}return this}});Hash.Cookie.implement(Hash.Cookie.Methods);var Color=new Class({initialize:function(B,D){D=D||(B.push?"rgb":"hex");var C,A;switch(D){case"rgb":C=B;A=C.rgbToHsb();break;case"hsb":C=B.hsbToRgb();A=B;break;default:C=B.hexToRgb(true);A=C.rgbToHsb()}C.hsb=A;C.hex=C.rgbToHex();return $extend(C,Color.prototype)},mix:function(){var A=$A(arguments);var C=($type(A[A.length-1])=="number")?A.pop():50;var B=this.copy();A.each(function(D){D=new Color(D);for(var E=0;E<3;E++){B[E]=Math.round((B[E]/100*(100-C))+(D[E]/100*C))}});return new Color(B,"rgb")},invert:function(){return new Color(this.map(function(A){return 255-A}))},setHue:function(A){return new Color([A,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(A){return new Color([this.hsb[0],A,this.hsb[2]],"hsb")},setBrightness:function(A){return new Color([this.hsb[0],this.hsb[1],A],"hsb")}});function $RGB(C,B,A){return new Color([C,B,A],"rgb")}function $HSB(C,B,A){return new Color([C,B,A],"hsb")}Array.extend({rgbToHsb:function(){var B=this[0],C=this[1],J=this[2];var G,F,H;var I=Math.max(B,C,J),E=Math.min(B,C,J);var K=I-E;H=I/255;F=(I!=0)?K/I:0;if(F==0){G=0}else{var D=(I-B)/K;var A=(I-C)/K;var L=(I-J)/K;if(B==I){G=L-A}else{if(C==I){G=2+D-L}else{G=4+A-D}}G/=6;if(G<0){G++}}return[Math.round(G*360),Math.round(F*100),Math.round(H*100)]},hsbToRgb:function(){var C=Math.round(this[2]/100*255);if(this[1]==0){return[C,C,C]}else{var A=this[0]%360;var E=A%60;var F=Math.round((this[2]*(100-this[1]))/10000*255);var D=Math.round((this[2]*(6000-this[1]*E))/600000*255);var B=Math.round((this[2]*(6000-this[1]*(60-E)))/600000*255);switch(Math.floor(A/60)){case 0:return[C,B,F];case 1:return[D,C,F];case 2:return[F,C,B];case 3:return[F,D,C];case 4:return[B,F,C];case 5:return[C,F,D]}}return false}});var Scroller=new Class({options:{area:20,velocity:1,onChange:function(A,B){this.element.scrollTo(A,B)}},initialize:function(B,A){this.setOptions(A);this.element=$(B);this.mousemover=([window,document].contains(B))?$(document.body):this.element},start:function(){this.coord=this.getCoords.bindWithEvent(this);this.mousemover.addListener("mousemove",this.coord)},stop:function(){this.mousemover.removeListener("mousemove",this.coord);this.timer=$clear(this.timer)},getCoords:function(A){this.page=(this.element==window)?A.client:A.page;if(!this.timer){this.timer=this.scroll.periodical(50,this)}},scroll:function(){var A=this.element.getSize();var D=this.element.getPosition();var C={x:0,y:0};for(var B in this.page){if(this.page[B]<(this.options.area+D[B])&&A.scroll[B]!=0){C[B]=(this.page[B]-this.options.area-D[B])*this.options.velocity}else{if(this.page[B]+this.options.area>(A.size[B]+D[B])&&A.scroll[B]+A.size[B]!=A.scrollSize[B]){C[B]=(this.page[B]-A.size[B]+this.options.area-D[B])*this.options.velocity}}}if(C.y||C.x){this.fireEvent("onChange",[A.scroll.x+C.x,A.scroll.y+C.y])}}});Scroller.implement(new Events,new Options);var Slider=new Class({options:{onChange:Class.empty,onComplete:Class.empty,onTick:function(A){this.knob.setStyle(this.p,A)},mode:"horizontal",steps:100,offset:0},initialize:function(D,A,B){this.element=$(D);this.knob=$(A);this.setOptions(B);this.previousChange=-1;this.previousEnd=-1;this.step=-1;this.element.addEvent("mousedown",this.clickedElement.bindWithEvent(this));var C,F;switch(this.options.mode){case"horizontal":this.z="x";this.p="left";C={x:"left",y:false};F="offsetWidth";break;case"vertical":this.z="y";this.p="top";C={x:false,y:"top"};F="offsetHeight"}this.max=this.element[F]-this.knob[F]+(this.options.offset*2);this.half=this.knob[F]/2;this.getPos=this.element["get"+this.p.capitalize()].bind(this.element);this.knob.setStyle("position","relative").setStyle(this.p,-this.options.offset);var E={};E[this.z]=[-this.options.offset,this.max-this.options.offset];this.drag=new Drag.Base(this.knob,{limit:E,modifiers:C,snap:0,onStart:function(){this.draggedKnob()}.bind(this),onDrag:function(){this.draggedKnob()}.bind(this),onComplete:function(){this.draggedKnob();this.end()}.bind(this)});if(this.options.initialize){this.options.initialize.call(this)}},set:function(A){this.step=A.limit(0,this.options.steps);this.checkStep();this.end();this.fireEvent("onTick",this.toPosition(this.step));return this},clickedElement:function(B){var A=B.page[this.z]-this.getPos()-this.half;A=A.limit(-this.options.offset,this.max-this.options.offset);this.step=this.toStep(A);this.checkStep();this.end();this.fireEvent("onTick",A)},draggedKnob:function(){this.step=this.toStep(this.drag.value.now[this.z]);this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("onChange",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("onComplete",this.step+"")}},toStep:function(A){return Math.round((A+this.options.offset)/this.max*this.options.steps)},toPosition:function(A){return this.max*A/this.options.steps}});Slider.implement(new Events);Slider.implement(new Options);var SmoothScroll=Fx.Scroll.extend({initialize:function(B){this.parent(window,B);this.links=(this.options.links)?$$(this.options.links):$$(document.links);var A=window.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(D){if(D.href.indexOf(A)!=0){return }var C=D.href.substr(A.length);if(C&&$(C)){this.useLink(D,C)}},this);if(!window.webkit419){this.addEvent("onComplete",function(){window.location.hash=this.anchor})}},useLink:function(B,A){B.addEvent("click",function(C){this.anchor=A;this.toElement(A);C.stop()}.bindWithEvent(this))}});var Sortables=new Class({options:{handles:false,onStart:Class.empty,onComplete:Class.empty,ghost:true,snap:3,onDragStart:function(A,B){B.setStyle("opacity",0.7);A.setStyle("opacity",0.7)},onDragComplete:function(A,B){A.setStyle("opacity",1);B.remove();this.trash.remove()}},initialize:function(D,B){this.setOptions(B);this.list=$(D);this.elements=this.list.getChildren();this.handles=(this.options.handles)?$$(this.options.handles):this.elements;this.bound={start:[],moveGhost:this.moveGhost.bindWithEvent(this)};for(var C=0,A=this.handles.length;C<A;C++){this.bound.start[C]=this.start.bindWithEvent(this,this.elements[C])}this.attach();if(this.options.initialize){this.options.initialize.call(this)}this.bound.move=this.move.bindWithEvent(this);this.bound.end=this.end.bind(this)},attach:function(){this.handles.each(function(B,A){B.addEvent("mousedown",this.bound.start[A])},this)},detach:function(){this.handles.each(function(B,A){B.removeEvent("mousedown",this.bound.start[A])},this)},start:function(C,B){this.active=B;this.coordinates=this.list.getCoordinates();if(this.options.ghost){var A=B.getPosition();this.offset=C.page.y-A.y;this.trash=new Element("div").inject(document.body);this.ghost=B.clone().inject(this.trash).setStyles({position:"absolute",left:A.x,top:C.page.y-this.offset});document.addListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragStart",[B,this.ghost])}document.addListener("mousemove",this.bound.move);document.addListener("mouseup",this.bound.end);this.fireEvent("onStart",B);C.stop()},moveGhost:function(A){var B=A.page.y-this.offset;B=B.limit(this.coordinates.top,this.coordinates.bottom-this.ghost.offsetHeight);this.ghost.setStyle("top",B);A.stop()},move:function(E){var B=E.page.y;this.previous=this.previous||B;var A=((this.previous-B)>0);var D=this.active.getPrevious();var C=this.active.getNext();if(D&&A&&B<D.getCoordinates().bottom){this.active.injectBefore(D)}if(C&&!A&&B>C.getCoordinates().top){this.active.injectAfter(C)}this.previous=B},serialize:function(A){return this.list.getChildren().map(A||function(B){return this.elements.indexOf(B)},this)},end:function(){this.previous=null;document.removeListener("mousemove",this.bound.move);document.removeListener("mouseup",this.bound.end);if(this.options.ghost){document.removeListener("mousemove",this.bound.moveGhost);this.fireEvent("onDragComplete",[this.active,this.ghost])}this.fireEvent("onComplete",this.active)}});Sortables.implement(new Events,new Options);var Tips=new Class({options:{onShow:function(A){A.setStyle("visibility","visible")},onHide:function(A){A.setStyle("visibility","hidden")},maxTitleChars:30,showDelay:100,hideDelay:100,className:"tool",offsets:{x:16,y:16},fixed:false},initialize:function(B,A){this.setOptions(A);this.toolTip=new Element("div",{"class":this.options.className+"-tip",styles:{position:"absolute",top:"0",left:"0",visibility:"hidden"}}).inject(document.body);this.wrapper=new Element("div").inject(this.toolTip);$$(B).each(this.build,this);if(this.options.initialize){this.options.initialize.call(this)}},build:function(B){B.$tmp.myTitle=(B.href&&B.getTag()=="a")?B.href.replace("http://",""):(B.rel||false);if(B.title){var C=B.title.split("::");if(C.length>1){B.$tmp.myTitle=C[0].trim();B.$tmp.myText=C[1].trim()}else{B.$tmp.myText=B.title}B.removeAttribute("title")}else{B.$tmp.myText=false}if(B.$tmp.myTitle&&B.$tmp.myTitle.length>this.options.maxTitleChars){B.$tmp.myTitle=B.$tmp.myTitle.substr(0,this.options.maxTitleChars-1)+"&hellip;"}B.addEvent("mouseenter",function(D){this.start(B);if(!this.options.fixed){this.locate(D)}else{this.position(B)}}.bind(this));if(!this.options.fixed){B.addEvent("mousemove",this.locate.bindWithEvent(this))}var A=this.end.bind(this);B.addEvent("mouseleave",A);B.addEvent("trash",A)},start:function(A){this.wrapper.empty();if(A.$tmp.myTitle){this.title=new Element("span").inject(new Element("div",{"class":this.options.className+"-title"}).inject(this.wrapper)).setHTML(A.$tmp.myTitle)}if(A.$tmp.myText){this.text=new Element("span").inject(new Element("div",{"class":this.options.className+"-text"}).inject(this.wrapper)).setHTML(A.$tmp.myText)}$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this)},end:function(A){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this)},position:function(A){var B=A.getPosition();this.toolTip.setStyles({left:B.x+this.options.offsets.x,top:B.y+this.options.offsets.y})},locate:function(B){var D={x:window.getWidth(),y:window.getHeight()};var A={x:window.getScrollLeft(),y:window.getScrollTop()};var C={x:this.toolTip.offsetWidth,y:this.toolTip.offsetHeight};var G={x:"left",y:"top"};for(var E in G){var F=B.page[E]+this.options.offsets[E];if((F+C[E]-A[E])>D[E]){F=B.page[E]-this.options.offsets[E]-C[E]}this.toolTip.setStyle(G[E],F)}},show:function(){if(this.options.timeout){this.timer=this.hide.delay(this.options.timeout,this)}this.fireEvent("onShow",[this.toolTip])},hide:function(){this.fireEvent("onHide",[this.toolTip])}});Tips.implement(new Events,new Options);var Group=new Class({initialize:function(){this.instances=$A(arguments);this.events={};this.checker={}},addEvent:function(B,A){this.checker[B]=this.checker[B]||{};this.events[B]=this.events[B]||[];if(this.events[B].contains(A)){return false}else{this.events[B].push(A)}this.instances.each(function(C,D){C.addEvent(B,this.check.bind(this,[B,C,D]))},this);return this},check:function(C,A,B){this.checker[C][B]=true;var D=this.instances.every(function(F,E){return this.checker[C][E]||false},this);if(!D){return }this.checker[C]={};this.events[C].each(function(E){E.call(this,this.instances,A)},this)}});var Accordion=Fx.Elements.extend({options:{onActive:Class.empty,onBackground:Class.empty,display:0,show:false,height:true,width:false,opacity:true,fixedHeight:false,fixedWidth:false,wait:false,alwaysHide:false},initialize:function(){var C,E,F,B;$each(arguments,function(I,H){switch($type(I)){case"object":C=I;break;case"element":B=$(I);break;default:var G=$$(I);if(!E){E=G}else{F=G}}});this.togglers=E||[];this.elements=F||[];this.container=$(B);this.setOptions(C);this.previous=-1;if(this.options.alwaysHide){this.options.wait=true}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"}for(var D=0,A=this.togglers.length;D<A;D++){this.addSection(this.togglers[D],this.elements[D])}this.elements.each(function(H,G){if(this.options.show===G){this.fireEvent("onActive",[this.togglers[G],H])}else{for(var I in this.effects){H.setStyle(I,0)}}},this);this.parent(this.elements);if($chk(this.options.display)){this.display(this.options.display)}},addSection:function(E,C,G){E=$(E);C=$(C);var F=this.togglers.contains(E);var B=this.togglers.length;this.togglers.include(E);this.elements.include(C);if(B&&(!F||G)){G=$pick(G,B-1);E.injectBefore(this.togglers[G]);C.injectAfter(E)}else{if(this.container&&!F){E.inject(this.container);C.inject(this.container)}}var A=this.togglers.indexOf(E);E.addEvent("click",this.display.bind(this,A));if(this.options.height){C.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})}if(this.options.width){C.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})}C.fullOpacity=1;if(this.options.fixedWidth){C.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){C.fullHeight=this.options.fixedHeight}C.setStyle("overflow","hidden");if(!F){for(var D in this.effects){C.setStyle(D,0)}}return this},display:function(A){A=($type(A)=="element")?this.elements.indexOf(A):A;if((this.timer&&this.options.wait)||(A===this.previous&&!this.options.alwaysHide)){return this}this.previous=A;var B={};this.elements.each(function(E,D){B[D]={};var C=(D!=A)||(this.options.alwaysHide&&(E.offsetHeight>0));this.fireEvent(C?"onBackground":"onActive",[this.togglers[D],E]);for(var F in this.effects){B[D][F]=C?0:E[this.effects[F]]}},this);return this.start(B)},showThisHideOpen:function(A){return this.display(A)}});Fx.Accordion=Accordion;Element.extend({disableSelection:function(){if(window.ie){this.onselectstart=function(){return false}}else{if(window.gecko){this.setStyle("-moz-user-select","none")}else{this.onmousedown=function(){return false}}}},enableSelection:function(){if(window.ie){this.onselectstart=function(){return true}}else{if(window.gecko){this.setStyle("-moz-user-select","")}else{this.onmousedown=function(){return true}}}}});if(!window.console){window.console={log:function(){},warn:function(){},debug:function(){},info:function(){},error:function(){},assert:function(){},dir:function(){},dirxml:function(){},trace:function(){},group:function(){},groupEnd:function(){},time:function(){},timeEnd:function(){},profile:function(){},profileEnd:function(){},count:function(){}}}document.blur=function(){var A=document.createElement("input");A.style.position="absolute";A.style.left=window.getSize().scroll.x+"px";A.style.top=window.getSize().scroll.y+"px";A.style.width="1px";A.style.height="1px";document.body.appendChild(A);A.focus();A.parentNode.removeChild(A);A=null};String.prototype.repeat=function(A){return new Array(A+1).join(this)};isMac=(navigator.appVersion.indexOf("Mac")!=-1)?true:false;isDOM=(document.getElementById)?true:false;isOpera=isOpera5=window.opera&&isDOM;isOpera6=isOpera&&window.print;isOpera7=isOpera&&navigator.userAgent.indexOf("Opera 7")>0||navigator.userAgent.indexOf("Opera/7")>=0;isMSIE=isIE=document.all&&document.all.item&&!isOpera;isMSIE4=((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1))?true:false;isMSIEmac=((document.all)&&(isMac))?true:false;isNC=navigator.appName=="Netscape";isNC4=isNC&&!isDOM;isNC6=isNC&&isDOM;var gSafeOnload=new Array();var gSafeOnloadDelay=new Array();function SafeAddOnload(A){SafeAddOnloadDelayed(A,0)}function SafeAddOnloadDelayed(A,B){if(isMSIEmac&&isMSIE4){window.onload=SafeOnload;gSafeOnload[gSafeOnload.length]=A;gSafeOnloadDelay[gSafeOnloadDelay.length]=B}else{if(window.onload){if(window.onload!=SafeOnload){gSafeOnload[0]=window.onload;gSafeOnloadDelay[0]=0;window.onload=SafeOnload}gSafeOnload[gSafeOnload.length]=A;gSafeOnloadDelay[gSafeOnloadDelay.length]=B}else{window.onload=A}}}function SafeOnload(){var A=gSafeOnload.length;for(xyzii=0;xyzii<A;xyzii++){if(typeof (gSafeOnload[xyzii])!="function"){gSafeOnload[xyzii]=new Function(gSafeOnload[xyzii])}if(gSafeOnloadDelay[xyzii]>0){setTimeout(gSafeOnload[xyzii],gSafeOnloadDelay[xyzii])}else{gSafeOnload[xyzii]()}}}function SetLayerOpacity(A,B){if(!isDOM){return false}if(isMSIE){document.getElementById(A).style.filter="alpha(opacity="+B+")"}if(isNC6){document.getElementById(A).style.MozOpacity=B/100}}function SetCookie(C,D,E){if(E){var B=new Date();B.setTime(B.getTime()+(E*24*60*60*1000));var A="; expires="+B.toGMTString()}else{var A=""}document.cookie=C+"="+D+A+"; path=/"}function GetCookie(B){var D=B+"=";var A=document.cookie.split(";");for(var C=0;C<A.length;C++){var E=A[C];while(E.charAt(0)==" "){E=E.substring(1,E.length)}if(E.indexOf(D)==0){return E.substring(D.length,E.length)}}return null}function DeleteCookie(A){SetCookie(A,"",-1)}function PopupWindow(B,H,A,E,C,D,F,I){if("center"==A){A=Math.round((screen.width-B)/2)}else{if("left"==A){A=0}else{if("right"==A){A=screen.width-B}}}if("center"==E){E=Math.round((screen.height-H)/2)}else{if("top"==E){E=0}else{if("bottom"==E){E=screen.height-H}}}var G="hotkeys=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,titlebar=no,toolbar=no";if(I){splitaddons=I.split(",");for(i=0;i<splitaddons.length;i++){regexp=new RegExp(splitaddons[i]+"=no","i");G=G.replace(regexp,splitaddons[i]+"=yes")}}windowhandle=window.open(C,D,"height="+H+",width="+B+",screenX="+A+",screenY="+E+",left="+A+",top="+E+G);if(true==F){windowhandle.focus()}return windowhandle}function PopupWindowResize(B,C,A,D){if("center"==A){A=Math.round((screen.width-B)/2)}else{if("left"==A){A=0}else{if("right"==A){A=screen.width-B}}}if("center"==D){D=Math.round((screen.height-C)/2)}else{if("top"==D){D=0}else{if("bottom"==D){D=screen.height-C}}}window.resizeTo(B,C);if(A>0&&D>0){window.moveTo(A,D)}}var gLoadedScripts=new Array();function LoadScript(A){if(true==in_array(A,gLoadedScripts)){return }gLoadedScripts.push(A);script=document.createElement("script");script.type="text/javascript";script.src=A;document.getElementsByTagName("head")[0].appendChild(script);return script}function in_array(B,C){for(var A in C){if(B==C[A]){return true}}return false}function print_r(D,A){var C=new String;for(var B in D){C+=B+" = "+D[B]+"\n"}if(true===A){return C}else{alert(C)}}function AddEvent(C,B,A){if(!document.all&&document.getElementById){C.setAttribute(B,A)}if(document.all&&document.getElementById){C[B.toLowerCase()]=new Function(A)}}function GetWindowWidth(){return parseInt((document.body&&!isOpera&&document.body.clientWidth)?document.body.clientWidth:(window.innerWidth||0))}function GetWindowHeight(){return parseInt((document.body&&!isOpera&&document.body.clientHeight)?document.body.clientHeight:(window.innerHeight||0))}function CenterLayerOnPage(C,A,B){if(document.documentElement.clientWidth<A){leftPom=Math.round((document.documentElement.scrollWidth-A)/2)}else{leftPom=Math.round((document.documentElement.clientWidth-A)/2)+document.documentElement.scrollLeft}if(document.documentElement.clientHeight<B){topPom=Math.round((document.documentElement.scrollHeight-B)/2)}else{topPom=Math.round((document.documentElement.clientHeight-B)/2)+document.documentElement.scrollTop}$(C).style.top=topPom+"px";$(C).style.left=leftPom+"px"}function ImgAlpha(E,A,C,B){if(isIE){if(B){scale="none"}else{scale="scale"}var D=new Element("div");D.style.width=A+"px";D.style.height=C+"px";D.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+E+"',sizingMethod='"+scale+"')"}else{var D=new Element("img");D.width=A;D.height=C;D.src=E}return D}var MouseX=0;var MouseY=0;function MousePositionXYHandler(A){if(isNC6){MouseX=A.pageX;MouseY=A.pageY}else{if(isMSIE4){MouseX=document.body.scrollLeft+window.event.x;MouseY=document.body.scrollTop+window.event.y}else{if(isMSIE&&event&&document.documentElement&&document.body){MouseX=event.clientX+document.documentElement.scrollLeft+document.body.scrollLeft;MouseY=event.clientY+document.documentElement.scrollTop+document.body.scrollTop}else{MouseX=event.pageX?event.pageX-window.pageXOffset:event.clientX;MouseY=event.pageY?event.pageY-window.pageYOffset:event.clientY}}}}document.onmousemove=MousePositionXYHandler;var WindowPosition={GetX:function(){if(isMSIE){return window.screenLeft}return window.screenX},GetY:function(){if(isMSIE){return window.screenTop}return window.screenY}};copyObject=function(B){var A=$type(B)=="array"?[]:{};for(i in B){if(B[i]&&$type(B[i])=="object"){A[i]=copyObject(B[i])}else{A[i]=B[i]}}return A};DeForm={};DeForm.Version="stable/2.9.2";var gDeFormScriptStack=[];var gDeFormScriptStackTimeoutID;DeForm.LoadScript=function(A,B){gDeFormScriptStack.push({src:A,callback:B});clearTimeout(gDeFormScriptStackTimeoutID);gDeFormScriptStackTimeoutID=setTimeout("DeForm.LoadScriptGetFromStack()",350);return true};DeForm.LoadScriptHelper=function(A,B){scriptElement=document.createElement("script");scriptElement.type="text/javascript";scriptElement.src=A;if(window.ie){scriptElement.attachEvent("onreadystatechange",function(C){if(scriptElement.readyState=="loaded"||scriptElement.readyState=="complete"){DeForm.LoadScriptCallBack(B);DeForm.LoadScriptGetFromStack()}})}else{if(!window.opera){scriptElement.addEventListener("load",function(C){DeForm.LoadScriptCallBack(B);DeForm.LoadScriptGetFromStack()},false)}}if(window.opera){document.getElementsByTagName("head")[0].appendChild(scriptElement);DeForm.LoadScriptCallBack(B);DeForm.LoadScriptGetFromStack()}else{document.getElementsByTagName("head")[0].appendChild(scriptElement)}return true};DeForm.LoadScriptGetFromStack=function(){if(gDeFormScriptStack.length==0){return true}obj=gDeFormScriptStack.shift();DeForm.LoadScriptHelper(obj.src,obj.callback);return true};DeForm.LoadScriptCallBack=function(A){if(typeof (A)=="function"){A()}return true};var gDeFormLoadedCSS=new Array();DeForm.LoadCSS=function(B,A){if(true==DeForm.in_array(B,gDeFormLoadedCSS)&&true!=A){return }gDeFormLoadedCSS.push(B);css=document.createElement("link");css.rel="stylesheet";css.href=B;document.getElementsByTagName("head")[0].appendChild(css);return css};DeForm.in_array=function(B,C){for(var A in C){if(B==C[A]){return true}}return false};DeForm.ImgAlpha=function(D,A,B){if(window.ie){var C=document.createElement("span");C.style.display="block";C.style.width=A+"px";C.style.height=B+"px";C.style.border="0";C.runtimeStyle.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+D+"',sizingMethod='scale')";C.style.cursor="pointer"}else{var C=document.createElement("img");C.width=A;C.height=B;C.style.border="0";C.src=D;C.style.cursor="pointer"}return C};DeForm.GenericElement=new Class({initialize:function(A,D,C,B){this.mName=A;this.mEl=$(D);this.mBaseClass=C;this.mMoveEl=$pick(this.mMoveEl,this.mEl.getParent());this.mResizeEl=$pick(this.mResizeEl,this.mEl);this.mReadOnly=false;this.mInvalid=false;this.mResizeFXDuration=350;this.mMoveFXDuration=350;this.mValidators={};this.mDefaultToolTipText="";this.mIsVisible=true;this.mFormRef=null;this.mResizeFX=$pick(this.mResizeFX,this.mResizeEl.effects({duration:this.mResizeFXDuration}));this.mMoveFX=$pick(this.mMoveFX,this.mMoveEl.effects({duration:this.mMoveFXDuration}));this.mToolTip=$pick(this.mToolTip,new DeForm.ToolTip($pick($(B),this.mEl)))},setValue:function(A){A=$pick(A,"");this.mEl.value=A},getValue:function(){return this.mEl.value},getName:function(){return this.mName},getType:function(){return this.mType},handleAjaxRequest:function(A){this.setInvalid(!A.valid,A.error_displayed);this.setValue(A.value);this.setReadOnly(A.readonly)},setInvalid:function(B,A){this.mInvalid=B;this.mToolTip.unregisterElementEvents();if(B){this.mToolTip.setText(A);this.mToolTip.setType("error");this.mToolTip.registerElementEvents()}else{if(this.mDefaultToolTipText){this.mToolTip.registerElementEvents();this.mToolTip.setType("standard");this.mToolTip.setText(this.mDefaultToolTipText)}}this.changeClass()},isInvalid:function(){return this.mInvalid},setReadOnly:function(A){if(!$defined(A)){return }if(A){this.mInitialValue="";this.mEl.addEvent("mouseover",this.setInitialValueIfNotEmpty.bind(this));this.mEl.addEvent("focus",this.setInitialValueIfNotEmpty.bind(this));this.mEl.addEvent("change",this.setElementsInitialValue.bind(this));this.mEl.addEvent("blur",this.setElementsInitialValue.bind(this))}else{this.mEl.removeEvents("mouseover");this.mEl.removeEvents("focus");this.mEl.removeEvents("change");this.mEl.removeEvents("blur")}this.mReadOnly=A;this.changeClass()},isReadOnly:function(){return this.mReadOnly},changeClass:function(){class_names=[this.mBaseClass];if(true==this.mInvalid){class_names.push("error")}if(true==this.mReadOnly){class_names.push("disabled")}this.mEl.setProperty("class",class_names.join("_"))},setElementsInitialValue:function(){this.setValue(this.mInitialValue)},setInitialValueIfNotEmpty:function(){if(!this.mEl.mInitialValue){this.mInitialValue=this.getValue()}},setDefaultToolTipText:function(A){this.mDefaultToolTipText=A;this.setInvalid(this.isInvalid())},focus:function(){this.mEl.focus()},getPosition:function(){return{x:this.mMoveEl.getStyle("left").toInt(),y:this.mMoveEl.getStyle("top").toInt()}},getDimensions:function(){return{width:this.mResizeEl.getStyle("width").toInt(),height:this.mResizeEl.getStyle("height").toInt()}},moveTo:function(C,B,E){var A={left:this.getPosition().x,top:this.getPosition().y};var D={};if(C!=A.left&&$type(C)=="number"){D.left=C}if(B!=A.top&&$type(B)=="number"){D.top=B}if(D.left>=0||D.top>=0){if(E){this.mMoveFX.start(D)}else{this.mMoveEl.setStyles(D)}}},moveBy:function(B,A,C){this.moveTo(this.getPosition().x+B,this.getPosition().y+A,C)},resizeTo:function(B,D,E){var A={width:this.getDimensions().width,height:this.getDimensions().height};var C={};if(B!=A.width&&$type(B)=="number"){C.width=B}if(D!=A.height&&$type(D)=="number"){C.height=D}if(C.width>=0||C.height>=0){if(E){this.mResizeFX.start(C)}else{this.mResizeEl.setStyles(C)}}},resizeBy:function(B,A,C){this.resizeTo(this.getDimensions().width+B,this.getDimensions().height+A,C)},hide:function(){this.mIsVisible=false;this.mEl.setStyle("display","none")},show:function(){this.mIsVisible=true;this.mEl.setStyle("display","block")},isVisible:function(){return this.mIsVisible},getDomElement:function(){return this.mEl},isChanged:function(){},resetChanged:function(){},clear:function(){this.setValue("")}});DeForm.GenericElement.implement(new Events);DeForm.Button=DeForm.GenericElement.extend({initialize:function(A,D,C,B){this.parent(A,D,C,B);this.mType="Button";this.mSubType=this.mEl.getProperty("type");this.mWaiting=false;this.mWaitBtnText=null;this.mMoveEl=this.mEl.getParent().getParent();this.mMoveFX=this.mMoveEl.effects({duration:this.mMoveFXDuration});this.mEl.addEvent("mousedown",function(){this.mEl.getParent().className=this.mBaseClass+"_submitted"}.bind(this));this.mEl.addEvent("mouseleave",function(){this.mEl.getParent().className=this.mBaseClass}.bind(this));this.mEl.addEvent("mouseup",function(){this.mEl.getParent().className=this.mBaseClass}.bind(this));this.mEl.addEvent("click",this.fireEvent.bind(this,"click"))},registerWait:function(B,A){$(B).addEvent(A,this.showWait.bind(this));this.mEl.stopWait=this.stopWait.bind(this)},setWaitBtnText:function(A){this.mWaitBtnText=A},showWait:function(){if(this.isReadOnly()){return false}this.setReadOnly(true);this.mPreviousCaption=this.getCaption();this.setCaption(this.mWaitBtnText);this.mEl.blur();this.mEl.getParent().className=this.mBaseClass+"_submitted";this.mWaiting=true;$(this.mEl.getProperty("id")+"LI").setStyle("visibility","visible");this.fireEvent("onShowWait")},stopWait:function(){this.setReadOnly(false);this.mEl.getParent().className=this.mBaseClass;this.setCaption(this.mPreviousCaption);$(this.mEl.getProperty("id")+"LI").setStyle("visibility","hidden");this.mWaiting=false;this.fireEvent("onStopWait")},isWaiting:function(){return this.mWaiting},setReadOnly:function(A){if(A){this.mEl.disable=true;this.mEl.disabled=true}else{this.mEl.disable=false;this.mEl.disabled=false}this.mReadOnly=A;this.changeClass()},setInvalid:function(){},setValue:function(){},setCaption:function(A){this.mEl.value=A},getCaption:function(A){return this.mEl.value},handleAjaxRequest:function(A){this.parent(A);this.setCaption(A.caption)},changeClass:function(){class_names=[this.mBaseClass];this.mEl.getParent().className=class_names.join("_")},hide:function(){this.mMoveEl.setStyle("display","none")},show:function(){this.mMoveEl.setStyle("display","block")},getSubType:function(){return this.mSubType}});DeForm.CheckBox=DeForm.GenericElement.extend({initialize:function(A,C,B){this.parent(A,C,B,this.mEl);this.mType="CheckBox";this.resetChanged();this.mEl.addEvent("mouseup",this.eClick.bindWithEvent(this));this.mEl.addEvent("keyup",this.eClick.bindWithEvent(this));this.mEl.addEvent("mouseover",this.fireEvent.bind(this,"mouseover"));this.mEl.addEvent("mouseout",this.fireEvent.bind(this,"mouseout"));this.mEl.addEvent("mousedown",this.fireEvent.bind(this,"mousedown"));this.mEl.addEvent("mouseup",this.fireEvent.bind(this,"mouseup"));this.mEl.addEvent("mouseenter",this.fireEvent.bind(this,"mouseenter"));this.mEl.addEvent("mouseleave",this.fireEvent.bind(this,"mouseleave"));if(this.mLabelEl=$E(".DF_checkbox_label",this.mEl.getParent().getParent())){this.mLabelEl.addEvent("click",this.eClick.bindWithEvent(this));this.mLabelEl.onselectstart=function(){return false};this.mLabelEl.addEvent("mousedown",function(D){D.preventDefault()}.bindWithEvent(this))}},eClick:function(A){if(A.type=="keyup"&&A.key!="space"){return }if(this.isReadOnly()){return }if(this.getValue()>0){this.setValue(0,A.target===this.mEl);this.fireEvent("onUnchecked")}else{this.setValue(1,A.target===this.mEl);this.fireEvent("onChecked")}this.fireEvent("onClick",A);this.fireEvent("click",A);this.mEl.fireEvent("click",A);this.changeClass()},setValue:function(B,A){if(B>0){B=1;if(true!==A){this.mEl.checked=true}}else{B=0;if(true!==A){this.mEl.checked=false}}this.parent(B);this.changeClass()},changeClass:function(){class_names=[this.mBaseClass];if(true==this.mInvalid){class_names.push("error")}if(true==this.mReadOnly){class_names.push("disabled")}if(this.getValue()>0){class_names.push("on")}else{class_names.push("off")}this.mEl.getParent().className=class_names.join("_")},setInvalid:function(B,A){this.parent(B,A);if(B){this.mToolTip.addEvent("click",this.mToolTip.hide.bindWithEvent(this.mToolTip))}},hide:function(){this.mEl.getParent().setStyle("display","none");if(this.mEl.getParent().getNext()){this.mEl.getParent().getNext().setStyle("display","none")}},show:function(){this.mEl.getParent().setStyle("display","block");if(this.mEl.getParent().getNext()){this.mEl.getParent().getNext().setStyle("display","block")}},isChanged:function(){if(this.mStartValue==this.getValue()){return false}return true},resetChanged:function(){if(this.getValue()>0){this.mStartValue=1}else{this.mStartValue=0}},clear:function(){this.setValue(0)}});DeForm.SelectListJS=DeForm.GenericElement.extend({mDisabled:false,mDisabledClass:"",mInvalid:false,mInvalidClass:"",mElementName:false,mObjectElementName:false,mStyles:false,mVisibleElement:false,mChooserInputEl:false,mSelectedOptions:[],mMultiMode:false,mFirstAlternate:false,mOptions:[],mOptionsKeys:[],mOptionsCount:0,initialize:function(B,F,A,D,E,C){this.parent(B,F+"SJS",A,C);this.mType="SelectListJS";if(false==A){A="DF_selectlistjs"}if(E){this.mFirstAlternate=true}this.mStyles=A;this.mElementName=B;this.mObjectElementName=F;this.mStyles=A;this.mVisibleElement=$(this.mObjectElementName+"SJS");this.mChooserInputEl=$(this.mObjectElementName);if(D){this.mMultiMode=true}},setReadOnly:function(A){if(this.mDisabled==A){return }this.mDisabled=A;if(true==this.mDisabled){this.mDisabledClass="_disabled"}else{this.mDisabledClass=""}this.mOptions.each(function(C){var B="";if(C.getProperty("class").match(/selected/)){B="_selected"}C.setProperty("class",this.mStyles+"_option"+B+this.mDisabledClass)}.bind(this))},setInvalid:function(A,B){if(this.mInvalid==A){return }this.mInvalid=A;if(true==this.mInvalid){this.mInvalidClass="_error"}else{this.mInvalidClass=""}this.mVisibleElement.setProperty("class",this.mStyles+this.mInvalidClass);this.parent(A,B)},addOptions:function(){for(var A=0;A<arguments.length;A++){var B=arguments[A];this.addOption(B[0],B[1],B[2])}},addOption:function(B,A,C){if($defined(this.mOptions[B])){return false}this.mOptions[this.mOptionsCount]=new Element("div",{styles:{overflow:"hidden"},events:{mousedown:function(){this.selectOption(B)}.bind(this)},id:"DFSelectListJSOption"+this.mOptionsCount+this.mObjectElementName,"class":this.mStyles+"_option"}).setHTML(A.replace(/\s/g,"&nbsp;")).injectInside(this.mVisibleElement);this.mOptions[this.mOptionsCount].html=A;this.mOptionsKeys[this.mOptionsCount]=B;this.mOptions[this.mOptionsCount].disableSelection();this.mChooserInputEl.adopt(new Element("option",{value:B,id:"DFSelectListOption"+this.mOptionsCount+this.mObjectElementName}).setText(A));if(C){this.selectOption(B,true)}this.mOptionsCount++;if(0==this.mSelectedOptions.length){this.selectOption(B,true)}this.fireEvent("onAddOption")},selectOption:function(B,A){if(true==this.mDisabled||0>this.mOptionsKeys.indexOf(B)){return }if(!this.mMultiMode){this.clear()}else{if(this.mSelectedOptions.contains(B)){this.unselectOption(B);return }}if(this.mFirstAlternate){if((this.mSelectedOptions.contains(this.mOptionsKeys[0])&&B!=this.mOptionsKeys[0])||(false==this.mSelectedOptions.contains(this.mOptionsKeys[0])&&B==this.mOptionsKeys[0])){this.clear()}}this.mSelectedOptions.include(B);this.setValue(this.mSelectedOptions);if(true!=A){this.fireEvent("onSelectOption")}this.mOptions[this.mOptionsKeys.indexOf(B)].addClass(this.mStyles+"_option_selected")},unselectOption:function(A){var B=this.mOptionsKeys.indexOf(A);var C=$("DFSelectListJSOption"+B+this.mObjectElementName);if(C){C.removeClass(this.mStyles+"_option_selected");C.addClass(this.mStyles+"_option");this.mSelectedOptions.remove(A);this.setValue(this.mSelectedOptions)}},setValue:function(A){if(false==this.mMultiMode&&"array"==$type(A)&&1<A.length){return false}if("array"!=$type(A)){A=[A]}this.clear();A.each(function(C){var B=this.mOptionsKeys.indexOf(C);$("DFSelectListOption"+B+this.mObjectElementName).setProperty("selected","true");this.mSelectedOptions.include(C);this.mOptions[B].setProperty("class",this.mStyles+"_option_selected")}.bind(this));this.fireEvent("onChange")},clear:function(){this.mSelectedOptions=[];$ES("option",this.mChooserInputEl).each(function(A){A.removeProperty("selected")});this.mOptions.each(function(A){A.setProperty("class",this.mStyles+"_option")}.bind(this))},getValue:function(){return this.mChooserInputEl.getValue()},getName:function(){return this.mElementName}});DeForm.ComboBox=DeForm.GenericElement.extend({initialize:function(A,D,C,B){this.mMoveEl=$(D);this.parent(A,D,C,B);this.mType="ComboBox";this.mIsPopupClosed=true;this.mPopupEl=$E(".DF_combobox_popup",this.mEl);this.mChooserEl=$E(".DF_combobox_chooser",this.mEl);this.mChooserInputEl=$E(".DF_combobox_chooser .DF_combobox_input input",this.mEl);this.mHiddenEl=$E("input.DF_hidden",this.mEl);this.mOptions={};this.mOptionsCount=0;this.mSelectedOption=null;this.mSelectedText=null;this.mAutoHeight=true;this.mInitialHeight=100;this.mMaxAutoHeightOptions=7;this.mPreviousValue=null;this.resetChanged();this.mChooserEl.onselectstart=function(){return false};this.mChooserEl.addEvent("mousedown",function(E){E.preventDefault()}.bindWithEvent(this));this.mMouseDownWindowEvent=this.eClick.bindWithEvent(this);window.document.addEvent("mousedown",this.mMouseDownWindowEvent);this.mChooserEl.addEvent("trash",this.eRemove.bind(this));this.mPopupEl.addEvent("mouseenter",function(E){this.changeSelectedOptionClass("");E.stop()}.bindWithEvent(this));this.mPopupEl.injectInside(document.body);this.addEvent("onPopupOpen",this.mToolTip.hide.bind(this.mToolTip))},addOption:function(B,A,C){if($defined(this.mOptions[B])){return false}this.mOptions[B]=new Element("div",{styles:{overflow:"hidden"},events:{mouseenter:function(){this.setProperty("class","Act")},mouseleave:function(){this.setProperty("class","")},mouseup:function(){this.selectOption(B);this.closePopup()}.bind(this)}}).setHTML("<span>"+A.replace(/\s/g,"&nbsp;")+"</span>").injectInside(this.mPopupEl);this.mOptions[B].html=A;if(C){this.selectOption(B,true)}this.mOptionsCount++;if(null==this.mSelectedOption){this.selectOption(B,true)}this.fireEvent("onAddOption");this.checkAutoHeight()},addOptions:function(){for(var A=0;A<arguments.length;A++){var B=arguments[A];this.addOption(B[0],B[1],B[2])}},removeOption:function(A){if(!this.mOptions[A]){return false}this.mOptions[A].remove();delete this.mOptions[A];this.mOptionsCount--;if(this.mSelectedOption==A){for(key in this.mOptions){this.selectOption(key,true);break}}this.fireEvent("onRemoveOption");this.checkAutoHeight()},removeAllOptions:function(){this.mPopupEl.empty();this.mOptions={};this.mOptionsCount=0;this.mHiddenEl.value="";this.mSelectedOption=null;this.mChooserInputEl.setProperty("value","");this.fireEvent("onRemoveAllOptions");this.checkAutoHeight()},selectOption:function(B,A){if(!this.mOptions[B]){return }this.mChooserInputEl.setProperty("value",this.mOptions[B].html);this.mSelectedOption=B;this.mSelectedText=$E("span",this.mOptions[B]).getText();this.mHiddenEl.value=B;for(i in this.mOptions){this.mOptions[i].setProperty("class","")}this.changeSelectedOptionClass("Act");if(true!=A){this.fireEvent("onSelectOption");if(this.mPreviousValue!=B){this.fireEvent("onChangeOption",[this.mPreviousValue,B],30)}}this.mPreviousValue=B},getSelected:function(){return this.mSelectedOption},getText:function(){return this.mSelectedText},changeSelectedOptionClass:function(A){if(this.mOptions[this.getSelected()]){return this.mOptions[this.getSelected()].setProperty("class",A)}},setValue:function(A){this.selectOption(A)},getValue:function(){return this.mHiddenEl.value},eClick:function(A){if(true!==this.mReadOnly&&true===this.mIsPopupClosed&&(this.mChooserEl.hasChild(A.target)||this.mChooserEl==A.target)){this.openPopup()}else{if(true!==this.mReadOnly&&false===this.mIsPopupClosed&&false===this.mPopupEl.hasChild(A.target)&&A.target!=this.mPopupEl){this.closePopup()}}return false},eRemove:function(){if(this.mPopupEl.empty){this.mPopupEl.empty();this.mPopupEl.remove()}if(this.mMouseDownWindowEvent){window.document.removeEvent("mousedown",this.mMouseDownWindowEvent)}},resizeTo:function(){},openPopup:function(){this.mPopupEl.setStyles({display:"block",position:"absolute",left:this.mEl.getPosition().x,top:this.mEl.getPosition().y,"z-index":1000});this.mIsPopupClosed=false;this.fireEvent("onPopupOpen");if(this.mOptions[this.getSelected()]){this.mPopupEl.scrollTop=this.mOptions[this.getSelected()].getPosition().y-this.mEl.getPosition().y-this.mChooserEl.getStyle("height").toInt();this.changeSelectedOptionClass("Act")}},closePopup:function(){this.mIsPopupClosed=true;this.fireEvent("onPopupClose");this.mPopupEl.setStyle("display","none")},hide:function(){this.closePopup();this.parent()},checkAutoHeight:function(){if(this.mAutoHeight&&this.getOptionsCount()<this.mMaxAutoHeightOptions){this.mPopupEl.setStyle("height","")}else{if(this.mInitialHeight){this.mPopupEl.setStyle("height",this.mInitialHeight)}}},getOptionsCount:function(){return this.mOptionsCount},setAutoHeight:function(A){this.mAutoHeight=A;this.checkAutoHeight()},setInitialHeight:function(A){this.mInitialHeight=A},isChanged:function(){if(this.mStartValue==this.getValue()){return false}return true},resetChanged:function(){this.mStartValue=this.getValue()},clear:function(){for(i in this.mOptions){this.selectOption(i,true);return }}});DeForm.Form=DeForm.GenericElement.extend({initialize:function(A,D,C,B){this.parent(A,D,C,B);this.mType="Form";this.mAjax=null;this.mIsAjaxForm=false;this.mElements={};this.mErrorBoxEl=null;this.ErrorText=null;this.mErrorBoxMode="relative";this.mAJAXCallback=null;this.mMoveEl=this.mEl;this.mMoveFX=this.mMoveEl.effects({duration:this.mMoveFXDuration});this.mPreventSubmit=false;this.mScrollErrorBox=false;this.mAjaxAdditionalParams={};this.addEvent("onValid",this.resetChanged.bind(this));this.mEl.addEvent("submit",this.submit.bind(this));this.mEl.onsubmit=function(){return false};this.mEl.addEvent("trash",function(){form_prefix=this.mName.split("_")[0];if(this.mErrorBoxEl&&this.mErrorBoxEl.empty){this.mErrorBoxEl.empty();this.mErrorBoxEl.remove()}for(i in this.mElements){var E=form_prefix+"_"+i;this.mElements[i]=null;window[E]=null}window[this.mName]=null}.bind(this))},setAjax:function(A){this.mIsAjaxForm=A},setAjaxAdditionalParams:function(A){this.mAjaxAdditionalParams=A},setMethod:function(A){if("ajax"==A){this.setAjax(true);A="post"}else{if("post"==A||"get"==A){this.setAjax(false)}else{A="post"}}this.mEl.setProperty("method",A)},submit:function(){this.fireEvent("onSubmit",this);if(true===this.mPreventSubmit){for(i in this.mElements){element=this.mElements[i];if(element.getType()=="Button"&&"submit"==element.getSubType()){element.stopWait.delay(100,element)}}return false}this.mPreventSubmit=false;if(this.mIsAjaxForm){this.eSubmitAjax()}else{this.mEl.onsubmit=function(){return true};this.mEl.submit()}this.fireEvent("onAfterSubmit",this)},preventSubmit:function(){this.mPreventSubmit=true},clearPreventSubmit:function(){this.mPreventSubmit=false},setErrorBoxElement:function(A){this.mErrorBoxEl=new Element("div",{id:this.mEl.getProperty("id")+"errorbox",styles:{height:0}}).setHTML('<div class="Inner"></div>');if($(A)){this.mErrorBoxContainer=$(A);this.mErrorBoxEl.injectInside(this.mErrorBoxContainer)}else{this.mErrorBoxEl.injectBefore(this.mEl)}this.mErrorBoxEl.fx=this.mErrorBoxEl.effects();this.mErrorBoxEl.addEvent("click",this.hideErrorBox.bind(this))},handleAjaxRequest:function(A){this.parent(A);this.setErrorText(A.error);this.setErrorBoxMode(A.error_position)},setErrorBoxStyle:function(A){this.mErrorBoxStyle=A},setErrorText:function(A){this.mErrorText=A},setSuccessBoxStyle:function(A){this.mSuccessBoxStyle=A},setSuccessText:function(A){this.mSuccessText=A},showSuccessBox:function(A){this.mErrorBoxEl.setProperty("class",this.mSuccessBoxStyle);this.showErrorSuccesBoxHelper($pick(A,this.mSuccessText))},setErrorBoxMode:function(A){this.mErrorBoxMode=A;if("relative"==this.mErrorBoxMode){this.mErrorBoxEl.setStyles({position:"relative"})}else{this.mErrorBoxEl.setStyles({position:"absolute","z-index":1000})}},setErrorBoxScroll:function(A){this.mScrollErrorBox=A},scrollPageToTop:function(){if(this.mScrollErrorBox){return new Fx.Scroll(document.documentElement,{duration:700}).toTop()}},showErrorBox:function(A){if("none"==this.mErrorBoxMode){return false}this.mErrorBoxEl.setProperty("class",this.mErrorBoxStyle);this.showErrorSuccesBoxHelper($pick(A,this.mErrorText))},showErrorSuccesBoxHelper:function(A){this.mErrorBoxEl.getFirst().setHTML(A);this.mErrorBoxEl.setStyles({opacity:0,height:0});this.mErrorBoxEl.setStyles({height:1,visibility:"visible",display:"block",opacity:0});if(!this.mErrorBoxContainer){this.mErrorBoxEl.setStyle("width",this.mEl.getStyle("width"))}this.mErrorBoxEl.fx.stop().setOptions({duration:300});this.mErrorBoxEl.fx.start({height:[1,this.getErrorTextBoxHeight(A)],opacity:[0.9]})},hideErrorBox:function(){this.mErrorBoxEl.fx.stop().setOptions({duration:190});return this.mErrorBoxEl.fx.start({height:[0],opacity:[0]})},hideSuccessBox:function(){this.hideErrorBox()},getErrorTextBoxHeight:function(B){var C=new Element("div",{"class":"DF_errorbox",styles:{width:(this.mErrorBoxContainer?this.mErrorBoxContainer.getStyle("width"):this.mEl.getStyle("width")),position:"absolute",display:"block",visibility:"hidden"}}).adopt(new Element("div",{"class":"Inner"}).setHTML(B)).inject($(document.body));var A=C.getStyle("height");C.remove();return A},registerElements:function(){for(var A=0;A<arguments.length;A++){var B=arguments[A];this.mElements[B.getName()]=B;B.mFormRef=this}},setAJAXCallback:function(A,B){this.mAJAXCallback={callback:A,params:B}},eSubmitAjax:function(){url=this.mEl.getProperty("action");if(""==url){url=window.location.href}if(this.mAjaxCallback){this.mAjax=[this.mAJAXCallback.callback].remote(url,{onComplete:this.processForm.bind(this)},this.mAJAXCallback.params)}else{this.mAjax=new Json.Remote(url,{onComplete:this.processForm.bind(this)})}var A={};for(i in this.mElements){element=this.mElements[i];if(false==["Button","GroupBox","Label","Form","JSCalendar","FancyUploader"].contains(element.getType())){A[element.getName()]=element.getValue()}A.__deform_form_id__=this.getName();for(i in this.mAjaxAdditionalParams){A[i]=this.mAjaxAdditionalParams[i]}}this.hideErrorBox().chain(this.mAjax.send.bind(this.mAjax,[A]))},processForm:function(A){if(A.is_error){if(window.gecko){console.error(A.js)}this.mEl.replaceWith(new Element("div").setHTML(A.html));this.fireEvent("onFormError");return false}for(i in A.elements){element=A.elements[i];if(this.mElements[i]){this.mElements[i].handleAjaxRequest(A.elements[i])}}for(i in this.mElements){element=this.mElements[i];if(element.getType()=="Button"&&"submit"==element.getSubType()&&element.isWaiting()){element.stopWait()}}if(A.form.valid){this.scrollPageToTop();this.fireEvent("onValid")}else{if(!A.form.valid){this.scrollPageToTop();this.showErrorBox.delay(100,this);this.fireEvent("onInvalid")}}},getInvalidElements:function(){out=[];for(i in this.mElements){element=this.mElements[i];if(element!=this&&element.isInvalid()){out.push(element)}}return out},isInvalid:function(){return this.getInvalidElements().length>0},setInvalid:function(){},getValue:function(){},setValue:function(){},moveTo:function(B,A,C){this.parent(B,A,false);this.mErrorBoxEl.setStyles({left:B,top:A})},clear:function(){for(var B in this.mElements){var A=this.mElements[B];if("Form"!=A.getType()){A.clear()}}},isChanged:function(){for(i in this.mElements){if(this.mElements[i]!=this&&true===this.mElements[i].isChanged()){return true}}return false},resetChanged:function(){for(i in this.mElements){if(this.mElements[i]!=this&&true===this.mElements[i].resetChanged()){return true}}return false},escapeSpecialChars:function(A){if($type(A)=="string"){A=A.replace(/\\/,"\\").replace(/&/,"&amp;").replace(/"/,"&quot;").replace(/'/,"&#039;").replace(/</,"&lt;").replace(/>/,"&gt;")}return A}});DeForm.Grid=DeForm.GenericElement.extend({initialize:function(A,F,E,D,B,C){this.parent(A,F,E);this.mIconImage=D;this.mIconWidth=B;this.mIconHeight=C;this.mGridColumns=[];this.mGridData={};this.mGridRows=[];this.mType="Grid",this.mIsIconCreated=false;this.mDataEl=$(this.mEl.getProperty("id")+"_hidden");this.mTableEl=new Element("table");this.mTableEl.setStyle("width","100%");this.mTableBodyEl=new Element("tbody");this.mTableHeaderEl=new Element("tr");this.mTableEl.adopt(this.mTableBodyEl);this.mEl.adopt(this.mTableEl);this.mTableBodyEl.adopt(this.mTableHeaderEl);this.mMoveEl=this.mEl;this.mMoveFX=this.mMoveEl.effects({duration:this.mMoveFXDuration})},handleAjaxRequest:function(A){A.value=A.serialized_value;this.parent(A)},getRow:function(C){var A={};for(var B in this.mGridData){A[B]=this.mGridData[B].data[C]}return A},addRow:function(E){this.fireEvent("onAdd");if(E.length<=0){return }var B=this.mGridRows.length;var A=new Element("tr");A.addEvent("click",this.fireEvent.bind(this,["onClickRow",B]));this.mGridRows.push(A);for(b in this.mGridColumns){col_name=this.mGridColumns[b];if(typeof (this.mGridData[col_name])=="undefined"){continue}this.mGridData[col_name].data[B]=E[col_name];var F=new Element("td");F.setStyles({width:this.mGridData[col_name].column_width,textAlign:this.mGridData[col_name].column_align});F.appendText(E[col_name]);A.adopt(F)}if(this.mIconImage!=""){var F=new Element("td");F.setStyles({verticalAlign:"middle",width:this.mIconWidth+"px"});var C=new Element("a");var D=DeForm.ImgAlpha(this.mIconImage,this.mIconWidth,this.mIconHeight);C.addEvent("click",this.deleteRow.bind(this).pass(B));C.adopt(D);F.adopt(C);A.adopt(F)}this.mTableBodyEl.adopt(A);this.serializeData();this.fireEvent("onAdded")},addEmptyRow:function(F,A){var C=new Element("tr");C.setProperty("id",F+"_"+A+"_ADD_TR");for(b in this.mGridColumns){col_name=this.mGridColumns[b];if(typeof (this.mGridData[col_name])=="undefined"){continue}var G=new Element("td");col_input_el=$E("#"+F+"_"+col_name);col_input_el.remove();col_input_el.injectInside(G);col_input_el.removeProperty("style");C.adopt(G)}var E=new Element("td");var D=new Element("img");D.injectInside(E);D.setProperty("src","/mp/DeForm/DF_grid_add.png");C.adopt(E);var B=new Element("tfoot");B.adopt(C);this.mTableBodyEl.getParent().adopt(B);D.setStyle("cursor","pointer");D.addEvent("click",this.addRowByName.bind(this,[F,A]))},addRowByName:function(pFormName,pGridName){var Arguments={};for(b in this.mGridColumns){col_name=this.mGridColumns[b];if(typeof (this.mGridData[col_name])=="undefined"){continue}eval("Arguments."+col_name+" = '"+$E("#"+pFormName+"_"+col_name).getValue()+"'")}this.addRow(Arguments)},addColumn:function(B,E,A,D,C){if($type(this.mGridData[B])=="object"){return }this.mGridColumns.push(B);this.mGridData[B]={};this.mGridData[B].column_width=A;this.mGridData[B].column_align=D;this.mGridData[B].data={};var F=new Element("th");F.setStyle("width",A);F.appendText(E);this.mTableHeaderEl.adopt(F)},deleteRow:function(A){this.mGridRows[A].effect("opacity",{duration:350,onComplete:this.deleteRowHelper.bind(this).pass(A)}).start(0)},deleteRowHelper:function(C,A){if(!this.mGridRows[C]){return 0}this.mTableBodyEl.removeChild(this.mGridRows[C]);this.mGridRows[C]=null;var B={};for(name in this.mGridData){B[name]=this.mGridData[name].data[C];delete this.mGridData[name].data[C]}if(true!=A){this.fireEvent("onDelete",B)}this.serializeData();return this.mGridRows.length},deleteAllRows:function(B){var C;var A=this.mGridRows.length;for(C=A;C>=0;C--){this.deleteRowHelper(C,B)}},setInvalid:function(){},serializeData:function(){this.mDataEl.value=DeForm.Grid.json_encode(this.mGridData)},getValue:function(){return this.mDataEl.value},setValue:function(A){this.deleteAllRows(true);this.mDataEl.value=A;this.unserializeData()},unserializeData:function(){var D=this.mDataEl.value;if(D!=""){var C=DeForm.Grid.json_decode(D);var B="";for(name in C){B=name;break}if(B==""){return }for(i in C[B].data){if(parseInt(i)!=i){continue}var A={};for(col_name in C){if(typeof (C[col_name].data[i])=="undefined"){A[col_name]=""}else{A[col_name]=C[col_name].data[i]}}this.addRow(A)}}if(this.mIconImage!=""&&!this.mIsIconCreated){this.mTableHeaderEl.adopt(new Element("th"));this.mIsIconCreated=true}}});DeForm.Grid.specialChars={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};DeForm.Grid.json_encode=function(B){switch($type(B)){case false:return"null";case"number":return isFinite(B)?String(B):"null";case"boolean":return String(B);case"string":return'"'+B.replace(/([\x00-\x1f\\"])/g,function(F,E){var G=DeForm.Grid.specialChars[E];if(G){return G}G=E.charCodeAt();return"\\u00"+Math.floor(G/16).toString(16)+(G%16).toString(16)})+'"';case"arguments":case"array":return"["+$A(B).map(DeForm.Grid.json_encode).remove(false).join(",")+"]";case"object":var A=[];for(var D in B){var C=DeForm.Grid.json_encode(B[D]);if(C){A.push(DeForm.Grid.json_encode(D)+":"+C)}}return"{"+A.join(",")+"}"}return false};DeForm.Grid.json_decode=function(str,secure){return(($type(str)!="string")||(secure&&!str.test(/^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/)))?false:eval("("+str+")")};DeForm.TextArea=DeForm.GenericElement.extend({initialize:function(A,D,C,B){this.parent(A,D,C,B);this.mType="TextArea";this.mElCounter=$(this.mEl.getProperty("id")+"counter");this.mMaxLength=0;this.mCounterAllowPass=false;this.mCounterVisible=false;this.resetChanged();if("visible"==this.mElCounter.getStyle("visibility")){this.mCounterVisible=true}else{this.mCounterVisible=false}},setMaxLength:function(A){this.mMaxLength=A;this.checkMaxLength()},setCounterPass:function(A){if(A!=""){this.mCounterAllowPass=true}else{this.mCounterAllowPass=false}this.eMaxLength()},setCounterVisible:function(A){if(A!=""){this.mCounterVisible=true;this.mElCounter.setStyle("visibility","visible")}else{this.mCounterVisible=false;this.mElCounter.setStyle("visibility","hidden")}},isCounterVisible:function(){return this.mCounterVisible},checkMaxLength:function(){if(this.mMaxLength>0){this.mEl.addEvent("click",this.eMaxLength.bind(this));this.mEl.addEvent("keypress",this.eMaxLength.bind(this));this.mEl.addEvent("keyup",this.eMaxLength.bind(this));this.mEl.addEvent("keydown",this.eMaxLength.bind(this));this.eMaxLength()}else{this.mEl.removeEvents("click");this.mEl.removeEvents("keypress");this.mEl.removeEvents("keyup");this.mEl.removeEvents("keydown")}},setValue:function(A){this.parent(A)},eMaxLength:function(){if(this.getValue().length>=this.mMaxLength){if(false===this.mCounterAllowPass){this.setValue(this.getValue().substr(0,this.mMaxLength))}counter_html='<span style="color:#F00">'+parseInt(this.mMaxLength-this.getValue().length)+"</span>"}else{counter_html=this.mMaxLength-this.getValue().length}this.mElCounter.setHTML(counter_html)},setElementsInitialValue:function(){this.parent();this.checkMaxLength()},resizeTo:function(A,B,C){this.parent(A,B,C);this.mElCounter.setStyle("width",A)},setInvalid:function(B,A){this.parent(B,A);if(B){this.mToolTip.addEvent("keydown",this.mToolTip.hide.bindWithEvent(this.mToolTip))}},setReadOnly:function(A){if(!$defined(A)){return }if(A){this.mEl.setProperty("readonly","readonly")}else{this.mEl.removeProperty("readonly")}this.mReadOnly=A;this.changeClass()},hide:function(){this.parent();if(this.mCounterVisible){this.mElCounter.setStyle("display","none")}},show:function(){this.parent();if(this.mCounterVisible){this.mElCounter.setStyle("display","block")}},isChanged:function(){if(this.mStartValue==this.getValue()){return false}return true},resetChanged:function(){this.mStartValue=this.getValue()}});DeForm.TextBox=DeForm.GenericElement.extend({initialize:function(A,D,C,B){this.parent(A,D,C,B);this.mType="TextBox";this.resetChanged();this.mEl.addEvent("mouseover",this.fireEvent.bind(this,"mouseover"));this.mEl.addEvent("mouseout",this.fireEvent.bind(this,"mouseout"));this.mEl.addEvent("mousedown",this.fireEvent.bind(this,"mousedown"));this.mEl.addEvent("mouseup",this.fireEvent.bind(this,"mouseup"));this.mEl.addEvent("keyup",this.fireEvent.bind(this,"keyup"));this.mEl.addEvent("keydown",this.fireEvent.bind(this,"keydown"));this.mEl.addEvent("click",this.fireEvent.bind(this,"click"));this.mEl.addEvent("mouseenter",this.fireEvent.bind(this,"mouseenter"));this.mEl.addEvent("mouseleave",this.fireEvent.bind(this,"mouseleave"));this.mEl.addEvent("focus",this.fireEvent.bind(this,"focus"));this.mEl.addEvent("blur",this.fireEvent.bind(this,"blur"))},resizeBy:function(A,C,B){this.parent(A,null,B)},resizeTo:function(A,C,B){this.parent(A,null,B)},setInvalid:function(B,A){this.parent(B,A);if(B){this.mToolTip.addEvent("keydown",this.mToolTip.hide.bindWithEvent(this.mToolTip))}},setReadOnly:function(A){if(!$defined(A)){return }if(A){this.mEl.setProperty("readonly","readonly")}else{this.mEl.removeProperty("readonly")}this.mReadOnly=A;this.changeClass()},isChanged:function(){if(this.mStartValue==this.getValue()){return false}return true},resetChanged:function(){this.mStartValue=this.getValue()}});DeForm.DateBox=DeForm.TextBox.extend({initialize:function(A,D,C,B){this.parent(A,D,C,B);this.mType="DateBox"},setInvalid:function(B,A){this.parent(B,A);if(!B&&this.mDefaultToolTipText){this.mToolTip.addEvent("keydown",this.mToolTip.hide.bind(this.mToolTip))}}});DeForm.SwfUpload=DeForm.GenericElement.extend({initialize:function(A,E,D,C,B){this.mObjName=A;this.parent(A,E,D);this.mType="SwfUpload";this.mLibJSPath=C;this.mFlashPath=B;this.mProgressContainer=$(this.mObjName+"_progress_containrer");this.mProgressBar=$(this.mObjName+"_progress_bar");this.mButtons=$(this.mObjName+"_button");this.mResizeProgresContainerFX=this.mProgressContainer.effects({duration:this.mResizeFXDuration});this.mResizeProgresBarFX=this.mProgressBar.effects({duration:this.mResizeFXDuration});this.mButtonsFX=this.mButtons.effects({duration:this.mResizeFXDuration});DeForm.LoadScript(this.mLibJSPath,this.initializeSwfUpload.bind(this))},initializeSwfUpload:function(){this.mSwfu=new SWFUpload({upload_script:"",target:this.mObjName+"_button",flash_path:this.mFlashPath,allowed_filesize:4000,allowed_filetypes:"*.*",allowed_filetypes_description:"All files",browse_link_innerhtml:"Browse",upload_link_innerhtml:"Upload",browse_link_class:"DF_swf_browse",upload_link_class:"DF_swf_upload",flash_loaded_callback:this.mObjName+".mSwfu.flashLoaded",upload_file_queued_callback:this.mObjName+".fileQueued",upload_file_start_callback:this.mObjName+".uploadFileStart",upload_progress_callback:this.mObjName+".uploadProgress",upload_file_complete_callback:this.mObjName+".uploadFileComplete",upload_file_cancel_callback:this.mObjName+".uploadFileCancelled",upload_file_error_callback:this.mObjName+".errorsFunction",upload_error_callback:this.mObjName+".uploadError",upload_queue_complete_callback:this.mObjName+".uploadQueueComplete",upload_cancel_callback:this.mObjName+".uploadCancel",auto_upload:false});this.last_id=0;$("SWFUpload_0CancelBtn").addEvent("click",this.cancelQueue.bind(this))},fileQueued:function(B,A){this.mEl.value=B.name;$(this.mProgressBar).style.width="0px";if(this.last_id!=0){this.mSwfu.cancelFile(this.last_id)}this.last_id=B.id},uploadFileCancelled:function(B,A){},uploadFileStart:function(C,B,A){$(this.mProgressBar).style.visibility="visible";$("SWFUpload_0CancelBtn").setStyle("top","0px");var D=$("SWFUpload_0UploadBtn").offsetLeft;D+=$("swfuploader_test_button").getStyle("left").toInt();$("SWFUpload_0CancelBtn").setStyle("left",D+"px");$("SWFUpload_0CancelBtn").setStyle("visibility","visible")},uploadProgress:function(A,D){var C=parseInt($(this.mProgressContainer).style.width);var B=(D/A.size);$(this.mProgressBar).style.width=Math.ceil(C*B)+"px"},uploadError:function(A){SWFUpload.debug(A)},uploadFileComplete:function(A){$("SWFUpload_0CancelBtn").setStyle("visibility","hidden")},cancelQueue:function(){this.mSwfu.cancelQueue();$("SWFUpload_0CancelBtn").setStyle("visibility","hidden")},uploadQueueComplete:function(A){this.mSwfu.cancelQueue()},errorsFunction:function(C,A,B){if(-50==C){alert(A.name+" - File is too big")}},addSeting:function(A,B){if(this.mSwfu){this.mSwfu.addSetting(A,B);this.mSwfu.loadFlash()}else{this.addSeting.delay(200,this,[A,B])}},setFileType:function(A,B){if(A){this.addSeting("allowed_filetypes",A)}if(B){this.addSeting("allowed_filetypes_description",B)}},setMaxFileSize:function(A){this.addSeting("allowed_filesize",A)},setUploadScript:function(A){this.addSeting("upload_script",A)},setCallback:function(B,A){this.addSeting(B,A)},resizeBy:function(A,C,B){this.parent(A,null,B)},resizeTo:function(A,B,C){data={width:this.getDimensions().width};button_data={left:this.mButtons.getPosition().x};if($type(A)=="number"){data.width=A;button_data.left=A+10}if($type(B)=="number"){data.height=B}this.mResizeFX.start(data);this.mResizeProgresContainerFX.start(data);this.mResizeProgresBarFX.start(data);this.mButtonsFX.start(button_data)}});DeForm.FancyUploader=DeForm.GenericElement.extend({mContainer:false,mOffset:50,initialize:function(L,I,F,E,J,A,G,K,B,M,N,C,D,H){this.parent(L,I,"");if(K&&B){types={};types[B]=K}this.mContainer=new Element("div",{styles:{height:1,position:"absolute",top:this.getContainerTop(),left:this.getContainerLeft()}}).injectBefore($E("div"));window.addEvent("scroll",this.moveContainer.bind(this));this.moveContainer();if(N>0){N=N*1024}DeForm.LoadScript(J,function(){DeForm.LoadScript(A,function(){DeForm.LoadScript(E,this.newFancy.bind(this,[I,types,M,G,N,C,D,H]))}.bind(this))}.bind(this))},newFancy:function(H,G,F,B,D,A,C,E){this.mFancyObj=new FancyUpload(H,{swf:B,queued:true,queueList:H+"_upload_queue",limitFiles:A.toInt(),multiple:C,types:G,url:F,limitSize:D,container:this.mContainer,instantStart:E,createReplacement:function(){},onComplete:this.fireEvent.bind(this,"onComplete"),onSelect:function(I,J){this.fireEvent("onSelect",[I,J])}.bind(this)});this.browse=this.mFancyObj.uploader.browse.bind(this.mFancyObj.uploader);this.addEvent("onSelect",function(I,J){this.mFormRef.hideErrorBox();if(D&&(J>D)){this.mFormRef.showErrorBox(this.mErrorFileSize)}});if($(H+"_browse_button")){$(H+"_browse_button").addEvent("click",this.browse.bind(this))}},setErrorFileSize:function(A){this.mErrorFileSize=A},upload:function(){this.mFancyObj.uploader.send(this.mFancyObj.options.url)},setAction:function(B){var A={url:B};if(!this.mFancyObj){this.setAction.delay(300,this,B);return false}this.mFancyObj.setOptions(A);return true},setValue:function(){},getValue:function(){return new String()},getContainerLeft:function(){return window.getScrollLeft()+this.mOffset},getContainerTop:function(){return window.getScrollTop()+this.mOffset},moveContainer:function(){this.mContainer.setStyles({top:this.getContainerTop()+"px",left:this.getContainerLeft()+"px"})}});DeForm.FileBox=DeForm.GenericElement.extend({initialize:function(A,D,C,B){this.parent(A,D,C,B);this.mType="FileBox"}});DeForm.JSCalendar=DeForm.GenericElement.extend({initialize:function(pName,pEl,pInputObj,pBaseClass,pCSS,pLib,pLang,pDateFormat){this.parent(pName,pEl,pBaseClass);this.mType="JSCalendar";this.mCal=null;this.mFirstDayOfWeek=0;this.mDateFormat=pDateFormat;eval("this.mInputObj = "+pInputObj);DeForm.LoadCSS(pCSS);DeForm.LoadScript(pLib);DeForm.LoadScript(pLang,this.initializeCalendar.bind(this));this.registerIconEvent(this.mEl)},registerButtonEvent:function(A){A.addEvent("click",this.showCalendarAtElement.bind(this).pass(A))},registerIconEvent:function(A){A.addEvent("click",this.showCalendarAtElement.bind(this).pass(A))},calendarCallback:function(B,A){this.mInputObj.setValue(A.toString());this.mInputObj.fireEvent("onSelectDate",A.toString());if(this.mCal.dateClicked){this.mCal.callCloseHandler()}},hide:function(){this.mCal.hide()},show:function(){this.mCal.show()},initializeCalendar:function(){this.mCal=new Calendar(this.mFirstDayOfWeek,Date.parseDate(this.mInputObj.getValue(),this.mDateFormat),this.calendarCallback.bind(this),this.hide.bind(this));this.mCal.weekNumbers="";this.mCal.time24=1;this.mCal.setDateFormat(this.mDateFormat);this.mCal.create()},showCalendarAtElement:function(pEl){if(this.mCal){this.mCal.showAtElement(pEl,"Br");with(this.mCal.element.style){left=pEl.getPosition().x+"px";top=pEl.getPosition().y+17+"px";display="block"}}else{this.showCalendarAtElement.delay(300,this,pEl)}},resizeTo:function(){this.hide()},moveTo:function(B,A,C){this.parent(B,A,C);this.hide()}});DeForm.Label=DeForm.GenericElement.extend({initialize:function(A,C,B){this.parent(A,C,B);this.mType="Label";this.mMoveEl=this.mEl;this.mResizeEl=this.mEl;this.mResizeFX=this.mResizeEl.effects({duration:this.mResizeFXDuration});this.mMoveFX=this.mMoveEl.effects({duration:this.mMoveFXDuration});this.mAsterix=false},handleAjaxRequest:function(A){this.parent(A);this.setText(A.text)},setInvalid:function(){},setReadOnly:function(){},setAsterix:function(B){var A=$E("sup",this.mEl);if(true==B){A.setStyle("visibility","visible");this.mAsterix=true}else{A.setStyle("visibility","hidden");this.mAsterix=false}},getText:function(){return $E("span",this.mEl).getText()},setText:function(A){$E("span",this.mEl).setHTML(A)},getValue:function(){},setValue:function(A){}});DeForm.Groupbox=DeForm.Label.extend({initialize:function(A,D,C,B){this.parent(A,D,C,B);this.mType="GroupBox"}});DeForm.ToolTip=new Class({initialize:function(A){this.mToolTipEl=A;this.mToolTipEl.addEvent("trash",this.eRemove.bind(this));this.mClasses={error:"DF_ToolTip_error",standard:"DF_ToolTip_standard"};this.mOffsets={error:{x:11,y:-10},standard:{x:10,y:12}};this.mText="";this.mRegisteredEvents=[];this.mType="standard";this.mPreviousTitle="";this.create()},registerElementEvents:function(){this.addEvent("mouseenter",this.show.bindWithEvent(this));this.addEvent("mouseleave",this.hide.bindWithEvent(this));this.addEvent("mousemove",this.locate.bindWithEvent(this))},unregisterElementEvents:function(){for(i=0;i<this.mRegisteredEvents.length;i++){var A=this.mRegisteredEvents[i];this.removeEvent(A.event,A.ref);delete this.mRegisteredEvents[A]}},addEvent:function(A,B){this.mRegisteredEvents.push({event:A,ref:B});this.mToolTipEl.addEvent(A,B)},removeEvent:function(A,B){this.mToolTipEl.removeEvent(A,B)},show:function(A){$("DeForm_ToolTipEl").setProperty("class",this.mClasses[this.mType]);$("DeForm_ToolTipEl").fx.stop();$("DeForm_ToolTipEl").fx.start(1);this.locate(A);this.setText(this.mText);$clear($("DeForm_ToolTipEl").timer);$("DeForm_ToolTipEl").timer=this.hide.delay(8000,this);if(this.mToolTipEl.getProperty("title")){this.mPreviousTitle=this.mToolTipEl.getProperty("title");this.mToolTipEl.removeProperty("title")}},hide:function(){this.mToolTipEl.setProperty("title",this.mPreviousTitle);$("DeForm_ToolTipEl").fx.stop();$("DeForm_ToolTipEl").fx.start(0);$clear($("DeForm_ToolTipEl").timer)},setText:function(A){A=A.replace(/^\n+/g,"").replace(/\n/g,"<br/>");if($("DeForm_ToolTipEl")){$("DeForm_ToolTipEl").getFirst().setHTML(A)}this.mText=A},setType:function(A){this.mType=A;if($("DeForm_ToolTipEl")){$("DeForm_ToolTipEl").className=this.mClasses[A]}},create:function(){if(!$("DeForm_ToolTipEl")){new Element("div",{id:"DeForm_ToolTipEl"}).inject($(document.body));$("DeForm_ToolTipEl").adopt(new Element("div",{"class":"DF_ToolTip_inner"}));$("DeForm_ToolTipEl").fx=$("DeForm_ToolTipEl").effect("opacity",{duration:130});$("DeForm_ToolTipEl").setStyles({opacity:0,position:"absolute",left:0,top:0})}},locate:function(B){var D={x:window.getWidth(),y:window.getHeight()};var A={x:window.getScrollLeft(),y:window.getScrollTop()};var C={x:$("DeForm_ToolTipEl").offsetWidth,y:$("DeForm_ToolTipEl").offsetHeight};var G={x:"left",y:"top"};for(var E in G){var F=B.page[E]+this.mOffsets[this.mType][E];if(F+C[E]-A[E]>D[E]){F=B.page[E]-this.mOffsets[this.mType][E]-C[E]}$("DeForm_ToolTipEl").setStyle(G[E],F)}},eRemove:function(){this.mToolTipEl=null}});DeForm.SelectList=DeForm.GenericElement.extend({initialize:function(A,D,C,B){this.parent(A,D,C,B);this.mType="SelectList"},resizeBy:function(A,C,B){this.parent(A,null,B)},resizeTo:function(A,C,B){this.parent(A,null,B)},setReadOnly:function(A){if(!$defined(A)){return }if(A){this.mEl.setProperty("disabled","disabled")}else{this.mEl.removeProperty("disabled")}this.mReadOnly=A;this.changeClass()}});DeForm.Radio=DeForm.GenericElement.extend({initialize:function(A,D,C,B){this.mMoveEl=$(D);this.parent(A,D,C,B);this.mType="Radio";this.mRadios={};this.mStartValue=null;this.mPreviousValue=null},registerRadio:function(B){this.mRadios[$(B).value]=$(B);if(window.ie){this.changeClass();$(B).getParent().addEvent("click",this.setValue.bind(this,[$(B).value,true]))}if($(B).getNext&&$(B).getNext()){var A=$(B).getNext();A.addEvent("click",this.setValue.bind(this,[$(B).value,true]));A.onselectstart=function(){return false};A.addEvent("mousedown",function(C){C.preventDefault()}.bindWithEvent(this))}$(B).addEvent("click",this.setValue.bind(this,[$(B).value,true]));$(B).addEvent("keyup",this.setValue.bind(this,[$(B).value,true]));this.mPreviousValue=this.getValue();this.resetChanged()},setValue:function(B,A){if(this.mRadios[B]&&(false==this.mRadios[B].getProperty("disabled")||!A)){this.mRadios[B].setProperty("checked",true);this.fireEvent("onClick");if(this.mPreviousValue!=B){this.fireEvent("onChange")}this.mPreviousValue=B;this.changeClass();return true}return false},getValue:function(){for(value in this.mRadios){radio=this.mRadios[value];if(radio.getProperty("checked")){return radio.getValue()}}return new String()},setReadOnly:function(A,B){if(this.mRadios[B]){this.mRadios[B].disabled=A;return true}return false},resizeTo:function(){},isChanged:function(){if(this.mStartValue==this.getValue()){return false}return true},resetChanged:function(){this.mStartValue=this.getValue()},clear:function(){for(value in this.mRadios){this.mRadios[value].checked=0}this.changeClass()},changeClass:function(){for(value in this.mRadios){radio=this.mRadios[value];class_names=[this.mBaseClass];if(window.ie6){class_names.push("ie")}if(true==radio.getProperty("checked")){class_names.push("on")}else{class_names.push("off")}if(true==this.mInvalid){class_names.push("error")}if(true==radio.getProperty("disabled")){class_names.push("disabled")}radio.getParent().setProperty("class",class_names.join("_"))}},setInvalid:function(B,A){this.mInvalid=B;this.mToolTip.unregisterElementEvents();if(B){this.mToolTip.setText(A);this.mToolTip.setType("error");this.mToolTip.registerElementEvents()}else{if(this.mDefaultToolTipText){this.mToolTip.registerElementEvents();this.mToolTip.setType("standard");this.mToolTip.setText(this.mDefaultToolTipText)}}this.changeClass()}});DeForm.Captcha=DeForm.GenericElement.extend({initialize:function(A,D,C,B){this.parent(A,D,C,B);this.mType="Captcha"},setImgSrc:function(A){this.mImgSrc=A},reload:function(){this.mEl.setProperty("src",this.mImgSrc+"&"+(new Date).getTime())}});function DSWindowSkin(W,D,M,E,N,J,U,I,Q,Y,R,g,C,F,A,O,c,a,l,k,L,f,H,G,X,V,h,K,T,d,P,S,B,j,Z){this.mLeftTopW=D;this.mLeftTopH=M;this.mRightTopW=E;this.mRightTopH=N;this.mLeftBottomW=J;this.mLeftBottomH=U;this.mRightBottomW=I;this.mRightBottomH=Q;this.mContentLeft=Y;this.mContentTop=R;this.mContentRight=g;this.mContentBottom=C;this.mHeaderLeft=F;this.mHeaderTop=A;this.mHeaderRight=O;this.mHeaderHeight=c;this.mHeaderIconX=l;this.mHeaderIconY=k;this.mNoIconHeaderLeft=L;this.mCloseBtnW=f;this.mCloseBtnH=H;this.mCloseBtnRight=G;this.mCloseBtnTop=X;this.mImgP=W;this.mIconBaseP=V;this.mDeBug=h;this.maxZIndex=1;this.mCloseWinMessage=K;this.mCloseWinHeader=T;this.mCloseWinYes=d;this.mCloseWinNo=P;this.mLeftFW=S;this.mTopFW=B;this.mRightExtendFW=j;this.mBottomExtendFW=Z}var DSContextMenu=new Class({mIsVisible:false,initialize:function(A,C,B){var D=this.mMainEl=new Element("div",{"class":"ContextMenu",styles:{position:"absolute",left:"0px",top:"0px","z-index":10000,visibility:"hidden",width:A}}).injectInside(document.body);if(true===B){new Element("div",{"class":"TopBorder"}).injectInside(D)}this.mData=C;C.each(function(F){if(!F){return }if(F.separator){var G=new Element("div",{"class":"Separator"})}else{var G=F.element=new Element("a",{"class":"Item",href:F.href});G.innerHTML+=F.text;if(F.click){G.addEvent("click",function(H){H.stop();F.click()}.bindWithEvent(this))}var E=new Element("span",{"class":"Icon"}).injectInside(G);new Element("div",{styles:{position:"relative","padding-right":"4px"}}).adopt(ImgAlpha(F.icon,16,16,true).setStyle("border","0")).injectInside(E)}G.injectInside(D)}.bind(this))},Show:function(){this.mIsVisible=true;this.mMainEl.setStyles({visibility:"visible",display:"block","z-index":10000})},Hide:function(){this.mIsVisible=false;this.mMainEl.setStyles({visibility:"hidden",display:"none"})},Toggle:function(){if(true===this.mIsVisible){this.Hide()}else{this.Show()}},Move:function(B,A){this.mMainEl.setStyles({left:B+"px",top:A+"px"})},isVisible:function(){return this.mIsVisible}});var DSMenuBar=new Class({mItemActive:false,mLastClicked:false,mItems:[],mNotifications:{},initialize:function(){this.CreateGraphics();this.WindowResize.delay(1000,this)},CreateGraphics:function(){this.mMenuBarEl=new Element("div",{"class":"MenuBar",styles:{position:"absolute",width:window.getWidth()+"px",top:"-30px"}});window.addEvent("resize",this.WindowResize.bind(this));window.addEvent("scroll",this.WindowScroll.bind(this));this.mMenuBarInner=new Element("div",{"class":"Inner"}).injectInside(this.mMenuBarEl);this.mMenuBarInner.adopt(ImgAlpha("http://desmart.com/p/favicon.png",16,16).setStyles({position:"absolute",right:"4px",top:"2px",cursor:"pointer"}).addEvent("click",function(){location="http://www.desmart.com/"}));this.mNotificationsArea=new Element("div",{styles:{position:"absolute",right:22,top:0}}).injectInside(this.mMenuBarInner);this.mMenuBarEl.injectInside(document.body)},Show:function(){this.mMenuBarEl.setStyle("top","0px");this.PositionContextMenus()},Hide:function(){this.mMenuBarEl.effect("top",{duration:600}).start(-30)},PositionContextMenus:function(){for(i=0;i<this.mItems.length;i++){it=this.mItems[i];it.contextMenu.Move(it.getPosition().x.toInt(true),it.getPosition().y.toInt(true)+this.mMenuBarEl.getStyle("height").toInt(true)-1)}},WindowResize:function(){this.mMenuBarEl.setStyle("width",window.getWidth()+"px")},WindowScroll:function(){var A=window.getSize().scroll.x;this.mMenuBarEl.setStyle("left",A+"px");if(this.mBaloon){this.mBaloon.setStyle("right",12-A)}this.PositionContextMenus()},AddMenuItem:function(B,C,D){var A=new Element("a",{href:"","class":"Item"}).injectInside(this.mMenuBarInner);A.addEvent("mouseup",this.MenuItemClick.bindWithEvent(this,A));A.addEvent("mouseover",this.MenuItemMouseOver.bind(this,[A]));A.addEvent("click",function(E){var F=new Event(E);F.stop()}.bindWithEvent());A.contextMenu=C;A.setHTML(B);this.mNotificationsArea.setStyle("left",A.getCoordinates().width+A.getCoordinates().left);if(true===D){A.itemNumber=this.mItems.unshift(A)}else{A.itemNumber=this.mItems.push(A)}},AddMenuLink:function(B,A,C){it=new Element("a",{"class":"Item",href:A}).setHTML(B).addEvent("mouseover",this.HideAllContextMenus.bind(this));if(true===C&&this.mItems.length>0){it.injectBefore(this.mItems[0])}it.injectInside(this.mMenuBarInner)},MenuItemClick:function(A,B){if(this.mLastClicked==B.itemNumber||false==this.mItemActive){this.mItemActive=!this.mItemActive}this.HideAllContextMenus();if(this.mItemActive){B.contextMenu.Show();this.mClickEvent1=document.addEvent("click",this.MenuItemHideAll.bind(this))}this.mLastClicked=B.itemNumber;B.blur();A.preventDefault()},MenuItemMouseOver:function(A){if(this.mItemActive){this.HideAllContextMenus();A.contextMenu.Show();this.mClickEvent2=document.addEvent("click",this.MenuItemHideAll.bind(this));this.mLastClicked=A.itemNumber}},MenuItemHideAll:function(A){document.removeEvent("mouseup",this.mClickEvent1);document.removeEvent("mouseup",this.mClickEvent2);if(A.clientY<this.mMenuBarEl.getStyle("height").toInt()){return }this.mLastClicked=false;this.mItemActive=false;this.HideAllContextMenus()},HideAllContextMenus:function(){for(i=0;i<this.mItems.length;i++){it=this.mItems[i];it.contextMenu.Hide()}},setNotification:function(B){var A=B.name;$clear(this.mPeriodical1);if(this.mNotifications[A]){this.removeNotification(B.name)}this.mNotifications[A]=new Element("div").injectInside(this.mNotificationsArea);if(B["class"]!=""){this.mNotifications[A].setProperty("class",B["class"])}this.mNotifications[A].setHTML(B.html);this.mNotifications[A].setStyle("width",this.mNotifications[A].getStyle("width"));if(B.html.match(/\.\.\.$/)){this.mPeriodical1=function(){this.mNotifications[A].innerHTML+=".";this.mNotifications[A].innerHTML=this.mNotifications[A].innerHTML.replace(/\.\.\.\.$/,"")}.periodical(300,this)}},removeNotification:function(A){$clear(this.mPeriodical1);if(this.mNotifications[A]){this.mNotifications[A].remove();this.mNotifications[A]=null}},setBaloon:function(A){if(!this.mBaloon){this.mBaloon=new Element("div",{"class":"MenuBarBaloon",styles:{opacity:0}}).adopt(ImgAlpha("/p/dsmenubar_baloon.png",245,109)).injectInside(document.body);this.mBaloonTitle=new Element("div",{"class":"Title"}).injectInside(this.mBaloon);this.mBaloonFX=this.mBaloon.effect("opacity",{duration:700});this.mBaloonContent=new Element("div",{"class":"Content"}).injectInside(this.mBaloon);this.mBaloon.addEvent("click",this.removeBaloon.bind(this))}this.mBaloonTitle.setHTML(A.title);this.mBaloonContent.setHTML(A.html);this.mBaloonContent.setStyle("top",36+Math.abs(((50-this.mBaloonContent.getStyle("height").toInt(true)))/2));this.mBaloonFX.stop();this.mBaloonFX.start(1);this.mBaloon.setStyle("right",12-window.getSize().scroll.x);if(false!==A.close_delay){$clear(this.mTimer1);this.mTimer1=this.removeBaloon.delay(A.close_delay|30000,this)}},removeBaloon:function(){if(!this.mBaloonFX){return }this.mBaloonFX.stop();this.mBaloonFX.start(0).chain(function(){this.mBaloonFX=null;this.mBaloonTitle.remove();this.mBaloonTitle=null;this.mBaloonContent.remove();this.mBaloonContent=null;this.mBaloon.remove();this.mBaloon=null}.bind(this))}});var DSMenuBar1;window.addEvent("domready",function(){DSMenuBar1=new DSMenuBar()});var ActiveWindow=null;var ConfirmMode=0;var DSWindow=new Class({initialize:function(C,G,O,E,D,F,B,P,Q,I,A,H,N,K,L,J,M){if(M){ActiveWindow=this}this.mInstanceName=C;this.mEscapeKey=M;this.mWinID=this.mInstanceName;this.mContentID=P;this.mWidth=G;this.mHeight=O;this.mX=E;this.mY=D;this.mContentElement=$(this.mContentID);this.mHeaderText=F;if(B){this.mHeaderIcon=DSWindowSkin.mIconBaseP+B}else{this.mHeaderIcon=false}this.mModal=Q;if(J){this.mFullContent=true}else{this.mFullContent=false}if(H){this.mResizeBarOn=true}else{this.mResizeBarOn=false}this.mDeBug=DSWindowSkin.mDeBug;this.mLeftTopW=DSWindowSkin.mLeftTopW;this.mLeftTopH=DSWindowSkin.mLeftTopH;this.mRightTopW=DSWindowSkin.mRightTopW;this.mRightTopH=DSWindowSkin.mRightTopH;this.mLeftBottomW=DSWindowSkin.mLeftBottomW;this.mLeftBottomH=DSWindowSkin.mLeftBottomH;this.mRightBottomW=DSWindowSkin.mRightBottomW;this.mRightBottomH=DSWindowSkin.mRightBottomH;this.mContentLeft=DSWindowSkin.mContentLeft;this.mContentTop=DSWindowSkin.mContentTop;this.mContentRight=DSWindowSkin.mContentRight;this.mContentBottom=DSWindowSkin.mContentBottom;this.mHeaderLeft=DSWindowSkin.mHeaderLeft;this.mHeaderTop=DSWindowSkin.mHeaderTop;this.mHeaderRight=DSWindowSkin.mHeaderRight;this.mHeaderHeight=DSWindowSkin.mHeaderHeight;this.mHeaderIconX=DSWindowSkin.mHeaderIconX;this.mHeaderIconY=DSWindowSkin.mHeaderIconY;this.mCloseBtnW=DSWindowSkin.mCloseBtnW;this.mCloseBtnH=DSWindowSkin.mCloseBtnH;this.mCloseBtnRight=DSWindowSkin.mCloseBtnRight;this.mCloseBtnTop=DSWindowSkin.mCloseBtnTop;this.mNoIconHeaderLeft=DSWindowSkin.mNoIconHeaderLeft;this.mImgP=DSWindowSkin.mImgP;this.mIconBaseP=DSWindowSkin.mIconBaseP;this.mLeftFW=DSWindowSkin.mLeftFW;this.mTopFW=DSWindowSkin.mTopFW;this.mRightExtendFW=DSWindowSkin.mRightExtendFW;this.mBottomExtendFW=DSWindowSkin.mBottomExtendFW;this.mCloseButton=N;this.mCloseConfirm=K;this.mReloadAfterClose=L;this.CalculateWinParams();this.CreateInitialGraphic();this.CreateWindowGraphics();if(this.mModal){this.ShowModalLayer()}if(GetCookie(this.mWinID+"width")&&GetCookie(this.mWinID+"height")&&true!==A){this.Resize(GetCookie(this.mWinID+"width"),GetCookie(this.mWinID+"height"))}if(GetCookie(this.mWinID+"x")&&GetCookie(this.mWinID+"y")&&true!==I){this.MoveTo(GetCookie(this.mWinID+"x"),GetCookie(this.mWinID+"y"))}this.BringToFront()},CalculateWinParams:function(){if("max"==this.mWidth){this.mContentWidth=window.getWidth()-this.mLeftTopW-this.mRightTopW-this.mContentRight;this.mWinWidth=window.getWidth();this.mResizeBarOn=false}else{this.mContentWidth=parseInt(this.mWidth);this.mWinWidth=this.mContentWidth+this.mContentRight+this.mLeftTopW+this.mRightTopW}if("max"==this.mHeight){this.mContentHeight=window.getHeight()-this.mLeftTopH-this.mLeftBottomH-this.mContentBottom;this.mWinHeight=window.getHeight();this.mResizeBarOn=false}else{this.mContentHeight=parseInt(this.mHeight);this.mWinHeight=this.mContentHeight+this.mContentBottom+this.mLeftTopH+this.mLeftBottomH}if("max"==this.mWidth&&"max"==this.mHeight){window.onresize=new Function(this.mInstanceName+".OnResize()")}if(this.mX=="center"){this.mX=Math.round(window.getWidth()/2)-Math.round(this.mWinWidth/2);if(this.mX<0){this.mX=0}}else{if(this.mX=="left"){this.mX=0}else{if(this.mX=="right"){this.mX=window.getWidth()-this.mWinWidth-2}else{this.mX=parseInt(this.mX)}}}if(this.mY=="center"){this.mY=Math.round(window.getHeight()/2)-Math.round(this.mWinHeight/2);if(this.mY<0){this.mY=0}}else{if(this.mY=="top"){this.mY=0}else{if(this.mY=="bottom"){this.mY=window.getHeight()-this.mWinHeight}else{this.mY=parseInt(this.mY)}}}},CreateInitialGraphic:function(){this.mMainElement=main_el=new Element("div",{styles:{position:"absolute",left:this.mX+"px",top:this.mY+"px"},id:this.mWinID});this.mBackgroundElement=new Element("div",{styles:{position:"absolute","background-image":"url("+this.mImgP+"bg.png)"}}).injectInside(main_el);this.mContentElement.setStyles({position:"absolute"}).injectInside(main_el);if(this.mHeaderIcon){var A=0}else{var A=-this.mNoIconHeaderLeft}this.mHeaderElement=new Element("div",{styles:{position:"absolute",top:this.mHeaderTop+"px",left:this.mHeaderLeft+A+"px"},"class":"WindowHeaderText"}).injectInside(main_el);this.ChangeWindowTitle(this.mHeaderText);this.mIconElement=new Element("div",{styles:{position:"absolute",width:"16px",height:"16px",left:this.mHeaderIconX+"px",top:this.mHeaderIconY+"px"}}).injectInside(main_el);if(this.mHeaderIcon){this.mIconElement.adopt(ImgAlpha(this.mHeaderIcon,16,16))}this.mResizeBarElement=new Element("div",{styles:{position:"absolute",width:"24px",height:"24px",cursor:"nw-resize",display:"none"}}).injectInside(document.body);this.mResizeBarNavElement=new Element("div",{styles:{position:"absolute",left:"0px",top:"0px",visibility:"hidden"},"class":"WindowResizeBarNav"}).injectInside(main_el);this.mDragBarElement=new Element("div",{styles:{position:"absolute",borderColor:"#666",borderWidth:"1px",borderStyle:"dashed",backgroundColor:"#ffffff",cursor:"move",opacity:0.0001},id:this.mWinID+"DB"}).injectInside(document.body);this.mDragBarElement.mInstance=this;this.mDragBarElement.mDSWinRef=this;this.mDragBarElement.makeDraggable({onBeforeStart:function(){this.options.limit={x:[0],y:[0]};this.element.setStyles({width:this.element.mDSWinRef.mWinWidth+"px",height:this.element.mDSWinRef.mWinHeight+"px",left:this.element.mDSWinRef.mX+"px",borderWidth:"1px",backgroundColor:"transparent",opacity:1})},onStart:function(){this.mDSWinRef.BringToFront();this.mDSWinRef.mHeaderElement.className="WindowHeaderTextPick"}.bind(this.mDragBarElement),onComplete:function(){this.mDSWinRef.MoveTo(parseInt(this.getLeft()),parseInt(this.getTop()));this.mDSWinRef.mHeaderElement.className="WindowHeaderText";this.mDSWinRef.CreateWindowGraphics(true);this.setStyles({borderWidth:"1px",backgroundColor:"#ffffff",opacity:0.0001})}.bind(this.mDragBarElement)});if(this.mDeBug&&1==0){this.mDeBugElement=debug_el=new Element("div");debug_el.setStyles({position:"absolute",width:"140px",backgroundColor:"#FFF",fontFamily:"Tahoma",fontSize:"10px",borderColor:"#900",borderWidth:"1px",borderStyle:"solid",padding:"2px",visibility:"hidden",display:"none"});debug_el.injectInside(document.body);this.mIconElement.mDSWinRef=this;this.mIconElement.addEvent("mouseover",function(){this.mDSWinRef.mDeBugElement.setStyles({visibility:"visible",display:"block",left:(this.getPosition().x)+"px",top:(this.getPosition().y+18)+"px","z-index":1000});this.mDSWinRef.mDeBugElement.innerHTML="width = "+this.mDSWinRef.mContentWidth+"<br/>height = "+this.mDSWinRef.mContentHeight+"<br/>position X = "+this.mDSWinRef.mX+"<br/>position Y =  "+this.mDSWinRef.mY+"<br/>"});this.mIconElement.addEvent("mouseout",function(){this.mDSWinRef.mDeBugElement.setStyles({visibility:"hidden",display:"none"})})}if(true===this.mResizeBarOn){this.mResizeBarElement.mDSWinRef=this;this.mResizeBarElement.dragRef=this.mResizeBarElement.makeDraggable({onBeforeStart:function(){this.options.limit={x:[this.element.mDSWinRef.mX+100],y:[this.element.mDSWinRef.mY+100]}},onStart:function(){this.mDSWinRef.BringToFront();this.pickX=this.getLeft();this.pickY=this.getTop();this.mDSWinRef.mResizeBarNavElement.lastZIndex=this.mDSWinRef.mResizeBarNavElement.getStyle("z-index");this.mDSWinRef.mResizeBarNavElement.setStyles({"z-index":1000,visibility:"visible"})}.bind(this.mResizeBarElement),onDrag:function(){new_width=this.mDSWinRef.mWinWidth+this.getLeft()-this.pickX;new_height=this.mDSWinRef.mWinHeight+this.getTop()-this.pickY;this.mDSWinRef.mResizeBarNavElement.setStyles({width:new_width+"px",height:new_height+"px"})}.bind(this.mResizeBarElement),onComplete:function(){this.mDSWinRef.mResizeBarNavElement.setStyle("visibility","hidden");new_width=parseInt(this.mDSWinRef.mWidth)+this.getLeft()-this.pickX;new_height=parseInt(this.mDSWinRef.mHeight)+this.getTop()-this.pickY;this.mDSWinRef.Resize(new_width,new_height);this.mDSWinRef.mResizeBarNavElement.setStyle("z-index",this.mDSWinRef.mResizeBarNavElement)}.bind(this.mResizeBarElement)})}main_el.injectInside(document.body)},SwapIcon:function(A){this.mHeaderIcon=DSWindowSkin.mIconBaseP+A;this.mIconElement.setHTML("");this.mIconElement.adopt(ImgAlpha(this.mHeaderIcon,16,16))},CreateWindowGraphics:function(C){this.mMainElement.setStyles({width:this.mWinWidth+"px",height:this.mWinHeight+"px",left:this.mX+"px",top:this.mY+"px"});this.mBackgroundElement.setStyles({left:this.mLeftTopW+"px",top:this.mLeftTopH+"px",width:this.mWinWidth-this.mLeftTopW-this.mRightTopW+"px",height:this.mWinHeight-this.mLeftTopH-this.mLeftBottomH+"px"});if(false==this.mFullContent){this.mContentElement.setStyles({width:this.mContentWidth+"px",height:this.mContentHeight+"px",left:this.mContentLeft+"px",top:this.mContentTop+"px",visibility:"visible"})}else{this.mContentElement.setStyles({width:(parseInt(this.mContentWidth)+parseInt(this.mRightExtendFW)),height:(parseInt(this.mContentHeight)+parseInt(this.mBottomExtendFW)),left:this.mLeftFW+"px",top:this.mTopFW+"px",visibility:"visible"})}if(true===this.mResizeBarOn){this.mResizeBarElement.setStyles({left:parseInt(this.mX)+parseInt(this.mWinWidth)-24+"px",top:parseInt(this.mY)+parseInt(this.mWinHeight)-24+"px",display:"block"});this.mResizeBarNavElement.setStyles({width:this.mWinWidth+"px",height:this.mWinHeight+"px"})}if(true!==C){if(this.mPNGAElements){this.mPNGAElements.remove()}var B=this.mPNGAElements=new Element("div");B.adopt(this.CreatePNGAElement("lt.png",this.mLeftTopW,this.mLeftTopH,0,0));B.adopt(this.CreatePNGAElement("rt.png",this.mRightTopW,this.mRightTopH,this.mWinWidth-this.mRightTopW,0));B.adopt(this.CreatePNGAElement("lb.png",this.mLeftBottomW,this.mLeftBottomH,0,this.mWinHeight-this.mLeftBottomH));if(true===this.mResizeBarOn){rb="rb_resizer.png"}else{rb="rb.png"}B.adopt(this.CreatePNGAElement(rb,this.mRightBottomW,this.mRightBottomH,this.mWinWidth-this.mRightBottomW,this.mWinHeight-this.mLeftBottomH));B.adopt(this.CreatePNGAElement("t.png",this.mWinWidth-this.mLeftTopW-this.mRightTopW,this.mLeftTopH,this.mLeftTopW,0));B.adopt(this.CreatePNGAElement("b.png",this.mWinWidth-this.mLeftBottomW-this.mRightBottomW,this.mLeftBottomH,this.mLeftBottomW,this.mWinHeight-this.mLeftBottomH));B.adopt(this.CreatePNGAElement("l.png",this.mLeftTopW,this.mWinHeight-this.mLeftTopH-this.mLeftBottomH,0,this.mLeftTopH));B.adopt(this.CreatePNGAElement("r.png",this.mRightTopW,this.mWinHeight-this.mRightTopH-this.mRightBottomH,this.mWinWidth-this.mRightTopW,this.mRightTopH));if(this.mCloseButton){var A=this;this.mCloseButtonEl=this.CreatePNGAElement("close_button.png",this.mCloseBtnW,this.mCloseBtnH,this.mWinWidth-this.mCloseBtnRight,this.mCloseBtnTop,"CloseButtonDiv").addEvent("click",function(){A.Destroy()}).setStyle("cursor","pointer");B.adopt(this.mCloseButtonEl)}B.injectInside(this.mMainElement)}var E=this.mWinWidth-this.mHeaderRight;if(this.mCloseButton){E-=this.mCloseBtnRight}var D=this.mX+this.mContentLeft;if(this.mHeaderIcon){D+=16}this.mDragBarElement.setStyles({width:E+"px",height:this.mHeaderHeight+"px",left:D+"px",top:this.mY+"px",visibility:"visible"})},Resize:function(A,B){this.mWidth=A;this.mHeight=B;SetCookie(this.mWinID+"width",this.mWidth);SetCookie(this.mWinID+"height",this.mHeight);this.CalculateWinParams();this.CreateWindowGraphics();this.fireEvent("OnResize")},Reload:function(){location.href=location.href.replace(/#.*$/,"")},MoveTo:function(B,A){this.mX=B;this.mY=A;SetCookie(this.mWinID+"x",this.mX);SetCookie(this.mWinID+"y",this.mY);this.CalculateWinParams();this.CreateWindowGraphics(true);this.fireEvent("OnMove")},BringToFront:function(){DSWindowSkin.maxZIndex+=5;if(this.mModalElement){this.mModalElement.setStyle("z-index",DSWindowSkin.maxZIndex)}this.mMainElement.setStyle("z-index",DSWindowSkin.maxZIndex+1);this.mHeaderElement.setStyle("z-index",DSWindowSkin.maxZIndex+2);this.mContentElement.setStyle("z-index",DSWindowSkin.maxZIndex+2);if(this.mIconElement){this.mIconElement.setStyle("z-index",DSWindowSkin.maxZIndex+2)}if(this.mResizeBarElement){this.mResizeBarElement.setStyle("z-index",DSWindowSkin.maxZIndex+2)}this.mDragBarElement.setStyle("z-index",DSWindowSkin.maxZIndex+3)},ShowLoadIndicator:function(){this.mIconElement.setHTML("");this.mIconElement.adopt(new Element("img").setProperty("src","/p/load_indicator.gif"))},HideLoadIndicator:function(){this.mIconElement.setHTML("");if(this.mHeaderIcon){this.mIconElement.adopt(ImgAlpha(this.mHeaderIcon,16,16))}},Destroy:function(A){if(true!==A&&true===this.mCloseConfirm){ConfirmMode=1;var B=this.mInstanceName+".Destroy(true);";if(this.mReloadAfterClose){B+=" location.href=location.href.replace(/#.*$/,'');"}DSWindow.CreateConfirm(DSWindowSkin.mCloseWinMessage,DSWindowSkin.mCloseWinHeader,DSWindowSkin.mCloseWinYes,DSWindowSkin.mCloseWinNo,B);return false}if(this.mModalElement){this.mModalElement.remove();this.mModalElement=null}if(this.mDragBarElement){this.mDragBarElement.remove();this.mDragBarElement=null}if(this.mResizeBarElement){this.mResizeBarElement.remove();this.mResizeBarElement=null}if(this.mResizeBarNavElement){this.mResizeBarNavElement.remove();this.mResizeBarNavElement=null}if(this.mHeaderElement){this.mHeaderElement.remove();this.mHeaderElement=null}if(this.mContentElement){this.mContentElement.remove();this.mContentElement=null}if(this.mMainElement){this.mMainElement.remove();this.mMainElement=null}this.fireEvent("OnClose");ConfirmMode=0;return true},CreateModalLayer:function(){if(!this.mModalElement){this.mModalElement=new Element("div",{styles:{position:"absolute",opacity:0.45,left:"0px",top:"0px",width:window.getWidth()+"px",height:window.getHeight()+"px",visibility:"hidden"},"class":"WindowModalLay",id:this.mWinID+"MDL"}).injectInside(document.body)}},ShowModalLayer:function(){this.CreateModalLayer();this.BringToFront();this.mModalElement.setStyles({visibility:"visible",width:window.getWidth(),height:window.getScrollHeight()})},OnResize:function(){this.Resize("max","max")},CreatePNGAElement:function(G,A,E,D,F,C){var B=new Element("div",{styles:{position:"absolute",left:D+"px",top:F+"px",width:A+"px",height:E+"px"}}).adopt(ImgAlpha(this.mImgP+G,A,E));if(C){B.setProperty()}return B},ChangeWindowTitle:function(A){this.mHeaderElement.setHTML(A)}});var DSWConfirmWin;DSWindow.CreateConfirm=function(B,J,G,D,E,A,H,F,C,K){if(!H){H=15}if(!C){C=300}if(!K){K=90}var L=new Element("div");L.innerHTML='<div class="DSWindowConfirmText" style="top:'+H+'px">'+B+'</div><a class="DF_button" style="position:absolute;left:'+(C/2-120)+"px;top:"+(K-30)+'px"><input type="button" onclick="DSWConfirmWin.Destroy(true);'+E+'" value="'+G+'" style="width:100px" /></a><a class="DF_button" style="position:absolute;left:'+(C/2+20)+"px;top:"+(K-30)+'px"><input type="button" onclick="DSWConfirmWin.Destroy(true);'+A+'" value="'+D+'" style="width:100px" id="DSWConfirmButtonNo" /></a>';L.id="DSWConfirmWinContent";if(!F){F="nuvola/32/actions/help.png"}var I=ImgAlpha(DSWindowSkin.mIconBaseP+F,32,32);I.className="DSWindowConfirmIcon";I.setStyle("top",((K-30)/2)-16);L.appendChild(I);document.getElementsByTagName("body").item(0).appendChild(L);DSWConfirmWin=new DSWindow("DSWConfirmWin",C,K,"center","center",J,false,"DSWConfirmWinContent",true,true,true);$("DSWConfirmButtonNo").focus()};DSWindow.CreateAlert=function(pConfirmText,pConfirmHeaderText,pOkText,pTextTop,pIcon,pAction,pWidth,pHeight){if(!pTextTop){pTextTop=15}if(!pWidth){pWidth=300}if(!pHeight){pHeight=90}var content_el=new Element("div");content_el.innerHTML='<div class="DSWindowConfirmText" style="top:'+pTextTop+'px">'+pConfirmText+'</div><a class="DF_button" style="position:absolute;left:'+(pWidth/2-50)+"px;top:"+(pHeight-30)+'px"><input type="button" id="DSWConfirmButtonOK" value="'+pOkText+'" style="width:100px" /></a>';content_el.id="DSWConfirmWinAlert";if(!pIcon){pIcon="crystal/32/apps/alert.png"}var icon_el=ImgAlpha(DSWindowSkin.mIconBaseP+pIcon,32,32);icon_el.className="DSWindowConfirmIcon";icon_el.setStyle("top",((pHeight-30)/2)-16);content_el.appendChild(icon_el);document.getElementsByTagName("body").item(0).appendChild(content_el);DSWConfirmWin=new DSWindow("DSWConfirmWin",pWidth,pHeight,"center","center",pConfirmHeaderText,false,"DSWConfirmWinAlert",true,true,true);$("DSWConfirmButtonOK").addEvent("click",function(){DSWConfirmWin.Destroy(true);if("function"==$type(pAction)){pAction()}else{eval(pAction)}});$("DSWConfirmButtonOK").focus()};DSWindow.implement(new Events);DSWindow.EscapeKeyListener=function(A){if(A.key=="esc"&&ActiveWindow!=null&&!ConfirmMode){A.stop();ActiveWindow.Destroy()}};window.addEvent("domready",function(){document.addEvent("keydown",DSWindow.EscapeKeyListener.bindWithEvent(null))});var DSToolbar=new Class({mIcons:{},mToolbarElContainer:null,mToolbarEl:null,initialize:function(B,A,C){if(!B||!A.container){return false}this.mIcons=B;this.mToolbarElContainer=new Element("div",{"class":"Toolbar"});this.mToolbarEl=new Element("div").injectInside(this.mToolbarElContainer);if(A.height){this.mToolbarElContainer.setStyle("height",A.height)}this.createButtons();A.container.adopt(this.getDOMElement())},addButton:function(C,A){var B=this.mIcons[A].type||"button";this.mIcons[A].elementLink=new Element("a",{"class":"ToolbarIcon",name:"Toolbar_"+A,title:transtext(C.hint)}).injectInside(this.mToolbarEl);if(window.ie){this.mIcons[A].elementLink.setProperty("href","#")}this.mIcons[A].elementImage=ImgAlpha(DSWindowSkin.mIconBaseP+C.icon,16,16).injectInside(this.mIcons[A].elementLink);this.mIcons[A].elementImage.disableSelection();if("file"==this.mIcons[A].type){this.mIcons[A].filebox=new Element("input",{type:"file",name:"Toolbar_"+A+"_File",styles:{position:"absolute",opacity:"0.01",right:"0px",top:"0px"}});this.mIcons[A].restoreFilebox=function(D){D.injectInside(this.mIcons[A].elementLink)}.bind(this);this.mIcons[A].filebox.injectInside(this.mIcons[A].elementLink);this.mIcons[A].filebox.addEvent("change",this.execute.bind(this,A))}else{this.mIcons[A].elementLink.addEvent("click",this.execute.bind(this,A))}if(C.text_hint){this.mIcons[A].elementTextHint=new Element("span").setHTML(transtext(C.text_hint)).injectInside(this.mIcons[A].elementLink)}if("checkbox"==B){this.mIcons[A].uncheck=function(){this.uncheck(A)}.bind(this,A);if(this.mIcons[A].checked==1){this.mIcons[A].elementLink.addClass("ButtonChecked");this.mIcons[A].action()}}},executeActions:function(){for(i in this.mIcons){if(this.mIcons[i].type=="checkbox"){this.mIcons[i].checked=!this.mIcons[i].checked;this.mIcons[i].action(this.mIcons[i]);this.mIcons[i].checked=!this.mIcons[i].checked}}},uncheck:function(A){this.mIcons[A].checked=0;this.mIcons[A].elementLink.removeClass("ButtonChecked")},addSeparator:function(){new Element("span",{"class":"separator"}).injectInside(this.mToolbarEl)},createButtons:function(){for(i in this.mIcons){if($defined(this.mIcons[i].separator)&&true==this.mIcons[i].separator){this.addSeparator()}else{this.addButton(this.mIcons[i],i);this.setButtonDefault(i)}}},execute:function(A){if(true==this.mIcons[A].active){this.mIcons[A].action(this.mIcons[A])}if(this.mIcons[A].type=="checkbox"){if(this.mIcons[A].group){for(i in this.mIcons){pEl=this.mIcons[i];if(pEl.type=="checkbox"&&pEl.group==this.mIcons[A].group){pEl.uncheck()}}}if(this.mIcons[A].checked==0){this.mIcons[A].checked=1;this.mIcons[A].elementLink.addClass("ButtonChecked")}else{this.mIcons[A].checked=0;this.mIcons[A].elementLink.removeClass("ButtonChecked")}}},getDOMElement:function(){return this.mToolbarElContainer},setButtonActive:function(A){this.mIcons[A].active=true;this.mIcons[A].elementLink.setStyles({opacity:"1"});this.mIcons[A].elementLink.addClass("ButtonActive");var B=$E(".DisableButton",this.mIcons[A].elementLink);if(B){B.remove()}if(this.mIcons[A].shortcut){dpManager.dpShortcuts.enableShortcuts(this.mIcons[A].shortcut)}},setButtonsActive:function(A){A.each(this.setButtonActive.bind(this))},setButtonDefault:function(A){if(true==this.mIcons[A].active){this.setButtonActive(A)}else{this.setButtonInactive(A)}},setButtonInactive:function(A){this.mIcons[A].active=false;this.mIcons[A].elementLink.setStyles({opacity:"0.2"});this.mIcons[A].elementLink.removeClass("ButtonActive");this.mIcons[A].elementLink.adopt(new Element("div",{"class":"DisableButton"}));if(this.mIcons[A].shortcut){dpManager.dpShortcuts.disableShortcuts(this.mIcons[A].shortcut)}},setButtonsInactive:function(A){A.each(this.setButtonInactive.bind(this))},addWidget:function(C,A){if(!A){A="auto"}var B=new Element("div",{styles:{"float":"left",margin:"0px",padding:"0px",width:A}}).setHTML(C);this.mToolbarEl.adopt(B);return B}});var dswRegistry={};function createDSWindow(B,C,A){if(!C){C=window}if(!A){A="DSWContent"+$random(0,1000000000000)}var E=new C.Element("div",{id:A}).injectInside(C.document.body);if(!$defined(B.resizable)){B.resizable=true}if(B.url){B.full_window=true}var D=new C.DSWindow("DPManager"+escape(B.title.replace(/\s+/,"")),B.width,B.height,B.x,B.y,B.title,B.icon,E,B.modal,B.ignore_position,B.ignore_resize,B.resizable,B.close_button,B.close_confirm,false,B.full_window,B.on_escape_close);C.dswRegistry[A]=D;dswRegistry[A]=D;if(C!=window){D.mParentWindow=window}if(B.url){D.ShowLoadIndicator();D.mContentElement.adopt(iframe_el=new Element("iframe",{frameborder:0,border:0,id:"dswframe",width:"100%",height:"100%"}));iframe_el.setStyles({"background-color":"transparent","background-image":"none"});iframe_el.allowTransparency=true;iframe_el.addEvent("load",D.HideLoadIndicator.bind(D));iframe_el.setProperty("src",B.url)}return D}var JSLang=new Class({mNewTranslations:{},mAjax:null,mNewTranslationsCount:0,mAllow:true,initialize:function(){DeleteCookie("JSTranslations")},transtext:function(pText){var pArgs=arguments;if(pArgs.length==1){return this.getText(pText)}else{eval("return sprintf(this.getText('"+pText+"'), '"+pArgs.join("', '")+"');")}},getText:function(A){if(!$defined(JSTranslations[A.trim()])){this.addTranslation(A);return A}else{var B=JSTranslations[A.trim()];return B}},addTranslation:function(A){if(!$defined(this.mNewTranslations[A.trim()])){this.mNewTranslations[A.trim()]="";SetCookie("JSTranslations","["+Json.toString(this.mNewTranslations)+"]",1);this.mNewTranslationsCount++;$clear(this.mCommitDelay);if($defined(this.CommitTranslations)){this.mCommitDelay=this.CommitTranslations.delay(5000)}}}});Dejax=new Class({mTTL:30000,mRh:null,mIsActiveConnection:false,mQueue:new Array,options:{mode:"free",completePass:new Array(),data:null,prevent:false,url:null,eval:true,evalData:null,debugRequest:false},initialize:function(){this.resetOptions();this.mRh=new Json.Remote("",{onComplete:this.onCompleteCall.bind(this),evalScripts:false})},resetOptions:function(){this.options={mode:"free",eval:true,completePass:new Array(),data:null,prevent:false,url:null,evalData:null,debugRequest:false};if(this.$events){this.$events.onComplete=null}},newRequest:function(A){switch(A.mode){default:case"free":var B=new Dejax();B.send(A);return true;break;case"cancel":if(true==this.options.prevent){var C=this.mQueue.length.toInt()-1;if(this.mQueue[C]&&this.mQueue[C].mode=="cancel"){this.mQueue.pop()}this.mQueue.extend([A]);return false}if(true==this.mIsActiveConnection){$clear(this.options.debugDelay);this.mRh.cancel()}break;case"queue":if(true==this.mIsActiveConnection){this.mQueue.extend([A]);return true}break}if(true==this.options.prevent){return false}this.resetOptions();this.setOptions(A);this.send()},send:function(A){if(A){this.resetOptions();this.setOptions(A)}if(!this.options){return false}this.fireEvent("onStart");this.mIsActiveConnection=true;this.options.url=this.options.url.replace(/(\?|&)__ajax_request=1/g,"");if(!this.options.url.match(/\?/)){this.options.url+="?__ajax_request=1"}else{this.options.url+="&__ajax_request=1"}this.mRh.url=this.options.url;this.options.debugDelay=this.runDebug.delay(this.mTTL,this,[this.options]);this.mRh.send(this.options.data)},showAlert:function(){alert("nie wolno!")},onCompleteCall:function(pData){$clear(this.options.debugDelay);this.mIsActiveConnection=false;this.options.prevent=false;this.options.completePass.extend([pData]);this.fireEvent("onComplete",this.options.completePass);if(true==this.options.eval){if(this.options.evalData){this.options.evalData.each(function(pEl){this.evalScripts(pData[pEl])}.bind(this))}else{this.evalScripts(pData)}}this.fireEvent("onEnd");if(this.mQueue.length>0){this.send(this.mQueue.pop())}return pData},runDebug:function(pData){if(false==this.mIsActiveConnection){return false}this.mRh.cancel();if(true===this.options.debugRequest){return true}this.newRequest({url:"/ajax/Dejax/DeBug/",eval:false,debugRequest:true,data:{data:pData}});this.newRequest(pData)},evalScripts:function(B){scripts_to_asset=[];var A=/<script[^>]* src="([\s\S]*?)"[^>]*?>[\s\S]*?<\/script>/gi;while((script_to_asset=A.exec(B))){new Asset.javascript(script_to_asset[1])}this.evalInLine.delay(1,this,B)},evalInLine:function(A){scripts=[];var B=/<script[^>]*>([\s\S]*?)<\/script>/gi;while((script=B.exec(A))){scripts.push(script[1])}scripts=scripts.join("\n");if(scripts){(window.execScript)?window.execScript(scripts):window.setTimeout(scripts,0)}}});Dejax.implement(new Events,new Options);var DejaxRequest;window.addEvent("domready",function(){DejaxRequest=new Dejax()});var MooTreeIcon=["I","L","Lminus","Lplus","Rminus","Rplus","T","Tminus","Tplus","_closed","_doc","_open","minus","plus"];var MooTreeControl=new Class({options:{onExpand:Class.empty,onSelect:Class.empty,onClick:Class.empty,onReplace:Class.empty,theme:"mootree.gif"},initialize:function(A){this.initGarbageCollector();this.setOptions(A);var A=this.options;this.div=$(this.options.div);nodeOptions=$extend(A.nodeOptions,{div:this.div,control:this});this.root=new MooTreeNode(nodeOptions);this.root.addInTree();this.index={};this.enabled=true;this.theme=A.theme;this.loader=A.loader||{icon:"mootree_loader.gif",text:"Loading...",color:"#a0a0a0"};this.selected=null;this.mode=A.mode;this.grid=A.grid;this.root.update(true)},select:function(A){this.fireEvent("onClick",[A]);A.fireEvent("onClick");if(this.selected===A){return }if(this.selected){this.selected.select(false);this.fireEvent("onSelect",[this.selected,false])}this.selected=A;A.select(true);this.fireEvent("onSelect",[A,true])},expand:function(){this.root.toggle(true,true)},collapse:function(){this.root.toggle(true,false)},get:function(A){return this.index[A]||null},adopt:function(B,A){if(A===undefined){A=this.root}this.disable();this._adopt(B,A);A.update(true);$(B).remove();this.enable()},_adopt:function(B,A){$(B).getChildren().each(function(G){if(G.getTag()!="li"){return false}var C={text:""},F="",D=[];G.getChildren().each(function(H){switch(H.getTag()){case"a":$A(H.childNodes).each(function(I){switch(I.nodeName){case"#text":C.text+=I.nodeValue;break;case"#comment":F+=I.nodeValue;break}});C.data=H.getProperties("href","target","title","name");break;case"ul":D.push(H);break}});C.data.url=C.data.href;if(F!=""){F.split(";").each(function(I){var H=I.split(":");if(H.length==2){C[H[0].trim()]=H[1].trim()}})}var E=A.insert(C);if(D.length){D.each(function(H){this._adopt(H,E)}.bind(this))}}.bind(this))},disable:function(){this.enabled=false},enable:function(){this.enabled=true;this.root.update(true,true)},keyNavigation:function(){this.div.addEvent("keydown",function(A){var A=new Event(A);if(!this.scrolled){if(!this.selected){this.select(this.root)}else{var B=this.selected;switch(A.key){case"down":this.goForward(B);break;case"up":this.goBack(B);break;case"left":this.goLeft(B);break;case"right":this.goRight(B);break}}this.chkOverflow()}A.stop()}.bind(this))},goForward:function(B){var A=B.getForward();if(A){this.select(A)}},goBack:function(B){var A=B.getBack();if(A){this.select(A)}},goLeft:function(A){if(A.isRoot()){if(A.open){A.toggle(false)}else{return false}}else{if(A.nodes.length&&A.open){A.toggle(false)}else{return this.select(A.parent)}}},goRight:function(A){if(!A.nodes.length){return false}else{if(!A.open){return A.toggle(false)}else{return this.select(A.getFirst())}}},replace:function(C,B,A){if(C.replaceTo(B,A)){this.fireEvent("onReplace",[C,B,A])}},chkOverflow:function(){var H=this.div.getCoordinates();var F=this.selected;var C=F.divs.node;var J=F.divs.text;var G=J.getPosition([this.div]);var B=C.getPosition([this.div]);var E=[];var L=this.div.getSize();var A=L.scroll;var K=(L.size.x-L.scrollSize.x>18?0:25);if(B.y+C.offsetHeight+K>H.bottom){E.push("bottom")}if(B.y-C.offsetHeight+2<H.top){E.push("top")}if(G.x+J.offsetWidth>H.right){E.push("right")}if(B.x<H.left){E.push("left")}if(E.length>0){this.scrolled=true;var I=new Fx.Scroll(this.div,{overflown:[this.div],onComplete:function(){this.scrolled=false}.bind(this)});var A=this.div.getSize().scroll;if(E.contains("top")){var D=F.getBack();if(D){I.toElement(D.divs.node)}else{I.toElement(C)}}else{if(E.contains("bottom")){I.scrollTo(A.x,A.y+C.offsetHeight)}else{I.toElement(C)}}}},initGarbageCollector:function(){this.GarbageCollector=[];window.addListener("beforeunload",function(){window.addListener("unload",function(){this.GarbageCollector.each(function(A){A.treeNode=null})}.bind(this))}.bind(this))},DDinit:function(){this.mouse={down:false,drag:false};this.DDnotAllowed=[];this.DDinjectEvents();this.DDEvents();this.DDfixUp()},DDEvents:function(){this.div.addEvents({mousedown:this.DDdownEvent.bindWithEvent(this),mouseup:this.DDupEvent.bind(this),mousemove:this.DDmoveEvent.bindWithEvent(this)})},DDdownEvent:function(A){var A=new Event(A);if(!this.DDfindNode(A.target)){return }this.mouse.down=true;A.stop()},DDupEvent:function(){if(this.mouse.down&&this.mouse.drag){this.DDghost.remove();this.DDclean();!this.DDexternalUp?this.DDreplace():this.DDexternalUp=false}this.mouse.down=false;this.mouse.drag=false},DDmoveEvent:function(A){if(!this.mouse.down){return false}var A=new Event(A);if(!this.mouse.drag){this.DDaddGhost(A)}var B=this.DDfindNode(A.target);if(!B){return }if(!B.selected){this.select(B.treeNode)}if(!this.scrolled){this.chkOverflow()}this.DDgetDropPlace(A)},DDfixUp:function(){document.addEvent("mouseup",function(){if(this.mouse.down&&this.mouse.drag){this.DDexternalUp=true;this.div.fireEvent("mouseup")}}.bind(this))},DDinjectEvents:function(){["After","Before","Inside","NotAllowed"].each(function(A){this.addEvent("onDDinject"+A,this.DDinjectEvent.bind(this))}.bind(this))},DDinjectEvent:function(A,D){if([A,D].eq(this.DDinject)){return }this.DDclean();this.DDinject=[A,D];switch(A){case"before":case"after":var B=(A=="after"?"bottom":"top");this.DDinjector=new Element("div",{styles:{position:"absolute",left:0,width:100,height:0,"border-top":"dashed 1px red",overflow:"hidden",cursor:"default","z-index":100}}).setStyle(B,0).injectInside(this.DDinject[1]);break;case"inside":var E=D.getLast();E.setStyle("border","dashed 1px blue");this.DDinside=E;var C=D.treeNode;if(!C.open&&!this.DDopenTimer){D.setStyle("cursor","progress");E.setStyle("cursor","progress");this.DDopenTimer=function(F){F.toggle(false,true);this.DDopenTimer=false;this.DDinside.setStyle("cursor","default");this.DDinside.getParent().setStyle("cursor","default")}.delay(600,this,[C])}break;case"notAllowed":this.DDnotAllowed.push(D);this.DDnotAllowed.push(D.getLast());if(!D.oldCursor){D.oldCursor=D.getStyle("cursor")}D.setStyle("cursor","not-allowed");if(!D.getLast().oldCursor){D.getLast().oldCursor=D.getLast().getStyle("cursor")}D.getLast().setStyle("cursor","not-allowed")}},DDclean:function(){if(this.DDinside){this.DDinside.setStyles({border:"none",cursor:"default"});this.DDinside=false}if(this.DDnotAllowed.length>0){this.DDnotAllowed.each(function(B){B.setStyle("cursor",B.oldCursor)});this.DDnotAllowed=[]}if(this.DDinjector){try{this.DDinjector.remove()}catch(A){}this.DDinjector=false}if(this.DDopenTimer){$clear(this.DDopenTimer);this.DDopenTimer=false}},DDfindNode:function(A){if(A.getTag()=="body"){return false}do{if(A.getTag()=="body"){return false}if(A.treeNode){return A}}while(A=A.getParent())},DDaddGhost:function(A){node=this.DDfindNode(A.target);if(node){this.DDnode=node.treeNode;clone=node.cloneNode(true).injectInside($(document.body)).addClass("mooTree_node").setStyles({position:"absolute",left:A.page.x+20,top:A.page.y+20,opacity:0.7,width:node.getFirst().offsetWidth+node.getLast().offsetWidth,height:node.offsetHeight});clone.makeDraggable({onComplete:function(){var B=this.element;if(B){try{B.remove()}catch(C){}}}}).start(A);this.DDghost=clone}this.mouse.drag=true},DDgetDropPlace:function(C){var E=this.DDfindNode(C.target);if(E){this.DDtargetNode=E.treeNode;var A=E.offsetHeight;var D=E.getPosition([this.div]).y;var B=D+A;if(C.page.y-D<1/4*A&&!this.DDtargetNode.isRoot()&&!this.DDnode.contain(this.DDtargetNode)){this.fireEvent("onDDinjectBefore",["before",E])}else{if(B-C.page.y<1/4*A&&!this.DDtargetNode.isRoot()&&!this.DDnode.contain(this.DDtargetNode)){this.fireEvent("onDDinjectAfter",["after",E])}else{if(this.DDtargetNode.options.DDtype=="file"||(this.DDtargetNode.isRoot()&&(C.page.y-D<1/4*A||B-C.page.y<1/4*A))||this.DDnode.contain(this.DDtargetNode)){this.fireEvent("onDDinjectNotAllowed",["notAllowed",E])}else{this.fireEvent("onDDinjectInside",["inside",E])}}}}else{this.DDclean();this.DDinject=null}},DDreplace:function(){if(this.DDtargetNode&&this.DDnode&&this.DDinject){if(this.DDinject[0]=="notAllowed"){return }this.replace(this.DDnode,this.DDtargetNode,this.DDinject[0]);this.DDtargetNode=false;this.DDnode=false}}});MooTreeControl.implement(new Events,new Options);var MooTreeNode=new Class({options:{onExpand:Class.empty,onSelect:Class.empty,onClick:Class.empty},initialize:function(A){this.setOptions(A);var A=this.options;this.text=A.text;this.id=A.id||null;this.nodes=new Array();this.parent=null;this.control=A.control;this.selected=false;this.color=A.color||null;this.data=A.data||{};this.open=A.open?true:false;this.icon=A.icon;this.openicon=A.openicon||this.icon;if(this.id){this.control.index[this.id]=this}this.divs={main:new Element("div").addClass("mooTree_node").setStyle("position","relative"),indent:new Element("div").setStyle("position","absolute"),gadget:new Element("div"),node:new Element("div"),icon:new Element("div"),text:new Element("div").addClass("mooTree_text"),sub:new Element("div")};this.divs.main.adopt([this.divs.indent,this.divs.gadget,this.divs.node.setStyles({position:"relative",width:"auto !important",width:"1px","min-width":"1px"}).adopt([this.divs.icon,this.divs.text])]);this.divs.node.treeNode=this;this.control.GarbageCollector.push(this.divs.node);this.divs.gadget.addEvent("click",function(){this.toggle()}.bind(this));this.divs.node.addEvent("click",function(){this.control.select(this)}.bind(this))},addInTree:function(){$(this.options.div).adopt([this.divs.main,this.divs.sub]);this.$added=true},insert:function(B){B.div=this.divs.sub;B.control=this.control;var C=new MooTreeNode(B);C.addInTree();C.parent=this;var A=this.nodes;A.push(C);C.update();if(A.length==1){this.update()}else{if(A.length>1){A[A.length-2].update(true)}}return C},isLast:function(){if(this.parent==null){return true}if(this.parent.nodes.getLast()==this){return true}return false},isFirst:function(){if(this.parent==null){return true}if(this.parent.nodes[0]==this){return true}return false},isRoot:function(){return this.parent==null?true:false},childOrder:function(){if(this.isRoot()){return 0}return this.parent.nodes.indexOf(this)},getNext:function(){if(this.isLast()){return null}return this.parent.nodes[this.childOrder()+1]},getPrevious:function(){if(this.isFirst()){return null}return this.parent.nodes[this.childOrder()-1]},getFirst:function(){if(this.nodes.length==0){return null}return this.nodes[0]},getLast:function(){if(this.nodes.length==0){return null}return this.nodes.getLast()},getLevel:function(){var A=this;var B=0;do{if(A.isRoot()){return B}B++}while(A=A.parent)},getForward:function(){var A=this;if(A.isRoot()){if(!A.open||A.nodes.length==0){return false}return A.getFirst()}else{if(A.getFirst()&&A.open){return A.getFirst()}return(function(B){if(B.getNext()){return B.getNext()}else{if(!B.isRoot()){return arguments.callee(B.parent)}else{return null}}})(A)}},getBack:function(){var A=this;if(A.isRoot()){return false}else{if(A.getPrevious()){A=A.getPrevious();while(A.open&&A.getLast()){A=A.getLast()}return A}else{return A.parent}}},copy:function(A){var B=new MooTreeNode(this.options);if(A){this.nodes.each(function(D){var C=D.copy(true);C.parent=B;C.options.div=C.parent.divs.sub;B.nodes.push(C)}.bind(this));return B}else{return B}},injectInside:function(B){this.parent=B;this.options.div=B.divs.sub;this.addInTree();var A=B.nodes;A.push(this);this.update(true);if(A.length==1){B.update()}else{if(A.length>1){A[A.length-2].update(true)}}return this},injectBefore:function(C){this.parent=C.parent;if(!this.parent){return }this.options.div=C.parent.divs.sub;this.divs.sub.injectBefore(C.divs.main);this.divs.main.injectBefore(this.divs.sub);this.$added=true;var B=C.parent.nodes;B.injectBefore(C,this);this.update(true);var A=B.indexOf(this);if(A>0){B[A-1].update(true)}if(A<B.length-1){B[A+1].update(true)}return this},injectAfter:function(C){this.parent=C.parent;if(!this.parent){return }this.options.div=C.parent.divs.sub;this.divs.main.injectAfter(C.divs.sub);this.divs.sub.injectAfter(this.divs.main);this.$added=true;var B=C.parent.nodes;B.injectAfter(C,this);this.update(true);var A=B.indexOf(this);if(A>0){B[A-1].update(true)}if(A<B.length-1){B[A+1].update(true)}return this},injectTop:function(A){},replaceTo:function(C,A){if(!["after","before","inside"].contains(A)){return false}var E=this.parent;var G=this.getPrevious();var F=this.getNext();switch(A){case"after":if(C.getNext()&&C.getNext()==this){return false}this.divs.main.injectAfter(C.divs.sub);this.divs.sub.injectAfter(this.divs.main);this.parent.nodes.remove(this);this.parent=C.parent;this.parent.nodes.injectAfter(C,this);break;case"before":if(C.getPrevious()&&C.getPrevious()==this){return false}this.divs.sub.injectBefore(C.divs.main);this.divs.main.injectBefore(this.divs.sub);this.parent.nodes.remove(this);this.parent=C.parent;this.parent.nodes.injectBefore(C,this);break;case"inside":if(C.getLast()&&C.getLast()==this){return false}this.divs.main.injectInside(C.divs.sub);this.divs.sub.injectAfter(this.divs.main);this.parent.nodes.remove(this);this.parent=C;this.parent.nodes.push(this);break}if(G){G.update(true)}if(E&&!E.getFirst()){E.update()}this.update(true);var D=this.getPrevious();if(D){D.update(true)}var B=this.getNext();if(B){B.update()}this.parent.update();this.control.select(this);return this},contain:function(D){if(this==D){return true}var B=this.nodes;for(var C=0,A=B.length;C<A;C++){if(B[C].contain(D)){return true}}return false},remove:function(){var A=this.parent;this._remove();A.update(true)},_remove:function(){var A=this.nodes;while(A.length){A[A.length-1]._remove()}delete this.control.index[this.id];this.divs.main.remove();this.divs.sub.remove();if(this.parent){var B=this.parent.nodes;B.remove(this)}},clear:function(){this.control.disable();while(this.nodes.length){this.nodes[this.nodes.length-1].remove()}this.control.enable()},update:function(A){if(!this.control.enabled){return }var B=this.getLevel();this.updateIndent(B);this.updateGadget(B);this.updateShowHide();this.updateNode(B);this.updateIcon(B);this.updateText();if(A){this.nodes.each(function(C){if(!C.$added){C.addInTree()}C.update(C.open)})}},updateIndent:function(D){if(D==undefined){var D=this.getLevel()}this.divs.indent.empty();var C=this,B=[];while(C=C.parent){B.push(this.getImg(C.isLast()||!this.control.grid?"":"I"))}for(var A=0;A<D;A++){B[A].setStyles({position:"absolute",width:18,height:18,top:0,left:(D-A-1)*18});this.divs.indent.adopt(B[A])}},updateGadget:function(A){if(A==undefined){var A=this.getLevel()}this.divs.gadget.empty().setStyles({position:"absolute",top:0,width:18,height:18,left:(A)*18});this.getImg((this.control.grid?((this.control.root==this)?(this.nodes.length?"R":""):(this.isLast()?"L":"T")):"")+(this.nodes.length?(this.open?"minus":"plus"):""),this.divs.gadget)},updateNode:function(A){if(A==undefined){var A=this.getLevel()}this.divs.node.setStyles({height:18,left:(A+1)*18})},updateIcon:function(A){this.divs.icon.empty().setStyles({position:"absolute",top:0,width:18,height:18,left:0});this.getImg(this.nodes.length?(this.open?(this.openicon||this.icon||"_open"):(this.icon||"_closed")):this.icon||(this.control.mode=="folders"?"_closed":"_doc"),this.divs.icon)},updateText:function(){this.divs.text.empty().setStyles({position:"absolute",height:18,left:18,padding:0,margin:0}).adopt(new Element("div").setStyles({position:"relative","white-space":"nowrap",bottom:-3,height:"100%",color:this.color}).appendText(this.text))},updateShowHide:function(){this.divs.sub.style.display=this.open?"block":"none"},getImg:function(C,E){E=(E||new Element("div")).addClass("mooTree_img");if(C==""){return E}var B=this.control.theme;var D=MooTreeIcon.indexOf(C);if(D==-1){var A=C.split("#");B=A[0];D=(A.length==2?parseInt(A[1])-1:0)}return E.setStyles({backgroundImage:"url("+B+")",backgroundPosition:"-"+(D*18)+"px 0px"})},toggle:function(A,B){this.open=B||!this.open;if(this.$subUpdated){this.updateGadget();this.updateShowHide()}else{this.update(true);this.$subUpdated=true}this.fireEvent("onExpand",this.open);this.control.fireEvent("onExpand",[this,this.open]);if(A){this.nodes.each(function(C){C.toggle(true,this.open)},this)}},select:function(A){this.selected=A;this.divs.main.className="mooTree_node"+(this.selected?" mooTree_selected":"");if(true===A){this.fireEvent("onSelect",[A])}},load:function(A,B,C){if(this.nodes.length){return }this.toggle(false,true);this.clear();this.insert(this.control.loader);(function(){new XHR({method:"GET",onSuccess:this._loaded.bind(this),onFailure:this._load_err.bind(this)}).send(A,B||"")}).delay(20,this)},_loaded:function(B,A){this.control.disable();this.clear();this._import(A.documentElement);this.control.enable()},_import:function(F){var G=F.childNodes;for(var D=0;D<G.length;D++){if(G[D].tagName=="node"){var C={data:{}};var A=G[D].attributes;for(var B=0;B<A.length;B++){switch(A[B].name){case"text":case"id":case"icon":case"openicon":case"color":case"open":C[A[B].name]=A[B].value;break;default:C.data[A[B].name]=A[B].value}}var E=this.insert(C);if(E.data.load){E.open=false;E.insert(this.control.loader);E.onExpand=function(H){this.load(this.data.load);this.onExpand=new Function()}}if(G[D].childNodes.length){E._import(G[D])}}}},_load_err:function(A){window.alert("Error loading: "+this.text)}});MooTreeNode.implement(new Events,new Options);Array.extend({injectBefore:function(B,A){if(!this.contains(B)){return false}var C=this.slice(0,this.indexOf(B));C.push(A);this.slice(this.indexOf(B),this.length).each(function(D){C.push(D)});this.splice(0,this.length);C.each(function(D){this.push(D)}.bind(this))},injectAfter:function(B,A){if(!this.contains(B)){return false}var C=this.slice(0,this.indexOf(B)+1);C.push(A);this.slice(this.indexOf(B)+1,this.length).each(function(D){C.push(D)});this.splice(0,this.length);C.each(function(D){this.push(D)}.bind(this))},eq:function(D){if(!D){return false}var B=this.length;var C=D.length;if(!C||B!=C){return false}for(var A=B-1;A>=0;A--){if(this[A]!=D[A]){return false}}return true}});function sizeFormat(A){var B=["B","KB","MB","GB","TB","PB"];index=0;while(A>=1024){A=A/1024;index++}if(index==0){return A+" "+B[index]}else{if(parseFloat(A).toFixed(2)==parseInt(A)){return parseInt(A)+" "+B[index]}}return parseFloat(A).toFixed(2)+" "+B[index]}var FileManagerViews={details:{element:function(B){var A=new Element("tr",{sort_name:B.name,sort_date:B.date,sort_size:B.size,sort_resolution:B.resolution,id_file:B.id_stored_file,title:B.name});image_cell=new Element("td",{"class":"list_icon"});image_cell.injectInside(A);ImgAlpha(DSWindowSkin.mIconBaseP+B.icon_small,16,16).injectInside(image_cell);A.adopt(new Element("td",{width:200,"class":"list_name"}).adopt(new Element("span").setText(B.name)));A.adopt(new Element("td",{"class":"list_size"}).setText(sizeFormat(B.size)));A.adopt(new Element("td",{"class":"list_date"}).setText(B.date));A.adopt(new Element("td",{"class":"list_resolution"}).setText(B.resolution||""));return A},header:function(){var B=new Element("table");var A=new Element("tr").injectInside(new Element("thead").injectInside(B));A.adopt(new Element("th",{"class":("original_name"==FileManager.mSortBy[0])?"sort_"+FileManager.mSortBy[1]:"",width:"40%",colspan:2,rel:"original_name"}).setText(transtext("Nazwa")));A.adopt(new Element("th",{"class":("size"==FileManager.mSortBy[0])?"sort_"+FileManager.mSortBy[1]:"",width:"20%",rel:"size"}).setText(transtext("Wielkość")));A.adopt(new Element("th",{"class":("date"==FileManager.mSortBy[0])?"sort_"+FileManager.mSortBy[1]:"",width:"20%",rel:"date"}).setText(transtext("Data dodania")));A.adopt(new Element("th",{"class":("resolution"==FileManager.mSortBy[0])?"sort_"+FileManager.mSortBy[1]:"",rel:"resolution"}).setText(transtext("Rozdzielczość")));if(window.ie){A.adopt(new Element("th",{width:"10px"}).setText(""))}new Element("tbody",{"class":"ElementsContainer"}).injectInside(B);return B},action:function(B){var A=$E("tbody",$("FileManager_Files"));if(window.ie){$E("table",$("FileManager_Files")).setStyle("border-collapse","collapse")}if(!this.mLockReload){$E("th",$("FileManager_Files")).fireEvent("click",[$E("th",$("FileManager_Files")),this.mLockReload]);this.mLockReload=true}else{this.mLockReload=false}B.registerSort()},setInfo:function(C){var A=$E("table",$("FileManager_Files"));if(tFoot=$E("tfoot",$("FileManager_Files"))){$E("td",tFoot).setText(C)}else{var B=new Element("tfoot").injectInside(A);new Element("td",{colspan:5}).injectInside(new Element("tr").injectInside(B)).setText(C)}},clearInfo:function(){if(infoEl=$E("tfoot",$("FileManager_Files"))){infoEl.remove()}}},thumb:{element:function(C){var B=new Element("li",{id_file:C.id_stored_file,title:C.name});var D=new Element("span",{"class":"ImageContainer"}).injectInside(B);if(C.thumbnail){D.setStyle("background-image",'url("/cmp/dmsFileManager/loader.gif")');var E=new Asset.image(C.thumbnail,{onload:function(){D.setStyle("background-image",'url("'+C.thumbnail+'")')}})}else{var A=ImgAlpha(DSWindowSkin.mIconBaseP+C.icon_large,32,32);A.injectInside(new Element("span",{"class":"icon"}).injectInside(D))}B.adopt(new Element("div",{"class":"descriptionContainer"}).adopt(new Element("span",{"class":"description"}).setText(C.name.match(/^(.{0,15})/)[1])));return B},header:function(){return new Element("ul",{"class":"ElementsContainer"})},setInfo:function(B){var A=$E("ul",$("FileManager_Files"));if(tFoot=$E("li.foot",$("FileManager_Files"))){tFoot.setText(B)}else{new Element("li",{"class":"foot",skipsearch:1}).injectInside(A).setText(B)}},clearInfo:function(){if(infoEl=$E("li.foot",$("FileManager_Files"))){infoEl.remove()}}}};var dmsFileManager=new Class({mLoaded:false,mLoadingDirectory:false,mWindowToolbar:null,mDSWindow:null,mDSWindowOptions:null,mDirectories:null,mUploadElement:null,mActiveDirectoryID:null,mActiveFiles:null,mActiveFile:null,mActiveFileIndex:null,mTreeControl:null,mView:null,mOptions:null,mDirectoryFiles:null,mDirectoryFileIndex:0,mDialogWindow:null,mCallbackOptions:null,mLastNavigator:null,mActivePage:1,mSortBy:["original_name","asc"],mActiveFileID:null,mFilterWords:"",onDirectoryLoaded:null,initialize:function(A){this.mOptions=A;this.setWindowOptions({title:transtext("Menadżer plików"),width:800,height:500,x:"center",y:"center",icon:"crystal/16/apps/file-manager.png",modal:true,ignore_resize:false,ignore_position:false,close_button:true,resizable:true,close_confirm:false,on_escape_close:true});this.mAjax=new Dejax();this.mWindowToolbar={new_file:{active:true,hint:transtext("Upload new file"),icon:"crystal/16/actions/agt_add-to-autorun.png",action:function(){FileManager.uploadFile()},type:"file"},sep3:{separator:true},remove_file:{active:false,hint:transtext("Remove file"),icon:"crystal/16/actions/delete.png",action:function(){FileManager.removeActiveFile()}},attach_file:{active:false,hint:transtext("Attach file"),icon:"crystal/16/actions/attach.png",action:function(){$clear(this.mTmpDelay);if(true==FileManager.mOptions.useOptions){FileManager.showAttachDialog()}else{FileManager.callRequest()}}},sep1:{separator:true},new_dir:{active:true,hint:transtext("Create directory"),icon:"crystal/16/actions/folder_new.png",action:this.showDirectoryDialog.bind(this)},remove_dir:{active:false,hint:transtext("Remove directory"),icon:"crystal/16/actions/editdelete.png",action:function(){DSWindow.CreateConfirm(transtext("Czy na pewno chcesz usunąć ten folder? <br /><br /> Wszystkie pliki wewnątrz niego zostaną bezpowrotnie usunięte."),transtext("Usuwanie katalogu"),transtext("Tak"),transtext("Anuluj"),"FileManager.removeActiveDirectory()","",10,false,300,110)}.bind(this)},sep2:{separator:true},thumb_view:{active:true,checked:1,hint:transtext("Thumbnail view"),icon:"famfamfam/16/application_view_tile.png",action:function(){FileManager.setView("thumb");FileManager.loadView()},type:"checkbox",group:"default_view"},list_view:{active:true,hint:transtext("List view"),icon:"famfamfam/16/application_view_list.png",action:function(){FileManager.setView("details");FileManager.loadView()},type:"checkbox",group:"default_view"},sep4:{separator:true}}},createHTML:FileManagerViews,setView:function(A){this.mView=A},setWindowOptions:function(A){this.mDSWindowOptions=A},getContentElement:function(){return this.mDSWindow.mContentElement},open:function(){this.mDSWindow=createDSWindow(this.mDSWindowOptions);DejaxRequest.newRequest({url:"/dms/dmsFileManager/WindowInterface/",onComplete:function(A){this.getContentElement().setHTML(A);$("FileManager_Close").addEvent("click",function(){this.mDSWindow.Destroy()}.bind(this));this.mToolbar=new DSToolbar(this.mWindowToolbar,{container:this.getContentElement()});this.mToolbar.getDOMElement().injectInside(this.getContentElement());this.registerFilter();this.registerGlobalShortcuts();$("FileManager_File_Shadow").makeDraggable();DejaxRequest.newRequest({url:"/ajax/dmsFileManager/GetDirectories/","eval":true,onComplete:function(B){this.refreshDirectories(B);if(window.ie6){this.setJSResizing()}}.bind(this)})}.bind(this)})},refreshDirectories:function(A){this.mTreeControl=new MooTreeControl({div:$("FileManager_Directories",this.getContentElement()),mode:"folders",grid:true,theme:"/mp/MooTreeControl/mootree.gif",nodeOptions:{text:"",open:true}});this.mTreeControl.addEvent("onSelect",this.switchDirectory.bind(this));this.mTreeControl.root.text=transtext("Katalog główny");this.mTreeControl.root.update();this.mTreeControl.root.divs.node.disableSelection();this.mTreeControl.root.id=A[0]["id_tree"];this.mTreeControl.select(this.mTreeControl.root);A.shift();this.mDirectories=A;this.mDirectories.each(function(B){this.addDirectory(B.title,B.id_tree,B.id_tree_parent)}.bind(this))},showDirectoryDialog:function(){this.mDialogWindow=createDSWindow({title:transtext("Dodaj nowy katalog"),width:300,height:100,x:"center",y:"center",icon:"crystal/16/actions/folder_new.png",modal:true,ignore_position:true,close_button:true,resizable:false,on_escape_close:true});var A=DejaxRequest.newRequest({url:"/dms/dmsFileManager/CreateDirectory/","eval":true,evalData:["html"],onComplete:function(B){this.mDialogWindow.mContentElement.setHTML(B.html)}.bind(this)})},showAttachDialog:function(){this.mDialogWindow=createDSWindow({title:transtext("Załącz plik"),width:400,height:220,x:"center",y:"center",icon:"crystal/16/actions/folder_new.png",modal:true,ignore_position:true,close_button:true,resizable:false,on_escape_close:true});var A=DejaxRequest.newRequest({url:"/dms/dmsFileManager/AttachFile/?"+this.mOptions.whUrlParam,"eval":true,evalData:["html"],onComplete:function(B){this.mAttachHTML=B.html;this.mDialogWindow.mContentElement.setHTML(B.html)}.bind(this)})},loadDirectory:function(B,C,D,A){if(D){this.mActiveFileID=D}if(A){this.mFilterWords=""}if(C){this.mActivePage=C}this.requestFiles({id_directory:B,page:C,sortby:this.mSortBy,filter:this.mFilterWords},function(E){this.mDirectoryFiles=E.files;this.setJSNavigator(this.mToolbar.addWidget(E.navigator,450));this.mLoaded=true;this.loadView();if(!D){this.blurDirectory()}if("function"==$type(this.onDirectoryLoaded)){this.onDirectoryLoaded()}}.bind(this))},requestFiles:function(B,A){this.showIndicator();DejaxRequest.newRequest({url:"/ajax/dmsFileManager/GetDirectoryFiles/",data:B,mode:"cancel",onComplete:A})},loadFilesHTML:function(){this.mDirectoryFileIndex=0;this.resetStatusBar();this.clearActiveInfo();this.mLoadingDirectory=true;this.mDirectoryFiles.each(function(A){this.loadFileIntoDirectory(A)}.bind(this));this.mLoadingDirectory=false;if(null==this.mActiveFileID){this.blurDirectory();this.mActiveFileID=null}this.refreshQuota()},loadView:function(){this.showIndicator();if(false==this.mLoaded){return }$("FileManager_Files").innerHTML="";$("FileManager_Files").disableSelection();$("FileManager_Files").adopt(this.createHTML[this.mView].header());this.loadFilesHTML();if("function"==$type(this.createHTML[this.mView].action)){this.createHTML[this.mView].action(this)}this.setFilesUsed(this.mMarkedFiles);this.hideIndicator()},loadFileIntoDirectory:function(A){if(true==this.mLoaded){this.mDirectoryFiles.include(A)}if(false==this.mLoadingDirectory){this.refreshQuota()}var B=this.createHTML[this.mView].element(A);B.setProperty("id","FileManager_FileID"+A.id_stored_file);B.setProperty("index",this.mDirectoryFileIndex);this.mDirectoryFileIndex++;B.addEvent("mousedown",this.setFileActive.bindWithEvent(this,B));B.addEvent("dblclick",this.mWindowToolbar.attach_file.action.bind(this));$E(".ElementsContainer",$("FileManager_Files")).adopt(B);this.createHTML[this.mView].clearInfo();if(A.id_stored_file==this.mActiveFileID){this.setFileActive(null,B,true)}return B},refreshQuota:function(){DejaxRequest.newRequest({url:"/ajax/dmsFileManager/GetUsage/",onComplete:function(A){if(true==A.useQuota){$("FileManager_Quota").setStyle("display","block");$("FileManager_Directories").setStyle("bottom",155);$E("span",$("FileManager_DiskUsage")).setText(sizeFormat(A.usage));$E("span",$("FileManager_DiskQuota")).setText(sizeFormat(A.maxsize));if(chart=$E("img",$("FileManager_DiskChart"))){chart.remove()}var B=parseInt((A.usage/A.maxsize)*100).toFixed(3);var C=parseInt(100-B).toFixed(3);new Element("img",{src:"http://chart.apis.google.com/chart?cht=p3&chd=t:"+B+","+C+"&chf=bg,s,E3E3E3&chs=140x80&chl=&chco=84A3E3,EBEDF0"}).injectInside($("FileManager_DiskChart"))}}.bind(this)})},setCallbackOptions:function(A){delete A.additionalOptions;this.mCallbackOptions=A},callRequest:function(){for(i in this.mActiveFiles){var A=this.mActiveFiles[i];if("function"==$type(this.mOptions.onAttachFile)){for(i in this.mDirectoryFiles[A.index]){this.mCallbackOptions[i]=this.mDirectoryFiles[A.index][i]}this.mOptions.onAttachFile(this.mCallbackOptions);this.mMarkedFiles.include(A.idFile);this.setFileUsed(A.idFile)}}if(true==this.mOptions.closeAfterAttach){this.mDSWindow.Destroy()}else{this.updateStatus(transtext("Plik został załączony"),"crystal/16/actions/agt_action_success.png")}},updateStatusByFile:function(A){this.updateStatus(transtext("Typ")+": "+A.type+" "+transtext("Data dodania")+": "+A.date+" "+transtext("Wielkość")+": "+sizeFormat(A.size),A.icon_small)},updateStatusByFiles:function(A){var B=0;for(i in A){B++}this.updateStatus(transtext("Zaznaczonych plików")+": "+B)},updateStatus:function(C,A){this.resetStatusBar();var D=$E(".FileStatus",$("FileManager_Status"));var B=new Element("p");B.setText(C);if(A){ImgAlpha(DSWindowSkin.mIconBaseP+A,16,16).injectInside(D)}B.injectInside(D)},resetStatusBar:function(){var A=$E(".FileStatus",$("FileManager_Status"));A.empty()},uploadFile:function(){this.showIndicator();var A=this.mToolbar.mIcons.new_file.filebox;$("_FileManager_DirectoryTextbox").value=this.mActiveDirectoryID;$("_FileManager_OrderTextbox").value=Json.toString(this.mSortBy);$("_FileManager_UploadForm").adopt(A);$("_FileManager_UploadForm").submit();this.mToolbar.mIcons.new_file.restoreFilebox(A)},removeActiveFile:function(){this.showIndicator();for(i in this.mActiveFiles){this.removeFile(i)}},blurDirectory:function(){$ES(".Selected",$("FileManager_Files")).each(function(A){A.removeClass("Selected")});this.mActiveFile=null;this.setCallbackOptions({});this.mToolbar.setButtonsInactive(["remove_file","attach_file"])},removeFile:function(A){DejaxRequest.newRequest({url:"/ajax/dmsFileManager/DeleteFile/",data:{id_file:A},onComplete:function(B){if(true==B.success){if($("FileManager_FileID"+B.id_file)){$("FileManager_FileID"+B.id_file).remove()}this.blurDirectory();this.mDirectoryFiles.each(function(C){if(C.id_stored_file==B.id_file){this.mDirectoryFiles.remove(C);this.refreshQuota()}}.bind(this))}else{DSWindow.CreateAlert(B.message,transtext("Wystąpił błąd"),transtext("Zamknij"))}this.hideIndicator()}.bind(this)})},addDirectory:function(C,D,B){if(this.mTreeControl.root.id!==parseInt(D)){var A;if(this.mTreeControl.root.id==B){A=this.mTreeControl.root}else{A=this.mTreeControl.get(B)}A.insert({text:C,id:D});this.mTreeControl.get(D).divs.node.addEvents({drop:function(E){},over:function(E){E.setStyle("background-color","blue")},leave:function(E){E.setStyle("background-color","transparent")},click:function(E){this.mTreeControl.get(E).toggle(false,true)}.bind(this,D)});this.mTreeControl.get(D).divs.node.disableSelection()}},removeDirectory:function(A){this.mTreeControl.get(A).remove();this.hideIndicator()},removeActiveDirectory:function(){this.showIndicator();var A=this.mTreeControl.get(this.mActiveDirectoryID).parent;DejaxRequest.newRequest({url:"/ajax/dmsFileManager/DeleteFolder/",data:{id_directory:this.mActiveDirectoryID},onComplete:this.removeDirectory.bind(this,this.mActiveDirectoryID)});this.mTreeControl.select(A)},switchDirectory:function(B,A){if(true==A){this.showIndicator();this.mActiveDirectoryID=B.id;if(this.mTreeControl.root.id==B.id){this.mToolbar.setButtonsInactive(["remove_file","attach_file","remove_dir"])}else{this.mToolbar.setButtonsActive(["remove_dir"])}this.loadDirectory(this.mActiveDirectoryID)}},setJSResizing:function(){this.mDSWindow.addEvent("OnResize",this.resizeWindowHelper.bind(this));this.mDSWindow.fireEvent("OnResize")},resizeWindowHelper:function(){var A={x:parseInt(this.mDSWindow.mContentElement.getStyle("width")),y:parseInt(this.mDSWindow.mContentElement.getStyle("height"))};$("FileManager_Directories").setStyle("height",A.y-51);$("FileManager_Files").setStyles({height:A.y-51,width:A.x-parseInt($("FileManager_Directories").getStyle("width"))})},showIndicator:function(A){$("LoadIndicator").setStyle("display","block");this.createHTML[this.mView].clearInfo()},hideIndicator:function(A){$clear(this.mIndicatorDelay);this.mIndicatorDelay=function(){$("LoadIndicator").setStyle("display","none");if(0==this.mDirectoryFiles.length){this.createHTML[this.mView].setInfo(transtext("Brak plików do wyświetlenia w tym katalogu."))}}.delay(500,this)},setJSNavigator:function(B){if(this.mLastNavigator){this.mLastNavigator.remove()}this.mLastNavigator=B;var A=false;$ES("a",B).each(function(I){var F=I.getProperty("href");var H=I.getText();var D=I.getParent();if(window.ie){F=F.match(/(\d+)$/)[1]}if(!D.hasClass("Pages")){var C=new Element("a",{"class":"DF_button"});var G=new Element("input",{type:"button",value:H});if(I.hasClass("Active")){G.setStyle("font-weight","bold")}G.injectInside(C);C.injectInside(D);C.addEvent("click",this.loadDirectory.bind(this,[this.mActiveDirectoryID,F,this.mActiveSortField]))}else{if(false==A&&I.hasClass("Active")){var E=new Element("input",{type:"text",styles:{width:"30px"},value:F,"class":"DF_textbox"});this.registerQuickJump(E,F);E.injectInside(D);A=true}}I.remove()}.bind(this))},registerQuickJump:function(B,A){B.addEvent("keydown",function(C){if(!C.key.match(/^(\d|left|right|up|down|backspace|delete)$/)){C.stop();return false}}.bindWithEvent());B.addEvent("keyup",function(){$clear(this.tmpDelay);this.tmpDelay=this.quickJump.delay(1000,this,[B.getValue()])}.bind(this))},quickJump:function(A){if(A!=this.mActivePage){this.loadDirectory(this.mActiveDirectoryID,A,this.mActiveSortField)}},changeSort:function(A,B){this.mSortBy=[A,B];this.loadDirectory(this.mActiveDirectoryID,this.mActivePage)},changeFilter:function(A){this.mFilterWords=A;this.loadDirectory(this.mActiveDirectoryID,this.mActivePage)},registerFilter:function(){$("FileManager_FilterInput").addEvent("keyup",function(){$clear(this.mFilterDelay);this.mFilterDelay=this.changeFilter.delay(1000,this,[$("FileManager_FilterInput").getValue()])}.bind(this))},registerSort:function(){$ES("#FileManager_Files th").each(function(A){A.addEvent("click",function(C){var D=A.getProperty("rel");var B;$ES("#FileManager_Files th.sort_asc, #FileManager_Files th.sort_desc").each(function(E){E.removeClass("sort_asc");E.removeClass("sort_desc")});if(D!=this.mSortBy[0]){B="asc"}else{if("asc"==this.mSortBy[1]){B="desc"}else{B="asc"}}this.changeSort(D,B)}.bind(this,i))}.bind(this))},markFiles:function(A){this.mMarkedFiles=A},setFilesUsed:function(A){A.each(function(B){this.setFileUsed(B)}.bind(this))},setFileUsed:function(A){if($("FileManager_FileID"+A)){$("FileManager_FileID"+A).firstChild.innerHTML+=$("FileManager_IconUsed").innerHTML}},unselectFiles:function(){this.blurDirectory();this.clearActiveInfo()},clearActiveInfo:function(){delete (this.mActiveFiles);this.mActiveFiles=null;this.mActiveFiles={}},hasSelectedOneFile:function(){var A=0;for(i in this.mActiveFiles){if(0<A++){return false}}return true},setFileActive:function(A,H,E){var B=H.getProperty("id_file");var F=parseInt(H.getProperty("index"));if(!E&&$defined(this.mActiveFiles[B])){$clear(this.mTmpDelay);this.mTmpDelay=this.setFileActive.delay(300,this,[A,H,true]);return }if(A&&((false==A.control&&false==A.shift)||null==this.mActiveFiles)){this.unselectFiles()}if(A&&(true==A.control&&$defined(this.mActiveFiles[B]))){this.mActiveFiles[B]=null;delete this.mActiveFiles[B];H.removeClass("Selected")}else{if(A&&true==A.shift){var D=this.mActiveFiles[this.mLastSelectedFile];if(D.index==F){return }if(parseInt(D.index)<F){var C=parseInt(D.index);var G=F}else{var C=F;var G=parseInt(D.index)}this.unselectFiles();for(i=C;i<=G;i++){this.setFileActiveHelper($("FileManager_FileID"+this.mDirectoryFiles[i].id_stored_file),this.mDirectoryFiles[i].id_stored_file,i)}this.mToolbar.setButtonsActive(["remove_file","attach_file"])}else{this.mLastSelectedFile=B;this.setFileActiveHelper(H,B,F);this.mToolbar.setButtonsActive(["remove_file","attach_file"])}}if(true==this.hasSelectedOneFile()){this.updateStatusByFile(this.mDirectoryFiles[F])}else{this.updateStatusByFiles(this.mActiveFiles)}},setFileActiveHelper:function(C,B,A){this.mActiveFiles[B]={index:A,idFile:B,elDOM:C};C.addClass("Selected")},selectAllFiles:function(){var A=0;this.mDirectoryFiles.each(function(B){this.setFileActiveHelper($("FileManager_FileID"+B.id_stored_file),B.id_stored_file,A++)}.bind(this))},registerGlobalShortcuts:function(){}});(function(){if(!window.CKEDITOR){window.CKEDITOR=(function(){var a={timestamp:"99GE",version:"3.0.1",revision:"4391",_:{},status:"unloaded",basePath:(function(){var d=window.CKEDITOR_BASEPATH||"";if(!d){var e=document.getElementsByTagName("script");for(var f=0;f<e.length;f++){var g=e[f].src.match(/(^|.*[\\\/])ckeditor(?:_basic)?(?:_source)?.js(?:\?.*)?$/i);if(g){d=g[1];break}}}if(d.indexOf("://")==-1){if(d.indexOf("/")===0){d=location.href.match(/^.*?:\/\/[^\/]*/)[0]+d}else{d=location.href.match(/^[^\?]*\/(?:)/)[0]+d}}return d})(),getUrl:function(d){if(d.indexOf("://")==-1&&d.indexOf("/")!==0){d=this.basePath+d}if(this.timestamp&&d.charAt(d.length-1)!="/"){d+=(d.indexOf("?")>=0?"&":"?")+("t=")+this.timestamp}return d}},b=window.CKEDITOR_GETURL;if(b){var c=a.getUrl;a.getUrl=function(d){return b.call(a,d)||c.call(a,d)}}return a})()}var a=CKEDITOR;if(!a.event){a.event=function(){};a.event.implementOn=function(b,c){var d=a.event.prototype;for(var e in d){if(b[e]==undefined){b[e]=d[e]}}};a.event.prototype=(function(){var b=function(d){var e=d.getPrivate&&d.getPrivate()||d._||(d._={});return e.events||(e.events={})},c=function(d){this.name=d;this.listeners=[]};c.prototype={getListenerIndex:function(d){for(var e=0,f=this.listeners;e<f.length;e++){if(f[e].fn==d){return e}}return -1}};return{on:function(d,e,f,g,h){var i=b(this),j=i[d]||(i[d]=new c(d));if(j.getListenerIndex(e)<0){var k=j.listeners;if(!f){f=this}if(isNaN(h)){h=10}var l=this,m=function(o,p,q,r){var s={name:d,sender:this,editor:o,data:p,listenerData:g,stop:q,cancel:r,removeListener:function(){l.removeListener(d,e)}};e.call(f,s);return s.data};m.fn=e;m.priority=h;for(var n=k.length-1;n>=0;n--){if(k[n].priority<=h){k.splice(n+1,0,m);return }}k.unshift(m)}},fire:(function(){var d=false,e=function(){d=true},f=false,g=function(){f=true};return function(h,i,j){var k=b(this)[h],l=d,m=f;d=f=false;if(k){var n=k.listeners;if(n.length){n=n.slice(0);for(var o=0;o<n.length;o++){var p=n[o].call(this,j,i,e,g);if(typeof p!="undefined"){i=p}if(d||f){break}}}}var q=f||(typeof i=="undefined"?false:i);d=l;f=m;return q}})(),fireOnce:function(d,e,f){var g=this.fire(d,e,f);delete b(this)[d];return g},removeListener:function(d,e){var f=b(this)[d];if(f){var g=f.getListenerIndex(e);if(g>=0){f.listeners.splice(g,1)}}},hasListeners:function(d){var e=b(this)[d];return e&&e.listeners.length>0}}})()}if(!a.editor){a.ELEMENT_MODE_NONE=0;a.ELEMENT_MODE_REPLACE=1;a.ELEMENT_MODE_APPENDTO=2;a.editor=function(b,c,d){var e=this;e._={instanceConfig:b,element:c};e.elementMode=d||0;a.event.call(e);e._init()};a.editor.replace=function(b,c){var d=b;if(typeof d!="object"){d=document.getElementById(b);if(!d){var e=0,f=document.getElementsByName(b);while((d=f[e++])&&(d.tagName.toLowerCase()!="textarea")){}}if(!d){throw'[CKEDITOR.editor.replace] The element with id or name "'+b+'" was not found.'}}d.style.visibility="hidden";return new a.editor(c,d,1)};a.editor.appendTo=function(b,c){if(typeof b!="object"){b=document.getElementById(b);if(!b){throw'[CKEDITOR.editor.appendTo] The element with id "'+b+'" was not found.'}}return new a.editor(c,b,2)};a.editor.prototype={_init:function(){var b=a.editor._pending||(a.editor._pending=[]);b.push(this)},fire:function(b,c){return a.event.prototype.fire.call(this,b,c,this)},fireOnce:function(b,c){return a.event.prototype.fireOnce.call(this,b,c,this)}};a.event.implementOn(a.editor.prototype,true)}if(!a.env){a.env=(function(){var b=navigator.userAgent.toLowerCase(),c=window.opera,d={ie:
/*@cc_on!@*/
false,opera:!!c&&c.version,webkit:b.indexOf(" applewebkit/")>-1,air:b.indexOf(" adobeair/")>-1,mac:b.indexOf("macintosh")>-1,quirks:document.compatMode=="BackCompat",isCustomDomain:function(){return this.ie&&document.domain!=window.location.hostname}};d.gecko=navigator.product=="Gecko"&&!d.webkit&&!d.opera;var e=0;if(d.ie){e=parseFloat(b.match(/msie (\d+)/)[1]);d.ie8=!!document.documentMode;d.ie8Compat=document.documentMode==8;d.ie7Compat=e==7&&!document.documentMode||document.documentMode==7;d.ie6Compat=e<7||d.quirks}if(d.gecko){var f=b.match(/rv:([\d\.]+)/);if(f){f=f[1].split(".");e=f[0]*10000+(f[1]||0)*(100)+ +(f[2]||0)}}if(d.opera){e=parseFloat(c.version())}if(d.air){e=parseFloat(b.match(/ adobeair\/(\d+)/)[1])}if(d.webkit){e=parseFloat(b.match(/ applewebkit\/(\d+)/)[1])}d.version=e;d.isCompatible=d.ie&&e>=6||d.gecko&&e>=10801||d.opera&&e>=9.5||d.air&&e>=1||d.webkit&&e>=522||false;d.cssClass="cke_browser_"+(d.ie?"ie":d.gecko?"gecko":d.opera?"opera":d.air?"air":d.webkit?"webkit":"unknown");if(d.quirks){d.cssClass+=" cke_browser_quirks"}if(d.ie){d.cssClass+=" cke_browser_ie"+(d.version<7?"6":d.version>=8?"8":"7");if(d.quirks){d.cssClass+=" cke_browser_iequirks"}}if(d.gecko&&e<10900){d.cssClass+=" cke_browser_gecko18"}return d})()}var b=a.env;var c=b.ie;if(a.status=="unloaded"){(function(){a.event.implementOn(a);a.loadFullCore=function(){if(a.status!="basic_ready"){a.loadFullCore._load=true;return }delete a.loadFullCore;var e=document.createElement("script");e.type="text/javascript";e.src=a.basePath+"ckeditor.js";document.getElementsByTagName("head")[0].appendChild(e)};a.loadFullCoreTimeout=0;a.replaceClass="ckeditor";a.replaceByClassEnabled=true;var d=function(e,f,g){if(b.isCompatible){if(a.loadFullCore){a.loadFullCore()}var h=g(e,f);a.add(h);return h}return null};a.replace=function(e,f){return d(e,f,a.editor.replace)};a.appendTo=function(e,f){return d(e,f,a.editor.appendTo)};a.add=function(e){var f=this._.pending||(this._.pending=[]);f.push(e)};a.replaceAll=function(){var e=document.getElementsByTagName("textarea");for(var f=0;f<e.length;f++){var g=null,h=e[f],i=h.name;if(!h.name&&!h.id){continue}if(typeof arguments[0]=="string"){var j=new RegExp("(?:^| )"+arguments[0]+"(?:$| )");if(!j.test(h.className)){continue}}else{if(typeof arguments[0]=="function"){g={};if(arguments[0](h,g)===false){continue}}}this.replace(h,g)}};(function(){var e=function(){var f=a.loadFullCore,g=a.loadFullCoreTimeout;if(a.replaceByClassEnabled){a.replaceAll(a.replaceClass)}a.status="basic_ready";if(f&&f._load){f()}else{if(g){setTimeout(function(){if(a.loadFullCore){a.loadFullCore()}},g*1000)}}};if(window.addEventListener){window.addEventListener("load",e,false)}else{if(window.attachEvent){window.attachEvent("onload",e)}}})();a.status="basic_loaded"})()}a.dom={};var d=a.dom;(function(){var e=[];a.tools={arrayCompare:function(f,g){if(!f&&!g){return true}if(!f||!g||f.length!=g.length){return false}for(var h=0;h<f.length;h++){if(f[h]!=g[h]){return false}}return true},clone:function(f){var g;if(f&&f instanceof Array){g=[];for(var h=0;h<f.length;h++){g[h]=this.clone(f[h])}return g}if(f===null||typeof f!="object"||f instanceof String||f instanceof Number||f instanceof Boolean||f instanceof Date){return f}g=new f.constructor();for(var i in f){var j=f[i];g[i]=this.clone(j)}return g},extend:function(f){var g=arguments.length,h,i;if(typeof (h=arguments[g-1])=="boolean"){g--}else{if(typeof (h=arguments[g-2])=="boolean"){i=arguments[g-1];g-=2}}for(var j=1;j<g;j++){var k=arguments[j];for(var l in k){if(h===true||f[l]==undefined){if(!i||l in i){f[l]=k[l]}}}}return f},prototypedCopy:function(f){var g=function(){};g.prototype=f;return new g()},isArray:function(f){return !!f&&f instanceof Array},cssStyleToDomStyle:(function(){var f=document.createElement("div").style,g=typeof f.cssFloat!="undefined"?"cssFloat":typeof f.styleFloat!="undefined"?"styleFloat":"float";return function(h){if(h=="float"){return g}else{return h.replace(/-./g,function(i){return i.substr(1).toUpperCase()})}}})(),htmlEncode:function(f){var g=function(k){var l=new d.element("span");l.setText(k);return l.getHtml()},h=g("\n").toLowerCase()=="<br>"?function(k){return g(k).replace(/<br>/gi,"\n")}:g,i=g(">")==">"?function(k){return h(k).replace(/>/g,"&gt;")}:h,j=g("  ")=="&nbsp; "?function(k){return i(k).replace(/&nbsp;/g," ")}:i;this.htmlEncode=j;return this.htmlEncode(f)},getNextNumber:(function(){var f=0;return function(){return ++f}})(),override:function(f,g){return g(f)},setTimeout:function(f,g,h,i,j){if(!j){j=window}if(!h){h=j}return j.setTimeout(function(){if(i){f.apply(h,[].concat(i))}else{f.apply(h)}},g||0)},trim:(function(){var f=/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g;return function(g){return g.replace(f,"")}})(),ltrim:(function(){var f=/^[ \t\n\r]+/g;return function(g){return g.replace(f,"")}})(),rtrim:(function(){var f=/[ \t\n\r]+$/g;return function(g){return g.replace(f,"")}})(),indexOf:Array.prototype.indexOf?function(f,g){return f.indexOf(g)}:function(f,g){for(var h=0,i=f.length;h<i;h++){if(f[h]===g){return h}}return -1},bind:function(f,g){return function(){return f.apply(g,arguments)}},createClass:function(f){var g=f.$,h=f.base,i=f.privates||f._,j=f.proto,k=f.statics;if(i){var l=g;g=function(){var p=this;var m=p._||(p._={});for(var n in i){var o=i[n];m[n]=typeof o=="function"?a.tools.bind(o,p):o}l.apply(p,arguments)}}if(h){g.prototype=this.prototypedCopy(h.prototype);g.prototype.constructor=g;g.prototype.base=function(){this.base=h.prototype.base;h.apply(this,arguments);this.base=arguments.callee}}if(j){this.extend(g.prototype,j,true)}if(k){this.extend(g,k,true)}return g},addFunction:function(f,g){return e.push(function(){f.apply(g||this,arguments)})-1},callFunction:function(f){var g=e[f];return g.apply(window,Array.prototype.slice.call(arguments,1))},cssLength:(function(){var f=/^\d+(?:\.\d+)?$/;return function(g){return g+(f.test(g)?"px":"")}})(),repeat:function(f,g){return new Array(g+1).join(f)}}})();var e=a.tools;a.dtd=(function(){var f=e.extend,g={isindex:1,fieldset:1},h={input:1,button:1,select:1,textarea:1,label:1},i=f({a:1},h),j=f({iframe:1},i),k={hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1},l={ins:1,del:1,script:1},m=f({b:1,acronym:1,bdo:1,"var":1,"#":1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1},l),n=f({sub:1,img:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1},m),o=f({p:1},n),p=f({iframe:1},n,h),q={img:1,noscript:1,br:1,kbd:1,center:1,button:1,basefont:1,h5:1,h4:1,samp:1,h6:1,ol:1,h1:1,h3:1,h2:1,form:1,font:1,"#":1,select:1,menu:1,ins:1,abbr:1,label:1,code:1,table:1,script:1,cite:1,input:1,iframe:1,strong:1,textarea:1,noframes:1,big:1,small:1,span:1,hr:1,sub:1,bdo:1,"var":1,div:1,object:1,sup:1,strike:1,dir:1,map:1,dl:1,applet:1,del:1,isindex:1,fieldset:1,ul:1,b:1,acronym:1,a:1,blockquote:1,i:1,u:1,s:1,tt:1,address:1,q:1,pre:1,p:1,em:1,dfn:1},r=f({a:1},p),s={tr:1},t={"#":1},u=f({param:1},q),v=f({form:1},g,j,k,o),w={li:1},x={address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1};return{$block:x,$body:f({script:1},x),$cdata:{script:1,style:1},$empty:{area:1,base:1,br:1,col:1,hr:1,img:1,input:1,link:1,meta:1,param:1},$listItem:{dd:1,dt:1,li:1},$list:{ul:1,ol:1,dl:1},$nonEditable:{applet:1,button:1,embed:1,iframe:1,map:1,object:1,option:1,script:1,textarea:1},$removeEmpty:{abbr:1,acronym:1,address:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,s:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1},$tabIndex:{a:1,area:1,button:1,input:1,object:1,select:1,textarea:1},$tableContent:{caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1},col:{},tr:{td:1,th:1},img:{},colgroup:{col:1},noscript:v,td:v,br:{},th:v,center:v,kbd:r,button:f(o,k),basefont:{},h5:r,h4:r,samp:r,h6:r,ol:w,h1:r,h3:r,option:t,h2:r,form:f(g,j,k,o),select:{optgroup:1,option:1},font:r,ins:v,menu:w,abbr:r,label:r,table:{thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1},code:r,script:t,tfoot:s,cite:r,li:v,input:{},iframe:v,strong:r,textarea:t,noframes:v,big:r,small:r,span:r,hr:{},dt:r,sub:r,optgroup:{option:1},param:{},bdo:r,"var":r,div:v,object:u,sup:r,dd:v,strike:r,area:{},dir:w,map:f({area:1,form:1,p:1},g,l,k),applet:u,dl:{dt:1,dd:1},del:v,isindex:{},fieldset:f({legend:1},q),thead:s,ul:w,acronym:r,b:r,a:p,blockquote:v,caption:r,i:r,u:r,tbody:s,s:r,address:f(j,o),tt:r,legend:r,q:r,pre:f(m,i),p:r,em:r,dfn:r}})();var f=a.dtd;d.event=function(g){this.$=g};d.event.prototype={getKey:function(){return this.$.keyCode||this.$.which},getKeystroke:function(){var h=this;var g=h.getKey();if(h.$.ctrlKey||h.$.metaKey){g+=1000}if(h.$.shiftKey){g+=2000}if(h.$.altKey){g+=4000}return g},preventDefault:function(g){var h=this.$;if(h.preventDefault){h.preventDefault()}else{h.returnValue=false}if(g){this.stopPropagation()}},stopPropagation:function(){var g=this.$;if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}},getTarget:function(){var g=this.$.target||this.$.srcElement;return g?new d.node(g):null}};a.CTRL=1000;a.SHIFT=2000;a.ALT=4000;d.domObject=function(g){if(g){this.$=g}};d.domObject.prototype=(function(){var g=function(h,i){return function(j){if(typeof a!="undefined"){h.fire(i,new d.event(j))}}};return{getPrivate:function(){var h;if(!(h=this.getCustomData("_"))){this.setCustomData("_",h={})}return h},on:function(h){var k=this;var i=k.getCustomData("_cke_nativeListeners");if(!i){i={};k.setCustomData("_cke_nativeListeners",i)}if(!i[h]){var j=i[h]=g(k,h);if(k.$.addEventListener){k.$.addEventListener(h,j,!!a.event.useCapture)}else{if(k.$.attachEvent){k.$.attachEvent("on"+h,j)}}}return a.event.prototype.on.apply(k,arguments)},removeListener:function(h){var k=this;a.event.prototype.removeListener.apply(k,arguments);if(!k.hasListeners(h)){var i=k.getCustomData("_cke_nativeListeners"),j=i&&i[h];if(j){if(k.$.removeEventListener){k.$.removeEventListener(h,j,false)}else{if(k.$.detachEvent){k.$.detachEvent("on"+h,j)}}delete i[h]}}}}})();(function(g){var h={};g.equals=function(i){return i&&i.$===this.$};g.setCustomData=function(i,j){var k=this.getUniqueId(),l=h[k]||(h[k]={});l[i]=j;return this};g.getCustomData=function(i){var j=this.$._cke_expando,k=j&&h[j];return k&&k[i]};g.removeCustomData=function(i){var j=this.$._cke_expando,k=j&&h[j],l=k&&k[i];if(typeof l!="undefined"){delete k[i]}return l||null};g.getUniqueId=function(){return this.$._cke_expando||(this.$._cke_expando=e.getNextNumber())};a.event.implementOn(g)})(d.domObject.prototype);d.window=function(g){d.domObject.call(this,g)};d.window.prototype=new d.domObject();e.extend(d.window.prototype,{focus:function(){if(b.webkit&&this.$.parent){this.$.parent.focus()}this.$.focus()},getViewPaneSize:function(){var g=this.$.document,h=g.compatMode=="CSS1Compat";return{width:(h?g.documentElement.clientWidth:g.body.clientWidth)||(0),height:(h?g.documentElement.clientHeight:g.body.clientHeight)||(0)}},getScrollPosition:function(){var g=this.$;if("pageXOffset" in g){return{x:g.pageXOffset||0,y:g.pageYOffset||0}}else{var h=g.document;return{x:h.documentElement.scrollLeft||h.body.scrollLeft||0,y:h.documentElement.scrollTop||h.body.scrollTop||0}}}});d.document=function(g){d.domObject.call(this,g)};var g=d.document;g.prototype=new d.domObject();e.extend(g.prototype,{appendStyleSheet:function(h){if(this.$.createStyleSheet){this.$.createStyleSheet(h)}else{var i=new d.element("link");i.setAttributes({rel:"stylesheet",type:"text/css",href:h});this.getHead().append(i)}},createElement:function(h,i){var j=new d.element(h,this);if(i){if(i.attributes){j.setAttributes(i.attributes)}if(i.styles){j.setStyles(i.styles)}}return j},createText:function(h){return new d.text(h,this)},focus:function(){this.getWindow().focus()},getById:function(h){var i=this.$.getElementById(h);return i?new d.element(i):null},getByAddress:function(h,i){var j=this.$.documentElement;for(var k=0;j&&k<h.length;k++){var l=h[k];if(!i){j=j.childNodes[l];continue}var m=-1;for(var n=0;n<j.childNodes.length;n++){var o=j.childNodes[n];if(i===true&&o.nodeType==3&&o.previousSibling&&o.previousSibling.nodeType==3){continue}m++;if(m==l){j=o;break}}}return j?new d.node(j):null},getElementsByTag:function(h,i){if(!c&&i){h=i+":"+h}return new d.nodeList(this.$.getElementsByTagName(h))},getHead:function(){var h=this.$.getElementsByTagName("head")[0];h=new d.element(h);return(this.getHead=function(){return h})()},getBody:function(){var h=new d.element(this.$.body);return(this.getBody=function(){return h})()},getDocumentElement:function(){var h=new d.element(this.$.documentElement);return(this.getDocumentElement=function(){return h})()},getWindow:function(){var h=new d.window(this.$.parentWindow||this.$.defaultView);return(this.getWindow=function(){return h})()}});d.node=function(h){if(h){switch(h.nodeType){case 1:return new d.element(h);case 3:return new d.text(h)}d.domObject.call(this,h)}return this};d.node.prototype=new d.domObject();a.NODE_ELEMENT=1;a.NODE_TEXT=3;a.NODE_COMMENT=8;a.NODE_DOCUMENT_FRAGMENT=11;a.POSITION_IDENTICAL=0;a.POSITION_DISCONNECTED=1;a.POSITION_FOLLOWING=2;a.POSITION_PRECEDING=4;a.POSITION_IS_CONTAINED=8;a.POSITION_CONTAINS=16;e.extend(d.node.prototype,{appendTo:function(h,i){h.append(this,i);return h},clone:function(h,i){var j=this.$.cloneNode(h);if(!i){var k=function(l){if(l.nodeType!=1){return }l.removeAttribute("id",false);l.removeAttribute("_cke_expando",false);var m=l.childNodes;for(var n=0;n<m.length;n++){k(m[n])}};k(j)}return new d.node(j)},hasPrevious:function(){return !!this.$.previousSibling},hasNext:function(){return !!this.$.nextSibling},insertAfter:function(h){h.$.parentNode.insertBefore(this.$,h.$.nextSibling);return h},insertBefore:function(h){h.$.parentNode.insertBefore(this.$,h.$);return h},insertBeforeMe:function(h){this.$.parentNode.insertBefore(h.$,this.$);return h},getAddress:function(h){var i=[],j=this.getDocument().$.documentElement,k=this.$;while(k&&k!=j){var l=k.parentNode,m=-1;for(var n=0;n<l.childNodes.length;n++){var o=l.childNodes[n];if(h&&o.nodeType==3&&o.previousSibling&&o.previousSibling.nodeType==3){continue}m++;if(o==k){break}}i.unshift(m);k=k.parentNode}return i},getDocument:function(){var h=new g(this.$.ownerDocument||this.$.parentNode.ownerDocument);return(this.getDocument=function(){return h})()},getIndex:function(){var h=this.$,i=h.parentNode&&h.parentNode.firstChild,j=-1;while(i){j++;if(i==h){return j}i=i.nextSibling}return -1},getNextSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return !n.equals(k)}}var l=!h&&this.getFirst&&this.getFirst(),m;if(!l){if(this.type==1&&j&&j(this,true)===false){return null}l=this.getNext()}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false){return null}l=m.getNext()}if(!l){return null}if(j&&j(l)===false){return null}if(i&&i!=l.type){return l.getNextSourceNode(false,i,j)}return l},getPreviousSourceNode:function(h,i,j){if(j&&!j.call){var k=j;j=function(n){return !n.equals(k)}}var l=!h&&this.getLast&&this.getLast(),m;if(!l){if(this.type==1&&j&&j(this,true)===false){return null}l=this.getPrevious()}while(!l&&(m=(m||this).getParent())){if(j&&j(m,true)===false){return null}l=m.getPrevious()}if(!l){return null}if(j&&j(l)===false){return null}if(i&&l.type!=i){return l.getPreviousSourceNode(false,i,j)}return l},getPrevious:function(h){var i=this.$,j;do{i=i.previousSibling;j=i&&new d.node(i)}while(j&&h&&!h(j));return j},getNext:function(h){var i=this.$,j;do{i=i.nextSibling;j=i&&new d.node(i)}while(j&&h&&!h(j));return j},getParent:function(){var h=this.$.parentNode;return h&&h.nodeType==1?new d.node(h):null},getParents:function(h){var i=this,j=[];do{j[h?"push":"unshift"](i)}while(i=i.getParent());return j},getCommonAncestor:function(h){var j=this;if(h.equals(j)){return j}if(h.contains&&h.contains(j)){return h}var i=j.contains?j:j.getParent();do{if(i.contains(h)){return i}}while(i=i.getParent());return null},getPosition:function(h){var i=this.$,j=h.$;if(i.compareDocumentPosition){return i.compareDocumentPosition(j)}if(i==j){return 0}if(this.type==1&&h.type==1){if(i.contains){if(i.contains(j)){return 16+4}if(j.contains(i)){return 8+2}}if("sourceIndex" in i){return i.sourceIndex<0||j.sourceIndex<0?1:i.sourceIndex<j.sourceIndex?4:2}}var k=this.getAddress(),l=h.getAddress(),m=Math.min(k.length,l.length);for(var n=0;n<=m-1;n++){if(k[n]!=l[n]){if(n<m){return k[n]<l[n]?4:2}break}}return k.length<l.length?16+4:8+2},getAscendant:function(h,i){var j=this.$;if(!i){j=j.parentNode}while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h){return new d.node(j)}j=j.parentNode}return null},hasAscendant:function(h,i){var j=this.$;if(!i){j=j.parentNode}while(j){if(j.nodeName&&j.nodeName.toLowerCase()==h){return true}j=j.parentNode}return false},move:function(h,i){h.append(this.remove(),i)},remove:function(h){var i=this.$,j=i.parentNode;if(j){if(h){for(var k;k=i.firstChild;){j.insertBefore(i.removeChild(k),i)}}j.removeChild(i)}return this},replace:function(h){this.insertBefore(h);h.remove()},trim:function(){this.ltrim();this.rtrim()},ltrim:function(){var k=this;var h;while(k.getFirst&&(h=k.getFirst())){if(h.type==3){var i=e.ltrim(h.getText()),j=h.getLength();if(!i){h.remove();continue}else{if(i.length<j){h.split(j-i.length);k.$.removeChild(k.$.firstChild)}}}break}},rtrim:function(){var k=this;var h;while(k.getLast&&(h=k.getLast())){if(h.type==3){var i=e.rtrim(h.getText()),j=h.getLength();if(!i){h.remove();continue}else{if(i.length<j){h.split(i.length);k.$.lastChild.parentNode.removeChild(k.$.lastChild)}}}break}if(!c&&!b.opera){h=k.$.lastChild;if(h&&h.type==1&&h.nodeName.toLowerCase()=="br"){h.parentNode.removeChild(h)}}}});d.nodeList=function(h){this.$=h};d.nodeList.prototype={count:function(){return this.$.length},getItem:function(h){var i=this.$[h];return i?new d.node(i):null}};d.element=function(h,i){if(typeof h=="string"){h=(i?i.$:document).createElement(h)}d.domObject.call(this,h)};var h=d.element;h.get=function(i){return i&&(i.$?i:new h(i))};h.prototype=new d.node();h.createFromHtml=function(i,j){var k=new h("div",j);k.setHtml(i);return k.getFirst().remove()};h.setMarker=function(i,j,k,l){var m=j.getCustomData("list_marker_id")||j.setCustomData("list_marker_id",e.getNextNumber()).getCustomData("list_marker_id"),n=j.getCustomData("list_marker_names")||j.setCustomData("list_marker_names",{}).getCustomData("list_marker_names");i[m]=j;n[k]=1;return j.setCustomData(k,l)};h.clearAllMarkers=function(i){for(var j in i){h.clearMarkers(i,i[j],true)}};h.clearMarkers=function(i,j,k){var l=j.getCustomData("list_marker_names"),m=j.getCustomData("list_marker_id");for(var n in l){j.removeCustomData(n)}j.removeCustomData("list_marker_names");if(k){j.removeCustomData("list_marker_id");delete i[m]}};e.extend(h.prototype,{type:1,addClass:function(i){var j=this.$.className;if(j){var k=new RegExp("(?:^|\\s)"+i+"(?:\\s|$)","");if(!k.test(j)){j+=" "+i}}this.$.className=j||i},removeClass:function(i){var j=this.getAttribute("class");if(j){var k=new RegExp("(?:^|\\s+)"+i+"(?=\\s|$)","i");if(k.test(j)){j=j.replace(k,"").replace(/^\s+/,"");if(j){this.setAttribute("class",j)}else{this.removeAttribute("class")}}}},hasClass:function(i){var j=new RegExp("(?:^|\\s+)"+i+"(?=\\s|$)","");return j.test(this.getAttribute("class"))},append:function(i,j){var k=this;if(typeof i=="string"){i=k.getDocument().createElement(i)}if(j){k.$.insertBefore(i.$,k.$.firstChild)}else{k.$.appendChild(i.$)}return i},appendHtml:function(i){var k=this;if(!k.$.childNodes.length){k.setHtml(i)}else{var j=new h("div",k.getDocument());j.setHtml(i);j.moveChildren(k)}},appendText:function(i){if(this.$.text!=undefined){this.$.text+=i}else{this.append(new d.text(i))}},appendBogus:function(){var j=this;var i=j.getLast();while(i&&i.type==3&&!e.rtrim(i.getText())){i=i.getPrevious()}if(!i||!i.is||!i.is("br")){j.append(b.opera?j.getDocument().createText(""):j.getDocument().createElement("br"))}},breakParent:function(i){var l=this;var j=new d.range(l.getDocument());j.setStartAfter(l);j.setEndAfter(i);var k=j.extractContents();j.insertNode(l.remove());k.insertAfterNode(l)},contains:c||b.webkit?function(i){var j=this.$;return i.type!=1?j.contains(i.getParent().$):j!=i.$&&j.contains(i.$)}:function(i){return !!(this.$.compareDocumentPosition(i.$)&16)},focus:function(){try{this.$.focus()}catch(i){}},getHtml:function(){return this.$.innerHTML},getOuterHtml:function(){var j=this;if(j.$.outerHTML){return j.$.outerHTML.replace(/<\?[^>]*>/,"")}var i=j.$.ownerDocument.createElement("div");i.appendChild(j.$.cloneNode(true));return i.innerHTML},setHtml:function(i){return this.$.innerHTML=i},setText:function(i){h.prototype.setText=this.$.innerText!=undefined?function(j){return this.$.innerText=j}:function(j){return this.$.textContent=j};return this.setText(i)},getAttribute:(function(){var i=function(j){return this.$.getAttribute(j,2)};if(c&&(b.ie7Compat||b.ie6Compat)){return function(j){var l=this;switch(j){case"class":j="className";break;case"tabindex":var k=i.call(l,j);if(k!==0&&l.$.tabIndex===0){k=null}return k;break;case"checked":return l.$.checked;break;case"style":return l.$.style.cssText}return i.call(l,j)}}else{return i}})(),getChildren:function(){return new d.nodeList(this.$.childNodes)},getComputedStyle:c?function(i){return this.$.currentStyle[e.cssStyleToDomStyle(i)]}:function(i){return this.getWindow().$.getComputedStyle(this.$,"").getPropertyValue(i)},getDtd:function(){var i=f[this.getName()];this.getDtd=function(){return i};return i},getElementsByTag:g.prototype.getElementsByTag,getTabIndex:c?function(){var i=this.$.tabIndex;if(i===0&&!f.$tabIndex[this.getName()]&&parseInt(this.getAttribute("tabindex"),10)!==0){i=-1}return i}:b.webkit?function(){var i=this.$.tabIndex;if(i==undefined){i=parseInt(this.getAttribute("tabindex"),10);if(isNaN(i)){i=-1}}return i}:function(){return this.$.tabIndex},getText:function(){return this.$.textContent||this.$.innerText||""},getWindow:function(){return this.getDocument().getWindow()},getId:function(){return this.$.id||null},getNameAtt:function(){return this.$.name||null},getName:function(){var i=this.$.nodeName.toLowerCase();if(c){var j=this.$.scopeName;if(j!="HTML"){i=j.toLowerCase()+":"+i}}return(this.getName=function(){return i})()},getValue:function(){return this.$.value},getFirst:function(){var i=this.$.firstChild;return i?new d.node(i):null},getLast:function(i){var j=this.$.lastChild,k=j&&new d.node(j);if(k&&i&&!i(k)){k=k.getPrevious(i)}return k},getStyle:function(i){return this.$.style[e.cssStyleToDomStyle(i)]},is:function(){var i=this.getName();for(var j=0;j<arguments.length;j++){if(arguments[j]==i){return true}}return false},isEditable:function(){var i=this.getName(),j=!f.$nonEditable[i]&&(f[i]||f.span);return j&&j["#"]},isIdentical:function(i){if(this.getName()!=i.getName()){return false}var j=this.$.attributes,k=i.$.attributes,l=j.length,m=k.length;if(!c&&l!=m){return false}for(var n=0;n<l;n++){var o=j[n];if((!c||o.specified&&o.nodeName!="_cke_expando")&&(o.nodeValue!=i.getAttribute(o.nodeName))){return false}}if(c){for(n=0;n<m;n++){o=k[n];if((!c||o.specified&&o.nodeName!="_cke_expando")&&(o.nodeValue!=j.getAttribute(o.nodeName))){return false}}}return true},isVisible:function(){return this.$.offsetWidth&&this.$.style.visibility!="hidden"},hasAttributes:c&&(b.ie7Compat||b.ie6Compat)?function(){var i=this.$.attributes;for(var j=0;j<i.length;j++){var k=i[j];switch(k.nodeName){case"class":if(this.getAttribute("class")){return true}case"_cke_expando":continue;default:if(k.specified){return true}}}return false}:function(){var i=this.$.attributes;return i.length>1||i.length==1&&i[0].nodeName!="_cke_expando"},hasAttribute:function(i){var j=this.$.attributes.getNamedItem(i);return !!(j&&j.specified)},hide:function(){this.setStyle("display","none")},moveChildren:function(i,j){var k=this.$;i=i.$;if(k==i){return }var l;if(j){while(l=k.lastChild){i.insertBefore(k.removeChild(l),i.firstChild)}}else{while(l=k.firstChild){i.appendChild(k.removeChild(l))}}},show:function(){this.setStyles({display:"",visibility:""})},setAttribute:(function(){var i=function(j,k){this.$.setAttribute(j,k);return this};if(c&&(b.ie7Compat||b.ie6Compat)){return function(j,k){var l=this;if(j=="class"){l.$.className=k}else{if(j=="style"){l.$.style.cssText=k}else{if(j=="tabindex"){l.$.tabIndex=k}else{if(j=="checked"){l.$.checked=k}else{i.apply(l,arguments)}}}}return l}}else{return i}})(),setAttributes:function(i){for(var j in i){this.setAttribute(j,i[j])}return this},setValue:function(i){this.$.value=i;return this},removeAttribute:(function(){var i=function(j){this.$.removeAttribute(j)};if(c&&(b.ie7Compat||b.ie6Compat)){return function(j){if(j=="class"){j="className"}else{if(j=="tabindex"){j="tabIndex"}}i.call(this,j)}}else{return i}})(),removeAttributes:function(i){for(var j=0;j<i.length;j++){this.removeAttribute(i[j])}},removeStyle:function(i){var j=this;if(j.$.style.removeAttribute){j.$.style.removeAttribute(e.cssStyleToDomStyle(i))}else{j.setStyle(i,"")}if(!j.$.style.cssText){j.removeAttribute("style")}},setStyle:function(i,j){this.$.style[e.cssStyleToDomStyle(i)]=j;return this},setStyles:function(i){for(var j in i){this.setStyle(j,i[j])}return this},setOpacity:function(i){if(c){i=Math.round(i*100);this.setStyle("filter",i>=100?"":"progid:DXImageTransform.Microsoft.Alpha(opacity="+i+")")}else{this.setStyle("opacity",i)}},unselectable:b.gecko?function(){this.$.style.MozUserSelect="none"}:b.webkit?function(){this.$.style.KhtmlUserSelect="none"}:function(){if(c||b.opera){var i=this.$,j,k=0;i.unselectable="on";while(j=i.all[k++]){switch(j.tagName.toLowerCase()){case"iframe":case"textarea":case"input":case"select":break;default:j.unselectable="on"}}}},getPositionedAncestor:function(){var i=this;while(i.getName()!="html"){if(i.getComputedStyle("position")!="static"){return i}i=i.getParent()}return null},getDocumentPosition:function(i){var D=this;var j=0,k=0,l=D.getDocument().getBody(),m=D.getDocument().$.compatMode=="BackCompat",n=D.getDocument();if(document.documentElement.getBoundingClientRect){var o=D.$.getBoundingClientRect(),p=n.$,q=p.documentElement,r=q.clientTop||l.$.clientTop||0,s=q.clientLeft||l.$.clientLeft||0,t=true;if(c){var u=n.getDocumentElement().contains(D),v=n.getBody().contains(D);t=m&&v||!m&&u}if(t){j=o.left+(!m&&q.scrollLeft||l.$.scrollLeft);j-=s;k=o.top+(!m&&q.scrollTop||l.$.scrollTop);k-=r}}else{var w=D,x=null,y;while(w&&!(w.getName()=="body"||w.getName()=="html")){j+=w.$.offsetLeft-w.$.scrollLeft;k+=w.$.offsetTop-w.$.scrollTop;if(!w.equals(D)){j+=w.$.clientLeft||0;k+=w.$.clientTop||0}var z=x;while(z&&!z.equals(w)){j-=z.$.scrollLeft;k-=z.$.scrollTop;z=z.getParent()}x=w;w=(y=w.$.offsetParent)?new h(y):null}}if(i){var A=D.getWindow(),B=i.getWindow();if(!A.equals(B)&&A.$.frameElement){var C=new h(A.$.frameElement).getDocumentPosition(i);j+=C.x;k+=C.y}}if(!document.documentElement.getBoundingClientRect){if(b.gecko&&!m){j+=D.$.clientLeft?1:0;k+=D.$.clientTop?1:0}}return{x:j,y:k}},scrollIntoView:function(i){var o=this;var j=o.getWindow(),k=j.getViewPaneSize().height,l=k*-1;if(i){l+=k}else{l+=o.$.offsetHeight||0;l+=parseInt(o.getComputedStyle("marginBottom")||0,10)||0}var m=o.getDocumentPosition();l+=m.y;l=l<0?0:l;var n=j.getScrollPosition().y;if(l>n||l<n-k){j.$.scrollTo(0,l)}},setState:function(i){var j=this;switch(i){case 1:j.addClass("cke_on");j.removeClass("cke_off");j.removeClass("cke_disabled");break;case 0:j.addClass("cke_disabled");j.removeClass("cke_off");j.removeClass("cke_on");break;default:j.addClass("cke_off");j.removeClass("cke_on");j.removeClass("cke_disabled");break}},getFrameDocument:function(){var i=this.$;try{i.contentWindow.document}catch(j){i.src=i.src;if(c&&b.version<7){window.showModalDialog('javascript:document.write("<script>window.setTimeout(function(){window.close();},50);<\/script>")')}}return i&&new g(i.contentWindow.document)},copyAttributes:function(i,j){var p=this;var k=p.$.attributes;j=j||{};for(var l=0;l<k.length;l++){var m=k[l];if(m.specified||c&&m.nodeValue&&m.nodeName.toLowerCase()=="value"){var n=m.nodeName;if(n in j){continue}var o=p.getAttribute(n);if(o===null){o=m.nodeValue}i.setAttribute(n,o)}}if(p.$.style.cssText!==""){i.$.style.cssText=p.$.style.cssText}},renameNode:function(i){var l=this;if(l.getName()==i){return }var j=l.getDocument(),k=new h(i,j);l.copyAttributes(k);l.moveChildren(k);l.$.parentNode.replaceChild(k.$,l.$);k.$._cke_expando=l.$._cke_expando;l.$=k.$},getChild:function(i){var j=this.$;if(!i.slice){j=j.childNodes[i]}else{while(i.length>0&&j){j=j.childNodes[i.shift()]}}return j?new d.node(j):null},getChildCount:function(){return this.$.childNodes.length},disableContextMenu:function(){this.on("contextmenu",function(i){if(!i.data.getTarget().hasClass("cke_enable_context_menu")){i.data.preventDefault()}})}});a.command=function(i,j){this.uiItems=[];this.exec=function(k){if(this.state==0){return false}if(this.editorFocus){i.focus()}return j.exec.call(this,i,k)!==false};e.extend(this,j,{modes:{wysiwyg:1},editorFocus:true,state:2});a.event.call(this)};a.command.prototype={enable:function(){var i=this;if(i.state==0){i.setState(!i.preserveState||typeof i.previousState=="undefined"?2:i.previousState)}},disable:function(){this.setState(0)},setState:function(i){var j=this;if(j.state==i){return false}j.previousState=j.state;j.state=i;j.fire("state");return true},toggleState:function(){var i=this;if(i.state==2){i.setState(1)}else{if(i.state==1){i.setState(2)}}}};a.event.implementOn(a.command.prototype,true);a.ENTER_P=1;a.ENTER_BR=2;a.ENTER_DIV=3;a.config={customConfig:a.getUrl("config.js"),autoUpdateElement:true,baseHref:"",contentsCss:a.basePath+"contents.css",contentsLangDirection:"ltr",language:"",defaultLanguage:"en",enterMode:1,shiftEnterMode:2,corePlugins:"",docType:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',fullPage:false,height:200,plugins:"about,basicstyles,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,sourcearea,stylescombo,table,tabletools,specialchar,tab,templates,toolbar,undo,wysiwygarea,wsc",extraPlugins:"",removePlugins:"",protectedSource:[],tabIndex:0,theme:"default",skin:"kama",width:"",baseFloatZIndex:10000};var i=a.config;a.focusManager=function(j){if(j.focusManager){return j.focusManager}this.hasFocus=false;this._={editor:j};return this};a.focusManager.prototype={focus:function(){var k=this;if(k._.timer){clearTimeout(k._.timer)}if(!k.hasFocus){if(a.currentInstance){a.currentInstance.focusManager.forceBlur()}var j=k._.editor;j.container.getFirst().addClass("cke_focus");k.hasFocus=true;j.fire("focus")}},blur:function(){var j=this;if(j._.timer){clearTimeout(j._.timer)}j._.timer=setTimeout(function(){delete j._.timer;j.forceBlur()},100)},forceBlur:function(){if(this.hasFocus){var j=this._.editor;j.container.getFirst().removeClass("cke_focus");this.hasFocus=false;j.fire("blur")}}};(function(){var j={};a.lang={languages:{af:1,ar:1,bg:1,bn:1,bs:1,ca:1,cs:1,da:1,de:1,el:1,"en-au":1,"en-ca":1,"en-uk":1,en:1,eo:1,es:1,et:1,eu:1,fa:1,fi:1,fo:1,"fr-ca":1,fr:1,gl:1,gu:1,he:1,hi:1,hr:1,hu:1,is:1,it:1,ja:1,km:1,ko:1,lt:1,lv:1,mn:1,ms:1,nb:1,nl:1,no:1,pl:1,"pt-br":1,pt:1,ro:1,ru:1,sk:1,sl:1,"sr-latn":1,sr:1,sv:1,th:1,tr:1,uk:1,vi:1,"zh-cn":1,zh:1},load:function(k,l,m){if(!k||!a.lang.languages[k]){k=this.detect(l,k)}if(!this[k]){a.scriptLoader.load(a.getUrl("lang/"+k+".js"),function(){m(k,this[k])},this)}else{m(k,this[k])}},detect:function(k,l){var m=this.languages;l=l||navigator.userLanguage||navigator.language;var n=l.toLowerCase().match(/([a-z]+)(?:-([a-z]+))?/),o=n[1],p=n[2];if(m[o+"-"+p]){o=o+"-"+p}else{if(!m[o]){o=null}}a.lang.detect=o?function(){return o}:function(q){return q};return o||k}}})();a.scriptLoader=(function(){var j={},k={};return{load:function(l,m,n,o){var p=typeof l=="string";if(p){l=[l]}if(!n){n=a}var q=l.length,r=[],s=[],t=function(y){if(m){if(p){m.call(n,y)}else{m.call(n,r,s)}}};if(q===0){t(true);return }var u=function(y,z){(z?r:s).push(y);if(--q<=0){t(z)}},v=function(y,z){j[y]=1;var A=k[y];delete k[y];for(var B=0;B<A.length;B++){A[B](y,z)}},w=function(y){if(o!==true&&j[y]){u(y,true);return }var z=k[y]||(k[y]=[]);z.push(u);if(z.length>1){return }var A=new h("script");A.setAttributes({type:"text/javascript",src:y});if(m){if(c){A.$.onreadystatechange=function(){if(A.$.readyState=="loaded"||A.$.readyState=="complete"){A.$.onreadystatechange=null;v(y,true)}}}else{A.$.onload=function(){setTimeout(function(){v(y,true)},0)};A.$.onerror=function(){v(y,false)}}}A.appendTo(a.document.getHead())};for(var x=0;x<q;x++){w(l[x])}},loadCode:function(l){var m=new h("script");m.setAttribute("type","text/javascript");m.appendText(l);m.appendTo(a.document.getHead())}}})();a.resourceManager=function(j,k){var l=this;l.basePath=j;l.fileName=k;l.registered={};l.loaded={};l.externals={};l._={waitingList:{}}};a.resourceManager.prototype={add:function(j,k){if(this.registered[j]){throw'[CKEDITOR.resourceManager.add] The resource name "'+j+'" is already registered.'}this.registered[j]=k||{}},get:function(j){return this.registered[j]||null},getPath:function(j){var k=this.externals[j];return a.getUrl(k&&k.dir||this.basePath+j+"/")},getFilePath:function(j){var k=this.externals[j];return a.getUrl(this.getPath(j)+(k&&k.file||this.fileName+".js"))},addExternal:function(j,k,l){j=j.split(",");for(var m=0;m<j.length;m++){var n=j[m];this.externals[n]={dir:k,file:l}}},load:function(j,k,l){if(!e.isArray(j)){j=j?[j]:[]}var m=this.loaded,n=this.registered,o=[],p={},q={};for(var r=0;r<j.length;r++){var s=j[r];if(!s){continue}if(!m[s]&&!n[s]){var t=this.getFilePath(s);o.push(t);if(!(t in p)){p[t]=[]}p[t].push(s)}else{q[s]=this.get(s)}}a.scriptLoader.load(o,function(u,v){if(v.length){throw'[CKEDITOR.resourceManager.load] Resource name "'+p[v[0]].join(",")+'" was not found at "'+v[0]+'".'}for(var w=0;w<u.length;w++){var x=p[u[w]];for(var y=0;y<x.length;y++){var z=x[y];q[z]=this.get(z);m[z]=1}}k.call(l,q)},this)}};a.plugins=new a.resourceManager("plugins/","plugin");var j=a.plugins;j.load=e.override(j.load,function(k){return function(l,m,n){var o={},p=function(q){k.call(this,q,function(r){e.extend(o,r);var s=[];for(var t in r){var u=r[t],v=u&&u.requires;if(v){for(var w=0;w<v.length;w++){if(!o[v[w]]){s.push(v[w])}}}}if(s.length){p.call(this,s)}else{for(t in o){u=o[t];if(u.onLoad&&!u.onLoad._called){u.onLoad();u.onLoad._called=1}}if(m){m.call(n||window,o)}}},this)};p.call(this,l)}});j.setLang=function(k,l,m){var n=this.get(k);n.lang[l]=m};(function(){var k={},l=function(m,n){var o=function(){k[m]=1;n()},p=new h("img");p.on("load",o);p.on("error",o);p.setAttribute("src",m)};a.imageCacher={load:function(m,n){var o=m.length,p=function(){if(--o===0){n()}};for(var q=0;q<m.length;q++){var r=m[q];if(k[r]){p()}else{l(r,p)}}}}})();a.skins=(function(){var k={},l={},m={},n=function(o,p,q){var r=k[o],s=function(A){for(var B=0;B<A.length;B++){A[B]=a.getUrl(m[o]+A[B])}};if(!l[o]){var t=r.preload;if(t&&t.length>0){s(t);a.imageCacher.load(t,function(){l[o]=1;n(o,p,q)});return }l[o]=1}p=r[p];var u=!p||!!p._isLoaded;if(u){q&&q()}else{var v=p._pending||(p._pending=[]);v.push(q);if(v.length>1){return }var w=!p.css||!p.css.length,x=!p.js||!p.js.length,y=function(){if(w&&x){p._isLoaded=1;for(var A=0;A<v.length;A++){if(v[A]){v[A]()}}}};if(!w){s(p.css);for(var z=0;z<p.css.length;z++){a.document.appendStyleSheet(p.css[z])}w=1}if(!x){s(p.js);a.scriptLoader.load(p.js,function(){x=1;y()})}y()}};return{add:function(o,p){k[o]=p;p.skinPath=m[o]||(m[o]=a.getUrl("skins/"+o+"/"))},load:function(o,p,q){var r=o.skinName,s=o.skinPath;if(k[r]){n(r,p,q);var t=k[r];if(t.init){t.init(o)}}else{m[r]=s;a.scriptLoader.load(s+"skin.js",function(){n(r,p,q);var u=k[r];if(u.init){u.init(o)}})}}}})();a.themes=new a.resourceManager("themes/","theme");a.ui=function(k){if(k.ui){return k.ui}this._={handlers:{},items:{},editor:k};return this};var k=a.ui;k.prototype={add:function(l,m,n){this._.items[l]={type:m,command:n.command||null,args:Array.prototype.slice.call(arguments,2)}},create:function(l){var q=this;var m=q._.items[l],n=m&&q._.handlers[m.type],o=m&&m.command&&q._.editor.getCommand(m.command),p=n&&n.create.apply(q,m.args);if(o){o.uiItems.push(p)}return p},addHandler:function(l,m){this._.handlers[l]=m}};(function(){var l=0,m=function(){var x="editor"+ ++l;return a.instances&&a.instances[x]?m():x},n={},o=function(x){var y=x.config.customConfig;if(!y){return false}var z=n[y]||(n[y]={});if(z.fn){z.fn.call(x,x.config);if(x.config.customConfig==y||!o(x)){x.fireOnce("customConfigLoaded")}}else{a.scriptLoader.load(y,function(){if(a.editorConfig){z.fn=a.editorConfig}else{z.fn=function(){}}o(x)})}return true},p=function(x,y){x.on("customConfigLoaded",function(){if(y){if(y.on){for(var z in y.on){x.on(z,y.on[z])}}e.extend(x.config,y,true);delete x.config.on}q(x)});if(y&&y.customConfig!=undefined){x.config.customConfig=y.customConfig}if(!o(x)){x.fireOnce("customConfigLoaded")}},q=function(x){var y=x.config.skin.split(","),z=y[0],A=a.getUrl(y[1]||"skins/"+z+"/");x.skinName=z;x.skinPath=A;x.skinClass="cke_skin_"+z;x.fireOnce("configLoaded");r(x)},r=function(x){a.lang.load(x.config.language,x.config.defaultLanguage,function(y,z){x.langCode=y;x.lang=e.prototypedCopy(z);if(b.gecko&&b.version<10900&&x.lang.dir=="rtl"){x.lang.dir="ltr"}s(x)})},s=function(x){var y=x.config,z=y.plugins,A=y.extraPlugins,B=y.removePlugins;if(A){var C=new RegExp("(?:^|,)(?:"+A.replace(/\s*,\s*/g,"|")+")(?=,|$)","g");z=z.replace(C,"");z+=","+A}if(B){C=new RegExp("(?:^|,)(?:"+B.replace(/\s*,\s*/g,"|")+")(?=,|$)","g");z=z.replace(C,"")}j.load(z.split(","),function(D){var E=[],F=[],G=[];x.plugins=D;for(var H in D){var I=D[H],J=I.lang,K=j.getPath(H),L=null;I.path=K;if(J){L=e.indexOf(J,x.langCode)>=0?x.langCode:J[0];if(!I.lang[L]){G.push(a.getUrl(K+"lang/"+L+".js"))}else{e.extend(x.lang,I.lang[L]);L=null}}F.push(L);E.push(I)}a.scriptLoader.load(G,function(){var M=["beforeInit","init","afterInit"];for(var N=0;N<M.length;N++){for(var O=0;O<E.length;O++){var P=E[O];if(N===0&&F[O]&&P.lang){e.extend(x.lang,P.lang[F[O]])}if(P[M[N]]){P[M[N]](x)}}}x.fire("pluginsLoaded");t(x)})})},t=function(x){a.skins.load(x,"editor",function(){u(x)})},u=function(x){var y=x.config.theme;a.themes.load(y,function(){var z=x.theme=a.themes.get(y);z.path=a.themes.getPath(y);z.build(x);if(x.config.autoUpdateElement){v(x)}})},v=function(x){var y=x.element;if(x.elementMode==1&&y.is("textarea")){var z=y.$.form&&new h(y.$.form);if(z){function A(){x.updateElement()}z.on("submit",A);if(!z.$.submit.nodeName){z.$.submit=e.override(z.$.submit,function(B){return function(){x.updateElement();if(B.apply){B.apply(this,arguments)}else{B()}}})}x.on("destroy",function(){z.removeListener("submit",A)})}}};function w(){var x,y=this._.commands,z=this.mode;for(var A in y){x=y[A];x[x.modes[z]?"enable":"disable"]()}}a.editor.prototype._init=function(){var z=this;var x=h.get(z._.element),y=z._.instanceConfig;delete z._.element;delete z._.instanceConfig;z._.commands={};z._.styles=[];z.element=x;z.name=x&&z.elementMode==1&&(x.getId()||x.getNameAtt())||m();if(z.name in a.instances){throw'[CKEDITOR.editor] The instance "'+z.name+'" already exists.'}z.config=e.prototypedCopy(i);z.ui=new k(z);z.focusManager=new a.focusManager(z);a.fire("instanceCreated",null,z);z.on("mode",w,null,null,1);p(z,y)}})();e.extend(a.editor.prototype,{addCommand:function(l,m){return this._.commands[l]=new a.command(this,m)},addCss:function(l){this._.styles.push(l)},destroy:function(l){var m=this;if(!l){m.updateElement()}m.theme.destroy(m);m.fire("destroy");a.remove(m)},execCommand:function(l,m){var n=this.getCommand(l),o={name:l,commandData:m,command:n};if(n&&n.state!=0){if(this.fire("beforeCommandExec",o)!==true){o.returnValue=n.exec(o.commandData);if(!n.async&&this.fire("afterCommandExec",o)!==true){return o.returnValue}}}return false},getCommand:function(l){return this._.commands[l]},getData:function(){var n=this;n.fire("beforeGetData");var l=n._.data;if(typeof l!="string"){var m=n.element;if(m&&n.elementMode==1){l=m.is("textarea")?m.getValue():m.getHtml()}else{l=""}}l={dataValue:l};n.fire("getData",l);return l.dataValue},getSnapshot:function(){var l=this.fire("getSnapshot");if(typeof l!="string"){var m=this.element;if(m&&this.elementMode==1){l=m.is("textarea")?m.getValue():m.getHtml()}}return l},loadSnapshot:function(l){this.fire("loadSnapshot",l)},setData:function(l,m){if(m){this.on("dataReady",function(o){o.removeListener();m.call(o.editor)})}var n={dataValue:l};this.fire("setData",n);this._.data=n.dataValue;this.fire("afterSetData",n)},insertHtml:function(l){this.fire("insertHtml",l)},insertElement:function(l){this.fire("insertElement",l)},checkDirty:function(){return this.mayBeDirty&&this._.previousValue!==this.getSnapshot()},resetDirty:function(){if(this.mayBeDirty){this._.previousValue=this.getSnapshot()}},updateElement:function(){var m=this;var l=m.element;if(l&&m.elementMode==1){if(l.is("textarea")){l.setValue(m.getData())}else{l.setHtml(m.getData())}}}});a.on("loaded",function(){var l=a.editor._pending;if(l){delete a.editor._pending;for(var m=0;m<l.length;m++){l[m]._init()}}});a.htmlParser=function(){this._={htmlPartsRegex:new RegExp("<(?:(?:\\/([^>]+)>)|(?:!--([\\S|\\s]*?)-->)|(?:([^\\s>]+)\\s*((?:(?:[^\"'>]+)|(?:\"[^\"]*\")|(?:'[^']*'))*)\\/?>))","g")}};(function(){var l=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,m={checked:1,compact:1,declare:1,defer:1,disabled:1,ismap:1,multiple:1,nohref:1,noresize:1,noshade:1,nowrap:1,readonly:1,selected:1};a.htmlParser.prototype={onTagOpen:function(){},onTagClose:function(){},onText:function(){},onCDATA:function(){},onComment:function(){},parse:function(n){var A=this;var o,p,q=0,r;while(o=A._.htmlPartsRegex.exec(n)){var s=o.index;if(s>q){var t=n.substring(q,s);if(r){r.push(t)}else{A.onText(t)}}q=A._.htmlPartsRegex.lastIndex;if(p=o[1]){p=p.toLowerCase();if(r&&f.$cdata[p]){A.onCDATA(r.join(""));r=null}if(!r){A.onTagClose(p);continue}}if(r){r.push(o[0]);continue}if(p=o[3]){p=p.toLowerCase();var u={},v,w=o[4],x=!!(w&&w.charAt(w.length-1)=="/");if(w){while(v=l.exec(w)){var y=v[1].toLowerCase(),z=v[2]||v[3]||v[4]||"";if(!z&&m[y]){u[y]=y}else{u[y]=z}}}A.onTagOpen(p,u,x);if(!r&&f.$cdata[p]){r=[]}continue}if(p=o[2]){A.onComment(p)}}if(n.length>q){A.onText(n.substring(q,n.length))}}}})();a.htmlParser.comment=function(l){this.value=l;this._={isBlockLike:false}};a.htmlParser.comment.prototype={type:8,writeHtml:function(l,m){var n=this.value;if(m){if(!(n=m.onComment(n))){return }if(typeof n!="string"){n.writeHtml(l,m);return }}l.comment(n)}};(function(){var l=/[\t\r\n ]{2,}|[\t\r\n]/g;a.htmlParser.text=function(m){this.value=m;this._={isBlockLike:false}};a.htmlParser.text.prototype={type:3,writeHtml:function(m,n){var o=this.value;if(n&&!(o=n.onText(o,this))){return }m.text(o)}}})();(function(){a.htmlParser.cdata=function(l){this.value=l};a.htmlParser.cdata.prototype={type:3,writeHtml:function(l){l.write(this.value)}}})();a.htmlParser.fragment=function(){this.children=[];this.parent=null;this._={isBlockLike:true,hasInlineStarted:false}};(function(){var l={colgroup:1,dd:1,dt:1,li:1,option:1,p:1,td:1,tfoot:1,th:1,thead:1,tr:1},m=e.extend({table:1,ul:1,ol:1,dl:1},f.table,f.ul,f.ol,f.dl),n=f.$list,o=f.$listItem;a.htmlParser.fragment.fromHtml=function(p,q){var r=new a.htmlParser(),s=[],t=new a.htmlParser.fragment(),u=[],v=t,w=false,x;function y(C){if(u.length>0){for(var D=0;D<u.length;D++){var E=u[D],F=E.name,G=f[F],H=v.name&&f[v.name];if((!H||H[F])&&(!C||!G||G[C]||!f[C])){E=E.clone();E.parent=v;v=E;u.splice(D,1);D--}}}}function z(C,D,E){D=D||v||t;if(q&&!D.type){var F,G;if(C.attributes&&(G=C.attributes._cke_real_element_type)){F=G}else{F=C.name}if(!(F in f.$body)){var H=v;v=D;r.onTagOpen(q,{});D=v;if(E){v=H}}}if(C._.isBlockLike&&C.name!="pre"){var I=C.children.length,J=C.children[I-1],K;if(J&&J.type==3){if(!(K=e.rtrim(J.value))){C.children.length=I-1}else{J.value=K}}}D.add(C);if(C.returnPoint){v=C.returnPoint;delete C.returnPoint}}r.onTagOpen=function(C,D,E){var F=new a.htmlParser.element(C,D);if(F.isUnknown&&E){F.isEmpty=true}if(f.$removeEmpty[C]){u.push(F);return }else{if(C=="pre"){w=true}else{if(C=="br"&&w){v.add(new a.htmlParser.text("\n"));return }}}var G=v.name,H=G&&f[G]||(v._.isBlockLike?f.div:f.span);if(!F.isUnknown&&!v.isUnknown&&!H[C]){if(!G){return }var I=false,J;if(C in n&&G in n){var K=v.children,L=K[K.length-1];if(L&&L.name in o){x=v,J=L}else{z(v,v.parent)}}else{if(C==G){z(v,v.parent)}else{if(m[G]){if(!x){x=v}}else{z(v,v.parent,true);if(!l[G]){u.unshift(v)}}I=true}}if(J){v=J}else{v=v.returnPoint||v.parent}if(I){r.onTagOpen.apply(this,arguments);return }}y(C);F.parent=v;F.returnPoint=x;x=0;if(F.isEmpty){z(F)}else{v=F}};r.onTagClose=function(C){var D=0,E=[],F=v;while(F.type&&F.name!=C){if(!F._.isBlockLike){u.unshift(F);D++}E.push(F);F=F.parent}if(F.type){for(var G=0;G<E.length;G++){var H=E[G];z(H,H.parent)}v=F;if(v.name=="pre"){w=false}z(F,F.parent);if(F==v){v=v.parent}}else{u.splice(0,D);D=0}for(;D<u.length;D++){if(C==u[D].name){u.splice(D,1);D--}}};r.onText=function(C){if(!v._.hasInlineStarted&&!w){C=e.ltrim(C);if(C.length===0){return }}y();if(q&&!v.type){this.onTagOpen(q,{})}if(!w){C=C.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," ")}v.add(new a.htmlParser.text(C))};r.onCDATA=function(C){v.add(new a.htmlParser.cdata(C))};r.onComment=function(C){v.add(new a.htmlParser.comment(C))};r.parse(p);while(v.type){var A=v.parent,B=v;if(q&&!A.type&&!f.$body[B.name]){v=A;r.onTagOpen(q,{});A=v}A.add(B);v=A}return t};a.htmlParser.fragment.prototype={add:function(p){var s=this;var q=s.children.length,r=q>0&&s.children[q-1]||null;if(r){if(p._.isBlockLike&&r.type==3){r.value=e.rtrim(r.value);if(r.value.length===0){s.children.pop();s.add(p);return }}r.next=p}p.previous=r;p.parent=s;s.children.push(p);s._.hasInlineStarted=p.type==3||p.type==1&&!p._.isBlockLike},writeHtml:function(p,q){for(var r=0,s=this.children.length;r<s;r++){this.children[r].writeHtml(p,q)}}}})();a.htmlParser.element=function(l,m){var q=this;q.name=l;q.attributes=m;q.children=[];var n=f,o=!!(n.$block[l]||n.$listItem[l]||n.$tableContent[l]),p=!!n.$empty[l];q.isEmpty=p;q.isUnknown=!n[l];q._={isBlockLike:o,hasInlineStarted:p||!o}};(function(){var l=function(m,n){m=m[0];n=n[0];return m<n?-1:m>n?1:0};a.htmlParser.element.prototype={type:1,add:a.htmlParser.fragment.prototype.add,clone:function(){return new a.htmlParser.element(this.name,this.attributes)},writeHtml:function(m,n){var o=this.attributes;if(o._cke_replacedata){m.write(o._cke_replacedata);return }var p=this,q=p.name,r,s;if(n){for(;;){if(!(q=n.onElementName(q))){return }p.name=q;if(!(p=n.onElement(p))){return }if(p.name==q){break}q=p.name;if(!q){a.htmlParser.fragment.prototype.writeHtml.apply(p,arguments);return }}o=p.attributes}m.openTag(q,o);if(m.sortAttributes){var t=[];for(r in o){s=o[r];if(n&&(!(r=n.onAttributeName(r))||(s=n.onAttribute(p,r,s))===(false))){continue}t.push([r,s])}t.sort(l);for(var u=0,v=t.length;u<v;u++){var w=t[u];m.attribute(w[0],w[1])}}else{for(r in o){s=o[r];if(n&&(!(r=n.onAttributeName(r))||(s=n.onAttribute(p,r,s))===(false))){continue}m.attribute(r,s)}}m.openTagClose(q,p.isEmpty);if(!p.isEmpty){a.htmlParser.fragment.prototype.writeHtml.apply(p,arguments);m.closeTag(q)}}}})();(function(){a.htmlParser.filter=e.createClass({$:function(q){this._={elementNames:[],attributeNames:[],elements:{$length:0},attributes:{$length:0}};if(q){this.addRules(q,10)}},proto:{addRules:function(q,r){var s=this;if(typeof r!="number"){r=10}m(s._.elementNames,q.elementNames,r);m(s._.attributeNames,q.attributeNames,r);n(s._.elements,q.elements,r);n(s._.attributes,q.attributes,r);s._.text=o(s._.text,q.text,r)||s._.text;s._.comment=o(s._.comment,q.comment,r)||s._.comment},onElementName:function(q){return l(q,this._.elementNames)},onAttributeName:function(q){return l(q,this._.attributeNames)},onText:function(q){var r=this._.text;return r?r.filter(q):q},onComment:function(q){var r=this._.comment;return r?r.filter(q):q},onElement:function(q){var v=this;var r=[v._.elements[q.name],v._.elements.$],s,t;for(var u=0;u<2;u++){s=r[u];if(s){t=s.filter(q,v);if(t===false){return null}if(t&&t!=q){return v.onElement(t)}}}return q},onAttribute:function(q,r,s){var t=this._.attributes[r];if(t){var u=t.filter(s,q,this);if(u===false){return false}if(typeof u!="undefined"){return u}}return s}}});function l(q,r){for(var s=0;q&&s<r.length;s++){var t=r[s];q=q.replace(t[0],t[1])}return q}function m(q,r,s){var t,u,v=q.length,w=r&&r.length;if(w){for(t=0;t<v&&q[t].pri<s;t++){}for(u=w-1;u>=0;u--){var x=r[u];x.pri=s;q.splice(t,0,x)}}}function n(q,r,s){if(r){for(var t in r){var u=q[t];q[t]=o(u,r[t],s);if(!u){q.$length++}}}}function o(q,r,s){if(r){r.pri=s;if(q){if(!q.splice){if(q.pri>s){q=[r,q]}else{q=[q,r]}q.filter=p}else{m(q,r,s)}return q}else{r.filter=r;return r}}}function p(q){var r=typeof q=="object";for(var s=0;s<this.length;s++){var t=this[s],u=t.apply(window,arguments);if(typeof u!="undefined"){if(u===false){return false}if(r&&u!=q){return u}}}return null}})();a.htmlParser.basicWriter=e.createClass({$:function(){this._={output:[]}},proto:{openTag:function(l,m){this._.output.push("<",l)},openTagClose:function(l,m){if(m){this._.output.push(" />")}else{this._.output.push(">")}},attribute:function(l,m){this._.output.push(" ",l,'="',m,'"')},closeTag:function(l){this._.output.push("</",l,">")},text:function(l){this._.output.push(l)},comment:function(l){this._.output.push("<!--",l,"-->")},write:function(l){this._.output.push(l)},reset:function(){this._.output=[]},getHtml:function(l){var m=this._.output.join("");if(l){this.reset()}return m}}});delete a.loadFullCore;a.instances={};a.document=new g(document);a.add=function(l){a.instances[l.name]=l;l.on("focus",function(){if(a.currentInstance!=l){a.currentInstance=l;a.fire("currentInstance")}});l.on("blur",function(){if(a.currentInstance==l){a.currentInstance=null;a.fire("currentInstance")}})};a.remove=function(l){delete a.instances[l.name]};a.TRISTATE_ON=1;a.TRISTATE_OFF=2;a.TRISTATE_DISABLED=0;(function(){var l={address:1,blockquote:1,dl:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1,li:1,dt:1,de:1},m={body:1,div:1,table:1,tbody:1,tr:1,td:1,th:1,caption:1,form:1},n=function(o){var p=o.getChildren();for(var q=0,r=p.count();q<r;q++){var s=p.getItem(q);if(s.type==1&&f.$block[s.getName()]){return true}}return false};d.elementPath=function(o){var u=this;var p=null,q=null,r=[],s=o;while(s){if(s.type==1){if(!u.lastElement){u.lastElement=s}var t=s.getName();if(c&&s.$.scopeName!="HTML"){t=s.$.scopeName.toLowerCase()+":"+t}if(!q){if(!p&&l[t]){p=s}if(m[t]){if(!p&&t=="div"&&!n(s)){p=s}else{q=s}}}r.push(s);if(t=="body"){break}}s=s.getParent()}u.block=p;u.blockLimit=q;u.elements=r}})();d.elementPath.prototype={compare:function(l){var m=this.elements,n=l&&l.elements;if(!n||m.length!=n.length){return false}for(var o=0;o<m.length;o++){if(!m[o].equals(n[o])){return false}}return true}};d.text=function(l,m){if(typeof l=="string"){l=(m?m.$:document).createTextNode(l)}this.$=l};d.text.prototype=new d.node();e.extend(d.text.prototype,{type:3,getLength:function(){return this.$.nodeValue.length},getText:function(){return this.$.nodeValue},split:function(l){var q=this;if(c&&l==q.getLength()){var m=q.getDocument().createText("");m.insertAfter(q);return m}var n=q.getDocument(),o=new d.text(q.$.splitText(l),n);if(b.ie8){var p=new d.text("",n);p.insertAfter(o);p.remove()}return o},substring:function(l,m){if(typeof m!="number"){return this.$.nodeValue.substr(l)}else{return this.$.nodeValue.substring(l,m)}}});d.documentFragment=function(l){l=l||a.document;this.$=l.$.createDocumentFragment()};e.extend(d.documentFragment.prototype,h.prototype,{type:11,insertAfterNode:function(l){l=l.$;l.parentNode.insertBefore(this.$,l.nextSibling)}},true,{append:1,appendBogus:1,getFirst:1,getLast:1,appendTo:1,moveChildren:1,insertBefore:1,insertAfterNode:1,replace:1,trim:1,type:1,ltrim:1,rtrim:1,getDocument:1,getChildCount:1,getChild:1,getChildren:1});(function(){function l(p,q){if(this._.end){return null}var r,s=this.range,t,u=this.guard,v=this.type,w=p?"getPreviousSourceNode":"getNextSourceNode";if(!this._.start){this._.start=1;s.trim();if(s.collapsed){this.end();return null}}if(!p&&!this._.guardLTR){var x=s.endContainer,y=x.getChild(s.endOffset);this._.guardLTR=function(C,D){return(!D||!x.equals(C))&&((!y||!C.equals(y))&&(C.type!=1||C.getName()!="body"))}}if(p&&!this._.guardRTL){var z=s.startContainer,A=s.startOffset>0&&z.getChild(s.startOffset-1);this._.guardRTL=function(C,D){return(!D||!z.equals(C))&&((!A||!C.equals(A))&&(C.type!=1||C.getName()!="body"))}}var B=p?this._.guardRTL:this._.guardLTR;if(u){t=function(C,D){if(B(C,D)===false){return false}return u(C)}}else{t=B}if(this.current){r=this.current[w](false,v,t)}else{if(p){r=s.endContainer;if(s.endOffset>0){r=r.getChild(s.endOffset-1);if(t(r)===false){r=null}}else{r=t(r)===false?null:r.getPreviousSourceNode(true,v,t)}}else{r=s.startContainer;r=r.getChild(s.startOffset);if(r){if(t(r)===false){r=null}}else{r=t(s.startContainer)===false?null:s.startContainer.getNextSourceNode(true,v,t)}}}while(r&&!this._.end){this.current=r;if(!this.evaluator||this.evaluator(r)!==false){if(!q){return r}}else{if(q&&this.evaluator){return false}}r=r[w](false,v,t)}this.end();return this.current=null}function m(p){var q,r=null;while(q=l.call(this,p)){r=q}return r}d.walker=e.createClass({$:function(p){this.range=p;this._={}},proto:{end:function(){this._.end=1},next:function(){return l.call(this)},previous:function(){return l.call(this,true)},checkForward:function(){return l.call(this,false,true)!==false},checkBackward:function(){return l.call(this,true,true)!==false},lastForward:function(){return m.call(this)},lastBackward:function(){return m.call(this,true)},reset:function(){delete this.current;this._={}}}});var n={block:1,"list-item":1,table:1,"table-row-group":1,"table-header-group":1,"table-footer-group":1,"table-row":1,"table-column-group":1,"table-column":1,"table-cell":1,"table-caption":1},o={hr:1};h.prototype.isBlockBoundary=function(p){var q=e.extend({},o,p||{});return n[this.getComputedStyle("display")]||q[this.getName()]};d.walker.blockBoundary=function(p){return function(q,r){return !(q.type==1&&q.isBlockBoundary(p))}};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1})};d.walker.bookmarkContents=function(p){},d.walker.bookmark=function(p,q){function r(s){return s&&s.getName&&s.getName()=="span"&&s.hasAttribute("_fck_bookmark")}return function(s){var t,u;t=s&&!s.getName&&(u=s.getParent())&&(r(u));t=p?t:t||r(s);return q^t}};d.walker.whitespaces=function(p){return function(q){var r=q&&q.type==3&&!e.trim(q.getText());return p^r}}})();d.range=function(l){var m=this;m.startContainer=null;m.startOffset=null;m.endContainer=null;m.endOffset=null;m.collapsed=true;m.document=l};(function(){var l=function(q){q.collapsed=q.startContainer&&q.endContainer&&q.startContainer.equals(q.endContainer)&&q.startOffset==q.endOffset},m=function(q,r,s){q.optimizeBookmark();var t=q.startContainer,u=q.endContainer,v=q.startOffset,w=q.endOffset,x,y;if(u.type==3){u=u.split(w)}else{if(u.getChildCount()>0){if(w>=u.getChildCount()){u=u.append(q.document.createText(""));y=true}else{u=u.getChild(w)}}}if(t.type==3){t.split(v);if(t.equals(u)){u=t.getNext()}}else{if(!v){t=t.getFirst().insertBeforeMe(q.document.createText(""));x=true}else{if(v>=t.getChildCount()){t=t.append(q.document.createText(""));x=true}else{t=t.getChild(v).getPrevious()}}}var z=t.getParents(),A=u.getParents(),B,C,D;for(B=0;B<z.length;B++){C=z[B];D=A[B];if(!C.equals(D)){break}}var E=s,F,G,H,I;for(var J=B;J<z.length;J++){F=z[J];if(E&&!F.equals(t)){G=E.append(F.clone())}H=F.getNext();while(H){if(H.equals(A[J])||H.equals(u)){break}I=H.getNext();if(r==2){E.append(H.clone(true))}else{H.remove();if(r==1){E.append(H)}}H=I}if(E){E=G}}E=s;for(var K=B;K<A.length;K++){F=A[K];if(r>0&&!F.equals(u)){G=E.append(F.clone())}if(!z[K]||F.$.parentNode!=z[K].$.parentNode){H=F.getPrevious();while(H){if(H.equals(z[K])||H.equals(t)){break}I=H.getPrevious();if(r==2){E.$.insertBefore(H.$.cloneNode(true),E.$.firstChild)}else{H.remove();if(r==1){E.$.insertBefore(H.$,E.$.firstChild)}}H=I}}if(E){E=G}}if(r==2){var L=q.startContainer;if(L.type==3){L.$.data+=L.$.nextSibling.data;L.$.parentNode.removeChild(L.$.nextSibling)}var M=q.endContainer;if(M.type==3&&M.$.nextSibling){M.$.data+=M.$.nextSibling.data;M.$.parentNode.removeChild(M.$.nextSibling)}}else{if(C&&D&&(t.$.parentNode!=C.$.parentNode||u.$.parentNode!=D.$.parentNode)){var N=D.getIndex();if(x&&D.$.parentNode==t.$.parentNode){N--}q.setStart(D.getParent(),N)}q.collapse(true)}if(x){t.remove()}if(y&&u.$.parentNode){u.remove()}},n={abbr:1,acronym:1,b:1,bdo:1,big:1,cite:1,code:1,del:1,dfn:1,em:1,font:1,i:1,ins:1,label:1,kbd:1,q:1,samp:1,small:1,span:1,strike:1,strong:1,sub:1,sup:1,tt:1,u:1,"var":1};function o(q){var r=false,s=d.walker.bookmark(true);return function(t){if(s(t)){return true}if(t.type==3){if(e.trim(t.getText()).length){return false}}else{if(!n[t.getName()]){if(!q&&!c&&t.getName()=="br"&&!r){r=true}else{return false}}}return true}}function p(q){return q.type!=3&&q.getName() in f.$removeEmpty||!e.trim(q.getText())||q.getParent().hasAttribute("_fck_bookmark")}d.range.prototype={clone:function(){var r=this;var q=new d.range(r.document);q.startContainer=r.startContainer;q.startOffset=r.startOffset;q.endContainer=r.endContainer;q.endOffset=r.endOffset;q.collapsed=r.collapsed;return q},collapse:function(q){var r=this;if(q){r.endContainer=r.startContainer;r.endOffset=r.startOffset}else{r.startContainer=r.endContainer;r.startOffset=r.endOffset}r.collapsed=true},cloneContents:function(){var q=new d.documentFragment(this.document);if(!this.collapsed){m(this,2,q)}return q},deleteContents:function(){if(this.collapsed){return }m(this,0)},extractContents:function(){var q=new d.documentFragment(this.document);if(!this.collapsed){m(this,1,q)}return q},createBookmark:function(q){var v=this;var r,s,t,u;r=v.document.createElement("span");r.setAttribute("_fck_bookmark",1);r.setStyle("display","none");r.setHtml("&nbsp;");if(q){t="cke_bm_"+e.getNextNumber();r.setAttribute("id",t+"S")}if(!v.collapsed){s=r.clone();s.setHtml("&nbsp;");if(q){s.setAttribute("id",t+"E")}u=v.clone();u.collapse();u.insertNode(s)}u=v.clone();u.collapse(true);u.insertNode(r);if(s){v.setStartAfter(r);v.setEndBefore(s)}else{v.moveToPosition(r,4)}return{startNode:q?t+"S":r,endNode:q?t+"E":s,serializable:q}},createBookmark2:function(q){var x=this;var r=x.startContainer,s=x.endContainer,t=x.startOffset,u=x.endOffset,v,w;if(!r||!s){return{start:0,end:0}}if(q){if(r.type==1){v=r.getChild(t);if(v&&v.type==3&&t>0&&v.getPrevious().type==3){r=v;t=0}}while(r.type==3&&(w=r.getPrevious())&&(w.type==3)){r=w;t+=w.getLength()}if(!x.isCollapsed){if(s.type==1){v=s.getChild(u);if(v&&v.type==3&&u>0&&v.getPrevious().type==3){s=v;u=0}}while(s.type==3&&(w=s.getPrevious())&&(w.type==3)){s=w;u+=w.getLength()}}}return{start:r.getAddress(q),end:x.isCollapsed?null:s.getAddress(q),startOffset:t,endOffset:u,normalized:q,is2:true}},moveToBookmark:function(q){var y=this;if(q.is2){var r=y.document.getByAddress(q.start,q.normalized),s=q.startOffset,t=q.end&&y.document.getByAddress(q.end,q.normalized),u=q.endOffset;y.setStart(r,s);if(t){y.setEnd(t,u)}else{y.collapse(true)}}else{var v=q.serializable,w=v?y.document.getById(q.startNode):q.startNode,x=v?y.document.getById(q.endNode):q.endNode;y.setStartBefore(w);w.remove();if(x){y.setEndBefore(x);x.remove()}else{y.collapse(true)}}},getBoundaryNodes:function(){var v=this;var q=v.startContainer,r=v.endContainer,s=v.startOffset,t=v.endOffset,u;if(q.type==1){u=q.getChildCount();if(u>s){q=q.getChild(s)}else{if(u<1){q=q.getPreviousSourceNode()}else{q=q.$;while(q.lastChild){q=q.lastChild}q=new d.node(q);q=q.getNextSourceNode()||q}}}if(r.type==1){u=r.getChildCount();if(u>t){r=r.getChild(t).getPreviousSourceNode(true)}else{if(u<1){r=r.getPreviousSourceNode()}else{r=r.$;while(r.lastChild){r=r.lastChild}r=new d.node(r)}}}if(q.getPosition(r)&2){q=r}return{startNode:q,endNode:r}},getCommonAncestor:function(q,r){var v=this;var s=v.startContainer,t=v.endContainer,u;if(s.equals(t)){if(q&&s.type==1&&v.startOffset==v.endOffset-1){u=s.getChild(v.startOffset)}else{u=s}}else{u=s.getCommonAncestor(t)}return r&&!u.is?u.getParent():u},optimize:function(){var s=this;var q=s.startContainer,r=s.startOffset;if(q.type!=1){if(!r){s.setStartBefore(q)}else{if(r>=q.getLength()){s.setStartAfter(q)}}}q=s.endContainer;r=s.endOffset;if(q.type!=1){if(!r){s.setEndBefore(q)}else{if(r>=q.getLength()){s.setEndAfter(q)}}}},optimizeBookmark:function(){var s=this;var q=s.startContainer,r=s.endContainer;if(q.is&&q.is("span")&&q.hasAttribute("_fck_bookmark")){s.setStartAt(q,3)}if(r&&r.is&&r.is("span")&&r.hasAttribute("_fck_bookmark")){s.setEndAt(r,4)}},trim:function(q,r){var y=this;var s=y.startContainer,t=y.startOffset,u=y.collapsed;if((!q||u)&&(s&&s.type==3)){if(!t){t=s.getIndex();s=s.getParent()}else{if(t>=s.getLength()){t=s.getIndex()+1;s=s.getParent()}else{var v=s.split(t);t=s.getIndex()+1;s=s.getParent();if(!u&&y.startContainer.equals(y.endContainer)){y.setEnd(v,y.endOffset-y.startOffset)}}}y.setStart(s,t);if(u){y.collapse(true)}}var w=y.endContainer,x=y.endOffset;if(!(r||u)&&w&&w.type==3){if(!x){x=w.getIndex();w=w.getParent()}else{if(x>=w.getLength()){x=w.getIndex()+1;w=w.getParent()}else{w.split(x);x=w.getIndex()+1;w=w.getParent()}}y.setEnd(w,x)}},enlarge:function(q){switch(q){case 1:if(this.collapsed){return }var r=this.getCommonAncestor(),s=this.document.getBody(),t,u,v,w,x,y=false,z,A,B=this.startContainer,C=this.startOffset;if(B.type==3){if(C){B=!e.trim(B.substring(0,C)).length&&B;y=!!B}if(B){if(!(w=B.getPrevious())){v=B.getParent()}}}else{if(C){w=B.getChild(C-1)||B.getLast()}if(!w){v=B}}while(v||w){if(v&&!w){if(!x&&v.equals(r)){x=true}if(!s.contains(v)){break}if(!y||v.getComputedStyle("display")!="inline"){y=false;if(x){t=v}else{this.setStartBefore(v)}}w=v.getPrevious()}while(w){z=false;if(w.type==3){A=w.getText();if(/[^\s\ufeff]/.test(A)){w=null}z=/[\s\ufeff]$/.test(A)}else{if(w.$.offsetWidth>0&&!w.getAttribute("_fck_bookmark")){if(y&&f.$removeEmpty[w.getName()]){A=w.getText();if(!/[^\s\ufeff]/.test(A)){w=null}else{var D=w.$.all||w.$.getElementsByTagName("*");for(var E=0,F;F=D[E++];){if(!f.$removeEmpty[F.nodeName.toLowerCase()]){w=null;break}}}if(w){z=!!A.length}}else{w=null}}}if(z){if(y){if(x){t=v}else{if(v){this.setStartBefore(v)}}}else{y=true}}if(w){var G=w.getPrevious();if(!v&&!G){v=w;w=null;break}w=G}else{v=null}}if(v){v=v.getParent()}}B=this.endContainer;C=this.endOffset;v=w=null;x=y=false;if(B.type==3){B=!e.trim(B.substring(C)).length&&B;y=!(B&&B.getLength());if(B){if(!(w=B.getNext())){v=B.getParent()}}}else{w=B.getChild(C);if(!w){v=B}}while(v||w){if(v&&!w){if(!x&&v.equals(r)){x=true}if(!s.contains(v)){break}if(!y||v.getComputedStyle("display")!="inline"){y=false;if(x){u=v}else{if(v){this.setEndAfter(v)}}}w=v.getNext()}while(w){z=false;if(w.type==3){A=w.getText();if(/[^\s\ufeff]/.test(A)){w=null}z=/^[\s\ufeff]/.test(A)}else{if(w.$.offsetWidth>0&&!w.getAttribute("_fck_bookmark")){if(y&&f.$removeEmpty[w.getName()]){A=w.getText();if(!/[^\s\ufeff]/.test(A)){w=null}else{D=w.$.all||w.$.getElementsByTagName("*");for(E=0;F=D[E++];){if(!f.$removeEmpty[F.nodeName.toLowerCase()]){w=null;break}}}if(w){z=!!A.length}}else{w=null}}}if(z){if(y){if(x){u=v}else{this.setEndAfter(v)}}}if(w){G=w.getNext();if(!v&&!G){v=w;w=null;break}w=G}else{v=null}}if(v){v=v.getParent()}}if(t&&u){r=t.contains(u)?u:t;this.setStartBefore(r);this.setEndAfter(r)}break;case 2:case 3:var H=new d.range(this.document);s=this.document.getBody();H.setStartAt(s,1);H.setEnd(this.startContainer,this.startOffset);var I=new d.walker(H),J,K,L=d.walker.blockBoundary(q==3?{br:1}:null),M=function(O){var P=L(O);if(!P){J=O}return P},N=function(O){var P=M(O);if(!P&&O.is&&O.is("br")){K=O}return P};I.guard=M;v=I.lastBackward();J=J||s;this.setStartAt(J,!J.is("br")&&(!v||J.contains(v))?1:4);H=this.clone();H.collapse();H.setEndAt(s,2);I=new d.walker(H);I.guard=q==3?N:M;J=null;v=I.lastForward();J=J||s;this.setEndAt(J,!J.is("br")&&(!v||J.contains(v))?2:3);if(K){this.setEndAfter(K)}}},insertNode:function(q){var u=this;u.optimizeBookmark();u.trim(false,true);var r=u.startContainer,s=u.startOffset,t=r.getChild(s);if(t){q.insertBefore(t)}else{r.append(q)}if(q.getParent().equals(u.endContainer)){u.endOffset++}u.setStartBefore(q)},moveToPosition:function(q,r){this.setStartAt(q,r);this.collapse(true)},selectNodeContents:function(q){this.setStart(q,0);this.setEnd(q,q.type==3?q.getLength():q.getChildCount())},setStart:function(q,r){var s=this;s.startContainer=q;s.startOffset=r;if(!s.endContainer){s.endContainer=q;s.endOffset=r}l(s)},setEnd:function(q,r){var s=this;s.endContainer=q;s.endOffset=r;if(!s.startContainer){s.startContainer=q;s.startOffset=r}l(s)},setStartAfter:function(q){this.setStart(q.getParent(),q.getIndex()+1)},setStartBefore:function(q){this.setStart(q.getParent(),q.getIndex())},setEndAfter:function(q){this.setEnd(q.getParent(),q.getIndex()+1)},setEndBefore:function(q){this.setEnd(q.getParent(),q.getIndex())},setStartAt:function(q,r){var s=this;switch(r){case 1:s.setStart(q,0);break;case 2:if(q.type==3){s.setStart(q,q.getLength())}else{s.setStart(q,q.getChildCount())}break;case 3:s.setStartBefore(q);break;case 4:s.setStartAfter(q)}l(s)},setEndAt:function(q,r){var s=this;switch(r){case 1:s.setEnd(q,0);break;case 2:if(q.type==3){s.setEnd(q,q.getLength())}else{s.setEnd(q,q.getChildCount())}break;case 3:s.setEndBefore(q);break;case 4:s.setEndAfter(q)}l(s)},fixBlock:function(q,r){var u=this;var s=u.createBookmark(),t=u.document.createElement(r);u.collapse(q);u.enlarge(2);u.extractContents().appendTo(t);t.trim();if(!c){t.appendBogus()}u.insertNode(t);u.moveToBookmark(s);return t},splitBlock:function(q){var B=this;var r=new d.elementPath(B.startContainer),s=new d.elementPath(B.endContainer),t=r.blockLimit,u=s.blockLimit,v=r.block,w=s.block,x=null;if(!t.equals(u)){return null}if(q!="br"){if(!v){v=B.fixBlock(true,q);w=new d.elementPath(B.endContainer).block}if(!w){w=B.fixBlock(false,q)}}var y=v&&B.checkStartOfBlock(),z=w&&B.checkEndOfBlock();B.deleteContents();if(v&&v.equals(w)){if(z){x=new d.elementPath(B.startContainer);B.moveToPosition(w,4);w=null}else{if(y){x=new d.elementPath(B.startContainer);B.moveToPosition(v,3);v=null}else{B.setEndAt(v,2);var A=B.extractContents();w=v.clone(false);A.appendTo(w);w.insertAfter(v);B.moveToPosition(v,4);if(!c&&!v.is("ul","ol")){v.appendBogus()}}}}return{previousBlock:v,nextBlock:w,wasStartOfBlock:y,wasEndOfBlock:z,elementPath:x}},checkBoundaryOfElement:function(q,r){var s=this.clone();s[r==1?"setStartAt":"setEndAt"](q,r==1?1:2);var t=new d.walker(s),u=false;t.evaluator=p;return t[r==1?"checkBackward":"checkForward"]()},checkStartOfBlock:function(){var w=this;var q=w.startContainer,r=w.startOffset;if(r&&q.type==3){var s=e.ltrim(q.substring(0,r));if(s.length){return false}}w.trim();var t=new d.elementPath(w.startContainer),u=w.clone();u.collapse(true);u.setStartAt(t.block||t.blockLimit,1);var v=new d.walker(u);v.evaluator=o(true);return v.checkBackward()},checkEndOfBlock:function(){var w=this;var q=w.endContainer,r=w.endOffset;if(q.type==3){var s=e.rtrim(q.substring(r));if(s.length){return false}}w.trim();var t=new d.elementPath(w.endContainer),u=w.clone();u.collapse(false);u.setEndAt(t.block||t.blockLimit,2);var v=new d.walker(u);v.evaluator=o(false);return v.checkForward()},moveToElementEditStart:function(q){var r;while(q&&q.type==1){if(q.isEditable()){r=q}else{if(r){break}}q=q.getFirst()}if(r){this.moveToPosition(r,1);return true}else{return false}},getEnclosedNode:function(){var q=this.clone(),r=new d.walker(q),s=d.walker.bookmark(true),t=d.walker.whitespaces(true),u=function(w){return t(w)&&s(w)};q.evaluator=u;var v=r.next();r.reset();return v&&v.equals(r.previous())?v:null},getTouchedStartNode:function(){var q=this.startContainer;if(this.collapsed||q.type!=1){return q}return q.getChild(this.startOffset)||q},getTouchedEndNode:function(){var q=this.endContainer;if(this.collapsed||q.type!=1){return q}return q.getChild(this.endOffset-1)||q}}})();a.POSITION_AFTER_START=1;a.POSITION_BEFORE_END=2;a.POSITION_BEFORE_START=3;a.POSITION_AFTER_END=4;a.ENLARGE_ELEMENT=1;a.ENLARGE_BLOCK_CONTENTS=2;a.ENLARGE_LIST_ITEM_CONTENTS=3;a.START=1;a.END=2;a.STARTEND=3;(function(){var l=c&&b.version<7?a.basePath+"images/spacer.gif":"about:blank",m=h.createFromHtml('<div style="width:0px;height:0px;position:absolute;left:-10000px;background-image:url('+l+')"></div>',a.document);m.appendTo(a.document.getHead());try{b.hc=m.getComputedStyle("background-image")=="none"}catch(n){b.hc=false}if(b.hc){b.cssClass+=" cke_hc"}m.remove()})();j.load(i.corePlugins.split(","),function(){a.status="loaded";a.fire("loaded");var l=a._.pending;if(l){delete a._.pending;for(var m=0;m<l.length;m++){a.add(l[m])}}});j.add("about",{init:function(l){var m=l.addCommand("about",new a.dialogCommand("about"));m.modes={wysiwyg:1,source:1};m.canUndo=false;l.ui.addButton("About",{label:l.lang.about.title,command:"about"});a.dialog.add("about",this.path+"dialogs/about.js")}});j.add("basicstyles",{requires:["styles","button"],init:function(l){var m=function(p,q,r,s){var t=new a.style(s);l.attachStyleStateChange(t,function(u){l.getCommand(r).setState(u)});l.addCommand(r,new a.styleCommand(t));l.ui.addButton(p,{label:q,command:r})},n=l.config,o=l.lang;m("Bold",o.bold,"bold",n.coreStyles_bold);m("Italic",o.italic,"italic",n.coreStyles_italic);m("Underline",o.underline,"underline",n.coreStyles_underline);m("Strike",o.strike,"strike",n.coreStyles_strike);m("Subscript",o.subscript,"subscript",n.coreStyles_subscript);m("Superscript",o.superscript,"superscript",n.coreStyles_superscript)}});i.coreStyles_bold={element:"strong",overrides:"b"};i.coreStyles_italic={element:"em",overrides:"i"};i.coreStyles_underline={element:"u"};i.coreStyles_strike={element:"strike"};i.coreStyles_subscript={element:"sub"};i.coreStyles_superscript={element:"sup"};(function(){function l(p,q){var r=q.block||q.blockLimit;if(!r||r.getName()=="body"){return 2}if(r.getAscendant("blockquote",true)){return 1}return 2}function m(p){var q=p.editor,r=q.getCommand("blockquote");r.state=l(q,p.data.path);r.fire("state")}function n(p){for(var q=0,r=p.getChildCount(),s;q<r&&(s=p.getChild(q));q++){if(s.type==1&&s.isBlockBoundary()){return false}}return true}var o={exec:function(p){var q=p.getCommand("blockquote").state,r=p.getSelection(),s=r&&r.getRanges()[0];if(!s){return }var t=r.createBookmarks();if(c){var u=t[0].startNode,v=t[0].endNode,w;if(u&&u.getParent().getName()=="blockquote"){w=u;while(w=w.getNext()){if(w.type==1&&w.isBlockBoundary()){u.move(w,true);break}}}if(v&&v.getParent().getName()=="blockquote"){w=v;while(w=w.getPrevious()){if(w.type==1&&w.isBlockBoundary()){v.move(w);break}}}}var x=s.createIterator(),y;if(q==2){var z=[];while(y=x.getNextParagraph()){z.push(y)}if(z.length<1){var A=p.document.createElement(p.config.enterMode==1?"p":"div"),B=t.shift();s.insertNode(A);A.append(new d.text("",p.document));s.moveToBookmark(B);s.selectNodeContents(A);s.collapse(true);B=s.createBookmark();z.push(A);t.unshift(B)}var C=z[0].getParent(),D=[];for(var E=0;E<z.length;E++){y=z[E];C=C.getCommonAncestor(y.getParent())}var F={table:1,tbody:1,tr:1,ol:1,ul:1};while(F[C.getName()]){C=C.getParent()}var G=null;while(z.length>0){y=z.shift();while(!y.getParent().equals(C)){y=y.getParent()}if(!y.equals(G)){D.push(y)}G=y}while(D.length>0){y=D.shift();if(y.getName()=="blockquote"){var H=new d.documentFragment(p.document);while(y.getFirst()){H.append(y.getFirst().remove());z.push(H.getLast())}H.replace(y)}else{z.push(y)}}var I=p.document.createElement("blockquote");I.insertBefore(z[0]);while(z.length>0){y=z.shift();I.append(y)}}else{if(q==1){var J=[],K={};while(y=x.getNextParagraph()){var L=null,M=null;while(y.getParent()){if(y.getParent().getName()=="blockquote"){L=y.getParent();M=y;break}y=y.getParent()}if(L&&M&&!M.getCustomData("blockquote_moveout")){J.push(M);h.setMarker(K,M,"blockquote_moveout",true)}}h.clearAllMarkers(K);var N=[],O=[];K={};while(J.length>0){var P=J.shift();I=P.getParent();if(!P.getPrevious()){P.remove().insertBefore(I)}else{if(!P.getNext()){P.remove().insertAfter(I)}else{P.breakParent(P.getParent());O.push(P.getNext())}}if(!I.getCustomData("blockquote_processed")){O.push(I);h.setMarker(K,I,"blockquote_processed",true)}N.push(P)}h.clearAllMarkers(K);for(E=O.length-1;E>=0;E--){I=O[E];if(n(I)){I.remove()}}if(p.config.enterMode==2){var Q=true;while(N.length){P=N.shift();if(P.getName()=="div"){H=new d.documentFragment(p.document);var R=Q&&P.getPrevious()&&!(P.getPrevious().type==1&&P.getPrevious().isBlockBoundary());if(R){H.append(p.document.createElement("br"))}var S=P.getNext()&&!(P.getNext().type==1&&P.getNext().isBlockBoundary());while(P.getFirst()){P.getFirst().remove().appendTo(H)}if(S){H.append(p.document.createElement("br"))}H.replace(P);Q=false}}}}}r.selectBookmarks(t);p.focus()}};j.add("blockquote",{init:function(p){p.addCommand("blockquote",o);p.ui.addButton("Blockquote",{label:p.lang.blockquote,command:"blockquote"});p.on("selectionChange",m)},requires:["domiterator"]})})();j.add("button",{beforeInit:function(l){l.ui.addHandler(1,k.button.handler)}});a.UI_BUTTON=1;k.button=function(l){e.extend(this,l,{title:l.label,className:l.className||l.command&&"cke_button_"+l.command||"",click:l.click||(function(m){m.execCommand(l.command)})});this._={}};k.button.handler={create:function(l){return new k.button(l)}};k.button.prototype={canGroup:true,render:function(l,m){var n=b,o=this._.id="cke_"+e.getNextNumber();this._.editor=l;var p={id:o,button:this,editor:l,focus:function(){var v=a.document.getById(o);v.focus()},execute:function(){this.button.click(l)}},q=e.addFunction(p.execute,p),r=k.button._.instances.push(p)-1,s="",t=this.command;if(this.modes){l.on("mode",function(){this.setState(this.modes[l.mode]?2:0)},this)}else{if(t){t=l.getCommand(t);if(t){t.on("state",function(){this.setState(t.state)},this);s+="cke_"+(t.state==1?"on":t.state==0?"disabled":"off")}}}if(!t){s+="cke_off"}if(this.className){s+=" "+this.className}m.push('<span class="cke_button">','<a id="',o,'" class="',s,'" href="javascript:void(\'',(this.title||"").replace("'",""),'\')" title="',this.title,'" tabindex="-1" hidefocus="true"');if(n.opera||n.gecko&&n.mac){m.push(' onkeypress="return false;"')}if(n.gecko){m.push(' onblur="this.style.cssText = this.style.cssText;"')}m.push(' onkeydown="return CKEDITOR.ui.button._.keydown(',r,', event);" onfocus="return CKEDITOR.ui.button._.focus(',r,', event);" onclick="CKEDITOR.tools.callFunction(',q,', this); return false;"><span class="cke_icon"');if(this.icon){var u=(this.iconOffset||0)*(-16);m.push(' style="background-image:url(',a.getUrl(this.icon),");background-position:0 "+u+'px;"')}m.push('></span><span class="cke_label">',this.label,"</span>");if(this.hasArrow){m.push('<span class="cke_buttonarrow"></span>')}m.push("</a>","</span>");if(this.onRender){this.onRender()}return p},setState:function(l){var q=this;if(q._.state==l){return }var m=a.document.getById(q._.id);if(m){m.setState(l);var n=q.title,o=q._.editor.lang.common.unavailable,p=m.getChild(1);if(l==0){n=o.replace("%1",q.title)}p.setHtml(n)}q._.state=l}};k.button._={instances:[],keydown:function(l,m){var n=k.button._.instances[l];if(n.onkey){m=new d.event(m);return n.onkey(n,m.getKeystroke())!==false}},focus:function(l,m){var n=k.button._.instances[l],o;if(n.onfocus){o=n.onfocus(n,new d.event(m))!==false}if(b.gecko&&b.version<10900){m.preventBubble()}return o}};k.prototype.addButton=function(l,m){this.add(l,1,m)};(function(){var l=function(q,r){var s=q.document,t=s.getBody(),u=false,v=function(){u=true};t.on(r,v);s.$.execCommand(r);t.removeListener(r,v);return u},m=c?function(q,r){return l(q,r)}:function(q,r){try{return q.document.$.execCommand(r)}catch(s){return false}},n=function(q){this.type=q;this.canUndo=this.type=="cut"};n.prototype={exec:function(q,r){var s=m(q,this.type);if(!s){alert(q.lang.clipboard[this.type+"Error"])}return s}};var o=c?{exec:function(q,r){q.focus();if(!q.fire("beforePaste")&&!l(q,"paste")){q.openDialog("paste")}}}:{exec:function(q){try{if(!q.fire("beforePaste")&&!q.document.$.execCommand("Paste",false,null)){throw 0}}catch(r){q.openDialog("paste")}}},p=function(q){switch(q.data.keyCode){case 1000+86:case 2000+45:var r=this;r.fire("saveSnapshot");if(r.fire("beforePaste")){q.cancel()}setTimeout(function(){r.fire("saveSnapshot")},0);return ;case 1000+88:case 2000+46:r=this;r.fire("saveSnapshot");setTimeout(function(){r.fire("saveSnapshot")},0)}};j.add("clipboard",{init:function(q){function r(t,u,v,w){var x=q.lang[u];q.addCommand(u,v);q.ui.addButton(t,{label:x,command:u});if(q.addMenuItems){q.addMenuItem(u,{label:x,command:u,group:"clipboard",order:w})}}r("Cut","cut",new n("cut"),1);r("Copy","copy",new n("copy"),4);r("Paste","paste",o,8);a.dialog.add("paste",a.getUrl(this.path+"dialogs/paste.js"));q.on("key",p,q);if(q.contextMenu){function s(t){return q.document.$.queryCommandEnabled(t)?2:0}q.contextMenu.addListener(function(){return{cut:s("Cut"),copy:s("Cut"),paste:b.webkit?2:s("Paste")}})}}})})();j.add("colorbutton",{requires:["panelbutton","floatpanel","styles"],init:function(l){var m=l.config,n=l.lang.colorButton,o;if(!b.hc){p("TextColor","fore",n.textColorTitle);p("BGColor","back",n.bgColorTitle)}function p(r,s,t){l.ui.add(r,4,{label:t,title:t,className:"cke_button_"+r.toLowerCase(),modes:{wysiwyg:1},panel:{css:[a.getUrl(l.skinPath+"editor.css")]},onBlock:function(u,v){var w=u.addBlock(v);w.autoSize=true;w.element.addClass("cke_colorblock");w.element.setHtml(q(u,s));var x=w.keys;x[39]="next";x[9]="next";x[37]="prev";x[2000+9]="prev";x[32]="click"}})}function q(r,s){var t=[],u=m.colorButton_colors.split(","),v=e.addFunction(function(z,A){if(z=="?"){return }l.focus();r.hide();var B=new a.style(m["colorButton_"+A+"Style"],z&&{color:z});l.fire("saveSnapshot");if(z){B.apply(l.document)}else{B.remove(l.document)}l.fire("saveSnapshot")});t.push('<a class="cke_colorauto" _cke_focus=1 hidefocus=true title="',n.auto,'" onclick="CKEDITOR.tools.callFunction(',v,",null,'",s,"');return false;\" href=\"javascript:void('",n.auto,'\')"><table cellspacing=0 cellpadding=0 width="100%"><tr><td><span class="cke_colorbox" style="background-color:#000"></span></td><td colspan=7 align=center>',n.auto,'</td></tr></table></a><table cellspacing=0 cellpadding=0 width="100%">');for(var w=0;w<u.length;w++){if(w%8===0){t.push("</tr><tr>")}var x=u[w],y=l.lang.colors[x]||x;t.push('<td><a class="cke_colorbox" _cke_focus=1 hidefocus=true title="',y,'" onclick="CKEDITOR.tools.callFunction(',v,",'#",x,"','",s,"'); return false;\" href=\"javascript:void('",y,'\')"><span class="cke_colorbox" style="background-color:#',x,'"></span></a></td>')}if(m.colorButton_enableMore){t.push('</tr><tr><td colspan=8 align=center><a class="cke_colormore" _cke_focus=1 hidefocus=true title="',n.more,'" onclick="CKEDITOR.tools.callFunction(',v,",'?','",s,"');return false;\" href=\"javascript:void('",n.more,"')\">",n.more,"</a></td>")}t.push("</tr></table>");return t.join("")}}});i.colorButton_enableMore=false;i.colorButton_colors="000,800000,8B4513,2F4F4F,008080,000080,4B0082,696969,B22222,A52A2A,DAA520,006400,40E0D0,0000CD,800080,808080,F00,FF8C00,FFD700,008000,0FF,00F,EE82EE,A9A9A9,FFA07A,FFA500,FFFF00,00FF00,AFEEEE,ADD8E6,DDA0DD,D3D3D3,FFF0F5,FAEBD7,FFFFE0,F0FFF0,F0FFFF,F0F8FF,E6E6FA,FFF";i.colorButton_foreStyle={element:"span",styles:{color:"#(color)"},overrides:[{element:"font",attributes:{color:null}}]};i.colorButton_backStyle={element:"span",styles:{"background-color":"#(color)"}};(function(){j.colordialog={init:function(l){l.addCommand("colordialog",new a.dialogCommand("colordialog"));a.dialog.add("colordialog",this.path+"dialogs/colordialog.js")}};j.add("colordialog",j.colordialog)})();j.add("contextmenu",{requires:["menu"],beforeInit:function(l){l.contextMenu=new j.contextMenu(l);l.addCommand("contextMenu",{exec:function(){l.contextMenu.show(l.document.getBody())}})}});j.contextMenu=e.createClass({$:function(l){this.id="cke_"+e.getNextNumber();this.editor=l;this._.listeners=[];this._.functionId=e.addFunction(function(m){this._.panel.hide();l.focus();l.execCommand(m)},this)},_:{onMenu:function(l,m,n,o){var p=this._.menu,q=this.editor;if(p){p.hide();p.removeAll()}else{p=this._.menu=new a.menu(q);p.onClick=e.bind(function(z){var A=true;p.hide();if(c){p.onEscape()}if(z.onClick){z.onClick()}else{if(z.command){q.execCommand(z.command)}}A=false},this);p.onEscape=function(){q.focus();if(c){q.getSelection().unlock(true)}}}var r=this._.listeners,s=[],t=this.editor.getSelection(),u=t&&t.getStartElement();if(c){t.lock()}p.onHide=e.bind(function(){p.onHide=null;if(c){q.getSelection().unlock()}this.onHide&&this.onHide()},this);for(var v=0;v<r.length;v++){var w=r[v](u,t);if(w){for(var x in w){var y=this.editor.getMenuItem(x);if(y){y.state=w[x];p.add(y)}}}}p.show(l,m||(q.lang.dir=="rtl"?2:1),n,o)}},proto:{addTarget:function(l){l.on("contextmenu",function(m){var n=m.data;n.preventDefault();var o=n.getTarget().getDocument().getDocumentElement(),p=n.$.clientX,q=n.$.clientY;e.setTimeout(function(){this._.onMenu(o,null,p,q)},0,this)},this)},addListener:function(l){this._.listeners.push(l)},show:function(l,m,n,o){this.editor.focus();this._.onMenu(l||a.document.getDocumentElement(),m,n||0,o||0)}}});(function(){var l={toolbarFocus:{exec:function(n){var o=n._.elementsPath.idBase,p=a.document.getById(o+"0");if(p){p.focus()}}}},m='<span class="cke_empty">&nbsp;</span>';j.add("elementspath",{requires:["selection"],init:function(n){var o="cke_path_"+n.name,p,q=function(){if(!p){p=a.document.getById(o)}return p},r="cke_elementspath_"+e.getNextNumber()+"_";n._.elementsPath={idBase:r};n.on("themeSpace",function(s){if(s.data.space=="bottom"){s.data.html+='<div id="'+o+'" class="cke_path">'+m+"</div>"}});n.on("selectionChange",function(s){var t=b,u=s.data.selection,v=u.getStartElement(),w=[],x=this._.elementsPath.list=[];while(v){var y=x.push(v)-1,z;if(v.getAttribute("_cke_real_element_type")){z=v.getAttribute("_cke_real_element_type")}else{z=v.getName()}var A="";if(t.opera||t.gecko&&t.mac){A+=' onkeypress="return false;"'}if(t.gecko){A+=' onblur="this.style.cssText = this.style.cssText;"'}w.unshift('<a id="',r,y,'" href="javascript:void(\'',z,'\')" tabindex="-1" title="',n.lang.elementsPath.eleTitle.replace(/%1/,z),'"'+(b.gecko&&b.version<10900?' onfocus="event.preventBubble();"':"")+' hidefocus="true"  onkeydown="return CKEDITOR._.elementsPath.keydown(\'',this.name,"',",y,', event);"'+A," onclick=\"return CKEDITOR._.elementsPath.click('",this.name,"',",y,');">',z,"</a>");if(z=="body"){break}v=v.getParent()}q().setHtml(w.join("")+m)});n.on("contentDomUnload",function(){q().setHtml(m)});n.addCommand("elementsPathFocus",l.toolbarFocus)}})})();a._.elementsPath={click:function(l,m){var n=a.instances[l];n.focus();var o=n._.elementsPath.list[m];n.getSelection().selectElement(o);return false},keydown:function(l,m,n){var o=k.button._.instances[m],p=a.instances[l],q=p._.elementsPath.idBase,r;n=new d.event(n);switch(n.getKeystroke()){case 37:case 9:r=a.document.getById(q+(m+1));if(!r){r=a.document.getById(q+"0")}r.focus();return false;case 39:case 2000+9:r=a.document.getById(q+(m-1));if(!r){r=a.document.getById(q+(p._.elementsPath.list.length-1))}r.focus();return false;case 27:p.focus();return false;case 13:case 32:this.click(l,m);return false}return true}};(function(){j.add("enterkey",{requires:["keystrokes","indent"],init:function(s){var t=s.specialKeys;t[13]=o;t[2000+13]=n}});var l,m=/^h[1-6]$/;function n(s){l=1;return o(s,s.config.shiftEnterMode)}function o(s,t){if(s.mode!="wysiwyg"){return false}if(!t){t=s.config.enterMode}setTimeout(function(){s.fire("saveSnapshot");if(t==2||s.getSelection().getStartElement().hasAscendant("pre",true)){q(s,t)}else{p(s,t)}l=0},0);return true}function p(s,t,u){u=u||r(s);var v=u.document,w=t==3?"div":"p",x=u.splitBlock(w);if(!x){return }var y=x.previousBlock,z=x.nextBlock,A=x.wasStartOfBlock,B=x.wasEndOfBlock,C;if(z){C=z.getParent();if(C.is("li")){z.breakParent(C);z.move(z.getNext(),true)}}else{if(y&&(C=y.getParent())&&(C.is("li"))){y.breakParent(C);u.moveToElementEditStart(y.getNext());y.move(y.getPrevious())}}if(!A&&!B){if(z.is("li")&&(C=z.getFirst())&&(C.is&&C.is("ul","ol"))){z.insertBefore(v.createText("\xa0"),C)}if(z){u.moveToElementEditStart(z)}}else{if(A&&B&&y.is("li")){s.execCommand("outdent");return }var D;if(y){if(!l&&!m.test(y.getName())){D=y.clone()}}else{if(z){D=z.clone()}}if(!D){D=v.createElement(w)}var E=x.elementPath;if(E){for(var F=0,G=E.elements.length;F<G;F++){var H=E.elements[F];if(H.equals(E.block)||H.equals(E.blockLimit)){break}if(f.$removeEmpty[H.getName()]){H=H.clone();D.moveChildren(H);D.append(H)}}}if(!c){D.appendBogus()}u.insertNode(D);if(c&&A&&(!B||!y.getChildCount())){u.moveToElementEditStart(B?y:D);u.select()}u.moveToElementEditStart(A&&!B?z:D)}if(!c){if(z){var I=v.createElement("span");I.setHtml("&nbsp;");u.insertNode(I);I.scrollIntoView();u.deleteContents()}else{D.scrollIntoView()}}u.select()}function q(s,t){var u=r(s),v=u.document,w=t==3?"div":"p",x=u.checkEndOfBlock(),y=new d.elementPath(s.getSelection().getStartElement()),z=y.block,A=z&&y.block.getName(),B=false;if(!l&&A=="li"){p(s,t,u);return }if(!l&&x&&m.test(A)){v.createElement("br").insertAfter(z);if(b.gecko){v.createText("").insertAfter(z)}u.setStartAt(z.getNext(),c?3:1)}else{var C;B=A=="pre";if(B){C=v.createText(c?"\r":"\n")}else{C=v.createElement("br")}u.deleteContents();u.insertNode(C);if(!c){v.createText("").insertAfter(C)}if(x&&!c){C.getParent().appendBogus()}if(!c){C.getNext().$.nodeValue=""}if(c){u.setStartAt(C,4)}else{u.setStartAt(C.getNext(),1)}if(!c){var D=null;if(!b.gecko){D=v.createElement("span");D.setHtml("&nbsp;")}else{D=v.createElement("br")}D.insertBefore(C.getNext());D.scrollIntoView();D.remove()}}u.collapse(true);u.select(B)}function r(s){var t=s.getSelection().getRanges();for(var u=t.length-1;u>0;u--){t[u].deleteContents()}return t[0]}})();(function(){var l="nbsp,gt,lt,quot,iexcl,cent,pound,curren,yen,brvbar,sect,uml,copy,ordf,laquo,not,shy,reg,macr,deg,plusmn,sup2,sup3,acute,micro,para,middot,cedil,sup1,ordm,raquo,frac14,frac12,frac34,iquest,times,divide,fnof,bull,hellip,prime,Prime,oline,frasl,weierp,image,real,trade,alefsym,larr,uarr,rarr,darr,harr,crarr,lArr,uArr,rArr,dArr,hArr,forall,part,exist,empty,nabla,isin,notin,ni,prod,sum,minus,lowast,radic,prop,infin,ang,and,or,cap,cup,int,there4,sim,cong,asymp,ne,equiv,le,ge,sub,sup,nsub,sube,supe,oplus,otimes,perp,sdot,lceil,rceil,lfloor,rfloor,lang,rang,loz,spades,clubs,hearts,diams,circ,tilde,ensp,emsp,thinsp,zwnj,zwj,lrm,rlm,ndash,mdash,lsquo,rsquo,sbquo,ldquo,rdquo,bdquo,dagger,Dagger,permil,lsaquo,rsaquo,euro",m="Agrave,Aacute,Acirc,Atilde,Auml,Aring,AElig,Ccedil,Egrave,Eacute,Ecirc,Euml,Igrave,Iacute,Icirc,Iuml,ETH,Ntilde,Ograve,Oacute,Ocirc,Otilde,Ouml,Oslash,Ugrave,Uacute,Ucirc,Uuml,Yacute,THORN,szlig,agrave,aacute,acirc,atilde,auml,aring,aelig,ccedil,egrave,eacute,ecirc,euml,igrave,iacute,icirc,iuml,eth,ntilde,ograve,oacute,ocirc,otilde,ouml,oslash,ugrave,uacute,ucirc,uuml,yacute,thorn,yuml,OElig,oelig,Scaron,scaron,Yuml",n="Alpha,Beta,Gamma,Delta,Epsilon,Zeta,Eta,Theta,Iota,Kappa,Lambda,Mu,Nu,Xi,Omicron,Pi,Rho,Sigma,Tau,Upsilon,Phi,Chi,Psi,Omega,alpha,beta,gamma,delta,epsilon,zeta,eta,theta,iota,kappa,lambda,mu,nu,xi,omicron,pi,rho,sigmaf,sigma,tau,upsilon,phi,chi,psi,omega,thetasym,upsih,piv";function o(p){var q={},r=[],s={nbsp:"\xa0",shy:"",gt:">",lt:"<"};p=p.replace(/\b(nbsp|shy|gt|lt|amp)(?:,|$)/g,function(x,y){q[s[y]]="&"+y+";";r.push(s[y]);return""});p=p.split(",");var t=document.createElement("div"),u;t.innerHTML="&"+p.join(";&")+";";u=t.innerHTML;t=null;for(var v=0;v<u.length;v++){var w=u.charAt(v);q[w]="&"+p[v]+";";r.push(w)}q.regex=r.join("");return q}j.add("entities",{afterInit:function(p){var q=p.config;if(!q.entities){return }var r=p.dataProcessor,s=r&&r.htmlFilter;if(s){var t=l;if(q.entities_latin){t+=","+m}if(q.entities_greek){t+=","+n}if(q.entities_additional){t+=","+q.entities_additional}var u=o(t),v="["+u.regex+"]";delete u.regex;if(q.entities_processNumerical){v="[^ -~]|"+v}v=new RegExp(v,"g");function w(x){return u[x]||"&#"+x.charCodeAt(0)+";"}s.addRules({text:function(x){return x.replace(v,w)}})}}})})();i.entities=true;i.entities_latin=true;i.entities_greek=true;i.entities_processNumerical=false;i.entities_additional="#39";(function(){function l(u,v){var w=[];if(!v){return u}else{for(var x in v){w.push(x+"="+encodeURIComponent(v[x]))}}return u+(u.indexOf("?")!=-1?"&":"?")+w.join("&")}function m(u){u+="";var v=u.charAt(0).toUpperCase();return v+u.substr(1)}function n(u){var B=this;var v=B.getDialog(),w=v.getParentEditor();w._.filebrowserSe=B;var x=w.config["filebrowser"+m(v.getName())+"WindowWidth"]||w.config.filebrowserWindowWidth||"80%",y=w.config["filebrowser"+m(v.getName())+"WindowHeight"]||w.config.filebrowserWindowHeight||"70%",z=B.filebrowser.params||{};z.CKEditor=w.name;z.CKEditorFuncNum=w._.filebrowserFn;if(!z.langCode){z.langCode=w.langCode}var A=l(B.filebrowser.url,z);w.popup(A,x,y)}function o(u){var x=this;var v=x.getDialog(),w=v.getParentEditor();w._.filebrowserSe=x;if(!v.getContentElement(x["for"][0],x["for"][1]).getInputElement().$.value){return false}if(!v.getContentElement(x["for"][0],x["for"][1]).getAction()){return false}return true}function p(u,v,w){var x=w.params||{};x.CKEditor=u.name;x.CKEditorFuncNum=u._.filebrowserFn;if(!x.langCode){x.langCode=u.langCode}v.action=l(w.url,x);v.filebrowser=w}function q(u,v,w,x){var y,z;for(var A in x){y=x[A];if(y.type=="hbox"||y.type=="vbox"){q(u,v,w,y.children)}if(!y.filebrowser){continue}if(typeof y.filebrowser=="string"){var B={action:y.type=="fileButton"?"QuickUpload":"Browse",target:y.filebrowser};y.filebrowser=B}if(y.filebrowser.action=="Browse"){var C=y.filebrowser.url||u.config["filebrowser"+m(v)+"BrowseUrl"]||u.config.filebrowserBrowseUrl;if(C){y.onClick=n;y.filebrowser.url=C;y.hidden=false}}else{if(y.filebrowser.action=="QuickUpload"&&y["for"]){C=y.filebrowser.url||u.config["filebrowser"+m(v)+"UploadUrl"]||u.config.filebrowserUploadUrl;if(C){y.onClick=o;y.filebrowser.url=C;y.hidden=false;p(u,w.getContents(y["for"][0]).get(y["for"][1]),y.filebrowser)}}}}}function r(u,v){var w=v.getDialog(),x=v.filebrowser.target||null;u=u.replace(/#/g,"%23");if(x){var y=x.split(":"),z=w.getContentElement(y[0],y[1]);if(z){z.setValue(u);w.selectPage(y[0])}}}function s(u,v,w){if(w.indexOf(";")!==-1){var x=w.split(";");for(var y=0;y<x.length;y++){if(s(u,v,x[y])){return true}}return false}return u.getContents(v).get(w).filebrowser&&u.getContents(v).get(w).filebrowser.url}function t(u,v){var z=this;var w=z._.filebrowserSe.getDialog(),x=z._.filebrowserSe["for"],y=z._.filebrowserSe.filebrowser.onSelect;if(x){w.getContentElement(x[0],x[1]).reset()}if(y&&y.call(z._.filebrowserSe,u,v)===false){return }if(typeof v=="string"&&v){alert(v)}if(u){r(u,z._.filebrowserSe)}}j.add("filebrowser",{init:function(u,v){u._.filebrowserFn=e.addFunction(t,u);a.on("dialogDefinition",function(w){for(var x in w.data.definition.contents){q(w.editor,w.data.name,w.data.definition,w.data.definition.contents[x].elements);if(w.data.definition.contents[x].hidden&&w.data.definition.contents[x].filebrowser){w.data.definition.contents[x].hidden=!s(w.data.definition,w.data.definition.contents[x].id,w.data.definition.contents[x].filebrowser)}}})}})})();j.add("find",{init:function(l){var m=j.find;l.ui.addButton("Find",{label:l.lang.findAndReplace.find,command:"find"});var n=l.addCommand("find",new a.dialogCommand("find"));n.canUndo=false;l.ui.addButton("Replace",{label:l.lang.findAndReplace.replace,command:"replace"});var o=l.addCommand("replace",new a.dialogCommand("replace"));o.canUndo=false;a.dialog.add("find",this.path+"dialogs/find.js");a.dialog.add("replace",this.path+"dialogs/find.js")},requires:["styles"]});i.find_highlight={element:"span",styles:{"background-color":"#004",color:"#fff"}};(function(){var l=/\.swf(?:$|\?)/i,m=/^\d+(?:\.\d+)?$/;function n(q){if(m.test(q)){return q+"px"}return q}function o(q){var r=q.attributes;return r.type=="application/x-shockwave-flash"||l.test(r.src||"")}function p(q,r){var s=q.createFakeParserElement(r,"cke_flash","flash",true),t=s.attributes.style||"",u=r.attributes.width,v=r.attributes.height;if(typeof u!="undefined"){t=s.attributes.style=t+"width:"+n(u)+";"}if(typeof v!="undefined"){t=s.attributes.style=t+"height:"+n(v)+";"}return s}j.add("flash",{init:function(q){q.addCommand("flash",new a.dialogCommand("flash"));q.ui.addButton("Flash",{label:q.lang.common.flash,command:"flash"});a.dialog.add("flash",this.path+"dialogs/flash.js");q.addCss("img.cke_flash{background-image: url("+a.getUrl(this.path+"images/placeholder.png")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 80px;height: 80px;}");if(q.addMenuItems){q.addMenuItems({flash:{label:q.lang.flash.properties,command:"flash",group:"flash"}})}if(q.contextMenu){q.contextMenu.addListener(function(r,s){if(r&&r.is("img")&&r.getAttribute("_cke_real_element_type")=="flash"){return{flash:2}}})}},afterInit:function(q){var r=q.dataProcessor,s=r&&r.dataFilter;if(s){s.addRules({elements:{"cke:object":function(t){var u=t.attributes,v=u.classid&&String(u.classid).toLowerCase();if(!v){for(var w=0;w<t.children.length;w++){if(t.children[w].name=="embed"){if(!o(t.children[w])){return null}return p(q,t)}}return null}return p(q,t)},"cke:embed":function(t){if(!o(t)){return null}return p(q,t)}}},5)}},requires:["fakeobjects"]})})();e.extend(i,{flashEmbedTagOnly:false,flashAddEmbedTag:true,flashConvertOnEdit:false});(function(){function l(m,n,o,p,q,r,s){var t=m.config,u=q.split(";"),v=[],w={};for(var x=0;x<u.length;x++){var y={},z=u[x].split("/"),A=u[x]=z[0];y[o]=v[x]=z[1]||A;w[A]=new a.style(s,y)}m.ui.addRichCombo(n,{label:p.label,title:p.panelTitle,voiceLabel:p.voiceLabel,className:"cke_"+(o=="size"?"fontSize":"font"),multiSelect:false,panel:{css:[a.getUrl(m.skinPath+"editor.css")].concat(t.contentsCss),voiceLabel:p.panelVoiceLabel},init:function(){this.startGroup(p.panelTitle);for(var B=0;B<u.length;B++){var C=u[B];this.add(C,'<span style="font-'+o+":"+v[B]+'">'+C+"</span>",C)}},onClick:function(B){m.focus();m.fire("saveSnapshot");var C=w[B];if(this.getValue()==B){C.remove(m.document)}else{C.apply(m.document)}m.fire("saveSnapshot")},onRender:function(){m.on("selectionChange",function(B){var C=this.getValue(),D=B.data.path,E=D.elements;for(var F=0,G;F<E.length;F++){G=E[F];for(var H in w){if(w[H].checkElementRemovable(G,true)){if(H!=C){this.setValue(H)}return }}}this.setValue("",r)},this)}})}j.add("font",{requires:["richcombo","styles"],init:function(m){var n=m.config;l(m,"Font","family",m.lang.font,n.font_names,n.font_defaultLabel,n.font_style);l(m,"FontSize","size",m.lang.fontSize,n.fontSize_sizes,n.fontSize_defaultLabel,n.fontSize_style)}})})();i.font_names="Arial/Arial, Helvetica, sans-serif;Comic Sans MS/Comic Sans MS, cursive;Courier New/Courier New, Courier, monospace;Georgia/Georgia, serif;Lucida Sans Unicode/Lucida Sans Unicode, Lucida Grande, sans-serif;Tahoma/Tahoma, Geneva, sans-serif;Times New Roman/Times New Roman, Times, serif;Trebuchet MS/Trebuchet MS, Helvetica, sans-serif;Verdana/Verdana, Geneva, sans-serif";i.font_defaultLabel="";i.font_style={element:"span",styles:{"font-family":"#(family)"},overrides:[{element:"font",attributes:{face:null}}]};i.fontSize_sizes="8/8px;9/9px;10/10px;11/11px;12/12px;14/14px;16/16px;18/18px;20/20px;22/22px;24/24px;26/26px;28/28px;36/36px;48/48px;72/72px";i.fontSize_defaultLabel="";i.fontSize_style={element:"span",styles:{"font-size":"#(size)"},overrides:[{element:"font",attributes:{size:null}}]};j.add("format",{requires:["richcombo","styles"],init:function(l){var m=l.config,n=l.lang.format,o=m.format_tags.split(";"),p={};for(var q=0;q<o.length;q++){var r=o[q];p[r]=new a.style(m["format_"+r])}l.ui.addRichCombo("Format",{label:n.label,title:n.panelTitle,voiceLabel:n.voiceLabel,className:"cke_format",multiSelect:false,panel:{css:[a.getUrl(l.skinPath+"editor.css")].concat(m.contentsCss),voiceLabel:n.panelVoiceLabel},init:function(){this.startGroup(n.panelTitle);for(var s in p){var t=n["tag_"+s];this.add(s,"<"+s+">"+t+"</"+s+">",t)}},onClick:function(s){l.focus();l.fire("saveSnapshot");p[s].apply(l.document);l.fire("saveSnapshot")},onRender:function(){l.on("selectionChange",function(s){var t=this.getValue(),u=s.data.path;for(var v in p){if(p[v].checkActive(u)){if(v!=t){this.setValue(v,l.lang.format["tag_"+v])}return }}this.setValue("")},this)}})}});i.format_tags="p;h1;h2;h3;h4;h5;h6;pre;address;div";i.format_p={element:"p"};i.format_div={element:"div"};i.format_pre={element:"pre"};i.format_address={element:"address"};i.format_h1={element:"h1"};i.format_h2={element:"h2"};i.format_h3={element:"h3"};i.format_h4={element:"h4"};i.format_h5={element:"h5"};i.format_h6={element:"h6"};j.add("forms",{init:function(l){var m=l.lang;l.addCss("form{border: 1px dotted #FF0000;padding: 2px;}");var n=function(p,q,r){l.addCommand(q,new a.dialogCommand(q));l.ui.addButton(p,{label:m.common[p.charAt(0).toLowerCase()+p.slice(1)],command:q});a.dialog.add(q,r)},o=this.path+"dialogs/";n("Form","form",o+"form.js");n("Checkbox","checkbox",o+"checkbox.js");n("Radio","radio",o+"radio.js");n("TextField","textfield",o+"textfield.js");n("Textarea","textarea",o+"textarea.js");n("Select","select",o+"select.js");n("Button","button",o+"button.js");n("ImageButton","imagebutton",j.getPath("image")+"dialogs/image.js");n("HiddenField","hiddenfield",o+"hiddenfield.js");if(l.addMenuItems){l.addMenuItems({form:{label:m.form.menu,command:"form",group:"form"},checkbox:{label:m.checkboxAndRadio.checkboxTitle,command:"checkbox",group:"checkbox"},radio:{label:m.checkboxAndRadio.radioTitle,command:"radio",group:"radio"},textfield:{label:m.textfield.title,command:"textfield",group:"textfield"},hiddenfield:{label:m.hidden.title,command:"hiddenfield",group:"hiddenfield"},imagebutton:{label:m.image.titleButton,command:"imagebutton",group:"imagebutton"},button:{label:m.button.title,command:"button",group:"button"},select:{label:m.select.title,command:"select",group:"select"},textarea:{label:m.textarea.title,command:"textarea",group:"textarea"}})}if(l.contextMenu){l.contextMenu.addListener(function(p){if(p&&p.hasAscendant("form")){return{form:2}}});l.contextMenu.addListener(function(p){if(p){var q=p.getName();if(q=="select"){return{select:2}}if(q=="textarea"){return{textarea:2}}if(q=="input"){var r=p.getAttribute("type");if(r=="text"||r=="password"){return{textfield:2}}if(r=="button"||r=="submit"||r=="reset"){return{button:2}}if(r=="checkbox"){return{checkbox:2}}if(r=="radio"){return{radio:2}}if(r=="image"){return{imagebutton:2}}}if(q=="img"&&p.getAttribute("_cke_real_element_type")=="hiddenfield"){return{hiddenfield:2}}}})}},requires:["image"]});if(c){h.prototype.hasAttribute=function(l){var o=this;var m=o.$.attributes.getNamedItem(l);if(o.getName()=="input"){switch(l){case"class":return o.$.className.length>0;case"checked":return !!o.$.checked;case"value":var n=o.getAttribute("type");if(n=="checkbox"||n=="radio"){return o.$.value!="on"}break;default:}}return !!(m&&m.specified)}}(function(){var l={exec:function(n){n.insertElement(n.document.createElement("hr"))}},m="horizontalrule";j.add(m,{init:function(n){n.addCommand(m,l);n.ui.addButton("HorizontalRule",{label:n.lang.horizontalrule,command:m})}})})();(function(){var l=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,m="{cke_protected}";function n(M){var N=M.children.length,O=M.children[N-1];while(O&&O.type==3&&!e.trim(O.value)){O=M.children[--N]}return O}function o(M,N){var O=M.children,P=n(M);if(P){if((N||!c)&&(P.type==1&&P.name=="br")){O.pop()}if(P.type==3&&l.test(P.value)){O.pop()}}}function p(M){var N=n(M);return !N||N.type==1&&N.name=="br"}function q(M){o(M,true);if(p(M)){if(c){M.add(new a.htmlParser.text("\xa0"))}else{M.add(new a.htmlParser.element("br",{}))}}}function r(M){o(M);if(p(M)){M.add(new a.htmlParser.text("\xa0"))}}var s=f,t=e.extend({},s.$block,s.$listItem,s.$tableContent);for(var u in t){if(!("br" in s[u])){delete t[u]}}delete t.pre;var v={attributeNames:[[/^on/,"_cke_pa_on"]]},w={elements:{}};for(u in t){w.elements[u]=q}var x={elementNames:[[/^cke:/,""],[/^\?xml:namespace$/,""]],attributeNames:[[/^_cke_(saved|pa)_/,""],[/^_cke.*/,""]],elements:{$:function(M){var N=M.attributes;if(N){var O=["name","href","src"],P;for(var Q=0;Q<O.length;Q++){P="_cke_saved_"+O[Q];P in N&&delete N[O[Q]]}}},embed:function(M){var N=M.parent;if(N&&N.name=="object"){var O=N.attributes.width,P=N.attributes.height;O&&(M.attributes.width=O);P&&(M.attributes.height=P)}},param:function(M){M.children=[];M.isEmpty=true;return M},a:function(M){if(!(M.children.length||M.attributes.name||M.attributes._cke_saved_name)){return false}}},attributes:{"class":function(M,N){return e.ltrim(M.replace(/(?:^|\s+)cke_[^\s]*/g,""))||false}},comment:function(M){if(M.substr(0,m.length)==m){return new a.htmlParser.cdata(decodeURIComponent(M.substr(m.length)))}return M}},y={elements:{}};for(u in t){y.elements[u]=r}if(c){x.attributes.style=function(M,N){return M.toLowerCase()}}var z=/<(?:a|area|img|input).*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi;function A(M){return M.replace(z,"$& _cke_saved_$1")}var B=/<(style)(?=[ >])[^>]*>[^<]*<\/\1>/gi,C=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,D=/(<\/?)((?:object|embed|param).*?>)/gi,E=/<cke:param(.*?)\/>/gi;function F(M){return"<cke:encoded>"+encodeURIComponent(M)+"</cke:encoded>"}function G(M){return M.replace(B,F)}function H(M){return M.replace(D,"$1cke:$2")}function I(M){return M.replace(E,"<cke:param$1></cke:param>")}function J(M,N){return decodeURIComponent(N)}function K(M){return M.replace(C,J)}function L(M,N){var O=[],P=/<\!--\{cke_temp\}(\d*?)-->/g,Q=[/<!--[\s\S]*?-->/g,/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi].concat(N);for(var R=0;R<Q.length;R++){M=M.replace(Q[R],function(S){S=S.replace(P,function(T,U){return O[U]});return"<!--{cke_temp}"+(O.push(S)-1)+"-->"})}M=M.replace(P,function(S,T){return"<!--"+m+encodeURIComponent(O[T]).replace(/--/g,"%2D%2D")+"-->"});return M}j.add("htmldataprocessor",{requires:["htmlwriter"],init:function(M){var N=M.dataProcessor=new a.htmlDataProcessor(M);N.writer.forceSimpleAmpersand=M.config.forceSimpleAmpersand;N.dataFilter.addRules(v);N.dataFilter.addRules(w);N.htmlFilter.addRules(x);N.htmlFilter.addRules(y)}});a.htmlDataProcessor=function(M){var N=this;N.editor=M;N.writer=new a.htmlWriter();N.dataFilter=new a.htmlParser.filter();N.htmlFilter=new a.htmlParser.filter()};a.htmlDataProcessor.prototype={toHtml:function(M,N){M=L(M,this.editor.config.protectedSource);M=A(M);if(c){M=G(M)}M=H(M);M=I(M);var O=document.createElement("div");O.innerHTML="a"+M;M=O.innerHTML.substr(1);if(c){M=K(M)}var P=a.htmlParser.fragment.fromHtml(M,N),Q=new a.htmlParser.basicWriter();P.writeHtml(Q,this.dataFilter);return Q.getHtml(true)},toDataFormat:function(M,N){var O=this.writer,P=a.htmlParser.fragment.fromHtml(M,N);O.reset();P.writeHtml(O,this.htmlFilter);return O.getHtml(true)}}})();i.forceSimpleAmpersand=false;j.add("image",{init:function(l){var m="image";a.dialog.add(m,this.path+"dialogs/image.js");l.addCommand(m,new a.dialogCommand(m));l.ui.addButton("Image",{label:l.lang.common.image,command:m});if(l.addMenuItems){l.addMenuItems({image:{label:l.lang.image.menu,command:"image",group:"image"}})}if(l.contextMenu){l.contextMenu.addListener(function(n,o){if(!n||!n.is("img")||n.getAttribute("_cke_realelement")){return null}return{image:2}})}}});i.image_removeLinkByEmptyURL=true;(function(){var l={ol:1,ul:1};function m(r,s){r.getCommand(this.name).setState(s)}function n(r){var C=this;var s=r.data.path.elements,t,u,v=r.editor;for(var w=0;w<s.length;w++){if(s[w].getName()=="li"){u=s[w];continue}if(l[s[w].getName()]){t=s[w];break}}if(t){if(C.name=="outdent"){return m.call(C,v,2)}else{while(u&&(u=u.getPrevious(d.walker.whitespaces(true)))){if(u.getName&&u.getName()=="li"){return m.call(C,v,2)}}return m.call(C,v,0)}}if(!C.useIndentClasses&&C.name=="indent"){return m.call(C,v,2)}var x=r.data.path,y=x.block||x.blockLimit;if(!y){return m.call(C,v,0)}if(C.useIndentClasses){var z=y.$.className.match(C.classNameRegex),A=0;if(z){z=z[1];A=C.indentClassMap[z]}if(C.name=="outdent"&&!A||C.name=="indent"&&A==v.config.indentClasses.length){return m.call(C,v,0)}return m.call(C,v,2)}else{var B=parseInt(y.getStyle(C.indentCssProperty),10);if(isNaN(B)){B=0}if(B<=0){return m.call(C,v,0)}return m.call(C,v,2)}}function o(r,s,t){var u=s.startContainer,v=s.endContainer;while(u&&!u.getParent().equals(t)){u=u.getParent()}while(v&&!v.getParent().equals(t)){v=v.getParent()}if(!u||!v){return }var w=u,x=[],y=false;while(!y){if(w.equals(v)){y=true}x.push(w);w=w.getNext()}if(x.length<1){return }var z=t.getParents(true);for(var A=0;A<z.length;A++){if(z[A].getName&&l[z[A].getName()]){t=z[A];break}}var B=this.name=="indent"?1:-1,C=x[0],D=x[x.length-1],E={},F=j.list.listToArray(t,E),G=F[D.getCustomData("listarray_index")].indent;for(A=C.getCustomData("listarray_index");A<=D.getCustomData("listarray_index");A++){F[A].indent+=B}for(A=D.getCustomData("listarray_index")+1;A<F.length&&F[A].indent>G;A++){F[A].indent+=B}var H=j.list.arrayToList(F,E,null,r.config.enterMode,0);if(this.name=="outdent"){var I;if((I=t.getParent())&&(I.is("li"))){var J=H.listNode.getChildren(),K=[],L=J.count(),M;for(A=L-1;A>=0;A--){if((M=J.getItem(A))&&(M.is&&M.is("li"))){K.push(M)}}}}if(H){H.listNode.replace(t)}if(K&&K.length){for(A=0;A<K.length;A++){var N=K[A],O=N;while((O=O.getNext())&&(O.is&&O.getName() in l)){N.append(O)}N.insertAfter(I)}}h.clearAllMarkers(E)}function p(r,s){var A=this;var t=s.createIterator(),u=r.config.enterMode;t.enforceRealBlocks=true;t.enlargeBr=u!=2;var v;while(v=t.getNextParagraph()){if(A.useIndentClasses){var w=v.$.className.match(A.classNameRegex),x=0;if(w){w=w[1];x=A.indentClassMap[w]}if(A.name=="outdent"){x--}else{x++}x=Math.min(x,r.config.indentClasses.length);x=Math.max(x,0);var y=e.ltrim(v.$.className.replace(A.classNameRegex,""));if(x<1){v.$.className=y}else{v.addClass(r.config.indentClasses[x-1])}}else{var z=parseInt(v.getStyle(A.indentCssProperty),10);if(isNaN(z)){z=0}z+=(A.name=="indent"?1:-1)*(r.config.indentOffset);z=Math.max(z,0);z=Math.ceil(z/r.config.indentOffset)*r.config.indentOffset;v.setStyle(A.indentCssProperty,z?z+r.config.indentUnit:"");if(v.getAttribute("style")===""){v.removeAttribute("style")}}}}function q(r,s){var u=this;u.name=s;u.useIndentClasses=r.config.indentClasses&&r.config.indentClasses.length>0;if(u.useIndentClasses){u.classNameRegex=new RegExp("(?:^|\\s+)("+r.config.indentClasses.join("|")+")(?=$|\\s)");u.indentClassMap={};for(var t=0;t<r.config.indentClasses.length;t++){u.indentClassMap[r.config.indentClasses[t]]=t+1}}else{u.indentCssProperty=r.config.contentsLangDirection=="ltr"?"margin-left":"margin-right"}}q.prototype={exec:function(r){var s=r.getSelection(),t=s&&s.getRanges()[0];if(!s||!t){return }var u=s.createBookmarks(true),v=t.getCommonAncestor();while(v&&!(v.type==1&&l[v.getName()])){v=v.getParent()}if(v){o.call(this,r,t,v)}else{p.call(this,r,t)}r.focus();r.forceNextSelectionCheck();s.selectBookmarks(u)}};j.add("indent",{init:function(r){var s=new q(r,"indent"),t=new q(r,"outdent");r.addCommand("indent",s);r.addCommand("outdent",t);r.ui.addButton("Indent",{label:r.lang.indent,command:"indent"});r.ui.addButton("Outdent",{label:r.lang.outdent,command:"outdent"});r.on("selectionChange",e.bind(n,s));r.on("selectionChange",e.bind(n,t))},requires:["domiterator","list"]})})();e.extend(i,{indentOffset:40,indentUnit:"px",indentClasses:null});(function(){var l=/(-moz-|-webkit-|start|auto)/i;function m(p,q){var r=q.block||q.blockLimit;if(!r||r.getName()=="body"){return 2}var s=r.getComputedStyle("text-align").replace(l,"");if(!s&&this.isDefaultAlign||s==this.value){return 1}return 2}function n(p){var q=p.editor.getCommand(this.name);q.state=m.call(this,p.editor,p.data.path);q.fire("state")}function o(p,q,r){var u=this;u.name=q;u.value=r;var s=p.config.contentsLangDirection;u.isDefaultAlign=r=="left"&&s=="ltr"||r=="right"&&s=="rtl";var t=p.config.justifyClasses;if(t){switch(r){case"left":u.cssClassName=t[0];break;case"center":u.cssClassName=t[1];break;case"right":u.cssClassName=t[2];break;case"justify":u.cssClassName=t[3];break}u.cssClassRegex=new RegExp("(?:^|\\s+)(?:"+t.join("|")+")(?=$|\\s)")}}o.prototype={exec:function(p){var y=this;var q=p.getSelection();if(!q){return }var r=q.createBookmarks(),s=q.getRanges(),t=y.cssClassName,u,v;for(var w=s.length-1;w>=0;w--){u=s[w].createIterator();while(v=u.getNextParagraph()){v.removeAttribute("align");if(t){var x=v.$.className=e.ltrim(v.$.className.replace(y.cssClassRegex,""));if(y.state==2&&!y.isDefaultAlign){v.addClass(t)}else{if(!x){v.removeAttribute("class")}}}else{if(y.state==2&&!y.isDefaultAlign){v.setStyle("text-align",y.value)}else{v.removeStyle("text-align")}}}}p.focus();p.forceNextSelectionCheck();q.selectBookmarks(r)}};j.add("justify",{init:function(p){var q=new o(p,"justifyleft","left"),r=new o(p,"justifycenter","center"),s=new o(p,"justifyright","right"),t=new o(p,"justifyblock","justify");p.addCommand("justifyleft",q);p.addCommand("justifycenter",r);p.addCommand("justifyright",s);p.addCommand("justifyblock",t);p.ui.addButton("JustifyLeft",{label:p.lang.justify.left,command:"justifyleft"});p.ui.addButton("JustifyCenter",{label:p.lang.justify.center,command:"justifycenter"});p.ui.addButton("JustifyRight",{label:p.lang.justify.right,command:"justifyright"});p.ui.addButton("JustifyBlock",{label:p.lang.justify.block,command:"justifyblock"});p.on("selectionChange",e.bind(n,q));p.on("selectionChange",e.bind(n,s));p.on("selectionChange",e.bind(n,r));p.on("selectionChange",e.bind(n,t))},requires:["domiterator"]})})();e.extend(i,{justifyClasses:null});j.add("keystrokes",{beforeInit:function(l){l.keystrokeHandler=new a.keystrokeHandler(l);l.specialKeys={}},init:function(l){var m=l.config.keystrokes,n=l.config.blockedKeystrokes,o=l.keystrokeHandler.keystrokes,p=l.keystrokeHandler.blockedKeystrokes;for(var q=0;q<m.length;q++){o[m[q][0]]=m[q][1]}for(q=0;q<n.length;q++){p[n[q]]=1}}});a.keystrokeHandler=function(l){var m=this;if(l.keystrokeHandler){return l.keystrokeHandler}m.keystrokes={};m.blockedKeystrokes={};m._={editor:l};return m};(function(){var l,m=function(o){o=o.data;var p=o.getKeystroke(),q=this.keystrokes[p],r=this._.editor;l=r.fire("key",{keyCode:p})===true;if(!l){if(q){var s={from:"keystrokeHandler"};l=r.execCommand(q,s)!==false}if(!l){var t=r.specialKeys[p];l=t&&t(r)===true;if(!l){l=!!this.blockedKeystrokes[p]}}}if(l){o.preventDefault(true)}return !l},n=function(o){if(l){l=false;o.data.preventDefault(true)}};a.keystrokeHandler.prototype={attach:function(o){o.on("keydown",m,this);if(b.opera||b.gecko&&b.mac){o.on("keypress",n,this)}}}})();i.blockedKeystrokes=[1000+66,1000+73,1000+85];i.keystrokes=[[4000+121,"toolbarFocus"],[4000+122,"elementsPathFocus"],[2000+121,"contextMenu"],[1000+2000+121,"contextMenu"],[1000+90,"undo"],[1000+89,"redo"],[1000+2000+90,"redo"],[1000+76,"link"],[1000+66,"bold"],[1000+73,"italic"],[1000+85,"underline"],[4000+109,"toolbarCollapse"]];j.add("link",{init:function(l){l.addCommand("link",new a.dialogCommand("link"));l.addCommand("anchor",new a.dialogCommand("anchor"));l.addCommand("unlink",new a.unlinkCommand());l.ui.addButton("Link",{label:l.lang.link.toolbar,command:"link"});l.ui.addButton("Unlink",{label:l.lang.unlink,command:"unlink"});l.ui.addButton("Anchor",{label:l.lang.anchor.toolbar,command:"anchor"});a.dialog.add("link",this.path+"dialogs/link.js");a.dialog.add("anchor",this.path+"dialogs/anchor.js");l.addCss("img.cke_anchor{background-image: url("+a.getUrl(this.path+"images/anchor.gif")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 18px;height: 18px;}\na.cke_anchor{background-image: url("+a.getUrl(this.path+"images/anchor.gif")+");background-position: 0 center;background-repeat: no-repeat;border: 1px solid #a9a9a9;padding-left: 18px;}");l.on("selectionChange",function(m){var n=l.getCommand("unlink"),o=m.data.path.lastElement.getAscendant("a",true);if(o&&o.getName()=="a"&&o.getAttribute("href")){n.setState(2)}else{n.setState(0)}});if(l.addMenuItems){l.addMenuItems({anchor:{label:l.lang.anchor.menu,command:"anchor",group:"anchor"},link:{label:l.lang.link.menu,command:"link",group:"link",order:1},unlink:{label:l.lang.unlink,command:"unlink",group:"link",order:5}})}if(l.contextMenu){l.contextMenu.addListener(function(m,n){if(!m){return null}var o=m.is("img")&&m.getAttribute("_cke_real_element_type")=="anchor";if(!o){if(!(m=m.getAscendant("a",true))){return null}o=m.getAttribute("name")&&!m.getAttribute("href")}return o?{anchor:2}:{link:2,unlink:2}})}},afterInit:function(l){var m=l.dataProcessor,n=m&&m.dataFilter;if(n){n.addRules({elements:{a:function(o){var p=o.attributes;if(p.name&&!p.href){return l.createFakeParserElement(o,"cke_anchor","anchor")}}}})}},requires:["fakeobjects"]});a.unlinkCommand=function(){};a.unlinkCommand.prototype={exec:function(l){var m=l.getSelection(),n=m.createBookmarks(),o=m.getRanges(),p,q;for(var r=0;r<o.length;r++){p=o[r].getCommonAncestor(true);q=p.getAscendant("a",true);if(!q){continue}o[r].selectNodeContents(q)}m.selectRanges(o);l.document.$.execCommand("unlink",false,null);m.selectBookmarks(n)}};e.extend(i,{linkShowAdvancedTab:true,linkShowTargetTab:true});(function(){var l={ol:1,ul:1},m=/^[\n\r\t ]*$/;j.list={listToArray:function(t,u,v,w,x){if(!l[t.getName()]){return[]}if(!w){w=0}if(!v){v=[]}for(var y=0,z=t.getChildCount();y<z;y++){var A=t.getChild(y);if(A.$.nodeName.toLowerCase()!="li"){continue}var B={parent:t,indent:w,contents:[]};if(!x){B.grandparent=t.getParent();if(B.grandparent&&B.grandparent.$.nodeName.toLowerCase()=="li"){B.grandparent=B.grandparent.getParent()}}else{B.grandparent=x}if(u){h.setMarker(u,A,"listarray_index",v.length)}v.push(B);for(var C=0,D=A.getChildCount();C<D;C++){var E=A.getChild(C);if(E.type==1&&l[E.getName()]){j.list.listToArray(E,u,v,w+1,B.grandparent)}else{B.contents.push(E)}}}return v},arrayToList:function(t,u,v,w){if(!v){v=0}if(!t||t.length<v+1){return null}var x=t[v].parent.getDocument(),y=new d.documentFragment(x),z=null,A=v,B=Math.max(t[v].indent,0),C=null,D=w==1?"p":"div";for(;;){var E=t[A];if(E.indent==B){if(!z||t[A].parent.getName()!=z.getName()){z=t[A].parent.clone(false,true);y.append(z)}C=z.append(x.createElement("li"));for(var F=0;F<E.contents.length;F++){C.append(E.contents[F].clone(true,true))}A++}else{if(E.indent==Math.max(B,0)+1){var G=j.list.arrayToList(t,null,A,w);C.append(G.listNode);A=G.nextIndex}else{if(E.indent==-1&&!v&&E.grandparent){C;if(l[E.grandparent.getName()]){C=x.createElement("li")}else{if(w!=2&&E.grandparent.getName()!="td"){C=x.createElement(D)}else{C=new d.documentFragment(x)}}for(F=0;F<E.contents.length;F++){C.append(E.contents[F].clone(true,true))}if(C.type==11&&A!=t.length-1){if(C.getLast()&&C.getLast().type==1&&C.getLast().getAttribute("type")=="_moz"){C.getLast().remove()}C.appendBogus()}if(C.type==1&&C.getName()==D&&C.$.firstChild){C.trim();var H=C.getFirst();if(H.type==1&&H.isBlockBoundary()){var I=new d.documentFragment(x);C.moveChildren(I);C=I}}var J=C.$.nodeName.toLowerCase();if(!c&&(J=="div"||J=="p")){C.appendBogus()}y.append(C);z=null;A++}else{return null}}}if(t.length<=A||Math.max(t[A].indent,0)<B){break}}if(u){var K=y.getFirst();while(K){if(K.type==1){h.clearMarkers(u,K)}K=K.getNextSourceNode()}}return{listNode:y,nextIndex:A}}};function n(t,u){t.getCommand(this.name).setState(u)}function o(t){var u=t.data.path,v=u.blockLimit,w=u.elements,x;for(var y=0;y<w.length&&(x=w[y])&&(!x.equals(v));y++){if(l[w[y].getName()]){return n.call(this,t.editor,this.type==w[y].getName()?1:2)}}return n.call(this,t.editor,2)}function p(t,u,v,w){var x=j.list.listToArray(u.root,v),y=[];for(var z=0;z<u.contents.length;z++){var A=u.contents[z];A=A.getAscendant("li",true);if(!A||A.getCustomData("list_item_processed")){continue}y.push(A);h.setMarker(v,A,"list_item_processed",true)}var B=u.root.getDocument().createElement(this.type);for(z=0;z<y.length;z++){var C=y[z].getCustomData("listarray_index");x[C].parent=B}var D=j.list.arrayToList(x,v,null,t.config.enterMode),E,F=D.listNode.getChildCount();for(z=0;z<F&&(E=D.listNode.getChild(z));z++){if(E.getName()==this.type){w.push(E)}}D.listNode.replace(u.root)}function q(t,u,v){var w=u.contents,x=u.root.getDocument(),y=[];if(w.length==1&&w[0].equals(u.root)){var z=x.createElement("div");w[0].moveChildren&&w[0].moveChildren(z);w[0].append(z);w[0]=z}var A=u.contents[0].getParent();for(var B=0;B<w.length;B++){A=A.getCommonAncestor(w[B].getParent())}for(B=0;B<w.length;B++){var C=w[B],D;while(D=C.getParent()){if(D.equals(A)){y.push(C);break}C=D}}if(y.length<1){return }var E=y[y.length-1].getNext(),F=x.createElement(this.type);v.push(F);while(y.length){var G=y.shift(),H=x.createElement("li");G.moveChildren(H);G.remove();H.appendTo(F);if(!c){H.appendBogus()}}if(E){F.insertBefore(E)}else{F.appendTo(A)}}function r(t,u,v){var w=j.list.listToArray(u.root,v),x=[];for(var y=0;y<u.contents.length;y++){var z=u.contents[y];z=z.getAscendant("li",true);if(!z||z.getCustomData("list_item_processed")){continue}x.push(z);h.setMarker(v,z,"list_item_processed",true)}var A=null;for(y=0;y<x.length;y++){var B=x[y].getCustomData("listarray_index");w[B].indent=-1;A=B}for(y=A+1;y<w.length;y++){if(w[y].indent>w[y-1].indent+1){var C=w[y-1].indent+1-w[y].indent,D=w[y].indent;while(w[y]&&w[y].indent>=D){w[y].indent+=C;y++}y--}}var E=j.list.arrayToList(w,v,null,t.config.enterMode),F=E.listNode,G,H;function I(K){if((G=F[K?"getFirst":"getLast"]())&&(!(G.is&&G.isBlockBoundary())&&(H=u.root[K?"getPrevious":"getNext"](d.walker.whitespaces(true)))&&(!(H.is&&H.isBlockBoundary({br:1}))))){t.document.createElement("br")[K?"insertBefore":"insertAfter"](G)}}I(true);I();var J=u.root.getParent();F.replace(u.root)}function s(t,u){this.name=t;this.type=u}s.prototype={exec:function(t){t.focus();var u=t.document,v=t.getSelection(),w=v&&v.getRanges();if(!w||w.length<1){return }if(this.state==2){var x=u.getBody();x.trim();if(!x.getFirst()){var y=u.createElement(t.config.enterMode==1?"p":t.config.enterMode==3?"div":"br");y.appendTo(x);w=[new d.range(u)];if(y.is("br")){w[0].setStartBefore(y);w[0].setEndAfter(y)}else{w[0].selectNodeContents(y)}v.selectRanges(w)}else{var z=w.length==1&&w[0],A=z&&z.getEnclosedNode();if(A&&A.is&&this.type==A.getName()){n.call(this,t,1)}}}var B=v.createBookmarks(true),C=[],D={};while(w.length>0){z=w.shift();var E=z.getBoundaryNodes(),F=E.startNode,G=E.endNode;if(F.type==1&&F.getName()=="td"){z.setStartAt(E.startNode,1)}if(G.type==1&&G.getName()=="td"){z.setEndAt(E.endNode,2)}var H=z.createIterator(),I;H.forceBrBreak=this.state==2;while(I=H.getNextParagraph()){var J=new d.elementPath(I),K=null,L=false,M=J.blockLimit,N;for(var O=0;O<J.elements.length&&(N=J.elements[O])&&(!N.equals(M));O++){if(l[N.getName()]){M.removeCustomData("list_group_object");var P=N.getCustomData("list_group_object");if(P){P.contents.push(I)}else{P={root:N,contents:[I]};C.push(P);h.setMarker(D,N,"list_group_object",P)}L=true;break}}if(L){continue}var Q=M;if(Q.getCustomData("list_group_object")){Q.getCustomData("list_group_object").contents.push(I)}else{P={root:Q,contents:[I]};h.setMarker(D,Q,"list_group_object",P);C.push(P)}}}var R=[];while(C.length>0){P=C.shift();if(this.state==2){if(l[P.root.getName()]){p.call(this,t,P,D,R)}else{q.call(this,t,P,R)}}else{if(this.state==1&&l[P.root.getName()]){r.call(this,t,P,D)}}}for(O=0;O<R.length;O++){K=R[O];var S,T=this;(S=function(U){var V=K[U?"getPrevious":"getNext"](d.walker.whitespaces(true));if(V&&V.getName&&V.getName()==T.type){V.remove();V.moveChildren(K,U?true:false)}})();S(true)}h.clearAllMarkers(D);v.selectBookmarks(B);t.focus()}};j.add("list",{init:function(t){var u=new s("numberedlist","ol"),v=new s("bulletedlist","ul");t.addCommand("numberedlist",u);t.addCommand("bulletedlist",v);t.ui.addButton("NumberedList",{label:t.lang.numberedlist,command:"numberedlist"});t.ui.addButton("BulletedList",{label:t.lang.bulletedlist,command:"bulletedlist"});t.on("selectionChange",e.bind(o,u));t.on("selectionChange",e.bind(o,v))},requires:["domiterator"]})})();(function(){function l(q){if(!q||q.type!=1||q.getName()!="form"){return[]}var r=[],s=["style","className"];for(var t=0;t<s.length;t++){var u=s[t],v=q.$.elements.namedItem(u);if(v){var w=new h(v);r.push([w,w.nextSibling]);w.remove()}}return r}function m(q,r){if(!q||q.type!=1||q.getName()!="form"){return }if(r.length>0){for(var s=r.length-1;s>=0;s--){var t=r[s][0],u=r[s][1];if(u){t.insertBefore(u)}else{t.appendTo(q)}}}}function n(q,r){var s=l(q),t={},u=q.$;if(!r){t["class"]=u.className||"";u.className=""}t.inline=u.style.cssText||"";if(!r){u.style.cssText="position: static; overflow: visible"}m(s);return t}function o(q,r){var s=l(q),t=q.$;if("class" in r){t.className=r["class"]}if("inline" in r){t.style.cssText=r.inline}m(s)}function p(q,r){return function(){var s=q.getViewPaneSize();r.resize(s.width,s.height,null,true)}}j.add("maximize",{init:function(q){var r=q.lang,s=a.document,t=s.getWindow(),u,v,w,x=p(t,q),y=2;q.addCommand("maximize",{modes:{wysiwyg:1,source:1},editorFocus:false,exec:function(){var M=this;var z=q.container.getChild([0,0]),A=q.getThemeSpace("contents");if(q.mode=="wysiwyg"){var B=q.getSelection();u=B&&B.getRanges();v=t.getScrollPosition()}else{var C=q.textarea.$;u=!c&&[C.selectionStart,C.selectionEnd];v=[C.scrollLeft,C.scrollTop]}if(M.state==2){t.on("resize",x);w=t.getScrollPosition();var D=q.container;while(D=D.getParent()){D.setCustomData("maximize_saved_styles",n(D));D.setStyle("z-index",q.config.baseFloatZIndex-1)}A.setCustomData("maximize_saved_styles",n(A,true));z.setCustomData("maximize_saved_styles",n(z,true));if(c){s.$.documentElement.style.overflow=s.getBody().$.style.overflow="hidden"}else{s.getBody().setStyles({overflow:"hidden",width:"0px",height:"0px"})}t.$.scrollTo(0,0);var E=t.getViewPaneSize();z.setStyle("position","absolute");z.$.offsetLeft;z.setStyles({"z-index":q.config.baseFloatZIndex-1,left:"0px",top:"0px"});q.resize(E.width,E.height,null,true);var F=z.getDocumentPosition();z.setStyles({left:-1*F.x+"px",top:-1*F.y+"px"});z.addClass("cke_maximized")}else{if(M.state==1){t.removeListener("resize",x);var G=[A,z];for(var H=0;H<G.length;H++){o(G[H],G[H].getCustomData("maximize_saved_styles"));G[H].removeCustomData("maximize_saved_styles")}D=q.container;while(D=D.getParent()){o(D,D.getCustomData("maximize_saved_styles"));D.removeCustomData("maximize_saved_styles")}t.$.scrollTo(w.x,w.y);z.removeClass("cke_maximized");q.fire("resize")}}M.toggleState();var I=M.uiItems[0],J=M.state==2?r.maximize:r.minimize,K=q.element.getDocument().getById(I._.id);K.getChild(1).setHtml(J);K.setAttribute("title",J);K.setAttribute("href",'javascript:void("'+J+'");');if(q.mode=="wysiwyg"){if(u){q.getSelection().selectRanges(u);var L=q.getSelection().getStartElement();L&&L.scrollIntoView(true)}else{t.$.scrollTo(v.x,v.y)}}else{if(u){C.selectionStart=u[0];C.selectionEnd=u[1]}C.scrollLeft=v[0];C.scrollTop=v[1]}u=v=null;y=M.state},canUndo:false});q.ui.addButton("Maximize",{label:r.maximize,command:"maximize"});q.on("mode",function(){q.getCommand("maximize").setState(y)},null,null,100)}})})();j.add("newpage",{init:function(l){l.addCommand("newpage",{modes:{wysiwyg:1,source:1},exec:function(m){var n=this;m.setData(m.config.newpage_html,function(){m.fire("afterCommandExec",{name:n.name,command:n})});m.focus()},async:true});l.ui.addButton("NewPage",{label:l.lang.newPage,command:"newpage"})}});i.newpage_html="";j.add("pagebreak",{init:function(l){l.addCommand("pagebreak",j.pagebreakCmd);l.ui.addButton("PageBreak",{label:l.lang.pagebreak,command:"pagebreak"});l.addCss("img.cke_pagebreak{background-image: url("+a.getUrl(this.path+"images/pagebreak.gif")+");background-position: center center;background-repeat: no-repeat;clear: both;display: block;float: none;width: 100%;border-top: #999999 1px dotted;border-bottom: #999999 1px dotted;height: 5px;}")},afterInit:function(l){var m=l.dataProcessor,n=m&&m.dataFilter;if(n){n.addRules({elements:{div:function(o){var p=o.attributes.style,q=p&&o.children.length==1&&o.children[0],r=q&&q.name=="span"&&q.attributes.style;if(r&&/page-break-after\s*:\s*always/i.test(p)&&/display\s*:\s*none/i.test(r)){return l.createFakeParserElement(o,"cke_pagebreak","div")}}}})}},requires:["fakeobjects"]});j.pagebreakCmd={exec:function(l){var m=h.createFromHtml('<div style="page-break-after: always;"><span style="display: none;">&nbsp;</span></div>');m=l.createFakeElement(m,"cke_pagebreak","div");var n=l.getSelection().getRanges();for(var o,p=0;p<n.length;p++){o=n[p];if(p>0){m=m.clone(true)}o.splitBlock("p");o.insertNode(m)}}};j.add("pastefromword",{init:function(l){l.addCommand("pastefromword",new a.dialogCommand("pastefromword"));l.ui.addButton("PasteFromWord",{label:l.lang.pastefromword.toolbar,command:"pastefromword"});a.dialog.add("pastefromword",this.path+"dialogs/pastefromword.js")}});i.pasteFromWordIgnoreFontFace=true;i.pasteFromWordRemoveStyle=false;i.pasteFromWordKeepsStructure=false;(function(){var l={exec:function(n){if(a.getClipboardData()===false||!window.clipboardData){n.openDialog("pastetext");return }n.insertText(window.clipboardData.getData("Text"))}};j.add("pastetext",{init:function(n){var o="pastetext",p=n.addCommand(o,l);n.ui.addButton("PasteText",{label:n.lang.pasteText.button,command:o});a.dialog.add(o,a.getUrl(this.path+"dialogs/pastetext.js"));if(n.config.forcePasteAsPlainText){n.on("beforePaste",function(q){if(n.mode=="wysiwyg"){setTimeout(function(){p.exec()},0);q.cancel()}},null,null,20)}},requires:["clipboard"]});var m;a.getClipboardData=function(){if(!c){return false}var n=a.document,o=n.getBody();if(!m){m=n.createElement("div",{attributes:{id:"cke_hiddenDiv"},styles:{position:"absolute",visibility:"hidden",overflow:"hidden",width:"1px",height:"1px"}});m.setHtml("");m.appendTo(o)}var p=false,q=function(){p=true};o.on("paste",q);var r=o.$.createTextRange();r.moveToElementText(m.$);r.execCommand("Paste");var s=m.getHtml();m.setHtml("");o.removeListener("paste",q);return p&&s}})();a.editor.prototype.insertText=function(l){l=e.htmlEncode(l);l=l.replace(/(?:\r\n)|\n|\r/g,"<br>");this.insertHtml(l)};i.forcePasteAsPlainText=false;j.add("popup");e.extend(a.editor.prototype,{popup:function(l,m,n){m=m||"80%";n=n||"70%";if(typeof m=="string"&&m.length>1&&m.substr(m.length-1,1)=="%"){m=parseInt(window.screen.width*parseInt(m,10)/100,10)}if(typeof n=="string"&&n.length>1&&n.substr(n.length-1,1)=="%"){n=parseInt(window.screen.height*parseInt(n,10)/100,10)}if(m<640){m=640}if(n<420){n=420}var o=parseInt((window.screen.height-n)/(2),10),p=parseInt((window.screen.width-m)/(2),10),q="location=no,menubar=no,toolbar=no,dependent=yes,minimizable=no,modal=yes,alwaysRaised=yes,resizable=yes,width="+m+",height="+n+",top="+o+",left="+p,r=window.open("",null,q,true);if(!r){return false}try{r.moveTo(p,o);r.resizeTo(m,n);r.focus();r.location.href=l}catch(s){r=window.open(l,null,q,true)}return true}});(function(){var l={modes:{wysiwyg:1,source:1},canUndo:false,exec:function(n){var o,p=b.isCustomDomain();if(n.config.fullPage){o=n.getData()}else{var q="<body ",r=a.document.getBody(),s=n.config.baseHref.length>0?'<base href="'+n.config.baseHref+'" _cktemp="true"></base>':"";if(r.getAttribute("id")){q+='id="'+r.getAttribute("id")+'" '}if(r.getAttribute("class")){q+='class="'+r.getAttribute("class")+'" '}q+=">";o=n.config.docType+'<html dir="'+n.config.contentsLangDirection+'"><head>'+s+"<title>"+n.lang.preview+'</title><link type="text/css" rel="stylesheet" href="'+[].concat(n.config.contentsCss).join('"><link type="text/css" rel="stylesheet" href="')+'"></head>'+q+n.getData()+"</body></html>"}var t=640,u=420,v=80;try{var w=window.screen;t=Math.round(w.width*0.8);u=Math.round(w.height*0.7);v=Math.round(w.width*0.1)}catch(z){}var x="";if(p){window._cke_htmlToLoad=o;x='javascript:void( (function(){document.open();document.domain="'+document.domain+'";document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad = null;})() )'}var y=window.open(x,null,"toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+t+",height="+u+",left="+v);if(!p){y.document.write(o);y.document.close()}}},m="preview";j.add(m,{init:function(n){n.addCommand(m,l);n.ui.addButton("Preview",{label:n.lang.preview,command:m})}})})();j.add("print",{init:function(l){var m="print",n=l.addCommand(m,j.print);l.ui.addButton("Print",{label:l.lang.print,command:m})}});j.print={exec:function(l){if(b.opera){return }else{if(b.gecko){l.window.$.print()}else{l.document.$.execCommand("Print")}}},canUndo:false,modes:{wysiwyg:!b.opera}};j.add("removeformat",{requires:["selection"],init:function(l){l.addCommand("removeFormat",j.removeformat.commands.removeformat);l.ui.addButton("RemoveFormat",{label:l.lang.removeFormat,command:"removeFormat"})}});j.removeformat={commands:{removeformat:{exec:function(l){var m=l._.removeFormatRegex||(l._.removeFormatRegex=new RegExp("^(?:"+l.config.removeFormatTags.replace(/,/g,"|")+")$","i")),n=l._.removeAttributes||(l._.removeAttributes=l.config.removeFormatAttributes.split(",")),o=l.getSelection().getRanges();for(var p=0,q;q=o[p];p++){if(q.collapsed){continue}q.enlarge(1);var r=q.createBookmark(),s=r.startNode,t=r.endNode,u=function(x){var y=new d.elementPath(x),z=y.elements;for(var A=1,B;B=z[A];A++){if(B.equals(y.block)||B.equals(y.blockLimit)){break}if(m.test(B.getName())){x.breakParent(B)}}};u(s);u(t);var v=s.getNextSourceNode(true,1);while(v){if(v.equals(t)){break}var w=v.getNextSourceNode(false,1);if(v.getName()!="img"||!v.getAttribute("_cke_protected_html")){if(m.test(v.getName())){v.remove(true)}else{v.removeAttributes(n)}}v=w}q.moveToBookmark(r)}l.getSelection().selectRanges(o)}}}};i.removeFormatTags="b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var";i.removeFormatAttributes="class,style,lang,width,height,align,hspace,valign";j.add("resize",{init:function(l){var m=l.config;if(m.resize_enabled){var n=null,o,p;function q(t){var u=t.data.$.screenX-o.x,v=t.data.$.screenY-o.y,w=p.width+u*(l.lang.dir=="rtl"?-1:1),x=p.height+v;l.resize(Math.max(m.resize_minWidth,Math.min(w,m.resize_maxWidth)),Math.max(m.resize_minHeight,Math.min(x,m.resize_maxHeight)))}function r(t){a.document.removeListener("mousemove",q);a.document.removeListener("mouseup",r);if(l.document){l.document.removeListener("mousemove",q);l.document.removeListener("mouseup",r)}}var s=e.addFunction(function(t){if(!n){n=l.getResizable()}p={width:n.$.offsetWidth||0,height:n.$.offsetHeight||0};o={x:t.screenX,y:t.screenY};a.document.on("mousemove",q);a.document.on("mouseup",r);if(l.document){l.document.on("mousemove",q);l.document.on("mouseup",r)}});l.on("themeSpace",function(t){if(t.data.space=="bottom"){t.data.html+='<div class="cke_resizer" title="'+e.htmlEncode(l.lang.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+s+', event)"></div>'}},l,null,100)}}});i.resize_minWidth=750;i.resize_minHeight=250;i.resize_maxWidth=3000;i.resize_maxHeight=3000;i.resize_enabled=true;(function(){var l={modes:{wysiwyg:1,source:1},exec:function(n){var o=n.element.$.form;if(o){try{o.submit()}catch(p){if(o.submit.click){o.submit.click()}}}}},m="save";j.add(m,{init:function(n){var o=n.addCommand(m,l);o.modes={wysiwyg:!!n.element.$.form};n.ui.addButton("Save",{label:n.lang.save,command:m})}})})();(function(){var l="scaytcheck",m="",n=function(){var r=this,s=function(){var v={};v.srcNodeRef=r.document.getWindow().$.frameElement;v.assocApp="CKEDITOR."+a.version+"@"+a.revision;v.customerid=r.config.scayt_customerid||"1:11111111111111111111111111111111111111";v.customDictionaryName=r.config.scayt_customDictionaryName;v.userDictionaryName=r.config.scayt_userDictionaryName;v.defLang=r.scayt_defLang;if(a._scaytParams){for(var w in a._scaytParams){v[w]=a._scaytParams[w]}}var x=new window.scayt(v),y=o.instances[r.name];if(y){x.sLang=y.sLang;x.option(y.option());x.paused=y.paused}o.instances[r.name]=x;try{x.setDisabled(x.paused===false)}catch(z){}r.fire("showScaytState")};r.on("contentDom",s);r.on("contentDomUnload",function(){var v=a.document.getElementsByTag("script"),w=/^dojoIoScript(\d+)$/i,x=/^https?:\/\/svc\.spellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;for(var y=0;y<v.count();y++){var z=v.getItem(y),A=z.getId(),B=z.getAttribute("src");if(A&&B&&A.match(w)&&B.match(x)){z.remove()}}});r.on("beforeCommandExec",function(v){if((v.data.name=="source"||v.data.name=="newpage")&&(r.mode=="wysiwyg")){var w=o.getScayt(r);if(w){w.paused=!w.disabled;w.destroy();delete o.instances[r.name]}}});r.on("afterSetData",function(){if(o.isScaytEnabled(r)){o.getScayt(r).refresh()}});r.on("insertElement",function(){var v=o.getScayt(r);if(o.isScaytEnabled(r)){if(c){r.getSelection().unlock(true)}try{v.refresh()}catch(w){}}},this,null,50);r.on("scaytDialog",function(v){v.data.djConfig=window.djConfig;v.data.scayt_control=o.getScayt(r);v.data.tab=m;v.data.scayt=window.scayt});var t=r.dataProcessor,u=t&&t.htmlFilter;if(u){u.addRules({elements:{span:function(v){if(v.attributes.scayt_word&&v.attributes.scaytid){delete v.name;return v}}}})}if(r.document){s()}};j.scayt={engineLoaded:false,instances:{},getScayt:function(r){return this.instances[r.name]},isScaytReady:function(r){return this.engineLoaded===true&&"undefined"!==typeof window.scayt&&this.getScayt(r)},isScaytEnabled:function(r){var s=this.getScayt(r);return s?s.disabled===false:false},loadEngine:function(r){if(this.engineLoaded===true){return n.apply(r)}else{if(this.engineLoaded==-1){return a.on("scaytReady",function(){n.apply(r)})}}a.on("scaytReady",n,r);a.on("scaytReady",function(){this.engineLoaded=true},this,null,0);this.engineLoaded=-1;var s=document.location.protocol;s=s.search(/https?:/)!=-1?s:"http:";var t="svc.spellchecker.net/spellcheck/lf/scayt/scayt1.js",u=r.config.scayt_srcUrl||s+"//"+t,v=o.parseUrl(u).path+"/";a._djScaytConfig={baseUrl:v,addOnLoad:[function(){a.fireOnce("scaytReady")}],isDebug:false};a.document.getHead().append(a.document.createElement("script",{attributes:{type:"text/javascript",src:u}}));return null},parseUrl:function(r){var s;if(r.match&&(s=r.match(/(.*)[\/\\](.*?\.\w+)$/))){return{path:s[1],file:s[2]}}else{return r}}};var o=j.scayt,p=function(r,s,t,u,v,w,x){r.addCommand(u,v);r.addMenuItem(u,{label:t,command:u,group:w,order:x})},q={preserveState:true,editorFocus:false,exec:function(r){if(o.isScaytReady(r)){var s=o.isScaytEnabled(r);this.setState(s?2:1);var t=o.getScayt(r);t.setDisabled(s)}else{if(!r.config.scayt_autoStartup&&o.engineLoaded>=0){this.setState(0);r.on("showScaytState",function(){this.removeListener();this.setState(o.isScaytEnabled(r)?1:2)},this);o.loadEngine(r)}}}};j.add("scayt",{requires:["menubutton"],beforeInit:function(r){r.config.menu_groups="scayt_suggest,scayt_moresuggest,scayt_control,"+r.config.menu_groups},init:function(r){var s={},t={},u=r.addCommand(l,q);a.dialog.add(l,a.getUrl(this.path+"dialogs/options.js"));var v="scaytButton";r.addMenuGroup(v);r.addMenuItems({scaytToggle:{label:r.lang.scayt.enable,command:l,group:v},scaytOptions:{label:r.lang.scayt.options,group:v,onClick:function(){m="options";r.openDialog(l)}},scaytLangs:{label:r.lang.scayt.langs,group:v,onClick:function(){m="langs";r.openDialog(l)}},scaytAbout:{label:r.lang.scayt.about,group:v,onClick:function(){m="about";r.openDialog(l)}}});r.ui.add("Scayt",5,{label:r.lang.scayt.title,title:r.lang.scayt.title,className:"cke_button_scayt",onRender:function(){u.on("state",function(){this.setState(u.state)},this)},onMenu:function(){var x=o.isScaytEnabled(r);r.getMenuItem("scaytToggle").label=r.lang.scayt[x?"disable":"enable"];return{scaytToggle:2,scaytOptions:x?2:0,scaytLangs:x?2:0,scaytAbout:x?2:0}}});if(r.contextMenu&&r.addMenuItems){r.contextMenu.addListener(function(x){if(!(o.isScaytEnabled(r)&&x)){return null}var y=o.getScayt(r),z=y.getWord(x.$);if(!z){return null}var A=y.getLang(),B={},C=window.scayt.getSuggestion(z,A);if(!C||!C.length){return null}for(i in s){delete r._.menuItems[i];delete r._.commands[i]}for(i in t){delete r._.menuItems[i];delete r._.commands[i]}s={};t={};var D=false;for(var E=0,F=C.length;E<F;E+=1){var G="scayt_suggestion_"+C[E].replace(" ","_"),H=(function(L,M){return{exec:function(){y.replace(L,M)}}})(x.$,C[E]);if(E<r.config.scayt_maxSuggestions){p(r,"button_"+G,C[E],G,H,"scayt_suggest",E+1);B[G]=2;t[G]=2}else{p(r,"button_"+G,C[E],G,H,"scayt_moresuggest",E+1);s[G]=2;D=true}}if(D){r.addMenuItem("scayt_moresuggest",{label:r.lang.scayt.moreSuggestions,group:"scayt_moresuggest",order:10,getItems:function(){return s}})}var I={exec:function(){y.ignore(x.$)}},J={exec:function(){y.ignoreAll(x.$)}},K={exec:function(){window.scayt.addWordToUserDictionary(x.$)}};p(r,"ignore",r.lang.scayt.ignore,"scayt_ignore",I,"scayt_control",1);p(r,"ignore_all",r.lang.scayt.ignoreAll,"scayt_ignore_all",J,"scayt_control",2);p(r,"add_word",r.lang.scayt.addWord,"scayt_add_word",K,"scayt_control",3);t.scayt_moresuggest=2;t.scayt_ignore=2;t.scayt_ignore_all=2;t.scayt_add_word=2;if(y.fireOnContextMenu){y.fireOnContextMenu(r)}return t})}if(r.config.scayt_autoStartup){var w=function(){r.removeListener("showScaytState",w);u.setState(o.isScaytEnabled(r)?1:2)};r.on("showScaytState",w);o.loadEngine(r)}}})})();i.scayt_maxSuggestions=5;i.scayt_autoStartup=false;j.add("smiley",{requires:["dialog"],init:function(l){l.addCommand("smiley",new a.dialogCommand("smiley"));l.ui.addButton("Smiley",{label:l.lang.smiley.toolbar,command:"smiley"});a.dialog.add("smiley",this.path+"dialogs/smiley.js")}});i.smiley_path=a.basePath+"plugins/smiley/images/";i.smiley_images=["regular_smile.gif","sad_smile.gif","wink_smile.gif","teeth_smile.gif","confused_smile.gif","tounge_smile.gif","embaressed_smile.gif","omg_smile.gif","whatchutalkingabout_smile.gif","angry_smile.gif","angel_smile.gif","shades_smile.gif","devil_smile.gif","cry_smile.gif","lightbulb.gif","thumbs_down.gif","thumbs_up.gif","heart.gif","broken_heart.gif","kiss.gif","envelope.gif"];i.smiley_descriptions=[":)",":(",";)",":D",":/",":P","","","","","","","",";(","","","","","",":kiss",""];(function(){var l=".%2 p,.%2 div,.%2 pre,.%2 address,.%2 blockquote,.%2 h1,.%2 h2,.%2 h3,.%2 h4,.%2 h5,.%2 h6{background-repeat: no-repeat;border: 1px dotted gray;padding-top: 8px;padding-left: 8px;}.%2 p{%1p.png);}.%2 div{%1div.png);}.%2 pre{%1pre.png);}.%2 address{%1address.png);}.%2 blockquote{%1blockquote.png);}.%2 h1{%1h1.png);}.%2 h2{%1h2.png);}.%2 h3{%1h3.png);}.%2 h4{%1h4.png);}.%2 h5{%1h5.png);}.%2 h6{%1h6.png);}",m=/%1/g,n=/%2/g,o={preserveState:true,editorFocus:false,exec:function(p){this.toggleState();this.refresh(p)},refresh:function(p){var q=this.state==1?"addClass":"removeClass";p.document.getBody()[q]("cke_show_blocks")}};j.add("showblocks",{requires:["wysiwygarea"],init:function(p){var q=p.addCommand("showblocks",o);q.canUndo=false;if(p.config.startupOutlineBlocks){q.setState(1)}p.addCss(l.replace(m,"background-image: url("+a.getUrl(this.path)+"images/block_").replace(n,"cke_show_blocks "));p.ui.addButton("ShowBlocks",{label:p.lang.showBlocks,command:"showblocks"});p.on("mode",function(){if(q.state!=0){q.refresh(p)}});p.on("contentDom",function(){if(q.state!=0){q.refresh(p)}})}})})();i.startupOutlineBlocks=false;j.add("sourcearea",{requires:["editingblock"],init:function(l){var m=j.sourcearea;l.on("editingBlockReady",function(){var n,o;l.addMode("source",{load:function(p,q){if(c&&b.version<8){p.setStyle("position","relative")}l.textarea=n=new h("textarea");n.setAttributes({dir:"ltr",tabIndex:-1});n.addClass("cke_source");n.addClass("cke_enable_context_menu");var r={width:b.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"};if(c){if(!b.ie8Compat){o=function(){n.hide();n.setStyle("height",p.$.clientHeight+"px");n.show()};l.on("resize",o);l.on("afterCommandExec",function(t){if(t.data.name=="toolbarCollapse"){o()}});r.height=p.$.clientHeight+"px"}}else{n.on("mousedown",function(t){t.data.stopPropagation()})}p.setHtml("");p.append(n);n.setStyles(r);n.on("blur",function(){l.focusManager.blur()});n.on("focus",function(){l.focusManager.focus()});l.mayBeDirty=true;this.loadData(q);var s=l.keystrokeHandler;if(s){s.attach(n)}setTimeout(function(){l.mode="source";l.fire("mode")},b.gecko||b.webkit?100:0)},loadData:function(p){n.setValue(p);l.fire("dataReady")},getData:function(){return n.getValue()},getSnapshotData:function(){return n.getValue()},unload:function(p){l.textarea=n=null;if(o){l.removeListener("resize",o)}if(c&&b.version<8){p.removeStyle("position")}},focus:function(){n.focus()}})});l.addCommand("source",m.commands.source);if(l.ui.addButton){l.ui.addButton("Source",{label:l.lang.source,command:"source"})}l.on("mode",function(){l.getCommand("source").setState(l.mode=="source"?1:2)})}});j.sourcearea={commands:{source:{modes:{wysiwyg:1,source:1},exec:function(l){if(l.mode=="wysiwyg"){l.fire("saveSnapshot")}l.getCommand("source").setState(0);l.setMode(l.mode=="source"?"wysiwyg":"source")},canUndo:false}}};(function(){j.add("stylescombo",{requires:["richcombo","styles"],init:function(o){var p=o.config,q=o.lang.stylesCombo,r=this.path,s;o.ui.addRichCombo("Styles",{label:q.label,title:q.panelTitle,voiceLabel:q.voiceLabel,className:"cke_styles",multiSelect:true,panel:{css:[a.getUrl(o.skinPath+"editor.css")].concat(p.contentsCss),voiceLabel:q.panelVoiceLabel},init:function(){var t=this,u=p.stylesCombo_stylesSet.split(":"),v=u[1]?u.slice(1).join(":"):a.getUrl(r+"styles/"+u[0]+".js");u=u[0];a.loadStylesSet(u,v,function(w){var x,y,z=[];s={};for(var A=0;A<w.length;A++){var B=w[A];y=B.name;x=s[y]=new a.style(B);x._name=y;z.push(x)}z.sort(n);var C;for(A=0;A<z.length;A++){x=z[A];y=x._name;var D=x.type;if(D!=C){t.startGroup(q["panelTitle"+String(D)]);C=D}t.add(y,x.type==3?y:m(x._.definition),y)}t.commit();t.onOpen()})},onClick:function(t){o.focus();o.fire("saveSnapshot");var u=s[t],v=o.getSelection();if(u.type==3){var w=v.getSelectedElement();if(w){u.applyToObject(w)}return }var x=new d.elementPath(v.getStartElement());if(u.type==2&&u.checkActive(x)){u.remove(o.document)}else{u.apply(o.document)}o.fire("saveSnapshot")},onRender:function(){o.on("selectionChange",function(t){var u=this.getValue(),v=t.data.path,w=v.elements;for(var x=0,y;x<w.length;x++){y=w[x];for(var z in s){if(s[z].checkElementRemovable(y,true)){if(z!=u){this.setValue(z)}return }}}this.setValue("")},this)},onOpen:function(){var B=this;if(c){o.focus()}var t=o.getSelection(),u=t.getSelectedElement(),v=u&&u.getName(),w=new d.elementPath(u||t.getStartElement()),x=[0,0,0,0];B.showAll();B.unmarkAll();for(var y in s){var z=s[y],A=z.type;if(A==3){if(u&&z.element==v){if(z.checkElementRemovable(u,true)){B.mark(y)}x[A]++}else{B.hideItem(y)}}else{if(z.checkActive(w)){B.mark(y)}x[A]++}}if(!x[1]){B.hideGroup(q["panelTitle"+String(1)])}if(!x[2]){B.hideGroup(q["panelTitle"+String(2)])}if(!x[3]){B.hideGroup(q["panelTitle"+String(3)])}}})}});var l={};a.addStylesSet=function(o,p){l[o]=p};a.loadStylesSet=function(o,p,q){var r=l[o];if(r){q(r);return }a.scriptLoader.load(p,function(){q(l[o])})};function m(o){var p=[],q=o.element;if(q=="bdo"){q="span"}p=["<",q];var r=o.attributes;if(r){for(var s in r){p.push(" ",s,'="',r[s],'"')}}var t=a.style.getStyleText(o);if(t){p.push(' style="',t,'"')}p.push(">",o.name,"</",q,">");return p.join("")}function n(o,p){var q=o.type,r=p.type;return q==r?0:q==3?-1:r==3?1:r==1?1:-1}})();i.stylesCombo_stylesSet="default";j.add("table",{init:function(l){var m=j.table,n=l.lang.table;l.addCommand("table",new a.dialogCommand("table"));l.addCommand("tableProperties",new a.dialogCommand("tableProperties"));l.ui.addButton("Table",{label:n.toolbar,command:"table"});a.dialog.add("table",this.path+"dialogs/table.js");a.dialog.add("tableProperties",this.path+"dialogs/table.js");if(l.addMenuItems){l.addMenuItems({table:{label:n.menu,command:"tableProperties",group:"table",order:5},tabledelete:{label:n.deleteTable,command:"tableDelete",group:"table",order:1}})}if(l.contextMenu){l.contextMenu.addListener(function(o,p){if(!o){return null}var q=o.is("table")||o.hasAscendant("table");if(q){return{tabledelete:2,table:2}}return null})}}});(function(){function l(y,z){if(c){y.removeAttribute(z)}else{delete y[z]}}var m=/^(?:td|th)$/;function n(y){var z=y.createBookmarks(),A=y.getRanges(),B=[],C={};function D(L){if(B.length>0){return }if(L.type==1&&m.test(L.getName())&&!L.getCustomData("selected_cell")){h.setMarker(C,L,"selected_cell",true);B.push(L)}}for(var E=0;E<A.length;E++){var F=A[E];if(F.collapsed){var G=F.getCommonAncestor(),H=G.getAscendant("td",true)||G.getAscendant("th",true);if(H){B.push(H)}}else{var I=new d.walker(F),J;I.guard=D;while(J=I.next()){var K=J.getParent();if(K&&m.test(K.getName())&&!K.getCustomData("selected_cell")){h.setMarker(C,K,"selected_cell",true);B.push(K)}}}}h.clearAllMarkers(C);y.selectBookmarks(z);return B}function o(y){var z=new h(y),A=(z.getName()=="table"?y:z.getAscendant("table")).$,B=A.rows,C=-1,D=[];for(var E=0;E<B.length;E++){C++;if(!D[C]){D[C]=[]}var F=-1;for(var G=0;G<B[E].cells.length;G++){var H=B[E].cells[G];F++;while(D[C][F]){F++}var I=isNaN(H.colSpan)?1:H.colSpan,J=isNaN(H.rowSpan)?1:H.rowSpan;for(var K=0;K<J;K++){if(!D[C+K]){D[C+K]=[]}for(var L=0;L<I;L++){D[C+K][F+L]=B[E].cells[G]}}F+=I-1}}return D}function p(y,z){var A=c?"_cke_rowspan":"rowSpan";for(var B=0;B<y.length;B++){for(var C=0;C<y[B].length;C++){var D=y[B][C];if(D.parentNode){D.parentNode.removeChild(D)}D.colSpan=D[A]=1}}var E=0;for(B=0;B<y.length;B++){for(C=0;C<y[B].length;C++){D=y[B][C];if(!D){continue}if(C>E){E=C}if(D._cke_colScanned){continue}if(y[B][C-1]==D){D.colSpan++}if(y[B][C+1]!=D){D._cke_colScanned=1}}}for(B=0;B<=E;B++){for(C=0;C<y.length;C++){if(!y[C]){continue}D=y[C][B];if(!D||D._cke_rowScanned){continue}if(y[C-1]&&y[C-1][B]==D){D[A]++}if(!y[C+1]||y[C+1][B]!=D){D._cke_rowScanned=1}}}for(B=0;B<y.length;B++){for(C=0;C<y[B].length;C++){D=y[B][C];l(D,"_cke_colScanned");l(D,"_cke_rowScanned")}}for(B=0;B<y.length;B++){var F=z.ownerDocument.createElement("tr");for(C=0;C<y[B].length;){D=y[B][C];if(y[B-1]&&y[B-1][C]==D){C+=D.colSpan;continue}F.appendChild(D);if(A!="rowSpan"){D.rowSpan=D[A];D.removeAttribute(A)}C+=D.colSpan;if(D.colSpan==1){D.removeAttribute("colSpan")}if(D.rowSpan==1){D.removeAttribute("rowSpan")}}if(c){z.rows[B].replaceNode(F)}else{var G=new h(z.rows[B]),H=new h(F);G.setHtml("");H.moveChildren(G)}}}function q(y){var z=y.cells;for(var A=0;A<z.length;A++){z[A].innerHTML="";if(!c){new h(z[A]).appendBogus()}}}function r(y,z){var A=y.getStartElement().getAscendant("tr");if(!A){return }var B=A.clone(true);B.insertBefore(A);q(z?B.$:A.$)}function s(y){if(y instanceof d.selection){var z=n(y),A=[];for(var B=0;B<z.length;B++){var C=z[B].getParent();A[C.$.rowIndex]=C}for(B=A.length;B>=0;B--){if(A[B]){s(A[B])}}}else{if(y instanceof h){var D=y.getAscendant("table");if(D.$.rows.length==1){D.remove()}else{y.remove()}}}}function t(y,z){var A=y.getStartElement(),B=A.getAscendant("td",true)||A.getAscendant("th",true);if(!B){return }var C=B.getAscendant("table"),D=B.$.cellIndex;for(var E=0;E<C.$.rows.length;E++){var F=C.$.rows[E];if(F.cells.length<D+1){continue}B=new h(F.cells[D].cloneNode(false));if(!c){B.appendBogus()}var G=new h(F.cells[D]);if(z){B.insertBefore(G)}else{B.insertAfter(G)}}}function u(y){if(y instanceof d.selection){var z=n(y);for(var A=z.length;A>=0;A--){if(z[A]){u(z[A])}}}else{if(y instanceof h){var B=y.getAscendant("table"),C=y.$.cellIndex;for(A=B.$.rows.length-1;A>=0;A--){var D=new h(B.$.rows[A]);if(!C&&D.$.cells.length==1){s(D);continue}if(D.$.cells[C]){D.$.removeChild(D.$.cells[C])}}}}}function v(y,z){var A=y.getStartElement(),B=A.getAscendant("td",true)||A.getAscendant("th",true);if(!B){return }var C=B.clone();if(!c){C.appendBogus()}if(z){C.insertBefore(B)}else{C.insertAfter(B)}}function w(y){if(y instanceof d.selection){var z=n(y);for(var A=z.length-1;A>=0;A--){w(z[A])}}else{if(y instanceof h){if(y.getParent().getChildCount()==1){y.getParent().remove()}else{y.remove()}}}}var x={thead:1,tbody:1,tfoot:1,td:1,tr:1,th:1};j.tabletools={init:function(y){var z=y.lang.table;y.addCommand("cellProperties",new a.dialogCommand("cellProperties"));a.dialog.add("cellProperties",this.path+"dialogs/tableCell.js");y.addCommand("tableDelete",{exec:function(A){var B=A.getSelection(),C=B&&B.getStartElement(),D=C&&C.getAscendant("table",true);if(!D){return }B.selectElement(D);var E=B.getRanges()[0];E.collapse();B.selectRanges([E]);if(D.getParent().getChildCount()==1){D.getParent().remove()}else{D.remove()}}});y.addCommand("rowDelete",{exec:function(A){var B=A.getSelection();s(B)}});y.addCommand("rowInsertBefore",{exec:function(A){var B=A.getSelection();r(B,true)}});y.addCommand("rowInsertAfter",{exec:function(A){var B=A.getSelection();r(B)}});y.addCommand("columnDelete",{exec:function(A){var B=A.getSelection();u(B)}});y.addCommand("columnInsertBefore",{exec:function(A){var B=A.getSelection();t(B,true)}});y.addCommand("columnInsertAfter",{exec:function(A){var B=A.getSelection();t(B)}});y.addCommand("cellDelete",{exec:function(A){var B=A.getSelection();w(B)}});y.addCommand("cellInsertBefore",{exec:function(A){var B=A.getSelection();v(B,true)}});y.addCommand("cellInsertAfter",{exec:function(A){var B=A.getSelection();v(B)}});if(y.addMenuItems){y.addMenuItems({tablecell:{label:z.cell.menu,group:"tablecell",order:1,getItems:function(){var A=n(y.getSelection());return{tablecell_insertBefore:2,tablecell_insertAfter:2,tablecell_delete:2,tablecell_properties:A.length>0?2:0}}},tablecell_insertBefore:{label:z.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:z.cell.insertAfter,group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:z.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_properties:{label:z.cell.title,group:"tablecellproperties",command:"cellProperties",order:20},tablerow:{label:z.row.menu,group:"tablerow",order:1,getItems:function(){return{tablerow_insertBefore:2,tablerow_insertAfter:2,tablerow_delete:2}}},tablerow_insertBefore:{label:z.row.insertBefore,group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:z.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:z.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},tablecolumn:{label:z.column.menu,group:"tablecolumn",order:1,getItems:function(){return{tablecolumn_insertBefore:2,tablecolumn_insertAfter:2,tablecolumn_delete:2}}},tablecolumn_insertBefore:{label:z.column.insertBefore,group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:z.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:z.column.deleteColumn,group:"tablecolumn",command:"columnDelete",order:15}})}if(y.contextMenu){y.contextMenu.addListener(function(A,B){if(!A){return null}while(A){if(A.getName() in x){return{tablecell:2,tablerow:2,tablecolumn:2}}A=A.getParent()}return null})}},getSelectedCells:n};j.add("tabletools",j.tabletools)})();j.add("specialchar",{init:function(l){var m="specialchar";a.dialog.add(m,this.path+"dialogs/specialchar.js");l.addCommand(m,new a.dialogCommand(m));l.ui.addButton("SpecialChar",{label:l.lang.specialChar.toolbar,command:m})}});(function(){var l={exec:function(n){n.container.focusNext(true)}},m={exec:function(n){n.container.focusPrevious(true)}};j.add("tab",{requires:["keystrokes"],init:function(n){var o=n.keystrokeHandler.keystrokes;o[9]="tab";o[2000+9]="shiftTab";var p=n.config.tabSpaces,q="";while(p--){q+="\xa0"}n.addCommand("tab",{exec:function(r){if(!r.fire("tab")){if(q.length>0){r.insertHtml(q)}else{return r.execCommand("blur")}}return true}});n.addCommand("shiftTab",{exec:function(r){if(!r.fire("shiftTab")){return r.execCommand("blurBack")}return true}});n.addCommand("blur",l);n.addCommand("blurBack",m)}})})();h.prototype.focusNext=function(l){var u=this;var m=u.$,n=u.getTabIndex(),o,p,q,r,s,t;if(n<=0){s=u.getNextSourceNode(l,1);while(s){if(s.isVisible()&&s.getTabIndex()===0){q=s;break}s=s.getNextSourceNode(false,1)}}else{s=u.getDocument().getBody().getFirst();while(s=s.getNextSourceNode(false,1)){if(!o){if(!p&&s.equals(u)){p=true;if(l){if(!(s=s.getNextSourceNode(true,1))){break}o=1}}else{if(p&&!u.contains(s)){o=1}}}if(!s.isVisible()||(t=s.getTabIndex())<(0)){continue}if(o&&t==n){q=s;break}if(t>n&&(!q||!r||t<r)){q=s;r=t}else{if(!q&&t===0){q=s;r=t}}}}if(q){q.focus()}};h.prototype.focusPrevious=function(l){var u=this;var m=u.$,n=u.getTabIndex(),o,p,q,r=0,s,t=u.getDocument().getBody().getLast();while(t=t.getPreviousSourceNode(false,1)){if(!o){if(!p&&t.equals(u)){p=true;if(l){if(!(t=t.getPreviousSourceNode(true,1))){break}o=1}}else{if(p&&!u.contains(t)){o=1}}}if(!t.isVisible()||(s=t.getTabIndex())<(0)){continue}if(n<=0){if(o&&s===0){q=t;break}if(s>r){q=t;r=s}}else{if(o&&s==n){q=t;break}if(s<n&&(!q||s>r)){q=t;r=s}}}if(q){q.focus()}};i.tabSpaces=0;(function(){j.add("templates",{requires:["dialog"],init:function(n){a.dialog.add("templates",a.getUrl(this.path+"dialogs/templates.js"));n.addCommand("templates",new a.dialogCommand("templates"));n.ui.addButton("Templates",{label:n.lang.templates.button,command:"templates"})}});var l={},m={};a.addTemplates=function(n,o){l[n]=o};a.getTemplates=function(n){return l[n]};a.loadTemplates=function(n,o){var p=[];for(var q=0;q<n.length;q++){if(!m[n[q]]){p.push(n[q]);m[n[q]]=1}}if(p.length>0){a.scriptLoader.load(p,o)}else{setTimeout(o,0)}}})();i.templates="default";i.templates_files=[a.getUrl("plugins/templates/templates/default.js")];i.templates_replaceContent=true;(function(){var l=function(){this.toolbars=[];this.focusCommandExecuted=false};l.prototype.focus=function(){for(var n=0,o;o=this.toolbars[n++];){for(var p=0,q;q=o.items[p++];){if(q.focus){q.focus();return }}}};var m={toolbarFocus:{modes:{wysiwyg:1,source:1},exec:function(n){if(n.toolbox){n.toolbox.focusCommandExecuted=true;if(c){setTimeout(function(){n.toolbox.focus()},100)}else{n.toolbox.focus()}}}}};j.add("toolbar",{init:function(n){var o=function(p,q){switch(q){case 39:case 9:while((p=p.next||p.toolbar.next&&p.toolbar.next.items[0])&&(!p.focus)){}if(p){p.focus()}else{n.toolbox.focus()}return false;case 37:case 2000+9:while((p=p.previous||p.toolbar.previous&&p.toolbar.previous.items[p.toolbar.previous.items.length-1])&&(!p.focus)){}if(p){p.focus()}else{var r=n.toolbox.toolbars[n.toolbox.toolbars.length-1].items;r[r.length-1].focus()}return false;case 27:n.focus();return false;case 13:case 32:p.execute();return false}return true};n.on("themeSpace",function(p){if(p.data.space==n.config.toolbarLocation){n.toolbox=new l();var q=['<div class="cke_toolbox"'],r=n.config.toolbarStartupExpanded,s;q.push(r?">":' style="display:none">');var t=n.toolbox.toolbars,u=n.config.toolbar instanceof Array?n.config.toolbar:n.config["toolbar_"+n.config.toolbar];for(var v=0;v<u.length;v++){var w=u[v];if(!w){continue}var x="cke_"+e.getNextNumber(),y={id:x,items:[]};if(s){q.push("</div>");s=0}if(w==="/"){q.push('<div class="cke_break"></div>');continue}q.push('<span id="',x,'" class="cke_toolbar"><span class="cke_toolbar_start"></span>');var z=t.push(y)-1;if(z>0){y.previous=t[z-1];y.previous.next=y}for(var A=0;A<w.length;A++){var B,C=w[A];if(C=="-"){B=k.separator}else{B=n.ui.create(C)}if(B){if(B.canGroup){if(!s){q.push('<span class="cke_toolgroup">');s=1}}else{if(s){q.push("</span>");s=0}}var D=B.render(n,q);z=y.items.push(D)-1;if(z>0){D.previous=y.items[z-1];D.previous.next=D}D.toolbar=y;D.onkey=o;D.onfocus=function(){if(!n.toolbox.focusCommandExecuted){n.focus()}}}}if(s){q.push("</span>");s=0}q.push('<span class="cke_toolbar_end"></span></span>')}q.push("</div>");if(n.config.toolbarCanCollapse){var E=e.addFunction(function(){n.execCommand("toolbarCollapse")}),F="cke_"+e.getNextNumber();n.addCommand("toolbarCollapse",{exec:function(G){var H=a.document.getById(F),I=H.getPrevious(),J=G.getThemeSpace("contents"),K=I.getParent(),L=parseInt(J.$.style.height,10),M=K.$.offsetHeight;if(I.isVisible()){I.hide();H.addClass("cke_toolbox_collapser_min")}else{I.show();H.removeClass("cke_toolbox_collapser_min")}var N=K.$.offsetHeight-M;J.setStyle("height",L-N+"px")},modes:{wysiwyg:1,source:1}});q.push('<a id="'+F+'" class="cke_toolbox_collapser');if(!r){q.push(" cke_toolbox_collapser_min")}q.push('" onclick="CKEDITOR.tools.callFunction('+E+')"></a>')}p.data.html+=q.join("")}});n.addCommand("toolbarFocus",m.toolbarFocus)}})})();k.separator={render:function(l,m){m.push('<span class="cke_separator"></span>');return{}}};i.toolbarLocation="top";i.toolbar_Basic=[["Bold","Italic","-","NumberedList","BulletedList","-","Link","Unlink","-","About"]];i.toolbar_Full=[["Source","-","Save","NewPage","Preview","-","Templates"],["Cut","Copy","Paste","PasteText","PasteFromWord","-","Print","SpellChecker","Scayt"],["Undo","Redo","-","Find","Replace","-","SelectAll","RemoveFormat"],["Form","Checkbox","Radio","TextField","Textarea","Select","Button","ImageButton","HiddenField"],"/",["Bold","Italic","Underline","Strike","-","Subscript","Superscript"],["NumberedList","BulletedList","-","Outdent","Indent","Blockquote"],["JustifyLeft","JustifyCenter","JustifyRight","JustifyBlock"],["Link","Unlink","Anchor"],["Image","Flash","Table","HorizontalRule","Smiley","SpecialChar","PageBreak"],"/",["Styles","Format","Font","FontSize"],["TextColor","BGColor"],["Maximize","ShowBlocks","-","About"]];i.toolbar="Full";i.toolbarCanCollapse=true;i.toolbarStartupExpanded=true;(function(){j.add("undo",{requires:["selection","wysiwygarea"],init:function(n){var o=new m(n),p=n.addCommand("undo",{exec:function(){if(o.undo()){n.selectionChange();this.fire("afterUndo")}},state:0,canUndo:false}),q=n.addCommand("redo",{exec:function(){if(o.redo()){n.selectionChange();this.fire("afterRedo")}},state:0,canUndo:false});o.onChange=function(){p.setState(o.undoable()?2:0);q.setState(o.redoable()?2:0)};function r(s){if(o.enabled&&s.data.command.canUndo!==false){o.save()}}n.on("beforeCommandExec",r);n.on("afterCommandExec",r);n.on("saveSnapshot",function(){o.save()});n.on("contentDom",function(){n.document.on("keydown",function(s){if(!s.data.$.ctrlKey&&!s.data.$.metaKey){o.type(s)}})});n.on("beforeModeUnload",function(){n.mode=="wysiwyg"&&o.save(true)});n.on("mode",function(){o.enabled=n.mode=="wysiwyg";o.onChange()});n.ui.addButton("Undo",{label:n.lang.undo,command:"undo"});n.ui.addButton("Redo",{label:n.lang.redo,command:"redo"});n.resetUndo=function(){o.reset();n.fire("saveSnapshot")}}});function l(n){var p=this;var o=n.getSelection();p.contents=n.getSnapshot();p.bookmarks=o&&o.createBookmarks2(true);if(c){p.contents=p.contents.replace(/\s+_cke_expando=".*?"/g,"")}}l.prototype={equals:function(n,o){if(this.contents!=n.contents){return false}if(o){return true}var p=this.bookmarks,q=n.bookmarks;if(p||q){if(!p||!q||p.length!=q.length){return false}for(var r=0;r<p.length;r++){var s=p[r],t=q[r];if(s.startOffset!=t.startOffset||s.endOffset!=t.endOffset||!e.arrayCompare(s.start,t.start)||!e.arrayCompare(s.end,t.end)){return false}}}return true}};function m(n){this.editor=n;this.reset()}m.prototype={type:function(n){var o=n&&n.data.getKeystroke(),p={8:1,46:1},q=o in p,r=this.lastKeystroke in p,s=q&&o==this.lastKeystroke,t={37:1,38:1,39:1,40:1},u=o in t,v=this.lastKeystroke in t,w=!q&&!u,x=q&&!s,y=!this.typing||w&&(r||v);if(y||x){var z=new l(this.editor);e.setTimeout(function(){var B=this;var A=B.editor.getSnapshot();if(c){A=A.replace(/\s+_cke_expando=".*?"/g,"")}if(z.contents!=A){if(!B.save(false,z,false)){B.snapshots.splice(B.index+1,B.snapshots.length-B.index-1)}B.hasUndo=true;B.hasRedo=false;B.typesCount=1;B.modifiersCount=1;B.onChange()}},0,this)}this.lastKeystroke=o;if(q){this.typesCount=0;this.modifiersCount++;if(this.modifiersCount>25){this.save();this.modifiersCount=1}}else{if(!u){this.modifiersCount=0;this.typesCount++;if(this.typesCount>25){this.save();this.typesCount=1}}}this.typing=true},reset:function(){var n=this;n.lastKeystroke=0;n.snapshots=[];n.index=-1;n.limit=n.editor.config.undoStackSize;n.currentImage=null;n.hasUndo=false;n.hasRedo=false;n.resetType()},resetType:function(){var n=this;n.typing=false;delete n.lastKeystroke;n.typesCount=0;n.modifiersCount=0},fireChange:function(){var n=this;n.hasUndo=!!n.getNextImage(true);n.hasRedo=!!n.getNextImage(false);n.resetType();n.onChange()},save:function(n,o,p){var r=this;var q=r.snapshots;if(!o){o=new l(r.editor)}if(r.currentImage&&o.equals(r.currentImage,n)){return false}q.splice(r.index+1,q.length-r.index-1);if(q.length==r.limit){q.shift()}r.index=q.push(o)-1;r.currentImage=o;if(p!==false){r.fireChange()}return true},restoreImage:function(n){var p=this;p.editor.loadSnapshot(n.contents);if(n.bookmarks){p.editor.getSelection().selectBookmarks(n.bookmarks)}else{if(c){var o=p.editor.document.getBody().$.createTextRange();o.collapse(true);o.select()}}p.index=n.index;p.currentImage=n;p.fireChange()},getNextImage:function(n){var s=this;var o=s.snapshots,p=s.currentImage,q,r;if(p){if(n){for(r=s.index-1;r>=0;r--){q=o[r];if(!p.equals(q,true)){q.index=r;return q}}}else{for(r=s.index+1;r<o.length;r++){q=o[r];if(!p.equals(q,true)){q.index=r;return q}}}}return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo},undo:function(){var o=this;if(o.undoable()){o.save(true);var n=o.getNextImage(true);if(n){return o.restoreImage(n),true}}return false},redo:function(){var o=this;if(o.redoable()){o.save(true);if(o.redoable()){var n=o.getNextImage(false);if(n){return o.restoreImage(n),true}}}return false}}})();i.undoStackSize=20;(function(){var l={table:1,pre:1},m=/\s*<(p|div|address|h\d|center)[^>]*>\s*(?:<br[^>]*>|&nbsp;|&#160;)\s*(:?<\/\1>)?\s*$/gi;function n(r){var w=this;if(w.mode=="wysiwyg"){w.focus();var s=w.getSelection(),t=r.data;if(w.dataProcessor){t=w.dataProcessor.toHtml(t)}if(c){var u=s.isLocked;if(u){s.unlock()}var v=s.getNative();if(v.type=="Control"){v.clear()}v.createRange().pasteHTML(t);if(u){w.getSelection().lock()}}else{w.document.$.execCommand("inserthtml",false,t)}}}function o(r){if(this.mode=="wysiwyg"){this.focus();this.fire("saveSnapshot");var s=r.data,t=s.getName(),u=f.$block[t],v=this.getSelection(),w=v.getRanges(),x=v.isLocked;if(x){v.unlock()}var y,z,A,B;for(var C=w.length-1;C>=0;C--){y=w[C];y.deleteContents();z=!C&&s||s.clone(true);var D,E;if(u){while((D=y.getCommonAncestor(false,true))&&((E=f[D.getName()])&&(!(E&&E[t])))){if(y.checkStartOfBlock()&&y.checkEndOfBlock()){y.setStartBefore(D);y.collapse(true);D.remove()}else{y.splitBlock()}}}y.insertNode(z);if(!A){A=z}}y.moveToPosition(A,4);var F=A.getNextSourceNode(true);if(F&&F.type==1){y.moveToElementEditStart(F)}v.selectRanges([y]);if(x){this.getSelection().lock()}e.setTimeout(function(){this.fire("saveSnapshot")},0,this)}}function p(r){if(!r.checkDirty()){setTimeout(function(){r.resetDirty()})}}function q(r){var s=r.editor,t=r.data.path,u=t.blockLimit,v=r.data.selection,w=v.getRanges()[0],x=s.document.getBody(),y=s.config.enterMode;if(y!=2&&w.collapsed&&u.getName()=="body"&&!t.block){p(s);var z=v.createBookmarks(),A=w.fixBlock(true,s.config.enterMode==3?"div":"p");if(c){var B=A.getElementsByTag("br"),C;for(var D=0;D<B.count();D++){if((C=B.getItem(D))&&(C.hasAttribute("_cke_bogus"))){C.remove()}}}v.selectBookmarks(z);var E=A.getChildren(),F=E.count(),G,H=d.walker.whitespaces(true),I=A.getPrevious(H),J=A.getNext(H),K;if(I&&I.getName&&!(I.getName() in l)){K=I}else{if(J&&J.getName&&!(J.getName() in l)){K=J}}if((!F||(G=E.getItem(0))&&(G.is&&G.is("br")))&&(K&&w.moveToElementEditStart(K))){A.remove();w.select()}}var L=x.getLast(d.walker.whitespaces(true));if(L&&L.getName&&L.getName() in l){p(s);var M=s.document.createElement(c&&y!=2?'<br _cke_bogus="true" />':"br");x.append(M)}}j.add("wysiwygarea",{requires:["editingblock"],init:function(r){var s=r.config.enterMode!=2?r.config.enterMode==3?"div":"p":false;r.on("editingBlockReady",function(){var t,u,v,w,x,y,z,A=b.isCustomDomain(),B=function(){if(v){v.remove()}if(u){u.remove()}y=0;var E="void( "+(b.gecko?"setTimeout":"")+"( function(){document.open();"+(c&&A?'document.domain="'+document.domain+'";':"")+'document.write( window.parent[ "_cke_htmlToLoad_'+r.name+'" ] );document.close();window.parent[ "_cke_htmlToLoad_'+r.name+'" ] = null;}'+(b.gecko?", 0 )":")()")+" )";if(b.opera){E="void(0);"}v=h.createFromHtml('<iframe style="width:100%;height:100%" frameBorder="0" tabIndex="-1" allowTransparency="true" src="javascript:'+encodeURIComponent(E)+'"></iframe>');var F=r.lang.editorTitle.replace("%1",r.name);if(b.gecko){v.on("load",function(G){G.removeListener();D(v.$.contentWindow)});t.setAttributes({role:"region",title:F});v.setAttributes({role:"region",title:" "})}else{if(b.webkit){v.setAttribute("title",F);v.setAttribute("name",F)}else{if(c){u=h.createFromHtml('<fieldset style="height:100%'+(c&&b.quirks?";position:relative":"")+'"><legend style="display:block;width:0;height:0;overflow:hidden;'+(c&&b.quirks?"position:absolute":"")+'">'+e.htmlEncode(F)+"</legend></fieldset>",a.document);v.appendTo(u);u.appendTo(t)}}}if(!c){t.append(v)}},C='<script id="cke_actscrpt" type="text/javascript">window.onload = function(){window.parent.CKEDITOR._["contentDomReady'+r.name+'"]( window );}<\/script>',D=function(E){if(y){return }y=1;var F=E.document,G=F.body,H=F.getElementById("cke_actscrpt");H.parentNode.removeChild(H);delete a._["contentDomReady"+r.name];G.spellcheck=!r.config.disableNativeSpellChecker;if(c){G.hideFocus=true;G.disabled=true;G.contentEditable=true;G.removeAttribute("disabled")}else{F.designMode="on"}try{F.execCommand("enableObjectResizing",false,!r.config.disableObjectResizing)}catch(K){}try{F.execCommand("enableInlineTableEditing",false,!r.config.disableNativeTableHandles)}catch(L){}E=r.window=new d.window(E);F=r.document=new g(F);if(!(c||b.opera)){F.on("mousedown",function(M){var N=M.data.getTarget();if(N.is("img","hr","input","textarea","select")){r.getSelection().selectElement(N)}})}if(b.webkit){F.on("click",function(M){if(M.data.getTarget().is("input","select")){M.data.preventDefault()}});F.on("mouseup",function(M){if(M.data.getTarget().is("input","textarea")){M.data.preventDefault()}})}var I=c||b.webkit?E:F;I.on("blur",function(){r.focusManager.blur()});I.on("focus",function(){if(b.gecko){var M=G;while(M.firstChild){M=M.firstChild}if(!M.nextSibling&&"BR"==M.tagName&&M.hasAttribute("_moz_editor_bogus_node")){var N=F.$.createEvent("KeyEvents");N.initKeyEvent("keypress",true,true,E.$,false,false,false,false,0,32);F.$.dispatchEvent(N);var O=F.getBody().getFirst();if(r.config.enterMode==2){F.createElement("br",{attributes:{_moz_dirty:""}}).replace(O)}else{O.remove()}}}r.focusManager.focus()});var J=r.keystrokeHandler;if(J){J.attach(F)}if(c){r.on("key",function(M){var N=M.data.keyCode==8&&r.getSelection().getSelectedElement();if(N){r.fire("saveSnapshot");N.remove();r.fire("saveSnapshot");M.cancel()}})}if(r.contextMenu){r.contextMenu.addTarget(F)}setTimeout(function(){r.fire("contentDom");if(z){r.mode="wysiwyg";r.fire("mode");z=false}w=false;if(x){r.focus();x=false}setTimeout(function(){r.fire("dataReady")},0);if(c){setTimeout(function(){if(r.document){var M=r.document.$.body;M.runtimeStyle.marginBottom="0px";M.runtimeStyle.marginBottom=""}},1000)}},0)};r.addMode("wysiwyg",{load:function(E,F,G){t=E;if(c&&b.quirks){E.setStyle("position","relative")}r.mayBeDirty=true;z=true;if(G){this.loadSnapshotData(F)}else{this.loadData(F)}},loadData:function(E){w=true;if(r.dataProcessor){E=r.dataProcessor.toHtml(E,s)}E=r.config.docType+'<html dir="'+r.config.contentsLangDirection+'"><head><link type="text/css" rel="stylesheet" href="'+[].concat(r.config.contentsCss).join('"><link type="text/css" rel="stylesheet" href="')+'"><style type="text/css" _fcktemp="true">'+r._.styles.join("\n")+"</style></head><body>"+E+"</body></html>"+C;window["_cke_htmlToLoad_"+r.name]=E;a._["contentDomReady"+r.name]=D;B();if(b.opera){var F=v.$.contentWindow.document;F.open();F.write(E);F.close()}},getData:function(){var E=v.getFrameDocument().getBody().getHtml();if(r.dataProcessor){E=r.dataProcessor.toDataFormat(E,s)}if(r.config.ignoreEmptyParagraph){E=E.replace(m,"")}return E},getSnapshotData:function(){return v.getFrameDocument().getBody().getHtml()},loadSnapshotData:function(E){v.getFrameDocument().getBody().setHtml(E)},unload:function(E){r.window=r.document=v=t=x=null;r.fire("contentDomUnload")},focus:function(){if(w){x=true}else{if(r.window){r.window.focus();r.selectionChange()}}}});r.on("insertHtml",n,null,null,20);r.on("insertElement",o,null,null,20);r.on("selectionChange",q,null,null,1)})}})})();i.disableObjectResizing=false;i.disableNativeTableHandles=true;i.disableNativeSpellChecker=true;i.ignoreEmptyParagraph=true;j.add("wsc",{init:function(l){var m="checkspell",n=l.addCommand(m,new a.dialogCommand(m));n.modes={wysiwyg:!b.opera&&document.domain==window.location.hostname};l.ui.addButton("SpellChecker",{label:l.lang.spellCheck.toolbar,command:m});a.dialog.add(m,this.path+"dialogs/wsc.js")}});i.wsc_customerId=i.wsc_customerId||"1:ua3xw1-2XyGJ3-GWruD3-6OFNT1-oXcuB1-nR6Bp4-hgQHc-EcYng3-sdRXG3-NOfFk";i.wsc_customLoaderScript=i.wsc_customLoaderScript||null;j.add("styles",{requires:["selection"]});a.editor.prototype.attachStyleStateChange=function(l,m){var n=this._.styleStateChangeCallbacks;if(!n){n=this._.styleStateChangeCallbacks=[];this.on("selectionChange",function(o){for(var p=0;p<n.length;p++){var q=n[p],r=q.style.checkActive(o.data.path)?1:2;if(q.state!==r){q.fn.call(this,r);q.state!==r}}})}n.push({style:l,fn:m})};a.STYLE_BLOCK=1;a.STYLE_INLINE=2;a.STYLE_OBJECT=3;(function(){var l={address:1,div:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,p:1,pre:1},m={a:1,embed:1,hr:1,img:1,li:1,object:1,ol:1,table:1,td:1,tr:1,ul:1},n=/\s*(?:;\s*|$)/;a.style=function(L,M){if(M){L=e.clone(L);G(L.attributes,M);G(L.styles,M)}var N=this.element=(L.element||"*").toLowerCase();this.type=N=="#"||l[N]?1:m[N]?3:2;this._={definition:L}};a.style.prototype={apply:function(L){K.call(this,L,false)},remove:function(L){K.call(this,L,true)},applyToRange:function(L){var M=this;return(M.applyToRange=M.type==2?o:M.type==1?q:null).call(M,L)},removeFromRange:function(L){return(this.removeFromRange=this.type==2?p:null).call(this,L)},applyToObject:function(L){E(L,this)},checkActive:function(L){switch(this.type){case 1:return this.checkElementRemovable(L.block||L.blockLimit,true);case 2:var M=L.elements;for(var N=0,O;N<M.length;N++){O=M[N];if(O==L.block||O==L.blockLimit){continue}if(this.checkElementRemovable(O,true)){return true}}}return false},checkElementRemovable:function(L,M){if(!L){return false}var N=this._.definition,O;if(L.getName()==this.element){if(!M&&!L.hasAttributes()){return true}O=H(N);if(O._length){for(var P in O){if(P=="_length"){continue}var Q=L.getAttribute(P);if(O[P]==(P=="style"?J(Q,false):Q)){if(!M){return true}}else{if(M){return false}}}if(M){return true}}else{return true}}var R=I(this)[L.getName()];if(R){if(!(O=R.attributes)){return true}for(var S=0;S<O.length;S++){P=O[S][0];var T=L.getAttribute(P);if(T){var U=O[S][1];if(U===null||typeof U=="string"&&T==U||U.test(T)){return true}}}}return false}};a.style.getStyleText=function(L){var M=L._ST;if(M){return M}M=L.styles;var N=L.attributes&&L.attributes.style||"";if(N.length){N=N.replace(n,";")}for(var O in M){N+=(O+":"+M[O]).replace(n,";")}if(N.length){N=J(N)}return L._ST=N};function o(L){var al=this;var M=L.document;if(L.collapsed){var N=D(al,M);L.insertNode(N);L.moveToPosition(N,2);return }var O=al.element,P=al._.definition,Q,R=f[O]||(Q=true,f.span),S=L.createBookmark();L.enlarge(1);L.trim();var T=L.getBoundaryNodes(),U=T.startNode,V=T.endNode.getNextSourceNode(true);if(!V){var W;V=W=M.createText("");V.insertAfter(L.endContainer)}var X=V.getParent();if(X&&X.getAttribute("_fck_bookmark")){V=X}if(V.equals(U)){V=V.getNextSourceNode(true);if(!V){V=W=M.createText("");V.insertAfter(U)}}var Y=U,Z,aa;while(Y){var ab=false;if(Y.equals(V)){Y=null;ab=true}else{var ac=Y.type,ad=ac==1?Y.getName():null;if(ad&&Y.getAttribute("_fck_bookmark")){Y=Y.getNextSourceNode(true);continue}if(!ad||R[ad]&&(Y.getPosition(V)|4|0|8)==(4+0+8)){var ae=Y.getParent();if(ae&&((ae.getDtd()||f.span)[O]||Q)){if(!Z&&(!ad||!f.$removeEmpty[ad]||(Y.getPosition(V)|4|0|8)==(4+0+8))){Z=new d.range(M);Z.setStartBefore(Y)}if(ac==3||ac==1&&!Y.getChildCount()){var af=Y,ag;while(!af.$.nextSibling&&(ag=af.getParent(),R[ag.getName()])&&((ag.getPosition(U)|2|0|8)==(2+0+8))){af=ag}Z.setEndAfter(af);if(!af.$.nextSibling){ab=true}if(!aa){aa=ac!=3||/[^\s\ufeff]/.test(Y.getText())}}}else{ab=true}}else{ab=true}Y=Y.getNextSourceNode()}if(ab&&aa&&Z&&!Z.collapsed){var ah=D(al,M),ai=Z.getCommonAncestor();while(ah&&ai){if(ai.getName()==O){for(var aj in P.attributes){if(ah.getAttribute(aj)==ai.getAttribute(aj)){ah.removeAttribute(aj)}}for(var ak in P.styles){if(ah.getStyle(ak)==ai.getStyle(ak)){ah.removeStyle(ak)}}if(!ah.hasAttributes()){ah=null;break}}ai=ai.getParent()}if(ah){Z.extractContents().appendTo(ah);y(al,ah);Z.insertNode(ah);B(ah);if(!c){ah.$.normalize()}}Z=null}}W&&W.remove();L.moveToBookmark(S)}function p(L){L.enlarge(1);var M=L.createBookmark(),N=M.startNode;if(L.collapsed){var O=new d.elementPath(N.getParent()),P;for(var Q=0,R;Q<O.elements.length&&(R=O.elements[Q]);Q++){if(R==O.block||R==O.blockLimit){break}if(this.checkElementRemovable(R)){var S=L.checkBoundaryOfElement(R,2),T=!S&&L.checkBoundaryOfElement(R,1);if(T||S){P=R;P.match=T?"start":"end"}else{B(R);x(this,R)}}}if(P){var U=N;for(Q=0;true;Q++){var V=O.elements[Q];if(V.equals(P)){break}else{if(V.match){continue}else{V=V.clone()}}V.append(U);U=V}U[P.match=="start"?"insertBefore":"insertAfter"](P)}}else{var W=M.endNode,X=this;function Y(){var ab=new d.elementPath(N.getParent()),ac=new d.elementPath(W.getParent()),ad=null,ae=null;for(var af=0;af<ab.elements.length;af++){var ag=ab.elements[af];if(ag==ab.block||ag==ab.blockLimit){break}if(X.checkElementRemovable(ag)){ad=ag}}for(af=0;af<ac.elements.length;af++){ag=ac.elements[af];if(ag==ac.block||ag==ac.blockLimit){break}if(X.checkElementRemovable(ag)){ae=ag}}if(ae){W.breakParent(ae)}if(ad){N.breakParent(ad)}}Y();var Z=N.getNext();while(!Z.equals(W)){var aa=Z.getNextSourceNode();if(Z.type==1&&this.checkElementRemovable(Z)){if(Z.getName()==this.element){x(this,Z)}else{z(Z,I(this)[Z.getName()])}if(aa.type==1&&aa.contains(N)){Y();aa=N.getNext()}}Z=aa}}L.moveToBookmark(M)}function q(L){var M=L.createBookmark(true),N=L.createIterator();N.enforceRealBlocks=true;var O,P=L.document,Q;while(O=N.getNextParagraph()){var R=D(this,P);r(O,R)}L.moveToBookmark(M)}function r(L,M){var N=M.is("pre"),O=L.is("pre"),P=N&&!O,Q=!N&&O;if(P){M=w(L,M)}else{if(Q){M=v(t(L),M)}else{L.moveChildren(M)}}M.replace(L);if(N){s(M)}}function s(L){var M;if(!((M=L.getPreviousSourceNode(true,1))&&(M.is&&M.is("pre")))){return }var N=u(M.getHtml(),/\n$/,"")+"\n\n"+u(L.getHtml(),/^\n/,"");if(c){L.$.outerHTML="<pre>"+N+"</pre>"}else{L.setHtml(N)}M.remove()}function t(L){var M=/(\S\s*)\n(?:\s|(<span[^>]+_fck_bookmark.*?\/span>))*\n(?!$)/gi,N=L.getName(),O=u(L.getOuterHtml(),M,function(Q,R,S){return R+"</pre>"+S+"<pre>"}),P=[];O.replace(/<pre>([\s\S]*?)<\/pre>/gi,function(Q,R){P.push(R)});return P}function u(L,M,N){var O="",P="";L=L.replace(/(^<span[^>]+_fck_bookmark.*?\/span>)|(<span[^>]+_fck_bookmark.*?\/span>$)/gi,function(Q,R,S){R&&(O=R);S&&(P=S);return""});return O+L.replace(M,N)+P}function v(L,M){var N=new d.documentFragment(M.getDocument());for(var O=0;O<L.length;O++){var P=L[O];P=P.replace(/(\r\n|\r)/g,"\n");P=u(P,/^[ \t]*\n/,"");P=u(P,/\n$/,"");P=u(P,/^[ \t]+|[ \t]+$/g,function(R,S,T){if(R.length==1){return"&nbsp;"}else{if(!S){return e.repeat("&nbsp;",R.length-1)+" "}else{return" "+e.repeat("&nbsp;",R.length-1)}}});P=P.replace(/\n/g,"<br>");P=P.replace(/[ \t]{2,}/g,function(R){return e.repeat("&nbsp;",R.length-1)+" "});var Q=M.clone();Q.setHtml(P);N.append(Q)}return N}function w(L,M){var N=L.getHtml();N=u(N,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");N=N.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");N=N.replace(/([ \t\n\r]+|&nbsp;)/g," ");N=N.replace(/<br\b[^>]*>/gi,"\n");if(c){var O=L.getDocument().createElement("div");O.append(M);M.$.outerHTML="<pre>"+N+"</pre>";M=O.getFirst().remove()}else{M.setHtml(N)}return M}function x(L,M){var N=L._.definition,O=N.attributes,P=N.styles,Q=I(L);function R(){for(var T in O){if(T=="class"&&M.getAttribute(T)!=O[T]){continue}M.removeAttribute(T)}}R();for(var S in P){M.removeStyle(S)}O=Q[M.getName()];if(O){R()}A(M)}function y(L,M){var N=L._.definition,O=N.attributes,P=N.styles,Q=I(L),R=M.getElementsByTag(L.element);for(var S=R.count();--S>=0;){x(L,R.getItem(S))}for(var T in Q){if(T!=L.element){R=M.getElementsByTag(T);for(S=R.count()-1;S>=0;S--){var U=R.getItem(S);z(U,Q[T])}}}}function z(L,M){var N=M&&M.attributes;if(N){for(var O=0;O<N.length;O++){var P=N[O][0],Q;if(Q=L.getAttribute(P)){var R=N[O][1];if(R===null||R.test&&R.test(Q)||typeof R=="string"&&Q==R){L.removeAttribute(P)}}}}A(L)}function A(L){if(!L.hasAttributes()){var M=L.getFirst(),N=L.getLast();L.remove(true);if(M){B(M);if(N&&!M.equals(N)){B(N)}}}}function B(L){if(!L||L.type!=1||!f.$removeEmpty[L.getName()]){return }C(L,L.getNext(),true);C(L,L.getPrevious())}function C(L,M,N){if(M&&M.type==1){var O=M.getAttribute("_fck_bookmark");if(O){M=N?M.getNext():M.getPrevious()}if(M&&M.type==1&&L.isIdentical(M)){var P=N?L.getLast():L.getFirst();if(O){(N?M.getPrevious():M.getNext()).move(L,!N)}M.moveChildren(L,!N);M.remove();if(P){B(P)}}}}function D(L,M){var N,O=L._.definition,P=L.element;if(P=="*"){P="span"}N=new h(P,M);return E(N,L)}function E(L,M){var N=M._.definition,O=N.attributes,P=a.style.getStyleText(N);if(O){for(var Q in O){L.setAttribute(Q,O[Q])}}if(P){L.setAttribute("style",P)}return L}var F=/#\((.+?)\)/g;function G(L,M){for(var N in L){L[N]=L[N].replace(F,function(O,P){return M[P]})}}function H(L){var M=L._AC;if(M){return M}M={};var N=0,O=L.attributes;if(O){for(var P in O){N++;M[P]=O[P]}}var Q=a.style.getStyleText(L);if(Q){if(!M.style){N++}M.style=Q}M._length=N;return L._AC=M}function I(L){if(L._.overrides){return L._.overrides}var M=L._.overrides={},N=L._.definition.overrides;if(N){if(!e.isArray(N)){N=[N]}for(var O=0;O<N.length;O++){var P=N[O],Q,R,S;if(typeof P=="string"){Q=P.toLowerCase()}else{Q=P.element?P.element.toLowerCase():L.element;S=P.attributes}R=M[Q]||(M[Q]={});if(S){var T=R.attributes=R.attributes||[];for(var U in S){T.push([U.toLowerCase(),S[U]])}}}}return M}function J(L,M){var N;if(M!==false){var O=new h("span");O.setAttribute("style",L);N=O.getAttribute("style")}else{N=L}return N.replace(/\s*([;:])\s*/,"$1").replace(/([^\s;])$/,"$1;").replace(/,\s+/g,",").toLowerCase()}function K(L,M){var N=L.getSelection(),O=N.getRanges(),P=M?this.removeFromRange:this.applyToRange;for(var Q=0;Q<O.length;Q++){P.call(this,O[Q])}N.selectRanges(O)}})();a.styleCommand=function(l){this.style=l};a.styleCommand.prototype.exec=function(l){var n=this;l.focus();var m=l.document;if(m){if(n.state==2){n.style.apply(m)}else{if(n.state==1){n.style.remove(m)}}}return !!m};j.add("domiterator");(function(){var l=function(n){var o=this;if(arguments.length<1){return }o.range=n;o.forceBrBreak=false;o.enlargeBr=true;o.enforceRealBlocks=false;o._||(o._={})},m=/^[\r\n\t ]+$/;l.prototype={getNextParagraph:function(n){var O=this;var o,p,q,r,s;if(!O._.lastNode){p=O.range.clone();p.enlarge(O.forceBrBreak||!O.enlargeBr?3:2);var t=new d.walker(p),u=d.walker.bookmark(true,true);t.evaluator=u;O._.nextNode=t.next();t=new d.walker(p);t.evaluator=u;var v=t.previous();O._.lastNode=v.getNextSourceNode(true);if(O._.lastNode&&O._.lastNode.type==3&&!e.trim(O._.lastNode.getText())&&O._.lastNode.getParent().isBlockBoundary()){var w=new d.range(p.document);w.moveToPosition(O._.lastNode,4);if(w.checkEndOfBlock()){var x=new d.elementPath(w.endContainer),y=x.block||x.blockLimit;O._.lastNode=y.getNextSourceNode(true)}}if(!O._.lastNode){O._.lastNode=O._.docEndMarker=p.document.createText("");O._.lastNode.insertAfter(v)}p=null}var z=O._.nextNode;v=O._.lastNode;O._.nextNode=null;while(z){var A=false,B=z.type!=1,C=false;if(!B){var D=z.getName();if(z.isBlockBoundary(O.forceBrBreak&&{br:1})){if(D=="br"){B=true}else{if(!p&&!z.getChildCount()&&D!="hr"){o=z;q=z.equals(v);break}}if(p){p.setEndAt(z,3);if(D!="br"){O._.nextNode=z}}A=true}else{if(z.getFirst()){if(!p){p=new d.range(O.range.document);p.setStartAt(z,3)}z=z.getFirst();continue}B=true}}else{if(z.type==3){if(m.test(z.getText())){B=false}}}if(B&&!p){p=new d.range(O.range.document);p.setStartAt(z,3)}q=(!A||B)&&(z.equals(v));if(p&&!A){while(!z.getNext()&&!q){var E=z.getParent();if(E.isBlockBoundary(O.forceBrBreak&&{br:1})){A=true;q=q||E.equals(v);break}z=E;B=true;q=z.equals(v);C=true}}if(B){p.setEndAt(z,4)}z=z.getNextSourceNode(C,null,v);q=!z;if((A||q)&&(p)){var F=p.getBoundaryNodes(),G=new d.elementPath(p.startContainer),H=new d.elementPath(p.endContainer);if(F.startNode.equals(F.endNode)&&F.startNode.getParent().equals(G.blockLimit)&&F.startNode.type==1&&F.startNode.getAttribute("_fck_bookmark")){p=null;O._.nextNode=null}else{break}}if(q){break}}if(!o){if(!p){O._.docEndMarker&&O._.docEndMarker.remove();O._.nextNode=null;return null}G=new d.elementPath(p.startContainer);var I=G.blockLimit,J={div:1,th:1,td:1};o=G.block;if(!o&&!O.enforceRealBlocks&&J[I.getName()]&&p.checkStartOfBlock()&&p.checkEndOfBlock()){o=I}else{if(!o||O.enforceRealBlocks&&o.getName()=="li"){o=O.range.document.createElement(n||"p");p.extractContents().appendTo(o);o.trim();p.insertNode(o);r=s=true}else{if(o.getName()!="li"){if(!p.checkStartOfBlock()||!p.checkEndOfBlock()){o=o.clone(false);p.extractContents().appendTo(o);o.trim();var K=p.splitBlock();r=!K.wasStartOfBlock;s=!K.wasEndOfBlock;p.insertNode(o)}}else{if(!q){O._.nextNode=o.equals(v)?null:p.getBoundaryNodes().endNode.getNextSourceNode(true,null,v)}}}}}if(r){var L=o.getPrevious();if(L&&L.type==1){if(L.getName()=="br"){L.remove()}else{if(L.getLast()&&L.getLast().$.nodeName.toLowerCase()=="br"){L.getLast().remove()}}}}if(s){var M=d.walker.bookmark(false,true),N=o.getLast();if(N&&N.type==1&&N.getName()=="br"){if(c||N.getPrevious(M)||N.getNext(M)){N.remove()}}}if(!O._.nextNode){O._.nextNode=q||o.equals(v)?null:o.getNextSourceNode(true,null,v)}return o}};d.range.prototype.createIterator=function(){return new l(this)}})();j.add("panelbutton",{requires:["button"],beforeInit:function(l){l.ui.addHandler(4,k.panelButton.handler)}});a.UI_PANELBUTTON=4;(function(){var l=function(m){var o=this;var n=o._;if(n.state==0){return }o.createPanel(m);if(n.on){n.panel.hide();return }n.panel.showBlock(o._.id,o.document.getById(o._.id),4)};k.panelButton=e.createClass({base:k.button,$:function(m){var o=this;var n=m.panel;delete m.panel;o.base(m);o.document=n&&n.parent&&n.parent.getDocument()||a.document;o.hasArrow=true;o.click=l;o._={panelDefinition:n}},statics:{handler:{create:function(m){return new k.panelButton(m)}}},proto:{createPanel:function(m){var n=this._;if(n.panel){return }var o=this._.panelDefinition||{},p=o.parent||a.document.getBody(),q=this._.panel=new k.floatPanel(m,p,o),r=this;q.onShow=function(){if(r.className){this.element.getFirst().addClass(r.className+"_panel")}n.oldState=r._.state;r.setState(1);n.on=1;if(r.onOpen){r.onOpen()}};q.onHide=function(){if(r.className){this.element.getFirst().removeClass(r.className+"_panel")}r.setState(n.oldState);n.on=0;if(r.onClose){r.onClose()}};q.onEscape=function(){q.hide();r.document.getById(n.id).focus()};if(this.onBlock){this.onBlock(q,n.id)}q.getBlock(n.id).onHide=function(){n.on=0;r.setState(2)}}}})})();j.add("floatpanel",{requires:["panel"]});(function(){var l={},m=false;function n(o,p,q,r,s){var t=p.getUniqueId()+"-"+q.getUniqueId()+"-"+o.skinName+"-"+o.lang.dir+(o.uiColor&&"-"+o.uiColor||"")+(r.css&&"-"+r.css||"")+(s&&"-"+s||""),u=l[t];if(!u){u=l[t]=new k.panel(p,r);u.element=q.append(h.createFromHtml(u.renderHtml(o),p));u.element.setStyles({display:"none",position:"absolute"})}return u}k.floatPanel=e.createClass({$:function(o,p,q,r){q.forceIFrame=true;var s=p.getDocument(),t=n(o,s,p,q,r||0),u=t.element,v=u.getFirst().getFirst();this.element=u;o.panels?o.panels.push(u):o.panels=[u];this._={panel:t,parentElement:p,definition:q,document:s,iframe:v,children:[],dir:o.lang.dir}},proto:{addBlock:function(o,p){return this._.panel.addBlock(o,p)},addListBlock:function(o,p){return this._.panel.addListBlock(o,p)},getBlock:function(o){return this._.panel.getBlock(o)},showBlock:function(o,p,q,r,s){var t=this._.panel,u=t.showBlock(o);this.allowBlur(false);m=true;var v=this.element,w=this._.iframe,x=this._.definition,y=p.getDocumentPosition(v.getDocument()),z=this._.dir=="rtl",A=y.x+(r||0),B=y.y+(s||0);if(z&&(q==1||q==4)){A+=p.$.offsetWidth}else{if(!z&&(q==2||q==3)){A+=p.$.offsetWidth-1}}if(q==3||q==4){B+=p.$.offsetHeight-1}this._.panel._.offsetParentId=p.getId();v.setStyles({top:B+"px",left:"-3000px",visibility:"hidden",opacity:"0",display:""});if(!this._.blurSet){var C=c?w:new d.window(w.$.contentWindow);a.event.useCapture=true;C.on("blur",function(D){var G=this;if(c&&!G.allowBlur()){return }var E=D.data.getTarget(),F=E.getWindow&&E.getWindow();if(F&&F.equals(C)){return }if(G.visible&&!G._.activeChild&&!m){G.hide()}},this);C.on("focus",function(){this._.focused=true;this.hideChild();this.allowBlur(true)},this);a.event.useCapture=false;this._.blurSet=1}t.onEscape=e.bind(function(){this.onEscape&&this.onEscape()},this);e.setTimeout(function(){if(z){A-=v.$.offsetWidth}v.setStyles({left:A+"px",visibility:"",opacity:"1"});if(u.autoSize){function D(){var E=v.getFirst(),F=u.element.$.scrollHeight;if(c&&b.quirks&&F>0){F+=(E.$.offsetHeight||0)-(E.$.clientHeight||0)}E.setStyle("height",F+"px");t._.currentBlock.element.setStyle("display","none").removeStyle("display")}if(t.isLoaded){D()}else{t.onLoad=D}}else{v.getFirst().removeStyle("height")}e.setTimeout(function(){if(x.voiceLabel){if(b.gecko){var E=w.getParent();E.setAttribute("role","region");E.setAttribute("title",x.voiceLabel);w.setAttribute("role","region");w.setAttribute("title"," ")}}if(c&&b.quirks){w.focus()}else{w.$.contentWindow.focus()}if(c&&!b.quirks){this.allowBlur(true)}},0,this)},0,this);this.visible=1;if(this.onShow){this.onShow.call(this)}m=false},hide:function(){var o=this;if(o.visible&&(!o.onHide||o.onHide.call(o)!==true)){o.hideChild();o.element.setStyle("display","none");o.visible=0}},allowBlur:function(o){var p=this._.panel;if(o!=undefined){p.allowBlur=o}return p.allowBlur},showAsChild:function(o,p,q,r,s,t){if(this._.activeChild==o&&o._.panel._.offsetParentId==q.getId()){return }this.hideChild();o.onHide=e.bind(function(){e.setTimeout(function(){if(!this._.focused){this.hide()}},0,this)},this);this._.activeChild=o;this._.focused=false;o.showBlock(p,q,r,s,t);if(b.ie7Compat||b.ie8&&b.ie6Compat){setTimeout(function(){o.element.getChild(0).$.style.cssText+=""},100)}},hideChild:function(){var o=this._.activeChild;if(o){delete o.onHide;delete this._.activeChild;o.hide()}}}})})();j.add("menu",{beforeInit:function(l){var m=l.config.menu_groups.split(","),n={};for(var o=0;o<m.length;o++){n[m[o]]=o+1}l._.menuGroups=n;l._.menuItems={}},requires:["floatpanel"]});e.extend(a.editor.prototype,{addMenuGroup:function(l,m){this._.menuGroups[l]=m||100},addMenuItem:function(l,m){if(this._.menuGroups[m.group]){this._.menuItems[l]=new a.menuItem(this,l,m)}},addMenuItems:function(l){for(var m in l){this.addMenuItem(m,l[m])}},getMenuItem:function(l){return this._.menuItems[l]}});(function(){a.menu=e.createClass({$:function(m,n){var o=this;o.id="cke_"+e.getNextNumber();o.editor=m;o.items=[];o._.level=n||1},_:{showSubMenu:function(m){var s=this;var n=s._.subMenu,o=s.items[m],p=o.getItems&&o.getItems();if(!p){s._.panel.hideChild();return }if(n){n.removeAll()}else{n=s._.subMenu=new a.menu(s.editor,s._.level+1);n.parent=s;n.onClick=e.bind(s.onClick,s)}for(var q in p){n.add(s.editor.getMenuItem(q))}var r=s._.panel.getBlock(s.id).element.getDocument().getById(s.id+String(m));n.show(r,2)}},proto:{add:function(m){if(!m.order){m.order=this.items.length}this.items.push(m)},removeAll:function(){this.items=[]},show:function(m,n,o,p){var q=this.items,r=this.editor,s=this._.panel,t=this._.element;if(!s){s=this._.panel=new k.floatPanel(this.editor,a.document.getBody(),{css:[a.getUrl(r.skinPath+"editor.css")],level:this._.level-1,className:r.skinClass+" cke_contextmenu"},this._.level);s.onEscape=e.bind(function(){this.onEscape&&this.onEscape();this.hide()},this);s.onHide=e.bind(function(){this.onHide&&this.onHide()},this);var u=s.addBlock(this.id);u.autoSize=true;var v=u.keys;v[40]="next";v[9]="next";v[38]="prev";v[2000+9]="prev";v[32]="click";v[39]="click";t=this._.element=u.element;t.addClass(r.skinClass);var w=t.getDocument();w.getBody().setStyle("overflow","hidden");w.getElementsByTag("html").getItem(0).setStyle("overflow","hidden");this._.itemOverFn=e.addFunction(function(C){var D=this;clearTimeout(D._.showSubTimeout);D._.showSubTimeout=e.setTimeout(D._.showSubMenu,r.config.menu_subMenuDelay,D,[C])},this);this._.itemOutFn=e.addFunction(function(C){clearTimeout(this._.showSubTimeout)},this);this._.itemClickFn=e.addFunction(function(C){var E=this;var D=E.items[C];if(D.state==0){E.hide();return }if(D.getItems){E._.showSubMenu(C)}else{E.onClick&&E.onClick(D)}},this)}l(q);var x=['<div class="cke_menu">'],y=q.length,z=y&&q[0].group;for(var A=0;A<y;A++){var B=q[A];if(z!=B.group){x.push('<div class="cke_menuseparator"></div>');z=B.group}B.render(this,A,x)}x.push("</div>");t.setHtml(x.join(""));if(this.parent){this.parent._.panel.showAsChild(s,this.id,m,n,o,p)}else{s.showBlock(this.id,m,n,o,p)}r.fire("menuShow",[s])},hide:function(){this._.panel&&this._.panel.hide()}}});function l(m){m.sort(function(n,o){if(n.group<o.group){return -1}else{if(n.group>o.group){return 1}}return n.order<o.order?-1:n.order>o.order?1:0})}})();a.menuItem=e.createClass({$:function(l,m,n){var o=this;e.extend(o,n,{order:0,className:"cke_button_"+m});o.group=l._.menuGroups[o.group];o.editor=l;o.name=m},proto:{render:function(l,m,n){var t=this;var o=l.id+String(m),p=typeof t.state=="undefined"?2:t.state,q=" cke_"+(p==1?"on":p==0?"disabled":"off"),r=t.label;if(p==0){r=t.editor.lang.common.unavailable.replace("%1",r)}if(t.className){q+=" "+t.className}n.push('<span class="cke_menuitem"><a id="',o,'" class="',q,'" href="javascript:void(\'',(t.label||"").replace("'",""),'\')" title="',t.label,'" tabindex="-1"_cke_focus=1 hidefocus="true"');if(b.opera||b.gecko&&b.mac){n.push(' onkeypress="return false;"')}if(b.gecko){n.push(' onblur="this.style.cssText = this.style.cssText;"')}var s=(t.iconOffset||0)*(-16);n.push(' onmouseover="CKEDITOR.tools.callFunction(',l._.itemOverFn,",",m,');" onmouseout="CKEDITOR.tools.callFunction(',l._.itemOutFn,",",m,');" onclick="CKEDITOR.tools.callFunction(',l._.itemClickFn,",",m,'); return false;"><span class="cke_icon_wrapper"><span class="cke_icon"'+(t.icon?' style="background-image:url('+a.getUrl(t.icon)+");background-position:0 "+s+'px;"':"")+'></span></span><span class="cke_label">');if(t.getItems){n.push('<span class="cke_menuarrow"></span>')}n.push(r,"</span></a></span>")}}});i.menu_subMenuDelay=400;i.menu_groups="clipboard,form,tablecell,tablecellproperties,tablerow,tablecolumn,table,anchor,link,image,flash,checkbox,radio,textfield,hiddenfield,imagebutton,button,select,textarea";(function(){function l(){var v=this;try{var s=v.getSelection();if(!s){return }var t=s.getStartElement(),u=new d.elementPath(t);if(!u.compare(v._.selectionPreviousPath)){v._.selectionPreviousPath=u;v.fire("selectionChange",{selection:s,path:u,element:t})}}catch(w){}}var m,n;function o(){n=true;if(m){return }p.call(this);m=e.setTimeout(p,200,this)}function p(){m=null;if(n){e.setTimeout(l,0,this);n=false}}var q={exec:function(s){switch(s.mode){case"wysiwyg":s.document.$.execCommand("SelectAll",false,null);break;case"source":}},canUndo:false};j.add("selection",{init:function(s){s.on("contentDom",function(){var t=s.document;if(c){var u,v;t.on("focusin",function(){if(u){try{u.select()}catch(y){}u=null}});s.window.on("focus",function(){v=true;x()});s.document.on("beforedeactivate",function(){v=false;s.document.$.execCommand("Unselect")});t.on("mousedown",w);t.on("mouseup",function(){v=true;setTimeout(function(){x(true)},0)});t.on("keydown",w);t.on("keyup",function(){v=true;x()});t.on("selectionchange",x);function w(){v=false}function x(y){if(v){var z=s.document,A=z&&z.$.selection;if(y&&A&&A.type=="None"){if(!z.$.queryCommandEnabled("InsertImage")){e.setTimeout(x,50,this,true);return }}u=A&&A.createRange();o.call(s)}}}else{t.on("mouseup",o,s);t.on("keyup",o,s)}});s.addCommand("selectAll",q);s.ui.addButton("SelectAll",{label:s.lang.selectAll,command:"selectAll"});s.selectionChange=o}});a.editor.prototype.getSelection=function(){return this.document&&this.document.getSelection()};a.editor.prototype.forceNextSelectionCheck=function(){delete this._.selectionPreviousPath};g.prototype.getSelection=function(){var s=new d.selection(this);return !s||s.isInvalid?null:s};a.SELECTION_NONE=1;a.SELECTION_TEXT=2;a.SELECTION_ELEMENT=3;d.selection=function(s){var v=this;var t=s.getCustomData("cke_locked_selection");if(t){return t}v.document=s;v.isLocked=false;v._={cache:{}};if(c){var u=v.getNative().createRange();if(!u||u.item&&u.item(0).ownerDocument!=v.document.$||u.parentElement&&u.parentElement().ownerDocument!=v.document.$){v.isInvalid=true}}return v};var r={img:1,hr:1,li:1,table:1,tr:1,td:1,embed:1,object:1,ol:1,ul:1,a:1,input:1,form:1,select:1,textarea:1,button:1,fieldset:1,th:1,thead:1,tfoot:1};d.selection.prototype={getNative:c?function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.$.selection)}:function(){return this._.cache.nativeSel||(this._.cache.nativeSel=this.document.getWindow().$.getSelection())},getType:c?function(){var s=this._.cache;if(s.type){return s.type}var t=1;try{var u=this.getNative(),v=u.type;if(v=="Text"){t=2}if(v=="Control"){t=3}if(u.createRange().parentElement){t=2}}catch(w){}return s.type=t}:function(){var s=this._.cache;if(s.type){return s.type}var t=2,u=this.getNative();if(!u){t=1}else{if(u.rangeCount==1){var v=u.getRangeAt(0),w=v.startContainer;if(w==v.endContainer&&w.nodeType==1&&v.endOffset-v.startOffset==1&&r[w.childNodes[v.startOffset].nodeName.toLowerCase()]){t=3}}}return s.type=t},getRanges:c?(function(){var s=function(t,u){t=t.duplicate();t.collapse(u);var v=t.parentElement(),w=v.childNodes,x;for(var y=0;y<w.length;y++){var z=w[y];if(z.nodeType==1){x=t.duplicate();x.moveToElementText(z);x.collapse();var A=x.compareEndPoints("StartToStart",t);if(A>0){break}else{if(A===0){return{container:v,offset:y}}}x=null}}if(!x){x=t.duplicate();x.moveToElementText(v);x.collapse(false)}x.setEndPoint("StartToStart",t);var B=x.text.replace(/(\r\n|\r)/g,"\n").length;while(B>0){B-=w[--y].nodeValue.length}if(B===0){return{container:v,offset:y}}else{return{container:w[y],offset:-B}}};return function(){var E=this;var t=E._.cache;if(t.ranges){return t.ranges}var u=E.getNative(),v=u&&u.createRange(),w=E.getType(),x;if(!u){return[]}if(w==2){x=new d.range(E.document);var y=s(v,true);x.setStart(new d.node(y.container),y.offset);y=s(v);x.setEnd(new d.node(y.container),y.offset);return t.ranges=[x]}else{if(w==3){var z=E._.cache.ranges=[];for(var A=0;A<v.length;A++){var B=v.item(A),C=B.parentNode,D=0;x=new d.range(E.document);for(;D<C.childNodes.length&&C.childNodes[D]!=B;D++){}x.setStart(new d.node(C),D);x.setEnd(new d.node(C),D+1);z.push(x)}return z}}return t.ranges=[]}})():function(){var s=this._.cache;if(s.ranges){return s.ranges}var t=[],u=this.getNative();if(!u){return[]}for(var v=0;v<u.rangeCount;v++){var w=u.getRangeAt(v),x=new d.range(this.document);x.setStart(new d.node(w.startContainer),w.startOffset);x.setEnd(new d.node(w.endContainer),w.endOffset);t.push(x)}return s.ranges=t},getStartElement:function(){var z=this;var s=z._.cache;if(s.startElement!==undefined){return s.startElement}var t,u=z.getNative();switch(z.getType()){case 3:return z.getSelectedElement();case 2:var v=z.getRanges()[0];if(v){if(!v.collapsed){v.optimize();for(;;){var w=v.startContainer,x=v.startOffset;if(x==(w.getChildCount?w.getChildCount():w.getLength())){v.setStartAfter(w)}else{break}}t=v.startContainer;if(t.type!=1){return t.getParent()}t=t.getChild(v.startOffset);if(!t||t.type!=1){return v.startContainer}var y=t.getFirst();while(y&&y.type==1){t=y;y=y.getFirst()}return t}}if(c){v=u.createRange();v.collapse(true);t=v.parentElement()}else{t=u.anchorNode;if(t&&t.nodeType!=1){t=t.parentNode}}}return s.startElement=t?new h(t):null},getSelectedElement:function(){var s=this._.cache;if(s.selectedElement!==undefined){return s.selectedElement}var t;if(this.getType()==3){var u=this.getNative();if(c){try{t=u.createRange().item(0)}catch(w){}}else{var v=u.getRangeAt(0);t=v.startContainer.childNodes[v.startOffset]}}return s.selectedElement=t?new h(t):null},lock:function(){var s=this;s.getRanges();s.getStartElement();s.getSelectedElement();s._.cache.nativeSel={};s.isLocked=true;s.document.setCustomData("cke_locked_selection",s)},unlock:function(s){var x=this;var t=x.document,u=t.getCustomData("cke_locked_selection");if(u){t.setCustomData("cke_locked_selection",null);if(s){var v=u.getSelectedElement(),w=!v&&u.getRanges();x.isLocked=false;x.reset();t.getBody().focus();if(v){x.selectElement(v)}else{x.selectRanges(w)}}}if(!u||!s){x.isLocked=false;x.reset()}},reset:function(){this._.cache={}},selectElement:function(s){var v=this;if(v.isLocked){var t=new d.range(v.document);t.setStartBefore(s);t.setEndAfter(s);v._.cache.selectedElement=s;v._.cache.startElement=s;v._.cache.ranges=[t];v._.cache.type=3;return }if(c){v.getNative().empty();try{t=v.document.$.body.createControlRange();t.addElement(s.$);t.select()}catch(w){t=v.document.$.body.createTextRange();t.moveToElementText(s.$);t.select()}v.reset()}else{t=v.document.$.createRange();t.selectNode(s.$);var u=v.getNative();u.removeAllRanges();u.addRange(t);v.reset()}},selectRanges:function(s){var y=this;if(y.isLocked){y._.cache.selectedElement=null;y._.cache.startElement=s[0].getTouchedStartNode();y._.cache.ranges=s;y._.cache.type=2;return }if(c){if(s[0]){s[0].select()}y.reset()}else{var t=y.getNative();t.removeAllRanges();for(var u=0;u<s.length;u++){var v=s[u],w=y.document.$.createRange(),x=v.startContainer;if(v.collapsed&&b.gecko&&b.version<10900&&x.type==1&&!x.getChildCount()){x.appendText("")}w.setStart(x.$,v.startOffset);w.setEnd(v.endContainer.$,v.endOffset);t.addRange(w)}y.reset()}},createBookmarks:function(s){var t=[],u=this.getRanges(),v=u.length,w;for(var x=0;x<v;x++){t.push(w=u[x].createBookmark(s,true));s=w.serializable;var y=s?this.document.getById(w.startNode):w.startNode,z=s?this.document.getById(w.endNode):w.endNode;for(var A=x+1;A<v;A++){var B=u[A],C=B.startContainer,D=B.endContainer;C.equals(y.getParent())&&B.startOffset++;C.equals(z.getParent())&&B.startOffset++;D.equals(y.getParent())&&B.endOffset++;D.equals(z.getParent())&&B.endOffset++}}return t},createBookmarks2:function(s){var t=[],u=this.getRanges();for(var v=0;v<u.length;v++){t.push(u[v].createBookmark2(s))}return t},selectBookmarks:function(s){var t=[];for(var u=0;u<s.length;u++){var v=new d.range(this.document);v.moveToBookmark(s[u]);t.push(v)}this.selectRanges(t);return this}}})();d.range.prototype.select=c?function(l){var u=this;var m=u.collapsed,n,o,p=u.createBookmark(),q=p.startNode,r;if(!m){r=p.endNode}var s=u.document.$.body.createTextRange();s.moveToElementText(q.$);s.moveStart("character",1);if(r){var t=u.document.$.body.createTextRange();t.moveToElementText(r.$);s.setEndPoint("EndToEnd",t);s.moveEnd("character",-1)}else{n=l||!q.hasPrevious()||q.getPrevious().is&&q.getPrevious().is("br");o=u.document.createElement("span");o.setHtml("&#65279;");o.insertBefore(q);if(n){u.document.createText("").insertBefore(q)}}u.setStartBefore(q);q.remove();if(m){if(n){s.moveStart("character",-1);s.select();u.document.$.selection.clear()}else{s.select()}o.remove()}else{u.setEndBefore(r);r.remove();s.select()}}:function(){var o=this;var l=o.startContainer;if(o.collapsed&&l.type==1&&!l.getChildCount()){l.append(new d.text(""))}var m=o.document.$.createRange();m.setStart(l.$,o.startOffset);try{m.setEnd(o.endContainer.$,o.endOffset)}catch(p){if(p.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")>=0){o.collapse(true);m.setEnd(o.endContainer.$,o.endOffset)}else{throw p}}var n=o.document.getSelection().getNative();n.removeAllRanges();n.addRange(m)};(function(){var l={elements:{$:function(m){var n=m.attributes._cke_realelement,o=n&&new a.htmlParser.fragment.fromHtml(decodeURIComponent(n)),p=o&&o.children[0];if(p){var q=m.attributes.style;if(q){var r=/(?:^|\s)width\s*:\s*(\d+)/.exec(q),s=r&&r[1];r=/(?:^|\s)height\s*:\s*(\d+)/.exec(q);var t=r&&r[1];if(s){p.attributes.width=s}if(t){p.attributes.height=t}}}return p}}};j.add("fakeobjects",{requires:["htmlwriter"],afterInit:function(m){var n=m.dataProcessor,o=n&&n.htmlFilter;if(o){o.addRules(l)}}})})();a.editor.prototype.createFakeElement=function(l,m,n,o){var p=this.lang.fakeobjects,q={"class":m,src:a.getUrl("images/spacer.gif"),_cke_realelement:encodeURIComponent(l.getOuterHtml()),alt:p[n]||p.unknown};if(n){q._cke_real_element_type=n}if(o){q._cke_resizable=o}return this.document.createElement("img",{attributes:q})};a.editor.prototype.createFakeParserElement=function(l,m,n,o){var p=new a.htmlParser.basicWriter();l.writeHtml(p);var q=p.getHtml(),r=this.lang.fakeobjects,s={"class":m,src:a.getUrl("images/spacer.gif"),_cke_realelement:encodeURIComponent(q),alt:r[n]||r.unknown};if(n){s._cke_real_element_type=n}if(o){s._cke_resizable=o}return new a.htmlParser.element("img",s)};a.editor.prototype.restoreRealElement=function(l){var m=decodeURIComponent(l.getAttribute("_cke_realelement"));return h.createFromHtml(m,this.document)};j.add("richcombo",{requires:["floatpanel","listblock","button"],beforeInit:function(l){l.ui.addHandler(3,k.richCombo.handler)}});a.UI_RICHCOMBO=3;k.richCombo=e.createClass({$:function(l){var n=this;e.extend(n,l,{title:l.label,modes:{wysiwyg:1}});var m=n.panel||{};delete n.panel;n.id=e.getNextNumber();n.document=m&&m.parent&&m.parent.getDocument()||a.document;m.className=(m.className||"")+(" cke_rcombopanel");n._={panelDefinition:m,items:{},state:2}},statics:{handler:{create:function(l){return new k.richCombo(l)}}},proto:{renderHtml:function(l){var m=[];this.render(l,m);return m.join("")},render:function(l,m){var n="cke_"+this.id,o=e.addFunction(function(r){var u=this;var s=u._;if(s.state==0){return }u.createPanel(l);if(s.on){s.panel.hide();return }if(!s.committed){s.list.commit();s.committed=1}var t=u.getValue();if(t){s.list.mark(t)}else{s.list.unmarkAll()}s.panel.showBlock(u.id,new h(r),4)},this),p={id:n,combo:this,focus:function(){var r=a.document.getById(n).getChild(1);r.focus()},execute:o};l.on("mode",function(){this.setState(this.modes[l.mode]?2:0)},this);var q=e.addFunction(function(r,s){r=new d.event(r);var t=r.getKeystroke();switch(t){case 13:case 32:case 40:e.callFunction(o,s);break;default:p.onkey(p,t)}r.preventDefault()});m.push('<span class="cke_rcombo">',"<span id=",n);if(this.className){m.push(' class="',this.className,' cke_off"')}m.push("><span class=cke_label>",this.label,'</span><a hidefocus=true title="',this.title,'" tabindex="-1" href="javascript:void(\'',this.label,"')\"");if(b.opera||b.gecko&&b.mac){m.push(' onkeypress="return false;"')}if(b.gecko){m.push(' onblur="this.style.cssText = this.style.cssText;"')}m.push(' onkeydown="CKEDITOR.tools.callFunction( ',q,', event, this );" onclick="CKEDITOR.tools.callFunction(',o,', this); return false;"><span><span class="cke_accessibility">'+(this.voiceLabel?this.voiceLabel+" ":"")+'</span><span id="'+n+'_text" class="cke_text cke_inline_label">'+this.label+"</span></span><span class=cke_openbutton></span></a></span></span>");if(this.onRender){this.onRender()}return p},createPanel:function(l){if(this._.panel){return }var m=this._.panelDefinition,n=m.parent||a.document.getBody(),o=new k.floatPanel(l,n,m),p=o.addListBlock(this.id,this.multiSelect),q=this;o.onShow=function(){if(q.className){this.element.getFirst().addClass(q.className+"_panel")}q.setState(1);p.focus(!q.multiSelect&&q.getValue());q._.on=1;if(q.onOpen){q.onOpen()}};o.onHide=function(){if(q.className){this.element.getFirst().removeClass(q.className+"_panel")}q.setState(2);q._.on=0;if(q.onClose){q.onClose()}};o.onEscape=function(){o.hide();q.document.getById("cke_"+q.id).getFirst().getNext().focus()};p.onClick=function(r,s){q.document.getWindow().focus();if(q.onClick){q.onClick.call(q,r,s)}if(s){q.setValue(r,q._.items[r])}else{q.setValue("")}o.hide()};this._.panel=o;this._.list=p;o.getBlock(this.id).onHide=function(){q._.on=0;q.setState(2)};if(this.init){this.init()}},setValue:function(l,m){var o=this;o._.value=l;var n=o.document.getById("cke_"+o.id+"_text");if(!l){m=o.label;n.addClass("cke_inline_label")}else{n.removeClass("cke_inline_label")}n.setHtml(typeof m!="undefined"?m:l)},getValue:function(){return this._.value||""},unmarkAll:function(){this._.list.unmarkAll()},mark:function(l){this._.list.mark(l)},hideItem:function(l){this._.list.hideItem(l)},hideGroup:function(l){this._.list.hideGroup(l)},showAll:function(){this._.list.showAll()},add:function(l,m,n){this._.items[l]=n||l;this._.list.add(l,m,n)},startGroup:function(l){this._.list.startGroup(l)},commit:function(){this._.list.commit()},setState:function(l){var m=this;if(m._.state==l){return }m.document.getById("cke_"+m.id).setState(l);m._.state=l}}});k.prototype.addRichCombo=function(l,m){this.add(l,3,m)};j.add("htmlwriter");a.htmlWriter=e.createClass({base:a.htmlParser.basicWriter,$:function(){var n=this;n.base();n.indentationChars="\t";n.selfClosingEnd=" />";n.lineBreakChars="\n";n.forceSimpleAmpersand=false;n.sortAttributes=true;n._.indent=false;n._.indentation="";n._.rules={};var l=f;for(var m in e.extend({},l.$block,l.$listItem,l.$tableContent)){n.setRules(m,{indent:true,breakBeforeOpen:true,breakAfterOpen:true,breakBeforeClose:!l[m]["#"],breakAfterClose:true})}n.setRules("br",{breakAfterOpen:true});n.setRules("pre",{indent:false})},proto:{openTag:function(l,m){var o=this;var n=o._.rules[l];if(o._.indent){o.indentation()}else{if(n&&n.breakBeforeOpen){o.lineBreak();o.indentation()}}o._.output.push("<",l)},openTagClose:function(l,m){var o=this;var n=o._.rules[l];if(m){o._.output.push(o.selfClosingEnd)}else{o._.output.push(">");if(n&&n.indent){o._.indentation+=o.indentationChars}}if(n&&n.breakAfterOpen){o.lineBreak()}},attribute:function(l,m){if(this.forceSimpleAmpersand){m=m.replace(/&amp;/,"&")}this._.output.push(" ",l,'="',m,'"')},closeTag:function(l){var n=this;var m=n._.rules[l];if(m&&m.indent){n._.indentation=n._.indentation.substr(n.indentationChars.length)}if(n._.indent){n.indentation()}else{if(m&&m.breakBeforeClose){n.lineBreak();n.indentation()}}n._.output.push("</",l,">");if(m&&m.breakAfterClose){n.lineBreak()}},text:function(l){if(this._.indent){this.indentation();l=e.ltrim(l)}this._.output.push(l)},comment:function(l){if(this._.indent){this.indentation()}this._.output.push("<!--",l,"-->")},lineBreak:function(){var l=this;if(l._.output.length>0){l._.output.push(l.lineBreakChars)}l._.indent=true},indentation:function(){this._.output.push(this._.indentation);this._.indent=false},setRules:function(l,m){this._.rules[l]=m}}});j.add("menubutton",{requires:["button","contextmenu"],beforeInit:function(l){l.ui.addHandler(5,k.menuButton.handler)}});a.UI_MENUBUTTON=5;(function(){var l=function(m){var n=this._;if(n.state===0){return }n.previousState=n.state;var o=n.menu;if(!o){o=n.menu=new j.contextMenu(m);o.onHide=e.bind(function(){this.setState(n.previousState)},this);if(this.onMenu){o.addListener(this.onMenu)}}if(n.on){o.hide();return }this.setState(1);o.show(a.document.getById(this._.id),4)};k.menuButton=e.createClass({base:k.button,$:function(m){var n=m.panel;delete m.panel;this.base(m);this.hasArrow=true;this.click=l},statics:{handler:{create:function(m){return new k.menuButton(m)}}}})})();j.add("dialog",{requires:["dialogui"]});a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){function l(L){return !!this._.tabs[L][0].$.offsetHeight}function m(){var P=this;var L=P._.currentTabId,M=P._.tabIdList.length,N=e.indexOf(P._.tabIdList,L)+M;for(var O=N-1;O>N-M;O--){if(l.call(P,P._.tabIdList[O%M])){return P._.tabIdList[O%M]}}return null}function n(){var P=this;var L=P._.currentTabId,M=P._.tabIdList.length,N=e.indexOf(P._.tabIdList,L);for(var O=N+1;O<N+M;O++){if(l.call(P,P._.tabIdList[O%M])){return P._.tabIdList[O%M]}}return null}var o={};a.dialog=function(L,M){var N=a.dialog._.dialogDefinitions[M];if(!N){console.log('Error: The dialog "'+M+'" is not defined.');return }N=e.extend(N(L),q);N=e.clone(N);N=new u(this,N);this.definition=N=a.fire("dialogDefinition",{name:M,definition:N},L).definition;var O=a.document,P=L.theme.buildDialog(L);this._={editor:L,element:P.element,name:M,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=P.parts;this.parts.dialog.setStyles({position:b.ie6Compat?"absolute":"fixed",top:0,left:0,visibility:"hidden"});a.event.call(this);if(N.onLoad){this.on("load",N.onLoad)}if(N.onShow){this.on("show",N.onShow)}if(N.onHide){this.on("hide",N.onHide)}if(N.onOk){this.on("ok",function(Z){if(N.onOk.call(this,Z)===false){Z.data.hide=false}})}if(N.onCancel){this.on("cancel",function(Z){if(N.onCancel.call(this,Z)===false){Z.data.hide=false}})}var Q=this,R=function(Z){var aa=Q._.contents,ab=false;for(var ac in aa){for(var ad in aa[ac]){ab=Z.call(this,aa[ac][ad]);if(ab){return }}}};this.on("ok",function(Z){R(function(aa){if(aa.validate){var ab=aa.validate(this);if(typeof ab=="string"){alert(ab);ab=false}if(ab===false){if(aa.select){aa.select()}else{aa.focus()}Z.data.hide=false;Z.stop();return true}}})},this,null,0);this.on("cancel",function(Z){R(function(aa){if(aa.isChanged()){if(!confirm(L.lang.common.confirmCancel)){Z.data.hide=false}return true}})},this,null,0);this.parts.close.on("click",function(Z){if(this.fire("cancel",{hide:true}).hide!==false){this.hide()}},this);function S(Z){var aa=Q._.focusList,ab=Z?1:-1;if(aa.length<1){return }var ac=(Q._.currentFocusIndex+ab+aa.length)%(aa.length);while(!aa[ac].isFocusable()){ac=(ac+ab+aa.length)%(aa.length);if(ac==Q._.currentFocusIndex){break}}aa[ac].focus();if(aa[ac].type=="text"){aa[ac].select()}}function T(Z){if(Q!=a.dialog._.currentTop){return }var aa=Z.data.getKeystroke(),ab=false;if(aa==9||aa==2000+9){var ac=aa==2000+9;if(Q._.tabBarMode){var ad=ac?m.call(Q):n.call(Q);Q.selectPage(ad);Q._.tabs[ad][0].focus()}else{S(!ac)}ab=true}else{if(aa==4000+121&&!Q._.tabBarMode){Q._.tabBarMode=true;Q._.tabs[Q._.currentTabId][0].focus();ab=true}else{if((aa==37||aa==39)&&(Q._.tabBarMode)){ad=aa==37?m.call(Q):n.call(Q);Q.selectPage(ad);Q._.tabs[ad][0].focus();ab=true}}}if(ab){Z.stop();Z.data.preventDefault()}}this.on("show",function(){a.document.on("keydown",T,this,null,0);if(b.ie6Compat){var Z=z.getChild(0).getFrameDocument();Z.on("keydown",T,this,null,0)}});this.on("hide",function(){a.document.removeListener("keydown",T)});this.on("iframeAdded",function(Z){var aa=new g(Z.data.iframe.$.contentWindow.document);aa.on("keydown",T,this,null,0)});this.on("show",function(){var ac=this;if(!ac._.hasFocus){ac._.currentFocusIndex=-1;S(true);if(ac._.editor.mode=="wysiwyg"&&c){var Z=L.document.$.selection,aa=Z.createRange();if(aa){if(aa.parentElement&&aa.parentElement().ownerDocument==L.document.$||aa.item&&aa.item(0).ownerDocument==L.document.$){var ab=document.body.createTextRange();ab.moveToElementText(ac.getElement().getFirst().$);ab.collapse(true);ab.select()}}}}},this,null,4294967295);if(b.ie6Compat){this.on("load",function(Z){var aa=this.getElement(),ab=aa.getFirst();ab.remove();ab.appendTo(aa)},this)}w(this);x(this);new d.text(N.title,a.document).appendTo(this.parts.title);for(var U=0;U<N.contents.length;U++){this.addPage(N.contents[U])}var V=/cke_dialog_tab(\s|$|_)/,W=/cke_dialog_tab(\s|$)/;this.parts.tabs.on("click",function(Z){var ae=this;var aa=Z.data.getTarget(),ab=aa,ac,ad;if(!(V.test(aa.$.className)||aa.getName()=="a")){return }ac=aa.$.id.substr(0,aa.$.id.lastIndexOf("_"));ae.selectPage(ac);if(ae._.tabBarMode){ae._.tabBarMode=false;ae._.currentFocusIndex=-1;S(true)}Z.data.preventDefault()},this);var X=[],Y=a.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:N.buttons},X).getChild();this.parts.footer.setHtml(X.join(""));for(U=0;U<Y.length;U++){this._.buttons[Y[U].id]=Y[U]}a.skins.load(L,"dialog")};function p(L,M,N){this.element=M;this.focusIndex=N;this.isFocusable=function(){return true};this.focus=function(){L._.currentFocusIndex=this.focusIndex;this.element.focus()};M.on("keydown",function(O){if(O.data.getKeystroke() in {32:1,13:1}){this.fire("click")}});M.on("focus",function(){this.fire("mouseover")});M.on("blur",function(){this.fire("mouseout")})}a.dialog.prototype={resize:(function(){return function(L,M){var N=this;if(N._.contentSize&&N._.contentSize.width==L&&N._.contentSize.height==M){return }a.dialog.fire("resize",{dialog:N,skin:N._.editor.skinName,width:L,height:M},N._.editor);N._.contentSize={width:L,height:M};N._.updateSize=true}})(),getSize:function(){var N=this;if(!N._.updateSize){return N._.size}var L=N._.element.getFirst(),M=N._.size={width:L.$.offsetWidth||0,height:L.$.offsetHeight||0};N._.updateSize=!M.width||!M.height;return M},move:(function(){var L;return function(M,N){var Q=this;var O=Q._.element.getFirst();if(L===undefined){L=O.getComputedStyle("position")=="fixed"}if(L&&Q._.position&&Q._.position.x==M&&Q._.position.y==N){return }Q._.position={x:M,y:N};if(!L){var P=a.document.getWindow().getScrollPosition();M+=P.x;N+=P.y}O.setStyles({left:(M>0?M:0)+("px"),top:(N>0?N:0)+("px")})}})(),getPosition:function(){return e.extend({},this._.position)},show:function(){if(this._.editor.mode=="wysiwyg"&&c){this._.editor.getSelection().lock()}var L=this._.element,M=this.definition;if(!(L.getParent()&&L.getParent().equals(a.document.getBody()))){L.appendTo(a.document.getBody())}else{return }if(b.gecko&&b.version<10900){var N=this.parts.dialog;N.setStyle("position","absolute");setTimeout(function(){N.setStyle("position","fixed")},0)}this.resize(M.minWidth,M.minHeight);this.selectPage(this.definition.contents[0].id);this.reset();if(a.dialog._.currentZIndex===null){a.dialog._.currentZIndex=this._.editor.config.baseFloatZIndex}this._.element.getFirst().setStyle("z-index",a.dialog._.currentZIndex+=10);if(a.dialog._.currentTop===null){a.dialog._.currentTop=this;this._.parentDialog=null;A(this._.editor);a.document.on("keydown",D);a.document.on("keyup",E);for(var O in {keyup:1,keydown:1,keypress:1}){a.document.on(O,K)}}else{this._.parentDialog=a.dialog._.currentTop;var P=this._.parentDialog.getElement().getFirst();P.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);a.dialog._.currentTop=this}F(this,this,"\x1b",null,function(){this.getButton("cancel")&&this.getButton("cancel").click()});this._.hasFocus=false;e.setTimeout(function(){var Q=a.document.getWindow().getViewPaneSize(),R=this.getSize();this.move((Q.width-M.minWidth)/(2),(Q.height-R.height)/(2));this.parts.dialog.setStyle("visibility","");this.fireOnce("load",{});this.fire("show",{});this.foreach(function(S){S.setInitValue&&S.setInitValue()})},100,this)},foreach:function(L){var O=this;for(var M in O._.contents){for(var N in O._.contents[M]){L(O._.contents[M][N])}}return O},reset:(function(){var L=function(M){if(M.reset){M.reset()}};return function(){this.foreach(L);return this}})(),setupContent:function(){var L=arguments;this.foreach(function(M){if(M.setup){M.setup.apply(M,L)}})},commitContent:function(){var L=arguments;this.foreach(function(M){if(M.commit){M.commit.apply(M,L)}})},hide:function(){this.fire("hide",{});var L=this._.element;if(!L.getParent()){return }L.remove();this.parts.dialog.setStyle("visibility","hidden");G(this);if(!this._.parentDialog){B()}else{var M=this._.parentDialog.getElement().getFirst();M.setStyle("z-index",parseInt(M.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))}a.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){a.dialog._.currentZIndex=null;a.document.removeListener("keydown",D);a.document.removeListener("keyup",E);a.document.removeListener("keypress",E);for(var N in {keyup:1,keydown:1,keypress:1}){a.document.removeListener(N,K)}var O=this._.editor;O.focus();if(O.mode=="wysiwyg"&&c){O.getSelection().unlock(true)}}else{a.dialog._.currentZIndex-=10}this.foreach(function(P){P.resetInitValue&&P.resetInitValue()})},addPage:function(L){var V=this;var M=[],N=L.label?' title="'+e.htmlEncode(L.label)+'"':"",O=L.elements,P=a.dialog._.uiElementBuilders.vbox.build(V,{type:"vbox",className:"cke_dialog_page_contents",children:L.elements,expand:!!L.expand,padding:L.padding,style:L.style||"width: 100%; height: 100%;"},M),Q=h.createFromHtml(M.join("")),R=h.createFromHtml(['<a class="cke_dialog_tab"',V._.pageCount>0?" cke_last":"cke_first",N,!!L.hidden?' style="display:none"':"",' id="',L.id+"_",e.getNextNumber(),'" href="javascript:void(0)"',' hidefocus="true">',L.label,"</a>"].join(""));if(V._.pageCount===0){V.parts.dialog.addClass("cke_single_page")}else{V.parts.dialog.removeClass("cke_single_page")}V._.tabs[L.id]=[R,Q];V._.tabIdList.push(L.id);V._.pageCount++;V._.lastTab=R;var S=V._.contents[L.id]={},T,U=P.getChild();while(T=U.shift()){S[T.id]=T;if(typeof T.getChild=="function"){U.push.apply(U,T.getChild())}}Q.setAttribute("name",L.id);Q.appendTo(V.parts.contents);R.unselectable();V.parts.tabs.append(R);if(L.accessKey){F(V,V,"CTRL+"+L.accessKey,I,H);V._.accessKeyMap["CTRL+"+L.accessKey]=L.id}},selectPage:function(L){var Q=this;for(var M in Q._.tabs){var N=Q._.tabs[M][0],O=Q._.tabs[M][1];if(M!=L){N.removeClass("cke_dialog_tab_selected");O.hide()}}var P=Q._.tabs[L];P[0].addClass("cke_dialog_tab_selected");P[1].show();Q._.currentTabId=L;Q._.currentTabIndex=e.indexOf(Q._.tabIdList,L)},hidePage:function(L){var M=this._.tabs[L]&&this._.tabs[L][0];if(!M){return }M.hide()},showPage:function(L){var M=this._.tabs[L]&&this._.tabs[L][0];if(!M){return }M.show()},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(L,M){return this._.contents[L][M]},getValueOf:function(L,M){return this.getContentElement(L,M).getValue()},setValueOf:function(L,M,N){return this.getContentElement(L,M).setValue(N)},getButton:function(L){return this._.buttons[L]},click:function(L){return this._.buttons[L].click()},disableButton:function(L){return this._.buttons[L].disable()},enableButton:function(L){return this._.buttons[L].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()},addFocusable:function(L,M){var O=this;if(typeof M=="undefined"){M=O._.focusList.length;O._.focusList.push(new p(O,L,M))}else{O._.focusList.splice(M,0,new p(O,L,M));for(var N=M+1;N<O._.focusList.length;N++){O._.focusList[N].focusIndex++}}}};e.extend(a.dialog,{add:function(L,M){if(!this._.dialogDefinitions[L]||typeof M=="function"){this._.dialogDefinitions[L]=M}},exists:function(L){return !!this._.dialogDefinitions[L]},getCurrent:function(){return a.dialog._.currentTop},okButton:(function(){var L=function(M,N){N=N||{};return e.extend({id:"ok",type:"button",label:M.lang.common.ok,"class":"cke_dialog_ui_button_ok",onClick:function(O){var P=O.data.dialog;if(P.fire("ok",{hide:true}).hide!==false){P.hide()}}},N,true)};L.type="button";L.override=function(M){return e.extend(function(N){return L(N,M)},{type:"button"},true)};return L})(),cancelButton:(function(){var L=function(M,N){N=N||{};return e.extend({id:"cancel",type:"button",label:M.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(O){var P=O.data.dialog;if(P.fire("cancel",{hide:true}).hide!==false){P.hide()}}},N,true)};L.type="button";L.override=function(M){return e.extend(function(N){return L(N,M)},{type:"button"},true)};return L})(),addUIElement:function(L,M){this._.uiElementBuilders[L]=M}});a.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};a.event.implementOn(a.dialog);a.event.implementOn(a.dialog.prototype,true);var q={resizable:0,minWidth:600,minHeight:400,buttons:[a.dialog.okButton,a.dialog.cancelButton]},r=function(L,M,N){for(var O=0,P;P=L[O];O++){if(P.id==M){return P}if(N&&P[N]){var Q=r(P[N],M,N);if(Q){return Q}}}return null},s=function(L,M,N,O,P){if(N){for(var Q=0,R;R=L[Q];Q++){if(R.id==N){L.splice(Q,0,M);return M}if(O&&R[O]){var S=s(R[O],M,N,O,true);if(S){return S}}}if(P){return null}}L.push(M);return M},t=function(L,M,N){for(var O=0,P;P=L[O];O++){if(P.id==M){return L.splice(O,1)}if(N&&P[N]){var Q=t(P[N],M,N);if(Q){return Q}}}return null},u=function(L,M){this.dialog=L;var N=M.contents;for(var O=0,P;P=N[O];O++){N[O]=new v(L,P)}e.extend(this,M)};u.prototype={getContents:function(L){return r(this.contents,L)},getButton:function(L){return r(this.buttons,L)},addContents:function(L,M){return s(this.contents,L,M)},addButton:function(L,M){return s(this.buttons,L,M)},removeContents:function(L){t(this.contents,L)},removeButton:function(L){t(this.buttons,L)}};function v(L,M){this._={dialog:L};e.extend(this,M)}v.prototype={get:function(L){return r(this.elements,L,"children")},add:function(L,M){return s(this.elements,L,M,"children")},remove:function(L){t(this.elements,L,"children")}};function w(L){var M=null,N=null,O=L.getElement().getFirst(),P=L.getParentEditor(),Q=P.config.dialog_magnetDistance,R=o[P.skinName].margins||[0,0,0,0];if(typeof Q=="undefined"){Q=20}function S(U){var V=L.getSize(),W=a.document.getWindow().getViewPaneSize(),X=U.data.$.screenX,Y=U.data.$.screenY,Z=X-M.x,aa=Y-M.y,ab,ac;M={x:X,y:Y};N.x+=Z;N.y+=aa;if(N.x+R[3]<Q){ab=-R[3]}else{if(N.x-R[1]>W.width-V.width-Q){ab=W.width-V.width+R[1]}else{ab=N.x}}if(N.y+R[0]<Q){ac=-R[0]}else{if(N.y-R[2]>W.height-V.height-Q){ac=W.height-V.height+R[2]}else{ac=N.y}}L.move(ab,ac);U.data.preventDefault()}function T(U){a.document.removeListener("mousemove",S);a.document.removeListener("mouseup",T);if(b.ie6Compat){var V=z.getChild(0).getFrameDocument();V.removeListener("mousemove",S);V.removeListener("mouseup",T)}}L.parts.title.on("mousedown",function(U){L._.updateSize=true;M={x:U.data.$.screenX,y:U.data.$.screenY};a.document.on("mousemove",S);a.document.on("mouseup",T);N=L.getPosition();if(b.ie6Compat){var V=z.getChild(0).getFrameDocument();V.on("mousemove",S);V.on("mouseup",T)}U.data.preventDefault()},L)}function x(L){var M=L.definition,N=M.minWidth||0,O=M.minHeight||0,P=M.resizable,Q=o[L.getParentEditor().skinName].margins||[0,0,0,0];function R(ac,ad){ac.y+=ad}function S(ac,ad){ac.x2+=ad}function T(ac,ad){ac.y2+=ad}function U(ac,ad){ac.x+=ad}var V=null,W=null,X=L._.editor.config.magnetDistance,Y=["tl","t","tr","l","r","bl","b","br"];function Z(ac){var ad=ac.listenerData.part,ae=L.getSize();W=L.getPosition();e.extend(W,{x2:W.x+ae.width,y2:W.y+ae.height});V={x:ac.data.$.screenX,y:ac.data.$.screenY};a.document.on("mousemove",aa,L,{part:ad});a.document.on("mouseup",ab,L,{part:ad});if(b.ie6Compat){var af=z.getChild(0).getFrameDocument();af.on("mousemove",aa,L,{part:ad});af.on("mouseup",ab,L,{part:ad})}ac.data.preventDefault()}function aa(ac){var ad=ac.data.$.screenX,ae=ac.data.$.screenY,af=ad-V.x,ag=ae-V.y,ah=a.document.getWindow().getViewPaneSize(),ai=ac.listenerData.part;if(ai.search("t")!=-1){R(W,ag)}if(ai.search("l")!=-1){U(W,af)}if(ai.search("b")!=-1){T(W,ag)}if(ai.search("r")!=-1){S(W,af)}V={x:ad,y:ae};var aj,ak,al,am;if(W.x+Q[3]<X){aj=-Q[3]}else{if(ai.search("l")!=-1&&W.x2-W.x<N+X){aj=W.x2-N}else{aj=W.x}}if(W.y+Q[0]<X){ak=-Q[0]}else{if(ai.search("t")!=-1&&W.y2-W.y<O+X){ak=W.y2-O}else{ak=W.y}}if(W.x2-Q[1]>ah.width-X){al=ah.width+Q[1]}else{if(ai.search("r")!=-1&&W.x2-W.x<N+X){al=W.x+N}else{al=W.x2}}if(W.y2-Q[2]>ah.height-X){am=ah.height+Q[2]}else{if(ai.search("b")!=-1&&W.y2-W.y<O+X){am=W.y+O}else{am=W.y2}}L.move(aj,ak);L.resize(al-aj,am-ak);ac.data.preventDefault()}function ab(ac){a.document.removeListener("mouseup",ab);a.document.removeListener("mousemove",aa);if(b.ie6Compat){var ad=z.getChild(0).getFrameDocument();ad.removeListener("mouseup",ab);ad.removeListener("mousemove",aa)}}}var y,z,A=function(L){var M=a.document.getWindow();if(!z){var N=['<div style="position: ',b.ie6Compat?"absolute":"fixed","; z-index: ",L.config.baseFloatZIndex,"; top: 0px; left: 0px; ","background-color: ",L.config.dialog_backgroundCoverColor||"white",'" id="cke_dialog_background_cover">'];if(b.ie6Compat){var O=b.isCustomDomain();N.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:');N.push(O?"void((function(){document.open();document.domain='"+document.domain+"';document.close();})())":"''");N.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')}N.push("</div>");z=h.createFromHtml(N.join(""))}var P=z,Q=function(){var U=M.getViewPaneSize();P.setStyles({width:U.width+"px",height:U.height+"px"})},R=function(){var U=M.getScrollPosition(),V=a.dialog._.currentTop;P.setStyles({left:U.x+"px",top:U.y+"px"});do{var W=V.getPosition();V.move(W.x,W.y)}while(V=V._.parentDialog)};y=Q;M.on("resize",Q);Q();if(b.ie6Compat){var S=function(){R();arguments.callee.prevScrollHandler.apply(this,arguments)};M.$.setTimeout(function(){S.prevScrollHandler=window.onscroll||(function(){});window.onscroll=S},0);R()}var T=L.config.dialog_backgroundCoverOpacity;P.setOpacity(typeof T!="undefined"?T:0.5);P.appendTo(a.document.getBody())},B=function(){if(!z){return }var L=a.document.getWindow();z.remove();L.removeListener("resize",y);if(b.ie6Compat){L.$.setTimeout(function(){var M=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=M||null},0)}y=null},C={},D=function(L){var M=L.data.$.ctrlKey||L.data.$.metaKey,N=L.data.$.altKey,O=L.data.$.shiftKey,P=String.fromCharCode(L.data.$.keyCode),Q=C[(M?"CTRL+":"")+(N?"ALT+":"")+(O?"SHIFT+":"")+P];if(!Q||!Q.length){return }Q=Q[Q.length-1];Q.keydown&&Q.keydown.call(Q.uiElement,Q.dialog,Q.key);L.data.preventDefault()},E=function(L){var M=L.data.$.ctrlKey||L.data.$.metaKey,N=L.data.$.altKey,O=L.data.$.shiftKey,P=String.fromCharCode(L.data.$.keyCode),Q=C[(M?"CTRL+":"")+(N?"ALT+":"")+(O?"SHIFT+":"")+P];if(!Q||!Q.length){return }Q=Q[Q.length-1];Q.keyup&&Q.keyup.call(Q.uiElement,Q.dialog,Q.key);L.data.preventDefault()},F=function(L,M,N,O,P){var Q=C[N]||(C[N]=[]);Q.push({uiElement:L,dialog:M,key:N,keyup:P||L.accessKeyUp,keydown:O||L.accessKeyDown})},G=function(L){for(var M in C){var N=C[M];for(var O=N.length-1;O>=0;O--){if(N[O].dialog==L||N[O].uiElement==L){N.splice(O,1)}}if(N.length===0){delete C[M]}}},H=function(L,M){if(L._.accessKeyMap[M]){L.selectPage(L._.accessKeyMap[M])}},I=function(L,M){},J={27:1,13:1},K=function(L){if(L.data.getKeystroke() in J){L.data.stopPropagation()}};(function(){k.dialog={uiElement:function(L,M,N,O,P,Q,R){if(arguments.length<4){return }var S=(O.call?O(M):O)||("div"),T=["<",S," "],U=(P&&P.call?P(M):P)||({}),V=(Q&&Q.call?Q(M):Q)||({}),W=(R&&R.call?R(L,M):R)||(""),X=this.domId=V.id||e.getNextNumber()+"_uiElement",Y=this.id=M.id,Z;V.id=X;var aa={};if(M.type){aa["cke_dialog_ui_"+M.type]=1}if(M.className){aa[M.className]=1}var ab=V["class"]&&V["class"].split?V["class"].split(" "):[];for(Z=0;Z<ab.length;Z++){if(ab[Z]){aa[ab[Z]]=1}}var ac=[];for(Z in aa){ac.push(Z)}V["class"]=ac.join(" ");if(M.title){V.title=M.title}var ad=(M.style||"").split(";");for(Z in U){ad.push(Z+":"+U[Z])}if(M.hidden){ad.push("display:none")}for(Z=ad.length-1;Z>=0;Z--){if(ad[Z]===""){ad.splice(Z,1)}}if(ad.length>0){V.style=(V.style?V.style+"; ":"")+(ad.join("; "))}for(Z in V){T.push(Z+'="'+e.htmlEncode(V[Z])+'" ')}T.push(">",W,"</",S,">");N.push(T.join(""));(this._||(this._={})).dialog=L;if(typeof M.isChanged=="boolean"){this.isChanged=function(){return M.isChanged}}if(typeof M.isChanged=="function"){this.isChanged=M.isChanged}a.event.implementOn(this);this.registerEvents(M);if(this.accessKeyUp&&this.accessKeyDown&&M.accessKey){F(this,L,"CTRL+"+M.accessKey)}var ae=this;L.on("load",function(){if(ae.getInputElement()){ae.getInputElement().on("focus",function(){L._.tabBarMode=false;L._.hasFocus=true;ae.fire("focus")},ae)}});if(this.keyboardFocusable){this.focusIndex=L._.focusList.push(this)-1;this.on("focus",function(){L._.currentFocusIndex=ae.focusIndex})}e.extend(this,M)},hbox:function(L,M,N,O,P){if(arguments.length<4){return }this._||(this._={});var Q=this._.children=M,R=P&&P.widths||null,S=P&&P.height||null,T={},U,V=function(){var W=['<tbody><tr class="cke_dialog_ui_hbox">'];for(U=0;U<N.length;U++){var X="cke_dialog_ui_hbox_child",Y=[];if(U===0){X="cke_dialog_ui_hbox_first"}if(U==N.length-1){X="cke_dialog_ui_hbox_last"}W.push('<td class="',X,'" ');if(R){if(R[U]){Y.push("width:"+e.cssLength(R[U]))}}else{Y.push("width:"+Math.floor(100/N.length)+"%")}if(S){Y.push("height:"+e.cssLength(S))}if(P&&P.padding!=undefined){Y.push("padding:"+e.cssLength(P.padding))}if(Y.length>0){W.push('style="'+Y.join("; ")+'" ')}W.push(">",N[U],"</td>")}W.push("</tr></tbody>");return W.join("")};k.dialog.uiElement.call(this,L,P||{type:"hbox"},O,"table",T,P&&P.align&&{align:P.align}||null,V)},vbox:function(L,M,N,O,P){if(arguments.length<3){return }this._||(this._={});var Q=this._.children=M,R=P&&P.width||null,S=P&&P.heights||null,T=function(){var U=['<table cellspacing="0" border="0" '];U.push('style="');if(P&&P.expand){U.push("height:100%;")}U.push("width:"+e.cssLength(R||"100%"),";");U.push('"');U.push('align="',e.htmlEncode(P&&P.align||(L.getParentEditor().lang.dir=="ltr"?"left":"right")),'" ');U.push("><tbody>");for(var V=0;V<N.length;V++){var W=[];U.push("<tr><td ");if(R){W.push("width:"+e.cssLength(R||"100%"))}if(S){W.push("height:"+e.cssLength(S[V]))}else{if(P&&P.expand){W.push("height:"+Math.floor(100/N.length)+"%")}}if(P&&P.padding!=undefined){W.push("padding:"+e.cssLength(P.padding))}if(W.length>0){U.push('style="',W.join("; "),'" ')}U.push(' class="cke_dialog_ui_vbox_child">',N[V],"</td></tr>")}U.push("</tbody></table>");return U.join("")};k.dialog.uiElement.call(this,L,P||{type:"vbox"},O,"div",null,null,T)}}})();k.dialog.uiElement.prototype={getElement:function(){return a.document.getById(this.domId)},getInputElement:function(){return this.getElement()},getDialog:function(){return this._.dialog},setValue:function(L){this.getInputElement().setValue(L);this.fire("change",{value:L});return this},getValue:function(){return this.getInputElement().getValue()},isChanged:function(){return false},selectParentTab:function(){var O=this;var L=O.getInputElement(),M=L,N;while((M=M.getParent())&&(M.$.className.search("cke_dialog_page_contents")==-1)){}if(!M){return O}N=M.getAttribute("name");if(O._.dialog._.currentTabId!=N){O._.dialog.selectPage(N)}return O},focus:function(){this.selectParentTab().getInputElement().focus();return this},registerEvents:function(L){var M=/^on([A-Z]\w+)/,N,O=function(Q,R,S,T){R.on("load",function(){Q.getInputElement().on(S,T,Q)})};for(var P in L){if(!(N=P.match(M))){continue}if(this.eventProcessors[P]){this.eventProcessors[P].call(this,this._.dialog,L[P])}else{O(this,this._.dialog,N[1].toLowerCase(),L[P])}}return this},eventProcessors:{onLoad:function(L,M){L.on("load",M,this)},onShow:function(L,M){L.on("show",M,this)},onHide:function(L,M){L.on("hide",M,this)}},accessKeyDown:function(L,M){this.focus()},accessKeyUp:function(L,M){},disable:function(){var L=this.getInputElement();L.setAttribute("disabled","true");L.addClass("cke_disabled")},enable:function(){var L=this.getInputElement();L.removeAttribute("disabled");L.removeClass("cke_disabled")},isEnabled:function(){return !this.getInputElement().getAttribute("disabled")},isVisible:function(){return !!this.getInputElement().$.offsetHeight},isFocusable:function(){if(!this.isEnabled()||!this.isVisible()){return false}return true}};k.dialog.hbox.prototype=e.extend(new k.dialog.uiElement(),{getChild:function(L){var M=this;if(arguments.length<1){return M._.children.concat()}if(!L.splice){L=[L]}if(L.length<2){return M._.children[L[0]]}else{return M._.children[L[0]]&&M._.children[L[0]].getChild?M._.children[L[0]].getChild(L.slice(1,L.length)):null}}},true);k.dialog.vbox.prototype=new k.dialog.hbox();(function(){var L={build:function(M,N,O){var P=N.children,Q,R=[],S=[];for(var T=0;T<P.length&&(Q=P[T]);T++){var U=[];R.push(U);S.push(a.dialog._.uiElementBuilders[Q.type].build(M,Q,U))}return new k.dialog[N.type](M,S,R,O,N)}};a.dialog.addUIElement("hbox",L);a.dialog.addUIElement("vbox",L)})();a.dialogCommand=function(L){this.dialogName=L};a.dialogCommand.prototype={exec:function(L){L.openDialog(this.dialogName)},canUndo:false};(function(){var L=/^([a]|[^a])+$/,M=/^\d*$/,N=/^\d*(?:\.\d+)?$/;a.VALIDATE_OR=1;a.VALIDATE_AND=2;a.dialog.validate={functions:function(){return function(){var U=this;var O=U&&U.getValue?U.getValue():arguments[0],P=undefined,Q=2,R=[],S;for(S=0;S<arguments.length;S++){if(typeof arguments[S]=="function"){R.push(arguments[S])}else{break}}if(S<arguments.length&&typeof arguments[S]=="string"){P=arguments[S];S++}if(S<arguments.length&&typeof arguments[S]=="number"){Q=arguments[S]}var T=Q==2?true:false;for(S=0;S<R.length;S++){if(Q==2){T=T&&R[S](O)}else{T=T||R[S](O)}}if(!T){if(P!==undefined){alert(P)}if(U&&(U.select||U.focus)){U.select||U.focus()}return false}return true}},regex:function(O,P){return function(){var R=this;var Q=R&&R.getValue?R.getValue():arguments[0];if(!O.test(Q)){if(P!==undefined){alert(P)}if(R&&(R.select||R.focus)){if(R.select){R.select()}else{R.focus()}}return false}return true}},notEmpty:function(O){return this.regex(L,O)},integer:function(O){return this.regex(M,O)},number:function(O){return this.regex(N,O)},equals:function(O,P){return this.functions(function(Q){return Q==O},P)},notEqual:function(O,P){return this.functions(function(Q){return Q!=O},P)}}})();a.skins.add=(function(){var L=a.skins.add;return function(M,N){o[M]={margins:N.margins};return L.apply(this,arguments)}})()})();e.extend(a.editor.prototype,{openDialog:function(l){var m=a.dialog._.dialogDefinitions[l];if(typeof m=="function"){var n=this._.storedDialogs||(this._.storedDialogs={}),o=n[l]||(n[l]=new a.dialog(this,l));o.show();return o}else{if(m=="failed"){throw new Error('[CKEDITOR.dialog.openDialog] Dialog "'+l+'" failed when loading definition.')}}var p=a.document.getBody(),q=p.$.style.cursor,r=this;p.setStyle("cursor","wait");a.scriptLoader.load(a.getUrl(m),function(){if(typeof a.dialog._.dialogDefinitions[l]!="function"){a.dialog._.dialogDefinitions[l]="failed"}r.openDialog(l);p.setStyle("cursor",q)});return null}});(function(){var l=function(n,o){return n._.modes&&n._.modes[o||n.mode]},m;j.add("editingblock",{init:function(n){if(!n.config.editingBlock){return }n.on("themeSpace",function(o){if(o.data.space=="contents"){o.data.html+="<br>"}});n.on("themeLoaded",function(){n.fireOnce("editingBlockReady")});n.on("uiReady",function(){n.setMode(n.config.startupMode)});n.on("afterSetData",function(){if(!m){function o(){m=true;l(n).loadData(n.getData());m=false}if(n.mode){o()}else{n.on("mode",function(){o();n.removeListener("mode",arguments.callee)})}}});n.on("beforeGetData",function(){if(!m&&n.mode){m=true;n.setData(l(n).getData());m=false}});n.on("getSnapshot",function(o){if(n.mode){o.data=l(n).getSnapshotData()}});n.on("loadSnapshot",function(o){if(n.mode){l(n).loadSnapshotData(o.data)}});n.on("mode",function(o){o.removeListener();var p=n.container;if(b.webkit&&b.version<528){var q=n.config.tabIndex||n.element.getAttribute("tabindex")||0;p=p.append(h.createFromHtml('<input tabindex="'+q+'" style="position:absolute; left:-10000">'))}p.on("focus",function(){n.focus()});if(n.config.startupFocus){n.focus()}setTimeout(function(){n.fireOnce("instanceReady");a.fire("instanceReady",null,n)})})}});a.editor.prototype.mode="";a.editor.prototype.addMode=function(n,o){o.name=n;(this._.modes||(this._.modes={}))[n]=o};a.editor.prototype.setMode=function(n){var o,p=this.getThemeSpace("contents"),q=this.checkDirty();if(this.mode){if(n==this.mode){return }this.fire("beforeModeUnload");var r=l(this);o=r.getData();r.unload(p);this.mode=""}p.setHtml("");var s=l(this,n);if(!s){throw'[CKEDITOR.editor.setMode] Unknown mode "'+n+'".'}if(!q){this.on("mode",function(){this.resetDirty();this.removeListener("mode",arguments.callee)})}s.load(p,typeof o!="string"?this.getData():o)};a.editor.prototype.focus=function(){var n=l(this);if(n){n.focus()}}})();i.startupMode="wysiwyg";i.startupFocus=false;i.editingBlock=true;j.add("panel",{beforeInit:function(l){l.ui.addHandler(2,k.panel.handler)}});a.UI_PANEL=2;k.panel=function(l,m){var n=this;if(m){e.extend(n,m)}e.extend(n,{className:"",css:[]});n.id=e.getNextNumber();n.document=l;n._={blocks:{}}};k.panel.handler={create:function(l){return new k.panel(l)}};k.panel.prototype={renderHtml:function(l){var m=[];this.render(l,m);return m.join("")},render:function(l,m){var o=this;var n="cke_"+o.id;m.push('<div class="',l.skinClass,'" lang="',l.langCode,'" style="display:none;z-index:'+(l.config.baseFloatZIndex+1)+'"><div id=',n," dir=",l.lang.dir,' class="cke_panel cke_',l.lang.dir);if(o.className){m.push(" ",o.className)}m.push('">');if(o.forceIFrame||o.css.length){m.push('<iframe id="',n,'_frame" frameborder="0" src="javascript:void(');m.push(b.isCustomDomain()?"(function(){document.open();document.domain='"+document.domain+"';document.close();})()":"0");m.push(')"></iframe>')}m.push("</div></div>");return n},getHolderElement:function(){var l=this._.holder;if(!l){if(this.forceIFrame||this.css.length){var m=this.document.getById("cke_"+this.id+"_frame"),n=m.getParent(),o=n.getAttribute("dir"),p=n.getParent().getAttribute("class"),q=n.getParent().getAttribute("lang"),r=m.getFrameDocument();r.$.open();if(b.isCustomDomain()){r.$.domain=document.domain}var s=e.addFunction(e.bind(function(u){this.isLoaded=true;if(this.onLoad){this.onLoad()}},this));r.$.write('<!DOCTYPE html><html dir="'+o+'" class="'+p+'_container" lang="'+q+'"><head><style>.'+p+'_container{visibility:hidden}</style></head><body class="cke_'+o+" cke_panel_frame "+b.cssClass+'" style="margin:0;padding:0" onload="( window.CKEDITOR || window.parent.CKEDITOR ).tools.callFunction('+s+');"></body><link type="text/css" rel=stylesheet href="'+this.css.join('"><link type="text/css" rel="stylesheet" href="')+'"></html>');r.$.close();var t=r.getWindow();t.$.CKEDITOR=a;r.on("keydown",function(u){var w=this;var v=u.data.getKeystroke();if(w._.onKeyDown&&w._.onKeyDown(v)===false){u.data.preventDefault();return }if(v==27){w.onEscape&&w.onEscape()}},this);l=r.getBody()}else{l=this.document.getById("cke_"+this.id)}this._.holder=l}return l},addBlock:function(l,m){var n=this;m=n._.blocks[l]=m||new k.panel.block(n.getHolderElement());if(!n._.currentBlock){n.showBlock(l)}return m},getBlock:function(l){return this._.blocks[l]},showBlock:function(l){var p=this;var m=p._.blocks,n=m[l],o=p._.currentBlock;if(o){o.hide()}p._.currentBlock=n;n._.focusIndex=-1;p._.onKeyDown=n.onKeyDown&&e.bind(n.onKeyDown,n);n.show();return n}};k.panel.block=e.createClass({$:function(l){var m=this;m.element=l.append(l.getDocument().createElement("div",{attributes:{"class":"cke_panel_block"},styles:{display:"none"}}));m.keys={};m._.focusIndex=-1;m.element.disableContextMenu()},_:{},proto:{show:function(){this.element.setStyle("display","")},hide:function(){var l=this;if(!l.onHide||l.onHide.call(l)!==true){l.element.setStyle("display","none")}},onKeyDown:function(l){var q=this;var m=q.keys[l];switch(m){case"next":var n=q._.focusIndex,o=q.element.getElementsByTag("a"),p;while(p=o.getItem(++n)){if(p.getAttribute("_cke_focus")&&p.$.offsetWidth){q._.focusIndex=n;p.focus();break}}return false;case"prev":n=q._.focusIndex;o=q.element.getElementsByTag("a");while(n>0&&(p=o.getItem(--n))){if(p.getAttribute("_cke_focus")&&p.$.offsetWidth){q._.focusIndex=n;p.focus();break}}return false;case"click":n=q._.focusIndex;p=n>=0&&q.element.getElementsByTag("a").getItem(n);if(p){p.$.click?p.$.click():p.$.onclick()}return false}return true}}});j.add("listblock",{requires:["panel"],onLoad:function(){k.panel.prototype.addListBlock=function(l,m){return this.addBlock(l,new k.listBlock(this.getHolderElement(),m))};k.listBlock=e.createClass({base:k.panel.block,$:function(l,m){var o=this;o.base(l);o.multiSelect=!!m;var n=o.keys;n[40]="next";n[9]="next";n[38]="prev";n[2000+9]="prev";n[32]="click";o._.pendingHtml=[];o._.items={};o._.groups={}},_:{close:function(){if(this._.started){this._.pendingHtml.push("</ul>");delete this._.started}},getClick:function(){if(!this._.click){this._.click=e.addFunction(function(l){var n=this;var m=true;if(n.multiSelect){m=n.toggle(l)}else{n.mark(l)}if(n.onClick){n.onClick(l,m)}},this)}return this._.click}},proto:{add:function(l,m,n){var q=this;var o=q._.pendingHtml,p="cke_"+e.getNextNumber();if(!q._.started){o.push("<ul class=cke_panel_list>");q._.started=1}q._.items[l]=p;o.push("<li id=",p,' class=cke_panel_listItem><a _cke_focus=1 hidefocus=true title="',n||l,'" href="javascript:void(\'',l,'\')" onclick="CKEDITOR.tools.callFunction(',q._.getClick(),",'",l,"'); return false;\">",m||l,"</a></li>")},startGroup:function(l){this._.close();var m="cke_"+e.getNextNumber();this._.groups[l]=m;this._.pendingHtml.push("<h1 id=",m," class=cke_panel_grouptitle>",l,"</h1>")},commit:function(){var l=this;l._.close();l.element.appendHtml(l._.pendingHtml.join(""));l._.pendingHtml=[]},toggle:function(l){var m=this.isMarked(l);if(m){this.unmark(l)}else{this.mark(l)}return !m},hideGroup:function(l){var m=this.element.getDocument().getById(this._.groups[l]),n=m&&m.getNext();if(m){m.setStyle("display","none");if(n&&n.getName()=="ul"){n.setStyle("display","none")}}},hideItem:function(l){this.element.getDocument().getById(this._.items[l]).setStyle("display","none")},showAll:function(){var l=this._.items,m=this._.groups,n=this.element.getDocument();for(var o in l){n.getById(l[o]).setStyle("display","")}for(var p in m){var q=n.getById(m[p]),r=q.getNext();q.setStyle("display","");if(r&&r.getName()=="ul"){r.setStyle("display","")}}},mark:function(l){var m=this;if(!m.multiSelect){m.unmarkAll()}m.element.getDocument().getById(m._.items[l]).addClass("cke_selected")},unmark:function(l){this.element.getDocument().getById(this._.items[l]).removeClass("cke_selected")},unmarkAll:function(){var l=this._.items,m=this.element.getDocument();for(var n in l){m.getById(l[n]).removeClass("cke_selected")}},isMarked:function(l){return this.element.getDocument().getById(this._.items[l]).hasClass("cke_selected")},focus:function(l){this._.focusIndex=-1;if(l){var m=this.element.getDocument().getById(this._.items[l]).getFirst(),n=this.element.getElementsByTag("a"),o,p=-1;while(o=n.getItem(++p)){if(o.equals(m)){this._.focusIndex=p;break}}setTimeout(function(){m.focus()},0)}}}})}});j.add("dialogui");(function(){var l=function(s){var v=this;v._||(v._={});v._["default"]=v._.initValue=s["default"]||"";var t=[v._];for(var u=1;u<arguments.length;u++){t.push(arguments[u])}t.push(true);e.extend.apply(e,t);return v._},m={build:function(s,t,u){return new k.dialog.textInput(s,t,u)}},n={build:function(s,t,u){return new k.dialog[t.type](s,t,u)}},o={isChanged:function(){return this.getValue()!=this.getInitValue()},reset:function(){this.setValue(this.getInitValue())},setInitValue:function(){this._.initValue=this.getValue()},resetInitValue:function(){this._.initValue=this._["default"]},getInitValue:function(){return this._.initValue}},p=e.extend({},k.dialog.uiElement.prototype.eventProcessors,{onChange:function(s,t){if(!this._.domOnChangeRegistered){s.on("load",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})},this)},this);this._.domOnChangeRegistered=true}this.on("change",t)}},true),q=/^on([A-Z]\w+)/,r=function(s){for(var t in s){if(q.test(t)||t=="title"||t=="type"){delete s[t]}}return s};e.extend(k.dialog,{labeledElement:function(s,t,u,v){if(arguments.length<4){return }var w=l.call(this,t);w.labelId=e.getNextNumber()+"_label";var x=this._.children=[],y=function(){var z=[];if(t.labelLayout!="horizontal"){z.push('<div class="cke_dialog_ui_labeled_label" id="',w.labelId,'" >',t.label,"</div>",'<div class="cke_dialog_ui_labeled_content">',v(s,t),"</div>")}else{var A={type:"hbox",widths:t.widths,padding:0,children:[{type:"html",html:'<span class="cke_dialog_ui_labeled_label" id="'+w.labelId+'">'+e.htmlEncode(t.label)+"</span>"},{type:"html",html:'<span class="cke_dialog_ui_labeled_content">'+v(s,t)+"</span>"}]};a.dialog._.uiElementBuilders.hbox.build(s,A,z)}return z.join("")};k.dialog.uiElement.call(this,s,t,u,"div",null,null,y)},textInput:function(s,t,u){if(arguments.length<3){return }l.call(this,t);var v=this._.inputId=e.getNextNumber()+"_textInput",w={"class":"cke_dialog_ui_input_"+t.type,id:v,type:"text"},x;if(t.validate){this.validate=t.validate}if(t.maxLength){w.maxlength=t.maxLength}if(t.size){w.size=t.size}var y=this,z=false;s.on("load",function(){y.getInputElement().on("keydown",function(B){if(B.data.getKeystroke()==13){z=true}});y.getInputElement().on("keyup",function(B){if(B.data.getKeystroke()==13&&z){s.getButton("ok")&&s.getButton("ok").click();z=false}},null,null,1000)});var A=function(){var B=['<div class="cke_dialog_ui_input_',t.type,'"'];if(t.width){B.push('style="width:'+t.width+'" ')}B.push("><input ");for(var C in w){B.push(C+'="'+w[C]+'" ')}B.push(" /></div>");return B.join("")};k.dialog.labeledElement.call(this,s,t,u,A)},textarea:function(s,t,u){if(arguments.length<3){return }l.call(this,t);var v=this,w=this._.inputId=e.getNextNumber()+"_textarea",x={};if(t.validate){this.validate=t.validate}x.rows=t.rows||5;x.cols=t.cols||20;var y=function(){var z=['<div class="cke_dialog_ui_input_textarea"><textarea class="cke_dialog_ui_input_textarea" id="',w,'" '];for(var A in x){z.push(A+'="'+e.htmlEncode(x[A])+'" ')}z.push(">",e.htmlEncode(v._["default"]),"</textarea></div>");return z.join("")};k.dialog.labeledElement.call(this,s,t,u,y)},checkbox:function(s,t,u){if(arguments.length<3){return }var v=l.call(this,t,{"default":!!t["default"]});if(t.validate){this.validate=t.validate}var w=function(){var x=e.extend({},t,{id:t.id?t.id+"_checkbox":e.getNextNumber()+"_checkbox"},true),y=[],z={"class":"cke_dialog_ui_checkbox_input",type:"checkbox"};r(x);if(t["default"]){z.checked="checked"}v.checkbox=new k.dialog.uiElement(s,x,y,"input",null,z);y.push(' <label for="',z.id,'">',e.htmlEncode(t.label),"</label>");return y.join("")};k.dialog.uiElement.call(this,s,t,u,"span",null,null,w)},radio:function(s,t,u){if(arguments.length<3){return }l.call(this,t);if(!this._["default"]){this._["default"]=this._.initValue=t.items[0][1]}if(t.validate){this.validate=t.valdiate}var v=[],w=this,x=function(){var y=[],z=[],A={"class":"cke_dialog_ui_radio_item"},B=t.id?t.id+"_radio":e.getNextNumber()+"_radio";for(var C=0;C<t.items.length;C++){var D=t.items[C],E=D[2]!==undefined?D[2]:D[0],F=D[1]!==undefined?D[1]:D[0],G=e.extend({},t,{id:e.getNextNumber()+"_radio_input",title:null,type:null},true),H=e.extend({},G,{id:null,title:E},true),I={type:"radio","class":"cke_dialog_ui_radio_input",name:B,value:F},J=[];if(w._["default"]==F){I.checked="checked"}r(G);r(H);v.push(new k.dialog.uiElement(s,G,J,"input",null,I));J.push(" ");new k.dialog.uiElement(s,H,J,"label",null,{"for":I.id},D[0]);y.push(J.join(""))}new k.dialog.hbox(s,[],y,z);return z.join("")};k.dialog.labeledElement.call(this,s,t,u,x);this._.children=v},button:function(s,t,u){if(!arguments.length){return }if(typeof t=="function"){t=t(s.getParentEditor())}l.call(this,t,{disabled:t.disabled||false});a.event.implementOn(this);var v=this;s.on("load",function(x){var y=this.getElement();(function(){y.on("click",function(z){v.fire("click",{dialog:v.getDialog()});z.data.preventDefault()})})();y.unselectable()},this);var w=e.extend({},t);delete w.style;k.dialog.uiElement.call(this,s,w,u,"a",null,{style:t.style,href:"javascript:void(0)",title:t.label,hidefocus:"true","class":t["class"]},'<span class="cke_dialog_ui_button">'+e.htmlEncode(t.label)+"</span>")},select:function(s,t,u){if(arguments.length<3){return }var v=l.call(this,t);if(t.validate){this.validate=t.validate}var w=function(){var x=e.extend({},t,{id:t.id?t.id+"_select":e.getNextNumber()+"_select"},true),y=[],z=[],A={"class":"cke_dialog_ui_input_select"};if(t.size!=undefined){A.size=t.size}if(t.multiple!=undefined){A.multiple=t.multiple}r(x);for(var B=0,C;B<t.items.length&&(C=t.items[B]);B++){z.push('<option value="',e.htmlEncode(C[1]!==undefined?C[1]:C[0]),'" /> ',e.htmlEncode(C[0]))}v.select=new k.dialog.uiElement(s,x,y,"select",null,A,z.join(""));return y.join("")};k.dialog.labeledElement.call(this,s,t,u,w)},file:function(s,t,u){if(arguments.length<3){return }if(t["default"]===undefined){t["default"]=""}var v=e.extend(l.call(this,t),{definition:t,buttons:[]});if(t.validate){this.validate=t.validate}var w=function(){v.frameId=e.getNextNumber()+"_fileInput";var x=b.isCustomDomain(),y=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" id="',v.frameId,'" title="',t.label,'" src="javascript:void('];y.push(x?"(function(){document.open();document.domain='"+document.domain+"';document.close();})()":"0");y.push(')"></iframe>');return y.join("")};s.on("load",function(){var x=a.document.getById(v.frameId),y=x.getParent();y.addClass("cke_dialog_ui_input_file")});k.dialog.labeledElement.call(this,s,t,u,w)},fileButton:function(s,t,u){if(arguments.length<3){return }var v=l.call(this,t),w=this;if(t.validate){this.validate=t.validate}var x=e.extend({},t),y=x.onClick;x.className=(x.className?x.className+" ":"")+("cke_dialog_ui_button");x.onClick=function(z){var A=t["for"];if(!y||y.call(this,z)!==false){s.getContentElement(A[0],A[1]).submit();this.disable()}};s.on("load",function(){s.getContentElement(t["for"][0],t["for"][1])._.buttons.push(w)});k.dialog.button.call(this,s,x,u)},html:(function(){var s=/^\s*<[\w:]+\s+([^>]*)?>/,t=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,u=/\/$/;return function(v,w,x){if(arguments.length<3){return }var y=[],z,A=w.html,B,C;if(A.charAt(0)!="<"){A="<span>"+A+"</span>"}if(w.focus){var D=this.focus;this.focus=function(){D.call(this);w.focus.call(this);this.fire("focus")};if(w.isFocusable){var E=this.isFocusable;this.isFocusable=E}this.keyboardFocusable=true}k.dialog.uiElement.call(this,v,w,y,"span",null,null,"");z=y.join("");B=z.match(s);C=A.match(t)||["","",""];if(u.test(C[1])){C[1]=C[1].slice(0,-1);C[2]="/"+C[2]}x.push([C[1]," ",B[1]||"",C[2]].join(""))}})()},true);k.dialog.html.prototype=new k.dialog.uiElement();k.dialog.labeledElement.prototype=e.extend(new k.dialog.uiElement(),{setLabel:function(s){var t=a.document.getById(this._.labelId);if(t.getChildCount()<1){new d.text(s,a.document).appendTo(t)}else{t.getChild(0).$.nodeValue=s}return this},getLabel:function(){var s=a.document.getById(this._.labelId);if(!s||s.getChildCount()<1){return""}else{return s.getChild(0).getText()}},eventProcessors:p},true);k.dialog.button.prototype=e.extend(new k.dialog.uiElement(),{click:function(){var s=this;if(!s._.disabled){return s.fire("click",{dialog:s._.dialog})}s.getElement().$.blur();return false},enable:function(){this._.disabled=false;var s=this.getElement();s&&s.removeClass("disabled")},disable:function(){this._.disabled=true;this.getElement().addClass("disabled")},isVisible:function(){return !!this.getElement().$.firstChild.offsetHeight},isEnabled:function(){return !this._.disabled},eventProcessors:e.extend({},k.dialog.uiElement.prototype.eventProcessors,{onClick:function(s,t){this.on("click",t)}},true),accessKeyUp:function(){this.click()},accessKeyDown:function(){this.focus()},keyboardFocusable:true},true);k.dialog.textInput.prototype=e.extend(new k.dialog.labeledElement(),{getInputElement:function(){return a.document.getById(this._.inputId)},focus:function(){var s=this.selectParentTab();setTimeout(function(){var t=s.getInputElement();t&&t.$.focus()},0)},select:function(){var s=this.selectParentTab();setTimeout(function(){var t=s.getInputElement();if(t){t.$.focus();t.$.select()}},0)},accessKeyUp:function(){this.select()},setValue:function(s){s=s||"";return k.dialog.uiElement.prototype.setValue.call(this,s)},keyboardFocusable:true},o,true);k.dialog.textarea.prototype=new k.dialog.textInput();k.dialog.select.prototype=e.extend(new k.dialog.labeledElement(),{getInputElement:function(){return this._.select.getElement()},add:function(s,t,u){var v=new h("option",this.getDialog().getParentEditor().document),w=this.getInputElement().$;v.$.text=s;v.$.value=t===undefined||t===null?s:t;if(u===undefined||u===null){if(c){w.add(v.$)}else{w.add(v.$,null)}}else{w.add(v.$,u)}return this},remove:function(s){var t=this.getInputElement().$;t.remove(s);return this},clear:function(){var s=this.getInputElement().$;while(s.length>0){s.remove(0)}return this},keyboardFocusable:true},o,true);k.dialog.checkbox.prototype=e.extend(new k.dialog.uiElement(),{getInputElement:function(){return this._.checkbox.getElement()},setValue:function(s){this.getInputElement().$.checked=s;this.fire("change",{value:s})},getValue:function(){return this.getInputElement().$.checked},accessKeyUp:function(){this.setValue(!this.getValue())},eventProcessors:{onChange:function(s,t){if(!c){return p.onChange.apply(this,arguments)}else{s.on("load",function(){var u=this._.checkbox.getElement();u.on("propertychange",function(v){v=v.data.$;if(v.propertyName=="checked"){this.fire("change",{value:u.$.checked})}},this)},this);this.on("change",t)}return null}},keyboardFocusable:true},o,true);k.dialog.radio.prototype=e.extend(new k.dialog.uiElement(),{setValue:function(s){var t=this._.children,u;for(var v=0;v<t.length&&(u=t[v]);v++){u.getElement().$.checked=u.getValue()==s}this.fire("change",{value:s})},getValue:function(){var s=this._.children;for(var t=0;t<s.length;t++){if(s[t].getElement().$.checked){return s[t].getValue()}}return null},accessKeyUp:function(){var s=this._.children,t;for(t=0;t<s.length;t++){if(s[t].getElement().$.checked){s[t].getElement().focus();return }}s[0].getElement().focus()},eventProcessors:{onChange:function(s,t){if(!c){return p.onChange.apply(this,arguments)}else{s.on("load",function(){var u=this._.children,v=this;for(var w=0;w<u.length;w++){var x=u[w].getElement();x.on("propertychange",function(y){y=y.data.$;if(y.propertyName=="checked"&&this.$.checked){v.fire("change",{value:this.getAttribute("value")})}})}},this);this.on("change",t)}return null}},keyboardFocusable:true},o,true);k.dialog.file.prototype=e.extend(new k.dialog.labeledElement(),o,{getInputElement:function(){var s=a.document.getById(this._.frameId).getFrameDocument();return s.$.forms.length>0?new h(s.$.forms[0].elements[0]):this.getElement()},submit:function(){this.getInputElement().getParent().$.submit();return this},getAction:function(s){return this.getInputElement().getParent().$.action},reset:function(){var s=a.document.getById(this._.frameId),t=s.getFrameDocument(),u=this._.definition,v=this._.buttons;function w(){t.$.open();if(b.isCustomDomain()){t.$.domain=document.domain}var x="";if(u.size){x=u.size-(c?7:0)}t.$.write(['<html><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" action="',e.htmlEncode(u.action),'">','<input type="file" name="',e.htmlEncode(u.id||"cke_upload"),'" size="',e.htmlEncode(x>0?x:""),'" />',"</form>","</body></html>"].join(""));t.$.close();for(var y=0;y<v.length;y++){v[y].enable()}}if(b.gecko){setTimeout(w,500)}else{w()}},getValue:function(){return""},eventProcessors:p,keyboardFocusable:true},true);k.dialog.fileButton.prototype=new k.dialog.button();a.dialog.addUIElement("text",m);a.dialog.addUIElement("password",m);a.dialog.addUIElement("textarea",n);a.dialog.addUIElement("checkbox",n);a.dialog.addUIElement("radio",n);a.dialog.addUIElement("button",n);a.dialog.addUIElement("select",n);a.dialog.addUIElement("file",n);a.dialog.addUIElement("fileButton",n);a.dialog.addUIElement("html",n)})();a.skins.add("kama",(function(){var l=[];if(c&&b.version<7){l.push("icons.png","images/sprites_ie6.png","images/dialog_sides.gif")}return{preload:l,editor:{css:["editor.css"]},dialog:{css:["dialog.css"]},templates:{css:["templates.css"]},margins:[0,0,0,0],init:function(m){if(m.config.width&&!isNaN(m.config.width)){m.config.width-=12}var n=[],o=/\$color/g,p="/* UI Color Support */.cke_skin_kama .cke_menuitem .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a:active .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover .cke_label,.cke_skin_kama .cke_menuitem a:focus .cke_label,.cke_skin_kama .cke_menuitem a:active .cke_label{\tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_label,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_label{\tbackground-color: transparent !important;}.cke_skin_kama .cke_menuitem a.cke_disabled:hover .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:focus .cke_icon_wrapper,.cke_skin_kama .cke_menuitem a.cke_disabled:active .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuitem a.cke_disabled .cke_icon_wrapper{\tbackground-color: $color !important;\tborder-color: $color !important;}.cke_skin_kama .cke_menuseparator{\tbackground-color: $color !important;}.cke_skin_kama .cke_menuitem a:hover,.cke_skin_kama .cke_menuitem a:focus,.cke_skin_kama .cke_menuitem a:active{\tbackground-color: $color !important;}";if(b.webkit){p=p.split("}").slice(0,-1);for(var q=0;q<p.length;q++){p[q]=p[q].split("{")}}function r(u){var v=u.getHead().append("style");v.setAttribute("id","cke_ui_color");v.setAttribute("type","text/css");return v}function s(u,v,w){var x,y,z;for(var A=0;A<u.length;A++){if(b.webkit){for(y=0;y<u[A].$.sheet.rules.length;y++){u[A].$.sheet.removeRule(y)}for(y=0;y<v.length;y++){z=v[y][1];for(x=0;x<w.length;x++){z=z.replace(w[x][0],w[x][1])}u[A].$.sheet.addRule(v[y][0],z)}}else{z=v;for(x=0;x<w.length;x++){z=z.replace(w[x][0],w[x][1])}if(c){u[A].$.styleSheet.cssText=z}else{u[A].setHtml(z)}}}}var t=/\$color/g;e.extend(m,{uiColor:null,getUiColor:function(){return this.uiColor},setUiColor:function(u){var v,w=r(a.document),x="#cke_"+m.name.replace(".","\\."),y=[x+" .cke_wrapper",x+"_dialog .cke_dialog_contents",x+"_dialog a.cke_dialog_tab",x+"_dialog .cke_dialog_footer"].join(","),z="background-color: $color !important;";if(b.webkit){v=[[y,z]]}else{v=y+"{"+z+"}"}return(this.setUiColor=function(A){var B=[[t,A]];m.uiColor=A;s([w],v,B);s(n,p,B)})(u)}});m.on("menuShow",function(u){var v=u.data[0],w=v.element.getElementsByTag("iframe").getItem(0).getFrameDocument();if(!w.getById("cke_ui_color")){var x=r(w);n.push(x);var y=m.getUiColor();if(y){s([x],p,[[t,y]])}}});if(m.config.uiColor){m.setUiColor(m.config.uiColor)}}}})());if(a.dialog){a.dialog.on("resize",function(l){var m=l.data,n=m.width,o=m.height,p=m.dialog,q=p.parts.contents,r=!b.quirks;if(m.skin!="kama"){return }q.setStyles(c||b.gecko&&b.version<10900?{width:n+"px",height:o+"px"}:{"min-width":n+"px","min-height":o+"px"});if(!c){return }setTimeout(function(){var s=q.getParent(),t=s.getParent(),u=t.getChild(2);u.setStyle("width",s.$.offsetWidth+"px");u=t.getChild(7);u.setStyle("width",s.$.offsetWidth-28+"px");u=t.getChild(4);u.setStyle("height",s.$.offsetHeight-31-14+"px");u=t.getChild(5);u.setStyle("height",s.$.offsetHeight-31-14+"px")},100)})}a.themes.add("default",(function(){return{build:function(l,m){var n=l.name,o=l.element,p=l.elementMode;if(!o||p==0){return }if(p==1){o.hide()}var q=l.fire("themeSpace",{space:"top",html:""}).html,r=l.fire("themeSpace",{space:"contents",html:""}).html,s=l.fireOnce("themeSpace",{space:"bottom",html:""}).html,t=r&&l.config.height,u=l.config.tabIndex||l.element.getAttribute("tabindex")||0;if(!r){t="auto"}else{if(!isNaN(t)){t+="px"}}var v="",w=l.config.width;if(w){if(!isNaN(w)){w+="px"}v+="width: "+w+";"}var x=h.createFromHtml(['<span id="cke_',n,'" onmousedown="return false;" class="',l.skinClass,'" dir="',l.lang.dir,'" title="',b.gecko?" ":"",'" lang="',l.langCode,'" tabindex="'+u+'"'+(v?' style="'+v+'"':"")+'><span class="',b.cssClass,'"><span class="cke_wrapper cke_',l.lang.dir,'"><table class="cke_editor" border="0" cellspacing="0" cellpadding="0"><tbody><tr',q?"":' style="display:none"','><td id="cke_top_',n,'" class="cke_top">',q,"</td></tr><tr",r?"":' style="display:none"','><td id="cke_contents_',n,'" class="cke_contents" style="height:',t,'">',r,"</td></tr><tr",s?"":' style="display:none"','><td id="cke_bottom_',n,'" class="cke_bottom">',s,"</td></tr></tbody></table><style>.",l.skinClass,"{visibility:hidden;}</style></span></span></span>"].join(""));x.getChild([0,0,0,0,0]).unselectable();x.getChild([0,0,0,0,2]).unselectable();if(p==1){x.insertAfter(o)}else{o.append(x)}l.container=x;x.disableContextMenu();l.fireOnce("themeLoaded");l.fireOnce("uiReady")},buildDialog:function(l){var m=e.getNextNumber(),n=h.createFromHtml(['<div id="cke_'+l.name.replace(".","\\.")+'_dialog" class="cke_skin_',l.skinName,'" dir="',l.lang.dir,'" lang="',l.langCode,'"><div class="cke_dialog'," "+b.cssClass," cke_",l.lang.dir,'" style="position:absolute"><div class="%body"><div id="%title#" class="%title"></div><div id="%close_button#" class="%close_button"><span>X</span></div><div id="%tabs#" class="%tabs"></div><div id="%contents#" class="%contents"></div><div id="%footer#" class="%footer"></div></div><div id="%tl#" class="%tl"></div><div id="%tc#" class="%tc"></div><div id="%tr#" class="%tr"></div><div id="%ml#" class="%ml"></div><div id="%mr#" class="%mr"></div><div id="%bl#" class="%bl"></div><div id="%bc#" class="%bc"></div><div id="%br#" class="%br"></div></div>',c?"":"<style>.cke_dialog{visibility:hidden;}</style>","</div>"].join("").replace(/#/g,"_"+m).replace(/%/g,"cke_dialog_")),o=n.getChild([0,0]);o.getChild(0).unselectable();o.getChild(1).unselectable();return{element:n,parts:{dialog:n.getChild(0),title:o.getChild(0),close:o.getChild(1),tabs:o.getChild(2),contents:o.getChild(3),footer:o.getChild(4)}}},destroy:function(l){var m=l.container,n=l.panels;if(c){m.setStyle("display","none");var o=document.body.createTextRange();o.moveToElementText(m.$);try{o.select()}catch(q){}}if(m){m.remove()}for(var p=0;n&&p<n.length;p++){n[p].remove()}if(l.elementMode==1){l.element.show();delete l.element}}}})());a.editor.prototype.getThemeSpace=function(l){var m="cke_"+l,n=this._[m]||(this._[m]=a.document.getById(m+"_"+this.name));return n};a.editor.prototype.resize=function(l,m,n,o){var p=/^\d+$/;if(p.test(l)){l+="px"}var q=a.document.getById("cke_contents_"+this.name),r=o?q.getAscendant("table").getParent():q.getAscendant("table").getParent().getParent().getParent();b.webkit&&r.setStyle("display","none");r.setStyle("width",l);if(b.webkit){r.$.offsetWidth;r.setStyle("display","")}var s=n?0:(r.$.offsetHeight||0)-(q.$.clientHeight||0);q.setStyle("height",Math.max(m-s,0)+"px");this.fire("resize")};a.editor.prototype.getResizable=function(){return this.container.getChild([0,0])}})();
