var Prototype={Version:"1.7",Browser:(function(){var b=navigator.userAgent;var a=Object.prototype.toString.call(window.opera)=="[object Opera]";return{IE:!!window.attachEvent&&!a,Opera:a,WebKit:b.indexOf("AppleWebKit/")>-1,Gecko:b.indexOf("Gecko")>-1&&b.indexOf("KHTML")===-1,MobileSafari:/Apple.*Mobile/.test(b)}
})(),BrowserFeatures:{XPath:!!document.evaluate,SelectorsAPI:!!document.querySelector,ElementExtensions:(function(){var a=window.Element||window.HTMLElement;return !!(a&&a.prototype)})(),SpecificElementExtensions:(function(){if(typeof window.HTMLDivElement!=="undefined"){return true
}var c=document.createElement("div"),b=document.createElement("form"),a=false;if(c.__proto__&&(c.__proto__!==b.__proto__)){a=true}c=b=null;return a})()},ScriptFragment:"<script[^>]*>([\\S\\s]*?)<\/script>",JSONFilter:/^\/\*-secure-([\s\S]*)\*\/\s*$/,emptyFunction:function(){},K:function(a){return a
}};if(Prototype.Browser.MobileSafari){Prototype.BrowserFeatures.SpecificElementExtensions=false}var Abstract={};var Try={these:function(){var c;for(var b=0,d=arguments.length;b<d;b++){var a=arguments[b];
try{c=a();break}catch(f){}}return c}};var Class=(function(){var d=(function(){for(var f in {toString:1}){if(f==="toString"){return false}}return true})();function a(){}function b(){var j=null,h=$A(arguments);
if(Object.isFunction(h[0])){j=h.shift()}function f(){this.initialize.apply(this,arguments)}Object.extend(f,Class.Methods);f.superclass=j;f.subclasses=[];if(j){a.prototype=j.prototype;f.prototype=new a;
j.subclasses.push(f)}for(var g=0,k=h.length;g<k;g++){f.addMethods(h[g])}if(!f.prototype.initialize){f.prototype.initialize=Prototype.emptyFunction}f.prototype.constructor=f;return f}function c(m){var h=this.superclass&&this.superclass.prototype,g=Object.keys(m);
if(d){if(m.toString!=Object.prototype.toString){g.push("toString")}if(m.valueOf!=Object.prototype.valueOf){g.push("valueOf")}}for(var f=0,j=g.length;f<j;f++){var l=g[f],k=m[l];if(h&&Object.isFunction(k)&&k.argumentNames()[0]=="$super"){var n=k;
k=(function(i){return function(){return h[i].apply(this,arguments)}})(l).wrap(n);k.valueOf=n.valueOf.bind(n);k.toString=n.toString.bind(n)}this.prototype[l]=k}return this}return{create:b,Methods:{addMethods:c}}
})();(function(){var H=Object.prototype.toString,G="Null",q="Undefined",A="Boolean",g="Number",u="String",M="Object",w="[object Function]",D="[object Boolean]",h="[object Number]",m="[object String]",i="[object Array]",C="[object Date]",j=window.JSON&&typeof JSON.stringify==="function"&&JSON.stringify(0)==="0"&&typeof JSON.stringify(Prototype.K)==="undefined";
function l(O){switch(O){case null:return G;case (void 0):return q}var N=typeof O;switch(N){case"boolean":return A;case"number":return g;case"string":return u}return M}function E(N,P){for(var O in P){N[O]=P[O]
}return N}function L(N){try{if(c(N)){return"undefined"}if(N===null){return"null"}return N.inspect?N.inspect():String(N)}catch(O){if(O instanceof RangeError){return"..."}throw O}}function I(N){return K("",{"":N},[])
}function K(W,T,U){var V=T[W],S=typeof V;if(l(V)===M&&typeof V.toJSON==="function"){V=V.toJSON(W)}var P=H.call(V);switch(P){case h:case D:case m:V=V.valueOf()}switch(V){case null:return"null";case true:return"true";
case false:return"false"}S=typeof V;switch(S){case"string":return V.inspect(true);case"number":return isFinite(V)?String(V):"null";case"object":for(var O=0,N=U.length;O<N;O++){if(U[O]===V){throw new TypeError()
}}U.push(V);var R=[];if(P===i){for(var O=0,N=V.length;O<N;O++){var Q=K(O,V,U);R.push(typeof Q==="undefined"?"null":Q)}R="["+R.join(",")+"]"}else{var X=Object.keys(V);for(var O=0,N=X.length;O<N;O++){var W=X[O],Q=K(W,V,U);
if(typeof Q!=="undefined"){R.push(W.inspect(true)+":"+Q)}}R="{"+R.join(",")+"}"}U.pop();return R}}function B(N){return JSON.stringify(N)}function k(N){return $H(N).toQueryString()}function r(N){return N&&N.toHTML?N.toHTML():String.interpret(N)
}function t(N){if(l(N)!==M){throw new TypeError()}var O=[];for(var P in N){if(N.hasOwnProperty(P)){O.push(P)}}return O}function d(N){var O=[];for(var P in N){O.push(N[P])}return O}function F(N){return E({},N)
}function z(N){return !!(N&&N.nodeType==1)}function n(N){return H.call(N)===i}var b=(typeof Array.isArray=="function")&&Array.isArray([])&&!Array.isArray({});if(b){n=Array.isArray}function f(N){return N instanceof Hash
}function a(N){return H.call(N)===w}function p(N){return H.call(N)===m}function s(N){return H.call(N)===h}function J(N){return H.call(N)===C}function c(N){return typeof N==="undefined"}E(Object,{extend:E,inspect:L,toJSON:j?B:I,toQueryString:k,toHTML:r,keys:Object.keys||t,values:d,clone:F,isElement:z,isArray:n,isHash:f,isFunction:a,isString:p,isNumber:s,isDate:J,isUndefined:c})
})();Object.extend(Function.prototype,(function(){var l=Array.prototype.slice;function d(q,m){var p=q.length,n=m.length;while(n--){q[p+n]=m[n]}return q}function j(n,m){n=l.call(n,0);return d(n,m)}function h(){var m=this.toString().match(/^[\s\(]*function[^(]*\(([^)]*)\)/)[1].replace(/\/\/.*?[\r\n]|\/\*(?:.|[\r\n])*?\*\//g,"").replace(/\s+/g,"").split(",");
return m.length==1&&!m[0]?[]:m}function i(p){if(arguments.length<2&&Object.isUndefined(arguments[0])){return this}var m=this,n=l.call(arguments,1);return function(){var q=j(n,arguments);return m.apply(p,q)
}}function g(p){var m=this,n=l.call(arguments,1);return function(r){var q=d([r||window.event],n);return m.apply(p,q)}}function k(){if(!arguments.length){return this}var m=this,n=l.call(arguments,0);return function(){var p=j(n,arguments);
return m.apply(this,p)}}function f(p){var m=this,n=l.call(arguments,1);p=p*1000;return window.setTimeout(function(){return m.apply(m,n)},p)}function a(){var m=d([0.01],arguments);return this.delay.apply(this,m)
}function c(n){var m=this;return function(){var p=d([m.bind(this)],arguments);return n.apply(this,p)}}function b(){if(this._methodized){return this._methodized}var m=this;return this._methodized=function(){var n=d([this],arguments);
return m.apply(null,n)}}return{argumentNames:h,bind:i,bindAsEventListener:g,curry:k,delay:f,defer:a,wrap:c,methodize:b}})());(function(c){function b(){return this.getUTCFullYear()+"-"+(this.getUTCMonth()+1).toPaddedString(2)+"-"+this.getUTCDate().toPaddedString(2)+"T"+this.getUTCHours().toPaddedString(2)+":"+this.getUTCMinutes().toPaddedString(2)+":"+this.getUTCSeconds().toPaddedString(2)+"Z"
}function a(){return this.toISOString()}if(!c.toISOString){c.toISOString=b}if(!c.toJSON){c.toJSON=a}})(Date.prototype);RegExp.prototype.match=RegExp.prototype.test;RegExp.escape=function(a){return String(a).replace(/([.*+?^=!:${}()|[\]\/\\])/g,"\\$1")
};var PeriodicalExecuter=Class.create({initialize:function(b,a){this.callback=b;this.frequency=a;this.currentlyExecuting=false;this.registerCallback()},registerCallback:function(){this.timer=setInterval(this.onTimerEvent.bind(this),this.frequency*1000)
},execute:function(){this.callback(this)},stop:function(){if(!this.timer){return}clearInterval(this.timer);this.timer=null},onTimerEvent:function(){if(!this.currentlyExecuting){try{this.currentlyExecuting=true;
this.execute();this.currentlyExecuting=false}catch(a){this.currentlyExecuting=false;throw a}}}});Object.extend(String,{interpret:function(a){return a==null?"":String(a)},specialChar:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\\":"\\\\"}});
Object.extend(String.prototype,(function(){var NATIVE_JSON_PARSE_SUPPORT=window.JSON&&typeof JSON.parse==="function"&&JSON.parse('{"test": true}').test;function prepareReplacement(replacement){if(Object.isFunction(replacement)){return replacement
}var template=new Template(replacement);return function(match){return template.evaluate(match)}}function gsub(pattern,replacement){var result="",source=this,match;replacement=prepareReplacement(replacement);
if(Object.isString(pattern)){pattern=RegExp.escape(pattern)}if(!(pattern.length||pattern.source)){replacement=replacement("");return replacement+source.split("").join(replacement)+replacement}while(source.length>0){if(match=source.match(pattern)){result+=source.slice(0,match.index);
result+=String.interpret(replacement(match));source=source.slice(match.index+match[0].length)}else{result+=source,source=""}}return result}function sub(pattern,replacement,count){replacement=prepareReplacement(replacement);
count=Object.isUndefined(count)?1:count;return this.gsub(pattern,function(match){if(--count<0){return match[0]}return replacement(match)})}function scan(pattern,iterator){this.gsub(pattern,iterator);return String(this)
}function truncate(length,truncation){length=length||30;truncation=Object.isUndefined(truncation)?"...":truncation;return this.length>length?this.slice(0,length-truncation.length)+truncation:String(this)
}function strip(){return this.replace(/^\s+/,"").replace(/\s+$/,"")}function stripTags(){return this.replace(/<\w+(\s+("[^"]*"|'[^']*'|[^>])+)?>|<\/\w+>/gi,"")}function stripScripts(){return this.replace(new RegExp(Prototype.ScriptFragment,"img"),"")
}function extractScripts(){var matchAll=new RegExp(Prototype.ScriptFragment,"img"),matchOne=new RegExp(Prototype.ScriptFragment,"im");return(this.match(matchAll)||[]).map(function(scriptTag){return(scriptTag.match(matchOne)||["",""])[1]
})}function evalScripts(){return this.extractScripts().map(function(script){return eval(script)})}function escapeHTML(){return this.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function unescapeHTML(){return this.stripTags().replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&amp;/g,"&")
}function toQueryParams(separator){var match=this.strip().match(/([^?#]*)(#.*)?$/);if(!match){return{}}return match[1].split(separator||"&").inject({},function(hash,pair){if((pair=pair.split("="))[0]){var key=decodeURIComponent(pair.shift()),value=pair.length>1?pair.join("="):pair[0];
if(value!=undefined){value=decodeURIComponent(value)}if(key in hash){if(!Object.isArray(hash[key])){hash[key]=[hash[key]]}hash[key].push(value)}else{hash[key]=value}}return hash})}function toArray(){return this.split("")
}function succ(){return this.slice(0,this.length-1)+String.fromCharCode(this.charCodeAt(this.length-1)+1)}function times(count){return count<1?"":new Array(count+1).join(this)}function camelize(){return this.replace(/-+(.)?/g,function(match,chr){return chr?chr.toUpperCase():""
})}function capitalize(){return this.charAt(0).toUpperCase()+this.substring(1).toLowerCase()}function underscore(){return this.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/-/g,"_").toLowerCase()
}function dasherize(){return this.replace(/_/g,"-")}function inspect(useDoubleQuotes){var escapedString=this.replace(/[\x00-\x1f\\]/g,function(character){if(character in String.specialChar){return String.specialChar[character]
}return"\\u00"+character.charCodeAt().toPaddedString(2,16)});if(useDoubleQuotes){return'"'+escapedString.replace(/"/g,'\\"')+'"'}return"'"+escapedString.replace(/'/g,"\\'")+"'"}function unfilterJSON(filter){return this.replace(filter||Prototype.JSONFilter,"$1")
}function isJSON(){var str=this;if(str.blank()){return false}str=str.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@");str=str.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]");
str=str.replace(/(?:^|:|,)(?:\s*\[)+/g,"");return(/^[\],:{}\s]*$/).test(str)}function evalJSON(sanitize){var json=this.unfilterJSON(),cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
if(cx.test(json)){json=json.replace(cx,function(a){return"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})}try{if(!sanitize||json.isJSON()){return eval("("+json+")")}}catch(e){}throw new SyntaxError("Badly formed JSON string: "+this.inspect())
}function parseJSON(){var json=this.unfilterJSON();return JSON.parse(json)}function include(pattern){return this.indexOf(pattern)>-1}function startsWith(pattern){return this.lastIndexOf(pattern,0)===0}function endsWith(pattern){var d=this.length-pattern.length;
return d>=0&&this.indexOf(pattern,d)===d}function empty(){return this==""}function blank(){return/^\s*$/.test(this)}function interpolate(object,pattern){return new Template(this,pattern).evaluate(object)
}return{gsub:gsub,sub:sub,scan:scan,truncate:truncate,strip:String.prototype.trim||strip,stripTags:stripTags,stripScripts:stripScripts,extractScripts:extractScripts,evalScripts:evalScripts,escapeHTML:escapeHTML,unescapeHTML:unescapeHTML,toQueryParams:toQueryParams,parseQuery:toQueryParams,toArray:toArray,succ:succ,times:times,camelize:camelize,capitalize:capitalize,underscore:underscore,dasherize:dasherize,inspect:inspect,unfilterJSON:unfilterJSON,isJSON:isJSON,evalJSON:NATIVE_JSON_PARSE_SUPPORT?parseJSON:evalJSON,include:include,startsWith:startsWith,endsWith:endsWith,empty:empty,blank:blank,interpolate:interpolate}
})());var Template=Class.create({initialize:function(a,b){this.template=a.toString();this.pattern=b||Template.Pattern},evaluate:function(a){if(a&&Object.isFunction(a.toTemplateReplacements)){a=a.toTemplateReplacements()
}return this.template.gsub(this.pattern,function(d){if(a==null){return(d[1]+"")}var g=d[1]||"";if(g=="\\"){return d[2]}var b=a,h=d[3],f=/^([^.[]+|\[((?:.*?[^\\])?)\])(\.|\[|$)/;d=f.exec(h);if(d==null){return g
}while(d!=null){var c=d[1].startsWith("[")?d[2].replace(/\\\\]/g,"]"):d[1];b=b[c];if(null==b||""==d[3]){break}h=h.substring("["==d[3]?d[1].length:d[0].length);d=f.exec(h)}return g+String.interpret(b)})
}});Template.Pattern=/(^|.|\r|\n)(#\{(.*?)\})/;var $break={};var Enumerable=(function(){function c(D,C){var B=0;try{this._each(function(F){D.call(C,F,B++)})}catch(E){if(E!=$break){throw E}}return this}function t(E,D,C){var B=-E,F=[],G=this.toArray();
if(E<1){return G}while((B+=E)<G.length){F.push(G.slice(B,B+E))}return F.collect(D,C)}function b(D,C){D=D||Prototype.K;var B=true;this.each(function(F,E){B=B&&!!D.call(C,F,E);if(!B){throw $break}});return B
}function j(D,C){D=D||Prototype.K;var B=false;this.each(function(F,E){if(B=!!D.call(C,F,E)){throw $break}});return B}function k(D,C){D=D||Prototype.K;var B=[];this.each(function(F,E){B.push(D.call(C,F,E))
});return B}function w(D,C){var B;this.each(function(F,E){if(D.call(C,F,E)){B=F;throw $break}});return B}function i(D,C){var B=[];this.each(function(F,E){if(D.call(C,F,E)){B.push(F)}});return B}function h(E,D,C){D=D||Prototype.K;
var B=[];if(Object.isString(E)){E=new RegExp(RegExp.escape(E))}this.each(function(G,F){if(E.match(G)){B.push(D.call(C,G,F))}});return B}function a(B){if(Object.isFunction(this.indexOf)){if(this.indexOf(B)!=-1){return true
}}var C=false;this.each(function(D){if(D==B){C=true;throw $break}});return C}function s(C,B){B=Object.isUndefined(B)?null:B;return this.eachSlice(C,function(D){while(D.length<C){D.push(B)}return D})}function m(B,D,C){this.each(function(F,E){B=D.call(C,B,F,E)
});return B}function A(C){var B=$A(arguments).slice(1);return this.map(function(D){return D[C].apply(D,B)})}function r(D,C){D=D||Prototype.K;var B;this.each(function(F,E){F=D.call(C,F,E);if(B==null||F>=B){B=F
}});return B}function p(D,C){D=D||Prototype.K;var B;this.each(function(F,E){F=D.call(C,F,E);if(B==null||F<B){B=F}});return B}function f(E,C){E=E||Prototype.K;var D=[],B=[];this.each(function(G,F){(E.call(C,G,F)?D:B).push(G)
});return[D,B]}function g(C){var B=[];this.each(function(D){B.push(D[C])});return B}function d(D,C){var B=[];this.each(function(F,E){if(!D.call(C,F,E)){B.push(F)}});return B}function n(C,B){return this.map(function(E,D){return{value:E,criteria:C.call(B,E,D)}
}).sort(function(G,F){var E=G.criteria,D=F.criteria;return E<D?-1:E>D?1:0}).pluck("value")}function q(){return this.map()}function u(){var C=Prototype.K,B=$A(arguments);if(Object.isFunction(B.last())){C=B.pop()
}var D=[this].concat(B).map($A);return this.map(function(F,E){return C(D.pluck(E))})}function l(){return this.toArray().length}function z(){return"#<Enumerable:"+this.toArray().inspect()+">"}return{each:c,eachSlice:t,all:b,every:b,any:j,some:j,collect:k,map:k,detect:w,findAll:i,select:i,filter:i,grep:h,include:a,member:a,inGroupsOf:s,inject:m,invoke:A,max:r,min:p,partition:f,pluck:g,reject:d,sortBy:n,toArray:q,entries:q,zip:u,size:l,inspect:z,find:w}
})();function $A(c){if(!c){return[]}if("toArray" in Object(c)){return c.toArray()}var b=c.length||0,a=new Array(b);while(b--){a[b]=c[b]}return a}function $w(a){if(!Object.isString(a)){return[]}a=a.strip();
return a?a.split(/\s+/):[]}Array.from=$A;(function(){var t=Array.prototype,n=t.slice,q=t.forEach;function b(B,A){for(var z=0,C=this.length>>>0;z<C;z++){if(z in this){B.call(A,this[z],z,this)}}}if(!q){q=b
}function m(){this.length=0;return this}function d(){return this[0]}function h(){return this[this.length-1]}function j(){return this.select(function(z){return z!=null})}function w(){return this.inject([],function(A,z){if(Object.isArray(z)){return A.concat(z.flatten())
}A.push(z);return A})}function i(){var z=n.call(arguments,0);return this.select(function(A){return !z.include(A)})}function g(z){return(z===false?this.toArray():this)._reverse()}function l(z){return this.inject([],function(C,B,A){if(0==A||(z?C.last()!=B:!C.include(B))){C.push(B)
}return C})}function r(z){return this.uniq().findAll(function(A){return z.detect(function(B){return A===B})})}function s(){return n.call(this,0)}function k(){return this.length}function u(){return"["+this.map(Object.inspect).join(", ")+"]"
}function a(B,z){z||(z=0);var A=this.length;if(z<0){z=A+z}for(;z<A;z++){if(this[z]===B){return z}}return -1}function p(A,z){z=isNaN(z)?this.length:(z<0?this.length+z:z)+1;var B=this.slice(0,z).reverse().indexOf(A);
return(B<0)?B:z-B-1}function c(){var E=n.call(this,0),C;for(var A=0,B=arguments.length;A<B;A++){C=arguments[A];if(Object.isArray(C)&&!("callee" in C)){for(var z=0,D=C.length;z<D;z++){E.push(C[z])}}else{E.push(C)
}}return E}Object.extend(t,Enumerable);if(!t._reverse){t._reverse=t.reverse}Object.extend(t,{_each:q,clear:m,first:d,last:h,compact:j,flatten:w,without:i,reverse:g,uniq:l,intersect:r,clone:s,toArray:s,size:k,inspect:u});
var f=(function(){return[].concat(arguments)[0][0]!==1})(1,2);if(f){t.concat=c}if(!t.indexOf){t.indexOf=a}if(!t.lastIndexOf){t.lastIndexOf=p}})();function $H(a){return new Hash(a)}var Hash=Class.create(Enumerable,(function(){function f(r){this._object=Object.isHash(r)?r.toObject():Object.clone(r)
}function g(s){for(var r in this._object){var t=this._object[r],u=[r,t];u.key=r;u.value=t;s(u)}}function k(r,s){return this._object[r]=s}function c(r){if(this._object[r]!==Object.prototype[r]){return this._object[r]
}}function n(r){var s=this._object[r];delete this._object[r];return s}function q(){return Object.clone(this._object)}function p(){return this.pluck("key")}function m(){return this.pluck("value")}function h(s){var r=this.detect(function(t){return t.value===s
});return r&&r.key}function j(r){return this.clone().update(r)}function d(r){return new Hash(r).inject(this,function(s,t){s.set(t.key,t.value);return s})}function b(r,s){if(Object.isUndefined(s)){return r
}return r+"="+encodeURIComponent(String.interpret(s))}function a(){return this.inject([],function(w,B){var u=encodeURIComponent(B.key),s=B.value;if(s&&typeof s=="object"){if(Object.isArray(s)){var A=[];
for(var t=0,r=s.length,z;t<r;t++){z=s[t];A.push(b(u,z))}return w.concat(A)}}else{w.push(b(u,s))}return w}).join("&")}function l(){return"#<Hash:{"+this.map(function(r){return r.map(Object.inspect).join(": ")
}).join(", ")+"}>"}function i(){return new Hash(this)}return{initialize:f,_each:g,set:k,get:c,unset:n,toObject:q,toTemplateReplacements:q,keys:p,values:m,index:h,merge:j,update:d,toQueryString:a,inspect:l,toJSON:q,clone:i}
})());Hash.from=$H;Object.extend(Number.prototype,(function(){function d(){return this.toPaddedString(2,16)}function b(){return this+1}function i(k,j){$R(0,this,true).each(k,j);return this}function h(l,k){var j=this.toString(k||10);
return"0".times(l-j.length)+j}function a(){return Math.abs(this)}function c(){return Math.round(this)}function f(){return Math.ceil(this)}function g(){return Math.floor(this)}return{toColorPart:d,succ:b,times:i,toPaddedString:h,abs:a,round:c,ceil:f,floor:g}
})());function $R(c,a,b){return new ObjectRange(c,a,b)}var ObjectRange=Class.create(Enumerable,(function(){function b(g,d,f){this.start=g;this.end=d;this.exclusive=f}function c(d){var f=this.start;while(this.include(f)){d(f);
f=f.succ()}}function a(d){if(d<this.start){return false}if(this.exclusive){return d<this.end}return d<=this.end}return{initialize:b,_each:c,include:a}})());var Ajax={getTransport:function(){return Try.these(function(){return new XMLHttpRequest()
},function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})||false},activeRequestCount:0};Ajax.Responders={responders:[],_each:function(a){this.responders._each(a)
},register:function(a){if(!this.include(a)){this.responders.push(a)}},unregister:function(a){this.responders=this.responders.without(a)},dispatch:function(d,b,c,a){this.each(function(f){if(Object.isFunction(f[d])){try{f[d].apply(f,[b,c,a])
}catch(g){}}})}};Object.extend(Ajax.Responders,Enumerable);Ajax.Responders.register({onCreate:function(){Ajax.activeRequestCount++},onComplete:function(){Ajax.activeRequestCount--}});Ajax.Base=Class.create({initialize:function(a){this.options={method:"post",asynchronous:true,contentType:"application/x-www-form-urlencoded",encoding:"UTF-8",parameters:"",evalJSON:true,evalJS:true};
Object.extend(this.options,a||{});this.options.method=this.options.method.toLowerCase();if(Object.isHash(this.options.parameters)){this.options.parameters=this.options.parameters.toObject()}}});Ajax.Request=Class.create(Ajax.Base,{_complete:false,initialize:function($super,b,a){$super(a);
this.transport=Ajax.getTransport();this.request(b)},request:function(b){this.url=b;this.method=this.options.method;var d=Object.isString(this.options.parameters)?this.options.parameters:Object.toQueryString(this.options.parameters);
if(!["get","post"].include(this.method)){d+=(d?"&":"")+"_method="+this.method;this.method="post"}if(d&&this.method==="get"){this.url+=(this.url.include("?")?"&":"?")+d}this.parameters=d.toQueryParams();
try{var a=new Ajax.Response(this);if(this.options.onCreate){this.options.onCreate(a)}Ajax.Responders.dispatch("onCreate",this,a);this.transport.open(this.method.toUpperCase(),this.url,this.options.asynchronous);
if(this.options.asynchronous){this.respondToReadyState.bind(this).defer(1)}this.transport.onreadystatechange=this.onStateChange.bind(this);this.setRequestHeaders();this.body=this.method=="post"?(this.options.postBody||d):null;
this.transport.send(this.body);if(!this.options.asynchronous&&this.transport.overrideMimeType){this.onStateChange()}}catch(c){this.dispatchException(c)}},onStateChange:function(){var a=this.transport.readyState;
if(a>1&&!((a==4)&&this._complete)){this.respondToReadyState(this.transport.readyState)}},setRequestHeaders:function(){var f={"X-Requested-With":"XMLHttpRequest","X-Prototype-Version":Prototype.Version,Accept:"text/javascript, text/html, application/xml, text/xml, */*"};
if(this.method=="post"){f["Content-type"]=this.options.contentType+(this.options.encoding?"; charset="+this.options.encoding:"");if(this.transport.overrideMimeType&&(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]<2005){f.Connection="close"
}}if(typeof this.options.requestHeaders=="object"){var c=this.options.requestHeaders;if(Object.isFunction(c.push)){for(var b=0,d=c.length;b<d;b+=2){f[c[b]]=c[b+1]}}else{$H(c).each(function(g){f[g.key]=g.value
})}}for(var a in f){this.transport.setRequestHeader(a,f[a])}},success:function(){var a=this.getStatus();return !a||(a>=200&&a<300)||a==304},getStatus:function(){try{if(this.transport.status===1223){return 204
}return this.transport.status||0}catch(a){return 0}},respondToReadyState:function(a){var c=Ajax.Request.Events[a],b=new Ajax.Response(this);if(c=="Complete"){try{this._complete=true;(this.options["on"+b.status]||this.options["on"+(this.success()?"Success":"Failure")]||Prototype.emptyFunction)(b,b.headerJSON)
}catch(d){this.dispatchException(d)}var f=b.getHeader("Content-type");if(this.options.evalJS=="force"||(this.options.evalJS&&this.isSameOrigin()&&f&&f.match(/^\s*(text|application)\/(x-)?(java|ecma)script(;.*)?\s*$/i))){this.evalResponse()
}}try{(this.options["on"+c]||Prototype.emptyFunction)(b,b.headerJSON);Ajax.Responders.dispatch("on"+c,this,b,b.headerJSON)}catch(d){this.dispatchException(d)}if(c=="Complete"){this.transport.onreadystatechange=Prototype.emptyFunction
}},isSameOrigin:function(){var a=this.url.match(/^\s*https?:\/\/[^\/]*/);return !a||(a[0]=="#{protocol}//#{domain}#{port}".interpolate({protocol:location.protocol,domain:document.domain,port:location.port?":"+location.port:""}))
},getHeader:function(a){try{return this.transport.getResponseHeader(a)||null}catch(b){return null}},evalResponse:function(){try{return eval((this.transport.responseText||"").unfilterJSON())}catch(e){this.dispatchException(e)
}},dispatchException:function(a){(this.options.onException||Prototype.emptyFunction)(this,a);Ajax.Responders.dispatch("onException",this,a)}});Ajax.Request.Events=["Uninitialized","Loading","Loaded","Interactive","Complete"];
Ajax.Response=Class.create({initialize:function(c){this.request=c;var d=this.transport=c.transport,a=this.readyState=d.readyState;if((a>2&&!Prototype.Browser.IE)||a==4){this.status=this.getStatus();this.statusText=this.getStatusText();
this.responseText=String.interpret(d.responseText);this.headerJSON=this._getHeaderJSON()}if(a==4){var b=d.responseXML;this.responseXML=Object.isUndefined(b)?null:b;this.responseJSON=this._getResponseJSON()
}},status:0,statusText:"",getStatus:Ajax.Request.prototype.getStatus,getStatusText:function(){try{return this.transport.statusText||""}catch(a){return""}},getHeader:Ajax.Request.prototype.getHeader,getAllHeaders:function(){try{return this.getAllResponseHeaders()
}catch(a){return null}},getResponseHeader:function(a){return this.transport.getResponseHeader(a)},getAllResponseHeaders:function(){return this.transport.getAllResponseHeaders()},_getHeaderJSON:function(){var a=this.getHeader("X-JSON");
if(!a){return null}a=decodeURIComponent(escape(a));try{return a.evalJSON(this.request.options.sanitizeJSON||!this.request.isSameOrigin())}catch(b){this.request.dispatchException(b)}},_getResponseJSON:function(){var a=this.request.options;
if(!a.evalJSON||(a.evalJSON!="force"&&!(this.getHeader("Content-type")||"").include("application/json"))||this.responseText.blank()){return null}try{return this.responseText.evalJSON(a.sanitizeJSON||!this.request.isSameOrigin())
}catch(b){this.request.dispatchException(b)}}});Ajax.Updater=Class.create(Ajax.Request,{initialize:function($super,a,c,b){this.container={success:(a.success||a),failure:(a.failure||(a.success?null:a))};
b=Object.clone(b);var d=b.onComplete;b.onComplete=(function(f,g){this.updateContent(f.responseText);if(Object.isFunction(d)){d(f,g)}}).bind(this);$super(c,b)},updateContent:function(d){var c=this.container[this.success()?"success":"failure"],a=this.options;
if(!a.evalScripts){d=d.stripScripts()}if(c=protoByID(c)){if(a.insertion){if(Object.isString(a.insertion)){var b={};b[a.insertion]=d;c.insert(b)}else{a.insertion(c,d)}}else{c.update(d)}}}});Ajax.PeriodicalUpdater=Class.create(Ajax.Base,{initialize:function($super,a,c,b){$super(b);
this.onComplete=this.options.onComplete;this.frequency=(this.options.frequency||2);this.decay=(this.options.decay||1);this.updater={};this.container=a;this.url=c;this.start()},start:function(){this.options.onComplete=this.updateComplete.bind(this);
this.onTimerEvent()},stop:function(){this.updater.options.onComplete=undefined;clearTimeout(this.timer);(this.onComplete||Prototype.emptyFunction).apply(this,arguments)},updateComplete:function(a){if(this.options.decay){this.decay=(a.responseText==this.lastText?this.decay*this.options.decay:1);
this.lastText=a.responseText}this.timer=this.onTimerEvent.bind(this).delay(this.decay*this.frequency)},onTimerEvent:function(){this.updater=new Ajax.Updater(this.container,this.url,this.options)}});function protoByID(b){if(arguments.length>1){for(var a=0,d=[],c=arguments.length;
a<c;a++){d.push(protoByID(arguments[a]))}return d}if(Object.isString(b)){b=document.getElementById(b)}return Element.extend(b)}if(Prototype.BrowserFeatures.XPath){document._getElementsByXPath=function(g,a){var c=[];
var f=document.evaluate(g,protoByID(a)||document,null,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE,null);for(var b=0,d=f.snapshotLength;b<d;b++){c.push(Element.extend(f.snapshotItem(b)))}return c}}if(!Node){var Node={}
}if(!Node.ELEMENT_NODE){Object.extend(Node,{ELEMENT_NODE:1,ATTRIBUTE_NODE:2,TEXT_NODE:3,CDATA_SECTION_NODE:4,ENTITY_REFERENCE_NODE:5,ENTITY_NODE:6,PROCESSING_INSTRUCTION_NODE:7,COMMENT_NODE:8,DOCUMENT_NODE:9,DOCUMENT_TYPE_NODE:10,DOCUMENT_FRAGMENT_NODE:11,NOTATION_NODE:12})
}(function(c){function d(g,f){if(g==="select"){return false}if("type" in f){return false}return true}var b=(function(){try{var f=document.createElement('<input name="x">');return f.tagName.toLowerCase()==="input"&&f.name==="x"
}catch(g){return false}})();var a=c.Element;c.Element=function(h,g){g=g||{};h=h.toLowerCase();var f=Element.cache;if(b&&g.name){h="<"+h+' name="'+g.name+'">';delete g.name;return Element.writeAttribute(document.createElement(h),g)
}if(!f[h]){f[h]=Element.extend(document.createElement(h))}var i=d(h,g)?f[h].cloneNode(false):document.createElement(h);return Element.writeAttribute(i,g)};Object.extend(c.Element,a||{});if(a){c.Element.prototype=a.prototype
}})(this);Element.idCounter=1;Element.cache={};Element._purgeElement=function(b){var a=b._prototypeUID;if(a){Element.stopObserving(b);b._prototypeUID=void 0;delete Element.Storage[a]}};Element.Methods={visible:function(a){return protoByID(a).style.display!="none"
},toggle:function(a){a=protoByID(a);Element[Element.visible(a)?"hide":"show"](a);return a},hide:function(a){a=protoByID(a);a.style.display="none";return a},show:function(a){a=protoByID(a);a.style.display="";
return a},remove:function(a){a=protoByID(a);a.parentNode.removeChild(a);return a},update:(function(){var d=(function(){var h=document.createElement("select"),i=true;h.innerHTML='<option value="test">test</option>';
if(h.options&&h.options[0]){i=h.options[0].nodeName.toUpperCase()!=="OPTION"}h=null;return i})();var b=(function(){try{var h=document.createElement("table");if(h&&h.tBodies){h.innerHTML="<tbody><tr><td>test</td></tr></tbody>";
var j=typeof h.tBodies[0]=="undefined";h=null;return j}}catch(i){return true}})();var a=(function(){try{var h=document.createElement("div");h.innerHTML="<link>";var j=(h.childNodes.length===0);h=null;return j
}catch(i){return true}})();var c=d||b||a;var g=(function(){var h=document.createElement("script"),j=false;try{h.appendChild(document.createTextNode(""));j=!h.firstChild||h.firstChild&&h.firstChild.nodeType!==3
}catch(i){j=true}h=null;return j})();function f(m,n){m=protoByID(m);var h=Element._purgeElement;var p=m.getElementsByTagName("*"),l=p.length;while(l--){h(p[l])}if(n&&n.toElement){n=n.toElement()}if(Object.isElement(n)){return m.update().insert(n)
}n=Object.toHTML(n);var k=m.tagName.toUpperCase();if(k==="SCRIPT"&&g){m.text=n;return m}if(c){if(k in Element._insertionTranslations.tags){while(m.firstChild){m.removeChild(m.firstChild)}Element._getContentFromAnonymousElement(k,n.stripScripts()).each(function(i){m.appendChild(i)
})}else{if(a&&Object.isString(n)&&n.indexOf("<link")>-1){while(m.firstChild){m.removeChild(m.firstChild)}var j=Element._getContentFromAnonymousElement(k,n.stripScripts(),true);j.each(function(i){m.appendChild(i)
})}else{m.innerHTML=n.stripScripts()}}}else{m.innerHTML=n.stripScripts()}n.evalScripts.bind(n).defer();return m}return f})(),replace:function(b,c){b=protoByID(b);if(c&&c.toElement){c=c.toElement()}else{if(!Object.isElement(c)){c=Object.toHTML(c);
var a=b.ownerDocument.createRange();a.selectNode(b);c.evalScripts.bind(c).defer();c=a.createContextualFragment(c.stripScripts())}}b.parentNode.replaceChild(c,b);return b},insert:function(c,f){c=protoByID(c);
if(Object.isString(f)||Object.isNumber(f)||Object.isElement(f)||(f&&(f.toElement||f.toHTML))){f={bottom:f}}var d,g,b,h;for(var a in f){d=f[a];a=a.toLowerCase();g=Element._insertionTranslations[a];if(d&&d.toElement){d=d.toElement()
}if(Object.isElement(d)){g(c,d);continue}d=Object.toHTML(d);b=((a=="before"||a=="after")?c.parentNode:c).tagName.toUpperCase();h=Element._getContentFromAnonymousElement(b,d.stripScripts());if(a=="top"||a=="after"){h.reverse()
}h.each(g.curry(c));d.evalScripts.bind(d).defer()}return c},wrap:function(b,c,a){b=protoByID(b);if(Object.isElement(c)){protoByID(c).writeAttribute(a||{})}else{if(Object.isString(c)){c=new Element(c,a)
}else{c=new Element("div",c)}}if(b.parentNode){b.parentNode.replaceChild(c,b)}c.appendChild(b);return c},inspect:function(b){b=protoByID(b);var a="<"+b.tagName.toLowerCase();$H({id:"id",className:"class"}).each(function(g){var f=g.first(),c=g.last(),d=(b[f]||"").toString();
if(d){a+=" "+c+"="+d.inspect(true)}});return a+">"},recursivelyCollect:function(a,c,d){a=protoByID(a);d=d||-1;var b=[];while(a=a[c]){if(a.nodeType==1){b.push(Element.extend(a))}if(b.length==d){break}}return b
},ancestors:function(a){return Element.recursivelyCollect(a,"parentNode")},descendants:function(a){return Element.select(a,"*")},firstDescendant:function(a){a=protoByID(a).firstChild;while(a&&a.nodeType!=1){a=a.nextSibling
}return protoByID(a)},immediateDescendants:function(b){var a=[],c=protoByID(b).firstChild;while(c){if(c.nodeType===1){a.push(Element.extend(c))}c=c.nextSibling}return a},previousSiblings:function(a,b){return Element.recursivelyCollect(a,"previousSibling")
},nextSiblings:function(a){return Element.recursivelyCollect(a,"nextSibling")},siblings:function(a){a=protoByID(a);return Element.previousSiblings(a).reverse().concat(Element.nextSiblings(a))},match:function(b,a){b=protoByID(b);
if(Object.isString(a)){return Prototype.Selector.match(b,a)}return a.match(b)},up:function(b,d,a){b=protoByID(b);if(arguments.length==1){return protoByID(b.parentNode)}var c=Element.ancestors(b);return Object.isNumber(d)?c[d]:Prototype.Selector.find(c,d,a)
},down:function(b,c,a){b=protoByID(b);if(arguments.length==1){return Element.firstDescendant(b)}return Object.isNumber(c)?Element.descendants(b)[c]:Element.select(b,c)[a||0]},previous:function(b,c,a){b=protoByID(b);
if(Object.isNumber(c)){a=c,c=false}if(!Object.isNumber(a)){a=0}if(c){return Prototype.Selector.find(b.previousSiblings(),c,a)}else{return b.recursivelyCollect("previousSibling",a+1)[a]}},next:function(b,d,a){b=protoByID(b);
if(Object.isNumber(d)){a=d,d=false}if(!Object.isNumber(a)){a=0}if(d){return Prototype.Selector.find(b.nextSiblings(),d,a)}else{var c=Object.isNumber(a)?a+1:1;return b.recursivelyCollect("nextSibling",a+1)[a]
}},select:function(a){a=protoByID(a);var b=Array.prototype.slice.call(arguments,1).join(", ");return Prototype.Selector.select(b,a)},adjacent:function(a){a=protoByID(a);var b=Array.prototype.slice.call(arguments,1).join(", ");
return Prototype.Selector.select(b,a.parentNode).without(a)},identify:function(a){a=protoByID(a);var b=Element.readAttribute(a,"id");if(b){return b}do{b="anonymous_element_"+Element.idCounter++}while(protoByID(b));
Element.writeAttribute(a,"id",b);return b},readAttribute:function(c,a){c=protoByID(c);if(Prototype.Browser.IE){var b=Element._attributeTranslations.read;if(b.values[a]){return b.values[a](c,a)}if(b.names[a]){a=b.names[a]
}if(a.include(":")){return(!c.attributes||!c.attributes[a])?null:c.attributes[a].value}}return c.getAttribute(a)},writeAttribute:function(f,c,g){f=protoByID(f);var b={},d=Element._attributeTranslations.write;
if(typeof c=="object"){b=c}else{b[c]=Object.isUndefined(g)?true:g}for(var a in b){c=d.names[a]||a;g=b[a];if(d.values[a]){c=d.values[a](f,g)}if(g===false||g===null){f.removeAttribute(c)}else{if(g===true){f.setAttribute(c,c)
}else{f.setAttribute(c,g)}}}return f},getHeight:function(a){return Element.getDimensions(a).height},getWidth:function(a){return Element.getDimensions(a).width},classNames:function(a){return new Element.ClassNames(a)
},hasClassName:function(a,b){if(!(a=protoByID(a))){return}var c=a.className;return(c.length>0&&(c==b||new RegExp("(^|\\s)"+b+"(\\s|$)").test(c)))},addClassName:function(a,b){if(!(a=protoByID(a))){return
}if(!Element.hasClassName(a,b)){a.className+=(a.className?" ":"")+b}return a},removeClassName:function(a,b){if(!(a=protoByID(a))){return}a.className=a.className.replace(new RegExp("(^|\\s+)"+b+"(\\s+|$)")," ").strip();
return a},toggleClassName:function(a,b){if(!(a=protoByID(a))){return}return Element[Element.hasClassName(a,b)?"removeClassName":"addClassName"](a,b)},cleanWhitespace:function(b){b=protoByID(b);var c=b.firstChild;
while(c){var a=c.nextSibling;if(c.nodeType==3&&!/\S/.test(c.nodeValue)){b.removeChild(c)}c=a}return b},empty:function(a){return protoByID(a).innerHTML.blank()},descendantOf:function(b,a){b=protoByID(b),a=protoByID(a);
if(b.compareDocumentPosition){return(b.compareDocumentPosition(a)&8)===8}if(a.contains){return a.contains(b)&&a!==b}while(b=b.parentNode){if(b==a){return true}}return false},scrollTo:function(a){a=protoByID(a);
var b=Element.cumulativeOffset(a);window.scrollTo(b[0],b[1]);return a},getStyle:function(b,c){b=protoByID(b);c=c=="float"?"cssFloat":c.camelize();var d=b.style[c];if(!d||d=="auto"){var a=document.defaultView.getComputedStyle(b,null);
d=a?a[c]:null}if(c=="opacity"){return d?parseFloat(d):1}return d=="auto"?null:d},getOpacity:function(a){return protoByID(a).getStyle("opacity")},setStyle:function(b,c){b=protoByID(b);var f=b.style,a;if(Object.isString(c)){b.style.cssText+=";"+c;
return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var d in c){if(d=="opacity"){b.setOpacity(c[d])}else{f[(d=="float"||d=="cssFloat")?(Object.isUndefined(f.styleFloat)?"cssFloat":"styleFloat"):d]=c[d]
}}return b},setOpacity:function(a,b){a=protoByID(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;return a},makePositioned:function(a){a=protoByID(a);var b=Element.getStyle(a,"position");if(b=="static"||!b){a._madePositioned=true;
a.style.position="relative";if(Prototype.Browser.Opera){a.style.top=0;a.style.left=0}}return a},undoPositioned:function(a){a=protoByID(a);if(a._madePositioned){a._madePositioned=undefined;a.style.position=a.style.top=a.style.left=a.style.bottom=a.style.right=""
}return a},makeClipping:function(a){a=protoByID(a);if(a._overflow){return a}a._overflow=Element.getStyle(a,"overflow")||"auto";if(a._overflow!=="hidden"){a.style.overflow="hidden"}return a},undoClipping:function(a){a=protoByID(a);
if(!a._overflow){return a}a.style.overflow=a._overflow=="auto"?"":a._overflow;a._overflow=null;return a},clonePosition:function(b,d){var a=Object.extend({setLeft:true,setTop:true,setWidth:true,setHeight:true,offsetTop:0,offsetLeft:0},arguments[2]||{});
d=protoByID(d);var f=Element.viewportOffset(d),g=[0,0],c=null;b=protoByID(b);if(Element.getStyle(b,"position")=="absolute"){c=Element.getOffsetParent(b);g=Element.viewportOffset(c)}if(c==document.body){g[0]-=document.body.offsetLeft;
g[1]-=document.body.offsetTop}if(a.setLeft){b.style.left=(f[0]-g[0]+a.offsetLeft)+"px"}if(a.setTop){b.style.top=(f[1]-g[1]+a.offsetTop)+"px"}if(a.setWidth){b.style.width=d.offsetWidth+"px"}if(a.setHeight){b.style.height=d.offsetHeight+"px"
}return b}};Object.extend(Element.Methods,{getElementsBySelector:Element.Methods.select,childElements:Element.Methods.immediateDescendants});Element._attributeTranslations={write:{names:{className:"class",htmlFor:"for"},values:{}}};
if(Prototype.Browser.Opera){Element.Methods.getStyle=Element.Methods.getStyle.wrap(function(d,b,c){switch(c){case"height":case"width":if(!Element.visible(b)){return null}var f=parseInt(d(b,c),10);if(f!==b["offset"+c.capitalize()]){return f+"px"
}var a;if(c==="height"){a=["border-top-width","padding-top","padding-bottom","border-bottom-width"]}else{a=["border-left-width","padding-left","padding-right","border-right-width"]}return a.inject(f,function(g,h){var i=d(b,h);
return i===null?g:g-parseInt(i,10)})+"px";default:return d(b,c)}});Element.Methods.readAttribute=Element.Methods.readAttribute.wrap(function(c,a,b){if(b==="title"){return a.title}return c(a,b)})}else{if(Prototype.Browser.IE){Element.Methods.getStyle=function(a,b){a=protoByID(a);
b=(b=="float"||b=="cssFloat")?"styleFloat":b.camelize();var c=a.style[b];if(!c&&a.currentStyle){c=a.currentStyle[b]}if(b=="opacity"){if(c=(a.getStyle("filter")||"").match(/alpha\(opacity=(.*)\)/)){if(c[1]){return parseFloat(c[1])/100
}}return 1}if(c=="auto"){if((b=="width"||b=="height")&&(a.getStyle("display")!="none")){return a["offset"+b.capitalize()]+"px"}return null}return c};Element.Methods.setOpacity=function(b,f){function g(h){return h.replace(/alpha\([^\)]*\)/gi,"")
}b=protoByID(b);var a=b.currentStyle;if((a&&!a.hasLayout)||(!a&&b.style.zoom=="normal")){b.style.zoom=1}var d=b.getStyle("filter"),c=b.style;if(f==1||f===""){(d=g(d))?c.filter=d:c.removeAttribute("filter");
return b}else{if(f<0.00001){f=0}}c.filter=g(d)+"alpha(opacity="+(f*100)+")";return b};Element._attributeTranslations=(function(){var b="className",a="for",c=document.createElement("div");c.setAttribute(b,"x");
if(c.className!=="x"){c.setAttribute("class","x");if(c.className==="x"){b="class"}}c=null;c=document.createElement("label");c.setAttribute(a,"x");if(c.htmlFor!=="x"){c.setAttribute("htmlFor","x");if(c.htmlFor==="x"){a="htmlFor"
}}c=null;return{read:{names:{"class":b,className:b,"for":a,htmlFor:a},values:{_getAttr:function(d,f){return d.getAttribute(f)},_getAttr2:function(d,f){return d.getAttribute(f,2)},_getAttrNode:function(d,g){var f=d.getAttributeNode(g);
return f?f.value:""},_getEv:(function(){var d=document.createElement("div"),h;d.onclick=Prototype.emptyFunction;var g=d.getAttribute("onclick");if(String(g).indexOf("{")>-1){h=function(f,i){i=f.getAttribute(i);
if(!i){return null}i=i.toString();i=i.split("{")[1];i=i.split("}")[0];return i.strip()}}else{if(g===""){h=function(f,i){i=f.getAttribute(i);if(!i){return null}return i.strip()}}}d=null;return h})(),_flag:function(d,f){return protoByID(d).hasAttribute(f)?f:null
},style:function(d){return d.style.cssText.toLowerCase()},title:function(d){return d.title}}}}})();Element._attributeTranslations.write={names:Object.extend({cellpadding:"cellPadding",cellspacing:"cellSpacing"},Element._attributeTranslations.read.names),values:{checked:function(a,b){a.checked=!!b
},style:function(a,b){a.style.cssText=b?b:""}}};Element._attributeTranslations.has={};$w("colSpan rowSpan vAlign dateTime accessKey tabIndex encType maxLength readOnly longDesc frameBorder").each(function(a){Element._attributeTranslations.write.names[a.toLowerCase()]=a;
Element._attributeTranslations.has[a.toLowerCase()]=a});(function(a){Object.extend(a,{href:a._getAttr2,src:a._getAttr2,type:a._getAttr,action:a._getAttrNode,disabled:a._flag,checked:a._flag,readonly:a._flag,multiple:a._flag,onload:a._getEv,onunload:a._getEv,onclick:a._getEv,ondblclick:a._getEv,onmousedown:a._getEv,onmouseup:a._getEv,onmouseover:a._getEv,onmousemove:a._getEv,onmouseout:a._getEv,onfocus:a._getEv,onblur:a._getEv,onkeypress:a._getEv,onkeydown:a._getEv,onkeyup:a._getEv,onsubmit:a._getEv,onreset:a._getEv,onselect:a._getEv,onchange:a._getEv})
})(Element._attributeTranslations.read.values);if(Prototype.BrowserFeatures.ElementExtensions){(function(){function a(f){var b=f.getElementsByTagName("*"),d=[];for(var c=0,g;g=b[c];c++){if(g.tagName!=="!"){d.push(g)
}}return d}Element.Methods.down=function(c,d,b){c=protoByID(c);if(arguments.length==1){return c.firstDescendant()}return Object.isNumber(d)?a(c)[d]:Element.select(c,d)[b||0]}})()}}else{if(Prototype.Browser.Gecko&&/rv:1\.8\.0/.test(navigator.userAgent)){Element.Methods.setOpacity=function(a,b){a=protoByID(a);
a.style.opacity=(b==1)?0.999999:(b==="")?"":(b<0.00001)?0:b;return a}}else{if(Prototype.Browser.WebKit){Element.Methods.setOpacity=function(a,b){a=protoByID(a);a.style.opacity=(b==1||b==="")?"":(b<0.00001)?0:b;
if(b==1){if(a.tagName.toUpperCase()=="IMG"&&a.width){a.width++;a.width--}else{try{var d=document.createTextNode(" ");a.appendChild(d);a.removeChild(d)}catch(c){}}}return a}}}}}if("outerHTML" in document.documentElement){Element.Methods.replace=function(c,f){c=protoByID(c);
if(f&&f.toElement){f=f.toElement()}if(Object.isElement(f)){c.parentNode.replaceChild(f,c);return c}f=Object.toHTML(f);var d=c.parentNode,b=d.tagName.toUpperCase();if(Element._insertionTranslations.tags[b]){var g=c.next(),a=Element._getContentFromAnonymousElement(b,f.stripScripts());
d.removeChild(c);if(g){a.each(function(h){d.insertBefore(h,g)})}else{a.each(function(h){d.appendChild(h)})}}else{c.outerHTML=f.stripScripts()}f.evalScripts.bind(f).defer();return c}}Element._returnOffset=function(b,c){var a=[b,c];
a.left=b;a.top=c;return a};Element._getContentFromAnonymousElement=function(f,d,g){var h=new Element("div"),c=Element._insertionTranslations.tags[f];var a=false;if(c){a=true}else{if(g){a=true;c=["","",0]
}}if(a){h.innerHTML="&nbsp;"+c[0]+d+c[1];h.removeChild(h.firstChild);for(var b=c[2];b--;){h=h.firstChild}}else{h.innerHTML=d}return $A(h.childNodes)};Element._insertionTranslations={before:function(a,b){a.parentNode.insertBefore(b,a)
},top:function(a,b){a.insertBefore(b,a.firstChild)},bottom:function(a,b){a.appendChild(b)},after:function(a,b){a.parentNode.insertBefore(b,a.nextSibling)},tags:{TABLE:["<table>","</table>",1],TBODY:["<table><tbody>","</tbody></table>",2],TR:["<table><tbody><tr>","</tr></tbody></table>",3],TD:["<table><tbody><tr><td>","</td></tr></tbody></table>",4],SELECT:["<select>","</select>",1]}};
(function(){var a=Element._insertionTranslations.tags;Object.extend(a,{THEAD:a.TBODY,TFOOT:a.TBODY,TH:a.TD})})();Element.Methods.Simulated={hasAttribute:function(a,c){c=Element._attributeTranslations.has[c]||c;
var b=protoByID(a).getAttributeNode(c);return !!(b&&b.specified)}};Element.Methods.ByTag={};Object.extend(Element,Element.Methods);(function(a){if(!Prototype.BrowserFeatures.ElementExtensions&&a.__proto__){window.HTMLElement={};
window.HTMLElement.prototype=a.__proto__;Prototype.BrowserFeatures.ElementExtensions=true}a=null})(document.createElement("div"));Element.extend=(function(){function c(h){if(typeof window.Element!="undefined"){var j=window.Element.prototype;
if(j){var l="_"+(Math.random()+"").slice(2),i=document.createElement(h);j[l]="x";var k=(i[l]!=="x");delete j[l];i=null;return k}}return false}function b(i,h){for(var k in h){var j=h[k];if(Object.isFunction(j)&&!(k in i)){i[k]=j.methodize()
}}}var d=c("object");if(Prototype.BrowserFeatures.SpecificElementExtensions){if(d){return function(i){if(i&&typeof i._extendedByPrototype=="undefined"){var h=i.tagName;if(h&&(/^(?:object|applet|embed)$/i.test(h))){b(i,Element.Methods);
b(i,Element.Methods.Simulated);b(i,Element.Methods.ByTag[h.toUpperCase()])}}return i}}return Prototype.K}var a={},f=Element.Methods.ByTag;var g=Object.extend(function(j){if(!j||typeof j._extendedByPrototype!="undefined"||j.nodeType!=1||j==window){return j
}var h=Object.clone(a),i=j.tagName.toUpperCase();if(f[i]){Object.extend(h,f[i])}b(j,h);j._extendedByPrototype=Prototype.emptyFunction;return j},{refresh:function(){if(!Prototype.BrowserFeatures.ElementExtensions){Object.extend(a,Element.Methods);
Object.extend(a,Element.Methods.Simulated)}}});g.refresh();return g})();if(document.documentElement.hasAttribute){Element.hasAttribute=function(a,b){return a.hasAttribute(b)}}else{Element.hasAttribute=Element.Methods.Simulated.hasAttribute
}Element.addMethods=function(c){var j=Prototype.BrowserFeatures,d=Element.Methods.ByTag;if(!c){Object.extend(Form,Form.Methods);Object.extend(Form.Element,Form.Element.Methods);Object.extend(Element.Methods.ByTag,{FORM:Object.clone(Form.Methods),INPUT:Object.clone(Form.Element.Methods),SELECT:Object.clone(Form.Element.Methods),TEXTAREA:Object.clone(Form.Element.Methods),BUTTON:Object.clone(Form.Element.Methods)})
}if(arguments.length==2){var b=c;c=arguments[1]}if(!b){Object.extend(Element.Methods,c||{})}else{if(Object.isArray(b)){b.each(h)}else{h(b)}}function h(l){l=l.toUpperCase();if(!Element.Methods.ByTag[l]){Element.Methods.ByTag[l]={}
}Object.extend(Element.Methods.ByTag[l],c)}function a(n,m,l){l=l||false;for(var q in n){var p=n[q];if(!Object.isFunction(p)){continue}if(!l||!(q in m)){m[q]=p.methodize()}}}function f(p){var l;var n={OPTGROUP:"OptGroup",TEXTAREA:"TextArea",P:"Paragraph",FIELDSET:"FieldSet",UL:"UList",OL:"OList",DL:"DList",DIR:"Directory",H1:"Heading",H2:"Heading",H3:"Heading",H4:"Heading",H5:"Heading",H6:"Heading",Q:"Quote",INS:"Mod",DEL:"Mod",A:"Anchor",IMG:"Image",CAPTION:"TableCaption",COL:"TableCol",COLGROUP:"TableCol",THEAD:"TableSection",TFOOT:"TableSection",TBODY:"TableSection",TR:"TableRow",TH:"TableCell",TD:"TableCell",FRAMESET:"FrameSet",IFRAME:"IFrame"};
if(n[p]){l="HTML"+n[p]+"Element"}if(window[l]){return window[l]}l="HTML"+p+"Element";if(window[l]){return window[l]}l="HTML"+p.capitalize()+"Element";if(window[l]){return window[l]}var m=document.createElement(p),q=m.__proto__||m.constructor.prototype;
m=null;return q}var i=window.HTMLElement?HTMLElement.prototype:Element.prototype;if(j.ElementExtensions){a(Element.Methods,i);a(Element.Methods.Simulated,i,true)}if(j.SpecificElementExtensions){for(var k in Element.Methods.ByTag){var g=f(k);
if(Object.isUndefined(g)){continue}a(d[k],g.prototype)}}Object.extend(Element,Element.Methods);delete Element.ByTag;if(Element.extend.refresh){Element.extend.refresh()}Element.cache={}};document.viewport={getDimensions:function(){return{width:this.getWidth(),height:this.getHeight()}
},getScrollOffsets:function(){return Element._returnOffset(window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft,window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop)
}};(function(b){var h=Prototype.Browser,f=document,c,d={};function a(){if(h.WebKit&&!f.evaluate){return document}if(h.Opera&&window.parseFloat(window.opera.version())<9.5){return document.body}return document.documentElement
}function g(i){if(!c){c=a()}d[i]="client"+i;b["get"+i]=function(){return c[d[i]]};return b["get"+i]()}b.getWidth=g.curry("Width");b.getHeight=g.curry("Height")})(document.viewport);Element.Storage={UID:1};
Element.addMethods({getStorage:function(b){if(!(b=protoByID(b))){return}var a;if(b===window){a=0}else{if(typeof b._prototypeUID==="undefined"){b._prototypeUID=Element.Storage.UID++}a=b._prototypeUID}if(!Element.Storage[a]){Element.Storage[a]=$H()
}return Element.Storage[a]},store:function(b,a,c){if(!(b=protoByID(b))){return}if(arguments.length===2){Element.getStorage(b).update(a)}else{Element.getStorage(b).set(a,c)}return b},retrieve:function(c,b,a){if(!(c=protoByID(c))){return
}var f=Element.getStorage(c),d=f.get(b);if(Object.isUndefined(d)){f.set(b,a);d=a}return d},clone:function(c,a){if(!(c=protoByID(c))){return}var f=c.cloneNode(a);f._prototypeUID=void 0;if(a){var d=Element.select(f,"*"),b=d.length;
while(b--){d[b]._prototypeUID=void 0}}return Element.extend(f)},purge:function(c){if(!(c=protoByID(c))){return}var a=Element._purgeElement;a(c);var d=c.getElementsByTagName("*"),b=d.length;while(b--){a(d[b])
}return null}});(function(){function i(A){var z=A.match(/^(\d+)%?$/i);if(!z){return null}return(Number(z[1])/100)}function q(K,L,A){var D=null;if(Object.isElement(K)){D=K;K=D.getStyle(L)}if(K===null){return null
}if((/^(?:-)?\d+(\.\d+)?(px)?$/i).test(K)){return window.parseFloat(K)}var F=K.include("%"),B=(A===document.viewport);if(/\d/.test(K)&&D&&D.runtimeStyle&&!(F&&B)){var z=D.style.left,J=D.runtimeStyle.left;
D.runtimeStyle.left=D.currentStyle.left;D.style.left=K||0;K=D.style.pixelLeft;D.style.left=z;D.runtimeStyle.left=J;return K}if(D&&F){A=A||D.parentNode;var C=i(K);var G=null;var E=D.getStyle("position");
var I=L.include("left")||L.include("right")||L.include("width");var H=L.include("top")||L.include("bottom")||L.include("height");if(A===document.viewport){if(I){G=document.viewport.getWidth()}else{if(H){G=document.viewport.getHeight()
}}}else{if(I){G=protoByID(A).measure("width")}else{if(H){G=protoByID(A).measure("height")}}}return(G===null)?0:G*C}return 0}function h(z){if(Object.isString(z)&&z.endsWith("px")){return z}return z+"px"
}function k(A){var z=A;while(A&&A.parentNode){var B=A.getStyle("display");if(B==="none"){return false}A=protoByID(A.parentNode)}return true}var d=Prototype.K;if("currentStyle" in document.documentElement){d=function(z){if(!z.currentStyle.hasLayout){z.style.zoom=1
}return z}}function g(z){if(z.include("border")){z=z+"-width"}return z.camelize()}Element.Layout=Class.create(Hash,{initialize:function($super,A,z){$super();this.element=protoByID(A);Element.Layout.PROPERTIES.each(function(B){this._set(B,null)
},this);if(z){this._preComputing=true;this._begin();Element.Layout.PROPERTIES.each(this._compute,this);this._end();this._preComputing=false}},_set:function(A,z){return Hash.prototype.set.call(this,A,z)
},set:function(A,z){throw"Properties of Element.Layout are read-only."},get:function($super,A){var z=$super(A);return z===null?this._compute(A):z},_begin:function(){if(this._prepared){return}var D=this.element;
if(k(D)){this._prepared=true;return}var F={position:D.style.position||"",width:D.style.width||"",visibility:D.style.visibility||"",display:D.style.display||""};D.store("prototype_original_styles",F);var G=D.getStyle("position"),z=D.getStyle("width");
if(z==="0px"||z===null){D.style.display="block";z=D.getStyle("width")}var A=(G==="fixed")?document.viewport:D.parentNode;D.setStyle({position:"absolute",visibility:"hidden",display:"block"});var B=D.getStyle("width");
var C;if(z&&(B===z)){C=q(D,"width",A)}else{if(G==="absolute"||G==="fixed"){C=q(D,"width",A)}else{var H=D.parentNode,E=protoByID(H).getLayout();C=E.get("width")-this.get("margin-left")-this.get("border-left")-this.get("padding-left")-this.get("padding-right")-this.get("border-right")-this.get("margin-right")
}}D.setStyle({width:C+"px"});this._prepared=true},_end:function(){var A=this.element;var z=A.retrieve("prototype_original_styles");A.store("prototype_original_styles",null);A.setStyle(z);this._prepared=false
},_compute:function(A){var z=Element.Layout.COMPUTATIONS;if(!(A in z)){throw"Property not found."}return this._set(A,z[A].call(this,this.element))},toObject:function(){var z=$A(arguments);var A=(z.length===0)?Element.Layout.PROPERTIES:z.join(" ").split(" ");
var B={};A.each(function(C){if(!Element.Layout.PROPERTIES.include(C)){return}var D=this.get(C);if(D!=null){B[C]=D}},this);return B},toHash:function(){var z=this.toObject.apply(this,arguments);return new Hash(z)
},toCSS:function(){var z=$A(arguments);var B=(z.length===0)?Element.Layout.PROPERTIES:z.join(" ").split(" ");var A={};B.each(function(C){if(!Element.Layout.PROPERTIES.include(C)){return}if(Element.Layout.COMPOSITE_PROPERTIES.include(C)){return
}var D=this.get(C);if(D!=null){A[g(C)]=D+"px"}},this);return A},inspect:function(){return"#<Element.Layout>"}});Object.extend(Element.Layout,{PROPERTIES:$w("height width top left right bottom border-left border-right border-top border-bottom padding-left padding-right padding-top padding-bottom margin-top margin-bottom margin-left margin-right padding-box-width padding-box-height border-box-width border-box-height margin-box-width margin-box-height"),COMPOSITE_PROPERTIES:$w("padding-box-width padding-box-height margin-box-width margin-box-height border-box-width border-box-height"),COMPUTATIONS:{height:function(B){if(!this._preComputing){this._begin()
}var z=this.get("border-box-height");if(z<=0){if(!this._preComputing){this._end()}return 0}var C=this.get("border-top"),A=this.get("border-bottom");var E=this.get("padding-top"),D=this.get("padding-bottom");
if(!this._preComputing){this._end()}return z-C-A-E-D},width:function(B){if(!this._preComputing){this._begin()}var A=this.get("border-box-width");if(A<=0){if(!this._preComputing){this._end()}return 0}var E=this.get("border-left"),z=this.get("border-right");
var C=this.get("padding-left"),D=this.get("padding-right");if(!this._preComputing){this._end()}return A-E-z-C-D},"padding-box-height":function(A){var z=this.get("height"),C=this.get("padding-top"),B=this.get("padding-bottom");
return z+C+B},"padding-box-width":function(z){var A=this.get("width"),B=this.get("padding-left"),C=this.get("padding-right");return A+B+C},"border-box-height":function(A){if(!this._preComputing){this._begin()
}var z=A.offsetHeight;if(!this._preComputing){this._end()}return z},"border-box-width":function(z){if(!this._preComputing){this._begin()}var A=z.offsetWidth;if(!this._preComputing){this._end()}return A
},"margin-box-height":function(A){var z=this.get("border-box-height"),B=this.get("margin-top"),C=this.get("margin-bottom");if(z<=0){return 0}return z+B+C},"margin-box-width":function(B){var A=this.get("border-box-width"),C=this.get("margin-left"),z=this.get("margin-right");
if(A<=0){return 0}return A+C+z},top:function(z){var A=z.positionedOffset();return A.top},bottom:function(z){var C=z.positionedOffset(),A=z.getOffsetParent(),B=A.measure("height");var D=this.get("border-box-height");
return B-D-C.top},left:function(z){var A=z.positionedOffset();return A.left},right:function(B){var D=B.positionedOffset(),C=B.getOffsetParent(),z=C.measure("width");var A=this.get("border-box-width");return z-A-D.left
},"padding-top":function(z){return q(z,"paddingTop")},"padding-bottom":function(z){return q(z,"paddingBottom")},"padding-left":function(z){return q(z,"paddingLeft")},"padding-right":function(z){return q(z,"paddingRight")
},"border-top":function(z){return q(z,"borderTopWidth")},"border-bottom":function(z){return q(z,"borderBottomWidth")},"border-left":function(z){return q(z,"borderLeftWidth")},"border-right":function(z){return q(z,"borderRightWidth")
},"margin-top":function(z){return q(z,"marginTop")},"margin-bottom":function(z){return q(z,"marginBottom")},"margin-left":function(z){return q(z,"marginLeft")},"margin-right":function(z){return q(z,"marginRight")
}}});if("getBoundingClientRect" in document.documentElement){Object.extend(Element.Layout.COMPUTATIONS,{right:function(A){var B=d(A.getOffsetParent());var C=A.getBoundingClientRect(),z=B.getBoundingClientRect();
return(z.right-C.right).round()},bottom:function(A){var B=d(A.getOffsetParent());var C=A.getBoundingClientRect(),z=B.getBoundingClientRect();return(z.bottom-C.bottom).round()}})}Element.Offset=Class.create({initialize:function(A,z){this.left=A.round();
this.top=z.round();this[0]=this.left;this[1]=this.top},relativeTo:function(z){return new Element.Offset(this.left-z.left,this.top-z.top)},inspect:function(){return"#<Element.Offset left: #{left} top: #{top}>".interpolate(this)
},toString:function(){return"[#{left}, #{top}]".interpolate(this)},toArray:function(){return[this.left,this.top]}});function t(A,z){return new Element.Layout(A,z)}function b(z,A){return protoByID(z).getLayout().get(A)
}function p(A){A=protoByID(A);var E=Element.getStyle(A,"display");if(E&&E!=="none"){return{width:A.offsetWidth,height:A.offsetHeight}}var B=A.style;var z={visibility:B.visibility,position:B.position,display:B.display};
var D={visibility:"hidden",display:"block"};if(z.position!=="fixed"){D.position="absolute"}Element.setStyle(A,D);var C={width:A.offsetWidth,height:A.offsetHeight};Element.setStyle(A,z);return C}function m(z){z=protoByID(z);
if(f(z)||c(z)||n(z)||l(z)){return protoByID(document.body)}var A=(Element.getStyle(z,"display")==="inline");if(!A&&z.offsetParent){return protoByID(z.offsetParent)}while((z=z.parentNode)&&z!==document.body){if(Element.getStyle(z,"position")!=="static"){return l(z)?protoByID(document.body):protoByID(z)
}}return protoByID(document.body)}function w(A){A=protoByID(A);var z=0,B=0;if(A.parentNode){do{z+=A.offsetTop||0;B+=A.offsetLeft||0;A=A.offsetParent}while(A)}return new Element.Offset(B,z)}function r(A){A=protoByID(A);
var B=A.getLayout();var z=0,D=0;do{z+=A.offsetTop||0;D+=A.offsetLeft||0;A=A.offsetParent;if(A){if(n(A)){break}var C=Element.getStyle(A,"position");if(C!=="static"){break}}}while(A);D-=B.get("margin-top");
z-=B.get("margin-left");return new Element.Offset(D,z)}function a(A){var z=0,B=0;do{z+=A.scrollTop||0;B+=A.scrollLeft||0;A=A.parentNode}while(A);return new Element.Offset(B,z)}function u(D){A=protoByID(A);
var z=0,C=0,B=document.body;var A=D;do{z+=A.offsetTop||0;C+=A.offsetLeft||0;if(A.offsetParent==B&&Element.getStyle(A,"position")=="absolute"){break}}while(A=A.offsetParent);A=D;do{if(A!=B){z-=A.scrollTop||0;
C-=A.scrollLeft||0}}while(A=A.parentNode);return new Element.Offset(C,z)}function s(z){z=protoByID(z);if(Element.getStyle(z,"position")==="absolute"){return z}var D=m(z);var C=z.viewportOffset(),A=D.viewportOffset();
var E=C.relativeTo(A);var B=z.getLayout();z.store("prototype_absolutize_original_styles",{left:z.getStyle("left"),top:z.getStyle("top"),width:z.getStyle("width"),height:z.getStyle("height")});z.setStyle({position:"absolute",top:E.top+"px",left:E.left+"px",width:B.get("width")+"px",height:B.get("height")+"px"});
return z}function j(A){A=protoByID(A);if(Element.getStyle(A,"position")==="relative"){return A}var z=A.retrieve("prototype_absolutize_original_styles");if(z){A.setStyle(z)}return A}if(Prototype.Browser.IE){m=m.wrap(function(B,A){A=protoByID(A);
if(f(A)||c(A)||n(A)||l(A)){return protoByID(document.body)}var z=A.getStyle("position");if(z!=="static"){return B(A)}A.setStyle({position:"relative"});var C=B(A);A.setStyle({position:z});return C});r=r.wrap(function(C,A){A=protoByID(A);
if(!A.parentNode){return new Element.Offset(0,0)}var z=A.getStyle("position");if(z!=="static"){return C(A)}var B=A.getOffsetParent();if(B&&B.getStyle("position")==="fixed"){d(B)}A.setStyle({position:"relative"});
var D=C(A);A.setStyle({position:z});return D})}else{if(Prototype.Browser.Webkit){w=function(A){A=protoByID(A);var z=0,B=0;do{z+=A.offsetTop||0;B+=A.offsetLeft||0;if(A.offsetParent==document.body){if(Element.getStyle(A,"position")=="absolute"){break
}}A=A.offsetParent}while(A);return new Element.Offset(B,z)}}}Element.addMethods({getLayout:t,measure:b,getDimensions:p,getOffsetParent:m,cumulativeOffset:w,positionedOffset:r,cumulativeScrollOffset:a,viewportOffset:u,absolutize:s,relativize:j});
function n(z){return z.nodeName.toUpperCase()==="BODY"}function l(z){return z.nodeName.toUpperCase()==="HTML"}function f(z){return z.nodeType===Node.DOCUMENT_NODE}function c(z){return z!==document.body&&!Element.descendantOf(z,document.body)
}if("getBoundingClientRect" in document.documentElement){Element.addMethods({viewportOffset:function(z){z=protoByID(z);if(c(z)){return new Element.Offset(0,0)}var A=z.getBoundingClientRect(),B=document.documentElement;
return new Element.Offset(A.left-B.clientLeft,A.top-B.clientTop)}})}})();window.protoSelect=function(){var a=$A(arguments).join(", ");return Prototype.Selector.select(a,document)};Prototype.Selector=(function(){function a(){throw new Error('Method "Prototype.Selector.select" must be defined.')
}function c(){throw new Error('Method "Prototype.Selector.match" must be defined.')}function d(m,n,j){j=j||0;var h=Prototype.Selector.match,l=m.length,g=0,k;for(k=0;k<l;k++){if(h(m[k],n)&&j==g++){return Element.extend(m[k])
}}}function f(j){for(var g=0,h=j.length;g<h;g++){Element.extend(j[g])}return j}var b=Prototype.K;return{select:a,match:c,find:d,extendElements:(Element.extend===b)?b:f,extendElement:Element.extend}})();
Prototype._original_property=window.Sizzle;(function(){var r=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,j=0,d=Object.prototype.toString,p=false,i=true;
[0,0].sort(function(){i=false;return 0});var b=function(J,z,G,B){G=G||[];var t=z=z||document;if(z.nodeType!==1&&z.nodeType!==9){return[]}if(!J||typeof J!=="string"){return G}var H=[],I,E,N,M,F,w,u=true,C=q(z),L=J;
while((r.exec(""),I=r.exec(L))!==null){L=I[3];H.push(I[1]);if(I[2]){w=I[3];break}}if(H.length>1&&k.exec(J)){if(H.length===2&&f.relative[H[0]]){E=g(H[0]+H[1],z)}else{E=f.relative[H[0]]?[z]:b(H.shift(),z);
while(H.length){J=H.shift();if(f.relative[J]){J+=H.shift()}E=g(J,E)}}}else{if(!B&&H.length>1&&z.nodeType===9&&!C&&f.match.ID.test(H[0])&&!f.match.ID.test(H[H.length-1])){var O=b.find(H.shift(),z,C);z=O.expr?b.filter(O.expr,O.set)[0]:O.set[0]
}if(z){var O=B?{expr:H.pop(),set:a(B)}:b.find(H.pop(),H.length===1&&(H[0]==="~"||H[0]==="+")&&z.parentNode?z.parentNode:z,C);E=O.expr?b.filter(O.expr,O.set):O.set;if(H.length>0){N=a(E)}else{u=false}while(H.length){var A=H.pop(),D=A;
if(!f.relative[A]){A=""}else{D=H.pop()}if(D==null){D=z}f.relative[A](N,D,C)}}else{N=H=[]}}if(!N){N=E}if(!N){throw"Syntax error, unrecognized expression: "+(A||J)}if(d.call(N)==="[object Array]"){if(!u){G.push.apply(G,N)
}else{if(z&&z.nodeType===1){for(var K=0;N[K]!=null;K++){if(N[K]&&(N[K]===true||N[K].nodeType===1&&h(z,N[K]))){G.push(E[K])}}}else{for(var K=0;N[K]!=null;K++){if(N[K]&&N[K].nodeType===1){G.push(E[K])}}}}}else{a(N,G)
}if(w){b(w,t,G,B);b.uniqueSort(G)}return G};b.uniqueSort=function(u){if(c){p=i;u.sort(c);if(p){for(var t=1;t<u.length;t++){if(u[t]===u[t-1]){u.splice(t--,1)}}}}return u};b.matches=function(t,u){return b(t,null,null,u)
};b.find=function(D,t,E){var C,A;if(!D){return[]}for(var z=0,w=f.order.length;z<w;z++){var B=f.order[z],A;if((A=f.leftMatch[B].exec(D))){var u=A[1];A.splice(1,1);if(u.substr(u.length-1)!=="\\"){A[1]=(A[1]||"").replace(/\\/g,"");
C=f.find[B](A,t,E);if(C!=null){D=D.replace(f.match[B],"");break}}}}if(!C){C=t.getElementsByTagName("*")}return{set:C,expr:D}};b.filter=function(G,F,J,z){var w=G,L=[],D=F,B,t,C=F&&F[0]&&q(F[0]);while(G&&F.length){for(var E in f.filter){if((B=f.match[E].exec(G))!=null){var u=f.filter[E],K,I;
t=false;if(D==L){L=[]}if(f.preFilter[E]){B=f.preFilter[E](B,D,J,L,z,C);if(!B){t=K=true}else{if(B===true){continue}}}if(B){for(var A=0;(I=D[A])!=null;A++){if(I){K=u(I,B,A,D);var H=z^!!K;if(J&&K!=null){if(H){t=true
}else{D[A]=false}}else{if(H){L.push(I);t=true}}}}}if(K!==undefined){if(!J){D=L}G=G.replace(f.match[E],"");if(!t){return[]}break}}}if(G==w){if(t==null){throw"Syntax error, unrecognized expression: "+G}else{break
}}w=G}return D};var f=b.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},leftMatch:{},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(t){return t.getAttribute("href")
}},relative:{"+":function(D,t,C){var A=typeof t==="string",E=A&&!/\W/.test(t),B=A&&!E;if(E&&!C){t=t.toUpperCase()}for(var z=0,w=D.length,u;z<w;z++){if((u=D[z])){while((u=u.previousSibling)&&u.nodeType!==1){}D[z]=B||u&&u.nodeName===t?u||false:u===t
}}if(B){b.filter(t,D,true)}},">":function(C,u,D){var A=typeof u==="string";if(A&&!/\W/.test(u)){u=D?u:u.toUpperCase();for(var w=0,t=C.length;w<t;w++){var B=C[w];if(B){var z=B.parentNode;C[w]=z.nodeName===u?z:false
}}}else{for(var w=0,t=C.length;w<t;w++){var B=C[w];if(B){C[w]=A?B.parentNode:B.parentNode===u}}if(A){b.filter(u,C,true)}}},"":function(z,u,B){var w=j++,t=s;if(!/\W/.test(u)){var A=u=B?u:u.toUpperCase();
t=n}t("parentNode",u,w,z,A,B)},"~":function(z,u,B){var w=j++,t=s;if(typeof u==="string"&&!/\W/.test(u)){var A=u=B?u:u.toUpperCase();t=n}t("previousSibling",u,w,z,A,B)}},find:{ID:function(u,w,z){if(typeof w.getElementById!=="undefined"&&!z){var t=w.getElementById(u[1]);
return t?[t]:[]}},NAME:function(w,B,C){if(typeof B.getElementsByName!=="undefined"){var u=[],A=B.getElementsByName(w[1]);for(var z=0,t=A.length;z<t;z++){if(A[z].getAttribute("name")===w[1]){u.push(A[z])
}}return u.length===0?null:u}},TAG:function(t,u){return u.getElementsByTagName(t[1])}},preFilter:{CLASS:function(z,u,w,t,C,D){z=" "+z[1].replace(/\\/g,"")+" ";if(D){return z}for(var A=0,B;(B=u[A])!=null;
A++){if(B){if(C^(B.className&&(" "+B.className+" ").indexOf(z)>=0)){if(!w){t.push(B)}}else{if(w){u[A]=false}}}}return false},ID:function(t){return t[1].replace(/\\/g,"")},TAG:function(u,t){for(var w=0;
t[w]===false;w++){}return t[w]&&q(t[w])?u[1]:u[1].toUpperCase()},CHILD:function(t){if(t[1]=="nth"){var u=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(t[2]=="even"&&"2n"||t[2]=="odd"&&"2n+1"||!/\D/.test(t[2])&&"0n+"+t[2]||t[2]);
t[2]=(u[1]+(u[2]||1))-0;t[3]=u[3]-0}t[0]=j++;return t},ATTR:function(A,u,w,t,B,C){var z=A[1].replace(/\\/g,"");if(!C&&f.attrMap[z]){A[1]=f.attrMap[z]}if(A[2]==="~="){A[4]=" "+A[4]+" "}return A},PSEUDO:function(A,u,w,t,B){if(A[1]==="not"){if((r.exec(A[3])||"").length>1||/^\w/.test(A[3])){A[3]=b(A[3],null,null,u)
}else{var z=b.filter(A[3],u,w,true^B);if(!w){t.push.apply(t,z)}return false}}else{if(f.match.POS.test(A[0])||f.match.CHILD.test(A[0])){return true}}return A},POS:function(t){t.unshift(true);return t}},filters:{enabled:function(t){return t.disabled===false&&t.type!=="hidden"
},disabled:function(t){return t.disabled===true},checked:function(t){return t.checked===true},selected:function(t){t.parentNode.selectedIndex;return t.selected===true},parent:function(t){return !!t.firstChild
},empty:function(t){return !t.firstChild},has:function(w,u,t){return !!b(t[3],w).length},header:function(t){return/h\d/i.test(t.nodeName)},text:function(t){return"text"===t.type},radio:function(t){return"radio"===t.type
},checkbox:function(t){return"checkbox"===t.type},file:function(t){return"file"===t.type},password:function(t){return"password"===t.type},submit:function(t){return"submit"===t.type},image:function(t){return"image"===t.type
},reset:function(t){return"reset"===t.type},button:function(t){return"button"===t.type||t.nodeName.toUpperCase()==="BUTTON"},input:function(t){return/input|select|textarea|button/i.test(t.nodeName)}},setFilters:{first:function(u,t){return t===0
},last:function(w,u,t,z){return u===z.length-1},even:function(u,t){return t%2===0},odd:function(u,t){return t%2===1},lt:function(w,u,t){return u<t[3]-0},gt:function(w,u,t){return u>t[3]-0},nth:function(w,u,t){return t[3]-0==u
},eq:function(w,u,t){return t[3]-0==u}},filter:{PSEUDO:function(C,w,z,D){var u=w[1],A=f.filters[u];if(A){return A(C,z,w,D)}else{if(u==="contains"){return(C.textContent||C.innerText||"").indexOf(w[3])>=0
}else{if(u==="not"){var B=w[3];for(var z=0,t=B.length;z<t;z++){if(B[z]===C){return false}}return true}}}},CHILD:function(t,z){var C=z[1],u=t;switch(C){case"only":case"first":while((u=u.previousSibling)){if(u.nodeType===1){return false
}}if(C=="first"){return true}u=t;case"last":while((u=u.nextSibling)){if(u.nodeType===1){return false}}return true;case"nth":var w=z[2],F=z[3];if(w==1&&F==0){return true}var B=z[0],E=t.parentNode;if(E&&(E.sizcache!==B||!t.nodeIndex)){var A=0;
for(u=E.firstChild;u;u=u.nextSibling){if(u.nodeType===1){u.nodeIndex=++A}}E.sizcache=B}var D=t.nodeIndex-F;if(w==0){return D==0}else{return(D%w==0&&D/w>=0)}}},ID:function(u,t){return u.nodeType===1&&u.getAttribute("id")===t
},TAG:function(u,t){return(t==="*"&&u.nodeType===1)||u.nodeName===t},CLASS:function(u,t){return(" "+(u.className||u.getAttribute("class"))+" ").indexOf(t)>-1},ATTR:function(B,z){var w=z[1],t=f.attrHandle[w]?f.attrHandle[w](B):B[w]!=null?B[w]:B.getAttribute(w),C=t+"",A=z[2],u=z[4];
return t==null?A==="!=":A==="="?C===u:A==="*="?C.indexOf(u)>=0:A==="~="?(" "+C+" ").indexOf(u)>=0:!u?C&&t!==false:A==="!="?C!=u:A==="^="?C.indexOf(u)===0:A==="$="?C.substr(C.length-u.length)===u:A==="|="?C===u||C.substr(0,u.length+1)===u+"-":false
},POS:function(A,u,w,B){var t=u[2],z=f.setFilters[t];if(z){return z(A,w,u,B)}}}};var k=f.match.POS;for(var m in f.match){f.match[m]=new RegExp(f.match[m].source+/(?![^\[]*\])(?![^\(]*\))/.source);f.leftMatch[m]=new RegExp(/(^(?:.|\r|\n)*?)/.source+f.match[m].source)
}var a=function(u,t){u=Array.prototype.slice.call(u,0);if(t){t.push.apply(t,u);return t}return u};try{Array.prototype.slice.call(document.documentElement.childNodes,0)}catch(l){a=function(A,z){var u=z||[];
if(d.call(A)==="[object Array]"){Array.prototype.push.apply(u,A)}else{if(typeof A.length==="number"){for(var w=0,t=A.length;w<t;w++){u.push(A[w])}}else{for(var w=0;A[w];w++){u.push(A[w])}}}return u}}var c;
if(document.documentElement.compareDocumentPosition){c=function(u,t){if(!u.compareDocumentPosition||!t.compareDocumentPosition){if(u==t){p=true}return 0}var w=u.compareDocumentPosition(t)&4?-1:u===t?0:1;
if(w===0){p=true}return w}}else{if("sourceIndex" in document.documentElement){c=function(u,t){if(!u.sourceIndex||!t.sourceIndex){if(u==t){p=true}return 0}var w=u.sourceIndex-t.sourceIndex;if(w===0){p=true
}return w}}else{if(document.createRange){c=function(z,u){if(!z.ownerDocument||!u.ownerDocument){if(z==u){p=true}return 0}var w=z.ownerDocument.createRange(),t=u.ownerDocument.createRange();w.setStart(z,0);
w.setEnd(z,0);t.setStart(u,0);t.setEnd(u,0);var A=w.compareBoundaryPoints(Range.START_TO_END,t);if(A===0){p=true}return A}}}}(function(){var u=document.createElement("div"),w="script"+(new Date).getTime();
u.innerHTML="<a name='"+w+"'/>";var t=document.documentElement;t.insertBefore(u,t.firstChild);if(!!document.getElementById(w)){f.find.ID=function(A,B,C){if(typeof B.getElementById!=="undefined"&&!C){var z=B.getElementById(A[1]);
return z?z.id===A[1]||typeof z.getAttributeNode!=="undefined"&&z.getAttributeNode("id").nodeValue===A[1]?[z]:undefined:[]}};f.filter.ID=function(B,z){var A=typeof B.getAttributeNode!=="undefined"&&B.getAttributeNode("id");
return B.nodeType===1&&A&&A.nodeValue===z}}t.removeChild(u);t=u=null})();(function(){var t=document.createElement("div");t.appendChild(document.createComment(""));if(t.getElementsByTagName("*").length>0){f.find.TAG=function(u,B){var A=B.getElementsByTagName(u[1]);
if(u[1]==="*"){var z=[];for(var w=0;A[w];w++){if(A[w].nodeType===1){z.push(A[w])}}A=z}return A}}t.innerHTML="<a href='#'></a>";if(t.firstChild&&typeof t.firstChild.getAttribute!=="undefined"&&t.firstChild.getAttribute("href")!=="#"){f.attrHandle.href=function(u){return u.getAttribute("href",2)
}}t=null})();if(document.querySelectorAll){(function(){var t=b,w=document.createElement("div");w.innerHTML="<p class='TEST'></p>";if(w.querySelectorAll&&w.querySelectorAll(".TEST").length===0){return}b=function(C,B,z,A){B=B||document;
if(!A&&B.nodeType===9&&!q(B)){try{return a(B.querySelectorAll(C),z)}catch(D){}}return t(C,B,z,A)};for(var u in t){b[u]=t[u]}w=null})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var t=document.createElement("div");
t.innerHTML="<div class='test e'></div><div class='test'></div>";if(t.getElementsByClassName("e").length===0){return}t.lastChild.className="e";if(t.getElementsByClassName("e").length===1){return}f.order.splice(1,0,"CLASS");
f.find.CLASS=function(u,w,z){if(typeof w.getElementsByClassName!=="undefined"&&!z){return w.getElementsByClassName(u[1])}};t=null})()}function n(u,C,B,G,D,F){var E=u=="previousSibling"&&!F;for(var z=0,w=G.length;
z<w;z++){var t=G[z];if(t){if(E&&t.nodeType===1){t.sizcache=B;t.sizset=z}t=t[u];var A=false;while(t){if(t.sizcache===B){A=G[t.sizset];break}if(t.nodeType===1&&!F){t.sizcache=B;t.sizset=z}if(t.nodeName===C){A=t;
break}t=t[u]}G[z]=A}}}function s(u,C,B,G,D,F){var E=u=="previousSibling"&&!F;for(var z=0,w=G.length;z<w;z++){var t=G[z];if(t){if(E&&t.nodeType===1){t.sizcache=B;t.sizset=z}t=t[u];var A=false;while(t){if(t.sizcache===B){A=G[t.sizset];
break}if(t.nodeType===1){if(!F){t.sizcache=B;t.sizset=z}if(typeof C!=="string"){if(t===C){A=true;break}}else{if(b.filter(C,[t]).length>0){A=t;break}}}t=t[u]}G[z]=A}}}var h=document.compareDocumentPosition?function(u,t){return u.compareDocumentPosition(t)&16
}:function(u,t){return u!==t&&(u.contains?u.contains(t):true)};var q=function(t){return t.nodeType===9&&t.documentElement.nodeName!=="HTML"||!!t.ownerDocument&&t.ownerDocument.documentElement.nodeName!=="HTML"
};var g=function(t,D){var z=[],A="",B,w=D.nodeType?[D]:D;while((B=f.match.PSEUDO.exec(t))){A+=B[0];t=t.replace(f.match.PSEUDO,"")}t=f.relative[t]?t+"*":t;for(var C=0,u=w.length;C<u;C++){b(t,w[C],z)}return b.filter(A,z)
};window.Sizzle=b})();(function(c){var d=Prototype.Selector.extendElements;function a(f,g){return d(c(f,g||document))}function b(g,f){return c.matches(f,[g]).length==1}Prototype.Selector.engine=c;Prototype.Selector.select=a;
Prototype.Selector.match=b})(Sizzle);window.Sizzle=Prototype._original_property;delete Prototype._original_property;var Form={reset:function(a){a=protoByID(a);a.reset();return a},serializeElements:function(i,d){if(typeof d!="object"){d={hash:!!d}
}else{if(Object.isUndefined(d.hash)){d.hash=true}}var f,h,a=false,g=d.submit,b,c;if(d.hash){c={};b=function(j,k,l){if(k in j){if(!Object.isArray(j[k])){j[k]=[j[k]]}j[k].push(l)}else{j[k]=l}return j}}else{c="";
b=function(j,k,l){return j+(j?"&":"")+encodeURIComponent(k)+"="+encodeURIComponent(l)}}return i.inject(c,function(j,k){if(!k.disabled&&k.name){f=k.name;h=protoByID(k).getValue();if(h!=null&&k.type!="file"&&(k.type!="submit"||(!a&&g!==false&&(!g||f==g)&&(a=true)))){j=b(j,f,h)
}}return j})}};Form.Methods={serialize:function(b,a){return Form.serializeElements(Form.getElements(b),a)},getElements:function(f){var g=protoByID(f).getElementsByTagName("*"),d,a=[],c=Form.Element.Serializers;
for(var b=0;d=g[b];b++){a.push(d)}return a.inject([],function(h,i){if(c[i.tagName.toLowerCase()]){h.push(Element.extend(i))}return h})},getInputs:function(h,c,d){h=protoByID(h);var a=h.getElementsByTagName("input");
if(!c&&!d){return $A(a).map(Element.extend)}for(var f=0,j=[],g=a.length;f<g;f++){var b=a[f];if((c&&b.type!=c)||(d&&b.name!=d)){continue}j.push(Element.extend(b))}return j},disable:function(a){a=protoByID(a);
Form.getElements(a).invoke("disable");return a},enable:function(a){a=protoByID(a);Form.getElements(a).invoke("enable");return a},findFirstElement:function(b){var c=protoByID(b).getElements().findAll(function(d){return"hidden"!=d.type&&!d.disabled
});var a=c.findAll(function(d){return d.hasAttribute("tabIndex")&&d.tabIndex>=0}).sortBy(function(d){return d.tabIndex}).first();return a?a:c.find(function(d){return/^(?:input|select|textarea)$/i.test(d.tagName)
})},focusFirstElement:function(b){b=protoByID(b);var a=b.findFirstElement();if(a){a.activate()}return b},request:function(b,a){b=protoByID(b),a=Object.clone(a||{});var d=a.parameters,c=b.readAttribute("action")||"";
if(c.blank()){c=window.location.href}a.parameters=b.serialize(true);if(d){if(Object.isString(d)){d=d.toQueryParams()}Object.extend(a.parameters,d)}if(b.hasAttribute("method")&&!a.method){a.method=b.method
}return new Ajax.Request(c,a)}};Form.Element={focus:function(a){protoByID(a).focus();return a},select:function(a){protoByID(a).select();return a}};Form.Element.Methods={serialize:function(a){a=protoByID(a);
if(!a.disabled&&a.name){var b=a.getValue();if(b!=undefined){var c={};c[a.name]=b;return Object.toQueryString(c)}}return""},getValue:function(a){a=protoByID(a);var b=a.tagName.toLowerCase();return Form.Element.Serializers[b](a)
},setValue:function(a,b){a=protoByID(a);var c=a.tagName.toLowerCase();Form.Element.Serializers[c](a,b);return a},clear:function(a){protoByID(a).value="";return a},present:function(a){return protoByID(a).value!=""
},activate:function(a){a=protoByID(a);try{a.focus();if(a.select&&(a.tagName.toLowerCase()!="input"||!(/^(?:button|reset|submit)$/i.test(a.type)))){a.select()}}catch(b){}return a},disable:function(a){a=protoByID(a);
a.disabled=true;return a},enable:function(a){a=protoByID(a);a.disabled=false;return a}};var Field=Form.Element;var $F=Form.Element.Methods.getValue;Form.Element.Serializers=(function(){function b(i,j){switch(i.type.toLowerCase()){case"checkbox":case"radio":return g(i,j);
default:return f(i,j)}}function g(i,j){if(Object.isUndefined(j)){return i.checked?i.value:null}else{i.checked=!!j}}function f(i,j){if(Object.isUndefined(j)){return i.value}else{i.value=j}}function a(l,p){if(Object.isUndefined(p)){return(l.type==="select-one"?c:d)(l)
}var k,m,q=!Object.isArray(p);for(var j=0,n=l.length;j<n;j++){k=l.options[j];m=this.optionValue(k);if(q){if(m==p){k.selected=true;return}}else{k.selected=p.include(m)}}}function c(j){var i=j.selectedIndex;
return i>=0?h(j.options[i]):null}function d(m){var j,n=m.length;if(!n){return null}for(var l=0,j=[];l<n;l++){var k=m.options[l];if(k.selected){j.push(h(k))}}return j}function h(i){return Element.hasAttribute(i,"value")?i.value:i.text
}return{input:b,inputSelector:g,textarea:f,select:a,selectOne:c,selectMany:d,optionValue:h,button:f}})();Abstract.TimedObserver=Class.create(PeriodicalExecuter,{initialize:function($super,a,b,c){$super(c,b);
this.element=protoByID(a);this.lastValue=this.getValue()},execute:function(){var a=this.getValue();if(Object.isString(this.lastValue)&&Object.isString(a)?this.lastValue!=a:String(this.lastValue)!=String(a)){this.callback(this.element,a);
this.lastValue=a}}});Form.Element.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.Observer=Class.create(Abstract.TimedObserver,{getValue:function(){return Form.serialize(this.element)
}});Abstract.EventObserver=Class.create({initialize:function(a,b){this.element=protoByID(a);this.callback=b;this.lastValue=this.getValue();if(this.element.tagName.toLowerCase()=="form"){this.registerFormCallbacks()
}else{this.registerCallback(this.element)}},onElementEvent:function(){var a=this.getValue();if(this.lastValue!=a){this.callback(this.element,a);this.lastValue=a}},registerFormCallbacks:function(){Form.getElements(this.element).each(this.registerCallback,this)
},registerCallback:function(a){if(a.type){switch(a.type.toLowerCase()){case"checkbox":case"radio":Event.observe(a,"click",this.onElementEvent.bind(this));break;default:Event.observe(a,"change",this.onElementEvent.bind(this));
break}}}});Form.Element.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.Element.getValue(this.element)}});Form.EventObserver=Class.create(Abstract.EventObserver,{getValue:function(){return Form.serialize(this.element)
}});(function(){var I={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,cache:{}};
var g=document.documentElement;var J="onmouseenter" in g&&"onmouseleave" in g;var a=function(K){return false};if(window.attachEvent){if(window.addEventListener){a=function(K){return !(K instanceof window.Event)
}}else{a=function(K){return true}}}var u;function G(L,K){return L.which?(L.which===K+1):(L.button===K)}var r={0:1,1:4,2:2};function E(L,K){return L.button===r[K]}function H(L,K){switch(K){case 0:return L.which==1&&!L.metaKey;
case 1:return L.which==2||(L.which==1&&L.metaKey);case 2:return L.which==3;default:return false}}if(window.attachEvent){if(!window.addEventListener){u=E}else{u=function(L,K){return a(L)?E(L,K):G(L,K)}}}else{if(Prototype.Browser.WebKit){u=H
}else{u=G}}function B(K){return u(K,0)}function z(K){return u(K,1)}function q(K){return u(K,2)}function d(M){M=I.extend(M);var L=M.target,K=M.type,N=M.currentTarget;if(N&&N.tagName){if(K==="load"||K==="error"||(K==="click"&&N.tagName.toLowerCase()==="input"&&N.type==="radio")){L=N
}}if(L.nodeType==Node.TEXT_NODE){L=L.parentNode}return Element.extend(L)}function s(L,M){var K=I.element(L);if(!M){return K}while(K){if(Object.isElement(K)&&Prototype.Selector.match(K,M)){return Element.extend(K)
}K=K.parentNode}}function w(K){return{x:c(K),y:b(K)}}function c(M){var L=document.documentElement,K=document.body||{scrollLeft:0};return M.pageX||(M.clientX+(L.scrollLeft||K.scrollLeft)-(L.clientLeft||0))
}function b(M){var L=document.documentElement,K=document.body||{scrollTop:0};return M.pageY||(M.clientY+(L.scrollTop||K.scrollTop)-(L.clientTop||0))}function t(K){I.extend(K);K.preventDefault();K.stopPropagation();
K.stopped=true}I.Methods={isLeftClick:B,isMiddleClick:z,isRightClick:q,element:d,findElement:s,pointer:w,pointerX:c,pointerY:b,stop:t};var D=Object.keys(I.Methods).inject({},function(K,L){K[L]=I.Methods[L].methodize();
return K});if(window.attachEvent){function k(L){var K;switch(L.type){case"mouseover":case"mouseenter":K=L.fromElement;break;case"mouseout":case"mouseleave":K=L.toElement;break;default:return null}return Element.extend(K)
}var A={stopPropagation:function(){this.cancelBubble=true},preventDefault:function(){this.returnValue=false},inspect:function(){return"[object Event]"}};I.extend=function(L,K){if(!L){return false}if(!a(L)){return L
}if(L._extendedByPrototype){return L}L._extendedByPrototype=Prototype.emptyFunction;var M=I.pointer(L);Object.extend(L,{target:L.srcElement||K,relatedTarget:k(L),pageX:M.x,pageY:M.y});Object.extend(L,D);
Object.extend(L,A);return L}}else{I.extend=Prototype.K}if(window.addEventListener){I.prototype=window.Event.prototype||document.createEvent("HTMLEvents").__proto__;Object.extend(I.prototype,D)}function p(O,N,P){var M=Element.retrieve(O,"prototype_event_registry");
if(Object.isUndefined(M)){if(f){f.push(O)}M=Element.retrieve(O,"prototype_event_registry",$H())}var K=M.get(N);if(Object.isUndefined(K)){K=[];M.set(N,K)}if(K.pluck("handler").include(P)){return false}var L;
if(N.include(":")){L=function(Q){if(Object.isUndefined(Q.eventName)){return false}if(Q.eventName!==N){return false}I.extend(Q,O);P.call(O,Q)}}else{if(!J&&(N==="mouseenter"||N==="mouseleave")){if(N==="mouseenter"||N==="mouseleave"){L=function(R){I.extend(R,O);
var Q=R.relatedTarget;while(Q&&Q!==O){try{Q=Q.parentNode}catch(S){Q=O}}if(Q===O){return}P.call(O,R)}}}else{L=function(Q){I.extend(Q,O);P.call(O,Q)}}}L.handler=P;K.push(L);return L}function j(){if(f){for(var K=0,L=f.length;
K<L;K++){I.stopObserving(f[K]);f[K]=null}}}function i(){if(!f){return}try{for(var K=0,L=f.length;K<L;K++){var M=f[K];if(M&&Object.isElement(M)&&!M.up("body")){I.stopObserving(M);f[K]=null}}}catch(M){console.log(M)
}}if(Prototype.Browser.IE){var f=[];window.attachEvent("onunload",j)}if(Prototype.Browser.WebKit){window.addEventListener("unload",Prototype.emptyFunction,false)}var n=Prototype.K,h={mouseenter:"mouseover",mouseleave:"mouseout"};
if(!J){n=function(K){return(h[K]||K)}}function C(N,M,O){N=protoByID(N);var L=p(N,M,O);if(!L){return N}if(M.include(":")){if(N.addEventListener){N.addEventListener("dataavailable",L,false)}else{N.attachEvent("ondataavailable",L);
N.attachEvent("onlosecapture",L)}}else{var K=n(M);if(N.addEventListener){N.addEventListener(K,L,false)}else{N.attachEvent("on"+K,L)}}return N}function m(Q,N,R){Q=protoByID(Q);var M=Element.retrieve(Q,"prototype_event_registry");
if(!M){return Q}if(!N){M.each(function(T){var S=T.key;m(Q,S)});return Q}var O=M.get(N);if(!O){return Q}if(!R){O.each(function(S){m(Q,N,S.handler)});return Q}var P=O.length,L;while(P--){if(O[P].handler===R){L=O[P];
break}}if(!L){return Q}if(N.include(":")){if(Q.removeEventListener){Q.removeEventListener("dataavailable",L,false)}else{Q.detachEvent("ondataavailable",L);Q.detachEvent("onlosecapture",L)}}else{var K=n(N);
if(Q.removeEventListener){Q.removeEventListener(K,L,false)}else{Q.detachEvent("on"+K,L)}}M.set(N,O.without(L));return Q}function F(N,M,L,K){N=protoByID(N);if(Object.isUndefined(K)){K=true}if(N==document&&document.createEvent&&!N.dispatchEvent){N=document.documentElement
}var O;if(document.createEvent){O=document.createEvent("HTMLEvents");O.initEvent("dataavailable",K,true)}else{O=document.createEventObject();O.eventType=K?"ondataavailable":"onlosecapture"}O.eventName=M;
O.memo=L||{};if(document.createEvent){N.dispatchEvent(O)}else{N.fireEvent(O.eventType,O)}return I.extend(O)}I.Handler=Class.create({initialize:function(M,L,K,N){this.element=protoByID(M);this.eventName=L;
this.selector=K;this.callback=N;this.handler=this.handleEvent.bind(this)},start:function(){I.observe(this.element,this.eventName,this.handler);return this},stop:function(){I.stopObserving(this.element,this.eventName,this.handler);
return this},handleEvent:function(L){var K=I.findElement(L,this.selector);if(K){this.callback.call(this.element,L,K)}}});function l(M,L,K,N){M=protoByID(M);if(Object.isFunction(K)&&Object.isUndefined(N)){N=K,K=null
}return new I.Handler(M,L,K,N).start()}Object.extend(I,I.Methods);Object.extend(I,{fire:F,observe:C,stopObserving:m,on:l});Element.addMethods({fire:F,observe:C,stopObserving:m,on:l,_cleanupPrototypeEventCache:i});
Object.extend(document,{fire:F.methodize(),observe:C.methodize(),stopObserving:m.methodize(),on:l.methodize(),loaded:false});if(window.Event){Object.extend(window.Event,I)}else{window.Event=I}})();(function(){var d;
function a(){if(document.loaded){return}if(d){window.clearTimeout(d)}document.loaded=true;document.fire("dom:loaded")}function c(){if(document.readyState==="complete"){document.stopObserving("readystatechange",c);
a()}}function b(){try{document.documentElement.doScroll("left")}catch(f){d=b.defer();return}a()}if(document.addEventListener){document.addEventListener("DOMContentLoaded",a,false)}else{document.observe("readystatechange",c);
if(window==top){d=b.defer()}}Event.observe(window,"load",a)})();Element.addMethods();Hash.toQueryString=Object.toQueryString;var Toggle={display:Element.toggle};Element.Methods.childOf=Element.Methods.descendantOf;
var Insertion={Before:function(a,b){return Element.insert(a,{before:b})},Top:function(a,b){return Element.insert(a,{top:b})},Bottom:function(a,b){return Element.insert(a,{bottom:b})},After:function(a,b){return Element.insert(a,{after:b})
}};var $continue=new Error('"throw $continue" is deprecated, use "return" instead');var Position={includeScrollOffsets:false,prepare:function(){this.deltaX=window.pageXOffset||document.documentElement.scrollLeft||document.body.scrollLeft||0;
this.deltaY=window.pageYOffset||document.documentElement.scrollTop||document.body.scrollTop||0},within:function(b,a,c){if(this.includeScrollOffsets){return this.withinIncludingScrolloffsets(b,a,c)}this.xcomp=a;
this.ycomp=c;this.offset=Element.cumulativeOffset(b);return(c>=this.offset[1]&&c<this.offset[1]+b.offsetHeight&&a>=this.offset[0]&&a<this.offset[0]+b.offsetWidth)},withinIncludingScrolloffsets:function(b,a,d){var c=Element.cumulativeScrollOffset(b);
this.xcomp=a+c[0]-this.deltaX;this.ycomp=d+c[1]-this.deltaY;this.offset=Element.cumulativeOffset(b);return(this.ycomp>=this.offset[1]&&this.ycomp<this.offset[1]+b.offsetHeight&&this.xcomp>=this.offset[0]&&this.xcomp<this.offset[0]+b.offsetWidth)
},overlap:function(b,a){if(!b){return 0}if(b=="vertical"){return((this.offset[1]+a.offsetHeight)-this.ycomp)/a.offsetHeight}if(b=="horizontal"){return((this.offset[0]+a.offsetWidth)-this.xcomp)/a.offsetWidth
}},cumulativeOffset:Element.Methods.cumulativeOffset,positionedOffset:Element.Methods.positionedOffset,absolutize:function(a){Position.prepare();return Element.absolutize(a)},relativize:function(a){Position.prepare();
return Element.relativize(a)},realOffset:Element.Methods.cumulativeScrollOffset,offsetParent:Element.Methods.getOffsetParent,page:Element.Methods.viewportOffset,clone:function(b,c,a){a=a||{};return Element.clonePosition(c,b,a)
}};if(!document.getElementsByClassName){document.getElementsByClassName=function(b){function a(c){return c.blank()?null:"[contains(concat(' ', @class, ' '), ' "+c+" ')]"}b.getElementsByClassName=Prototype.BrowserFeatures.XPath?function(c,f){f=f.toString().strip();
var d=/\s/.test(f)?$w(f).map(a).join(""):a(f);return d?document._getElementsByXPath(".//*"+d,c):[]}:function(f,g){g=g.toString().strip();var h=[],j=(/\s/.test(g)?$w(g):null);if(!j&&!g){return h}var c=protoByID(f).getElementsByTagName("*");
g=" "+g+" ";for(var d=0,l,k;l=c[d];d++){if(l.className&&(k=" "+l.className+" ")&&(k.include(g)||(j&&j.all(function(i){return !i.toString().blank()&&k.include(" "+i+" ")})))){h.push(Element.extend(l))}}return h
};return function(d,c){return protoByID(c||document.body).getElementsByClassName(d)}}(Element.Methods)}Element.ClassNames=Class.create();Element.ClassNames.prototype={initialize:function(a){this.element=protoByID(a)
},_each:function(a){this.element.className.split(/\s+/).select(function(b){return b.length>0})._each(a)},set:function(a){this.element.className=a},add:function(a){if(this.include(a)){return}this.set($A(this).concat(a).join(" "))
},remove:function(a){if(!this.include(a)){return}this.set($A(this).without(a).join(" "))},toString:function(){return $A(this).join(" ")}};Object.extend(Element.ClassNames.prototype,Enumerable);(function(){window.Selector=Class.create({initialize:function(a){this.expression=a.strip()
},findElements:function(a){return Prototype.Selector.select(this.expression,a)},match:function(a){return Prototype.Selector.match(a,this.expression)},toString:function(){return this.expression},inspect:function(){return"#<Selector: "+this.expression+">"
}});Object.extend(Selector,{matchElements:function(g,h){var a=Prototype.Selector.match,d=[];for(var c=0,f=g.length;c<f;c++){var b=g[c];if(a(b,h)){d.push(Element.extend(b))}}return d},findElement:function(g,h,b){b=b||0;
var a=0,d;for(var c=0,f=g.length;c<f;c++){d=g[c];if(Prototype.Selector.match(d,h)&&b===a++){return Element.extend(d)}}},findChildElements:function(b,c){var a=c.toArray().join(", ");return Prototype.Selector.select(a,b||document)
}})})();function $(a){return protoByID(a)}window.$$=window.protoSelect;function slPopUp(g,f,d,i){var b=document.all?document.body.clientWidth:innerWidth;var c=document.all?document.body.clientHeight:innerHeight;
x=(b-d)/2;y=(c-i)/2;var j="left="+x+",top="+y+",screenX="+x+",screenY="+y+",width="+d+",height="+i;var h="toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=1,";var a=window.open(g,f,j+","+h);
a.focus()}function selectChooserValue(c,a,d,b){document.forms[c].elements[a].value=d;document.forms[c].elements[a+".display"].value=b}function selectOption(f,j,k,h,i,g){var b=document.forms[j].elements[k].value;
document.forms[j].elements[k].value=h;var c=document.getElementById(f);if(!c){return}c.className=i;var d=f.substring(0,f.length-h.length)+b;var a=document.getElementById(d);if(a){a.className=g}}function addSelected(q,t,p,m,j){var b=document.forms[q].elements[t].value;
if(b==null||b==""){document.forms[q].elements[t].value=p}else{var k=b.split(",");var s=false;for(var c=0;c<k.length;++c){if(k[c]==p){s=true;break}}if(!s){b=b+","+p}document.forms[q].elements[t].value=b
}var h=document.createTextNode(m);var f=document.createTextNode("entfernen");var g=document.createElement("tr");var n=document.createElement("td");var l=document.createElement("td");var d=document.createElement("a");
d.onclick=function(){removeSelected(q,t,p,g.id)};d.appendChild(f);n.appendChild(h);l.appendChild(d);g.appendChild(n);g.appendChild(l);var a=j+"_"+p;g.setAttribute("id",a);var r=document.getElementById(j+"_tbody");
if(r==undefined){alert("no table tbody for id "+j+"_tbody")}r.appendChild(g)}function removeSelected(k,l,j,a){var c=document.forms[k].elements[l].value;if(c!=null){var g=c.split(",");var b="";var f=0;for(var d=0;
d<g.length;++d){if(g[d]==j){continue}f++;if(f>1){b=b+","}b=b+g[d]}document.forms[k].elements[l].value=b}var h=document.getElementById(a);if(h){h.parentNode.removeChild(h)}else{alert("tr not found")}}function rate(b,c,a){new Ajax.Request(b,{asynchronous:true,onSuccess:function(g){var f=document.getElementById(c);
if(!f){return}for(var d=0;d<f.childNodes.length;d++){var h=f.childNodes[d].childNodes[0];if(!h){continue}if(g.responseText=="reload"){location.reload()}else{h.className=f.childNodes[d].getAttribute("id")==c+"_option_"+a?"selection_1":"selection_0"
}}},onFailure:function(d){alert("Transaction failed.  The error is: "+d.statusText)}})}function loadContent(elid,url,onsuccess){var el=$(elid);if(!el){alert("no element found!")}Element.setStyle(el,{cursor:"wait"});
new Ajax.Updater({success:elid,failure:"dump_error"},url,{asynchronous:true,evalScripts:true,onSuccess:function(o){if(onsuccess){eval(onsuccess)}Element.setStyle(el,{cursor:"auto"})},onFailure:function(o){Element.setStyle(el,{cursor:"auto"})
}})}function loadContentAndHighlight(b,c,f,d,a){loadContent(b,c,"highlightGenericListElement('"+f+"', '"+d+"', '"+a+"')")}function loadChildFrameAndHighlight(f,b,d,c,a){frames[f].location.href=b;highlightGenericListElement(d,c,a)
}function loadSiblingFrame(b,a){parent.frames[b].location.href=a}function loadSiblingFrameAndHighlight(f,b,d,c,a){parent.frames[f].location.href=b;highlightGenericListElement(d,c,a)}function loadSiblingChildFrameAndHighlight(d,g,b,f,c,a){parent.frames[d].frames[g].location.href=b;
highlightGenericListElement(f,c,a)}function highlightGenericListElement(h,g,b){var c=$(h);if(!c){return}var a=document.getElementsByClassName(g);for(var f=0;f<a.length;++f){var d=a[f];d.className=b}highlightElement(h,g)
}function highlightElement(c,b){var a=$(c);if(!a){return}a.className=b}function printDebug(b,a){var c=$("dump_error");if(!c){return}if(a){c.innerHTML=b}else{c.innerHTML=c.innerHTML+"<br />"+b}}function updateFCKFields(g){if(!window.FCKEditorAPI){return
}try{var f=Form.getElements(g);for(var b=0;b<f.length;++b){var a=f[b];var c=FCKeditorAPI.GetInstance(a.name);if(c){c.UpdateLinkedField();printDebug("updated fck editor content ("+a.name+")")}}}catch(d){}}function submitAjaxForm(formID,elid,url,isOnSubmit,haveFCK){var el=$(elid);
if(!el){alert("no element found!")}if(haveFCK){updateFCKFields(formID)}var theParams="";if(url.indexOf("?")>-1){theParams=url.substring(url.indexOf("?")+1);url=url.substring(0,url.indexOf("?"))}var formParams=Form.serialize(formID);
if(formParams!=""){theParams+="&"+formParams}Element.setStyle(el,{cursor:"wait"});new Ajax.Updater({success:elid,failure:"dump_error"},url,{method:"post",asynchronous:true,evalScripts:true,parameters:theParams,onSuccess:function(o){Element.setStyle(el,{cursor:"auto"});
if(onsuccess){eval(onsuccess)}},onFailure:function(o){Element.setStyle(el,{cursor:"auto"});alert("Transaction failed.  The error is: "+o.statusText)}});if(isOnSubmit){return false}}function submitAjaxFormCP(b,f,a,c,d,g,j){if(g){slUpdateEditors($(f))
}if(d){updateFCKFields(b)}var h="";if(a.indexOf("?")>-1){h=a.substring(a.indexOf("?")+1);a=a.substring(0,a.indexOf("?"))}var i=Form.serialize(b);if(i!=""){h+="&"+i}if(g){slById(f).loadPost(a,h,j)}else{new Ajax.Request(a,{method:"post",asynchronous:true,evalScripts:true,parameters:h,onSuccess:function(m){var l=dojo.widget.byId(f);
var k=l.href;l.setContent(m.responseText);l.href=k},onFailure:function(k){alert(k)}})}if(c){return false}}function submitAjaxFormCP2(c,a,g,b,d,f,h,k){if(h){slUpdateEditors()}if(f){updateFCKFields(c)}if(f){updateFCKFields(a)
}var i="";if(b.indexOf("?")>-1){i=b.substring(b.indexOf("?")+1);b=b.substring(0,b.indexOf("?"))}var j=Form.serialize(c);j+="&"+Form.serialize(a);if(j!=""){i+="&"+j}if(h){slById(g).loadPost(b,i,k)}else{new Ajax.Request(b,{method:"post",asynchronous:true,evalScripts:true,parameters:i,onSuccess:function(n){var m=dojo.widget.byId(g);
var l=m.href;m.setContent(n.responseText);m.href=l},onFailure:function(l){alert(l)}})}if(d){return false}}function submitSimpleAjaxFormAsURL(f,b,c,a){var g="";if(c.indexOf("?")>-1){g=c.substring(c.indexOf("?")+1);
c=c.substring(0,c.indexOf("?"))}var d=Form.serialize(f);if(d!=""){g+="&"+d}c=c+"?"+g;if(a){slById(b).load(c);return}dojo.widget.byId(b).setUrl(c)}function submitAtoZ(d,b,c,f,a){document.forms[d].elements[f].value=a;
submitAjaxForm(d,b,c)}function submitAtoZ_CP(f,b,d,g,a,c){document.forms[f].elements[g].value=a;submitAjaxFormCP(f,b,d,false,false,c)}function reloadCP(a,b){new Ajax.Request(b,{method:"get",asynchronous:true,evalScripts:true,onSuccess:function(c){dojo.widget.byId(a).setContent(c.responseText);
dojo.widget.byId(a).href=b},onFailure:function(c){alert(c)}})}function hover(c,d,b,a){if(!c){return}if(c.className!=d&&c.className!=b){return}c.className=a?d:b}function toggleCheckboxes(c,a,g){var f=document.forms[c];
if(!f){return}for(var b=0;b<f.elements.length;++b){var d=f.elements[b];if(d.name==a){d.checked=g}}}function switchGUIPage(b,a){var c=document.forms[b];if(!c){return}document.location.href=document.forms[b].elements[a].value
}function slSelectTreeNode(f,b,c,h){var a=YAHOO.widget.TreeView.getTree(f);if(!a){return}var d=a.getNodeByProperty("sl_path",b);if(!d){return}var g=d.data.sl_id;if(!g){return}if(c&&h){triggerGUITree(g,h)
}else{highlightGUITreeNode(g)}}function triggerGUITree(d,h){var a=YAHOO.widget.TreeView.getTree("gui_tree");var c=a.getNodeByProperty("sl_id",d);if(!c){return}var f=c.data.situation;var b=c.data.situation_args;
var g="&args.situation="+f+(b?"&"+b:"");loadContent("gui_main",h+g,"highlightGUITreeNode('"+d+"')")}function highlightGUITreeNode(f){var b=YAHOO.widget.TreeView.getTree("gui_tree");var h=document.getElementById("gui_tree");
if(!h){return}var c=h.getElementsByTagName("a");if(c&&c.length>0){for(var d=0;d<c.length;++d){c[d].style.fontWeight="normal"}}var a=b.getNodeByProperty("sl_id",f);if(!a){alert("cannot find node to highlight: "+f)
}var g=a.getLabelEl();if(g){g.style.fontWeight="bold"}if(!a.expanded){a.toggle()}}function slSetFormElement(b,a){$(b).value=a}function changeIMG(b,c,f){var d=$(b);if(!d){alert("no element found!")}var g=d.src;
var a=g.lastIndexOf("/");d.src=g.substring(0,a)+"/"+c}function removeAMP(b){while(true){var a=b.indexOf("&amp;");if(a==-1){break}b=b.substring(0,a)+"&"+b.substring(a+"&amp;".length)}return b}function addOrReplaceArg(d,a,f){d=removeAMP(d);
var c="&args."+a+"=";var b=d.indexOf(c);if(b==-1){return f==null?d:(d+c+f)}var g=d.substring(b+c.length);return d.substring(0,b)+(f==null?"":(c+f))+(g.indexOf("&")==-1?"":g.substring(g.indexOf("&")))}function restoreIconSrc(){if(this.icon.src.substr(-"/elements/apps/gui/https/icons/current/loading.jpg".length)=="/elements/apps/gui/https/icons/current/loading.jpg"){this.icon.src=this.oldIconSrc
}}function slTreeCreateClicked(d,c,a){if(!d||d.actionIsDisabled(d.actions.ADDCHILD)){return false}this.controller=dojo.widget.manager.getWidgetById(c);if(!d){return false}try{controller.createChild(d,d.children.length,a,dojo.lang.hitch(this,restoreIconSrc))
}catch(b){}}function slTreeMoveClicked(c,b,a,d){if(c.actionIsDisabled(c.actions.MOVE)){return false}this.controller=dojo.widget.manager.getWidgetById(b);if(!c){alert("No node selected");return false}if(d=="up"){if(!c.getPreviousSibling()){return
}controller.move(c,c.parent,c.getParentIndex()-1)}else{if(d=="down"){if(!c.getNextSibling()){return}controller.move(c,c.parent,c.getParentIndex()+1)}}}function slTreeEditClicked(c,b,a){if(!c||c.actionIsDisabled(c.actions.EDIT)){return false
}this.controller=dojo.widget.manager.getWidgetById(b);if(!c){return false}}function slTreeRemoveClicked(d,c,a){if(!d){alert("No node selected");return false}if(d.actionIsDisabled(d.actions.REMOVE)){return false
}this.controller=dojo.widget.manager.getWidgetById(c);try{controller.removeNode(d,dojo.lang.hitch(this,restoreIconSrc))}catch(b){}}function dojoBindForm(b,a){dojo.io.bind({formNode:document.getElementById(b),mimetype:"text/html",load:function(d,g,f){dojo.widget.byId(a).setContent(g.getElementById(a+"_digest_content").innerHTML);
var c=g.getElementById(a+"_digest_url").innerHTML;dojo.widget.byId(a).href=c.replace(/&amp;/g,"&")},error:function(d,c){alert("form bind error: "+c.message)}})}function slAjaxNotify(a){new Ajax.Request(a,{asynchronous:false,onSuccess:function(b){},onFailure:function(b){alert("Transaction failed.  The error is: "+b.statusText)
}})}function slAddSBM(a){doc=escape(location.href);title=escape(document.title);switch(a){case"google":window.open("http://www.google.com/bookmarks/mark?op=add&hl=de&bkmk="+doc+"&title="+title);break;case"delicious":window.open("http://del.icio.us/post?url="+doc+"&title="+title);
break;case"mrwong":window.open("http://www.mister-wong.de/index.php?action=addurl&bm_url="+doc+"&bm_description="+title);break;case"yahoo":window.open("http://myweb2.search.yahoo.com/myresults/bookmarklet?u="+doc+"&t="+title);
break;case"folkd":window.open("http://www.folkd.com/submit/page/"+doc);break;case"blinkList":window.open("http://www.blinklist.com/index.php?Action=Blink/addblink.php&Description=&Url="+doc+"&Title="+title);
break;case"linkarena":window.open("http://linkarena.com/bookmarks/addlink/?url="+doc+"&title="+title+"&desc=&tags=");break;case"yigg":window.open("http://yigg.de/neu?exturl="+doc+"&exttitle="+title);break;
case"furl":window.open("http://www.furl.net/storeIt.jsp?u="+doc+"&t="+title);break;case"oneview":window.open("http://beta.oneview.de/quickadd/neu/addBookmark.jsf?URL="+doc+"&title="+title);break;case"webnews":window.open("http://www.webnews.de/einstellen?url="+doc+"&title="+title);
break}}function slDojoReloadCPIfNecessary(b,a){if(a==null){return}var c=dojo.widget.byId(b);if(c==null){return}if(c.href==a){return}c.setUrl(a)}function slToolboxItemSelected(h,i,j,b,d){var f=document.getElementById(h+"_c");
f.innerHTML=i;if(j!=null){var g;if(b!=null){g=document.getElementById(b)}else{g=document.getElementById(h+"_h")}if(g!=null){g.value=j}}if(d){if($(h+"_t")){var a=slById(h+"_t");if(a){a.hide()}}}else{var k=dojo.widget.byId(h+"_t");
k._hover=false;k.close()}}function slShowFCKEditor(h,c,g,f,a){var d=new FCKeditor(h);d.BasePath=g+"/";d.ToolbarSet=c;if(a!=null){d.Height=a}d.ReplaceTextarea();var b=document.getElementById(f);if(b!=null){b.style.visibility="hidden"
}}function slActivateField(a){$(a).checked=true}function slClick(b){var a=$(b);if(a!=null){a.onclick()}}function slIncludeLib(a){document.write('<script type="text/javascript" src="'+a+'"><\/script>')}function slIncludeCSS(a){document.write('<link rel="stylesheet" type="text/css" href="'+a+'" />\n')
}function slSetImgSRC(c,b){if(b==null||b==""){return}var a=document.getElementById(c);if(a==null){return}a.src=b}function slAutoCheckboxToggle(j,g,c,h){var b=$(j).getInputs("checkbox",c);if(g.value==h){if(!g.checked){return
}for(var d=0;d<b.length;d++){if(b[d]!=g){b[d].checked=false}}return}if(g.checked){var f=true;var a;for(var d=0;d<b.length;d++){if(b[d].value==h){a=b[d]}else{if(!b[d].checked){f=false}}}a.checked=f;if(f){for(var d=0;
d<b.length;d++){if(b[d].value!=h){b[d].checked=false}}}return}for(var d=0;d<b.length;d++){if(b[d].value!=h){if(b[d].checked){return}}else{b[d].check=true}}}function slInitAutoCheckboxToggle(d,g,f){var c=$(d);
if(!c){return}var a=c.getInputs("checkbox",g);if(!a){return}for(var b=0;b<a.length;b++){a[b].observe("click",slAutoCheckboxToggle.curry(d,a[b],g,f))}}function slHideEmbededObjects(){$$("object","embed").each(function(a){a.style.display="none"
})}function slShowEmbededObjects(){$$("object","embed").each(function(a){a.style.display="block"})}function slToggleCheckboxesWithClass(a,b){slToggleCheckboxesWithClass(a,b,true)}function slToggleCheckboxesWithClass(c,d,a){var f=$$("."+c);
for(var b=0;b<f.length;++b){var g=f[b];g.checked=d;if(a){g.onchange()}}}function slSuspendOnClick(c){var b=$(c);if(!b){return}var a=Element.readAttribute(b,"onclick");if(a){Element.writeAttribute(b,"onclick","");
Element.writeAttribute(b,"slsupsendedonclick",a)}}function slReattachOnClick(c){var b=$(c);if(!b){return}var a=Element.readAttribute(b,"slsupsendedonclick");if(a){Element.writeAttribute(b,"onclick",a)}}var SLFlash=Class.create({initialize:function(a){this.id=a
},run:function(){var a=AC_GetArgs(arguments,".swf","movie","clsid:d27cdb6e-ae6d-11cf-96b8-444553540000","application/x-shockwave-flash");this.generateObject(a.objAttrs,a.params,a.embedAttrs)},generateObject:function(f,d,a){var c="";
if(isIE&&isWin&&!isOpera){c+="<object ";for(var b in f){c+=b+'="'+f[b]+'" '}c+=">";for(var b in d){c+='<param name="'+b+'" value="'+d[b]+'" /> '}c+="</object>"}else{c+="<embed ";for(var b in a){c+=b+'="'+a[b]+'" '
}c+="> </embed>"}$(this.id).update(c)}});function slToggleTableRow(f,b){var g=$(f);var c=g.up("table");var d=c.select("tr");for(var a=0;a<d.length;a++){d[a].removeClassName(b)}g.addClassName(b)}function slEnsureElement(c,b){if($(c)!=undefined){return
}var a=document.getElementsByTagName("body").item(0);Element.insert(a,{bottom:b})}function slEnsureDialog(d,c,b){if($(d)!=undefined){return}var a=document.getElementsByTagName("body").item(0);Element.insert(a,{bottom:'<div id="'+d+'" class="gui_dialog" style="display:none" slModifyable="true" slWidth="'+c+'" slHeight="'+b+'"><div class="hd"> </div><div class="bd"> </div></div>'})
}function slOnKeyDownEnter(b,a){if((b==undefined?window.event:b).keyCode==13){a()}return true}function slClock(c,j,k){var g=$(c);if(g==null){return}var f=new Date();var d=f.getHours();var l=((d<10)?" 0":" ")+d;
var b=f.getMinutes();l+=((b<10)?":0":":")+b;if(j){var a=f.getSeconds();l+=((a<10)?":0":":")+a}if(k){var i=f.getFullYear();var h=f.getMonth()+1;l=f.getDate()+"."+h+"."+i+" "+l}g.innerHTML=l;setTimeout("slClock('"+c+"', "+j+", "+k+")",1000)
}function slInitFormInfoText(d,c,a){c="\u200b"+c;var b=$(d);if(!b.value||b.value==""){b.value=c;b.addClassName(a)}b.observe("blur",function(g){var f=Event.element(g);if(f.value==""){f.addClassName(a);f.value=c
}});b.observe("focus",function(g){var f=Event.element(g);f.removeClassName(a);if(f.value==c){f.value=""}})}function slPrintElement(c){var b=document.getElementById(c);var a=window.open("","print","width=740,height=325,top=200,left=250,toolbars=no,scrollbars=yes,status=no,resizable=no");
a.document.writeln(b.innerHTML);a.document.close();a.focus();a.print();a.close()}
/*	SWFObject v2.2 <http://code.google.com/p/swfobject/> 
	is released under the MIT License <http://www.opensource.org/licenses/mit-license.php> 
*/
var swfobject=function(){var I="undefined",t="object",X="Shockwave Flash",ab="ShockwaveFlash.ShockwaveFlash",s="application/x-shockwave-flash",W="SWFObjectExprInst",C="onreadystatechange",T=window,k=document,w=navigator,Y=false,Z=[i],q=[],S=[],N=[],m,V,J,G,O=false,a=false,p,L,n=true,R=function(){var af=typeof k.getElementById!=I&&typeof k.getElementsByTagName!=I&&typeof k.createElement!=I,am=w.userAgent.toLowerCase(),ad=w.platform.toLowerCase(),aj=ad?/win/.test(ad):/win/.test(am),ah=ad?/mac/.test(ad):/mac/.test(am),ak=/webkit/.test(am)?parseFloat(am.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,ac=!+"\v1",al=[0,0,0],ag=null;
if(typeof w.plugins!=I&&typeof w.plugins[X]==t){ag=w.plugins[X].description;if(ag&&!(typeof w.mimeTypes!=I&&w.mimeTypes[s]&&!w.mimeTypes[s].enabledPlugin)){Y=true;ac=false;ag=ag.replace(/^.*\s+(\S+\s+\S+$)/,"$1");
al[0]=parseInt(ag.replace(/^(.*)\..*$/,"$1"),10);al[1]=parseInt(ag.replace(/^.*\.(.*)\s.*$/,"$1"),10);al[2]=/[a-zA-Z]/.test(ag)?parseInt(ag.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof T.ActiveXObject!=I){try{var ai=new ActiveXObject(ab);
if(ai){ag=ai.GetVariable("$version");if(ag){ac=true;ag=ag.split(" ")[1].split(",");al=[parseInt(ag[0],10),parseInt(ag[1],10),parseInt(ag[2],10)]}}}catch(ae){}}}return{w3:af,pv:al,wk:ak,ie:ac,win:aj,mac:ah}
}(),l=function(){if(!R.w3){return}if((typeof k.readyState!=I&&k.readyState=="complete")||(typeof k.readyState==I&&(k.getElementsByTagName("body")[0]||k.body))){g()}if(!O){if(typeof k.addEventListener!=I){k.addEventListener("DOMContentLoaded",g,false)
}if(R.ie&&R.win){k.attachEvent(C,function(){if(k.readyState=="complete"){k.detachEvent(C,arguments.callee);g()}});if(T==top){(function(){if(O){return}try{k.documentElement.doScroll("left")}catch(ac){setTimeout(arguments.callee,0);
return}g()})()}}if(R.wk){(function(){if(O){return}if(!/loaded|complete/.test(k.readyState)){setTimeout(arguments.callee,0);return}g()})()}u(g)}}();function g(){if(O){return}try{var ae=k.getElementsByTagName("body")[0].appendChild(H("span"));
ae.parentNode.removeChild(ae)}catch(af){return}O=true;var ac=Z.length;for(var ad=0;ad<ac;ad++){Z[ad]()}}function P(ac){if(O){ac()}else{Z[Z.length]=ac}}function u(ad){if(typeof T.addEventListener!=I){T.addEventListener("load",ad,false)
}else{if(typeof k.addEventListener!=I){k.addEventListener("load",ad,false)}else{if(typeof T.attachEvent!=I){j(T,"onload",ad)}else{if(typeof T.onload=="function"){var ac=T.onload;T.onload=function(){ac();
ad()}}else{T.onload=ad}}}}}function i(){if(Y){aa()}else{M()}}function aa(){var ac=k.getElementsByTagName("body")[0];var af=H(t);af.setAttribute("type",s);var ae=ac.appendChild(af);if(ae){var ad=0;(function(){if(typeof ae.GetVariable!=I){var ag=ae.GetVariable("$version");
if(ag){ag=ag.split(" ")[1].split(",");R.pv=[parseInt(ag[0],10),parseInt(ag[1],10),parseInt(ag[2],10)]}}else{if(ad<10){ad++;setTimeout(arguments.callee,10);return}}ac.removeChild(af);ae=null;M()})()}else{M()
}}function M(){var al=q.length;if(al>0){for(var ak=0;ak<al;ak++){var ad=q[ak].id;var ag=q[ak].callbackFn;var af={success:false,id:ad};if(R.pv[0]>0){var aj=c(ad);if(aj){if(K(q[ak].swfVersion)&&!(R.wk&&R.wk<312)){B(ad,true);
if(ag){af.success=true;af.ref=E(ad);ag(af)}}else{if(q[ak].expressInstall&&F()){var an={};an.data=q[ak].expressInstall;an.width=aj.getAttribute("width")||"0";an.height=aj.getAttribute("height")||"0";if(aj.getAttribute("class")){an.styleclass=aj.getAttribute("class")
}if(aj.getAttribute("align")){an.align=aj.getAttribute("align")}var am={};var ac=aj.getElementsByTagName("param");var ah=ac.length;for(var ai=0;ai<ah;ai++){if(ac[ai].getAttribute("name").toLowerCase()!="movie"){am[ac[ai].getAttribute("name")]=ac[ai].getAttribute("value")
}}U(an,am,ad,ag)}else{r(aj);if(ag){ag(af)}}}}}else{B(ad,true);if(ag){var ae=E(ad);if(ae&&typeof ae.SetVariable!=I){af.success=true;af.ref=ae}ag(af)}}}}}function E(af){var ac=null;var ad=c(af);if(ad&&ad.nodeName=="OBJECT"){if(typeof ad.SetVariable!=I){ac=ad
}else{var ae=ad.getElementsByTagName(t)[0];if(ae){ac=ae}}}return ac}function F(){return !a&&K("6.0.65")&&(R.win||R.mac)&&!(R.wk&&R.wk<312)}function U(af,ag,ac,ae){a=true;J=ae||null;G={success:false,id:ac};
var aj=c(ac);if(aj){if(aj.nodeName=="OBJECT"){m=h(aj);V=null}else{m=aj;V=ac}af.id=W;if(typeof af.width==I||(!/%$/.test(af.width)&&parseInt(af.width,10)<310)){af.width="310"}if(typeof af.height==I||(!/%$/.test(af.height)&&parseInt(af.height,10)<137)){af.height="137"
}k.title=k.title.slice(0,47)+" - Flash Player Installation";var ai=R.ie&&R.win?"ActiveX":"PlugIn",ah="MMredirectURL="+T.location.toString().replace(/&/g,"%26")+"&MMplayerType="+ai+"&MMdoctitle="+k.title;
if(typeof ag.flashvars!=I){ag.flashvars+="&"+ah}else{ag.flashvars=ah}if(R.ie&&R.win&&aj.readyState!=4){var ad=H("div");ac+="SWFObjectNew";ad.setAttribute("id",ac);aj.parentNode.insertBefore(ad,aj);aj.style.display="none";
(function(){if(aj.readyState==4){aj.parentNode.removeChild(aj)}else{setTimeout(arguments.callee,10)}})()}z(af,ag,ac)}}function r(ad){if(R.ie&&R.win&&ad.readyState!=4){var ac=H("div");ad.parentNode.insertBefore(ac,ad);
ac.parentNode.replaceChild(h(ad),ac);ad.style.display="none";(function(){if(ad.readyState==4){ad.parentNode.removeChild(ad)}else{setTimeout(arguments.callee,10)}})()}else{ad.parentNode.replaceChild(h(ad),ad)
}}function h(ah){var ag=H("div");if(R.win&&R.ie){ag.innerHTML=ah.innerHTML}else{var ae=ah.getElementsByTagName(t)[0];if(ae){var ai=ae.childNodes;if(ai){var ad=ai.length;for(var af=0;af<ad;af++){if(!(ai[af].nodeType==1&&ai[af].nodeName=="PARAM")&&!(ai[af].nodeType==8)){ag.appendChild(ai[af].cloneNode(true))
}}}}}return ag}function z(an,al,ad){var ac,af=c(ad);if(R.wk&&R.wk<312){return ac}if(af){if(typeof an.id==I){an.id=ad}if(R.ie&&R.win){var am="";for(var aj in an){if(an[aj]!=Object.prototype[aj]){if(aj.toLowerCase()=="data"){al.movie=an[aj]
}else{if(aj.toLowerCase()=="styleclass"){am+=' class="'+an[aj]+'"'}else{if(aj.toLowerCase()!="classid"){am+=" "+aj+'="'+an[aj]+'"'}}}}}var ak="";for(var ai in al){if(al[ai]!=Object.prototype[ai]){ak+='<param name="'+ai+'" value="'+al[ai]+'" />'
}}af.outerHTML='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'+am+">"+ak+"</object>";S[S.length]=an.id;ac=c(an.id)}else{var ae=H(t);ae.setAttribute("type",s);for(var ah in an){if(an[ah]!=Object.prototype[ah]){if(ah.toLowerCase()=="styleclass"){ae.setAttribute("class",an[ah])
}else{if(ah.toLowerCase()!="classid"){ae.setAttribute(ah,an[ah])}}}}for(var ag in al){if(al[ag]!=Object.prototype[ag]&&ag.toLowerCase()!="movie"){f(ae,ag,al[ag])}}af.parentNode.replaceChild(ae,af);ac=ae
}}return ac}function f(ae,ac,ad){var af=H("param");af.setAttribute("name",ac);af.setAttribute("value",ad);ae.appendChild(af)}function D(ad){var ac=c(ad);if(ac&&ac.nodeName=="OBJECT"){if(R.ie&&R.win){ac.style.display="none";
(function(){if(ac.readyState==4){b(ad)}else{setTimeout(arguments.callee,10)}})()}else{ac.parentNode.removeChild(ac)}}}function b(ae){var ad=c(ae);if(ad){for(var ac in ad){if(typeof ad[ac]=="function"){ad[ac]=null
}}ad.parentNode.removeChild(ad)}}function c(ae){var ac=null;try{ac=k.getElementById(ae)}catch(ad){}return ac}function H(ac){return k.createElement(ac)}function j(ae,ac,ad){ae.attachEvent(ac,ad);N[N.length]=[ae,ac,ad]
}function K(ae){var ad=R.pv,ac=ae.split(".");ac[0]=parseInt(ac[0],10);ac[1]=parseInt(ac[1],10)||0;ac[2]=parseInt(ac[2],10)||0;return(ad[0]>ac[0]||(ad[0]==ac[0]&&ad[1]>ac[1])||(ad[0]==ac[0]&&ad[1]==ac[1]&&ad[2]>=ac[2]))?true:false
}function A(ah,ad,ai,ag){if(R.ie&&R.mac){return}var af=k.getElementsByTagName("head")[0];if(!af){return}var ac=(ai&&typeof ai=="string")?ai:"screen";if(ag){p=null;L=null}if(!p||L!=ac){var ae=H("style");
ae.setAttribute("type","text/css");ae.setAttribute("media",ac);p=af.appendChild(ae);if(R.ie&&R.win&&typeof k.styleSheets!=I&&k.styleSheets.length>0){p=k.styleSheets[k.styleSheets.length-1]}L=ac}if(R.ie&&R.win){if(p&&typeof p.addRule==t){p.addRule(ah,ad)
}}else{if(p&&typeof k.createTextNode!=I){p.appendChild(k.createTextNode(ah+" {"+ad+"}"))}}}function B(ae,ac){if(!n){return}var ad=ac?"visible":"hidden";if(O&&c(ae)){c(ae).style.visibility=ad}else{A("#"+ae,"visibility:"+ad)
}}function Q(ad){var ae=/[\\\"<>\.;]/;var ac=ae.exec(ad)!=null;return ac&&typeof encodeURIComponent!=I?encodeURIComponent(ad):ad}var d=function(){if(R.ie&&R.win){window.attachEvent("onunload",function(){var ah=N.length;
for(var ag=0;ag<ah;ag++){N[ag][0].detachEvent(N[ag][1],N[ag][2])}var ae=S.length;for(var af=0;af<ae;af++){D(S[af])}for(var ad in R){R[ad]=null}R=null;for(var ac in swfobject){swfobject[ac]=null}swfobject=null
})}}();return{registerObject:function(ag,ac,af,ae){if(R.w3&&ag&&ac){var ad={};ad.id=ag;ad.swfVersion=ac;ad.expressInstall=af;ad.callbackFn=ae;q[q.length]=ad;B(ag,false)}else{if(ae){ae({success:false,id:ag})
}}},getObjectById:function(ac){if(R.w3){return E(ac)}},embedSWF:function(ag,am,aj,al,ad,af,ae,ai,ak,ah){var ac={success:false,id:am};if(R.w3&&!(R.wk&&R.wk<312)&&ag&&am&&aj&&al&&ad){B(am,false);P(function(){aj+="";
al+="";var ao={};if(ak&&typeof ak===t){for(var aq in ak){ao[aq]=ak[aq]}}ao.data=ag;ao.width=aj;ao.height=al;var ar={};if(ai&&typeof ai===t){for(var ap in ai){ar[ap]=ai[ap]}}if(ae&&typeof ae===t){for(var an in ae){if(typeof ar.flashvars!=I){ar.flashvars+="&"+an+"="+ae[an]
}else{ar.flashvars=an+"="+ae[an]}}}if(K(ad)){var at=z(ao,ar,am);if(ao.id==am){B(am,true)}ac.success=true;ac.ref=at}else{if(af&&F()){ao.data=af;U(ao,ar,am,ah);return}else{B(am,true)}}if(ah){ah(ac)}})}else{if(ah){ah(ac)
}}},switchOffAutoHideShow:function(){n=false},ua:R,getFlashPlayerVersion:function(){return{major:R.pv[0],minor:R.pv[1],release:R.pv[2]}},hasFlashPlayerVersion:K,createSWF:function(ae,ad,ac){if(R.w3){return z(ae,ad,ac)
}else{return undefined}},showExpressInstall:function(ae,af,ac,ad){if(R.w3&&F()){U(ae,af,ac,ad)}},removeSWF:function(ac){if(R.w3){D(ac)}},createCSS:function(af,ae,ad,ac){if(R.w3){A(af,ae,ad,ac)}},addDomLoadEvent:P,addLoadEvent:u,getQueryParamValue:function(af){var ae=k.location.search||k.location.hash;
if(ae){if(/\?/.test(ae)){ae=ae.split("?")[1]}if(af==null){return Q(ae)}var ad=ae.split("&");for(var ac=0;ac<ad.length;ac++){if(ad[ac].substring(0,ad[ac].indexOf("="))==af){return Q(ad[ac].substring((ad[ac].indexOf("=")+1)))
}}}return""},expressInstallCallback:function(){if(a){var ac=c(W);if(ac&&m){ac.parentNode.replaceChild(m,ac);if(V){B(V,true);if(R.ie&&R.win){m.style.display="block"}}if(J){J(G)}}a=false}}}}();try{console.log("init console... done")
}catch(e){console={log:function(){},error:function(){}}}var SL={utils:{},effects:{},ui:{},browser:{IE6:Prototype.Browser.IE&&parseInt(navigator.userAgent.substring(navigator.userAgent.indexOf("MSIE")+5))==6},storage:$H()};
(function(){SL.getIE=function(){if(navigator.appName!="Microsoft Internet Explorer"){return -1}var a=new RegExp("MSIE ([0-9]{1,}[.0-9]{0,})");if(a.exec(navigator.userAgent)!=null){return parseFloat(RegExp.$1)
}return -1};Hash.prototype.setDefault=function(a,b){if(this.get(a)==undefined){this.set(a,b)}};Hash.prototype.ensureHash=function(a){if(this.get(a)==undefined){this.set(a,$H())}return this.get(a)};Element.addMethods({setStyle:function(b,c){try{b=$(b);
var g=b.style,a;if(Object.isString(c)){b.style.cssText+=";"+c;return c.include("opacity")?b.setOpacity(c.match(/opacity:\s*(\d?\.?\d*)/)[1]):b}for(var f in c){var d=c[f];try{if(d&&(d.toLowerCase().startsWith("nan")||d.toLowerCase().startsWith("infinity"))){continue
}if(f=="opacity"){b.setOpacity(d)}else{g[(f=="float"||f=="cssFloat")?(Object.isUndefined(g.styleFloat)?"cssFloat":"styleFloat"):f]=d}}catch(h){console.error("Error setting style:",f,"->",d," ",h)}}}catch(h){console.error(h)
}return b},getStorage:function(a){a=$(a);var b=a._slStorage;if(!b){b=$H();a._slStorage=b}return b},hasFixedPosition:function(a){return Element.getFixedParent(a)?true:false},getFixedParent:function(a){while(a){if(!a.tagName||a.tagName.toLowerCase()=="body"){break
}if(a.getStyle("position")=="fixed"){return a}a=a.up()}return null},cumulativeScrollOffsetFixed:function(b){var a=0,c=0;do{a+=b.scrollTop||0;c+=b.scrollLeft||0;if(b.getStyle("position")=="fixed"){break
}b=b.parentNode}while(b);return Element._returnOffset(c,a)},findZIndex:function(a){do{if(!a.tagName||a.tagName.toLowerCase()=="body"){break}var b=a.getStyle("z-index");if(b){return parseInt(b)}a=a.parentNode
}while(a)}})})();if(typeof PopUp!="function"){function PopUp(h,d,l){if(l==null){var b=SLPopupSize?SLPopupSize[0]:650;var k=SLPopupSize?SLPopupSize[1]:600;var j=(screen.width-b)/2;var f=(screen.height-k)/2;
var i=",top="+f;var g=",left="+j;var a=",width="+b;var c=",height="+k;win=window.open(h,d,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1"+i+g+a+c).focus()}else{win=window.open(h,d,"toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,"+l).focus()
}}}(function(){SL.utils.removeAMP=function(s){while(true){var i=s.indexOf("&amp;");if(i==-1){break}s=s.substring(0,i)+"&"+s.substring(i+"&amp;".length)}return s};SL.utils.addOrReplaceArg=function(url,arg,value){url=SL.utils.removeAMP(url);
var match="&args."+arg+"=";var matchPos=url.indexOf(match);if(matchPos==-1){return value==null?url:(url+match+value)}var trailing=url.substring(matchPos+match.length);return url.substring(0,matchPos)+(value==null?"":(match+value))+(trailing.indexOf("&")==-1?"":trailing.substring(trailing.indexOf("&")))
};SL.utils.addOrReplaceUrlParam=function(url,arg,value){url=SL.utils.removeAMP(url);var match="&"+arg+"=";var matchPos=url.indexOf(match);if(matchPos==-1){return value==null?url:(url+match+value)}var trailing=url.substring(matchPos+match.length);
return url.substring(0,matchPos)+(value==null?"":(match+value))+(trailing.indexOf("&")==-1?"":trailing.substring(trailing.indexOf("&")))};SL.utils.getArg=function(url,arg,value){url=SL.utils.removeAMP(url);
var match="&args."+arg+"=";var matchPos=url.indexOf(match);if(matchPos<0){return undefined}var trailing=url.substring(matchPos+match.length);matchPos=trailing.indexOf("&");if(matchPos<0){return trailing
}return trailing.substring(0,matchPos)};SL.utils.createBodyElement=function(name,attributes){var e=new Element(name,attributes);$$("body")[0].appendChild(e);return e};SL.utils.reparentToBody=function(e){SL.utils.reparent(e,document.getElementsByTagName("body").item(0))
};SL.utils.reparent=function(e,newParent){e.remove();newParent.appendChild(e)};SL.utils._domReady=false;SL.utils._domReadyExecuted=false;SL.utils._domReadyFunctions=$A();document.observe("dom:loaded",function(){SL.utils._domReady=true;
SL.utils._domReadyFunctions.each(function(f){try{f()}catch(e){console.error("Error executing onDomReady method:",f,e)}});SL.utils._domReadyFunctions=undefined;SL.utils._domReadyExecuted=true});SL.utils.onDomReady=function(f){if(SL.utils._domReady){try{f()
}catch(e){console.error(e)}}else{SL.utils._domReadyFunctions.push(f)}};SL.utils.isDomReady=function(){return SL.utils._domReady};SL.utils.focusFormElement=function(form,name){var elements=Form.getElements(form);
for(var i=0;i<elements.length;i++){if(elements[i].readAttribute("name")==name){elements[i].focus();return}}console.log("Form element not found:",form,":",name)};SL.utils.toArrayString=function(o){if(!o){return o
}if(Object.isString(o)){return o}if(Object.isArray(o)){return o.toString()}return $A(o).toString()};SL.utils.addFormSubmitWorkaround=function(e){$(e).select("form").each(function(f){f.select("input").each(function(e){if(e.readAttribute("type")=="text"||e.readAttribute("type")=="password"){e.observe("keypress",function(event){if(event.keyCode==Event.KEY_RETURN){var form=event.element().form;
try{if(Object.isFunction(form.submit)){form.submit()}else{form.submit.click()}}catch(ex){console.log(ex)}}})}})})};SL.utils.loadScript=function(url,cb,finishedCB){if(!SL.utils._loadedScripts){SL.utils._loadedScripts=$H()
}else{var h=SL.utils._loadedScripts.get(url);if(h){if(h.loaded){cb()}else{h.cbs.push(cb)}return}}console.log("Loading:",url);var h=$H();h.loaded=false;h.cbs=$A();h.cbs.push(cb);SL.utils._loadedScripts.set(url,h);
new Ajax.Request(url,{method:"get",evalJS:false,onSuccess:function(o){try{eval(o.responseText)}catch(e){console.log(e,":",o)}h.loaded=true;console.log("Loaded:",url);if(finishedCB){finishedCB()}h.cbs.each(function(cb){cb()
})}})};SL.utils.getFrameElement=function(frame,id){var f=frames[frame];if(!f){console.error("No frame:",frame,id);return undefined}return f.$(id)};SL.utils.executeAfterFrameDomReady=function(frame,cb){var id=undefined;
id=setInterval(function(){var f=frames[frame];if(f&&f.SL&&f.SL.utils._domReadyExecuted&&!f.__slInvalid){try{cb();clearInterval(id)}catch(e){clearInterval(id);console.error("Error in frame dom ready func:",e);
throw e}}},100)};SL.utils.loadJS=function(url){new Ajax.Request(url,{method:"get",evalJS:false,onSuccess:function(o){eval(o.responseText)}})};SL.utils.endsWithExtension=function(s,extensions){if(s==null||extensions==null){return false
}for(var i=0;i<extensions.length;++i){if(s.toLowerCase().endsWith("."+extensions[i].toLowerCase())){return true}}return false};SL.utils.supportsFileClick=function(){if(Prototype.Browser.IE){return false
}if(Prototype.Browser.Gecko){if(navigator.userAgent.indexOf("Firefox/3")>=0){return false}var r=/rv:([0-9]*).([0-9]*).([0-9]*)/.exec(navigator.userAgent);if(r!=null){console.log(r);var v1=parseInt(r[1]);
var v2=parseInt(r[2]);var v3=parseInt(r[3]);if(v1>1){return true}if(v1<1||v2<9){return false}if(v3<3){return false}}}return true};SL.utils.loadStyle=function(url,cb){if(SL.utils._loadedStyles){if(SL.utils._loadedStyles.get(url)){cb();
return}}else{SL.utils._loadedStyles=$H()}SL.utils._loadedStyles.set(url,true);new Ajax.Request(url,{method:"get",evalJS:false,onSuccess:function(o){var head=$$("head")[0];var e=new Element("link",{href:url,type:"text/css",rel:"stylesheet"});
head.appendChild(e);cb.defer()}})};SL.utils.reloadWithPrompt=function(id,reloadURL,arg,defaultValue,message){var v=window.prompt(message,defaultValue);if(v){SL.byID(id).load(reloadURL+"&args."+arg+"="+v)
}};SL.utils.locationReload=function(args){var href=location.href;$H(args).each(function(e){href=SL.utils.addOrReplaceUrlParam(href,e.key,e.value)});location.href=href}})();(function(){SL.byID=function(d){var c=$(d);
if(!c){console.error("SL.byID: unable to find element with id '"+d+"'");return}var a=c.retrieve("sl_component");if(a){return a}if(!SL.legacy){console.error("SL.byID: element '"+d+"' has no component")}var b=c.retrieve("sl_component_info");
if(b){console.log("Init configured component:",c,b);return new b.component(c,b.config)}return SL.legacy.initWidget(c)};SL.getC=function(b){var a=$(b);if(a){return a.retrieve("sl_component")}};SL.getCC=function(b){var c=b;
while(c){var a=c.retrieve("sl_component");if(a){return a}c=c.up()}};SL.register=function(d,b,a){b=$(b);if(!b){console.error("No element to regsiter:",b,d,a)}console.log("Configure component:",b,d,a);b.store("sl_component_info",{component:d,config:a})
};SL.initDefered=function(d,b,a){SL.utils.onDomReady(function(h,g,f){new h(g,f)}.curry(d,b,a))};SL.initOnEvent=function(n,a,l,k,d,b){var m=$(n);if(!m){return}var i=m.retrieve("sl_init_events");if(!i){i=$H();
m.store("sl_init_events",i)}var p=i.get(a);if(!p){p=$A();i.set(a,p);var g=function(r,c,q){var f=r.retrieve("sl_init_events");f.get(c).each(function(s,h){h(q)}.curry(r));r.stopObserving(c,f.get("_f_"+c));
f.set("_f_"+c,undefined);f.set(c,undefined)}.curry(m,a);i.set("_f_"+a,g);m.observe(a,g)}var j=function(u,s,f,t,r){var q=$(s);if(q&&q.retrieve("sl_component")){return}var h=new u(s,f);h.connectDestroy(t);
h.notifyInitEvent(r)}.curry(l,k,d,b?n:null);p.push(j)};SL.ensureComponent=function(g,f,b){var d=$(f);if(!d){return new g(f,b)}var a=d.retrieve("sl_component");if(a){return a}return new g(f,b)};SL.componentExists=function(b){var a=$(b);
if(!a){return false}return a.retrieve("sl_component")?true:false};SL.Component=Class.create({initialize:function(c,b){if(arguments.length==1&&(typeof c)!="string"&&!$(c)){b=c;this.e=undefined}else{this.e=$(c)
}if(!this.e){this.e=SL.utils.createBodyElement("div");this.e.setStyle({display:"none"});if(c){this.e.writeAttribute("id",c)}}else{if(!this.e.up()){var a=document.getElementsByTagName("body").item(0);a.appendChild(this.e)
}}this.id=this.e.identify();this.e.store("sl_component",this);this.e.addClassName("sljs__component__");this.config=$H(b);this.version=1;this.config.setDefault("spinner_class","gui_busy_img");if(this.config.get("add_css")){this.e.addClassName(this.config.get("add_css"))
}this.url=this.config.get("url");if(!this.url){this.url=this.e.readAttribute("slUrl")}if(this.config.get("admin_reset")){this.e.addClassName(this.config.get("admin_reset"))}this.init();if(this.config.get("after_init")){this.config.get("after_init")(this)
}if(this.config.get("auto_init")){if(!this.url){console.log("Auto init component without url",this)}else{console.log("Auto init component",this);this.load(this.url,null)}}},init:function(){},notifyInitEvent:function(a){},setUrl:function(a){this.url=a
},setLoading:function(b){this._cleanup(true);var c=$(this.id+"__custom_loading__");if(c){c.remove();c.setStyle({visibility:"visible"});var a=new Element("div");a.setStyle({width:this.e.getWidth()+"px",height:this.e.getHeight()+"px",position:"relative",margin:"0",padding:"0"});
b.update(a);a.appendChild(c)}else{b.update(this._getLoadingContent())}this._initLoadingDelay();this.e.addClassName("component_loading")},_initLoadingDelay:function(){var a=this.config.get("loading_delay");
if(!a||a<=0){return}this.e.setStyle({visibility:"hidden"});setTimeout(function(b){if(this.version==b){this.e.setStyle({visibility:"visible"})}}.bind(this,this.version+1),a)},_resetLoadingDelay:function(){if(this.e.getStyle("visibility")!="hidden"){return
}this.version++;setTimeout(function(a){if(this.version==a){this.e.setStyle({visibility:"visible"})}}.bind(this,this.version),1)},_getLoadingContent:function(a){return'<div class="'+this.config.get("spinner_class")+(a?" large":"")+'"></div>'
},_onSuccess:function(a){this.e.removeClassName("component_loading");this._onSuccessContent(a.request.options.slVersion,a.responseText)},_onSuccessContent:function(a,b){if(SL.legacy){slCloseTooltips()}if(a!=undefined&&a!=this.version){return
}try{this._setContent(b);this.onSuccess();this._emitContentChanged();if(this.nextLoadJS){this.nextLoadJS.each(function(d){d()});this.nextLoadJS=undefined}}catch(c){log.error(c)}this._resetLoadingDelay()
},onFailure:function(b){this.e.removeClassName("component_loading");this.e.setStyle({visibility:"visible"});var a=b.request.options.slVersion;if(a!=undefined&&a!=this.version){console.error("SL.Component failure on old version: ",b,":",a,":",this.version);
return}if(this.id=="admin_panel_main"){setTimeout(function(){document.location.reload()},1500)}if(this.e.up("html").readAttribute("lang")=="de"){this._setContent('<div class="gui_component_error">Fehler beim Laden der Komponente</div>')
}else{this._setContent('<div class="gui_component_error">Error loading component</div>')}console.error("SL.Component failure: ",b)},onError:function(a){console.error("SL.Component error: ",a)},_setContent:function(a){this._cleanup(true);
try{this.e.update(a);if(SL.legacy){SL.legacy.autoInitWidgets(this.e)}}catch(b){this.onError(b)}Element._cleanupPrototypeEventCache.defer()},_emitContentChanged:function(b){var c=this.e.up();while(c){if(c.tagName=="BODY"){break
}var a=c.retrieve("sl_component");if(a){a.onChildComponentChanged(this,b)}c=c.up()}},_getReloadURL:function(a){if(!a){a=this.url}if(this.reloadArgs){$H(this.reloadArgs).each(function(b){a=SL.utils.addOrReplaceArg(a,b.key,b.value)
})}return a},load:function(b,a){this.updatedArgs=undefined;if(a){this.setLoadingSpinner(a)}else{if(this.config.get("load_shaded")){this.setLoadingSpinner(this.id)}else{this.setLoading(this.e)}}this.version++;
this.url=b;new Ajax.Request(this.getReloadURL(b),{method:"post",onSuccess:this._onSuccess.bind(this),onFailure:this.onFailure.bind(this),slVersion:this.version})},loadPost:function(c,b,a){this.updatedArgs=undefined;
if(a){this.setLoadingSpinner(a)}else{if(this.config.get("load_shaded")){this.setLoadingSpinner(this.id)}else{this.setLoading(this.e)}}if(this.reloadArgs){$H(this.reloadArgs).each(function(d){if(!b){b=$H()
}b.set(d.key,d.value)})}new Ajax.Request(this.getReloadURL(c,true),{method:"post",parameters:b,onSuccess:this._onSuccess.bind(this),onFailure:this.onFailure.bind(this)})},setReloadArg:function(a,b){if(!this.reloadArgs){this.reloadArgs=$H({})
}this.reloadArgs.set(a,b)},onSuccess:function(){},onChildComponentChanged:function(a){},setDimension:function(b,a){this.e.setStyle({width:b+"px",height:a+"px"})},setLoadingSpinner:function(c){var f=$(c);
if(f&&!f.down("#__"+this.id+"__loading")){var b=this.e.getHeight();var d=b<=0||b>=100;var a=f.getStyle("position");if(!a||(a!="absolute"&&a!="relative"&&a!="fixed")){f.setStyle({position:"relative"})}var h=new Element("div",{style:"position:absolute;top:0;bottom:0;left:0;right:0;background-color:#fff;cursor:progress","class":this.config.get("spinner_class")+(d?"_overlay inline":"_overlay")});
h.setOpacity(0.3);f.insert(h);var g=new Element("div",{id:this.id+"__loading",style:"position:absolute;top:0;bottom:0;left:0;right:0;cursor:progress","class":this.config.get("spinner_class")+(d?" inline":"")});
g.setOpacity(0.3);f.insert(g)}this.e.addClassName("component_loading")},loadBackground:function(a){this.url=a;this.updatedArgs=undefined;this.version++;new Ajax.Request(this.getReloadURL(a),{method:"get",onSuccess:this._onSuccess.bind(this),onFailure:this.onFailure.bind(this),slVersion:this.version})
},replaceArgs:function(c,d,b){var a=this.url;if(!a){console.error("Replace args: No url for component:",this);return}$H(c).each(function(f){a=addOrReplaceArg(a,f.key,f.value)});if(d){this.loadBackground(this.getReloadURL(a))
}else{this.load(this.getReloadURL(a),b)}},updateArgs:function(a){if(!this.updatedArgs){this.updatedArgs=$H()}$H(a).each(function(b){this.url=addOrReplaceArg(this.url,b.key,b.value);this.updatedArgs.set(b.key,b.value)
}.bind(this))},toggleArg:function(a,c){if(!this.updatedArgs){this.updatedArgs=$H()}var b=this.updatedArgs.get(a);if(b==undefined&&this.url){b=SL.utils.getArg(this.url)}var d;if(b!=undefined){if(b===true){d=true
}else{if(b===false){d=false}else{if(b=="true"){d=true}else{d=false}}}d=!b}else{d=c}this.url=SL.utils.addOrReplaceArg(this.url,a,d);this.updatedArgs.set(a,d)},refresh:function(a,h,b){if(!this.url){var j=this.getParentComponent();
if(j!=null){j.refresh(a,h,b)}else{console.error("No parent to refresh:",this)}return}if(h){var c=this.url.split("?");if(c.length>1){this.url=c[0]+"?";c=c[1].split("&");var g=true;for(var d=0;d<c.length;
d++){var f=false;for(var k=0;k<h.length;k++){if(c[d].startsWith("args."+h[k])){f=true}}if(!f){if(g){g=false}else{this.url+="&"}this.url+=c[d]}}}}if(b){this.load(this.getReloadURL(),this.id)}else{if(a){this.loadBackground(this.getReloadURL())
}else{this._cleanup(true);this.load(this.getReloadURL())}}},refreshDelay:function(b,a){this.version++;if(this.e&&this.e.parentNode){setTimeout(this._delayedRefresh.bind(this,b,this.version),a)}},_delayedRefresh:function(a,b){if(this.version==b){this.refresh(a)
}},getParentComponent:function(){var b=this.e.up();while(b){if(b.tagName=="BODY"){return null}var a=b.retrieve("sl_component");if(a){return a}b=b.up()}return null},getReloadURL:function(a,b){if(!a){a=this.url
}if(!b&&this.reloadArgs){$H(this.reloadArgs).each(function(c){a=SL.utils.addOrReplaceArg(a,c.key,c.value)})}return a},_destroy:function(){console.log("Destroying component:",this.id);this._cleanup();this.e.store("sl_component",undefined);
if(this.e.parentNode){this.e.remove()}(function(b){var a=$(b);if(a&&a.parentNode){a.remove()}}.curry(this.id).defer())},uploadForm:function(n,m,k){this.version++;try{var a=this.e.select(".sljs__component__");
if(a){a.each(function(f){try{var h=f.retrieve("sl_component");if(h){h.updateForPost()}}catch(f){console.error(f)}})}}catch(j){console.log(j)}try{slUpdateEditors(this.e,true)}catch(j){console.error(j)}var j=SL.utils.createBodyElement("div");
var b=j.identify()+"_iframe";var d=new Element("iframe",{id:b,name:b,stlye:"display:none",src:"about:blank"});j.appendChild(d);d.observe("load",this._iframeLoaded.bind(this,j,b,this.version));var i=$(n);
if(this.updatedArgs){try{this.updatedArgs.each(function(f){var h=i.down('input[name="args.'+f.key+'"]');if(h){h.writeAttribute("value",f.value+"")}else{i.appendChild(new Element("input",{type:"hidden",name:"args."+f.key,value:f.value+""}))
}})}catch(l){console.error(l)}}if(k){var c=$(k);try{if(c){var g=$H(c.serialize(true));g.each(function(p,h){p.insert({bottom:new Element("input",{type:"hidden",name:h.key,value:SL.utils.toArrayString(h.value)})})
}.curry(i))}}catch(j){console.error("Error merging foreign form:",j)}}i.writeAttribute("target",b);if(m){i.submit()}return true},updateForPost:function(){},_iframeLoaded:function(d,f,a){if(this.version!=a){console.error("Old version:",this.version," ",a);
return}console.log("Update for form upload:",this.id);var b=$(f).contentWindow.sl_reload_url;if(b){this.url=b}var c=$(f).contentWindow.sl_reload_content;this._onSuccessContent(a,c);(function(g){g.remove()
}.curry(d).defer())},submitUploadForm:function(d,a,c){var b=$(d);if(a&&c){b.appendChild(new Element("input",{type:"hidden",name:a,value:c}))}this.uploadForm(d,true)},_cleanup:function(a){if(!a){if(this.isCleanedUp){return
}this.isCleanedUp=true;try{this.cleanup()}catch(d){console.error(d)}var b=this.e.retrieve("sl_delete_notify");if(b){b.each(function(g){try{g.value._destroy()}catch(f){console.error(f)}});this.e.store("sl_delete_notify",undefined)
}}try{var c=this.e.select(".sljs__component__");if(c){c.each(function(f){var g=f.retrieve("sl_component");if(g){g._cleanup()}})}c=this.e.select(".sljs__delete_notify__");if(c){c.each(function(g){var f=g.retrieve("sl_delete_notify");
if(f){f.each(function(i){try{i.value._destroy()}catch(h){console.error(h)}})}g.store("sl_delete_notify",undefined)})}}catch(d){console.error(d)}},connectDestroy:function(c){if(!c){return}var b=$(c);var a=b.retrieve("sl_delete_notify");
if(!a){a=$H();b.store("sl_delete_notify",a);b.addClassName("sljs__delete_notify__")}if(!a.get(this.id)){a.set(this.id,this)}},cleanup:function(){},hide:function(a){if(a===true){var b=this.getParentComponent();
if(b){b.hide()}return}},registerAfterNextLoadJS:function(a){if(!this.nextLoadJS){this.nextLoadJS=$A()}this.nextLoadJS.push(a)}})})();(function(){SL.legacy={initWidget:function(d,f){var c=undefined;if(this.findWidget){c=this.findWidget(d);
if(d.readAttribute("slDDSource")||d.readAttribute("slDDTarget")){c=new SL.widgets.Widget(d)}}if(!c){c=new SL.Component(d)}if(f){var b=d.readAttribute("slLazy");if(b){var a=d.readAttribute("slUrl");c.load(a)
}}d.store("sl_component",c);return c},autoInitWidgets:function(c){var d;if(c){d=$(c).select(".gui_w_ai")}else{d=$$(".gui_w_ai")}for(var b=0,a=d.length;b<a;b++){SL.legacy.initWidget(d[b],true)}}}})();function slById(a){return SL.byID(a)
}function slRefreshInParentWindow(a){if(!window.opener){return}window.opener.SL.byID(a).refresh(false)}function slAutoInitWidgets(a){console.log("legacy slAutoInitWidgets");SL.legacy.autoInitWidgets(a)
}function slUpdateEditors(b,c){var d;if(b){d=b.select(".gui_editor")}else{d=$$(".gui_editor")}for(var a=0;a<d.length;a++){SL.byID(d[a]).update()}if(!c){if(b){d=b.select(".sljs__component__")}else{d=$$(".sljs__component__")
}if(d){d.each(function(f){var g=f.retrieve("sl_component");if(g){g.updateForPost()}})}}}function slRegisterOverlay(b){var a=document.SLOMgr;if(!a){a=new YAHOO.widget.OverlayManager();document.SLOMgr=a}a.register(b)
}function slRaiseOverlay(b){var a=document.SLOMgr;if(!a){a=new YAHOO.widget.OverlayManager();document.SLOMgr=a}a.bringToTop(b)}function slCloseTooltips(){var a=document.slTooltips;if(a){a.each(function(b){b.value._doHide()
})}}function slInitTooltip(b,a){SL.byID(b).initOnce(a)}SL.utils.onDomReady(function(){SL.legacy.autoInitWidgets.defer()});String.prototype.parseColor=function(){var a="#";if(this.slice(0,4)=="rgb("){var c=this.slice(4,this.length-1).split(",");
var b=0;do{a+=parseInt(c[b]).toColorPart()}while(++b<3)}else{if(this.slice(0,1)=="#"){if(this.length==4){for(var b=1;b<4;b++){a+=(this.charAt(b)+this.charAt(b)).toLowerCase()}}if(this.length==7){a=this.toLowerCase()
}}}return(a.length==7?a:(arguments[0]||this))};Element.collectTextNodes=function(a){return $A($(a).childNodes).collect(function(b){return(b.nodeType==3?b.nodeValue:(b.hasChildNodes()?Element.collectTextNodes(b):""))
}).flatten().join("")};Element.collectTextNodesIgnoreClass=function(a,b){return $A($(a).childNodes).collect(function(c){return(c.nodeType==3?c.nodeValue:((c.hasChildNodes()&&!Element.hasClassName(c,b))?Element.collectTextNodesIgnoreClass(c,b):""))
}).flatten().join("")};Element.setContentZoom=function(a,b){a=$(a);a.setStyle({fontSize:(b/100)+"em"});if(Prototype.Browser.WebKit){window.scrollBy(0,0)}return a};Element.getInlineOpacity=function(a){return $(a).style.opacity||""
};Element.forceRerendering=function(a){try{a=$(a);var c=document.createTextNode(" ");a.appendChild(c);a.removeChild(c)}catch(b){}};var Effect={_elementDoesNotExistError:{name:"ElementDoesNotExistError",message:"The specified DOM element does not exist, but is required for this effect to operate"},Transitions:{linear:Prototype.K,sinoidal:function(a){return(-Math.cos(a*Math.PI)/2)+0.5
},reverse:function(a){return 1-a},flicker:function(a){var a=((-Math.cos(a*Math.PI)/4)+0.75)+Math.random()/4;return a>1?1:a},wobble:function(a){return(-Math.cos(a*Math.PI*(9*a))/2)+0.5},pulse:function(b,a){return(-Math.cos((b*((a||5)-0.5)*2)*Math.PI)/2)+0.5
},spring:function(a){return 1-(Math.cos(a*4.5*Math.PI)*Math.exp(-a*6))},none:function(a){return 0},full:function(a){return 1}},DefaultOptions:{duration:1,fps:100,sync:false,from:0,to:1,delay:0,queue:"parallel"},tagifyText:function(a){var b="position:relative";
if(Prototype.Browser.IE){b+=";zoom:1"}a=$(a);$A(a.childNodes).each(function(c){if(c.nodeType==3){c.nodeValue.toArray().each(function(d){a.insertBefore(new Element("span",{style:b}).update(d==" "?String.fromCharCode(160):d),c)
});Element.remove(c)}})},multiple:function(b,c){var f;if(((typeof b=="object")||Object.isFunction(b))&&(b.length)){f=b}else{f=$(b).childNodes}var a=Object.extend({speed:0.1,delay:0},arguments[2]||{});var d=a.delay;
$A(f).each(function(h,g){new c(h,Object.extend(a,{delay:g*a.speed+d}))})},PAIRS:{slide:["SlideDown","SlideUp"],blind:["BlindDown","BlindUp"],appear:["Appear","Fade"]},toggle:function(b,c,a){b=$(b);c=(c||"appear").toLowerCase();
return Effect[Effect.PAIRS[c][b.visible()?1:0]](b,Object.extend({queue:{position:"end",scope:(b.id||"global"),limit:1}},a||{}))}};Effect.DefaultOptions.transition=Effect.Transitions.sinoidal;Effect.ScopedQueue=Class.create(Enumerable,{initialize:function(){this.effects=[];
this.interval=null},_each:function(a){this.effects._each(a)},add:function(b){var c=new Date().getTime();var a=Object.isString(b.options.queue)?b.options.queue:b.options.queue.position;switch(a){case"front":this.effects.findAll(function(d){return d.state=="idle"
}).each(function(d){d.startOn+=b.finishOn;d.finishOn+=b.finishOn});break;case"with-last":c=this.effects.pluck("startOn").max()||c;break;case"end":c=this.effects.pluck("finishOn").max()||c;break}b.startOn+=c;
b.finishOn+=c;if(!b.options.queue.limit||(this.effects.length<b.options.queue.limit)){this.effects.push(b)}if(!this.interval){this.interval=setInterval(this.loop.bind(this),15)}},remove:function(a){this.effects=this.effects.reject(function(b){return b==a
});if(this.effects.length==0){clearInterval(this.interval);this.interval=null}},loop:function(){var c=new Date().getTime();for(var b=0,a=this.effects.length;b<a;b++){this.effects[b]&&this.effects[b].loop(c)
}}});Effect.Queues={instances:$H(),get:function(a){if(!Object.isString(a)){return a}return this.instances.get(a)||this.instances.set(a,new Effect.ScopedQueue())}};Effect.Queue=Effect.Queues.get("global");
Effect.Base=Class.create({position:null,start:function(a){if(a&&a.transition===false){a.transition=Effect.Transitions.linear}this.options=Object.extend(Object.extend({},Effect.DefaultOptions),a||{});this.currentFrame=0;
this.state="idle";this.startOn=this.options.delay*1000;this.finishOn=this.startOn+(this.options.duration*1000);this.fromToDelta=this.options.to-this.options.from;this.totalTime=this.finishOn-this.startOn;
this.totalFrames=this.options.fps*this.options.duration;this.render=(function(){function b(d,c){if(d.options[c+"Internal"]){d.options[c+"Internal"](d)}if(d.options[c]){d.options[c](d)}}return function(c){if(this.state==="idle"){this.state="running";
b(this,"beforeSetup");if(this.setup){this.setup()}b(this,"afterSetup")}if(this.state==="running"){c=(this.options.transition(c)*this.fromToDelta)+this.options.from;this.position=c;b(this,"beforeUpdate");
if(this.update){this.update(c)}b(this,"afterUpdate")}}})();this.event("beforeStart");if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).add(this)
}},loop:function(c){if(c>=this.startOn){if(c>=this.finishOn){this.render(1);this.cancel();this.event("beforeFinish");if(this.finish){this.finish()}this.event("afterFinish");return}var b=(c-this.startOn)/this.totalTime,a=(b*this.totalFrames).round();
if(a>this.currentFrame){this.render(b);this.currentFrame=a}}},cancel:function(){if(!this.options.sync){Effect.Queues.get(Object.isString(this.options.queue)?"global":this.options.queue.scope).remove(this)
}this.state="finished"},event:function(a){if(this.options[a+"Internal"]){this.options[a+"Internal"](this)}if(this.options[a]){this.options[a](this)}},inspect:function(){var a=$H();for(property in this){if(!Object.isFunction(this[property])){a.set(property,this[property])
}}return"#<Effect:"+a.inspect()+",options:"+$H(this.options).inspect()+">"}});Effect.Parallel=Class.create(Effect.Base,{initialize:function(a){this.effects=a||[];this.start(arguments[1])},update:function(a){this.effects.invoke("render",a)
},finish:function(a){this.effects.each(function(b){b.render(1);b.cancel();b.event("beforeFinish");if(b.finish){b.finish(a)}b.event("afterFinish")})}});Effect.Tween=Class.create(Effect.Base,{initialize:function(c,g,f){c=Object.isString(c)?$(c):c;
var b=$A(arguments),d=b.last(),a=b.length==5?b[3]:null;this.method=Object.isFunction(d)?d.bind(c):Object.isFunction(c[d])?c[d].bind(c):function(h){c[d]=h};this.start(Object.extend({from:g,to:f},a||{}))
},update:function(a){this.method(a)}});Effect.Event=Class.create(Effect.Base,{initialize:function(){this.start(Object.extend({duration:0},arguments[0]||{}))},update:Prototype.emptyFunction});Effect.Opacity=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)}if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})}var a=Object.extend({from:this.element.getOpacity()||0,to:1},arguments[1]||{});
this.start(a)},update:function(a){this.element.setOpacity(a)}});Effect.Move=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({x:0,y:0,mode:"relative"},arguments[1]||{});this.start(a)},setup:function(){this.element.makePositioned();this.originalLeft=parseFloat(this.element.getStyle("left")||"0");this.originalTop=parseFloat(this.element.getStyle("top")||"0");
if(this.options.mode=="absolute"){this.options.x=this.options.x-this.originalLeft;this.options.y=this.options.y-this.originalTop}},update:function(a){this.element.setStyle({left:(this.options.x*a+this.originalLeft).round()+"px",top:(this.options.y*a+this.originalTop).round()+"px"})
}});Effect.MoveBy=function(b,a,c){return new Effect.Move(b,Object.extend({x:c,y:a},arguments[3]||{}))};Effect.Scale=Class.create(Effect.Base,{initialize:function(b,c){this.element=$(b);if(!this.element){throw (Effect._elementDoesNotExistError)
}var a=Object.extend({scaleX:true,scaleY:true,scaleContent:true,scaleFromCenter:false,scaleMode:"box",scaleFrom:100,scaleTo:c},arguments[2]||{});this.start(a)},setup:function(){this.restoreAfterFinish=this.options.restoreAfterFinish||false;
this.elementPositioning=this.element.getStyle("position");this.originalStyle={};["top","left","width","height","fontSize"].each(function(b){this.originalStyle[b]=this.element.style[b]}.bind(this));this.originalTop=this.element.offsetTop;
this.originalLeft=this.element.offsetLeft;var a=this.element.getStyle("font-size")||"100%";["em","px","%","pt"].each(function(b){if(a.indexOf(b)>0){this.fontSize=parseFloat(a);this.fontSizeType=b}}.bind(this));
this.factor=(this.options.scaleTo-this.options.scaleFrom)/100;this.dims=null;if(this.options.scaleMode=="box"){this.dims=[this.element.offsetHeight,this.element.offsetWidth]}if(/^content/.test(this.options.scaleMode)){this.dims=[this.element.scrollHeight,this.element.scrollWidth]
}if(!this.dims){this.dims=[this.options.scaleMode.originalHeight,this.options.scaleMode.originalWidth]}},update:function(a){var b=(this.options.scaleFrom/100)+(this.factor*a);if(this.options.scaleContent&&this.fontSize){this.element.setStyle({fontSize:this.fontSize*b+this.fontSizeType})
}this.setDimensions(this.dims[0]*b,this.dims[1]*b)},finish:function(a){if(this.restoreAfterFinish){this.element.setStyle(this.originalStyle)}},setDimensions:function(a,f){var g={};if(this.options.scaleX){g.width=f.round()+"px"
}if(this.options.scaleY){g.height=a.round()+"px"}if(this.options.scaleFromCenter){var c=(a-this.dims[0])/2;var b=(f-this.dims[1])/2;if(this.elementPositioning=="absolute"){if(this.options.scaleY){g.top=this.originalTop-c+"px"
}if(this.options.scaleX){g.left=this.originalLeft-b+"px"}}else{if(this.options.scaleY){g.top=-c+"px"}if(this.options.scaleX){g.left=-b+"px"}}}this.element.setStyle(g)}});Effect.Highlight=Class.create(Effect.Base,{initialize:function(b){this.element=$(b);
if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({startcolor:"#ffff99"},arguments[1]||{});this.start(a)},setup:function(){if(this.element.getStyle("display")=="none"){this.cancel();
return}this.oldStyle={};if(!this.options.keepBackgroundImage){this.oldStyle.backgroundImage=this.element.getStyle("background-image");this.element.setStyle({backgroundImage:"none"})}if(!this.options.endcolor){this.options.endcolor=this.element.getStyle("background-color").parseColor("#ffffff")
}if(!this.options.restorecolor){this.options.restorecolor=this.element.getStyle("background-color")}this._base=$R(0,2).map(function(a){return parseInt(this.options.startcolor.slice(a*2+1,a*2+3),16)}.bind(this));
this._delta=$R(0,2).map(function(a){return parseInt(this.options.endcolor.slice(a*2+1,a*2+3),16)-this._base[a]}.bind(this))},update:function(a){this.element.setStyle({backgroundColor:$R(0,2).inject("#",function(b,c,d){return b+((this._base[d]+(this._delta[d]*a)).round().toColorPart())
}.bind(this))})},finish:function(){this.element.setStyle(Object.extend(this.oldStyle,{backgroundColor:this.options.restorecolor}))}});Effect.ScrollTo=function(c){var b=arguments[1]||{},a=document.viewport.getScrollOffsets(),d=$(c).cumulativeOffset();
if(b.offset){d[1]+=b.offset}return new Effect.Tween(null,a.top,d[1],b,function(f){scrollTo(a.left,f.round())})};Effect.Fade=function(c){c=$(c);var a=c.getInlineOpacity();var b=Object.extend({from:c.getOpacity()||1,to:0,afterFinishInternal:function(d){if(d.options.to!=0){return
}d.element.hide().setStyle({opacity:a})}},arguments[1]||{});return new Effect.Opacity(c,b)};Effect.Appear=function(b){b=$(b);var a=Object.extend({from:(b.getStyle("display")=="none"?0:b.getOpacity()||0),to:1,afterFinishInternal:function(c){c.element.forceRerendering()
},beforeSetup:function(c){c.element.setOpacity(c.options.from).show()}},arguments[1]||{});return new Effect.Opacity(b,a)};Effect.Puff=function(b){b=$(b);var a={opacity:b.getInlineOpacity(),position:b.getStyle("position"),top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};
return new Effect.Parallel([new Effect.Scale(b,200,{sync:true,scaleFromCenter:true,scaleContent:true,restoreAfterFinish:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:1,beforeSetupInternal:function(c){Position.absolutize(c.effects[0].element)
},afterFinishInternal:function(c){c.effects[0].element.hide().setStyle(a)}},arguments[1]||{}))};Effect.BlindUp=function(a){a=$(a);a.makeClipping();return new Effect.Scale(a,0,Object.extend({scaleContent:false,scaleX:false,restoreAfterFinish:true,afterFinishInternal:function(b){b.element.hide().undoClipping()
}},arguments[1]||{}))};Effect.BlindDown=function(b){b=$(b);var a=b.getDimensions();return new Effect.Scale(b,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:0,scaleMode:{originalHeight:a.height,originalWidth:a.width},restoreAfterFinish:true,afterSetup:function(c){c.element.makeClipping().setStyle({height:"0px"}).show()
},afterFinishInternal:function(c){c.element.undoClipping()}},arguments[1]||{}))};Effect.SwitchOff=function(b){b=$(b);var a=b.getInlineOpacity();return new Effect.Appear(b,Object.extend({duration:0.4,from:0,transition:Effect.Transitions.flicker,afterFinishInternal:function(c){new Effect.Scale(c.element,1,{duration:0.3,scaleFromCenter:true,scaleX:false,scaleContent:false,restoreAfterFinish:true,beforeSetup:function(d){d.element.makePositioned().makeClipping()
},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned().setStyle({opacity:a})}})}},arguments[1]||{}))};Effect.DropOut=function(b){b=$(b);var a={top:b.getStyle("top"),left:b.getStyle("left"),opacity:b.getInlineOpacity()};
return new Effect.Parallel([new Effect.Move(b,{x:0,y:100,sync:true}),new Effect.Opacity(b,{sync:true,to:0})],Object.extend({duration:0.5,beforeSetup:function(c){c.effects[0].element.makePositioned()},afterFinishInternal:function(c){c.effects[0].element.hide().undoPositioned().setStyle(a)
}},arguments[1]||{}))};Effect.Shake=function(d){d=$(d);var b=Object.extend({distance:20,duration:0.5},arguments[1]||{});var f=parseFloat(b.distance);var c=parseFloat(b.duration)/10;var a={top:d.getStyle("top"),left:d.getStyle("left")};
return new Effect.Move(d,{x:f,y:0,duration:c,afterFinishInternal:function(g){new Effect.Move(g.element,{x:-f*2,y:0,duration:c*2,afterFinishInternal:function(h){new Effect.Move(h.element,{x:f*2,y:0,duration:c*2,afterFinishInternal:function(i){new Effect.Move(i.element,{x:-f*2,y:0,duration:c*2,afterFinishInternal:function(j){new Effect.Move(j.element,{x:f*2,y:0,duration:c*2,afterFinishInternal:function(k){new Effect.Move(k.element,{x:-f,y:0,duration:c,afterFinishInternal:function(l){l.element.undoPositioned().setStyle(a)
}})}})}})}})}})}})};Effect.SlideDown=function(c){c=$(c).cleanWhitespace();var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,100,Object.extend({scaleContent:false,scaleX:false,scaleFrom:window.opera?0:1,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();
d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().setStyle({height:"0px"}).show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})
},afterFinishInternal:function(d){d.element.undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.SlideUp=function(c){c=$(c).cleanWhitespace();
var a=c.down().getStyle("bottom");var b=c.getDimensions();return new Effect.Scale(c,window.opera?0:1,Object.extend({scaleContent:false,scaleX:false,scaleMode:"box",scaleFrom:100,scaleMode:{originalHeight:b.height,originalWidth:b.width},restoreAfterFinish:true,afterSetup:function(d){d.element.makePositioned();
d.element.down().makePositioned();if(window.opera){d.element.setStyle({top:""})}d.element.makeClipping().show()},afterUpdateInternal:function(d){d.element.down().setStyle({bottom:(d.dims[0]-d.element.clientHeight)+"px"})
},afterFinishInternal:function(d){d.element.hide().undoClipping().undoPositioned();d.element.down().undoPositioned().setStyle({bottom:a})}},arguments[1]||{}))};Effect.Squish=function(a){return new Effect.Scale(a,window.opera?1:0,{restoreAfterFinish:true,beforeSetup:function(b){b.element.makeClipping()
},afterFinishInternal:function(b){b.element.hide().undoClipping()}})};Effect.Grow=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.full},arguments[1]||{});
var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var h=c.getDimensions();var i,g;var f,d;switch(b.direction){case"top-left":i=g=f=d=0;break;
case"top-right":i=h.width;g=d=0;f=-h.width;break;case"bottom-left":i=f=0;g=h.height;d=-h.height;break;case"bottom-right":i=h.width;g=h.height;f=-h.width;d=-h.height;break;case"center":i=h.width/2;g=h.height/2;
f=-h.width/2;d=-h.height/2;break}return new Effect.Move(c,{x:i,y:g,duration:0.01,beforeSetup:function(j){j.element.hide().makeClipping().makePositioned()},afterFinishInternal:function(j){new Effect.Parallel([new Effect.Opacity(j.element,{sync:true,to:1,from:0,transition:b.opacityTransition}),new Effect.Move(j.element,{x:f,y:d,sync:true,transition:b.moveTransition}),new Effect.Scale(j.element,100,{scaleMode:{originalHeight:h.height,originalWidth:h.width},sync:true,scaleFrom:window.opera?1:0,transition:b.scaleTransition,restoreAfterFinish:true})],Object.extend({beforeSetup:function(k){k.effects[0].element.setStyle({height:"0px"}).show()
},afterFinishInternal:function(k){k.effects[0].element.undoClipping().undoPositioned().setStyle(a)}},b))}})};Effect.Shrink=function(c){c=$(c);var b=Object.extend({direction:"center",moveTransition:Effect.Transitions.sinoidal,scaleTransition:Effect.Transitions.sinoidal,opacityTransition:Effect.Transitions.none},arguments[1]||{});
var a={top:c.style.top,left:c.style.left,height:c.style.height,width:c.style.width,opacity:c.getInlineOpacity()};var g=c.getDimensions();var f,d;switch(b.direction){case"top-left":f=d=0;break;case"top-right":f=g.width;
d=0;break;case"bottom-left":f=0;d=g.height;break;case"bottom-right":f=g.width;d=g.height;break;case"center":f=g.width/2;d=g.height/2;break}return new Effect.Parallel([new Effect.Opacity(c,{sync:true,to:0,from:1,transition:b.opacityTransition}),new Effect.Scale(c,window.opera?1:0,{sync:true,transition:b.scaleTransition,restoreAfterFinish:true}),new Effect.Move(c,{x:f,y:d,sync:true,transition:b.moveTransition})],Object.extend({beforeStartInternal:function(h){h.effects[0].element.makePositioned().makeClipping()
},afterFinishInternal:function(h){h.effects[0].element.hide().undoClipping().undoPositioned().setStyle(a)}},b))};Effect.Pulsate=function(c){c=$(c);var b=arguments[1]||{},a=c.getInlineOpacity(),f=b.transition||Effect.Transitions.linear,d=function(g){return 1-f((-Math.cos((g*(b.pulses||5)*2)*Math.PI)/2)+0.5)
};return new Effect.Opacity(c,Object.extend(Object.extend({duration:2,from:0,afterFinishInternal:function(g){g.element.setStyle({opacity:a})}},b),{transition:d}))};Effect.Fold=function(b){b=$(b);var a={top:b.style.top,left:b.style.left,width:b.style.width,height:b.style.height};
b.makeClipping();return new Effect.Scale(b,5,Object.extend({scaleContent:false,scaleX:false,afterFinishInternal:function(c){new Effect.Scale(b,1,{scaleContent:false,scaleY:false,afterFinishInternal:function(d){d.element.hide().undoClipping().setStyle(a)
}})}},arguments[1]||{}))};Effect.Morph=Class.create(Effect.Base,{initialize:function(c){this.element=$(c);if(!this.element){throw (Effect._elementDoesNotExistError)}var a=Object.extend({style:{}},arguments[1]||{});
if(!Object.isString(a.style)){this.style=$H(a.style)}else{if(a.style.include(":")){this.style=a.style.parseStyle()}else{this.element.addClassName(a.style);this.style=$H(this.element.getStyles());this.element.removeClassName(a.style);
var b=this.element.getStyles();this.style=this.style.reject(function(d){return d.value==b[d.key]});a.afterFinishInternal=function(d){d.element.addClassName(d.options.style);d.transforms.each(function(f){d.element.style[f.style]=""
})}}}this.start(a)},setup:function(){function a(b){if(!b||["rgba(0, 0, 0, 0)","transparent"].include(b)){b="#ffffff"}b=b.parseColor();return $R(0,2).map(function(c){return parseInt(b.slice(c*2+1,c*2+3),16)
})}this.transforms=this.style.map(function(h){var g=h[0],f=h[1],d=null;if(f.parseColor("#zzzzzz")!="#zzzzzz"){f=f.parseColor();d="color"}else{if(g=="opacity"){f=parseFloat(f);if(Prototype.Browser.IE&&(!this.element.currentStyle.hasLayout)){this.element.setStyle({zoom:1})
}}else{if(Element.CSS_LENGTH.test(f)){var c=f.match(/^([\+\-]?[0-9\.]+)(.*)$/);f=parseFloat(c[1]);d=(c.length==3)?c[2]:null}}}var b=this.element.getStyle(g);return{style:g.camelize(),originalValue:d=="color"?a(b):parseFloat(b||0),targetValue:d=="color"?a(f):f,unit:d}
}.bind(this)).reject(function(b){return((b.originalValue==b.targetValue)||(b.unit!="color"&&(isNaN(b.originalValue)||isNaN(b.targetValue))))})},update:function(a){var d={},b,c=this.transforms.length;while(c--){d[(b=this.transforms[c]).style]=b.unit=="color"?"#"+(Math.round(b.originalValue[0]+(b.targetValue[0]-b.originalValue[0])*a)).toColorPart()+(Math.round(b.originalValue[1]+(b.targetValue[1]-b.originalValue[1])*a)).toColorPart()+(Math.round(b.originalValue[2]+(b.targetValue[2]-b.originalValue[2])*a)).toColorPart():(b.originalValue+(b.targetValue-b.originalValue)*a).toFixed(3)+(b.unit===null?"":b.unit)
}this.element.setStyle(d,true)}});Effect.Transform=Class.create({initialize:function(a){this.tracks=[];this.options=arguments[1]||{};this.addTracks(a)},addTracks:function(a){a.each(function(b){b=$H(b);
var c=b.values().first();this.tracks.push($H({ids:b.keys().first(),effect:Effect.Morph,options:{style:c}}))}.bind(this));return this},play:function(){return new Effect.Parallel(this.tracks.map(function(a){var d=a.get("ids"),c=a.get("effect"),b=a.get("options");
var f=[$(d)||$$(d)].flatten();return f.map(function(g){return new c(g,Object.extend({sync:true},b))})}).flatten(),this.options)}});Element.CSS_PROPERTIES=$w("backgroundColor backgroundPosition borderBottomColor borderBottomStyle borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderSpacing borderTopColor borderTopStyle borderTopWidth bottom clip color fontSize fontWeight height left letterSpacing lineHeight marginBottom marginLeft marginRight marginTop markerOffset maxHeight maxWidth minHeight minWidth opacity outlineColor outlineOffset outlineWidth paddingBottom paddingLeft paddingRight paddingTop right textIndent top width wordSpacing zIndex");
Element.CSS_LENGTH=/^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;String.__parseStyleElement=document.createElement("div");String.prototype.parseStyle=function(){var b,a=$H();if(Prototype.Browser.WebKit){b=new Element("div",{style:this}).style
}else{String.__parseStyleElement.innerHTML='<div style="'+this+'"></div>';b=String.__parseStyleElement.childNodes[0].style}Element.CSS_PROPERTIES.each(function(c){if(b[c]){a.set(c,b[c])}});if(Prototype.Browser.IE&&this.include("opacity")){a.set("opacity",this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1])
}return a};if(document.defaultView&&document.defaultView.getComputedStyle){Element.getStyles=function(b){var a=document.defaultView.getComputedStyle($(b),null);return Element.CSS_PROPERTIES.inject({},function(c,d){c[d]=a[d];
return c})}}else{Element.getStyles=function(b){b=$(b);var a=b.currentStyle,c;c=Element.CSS_PROPERTIES.inject({},function(d,f){d[f]=a[f];return d});if(!c.opacity){c.opacity=b.getOpacity()}return c}}Effect.Methods={morph:function(a,b){a=$(a);
new Effect.Morph(a,Object.extend({style:b},arguments[2]||{}));return a},visualEffect:function(c,f,b){c=$(c);var d=f.dasherize().camelize(),a=d.charAt(0).toUpperCase()+d.substring(1);new Effect[a](c,b);
return c},highlight:function(b,a){b=$(b);new Effect.Highlight(b,a);return b}};$w("fade appear grow shrink fold blindUp blindDown slideUp slideDown pulsate shake puff squish switchOff dropOut").each(function(a){Effect.Methods[a]=function(c,b){c=$(c);
Effect[a.charAt(0).toUpperCase()+a.substring(1)](c,b);return c}});$w("getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles").each(function(a){Effect.Methods[a]=Element[a]
});Element.addMethods(Effect.Methods);SL.events={};(function(){SL.events.pushKeyboardObserver=function(a){if(!SL.events._keyboardObservers){SL.events._keyboardObservers=$A();SL.events._keyboard={shift:false};
document.observe("keydown",function(f,d){var c=d.keyCode;if(c!=Event.KEY_ESC&&SL.events._checkForm()){return}if(c==16){if(!f.shift){f.shift=true;for(var b=SL.events._keyboardObservers.length-1;b>=0;b--){o=SL.events._keyboardObservers[b];
if(o.shiftdown){if(o.shiftdown(f)){d.stop();return}}if(o.modal){return}}}return}f.code=c;f.key=String.fromCharCode(c).toLowerCase();for(var b=SL.events._keyboardObservers.length-1;b>=0;b--){o=SL.events._keyboardObservers[b];
if(o.keydown){if(o.keydown(f)){d.stop();return}}if(o.modal){return}}}.curry(SL.events._keyboard));document.observe("keyup",function(f,d){if(SL.events._checkForm()){return}var c=d.keyCode;if(c==16){f.shift=false;
for(var b=SL.events._keyboardObservers.length-1;b>=0;b--){o=SL.events._keyboardObservers[b];if(o.shiftup){if(o.shiftup(f)){d.stop();return}}if(o.modal){return}}return}f.code=c;f.key=String.fromCharCode(c).toLowerCase();
for(var b=SL.events._keyboardObservers.length-1;b>=0;b--){o=SL.events._keyboardObservers[b];if(o.keyup){if(o.keyup(f)){d.stop();return}if(o.modal){return}}}f.code=undefined;f.key=undefined}.curry(SL.events._keyboard))
}SL.events._keyboardObservers.push(a);return a};SL.events.removeKeyboardObserver=function(a){if(a.modal){var b=SL.events._keyboardObservers.indexOf(a);if(b>=0){SL.events._keyboardObservers=SL.events._keyboardObservers.slice(0,b)
}}else{SL.events._keyboardObservers=SL.events._keyboardObservers.without(a)}};SL.events._checkForm=function(){var b=document.activeElement;if(!b){return false}var a=b.tagName.toLowerCase();if(a=="body"){return false
}if(a=="input"||b.up("form")){return true}return false}})();SL.elements={};(function(){SL.elements.createBlindRow=function(a){var f=0;var c=a.childElements();for(var b=0;b<c.length;b++){var h=c[b].readAttribute("colspan");
f+=h?parseInt(h):1}var d=new Element("tr");var g=new Element("td",{colspan:f});g.setStyle({margin:"0",padding:"0"});d.appendChild(g);return d};SL.Element=Class.create({isElement:true,initialize:function(b,a){this.e=$(b);
this.id=this.e.identify();this.config=$H(a);this.init()},init:function(){},destroy:function(){this.cleanup()},cleanup:function(){},connectDestroy:function(c){if(!c){return}var b=$(c);var a=b.retrieve("sl_delete_notify");
if(!a){a=$H();b.store("sl_delete_notify",a);b.addClassName("sljs__delete_notify__")}if(!a.get(this.id)){a.set(this.id,this)}},_destroy:function(){if(this.e.parentNode){this.e.remove()}(function(b){var a=$(b);
if(a&&a.parentNode){a.remove()}}.curry(this.id).defer())}})})();(function(){SL.effects.hideEmbededObjects=function(){$$("object","embed","iframe").each(function(a){a.setStyle({visibility:"hidden"})})};
SL.effects.showEmbededObjects=function(){$$("object","embed","iframe").each(function(a){a.setStyle({visibility:"visible"})})};SL.effects.resetStyles=function(b,a){b.setOpacity(1);b.setStyle({height:"auto",overflow:a?"hidden":"visible"})
};SL.effects.resetCurrent=function(b){var a=b.retrieve("effect");if(a){a.cancel();SL.effects.resetStyles(b);if(a.options.slAfterFinish){a.options.slAfterFinish()}b.store("effect",undefined);return true
}return false};SL.effects.registerCurrent=function(a){SL.effects.resetCurrent(a.element);if(a.options.afterFinish){a.options.slAfterFinish=a.options.afterFinish}a.options.afterFinish=function(c){var b=c.retrieve("effect");
if(b&&b.options.slAfterFinish){b.options.slAfterFinish()}c.store("effect",undefined)}.curry(a.element);a.element.store("effect",a)};SL.effects.registerHover=function(b,a){if(!a){a="hover"}b.observe("mouseenter",function(){b.addClassName(a)
});b.observe("mouseleave",function(){b.removeClassName(a)})};SL.effects.reparentToOffscreen=function(b){b.remove();var a=document.getElementsByTagName("body").item(0);a.appendChild(b);b.setStyle({position:"absolute",top:"0px",left:"-999em"});
b.show()};SL.effects.reparentAndReset=function(b,a){a.remove();b.appendChild(a);a.setStyle({position:"static",top:"auto",left:"auto"});a.show()};SL.effects.getBodyHeight=function(){var b=$$("body")[0];
var a=b.getHeight();var c=document.viewport.getHeight()+document.viewport.getScrollOffsets().top;if(c>a){a=c}if(a<=0){a=1000}return a};SL.effects.Preloader=Class.create({initialize:function(b,a){if(!b){console.log("No element");
return}this.element=b;this.finishCallback=a;this.run.bind(this).defer()},run:function(){if(this.element.retrieve("sl_preloaded")){this._emitFinished();return}var a=this.element.select("img");if(a.length==0){this._emitFinished();
return}this.remaining=a.length;a.each(function(d){if(d.readAttribute("width")&&d.readAttribute("height")){this.remaining--;return}var c=d.readAttribute("src");if(!c){this.remaining--;return}var b=new Image();
b.onload=this._onLoad.bind(this);b.onerror=this._onLoad.bind(this);b.onabort=this._onLoad.bind(this);b.src=c}.bind(this));if(this.remaining<=0){this._emitFinished()}else{setTimeout(this._emitFinished.bind(this),20000)
}},_onLoad:function(){this.remaining--;if(this.remaining<=0){this._emitFinished()}},_emitFinished:function(){if(!this.finished){this.finished=true;this.element.store("sl_preloaded",true);if(this.finishCallback){this.finishCallback.defer()
}}}});SL.effects.Queue=Class.create({initialize:function(a){this.config=$H(a);this.effects=$H();this.steps=$A(["first","last"]);this.currentStep=-1},add:function(b,a){var c=this.effects.get(b);if(c==undefined){c=$A();
this.effects.set(b,c)}c.push(a);this.effects.set(b,c)},start:function(){if(this.steps.length==0){_finished();return}this._iter()},isEmpty:function(){return this.effects.size()<=0},_iter:function(){this.currentStep++;
console.log("Step:",this.currentStep);if(this.currentStep>=this.steps.length){this._finished();return}var a=this.effects.get(this.steps[this.currentStep]);if(!a||a.length==0){this._iter();return}var b=0;
a.each(function(c){if(b<c.options.duration){b=c.options.duration}});if(b<=0){console.log("No duration:",this.effects.get(this.steps[this.currentStep]));this._iter();return}new Effect.Parallel(a,{duration:b,afterFinish:this._iter.bind(this)})
},_finished:function(){console.log("Queue finished:",this.config);if(this.config.get("afterFinish")){this.config.get("afterFinish")(this)}}});SL.effects.PointerState=Class.create({initialize:function(b,a){this.e=$(b);
if(this.e){this.onEnterHandler=this.onMouseEnter.bind(this);this.onLeaveHandler=this.onMouseLeave.bind(this);this.e.observe("mouseenter",this.onEnterHandler);this.e.observe("mouseleave",this.onLeaveHandler)
}this.cfg=a;this.hasPointer=false},onMouseEnter:function(a){this.hasPointer=true;if(this.cfg&&this.cfg.enter){this.cfg.enter(a)}},onMouseLeave:function(a){this.hasPointer=false;if(this.cfg&&this.cfg.leave){this.cfg.leave(a)
}},stop:function(){if(this.e){this.e.stopObserving(this.onEnterHandler);this.e.stopObserving(this.onLeaveHandler)}}});SL.effects._initEffect=function(d,b,a){var c=d.retrieve("sl_e_effect");if(c){return c
}c={};c.visible=d.visible();d.store("sl_e_effect",c);if(b){c.element=d.wrap("div");if(!c.visible){d.setStyle("display:block");c.element.setStyle({display:"none"})}}else{c.element=d}if(a){if(a.duration){c.duration=a.duration/1000
}else{c.duration=0.5}}return c};SL.effects.toggleVisibility=function(g,f,a){var d=$(g);if(!d){console.log("Element not found:",g);return}var c;if(a&&a.mode){c=true}else{c=false}var b=SL.effects._initEffect(d,c,a);
d=b.element;if(a&&a.mode){if(a.mode=="slide"){SL.effects.resetCurrent(d);if(b.visible){SL.effects.registerCurrent(Effect.BlindUp(d,{duration:b.duration}));b.visible=false;if($(f)){$(f).addClassName("inactive");
$(f).removeClassName("active")}}else{SL.effects.registerCurrent(Effect.BlindDown(d,{duration:b.duration}));b.visible=true;if($(f)){$(f).removeClassName("inactive");$(f).addClassName("active")}}return}}if(b.visible){d.hide();
if($(f)){$(f).addClassName("inactive");$(f).removeClassName("active")}b.visible=false}else{d.show();if($(f)){$(f).removeClassName("inactive");$(f).addClassName("active")}b.visible=true}};SL.effects.connectHover=function(f,d,a){var g=$(d);
var b=$(f);if(a){g.setStyle({visibility:"hidden"});b.observe("mouseenter",function(){g.setStyle({visibility:"visible"})});b.observe("mouseleave",function(){g.setStyle({visibility:"hidden"})});return}g.hide();
b.observe("mouseenter",function(){g.show()});b.observe("mouseleave",function(){g.hide()})}})();(function(){SL.ui.Panel=Class.create(SL.Component,{init:function(){this.config.setDefault("position","bl");
this.config.setDefault("as_tooltip",true);this.attachedElement=$(this.config.get("attach_id"));this.asTooltip=this.config.get("as_tooltip");this.trigger=$(this.config.get("mouse_over_id"));if(this.trigger){this.trigger.observe("mouseenter",this.onMouseEnter.bind(this));
this.trigger.observe("mouseleave",this.onMouseLeave.bind(this));this.e.observe("mouseenter",this.onMouseEnterOL.bind(this));this.e.observe("mouseleave",this.onMouseLeaveOL.bind(this))}if(this.config.get("expanded")){this.toggle.bind(this).defer()
}},notifyInitEvent:function(a){if(this.trigger){this.onMouseEnter(a)}},onMouseEnter:function(a){this.mouseOnTrigger=true;if(!this.shown){this.toggle()}},onMouseLeave:function(a){this.mouseOnTrigger=false;
if(this.mouseOnOverlay){return}if(this.hideTimeout){clearTimeout(this.hideTimeout)}this.hideTimeout=setTimeout(this.hideDelayed.bind(this),500)},onMouseEnterOL:function(a){this.mouseOnOverlay=true},onMouseLeaveOL:function(a){this.mouseOnOverlay=false;
if(this.mouseOnTrigger){return}if(this.hideTimeout){clearTimeout(this.hideTimeout)}this.hideTimeout=setTimeout(this.hideDelayed.bind(this),500)},hideDelayed:function(){if(!this.shown){return}if(!this.mouseOnTrigger&&!this.mouseOnOverlay){this.hide()
}},toggle:function(){if(this.shown){this.hide();return}if(!this.initialized){if(this.attachedElement){this.ap=this.e.up("#admin_panel");if(!this.ap){this.as=this.e.up(".gui_admin_sidebar_left_main");this.config.set("detach_to_body",true)
}if(!this.ap&&!this.config.get("detach_to_body")){this.attachedElement.insert({after:this.e});this.attachedElement.up().setStyle({position:"relative"})}if(this.config.get("overlay")){this.e.absolutize();
this.e.setStyle({width:null,height:null})}}else{if(this.config.get("attach_id")){console.log("Attached element not found",this.config.get("attach_id"))}}this.initialized=true}this.shown=true;if(this.attachedElement){this.updatePosition()
}this.e.show();if(this.asTooltip){this.bodyCB=this.onBodyClicked.bind(this);(function(){if(this.bodyCB){$$("body")[0].observe("click",this.bodyCB)}}).bind(this).defer();SL.ui._registerActiveTooltip(this)
}else{SL.ui._registerActiveTooltip(null);SL.ui._registerStaticTooltip(this)}if(this.attachedElement){this.attachedElement.addClassName("active")}},onUpdate:function(){},onChildComponentChanged:function(a){this.updatePosition(false)
},updatePosition:function(d){if(!this.shown){return}this.onUpdate();if(d&&this.updateCB){clearTimeout(this.updateCB)}if(this.config.get("detach_to_body")||this.ap){if(!this.detached){if(this.ap){SL.utils.reparent(this.e,this.ap)
}else{SL.utils.reparentToBody(this.e)}this.connectDestroy(this.attachedElement);this.detached=true}var c=this.attachedElement.cumulativeOffset();var f=0;var l=this.attachedElement.getFixedParent();var h;
if(l){h=this.attachedElement.cumulativeScrollOffsetFixed();c.left-=h.left;c.top-=h.top}var a=this.attachedElement.cumulativeScrollOffset();c.left-=a.left;c.right-=a.right;var g=document.viewport.getScrollOffsets();
var i=document.viewport.getDimensions();if(this.as||l){f=g.top}var k=this.config.get("position");if(k=="overlay"){var b=c.left-5;if(b+this.e.getWidth()>g.left+i.width-200){b=c.left+this.attachedElement.getWidth()-this.e.getWidth()
}this.e.setStyle({top:(c.top+f-5)+"px",left:b+"px",zIndex:this.getZIndex()+""})}else{var j=c.top+this.attachedElement.getHeight()+f;if(l){if(j+this.e.getHeight()>g.top+i.height){if(j-this.e.getHeight()>g.top){j=j-this.e.getHeight()-this.attachedElement.getHeight()
}}}if(k=="br"){this.e.setStyle({top:(j)+"px",left:(c.left+this.attachedElement.getWidth()-this.e.getWidth())+"px",zIndex:this.getZIndex()+""})}else{this.e.setStyle({top:(j)+"px",left:c.left+"px",zIndex:this.getZIndex()+""})
}}}else{if(this.config.get("overlay")){var c=this.attachedElement.positionedOffset();var k=this.config.get("position");if(k=="br"){this.e.setStyle({top:(c.top+this.attachedElement.getHeight())+"px",left:(c.left+this.attachedElement.getWidth()-this.e.getWidth())+"px",zIndex:this.getZIndex()+""})
}else{this.e.setStyle({top:(c.top+this.attachedElement.getHeight())+"px",left:c.left+"px",zIndex:this.getZIndex()+""})}}}this.updateCB=setTimeout(this.updatePosition.bind(this),250)},hide:function(){this._hide(false)
},_hide:function(a){if(!this.shown){return}this.e.hide();this.shown=false;if(!a){if(this.asTooltip){SL.ui._registerActiveTooltip(null)}else{SL.ui._registerStaticTooltip(null)}}if(this.bodyCB){$$("body")[0].stopObserving("click",this.bodyCB);
this.bodyCB=undefined}if(this.attachedElement){this.attachedElement.removeClassName("active")}},onBodyClicked:function(g){if(this.shown){var i=this.e.cumulativeOffset();var a=g.pageX;var f=i.left;var b=this.e.offsetWidth;
var j=g.pageY;var d=i.top;var c=this.e.offsetHeight;if(a>f&&a<f+b&&j>d&&j<d+c){return}console.log(a,j,f,d,b,c);this.hide()}},getZIndex:function(){if(this.ap||this.config.get("admin")){if(this.attachedElement&&this.attachedElement.up(".admin_panel_toolbar")){return 960
}return SL.admin._overlayIndex+1}return SL.ui._overlayIndex+5}})})();(function(){SL.ui.MenuHorizontal=Class.create(SL.Component,{init:function(){this.config.setDefault("hide_delay",500);this.config.setDefault("show_effect","blind_down");
this.config.setDefault("show_duration",200);this.config.setDefault("hide_effect","fade");this.config.setDefault("hide_duration",200);this.config.setDefault("css_prefix","dropdown_menu");this.config.setDefault("mode","normal");
this.cssPrefix=this.config.get("css_prefix");if(this.config.get("mode")=="normal"){this.initSubElements(true,this.e.down("ul"))}else{this.e.select("li."+this.cssPrefix+"_horizontal").each(this.initElement.bind(this,true));
this.e.select("li."+this.cssPrefix).each(this.initElement.bind(this,false))}},initSubElements:function(a,b){b.childElements().each(function(d){this.initElement(a,d);var c=d.down(">div.children>ul");if(c&&!c.up().hasClassName("custom_children")){this.initSubElements(false,c)
}}.bind(this))},initElement:function(a,b){if(a&&SL.browser.IE6){b.down().setStyle({width:"1%"})}b.observe("mouseenter",this.onMouseEnter.bind(this,b));b.observe("mouseleave",this.onMouseLeave.bind(this,b))
},onMouseEnter:function(d){var c=d.up();c.childElements().each(this._resetChild.bind(this,d));var a=this.config.get("mode")=="normal"?d.down("div.children"):d.down("div."+this.cssPrefix);if(!a){return}if(a.retrieve("visible")){if(a.retrieve("status")!="visible"){a.store("status","visible")
}return}a.store("visible",true);if(!SL.effects.resetCurrent(a)){SL.effects.resetStyles(d);var b=this.config.get("show_effect");if(b=="appear"){a.hide();SL.effects.registerCurrent(Effect.Appear(a,{duration:this.config.get("show_duration")/1000}))
}else{if(b=="blind_down"){a.hide();SL.effects.registerCurrent(Effect.BlindDown(a,{duration:this.config.get("show_duration")/1000}))}}}d.addClassName("active");this._getNavItem(d).addClassName("active")
},_resetChild:function(b,a){if(b==a){return}var c=this.config.get("mode")=="normal"?a.down("div.children"):a.down("div."+this.cssPrefix);if(c==null){return}SL.effects.resetCurrent(c);SL.effects.resetStyles(c);
c.store("visible",false);c.store("status","hidden");a.removeClassName("active");this._getNavItem(a).removeClassName("active");c.hide()},onMouseLeave:function(b){var a=this.config.get("mode")=="normal"?b.down("div.children"):b.down("div."+this.cssPrefix);
if(!a){return}a.store("status","delayed_hide");setTimeout(this.delayedHide.bind(this,b,a),this.config.get("hide_delay"))},delayedHide:function(c,a){if(a.retrieve("status")!="delayed_hide"){return}SL.effects.resetCurrent(a);
var b=this.config.get("hide_effect");if(b=="blind_up"){SL.effects.registerCurrent(Effect.BlindUp(a,{duration:this.config.get("hide_duration")/1000,afterFinish:this._clearHover.bind(this,c)}))}else{if(b=="fade"){SL.effects.registerCurrent(Effect.Fade(a,{duration:this.config.get("hide_duration")/1000,afterFinish:this._clearHover.bind(this,c)}))
}else{c.removeClassName("hover")}}a.store("visible",false);a.store("status","hidden")},_clearHover:function(a){a.removeClassName("active");this._getNavItem(a).removeClassName("active")},_getNavItem:function(a){return a.down()
}});SL.ui.ContextMenu=Class.create(SL.ui.Panel,{init:function($super){var c=this.config.get("mode");var a=this.config.get("attach_id");if(c=="mouseover"){this.config.setDefault("mouse_over_id",a)}$super();
if(c=="contextmenu"){$(a).observe("contextmenu",function(d){this.toggle(this);d.stop()}.bind(this))}else{if(c=="click"){$(a).observe("click",this.toggle.bind(this))}}var b=$(this.config.get("click_id"));
if(b){b.observe("contextmenu",function(d){this.toggle(this);d.stop()}.bind(this));b.observe("click",function(d){this.toggle(this);d.stop()}.bind(this))}this.e.select("a").each(function(d){d.observe("click",function(){this.hide()
}.bind(this))}.bind(this))},getZIndex:function($super){if(this.ap||this.config.get("admin")){return 960}return $super()}})})();(function(){SL.ui.Expandable=Class.create(SL.Component,{init:function(){this.config.setDefault("duration",0);
this.config.setDefault("state_url",null);this.config.setDefault("css_prefix","expandable");this.config.setDefault("button_class",this.config.get("css_prefix")+"_btn");var a=this.e.down();var c=this.e.select("."+this.config.get("button_class"));
this.img=c[0]?c[0].down():false;this.body=a.next().down();var b=this.body.getStyle("display");this.expanded=!b||b=="block"},toggle:function(){if(this.expanded){this.hide()}else{this.show()}var b=this.config.get("state_url");
if(b){var a=b+"&args.state=";if(this.expanded){a+="true"}else{a+="false"}new Ajax.Request(a,{method:"get"})}},_getImgURL:function(a){if(!this.img){return}var c=this.img.src.lastIndexOf("/");var b=this.img.src.lastIndexOf("_");
if(b>c){c=b}if(c<0){return}return this.img.src.substring(0,c+1)+a+".png"},show:function(){this.e.addClassName("active");this.e.removeClassName("inactive");var a=this.config.get("duration");if(a<=0){this.body.setStyle("display:block")
}else{SL.effects.resetCurrent(this.body);this.body.setStyle({overflow:"hidden"});SL.effects.registerCurrent(Effect.BlindDown(this.body,{duration:a/1000}))}this.img.src=this._getImgURL("up");this.expanded=true
},hide:function(){this.e.removeClassName("active");this.e.addClassName("inactive");var a=this.config.get("duration");if(a<=0){this.body.setStyle("display:none")}else{SL.effects.resetCurrent(this.body);
this.body.setStyle({overflow:"hidden"});SL.effects.registerCurrent(Effect.BlindUp(this.body,{duration:a/1000}))}this.img.src=this._getImgURL("down");this.expanded=false}})})();(function(){SL.ui.Accordion=Class.create(SL.Component,{init:function(){this.config.setDefault("duration",0);
this.config.setDefault("on_mouse_over",false);this.config.setDefault("css_prefix","accordion");this.config.setDefault("button_class",this.config.get("css_prefix")+"_btn");this.config.setDefault("mode","complex");
if(this.config.get("fix_old_ie")){var b=SL.getIE();if(b>0&&b<9){this.config.set("duration",-1)}}this.cssPrefix=this.config.get("css_prefix");this.mode=this.config.get("mode");this.duration=this.config.get("duration");
this.onMouseOver=this.config.get("on_mouse_over");this.active=-1;if(this.mode=="list"){this.list=this.e.down("ul");var d=this.list.childElements();for(var c=0;c<d.length;c++){var g=d[c];if(g.hasClassName("selected")){this.active=c
}if(!g.down("ul")){continue}if(this.onMouseOver){g.observe("mouseenter",this._onMouseOver.bind(this,c))}else{g.observe("click",this._onMouseClicked.bind(this,c))}}}else{this.children=this.e.down().childElements();
for(var c=0;c<this.children.length;c++){var g=this.children[c];g.store("acc_idx",c);try{var a=g.down("."+this.cssPrefix+"_body").down();var f=a.getStyle("display");if(f==null||f=="block"){this.active=c;
g.addClassName("active")}else{g.addClassName("inactive")}}catch(g){console.error(g)}}if(this.onMouseOver){for(var c=0;c<this.children.length;c++){this.children[c].down().observe("mouseenter",this._onMouseOver.bind(this,c))
}}}this.updateState(false)},_onMouseOver:function(b,a){this.setActive(b)},_toggleBtn:function(d,g){var f=d.select("."+this.config.get("button_class"));if(!f){return}for(var c=0;c<f.length;c++){var a=f[c].down();
if(!a){continue}var h=a.src.lastIndexOf("/");var b=a.src.lastIndexOf("_");if(b>h){h=b}if(h<0){continue}a.src=a.src.substring(0,h+1)+g+".png"}},getElement:function(a){if(this.mode=="list"){var b=this.list.childElements()[a];
if(b){return b.down("ul")}console.error("No child for element:",a);return}return this.children[a].down("."+this.cssPrefix+"_body").down()},setActive:function(b){if(this.onMouseOver&&this.active==b){return
}if(this.config.get("multi")){var a=this.getElement(b);if(a.up().up().hasClassName("active")){if(this.duration<=0){a.setStyle("display:none")}else{SL.effects.resetCurrent(a);SL.effects.registerCurrent(Effect.BlindUp(a,{duration:this.duration/1000}))
}a.up().up().addClassName("inactive");a.up().up().removeClassName("active");if(this.mode!="list"){var d=this.children[b];if(d){this._toggleBtn(d.down(),"down")}else{console.error("No child for active element:",this.active)
}}this.active=-1;this.updateState(true);return}}if(this.active>=0&&!this.config.get("multi")){var a=this.getElement(this.active);if(this.duration<=0){a.setStyle("display:none")}else{SL.effects.resetCurrent(a);
SL.effects.registerCurrent(Effect.BlindUp(a,{duration:this.duration/1000}))}a.up().up().addClassName("inactive");a.up().up().removeClassName("active");if(this.mode!="list"){var d=this.children[this.active];
if(d){this._toggleBtn(d.down(),"down")}else{console.error("No child for active element:",this.active)}}}if(this.active==b){this.active=-1;this.updateState(true);return}var a=this.getElement(b);if(this.duration<=0){a.setStyle("display:block")
}else{SL.effects.resetCurrent(a);SL.effects.registerCurrent(Effect.BlindDown(a,{duration:this.duration/1000}))}a.up().up().addClassName("active");a.up().up().removeClassName("inactive");this.active=b;if(this.mode!="list"){var d=this.children[this.active];
if(d){this._toggleBtn(d.down(),"up")}else{console.error("No child for active element:",this.active)}}this.updateState(true)},updateState:function(f){var h=this.config.get("state_url");if(!h){return}if(!this.states){this.states={}
}for(var c=0;c<this.children.length;c++){var d=this.children[c];var g=d.id;if(!g){g=c}this.states[g]=d.hasClassName("active")}if(f){var a=Object.toJSON(this.states);var b=h.replace("@state@",a);new Ajax.Request(b,{method:"get"})
}}})})();(function(){SL.ui._overlayIndex=65;SL.ui._getNewOverlayIndex=function(){SL.ui._overlayIndex=SL.ui._overlayIndex+10;return SL.ui._overlayIndex};SL.ui.Overlay=Class.create(SL.Component,{init:function(){this.config.setDefault("backdrop_opacity",0.7);
this.config.setDefault("backdrop_duration",250);this.config.setDefault("delete_on_hide",false);this.config.setDefault("background-color","#ffffff");this.config.setDefault("load_shaded",true);this.config.setDefault("hide_objects",true);
this.e.setStyle({position:"absolute"});if(this.config.get("background-color")!="auto"){this.e.setStyle({backgroundColor:this.config.get("background-color")})}if(this.config.get("show")){this.show.bind(this).defer()
}},show:function(){if(this.shown){return}SL.ui._closeActiveTooltips();if(!this.admin){if(this.e.up(".gui_admin_panel")){this.admin=SL.byID("admin_panel")}}if(this.config.get("hide_objects")){SL.effects.hideEmbededObjects()
}this.exKB=SL.events.pushKeyboardObserver({modal:true,keydown:this.onKeyDown.bind(this)});if(SL.admin&&(this.admin||this.config.get("admin"))){if(this.id=="admin_panel_dialog"){this.zIndex=915}else{this.zIndex=SL.admin._getNewOverlayIndex()
}}else{this.zIndex=SL.ui._getNewOverlayIndex()}this._showBackdrop();this.beforeShowOverlay();this.centerToViewport(this.e);if(this.zIndex){this.e.setStyle({zIndex:(this.zIndex+1)+""})}this.e.appear({duration:0.1,afterFinish:this.afterShow.bind(this)});
this.shown=true;SL.ui.disableForOverlay()},setCloseJS:function(a){this.closeJS=a},beforeShowOverlay:function(){},afterShow:function(){},afterHideOverlay:function(){},beforeHide:function(){},hide:function(c,a){if(!c){c="abort"
}if(!this.shown){this._hideBackdrop(c);return}this.beforeHide();SL.events.removeKeyboardObserver(this.exKB);this.e.hide();this._hideBackdrop(c);if(this.onClose){var b=this.onClose.get(c)||this.onClose.get("all");
if(b){try{b(c)}catch(d){console.log(d)}}}if(!a&&this.closeJS){this.closeJS(this)}this.shown=false;SL.ui.enableAfterOverlay();this.afterHide();if(this.id=="admin_panel_dialog"){SL.admin.resetTitle();SL.admin.setArea(false)
}else{if(this.id=="admin_sidebar_left_view"){SL.admin.resetTitle()}}},afterHide:function(){},getTopLeftForCenter:function(d,a){var c=document.viewport.getWidth();var b=document.viewport.getHeight();var h=0;
var g=0;if(d<c){g=(c-d)/2}var f=document.viewport.getScrollOffsets();if(this.admin){return{top:25,left:g+f.left}}if(a<b){h=(b-a)/2}return{top:h+f.top,left:g+f.left}},centerToViewport:function(b){if(!b){b=this.e
}var a=this.getTopLeftForCenter(b.getWidth(),b.getHeight());this.e.setStyle({top:a.top+"px",left:a.left+"px"});this.afterCentered()},afterCentered:function(){},_getBackdrop:function(){var b=this.id+"_g_backdrop";
var a=$(b);if(!a){a=SL.utils.createBodyElement("div",{id:b});a.setStyle({position:"absolute",top:"0",left:"0",width:"100%",height:SL.effects.getBodyHeight()+"px",backgroundColor:"#000000"});a.addClassName("dialog_backdrop");
a.hide();a.observe("click",this.hide.bind(this))}a.setStyle({zIndex:this.zIndex+""});return a},_showBackdrop:function(b){this.hideBackdropCB=b;if(this.admin){this.admin.showBackdrop(this.hide.bind(this));
return}var a=this._getBackdrop(b);a.setStyle({height:SL.effects.getBodyHeight()+"px"});a.appear({duration:this.config.get("backdrop_duration")/1000,from:0,to:this.config.get("backdrop_opacity")})},_hideBackdrop:function(a){if(this.admin){if(this.config.get("hide_objects")){SL.effects.showEmbededObjects()
}this.admin.hideBackdrop(a);return}var b=this._getBackdrop();b.fade({duration:this.config.get("backdrop_duration")/1000,afterFinish:this._afterHideOverlay.bind(this,b)});if(this.config.get("hide_objects")){SL.effects.showEmbededObjects()
}},onKeyDown:function(a){if(a.code==Event.KEY_ESC||a.key=="q"){this.hide();return true}return false},_afterHideOverlay:function(a){this.afterHideOverlay();if(this.config.get("delete_on_hide")){a.remove();
this._destroy()}if(this.hideBackdropCB){this.hideBackdropCB()}},cleanup:function($super){SL.events.removeKeyboardObserver(this.exKB);$super()},addOnClose:function(a){this.onClose=$H(a)}});SL.ui.Dialog=Class.create(SL.ui.Overlay,{isDialog:true,init:function($super){this.config.setDefault("backdrop_opacity",0.6);
this.config.setDefault("static_height",false);this.config.setDefault("min_height",-1);$super();this.config.setDefault("dialog_class","gui_dialog");this.config.setDefault("add_class","gui_overlay");this.css=this.config.get("dialog_class");
this.e.addClassName(this.css);this.e.addClassName(this.config.get("add_class"));if(this.config.get("content_only")){this.e.addClassName("content_only")}},onDragStart:function(){this.dragged=true},onChildComponentChanged:function(a,b){this._updateOverlay.bind(this,false,b).defer()
},updateScrollPosition:function(){if(!this.admin){return}var f=this.e.cumulativeOffset().top;var a=document.viewport.getScrollOffsets();if(f>a.top){return}var d=document.viewport.getHeight();var c=f+this.e.getHeight();
if(c<a.top+d){var b=c-d;if(b<0){b=0}window.scrollTo(a.left,b)}},onSuccess:function(){if(this.draggable){this.draggable.destroy()}if(!this.admin&&this.e.select("."+this.css+"_head").size()>0){this.draggable=new SL.dnd.Draggable(this.e,{grip_class:this.css+"_head",cb:{dragStart:this.onDragStart.bind(this),moved:this.afterCentered.bind(this)}})
}if(this.nextMaxWidth){this.maxWidth=this.nextMaxWidth;this.nextMaxWidth=undefined}this._updateOverlay(true)},reset:function(){this._cleanup(true);this.e.update("");this.e.setStyle({width:"100px",height:"100px",minHeight:0,maxHeight:"none"})
},showAndLoad:function(b,a){this.nextMaxWidth=a>0?a:undefined;if(this.shown){var c=this.e.down("."+this.css+"_content_outer");this.load(b,c?c.identify():this.id);return}this.reset();this.show();this.load(b);
if(this.admin){window.scrollTo(0,0)}this.centerToViewport();setTimeout(function(d){if(this.version==d&&this.e.getStyle("visibility")=="hidden"){this.e.setStyle({visibility:"visible"})}}.bind(this,this.version),250);
this.e.setStyle({visibility:"hidden"})},afterHide:function(){this.reset()},show:function($super){this.maxWidth=undefined;$super()},setSize:function(a,c,b){this.config.set("size",a);this.config.set("static_height",c);
if(b){this.config.set("min_height",b)}this._updateOverlay()},setMaxWidth:function(a){this.maxWidth=a;this._updateOverlay()},_updateOverlay:function(c,g){if(this.admin){var i=this.e.down("."+this.css+"_content_outer");
var f=this.admin.backdrop.getWidth()-100;if(i&&this.maxWidth){if(this.maxWidth<f){f=this.maxWidth}this.e.setStyle({width:"auto",height:"auto",minHeight:0});i.setStyle({width:f+"px",height:"auto",maxHeight:(document.viewport.getHeight()-this.admin.backdrop.cumulativeOffset().top-100)+"px"})
}else{if(i){i.setStyle({width:"auto",maxHeight:"none"})}this.e.setStyle({width:f+"px",height:"auto",minHeight:(document.viewport.getHeight()-this.admin.backdrop.cumulativeOffset().top-100)+"px",maxHeight:"none"})
}if(!g){this.centerToViewport()}if(c){new SL.effects.Preloader(this.e,this._updateOverlay.bind(this)).run()}else{this.updateScrollPosition()}return}var i=this.e.down("."+this.css+"_content_outer");if(!i){var d=this.config.get("size");
if(d){this.e.setStyle({width:d.width>0?(d.width+"px"):"auto",height:d.height>0?(d.height+"px"):"auto"})}if(!g){this.centerToViewport()}if(c){new SL.effects.Preloader(this.e,this._updateOverlay.bind(this)).run()
}return}this.e.setStyle({width:"auto",height:"auto"});var b=i.down();var f="auto";var a="auto";var h=true;d=this.config.get("size");if(!d){if(b.getWidth()>document.viewport.getWidth()-60){f=document.viewport.getWidth()-60+"px"
}if(b.getHeight()>document.viewport.getHeight()-60){a=document.viewport.getHeight()-60+"px"}}else{h=!(d.height>0);f=(d.width>0?d.width:b.getWidth()+2)+"px";if(this.config.get("static_height")){a=(d.height>0?d.height:b.getHeight()+2)+"px"
}else{if(d.height>0){a=b.getHeight()>d.height?d.height:b.getHeight();if(a>document.viewport.getHeight()-60){a=document.viewport.getHeight()-60+"px"}else{a=a+"px"}}else{if(b.getHeight()>document.viewport.getHeight()-60){a=document.viewport.getHeight()-60+"px"
}else{a="auto"}}}}if(h){i.setStyle({width:f,height:"auto",minHeight:a})}else{i.setStyle({width:f,height:a,minHeight:"0"})}if(this.config.get("min_height")>i.getHeight()){i.setStyle({height:this.config.get("min_height")+"px"})
}if(!g){this.centerToViewport()}if(c){new SL.effects.Preloader(this.e,this._updateOverlay.bind(this)).run()}},cleanup:function($super){if(this.draggable){this.draggable.destroy()}}});SL.ui.Lightbox=Class.create(SL.ui.Overlay,{init:function($super){$super();
this.config.setDefault("resize_duration",500);this.config.setDefault("counter_template",new Template("#{index} of #{total}"));this.config.setDefault("content_dimension",null);this.config.setDefault("mode","auto");
this.config.setDefault("show_bottom",true);this.config.setDefault("bottom_duration",100);this.config.setDefault("hide_on_click","auto");this.config.setDefault("counter_top",false);this.config.setDefault("switch_duration",1000);
this.e.addClassName("lightbox");this.currentImage=0;this.mode=this.config.get("mode");this.diaTimeout=this.config.get("dia_timeout");this.contentDimension=this.config.get("content_dimension");if(this.mode=="auto"){var a=$(this.config.get("gallery_id"));
this.images=$A();a.select("a").each(function(c){this.images.push({url:c.readAttribute("href"),text:c.readAttribute("title")});c.observe("click",function(d,f){f.stop();this.showImage(d)}.bind(this,this.images.length-1))
}.bind(this))}else{if(this.mode=="json"){this.images=$A(this.config.get("data"))}else{if(this.mode=="html"){var a=$(this.config.get("gallery_id"));var b=this.config.get("content_dimension");this._switchImage(this.currentImage+1);
this.images=$A();a.childElements().each(function(c){this.images.push({e:c,text:c.readAttribute("title")});SL.effects.reparentToOffscreen(c);if(b){c.setStyle({maxWidth:b.width+"px"})}}.bind(this))}else{console.log("Unknown mode:",this.mode)
}}}if(this.config.get("autostart")){this.showImage.bind(this,0).defer()}},beforeShowOverlay:function(){if(this.diaTimeout){this.dia=true}this._initDefaultLayout()},afterShow:function(){this._updateForImage()
},showImage:function(a){this.currentImage=a;this.show()},showImageWithID:function(c){for(var a=0;a<this.images.length;a++){var b=this.images[a];if(b.id==c){this.currentImage=a;this.show();return}}console.log("Lightbox: No image with id ",c)
},next:function(a){if(a){a.stop()}if(this.dia){this.dia=false}if(this.currentTimeout){clearTimeout(this.currentTimeout)}this._switchImage(this.currentImage+1)},prev:function(a){if(a){a.stop()}if(this.dia){this.dia=false
}if(this.currentTimeout){clearTimeout(this.currentTimeout)}this._switchImage(this.currentImage-1)},_initDefaultLayout:function(){if(this.e.childElements().length>0){return}var j;if(this.mode=="html"){j=""
}else{if(!this.config.get("content_dimension")||!this.diaTimeout){j='<img src="" />'}else{j="";for(var g=0;g<this.images.length;g++){j+='<img style="position:absolute;top:0;left:0;display:none;" src="" />'
}}}var b;if(this.config.get("show_bottom")){var a='<div class="lightbox_details">';if(this.config.get("counter_top")){a+='<div class="lightbox_counter"></div><div class="lightbox_text"></div>'}else{a+='<div class="lightbox_text"></div><div class="lightbox_counter"></div>'
}if(this.config.get("add_content")){a=a+'<div class="lightbox_add_content">'+this.config.get("add_content")+"</div>"}if(this.config.get("print_img")){a=a+'<div class="lightbox_print"><img src="'+this.config.get("print_img")+'" /></div>'
}a=a+"</div>";b='<div class="lightbox_bottom" style="display:none">'+a;if(!this.config.get("top_close")){b+='<div class="lightbox_close"></div>'}b+="</div>"}else{b=""}var c;if(this.images.length>1&&!this.config.get("hide_nav")){c='<div class="lightbox_hnav"><a href="#" class="lightbox_hnav_next"></a><a href="#" class="lightbox_hnav_prev"></a></div>';
this.hasHoverNav=true}else{c=""}var h='<div class="lightbox_content">'+c+'<div id="'+this.id+'_content_inner" class="lightbox_content_inner">'+j+"</div></div>"+b;if(this.config.get("top_close")){h='<div class="lightbox_close_top"></div>'+h
}this.e.insert({top:h});this.hoverNext=this.e.down(".lightbox_hnav_next");this.hoverPrev=this.e.down(".lightbox_hnav_prev");this.content=this.e.down(".lightbox_content");this.contentInner=this.e.down(".lightbox_content_inner");
if(this.config.get("top_close")){this.close=this.e.down(".lightbox_close_top")}else{this.close=this.e.down(".lightbox_close")}this.text=this.e.down(".lightbox_text");this.counter=this.e.down(".lightbox_counter");
this.bottom=this.e.down(".lightbox_bottom");this.addContent=this.e.down(".lightbox_add_content");if(this.hasHoverNav){this.hoverNext.observe("click",this.next.bind(this));this.hoverPrev.observe("click",this.prev.bind(this));
SL.effects.registerHover(this.hoverNext);SL.effects.registerHover(this.hoverPrev)}if(this.close){this.close.observe("click",this.hide.bind(this))}var f=this.config.get("content_dimension");if(f){this.content.setStyle({width:f.width>0?(f.width+"px"):"auto",height:f.height>0?(f.height+"px"):"auto",overflow:"hidden",position:"relative"});
this.contentInner.setStyle({position:"relative"});if(this.bottom){this.bottom.show();this.bottom.setStyle({width:f.width+"px"})}}else{this.content.setStyle({width:"200px",height:"200px",overflow:"hidden"})
}this.contentInner.setStyle({overflow:"hidden",width:"100%"});var k=this.config.get("hide_nav")||this.config.get("hide_on_click");if(k=="auto"&&this.images.length<=1){this.e.observe("click",this.hide.bind(this))
}else{if(k==true){this.e.observe("click",this.hide.bind(this))}}var d=this.e.down(".lightbox_print");if(d){d.observe("click",slPrintElement.curry(this.id+"_content_inner"))}},_updateForImage:function(){this.inAnimation=true;
var c=this.images[this.currentImage];if(!this.diaTimeout||!this.config.get("content_dimension")){this.content.addClassName("loading");this.contentInner.hide();this.e.setOpacity(0.8)}if(this.mode=="html"){new SL.effects.Preloader(c.e,this._updateForHTML.bind(this));
return}var b;if(!this.config.get("content_dimension")||!this.diaTimeout){b=this.contentInner.down("img")}else{b=this.contentInner.children[this.currentImage];b.hide()}var a=new Image();a.onload=function(){b.writeAttribute("src",c.url);
this._resizeTo.bind(this,a.width,a.height,b).defer()}.bind(this);a.src=c.url},_updateForHTML:function(){var d=this.images[this.currentImage];var b=d.e.getWidth();var a=d.e.getHeight();this.contentInner.childElements().each(function(f){SL.effects.reparentToOffscreen(f)
});SL.effects.reparentAndReset(this.contentInner,d.e);var c=this.config.get("content_dimension");if(c){if(b>c.width){b=c.width;d.e.setStyle({width:b+"px"});if(c.height>0){a=c.height}}}this._resizeTo(b,a)
},_resizeTo:function(i,a,k){var j=this.content;var h=this.config.get("content_dimension");if(h!=null){var l=0;var f=0;if(h.width>0&&i!=h.width){f=(h.width-i)/2}if(h.height>0&&a!=h.height){l=(h.height-a)/2
}if(!k||!this.diaTimeout){this.contentInner.setStyle({top:l+"px",left:f+"px",width:i+"px",height:a+"px"});this._afterUpdateFinished(h.width,h.height)}else{this.contentInner.setStyle({width:"100%",height:h.height>0?(h.height+"px"):"auto"});
if(!this.currentIE){if(k){k.show()}this.currentIE=k;this._afterUpdateFinished(h.width,h.height)}else{console.log("appear:"+k.src);k.appear({duration:this.config.get("switch_duration")/1000,from:0,to:1,afterFinish:this._afterUpdateFinished.bind(this,i,a)});
this.currentIE.fade({duration:this.config.get("switch_duration")/1000,from:1,to:0});this.currentIE=k}this.currentIE.setStyle({top:l+"px",left:f+"px"})}this.centerToViewport.bind(this,this.e).defer();return
}var c=j.getWidth();var d=j.getHeight();var f=parseFloat(this.e.getStyle("left")||"0");var m=this.getTopLeftForCenter(i,a);var g=this.config.get("resize_duration")/2000;if(g<=0){j.setStyle({width:i+"px",height:a+"px"});
this.e.setStyle({top:m.top+"px",left:m.left+"px"});this._afterUpdateFinished(i,a);return}var b=new SL.effects.Queue({afterFinish:this._afterUpdateFinished.bind(this,i,a)});hScale=a*100/d;wScale=i*100/c;
if(d!=a){b.add("first",new Effect.Scale(j,hScale,{sync:true,scaleX:false,scaleContent:false,duration:g}));b.add("first",new Effect.Move(this.e,{sync:true,y:m.top,x:f,duration:g,mode:"absolute"}))}if(c!=i){b.add("last",new Effect.Scale(j,wScale,{sync:true,scaleY:false,scaleContent:false,duration:g}));
b.add("last",new Effect.Move(this.e,{sync:true,y:m.top,x:m.left,duration:g,mode:"absolute"}))}if(!this.contentDimension&&this.bottom){SL.effects.resetCurrent(this.bottom);this.bottom.hide()}if(b.isEmpty()){this._afterUpdateFinished(i,a);
return}b.start()},_switchImage:function(a){if(this.inAnimation){return}if(a<0){a=this.images.length-1}else{if(a>=this.images.length){a=0}}this.currentImage=a;this._updateForImage()},_afterUpdateFinished:function(c,a){if(this.dia){if(this.currentTimeout){clearTimeout(this.currentTimeout)
}this.currentTimeout=setTimeout(function(){this._switchImage(this.currentImage+1)}.bind(this),this.diaTimeout)}this.images[this.currentImage].loaded=true;var b=(this.currentImage>=this.images.length-1)?0:this.currentImage+1;
if(!this.images[b].loaded){if(this.mode=="html"){new SL.effects.Preloader(this.images[b].e)}else{new Image().src=this.images[b].url}}if(this.hasHoverNav){if(this.currentImage>=this.images.length-1){this.hoverNext.hide()
}else{this.hoverNext.show();if(this.contentDimension){this.hoverNext.setStyle({height:this.contentDimension.height+"px",width:(c/2)-1+"px"})}else{this.hoverNext.setStyle({height:a>0?(a+"px"):"auto",width:(c/2)-1+"px"})
}}if(this.currentImage<=0){this.hoverPrev.hide()}else{this.hoverPrev.show();if(this.contentDimension){this.hoverPrev.setStyle({height:this.contentDimension.height+"px",width:(c/2)-1+"px"})}else{this.hoverPrev.setStyle({height:a>0?(a+"px"):"auto",width:(c/2)-1+"px"})
}}}this.content.removeClassName("loading");this.contentInner.show();this.e.setOpacity(1);if(this.bottom){var d=this.images[this.currentImage];if(d.text){this.text.show();this.text.update(d.text)}else{this.text.hide()
}if(this.images.length>1){this.counter.update(this.config.get("counter_template").evaluate({total:this.images.length,index:this.currentImage+1}))}if(!this.contentDimension){this.bottom.setStyle({width:c+"px"});
SL.effects.registerCurrent(new Effect.BlindDown(this.bottom,{duration:this.config.get("bottom_duration")/1000}))}}setTimeout(function(){this.inAnimation=false}.bind(this),50)},onKeyDown:function($super,a){if($super(a)){return true
}if(this.inAnimation||this.images.length<2){return}if(a.code==Event.KEY_LEFT){this.prev()}else{if(a.code==Event.KEY_RIGHT){this.next()}}}});SL.ui.showSimpleLightbox=function(a,b,j,f,d,i,h,c,g){new SL.ui.Lightbox(a,{counter_template:h,mode:"json",hide_on_click:c,delete_on_hide:true,content_dimension:j,print_img:f,dia_timeout:d,switch_duration:i,hide_nav:g,data:b}).showImage(0)
};SL.ui.getDialog=function(b){var a=SL.byID(b);while(a){if(a.isDialog){return a}a=a.getParentComponent()}};SL.ui.disableForOverlay=function(){$$("div.you_tube>iframe").each(function(a){if(a.getStyle("visibility")!="hidden"){a.addClassName("__sl__hidden");
a.setStyle({visibility:"hidden"})}})};SL.ui.enableAfterOverlay=function(){$$(".__sl__hidden").each(function(a){a.removeClassName("__sl__hidden");a.setStyle({visibility:"visible"})})}})();(function(){SL.ui.TreeTable=Class.create(SL.Component,{init:function(){this.config.setDefault("selectable",false);
this.config.setDefault("keyboard_editing",false);this.config.setDefault("no_double_select",false);this.rows=this.config.get("rows");this.componentID=this.config.get("component_id");if(this.config.get("selectable")&&this.rows){this.selected=false;
this.config.get("rows").each(function(c){var b=$(c.id);b.observe("click",this.onRowClicked.bind(this,b))}.bind(this));var a=this.config.get("selected");if(!this.componentID){if(a){SL.storage.ensureHash("tree_selection").set(this.id,a)
}else{a=SL.storage.ensureHash("tree_selection").get(this.id)}}if(a){this.selected=$(a);if(this.selected){this.selected.addClassName("selected");if(this.componentID){SL.byID(this.componentID).updateArgs({"tree.selection":a})
}}}else{if(this.config.get("select_first")){console.log(this.rows[0].id);this.onRowClicked.bind(this,$(this.rows[0].id)).defer()}}this.dndActionURL=this.config.get("dnd_action_url");this.dndActionComponent=this.config.get("dnd_action_component");
if(this.dndActionURL){this.dnd=new SL.dnd.SortableTable(this.e.down("table"),{cb:{dragStart:this.onDragStart.bind(this),dragStop:this.onDragStop.bind(this)},grip_class:this.config.get("grip_class")})}if(this.config.get("keyboard_editing")){this.keyObserver=SL.events.pushKeyboardObserver({keydown:this.onKey.bind(this)})
}}this.ignoreSelect=0},ignoreNextSelect:function(){this.ignoreSelect++;setTimeout(function(){this.ignoreSelect--}.bind(this),100)},onDragStart:function(a,b){this.rows.each(function(f){if(!f.last){return
}var d=$(f.id);var c=SL.elements.createBlindRow(d);c.setStyle({backgroundColor:"#cccccc",height:"10px"});c.addClassName("sljs__tree_table_dnd_marker");c.id=f.id+"__last_child";d.insert({after:c})}.bind(this))
},onDragStop:function(b,h,g){var f=h.next();var d=h.previous();this.e.select(".sljs__tree_table_dnd_marker").each(function(c){c.remove()});if(this.dndActionURL){var i;var k;if(f){i=f.id;if(i.endsWith("__last_child")){i=i.substring(0,i.length-12);
k=false}else{k=true}}else{if(d){i=d.id;k=false}else{console.log("No target found");return}}var a=this.dndActionURL+"&args.dnd_action_source_id="+h.id+"&args.dnd_action_target_id="+i+"&args.dnd_action_above="+k;
var j=SL.byID(this.dndActionComponent);j.loadBackground(a)}},onKey:function(d){if(!this.selected||this.disabled){return}if(d.shift){var b=$H(this.getActions(this.selected.id));var c=undefined;switch(d.code){case Event.KEY_DOWN:c=b.get("down");
break;case Event.KEY_UP:c=b.get("up");break;case Event.KEY_LEFT:c=b.get("left");break;case Event.KEY_RIGHT:c=b.get("right");break;default:if(d.key=="n"){c=b.get("add")}else{if(d.key=="e"){c=b.get("edit")
}else{if(d.key=="m"){c=b.get("move")}}}}if(c){this._disableTemp();c()}return true}if(d.code==Event.KEY_DOWN){var f=this.selected.next();if(f){this.onRowClicked(f)}return true}if(d.code==Event.KEY_UP){var f=this.selected.previous();
if(f){this.onRowClicked(f)}return true}if(d.code==Event.KEY_ESC){this.onRowClicked(null);return true}if(d.code==Event.KEY_LEFT||d.code==Event.KEY_RIGHT){var b=$H(this.getActions(this.selected.id)).get("toggle");
if(b){this._disableTemp();b()}return true}},toggle:function(c){var b=$(c);if(!b){return}var a=b.down(".gtvlm");if(!a){a=b.down(".gtvtm")}if(!a){a=b.down(".gtvlp")}if(!a){a=b.down(".gtvtp")}if(!a){a=b.down(".gtvtn")
}if(!a){a=b.down(".gtvln")}if(!a){return}a.update(this._getLoadingContent())},onRowClicked:function(c,b){if(b){var a=b.findElement();if(a&&a.hasClassName("_tree_cell_")){return}}if(!c){if(this.selected){this.selected.removeClassName("selected");
this.setSelected();this.selected=undefined}return}if(this.selected){if(this.selected==c&&this.config.get("no_double_select")){return}this.selected.removeClassName("selected")}c.addClassName("selected");
this.selected=c;if(this.ignoreSelect>0){console.log("Ignoring select");return}this.setSelected(c.id)},setSelected:function(c){if(this.componentID){SL.byID(this.componentID).updateArgs({"tree.selection":c})
}else{var a=SL.storage.ensureHash("tree_selection");a.set(this.id,c)}if(this.selectionNotifyHandler){if(c){this.selectionNotifyHandler($(c),this.getActions(c))}else{this.selectionNotifyHandler(null,{})
}}var b=$H(this.getActions(this.selected.id)).get("select");if(b){b()}},getActions:function(c){for(var a=0;a<this.rows.length;a++){var b=this.rows[a];if(b&&b.id==c){return b.actions}}console.log("TreeTable: No actions for id "+c);
return $H()},connectSelectionNotify:function(a,b){this.selectionNotifyHandler=a;if(b&&this.selected){this.selectionNotifyHandler($(this.selected),this.getActions(this.selected.id))}},cleanup:function(){if(this.keyObserver){SL.events.removeKeyboardObserver(this.keyObserver)
}},_disableTemp:function(){if(!this.disabled){this.disabled=true;setTimeout(function(){this.disabled=false}.bind(this),5000)}},onSuccess:function(){this.disabled=undefined}});SL.ui.TreeTableActions=Class.create(SL.Component,{init:function(){this.tree=SL.byID(this.config.get("tree_id"));
this.actions=$H(this.config.get("actions"));this.actions.each(function(d){var b=d.value;var c=$(b.image);if(c){c.observe("click",this._clicked.bind(this,d.key))}}.bind(this));this.tree.connectSelectionNotify(this.onChanged.bind(this),this.config.get("emit_on_load"))
},_clicked:function(d){var b=this.actions.get(d);if(d.startsWith("_entries_")){b.fallback();return}var b=this.actions.get(d);if(!this.currentActions){if(b.fallback){b.fallback()}return}var c=this.currentActions.get(d);
if(c){c()}else{if(b.fallback){b.fallback()}}},setActions:function(a){this.currentActions=a;this.actions.each(function(c,h){var f=h.key;var b=h.value;var g=$(b.image);if(!g){return}var d;if(g.tagName.toLowerCase()=="img"){d=g
}else{d=g.down("img")}if(c.get(f)||b.fallback){if(d&&d.src.endsWith("_i.png")){d.src=d.src.substring(0,d.src.length-6)+".png"}g.setStyle({cursor:"pointer"})}else{if(d&&!d.src.endsWith("_i.png")){d.src=d.src.substring(0,d.src.length-4)+"_i.png"
}g.setStyle({pointer:"default"})}}.curry(a))},onChanged:function(a,b){this.setActions($H(b))}});SL.ui.Tree=Class.create(SL.Component,{init:function(){this.active=this.e.down("li.selected");this.topUL=this.e.down("ul");
this.initDefered.bind(this).defer()},initDefered:function(){this.e.select("li").each(function(c){var b=c.down(">div.item>a");if(b){b.observe("click",this._update.bind(this,c))}}.bind(this))},_deselect:function(c){if(this.active){if(c&&this.active==c){return
}this.active.removeClassName("selected");var b=this.active.up("ul");while(b&&b!=this.topUL){var a=b.up("li");if(!a){break}a.removeClassName("active");b=a.up("ul")}}},_deselectAll:function(a){$$("."+a).each(function(b){var d=SL.getC(b);
if(d){try{d._deselect()}catch(b){console.error(b)}}})},_update:function(d,c){if(c.isRightClick()){return}this._deselect(d);if(this.e.hasClassName("gui_html_tree")){this._deselectAll("gui_html_tree")}else{this._deselectAll("html_tree")
}this.active=d;d.addClassName("selected");var b=this.active.up("ul");while(b&&b!=this.topUL){var a=b.up("li");if(!a){break}a.addClassName("active");b=a.up("ul")}}})})();SL.dnd={};(function(){SL.dnd.SortableTable=Class.create(SL.Component,{init:function(){this.config.setDefault("callbacks",{});
this.config.setDefault("grip_class",null);this.cb=this.config.ensureHash("cb");this.gripClass=this.config.get("grip_class");this.root=this.e.down("tbody");if(!this.root){this.root=this.e}this._initObservedElements()
},_initObservedElements:function(){if(this.observed){this.observed.each(function(e){var element=$(e.key);if(element){element.stopObserving("mousedown",e.value)}}.bind(this))}this.observed=$H();this.root.childElements().each(function(e){if(this.gripClass){e.select("."+this.gripClass).each(function(e,e2){this._observeElement(e,e2)
}.bind(this,e))}else{this._observeElement(e)}}.bind(this))},_observeElement:function(e,e2){if(!this.observed.get(e2)&&!e2.down("form")){var h=this.onMouseDown.bind(this,e);e2.observe("mousedown",h);this.observed.set(e2.identify(),h)
}},onChildComponentChanged:function(component){this._initObservedElements()},onMouseDown:function(e,event){if(this.mouseMoveEvent||!event.isLeftClick()){return}this.mouseMoveEvent=this.onMouseMove.bind(this,e);
this.mouseUpEvent=this.onMouseUp.bind(this,e);document.observe("mousemove",this.mouseMoveEvent);document.observe("mouseup",this.mouseUpEvent);var offset=e.cumulativeOffset();this.xOffset=event.pageX-offset.left;
event.stop()},onMouseUp:function(e,event){document.stopObserving("mousemove",this.mouseMoveEvent);document.stopObserving("mouseup",this.mouseUpEvent);this.mouseMoveEvent=undefined;this.mouseUpEvent=undefined;
if(this.marker){var index=this.marker.up().childElements().indexOf(this.marker);if(this.ghost){this.marker.replace(this.ghost.down("tr"));this.ghost.remove()}else{this.ghost.remove()}this.marker=undefined;
this.ghost=undefined;if(this.cb.dragStop){this.cb.dragStop(this,e,index)}}this.previousIndex=undefined},onMouseMove:function(e,event){if(!this.marker){if(this.cb.dragStart){this.cb.dragStart(this,e)}this.previousIndex=e.up().childElements().indexOf(e);
this.marker=this.createMarker(e);this.ghost=SL.utils.createBodyElement("table",{"class":this.e.readAttribute("class")});this.ghost.setStyle({width:this.e.getWidth()+"px"});this.ghost.hide();var tb=new Element("tbody");
this.ghost.appendChild(tb);tb.appendChild(e.replace(this.marker));this.ghost.setStyle({position:"absolute",cursor:"move",zIndex:"1000"});this.ghost.setOpacity("0.8");this.ghost.show()}this.ghost.setStyle({left:event.pageX-this.xOffset+"px",top:event.pageY-(e.getHeight()/2)+"px"});
var row=this.findRowAt(event.pageX,event.pageY);if(row){if(row.e==this.marker){return}if(row.overlap<0.5){row.e.insert({after:this.marker})}else{row.e.insert({before:this.marker})}}event.stop()},findRowAt:function(x,y){var rows=this.root.childElements();
for(var i=0;i<rows.length;i++){var e=rows[i];var offset=e.cumulativeOffset();if(x<offset.left||y<offset.top){continue}if(x>offset.left+e.getWidth()){continue}if(y>offset.top+e.getHeight()){continue}var overlap=1-((y-offset.top)/e.getHeight());
return{e:e,overlap:overlap}}return false},createMarker:function(origRow){var e=SL.elements.createBlindRow(origRow);var mdiv=new Element("div");mdiv.setStyle({margin:"0",padding:"0",height:origRow.getHeight()-4+"px",border:"dotted #777 2px"});
e.down("td").appendChild(mdiv);return e},cleanup:function(){if(this.mouseMoveEvent){document.stopObserving("mousemove",this.mouseMoveEvent);document.stopObserving("mouseup",this.mouseUpEvent)}if(this.ghost){this.ghost.remove()
}}});SL.dnd.Draggable=Class.create(SL.Element,{init:function(){this.config.setDefault("grip_class",null);this.config.setDefault("orientation","both");this.config.setDefault("spacer_width",10);this.cb=this.config.ensureHash("cb");
this.orientation=this.config.get("orientation");var gripClass=this.config.get("grip_class");this.handle=gripClass?this.e.down("."+gripClass):this.e;if(!this.handle){console.log("Handle not found:"+gripClass);
return}this.mouseDownHandler=this.onMouseDown.bind(this);this.handle.observe("mousedown",this.mouseDownHandler);this.handle.setStyle({cursor:"move"});this.mouseClickHandler=this.onMouseClick.bind(this);
this.handle.observe("click",this.mouseClickHandler)},onMouseDown:function(event){if(this.mouseMoveEvent||!event.isLeftClick()){return}this.mouseMoveEvent=this.onMouseMove.bind(this);this.mouseUpEvent=this.onMouseUp.bind(this);
document.observe("mousemove",this.mouseMoveEvent);document.observe("mouseup",this.mouseUpEvent);this.xOffset=event.pointerX()-this.e.offsetLeft;this.yOffset=event.pointerY()-this.e.offsetTop;event.stop()
},onMouseClick:function(event){event.stop()},onMouseUp:function(event){document.stopObserving("mousemove",this.mouseMoveEvent);document.stopObserving("mouseup",this.mouseUpEvent);this.mouseMoveEvent=undefined;
this.mouseUpEvent=undefined;if(this.active){this.active=false;if(this.cb.dragStop){this.cb.dragStop(this)}}this.reenableIframes();event.stop()},onMouseMove:function(event){if(!this.active){this.active=true;
if(this.cb.dragStart){this.cb.dragStart(this)}}var minX=this.config.get("minX")||0;var minY=this.config.get("minY")||0;var op=this.e.getOffsetParent();var opWidth=op.getWidth();var opHeight=op.getHeight();
if(op.tagName=="BODY"){var bh=SL.effects.getBodyHeight();if(opHeight<bh){opHeight=bh}}var maxX=opWidth-this.config.get("spacer_width")-(this.config.get("maxX")||0)-this.e.getWidth();var maxY=opHeight-this.config.get("spacer_width")-(this.config.get("maxY")||9)-this.e.getHeight();
if(this.orientation=="horizontal"){this.e.setStyle({left:Math.min(Math.max(minX,event.pointerX()+2-this.xOffset),maxX)+"px"})}else{if(this.orientation=="vertical"){this.e.setStyle({top:Math.min(Math.max(minY,event.pointerY()+2-this.yOffset),maxY)+"px"})
}else{this.e.setStyle({left:Math.min(Math.max(minX,event.pointerX()+2-this.xOffset),maxX)+"px",top:Math.min(Math.max(minY,event.pointerY()+2-this.yOffset),maxY)+"px"})}}if(this.cb.moved){this.cb.moved(this)
}this.updateIframes();event.stop()},updateIframes:function(){if(this.iframes){this.iframes.each(function(b){b.e.clonePosition(b.frame)})}else{this.iframes=$A();$$("iframe").each(function(frame){var e=SL.utils.createBodyElement("div");
e.clonePosition(frame);e.setStyle({position:"absolute",backgroundColor:"#ffffff"});e.setOpacity(0);this.iframes.push({e:e,frame:frame})}.bind(this))}},reenableIframes:function(){if(this.iframes){this.iframes.each(function(b){b.e.remove()
});this.iframes=undefined}},cleanup:function(){this.handle.stopObserving("mousedown",this.mouseDownHandler);this.reenableIframes()},updatePos:function(x,y){if(x){this.e.setStyle({left:x+"px"})}if(y){this.e.setStyle({top:y+"px"})
}if(this.cb.moved){this.cb.moved(this)}},getPos:function(){return this.e.positionedOffset()}});SL.dnd.Dashboard=Class.create(SL.Component,{init:function(){this.config.setDefault("prefix","");this.prefix=this.config.get("prefix");
console.log("Init dashboard");this.container=this.e.select("."+this.prefix+"dashboard_container");this.dashlets=$A();console.log("Dashboard containers:",this.container.length);this.container.each(function(c){c.childElements().each(function(d){if(d.hasClassName(this.prefix+"dashlet")){new SL.dnd.Dashlet(d,{grip_class:this.prefix+"dashlet_head",dashboard:this});
this.dashlets.push(d)}}.bind(this))}.bind(this));this.updateHeight();this.e.up("."+this.prefix+"dashboard").setStyle({position:"relative"})},updateHeight:function(){this.container.each(function(c){c.setStyle({height:"auto"})
}.bind(this));this._updateHeightDefered.bind(this).defer()},_updateHeightDefered:function(){this.maxHeight=this.e.down().getHeight();this.container.each(function(c){if(this.maxHeight<c.getHeight()){this.maxHeight=c.getHeight()
}}.bind(this));if(this.maxHeight<=100){this.maxHeight=100}this.container.each(function(c){c.setStyle({height:this.maxHeight+"px"})}.bind(this))},notifyNewPosition:function(dashlet){this.updateHeight();
var url=this.config.get("notify_url");url=url.replace("@container@",dashlet.e.up().id);if(dashlet.isNew){url=url.replace("@id@",dashlet.e.id);url=url.replace("@type@",dashlet.config.get("dashlet_type"))
}else{url=url.replace("@id@",dashlet.e.down("."+this.prefix+"dashlet_body").down().id);url=url.replace("@type@","")}url=url.replace("@index@",dashlet.index);new Ajax.Request(url,{onSuccess:function(dashlet,o){eval(o.responseText)
}.bind(this,dashlet)})},attachNewDashlet:function(dashlet){this.dashlets.push(dashlet.e);dashlet.e.addClassName(this.prefix+"dashlet");dashlet.e.setStyle({display:"block"});dashlet.isNew=undefined;this.updateHeight()
},onChildComponentChanged:function(){this.updateHeight()}});SL.dnd.Dashlet=Class.create(SL.dnd.Draggable,{init:function($super){this.config.setDefault("cb",{dragStart:this.dragStart.bind(this),dragStop:this.dragStop.bind(this),moved:this.moved.bind(this)});
this.dashboard=this.config.get("dashboard");this.isNew=this.config.get("is_new");$super()},dragStart:function(){this.parent=this.e.up();this.index=this.parent.childElements().indexOf(this.e);var width=this.e.getWidth();
var height=this.e.getHeight();this.e.setStyle({width:width+"px",height:height+"px",position:"absolute"});this.ghost=new Element("div");this.ghost.setStyle({width:"100%",height:height+"px",border:"dotted #aaa 2px"});
if(!this.isNew){this.dashboard.e.up().appendChild(this.e.replace(this.ghost))}else{this.rep=new Element("div");this.rep.setStyle({width:width+"px",height:height+"px"});this.e.setStyle({display:"table-cell",width:"auto"});
this.dashboard.e.up().appendChild(this.e.replace(this.rep))}this.config.set("minY",this.e.getHeight()/-2);this.config.set("maxY",this.e.getHeight()/-2)},dragStop:function(){if(this.rep&&!this.ghost.up()){this.rep.replace(this.e)
}else{this.ghost.replace(this.e)}this.e.setStyle({position:"static",width:"auto",height:"auto"});var parent=this.e.up();var index=parent.childElements().indexOf(this.e);if(this.parent==parent&&this.index==index){return
}this.parent=parent;this.index=index;this.dashboard.notifyNewPosition.bind(this.dashboard,this).defer()},moved:function(){var offset=this.e.cumulativeOffset();var hovered=this.findAt(this.dashboard.dashlets,offset.left+this.e.getWidth()/2,offset.top+this.e.getHeight()/2);
if(hovered){if(hovered.overlap<0.4){hovered.e.insert({after:this.ghost});this.dashboard.updateHeight()}else{if(hovered.overlap>0.6){hovered.e.insert({before:this.ghost});this.dashboard.updateHeight()}}return
}hovered=this.findAt(this.dashboard.container,offset.left+this.e.getWidth()/2,offset.top+this.e.getHeight()/2);if(!hovered){return}if(this.isNew&&hovered.e==this.parent){return}hovered.e.appendChild(this.ghost);
this.dashboard.updateHeight()},findAt:function(elements,x,y){for(var i=0;i<elements.length;i++){var e=elements[i];if(!e||e.up==undefined||this.e==e||this.ghost==e||(this.ghost.up()&&this.ghost.up()==e)){continue
}var offset=e.cumulativeOffset();if(x<offset.left||y<offset.top){continue}if(x>offset.left+e.getWidth()){continue}if(y>offset.top+e.getHeight()){continue}var overlap=1-((y-offset.top)/e.getHeight());return{e:e,overlap:overlap}
}return false}})})();(function(){SL.ui.SplitPane=Class.create(SL.Component,{init:function(){this.config.setDefault("spacer_width",7);this.config.setDefault("orientation","horizontal");this.config.setDefault("spacer_class","gui_splitpane_"+this.config.get("orientation")+"_spacer");
this.div1=$(this.e.childElements()[0]);this.div2=$(this.e.childElements()[1]);setTimeout(this.initDefered.bind(this),75)},initDefered:function(){var a=this.config.get("spacer_width");this.spacer=new Element("div",{"class":this.config.get("spacer_class")});
this.e.setStyle({position:"relative"});this.div1.insert({after:this.spacer});if(this.config.get("orientation")=="horizontal"){var b=this.div1.getWidth();this.spacer.setStyle({position:"absolute",left:b+"px",top:"0",width:a+"px",bottom:"0",zIndex:"1"});
this.div1.setStyle({"float":"none",position:"absolute",left:"0",top:"0",width:b+"px"});this.div2.setStyle({"float":"none",position:"absolute",left:(b+a)+"px",top:"0",right:"0",marginLeft:"0"});this.currentHeight=Math.max(this.div1.getHeight(),this.div2.getHeight())+15;
this.e.setStyle({height:this.currentHeight+"px"});this.updateEvent=this.update.bind(this);this.actionURL=this.config.get("action_url");this.draggable=new SL.dnd.Draggable(this.spacer,{orientation:"horizontal",minX:this.config.get("min_left"),maxX:this.config.get("min_right"),cb:{moved:this.updateEvent,dragStop:this.onDragStop.bind(this)}})
}else{var c=this.div1.getHeight();this.spacer.setStyle({position:"absolute",left:"0",top:c+"px",height:a+"px",right:"0",zIndex:"1"});this.div1.setStyle({position:"absolute",left:"0",top:"0"});this.div2.setStyle({position:"absolute",top:(c+a)+"px",left:"0",right:"0",bottom:"0"});
this.updateEvent=this.update.bind(this);this.actionURL=this.config.get("action_url");this.draggable=new SL.dnd.Draggable(this.spacer,{orientation:"vertical",minY:this.config.get("min_left"),maxY:this.config.get("min_right"),cb:{moved:this.updateEvent,dragStop:this.onDragStop.bind(this)}})
}Event.observe(document.onresize?document:window,"resize",this.updateEvent);setTimeout(this.onCheckLayout.bind(this),500)},onCheckLayout:function(){if(this.isCleanedUp){return}if(this.config.get("orientation")=="horizontal"){var a=Math.max(this.div1.getHeight(),this.div2.getHeight())+15;
var b=this.currentHeight!=a;if(b){this.currentHeight=a;this.e.setStyle({height:a+"px"})}this.spacer.setStyle({height:this.currentHeight+"px"});setTimeout(this.onCheckLayout.bind(this),b?150:250)}},update:function(){var b=this.config.get("spacer_width");
if(this.config.get("orientation")=="horizontal"){var a=Math.max(this.div1.getHeight(),this.div2.getHeight())+15;if(this.currentHeight==a){}this.currentHeight=a;var f=this.spacer.offsetLeft;var c=f;this.spacer.setStyle({left:c+"px"});
this.div1.setStyle({width:c+"px"});this.div2.setStyle({left:(c+b)+"px"});this.e.setStyle({height:this.currentHeight+"px"});this.spacer.setStyle({height:this.currentHeight+"px"})}else{var f=this.spacer.offsetTop;
var d=f;this.spacer.setStyle({top:d+"px"});this.div1.setStyle({height:d+"px"});this.div2.setStyle({top:(d+b)+"px"})}},onChildComponentChanged:function(){console.log("Child changed");this.update()},onDragStop:function(){if(this.actionURL){var a=this.spacer.offsetLeft;
new Ajax.Request(this.actionURL+"&args._sp_offset="+a)}},cleanup:function(){this.draggable.destroy();Event.stopObserving(document.onresize?document:window,"resize",this.updateEvent)}})})();(function(){SL.ui.Tooltip=Class.create(SL.Component,{init:function(){this.config.setDefault("hide_delay",500);
this.config.setDefault("show_delay",500);this.config.setDefault("mode","normal");this.trigger=$(this.config.get("connect_id"));this.followMouse=this.config.get("mode")=="follow_mouse";SL.utils.reparentToBody(this.e);
this.e.setStyle({display:"block",position:"absolute",zIndex:"999"});this.e.hide();this.onTriggerEnterEvent=this.onTriggerEnter.bind(this);this.onTriggerLeaveEvent=this.onTriggerLeave.bind(this);this.trigger.observe("mouseenter",this.onTriggerEnterEvent);
this.trigger.observe("mouseleave",this.onTriggerLeaveEvent);this.initURL=this.config.get("url")},notifyInitEvent:function(a){this.onTriggerEnter(a)},onTriggerEnter:function(a){this.onTrigger=true;if(this.hideTimeout){clearTimeout(this.hideTimeout);
this.hideTimeout=undefined}if(this.showTimeout){return}if(this.initURL){this.load(this.initURL);this.initURL=undefined}this.onTooltipEnterEvent=this.onTooltipEnter.bind(this);this.onTooltipLeaveEvent=this.onTooltipLeave.bind(this);
this.e.observe("mouseenter",this.onTooltipEnterEvent);this.e.observe("mouseleave",this.onTooltipLeaveEvent);this.showTimeout=setTimeout(this._showDefered.bind(this),this.config.get("show_delay"));this.triggerPosition={left:a.pageX,top:a.pageY}
},onTriggerLeave:function(b){this.onTrigger=false;if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=undefined}if(!this.shown){return}if(this.hideTimeout){clearTimeout(this.hideTimeout);
this.hideTimeout=undefined}if(!this.onTooltip){var a=this.config.get("hide_delay");if(a>0){this.hideTimeout=setTimeout(this._hide.bind(this),a)}else{this._hide()}}},onTooltipEnter:function(a){if(this.hideTimeout){clearTimeout(this.hideTimeout);
this.hideTimeout=undefined}this.onTooltip=true},onTooltipLeave:function(a){this.onTooltip=false;if(!this.onTrigger){this.timeout=setTimeout(this._hide.bind(this),this.config.get("hide_delay"))}},_showDefered:function(){this.showTimeout=undefined;
if(!this.onTrigger&&!this.onTooltip){return}if(SL.ui._staticTooltip){if(!this.trigger.up("#"+SL.ui._staticTooltip.id)){return}}this.shown=true;SL.ui._registerActiveTooltip(this);if(this.followMouse){this.onMouseMoveEvent=this.onMouseMove.bind(this);
this.trigger.observe("mousemove",this.onMouseMoveEvent);this.e.observe("mousemove",this.onMouseMoveEvent)}this._update()},onSuccess:function(){this._update()},onChildComponentChanged:function(){this._update()
},onMouseMove:function(b){var a=this.trigger.cumulativeOffset();if(b.pageX<a.left){return}if(b.pageX>a.left+this.trigger.getWidth()){return}if(b.pageY<a.top){return}if(b.pageY>a.top+this.trigger.getHeight()){return
}this.triggerPosition={left:b.pageX,top:b.pageY};this._updatePositions()},_update:function(){new SL.effects.Preloader(this.e,this._updatePositions.bind(this)).run()},_updatePositions:function(){if(!this.shown){return
}if(this.config.get("mode")=="beside"){var h=this.trigger.cumulativeOffset();var c=h.left+this.trigger.getWidth()+5;var l=h.top+this.trigger.getHeight()/2-this.e.getHeight()/2;var i=document.viewport.getScrollOffsets();
var k=document.viewport.getDimensions();if(c+this.e.getWidth()>i.left+k.width){c=h.left-5-this.e.getWidth()}if(l<i.top){l=i.top}if(l+this.e.getHeight()>i.top+k.height){l=i.top+k.height-this.e.getHeight()
}this.e.setStyle({left:c+"px",top:l+"px"});if((this.onTrigger||this.onTooltip)&&this.shown){this.e.show()}return}if(this.config.get("mode")=="below"){var h=this.trigger.cumulativeOffset();var l=h.top+this.trigger.getHeight()+5;
this.e.setStyle({left:h.left+"px",top:l+"px"});if((this.onTrigger||this.onTooltip)&&this.shown){this.e.show()}return}if(this.followMouse){if(!this.triggerPosition){console.log("No trigger position");return
}var c=this.triggerPosition.left+2;var l=this.triggerPosition.top+2;var i=document.viewport.getScrollOffsets();var k=document.viewport.getDimensions();var g=i.left+k.width;var d=c+this.e.getWidth()-g;if(d>0){var j=i.left-(c-this.e.getWidth());
if(j<d){c=c-this.e.getWidth()-2}}var b=i.top+k.height;var a=l+this.e.getHeight()-b;if(a>0){var f=i.top-(l-this.e.getHeight());if(f<a){l=l-this.e.getHeight()-2}}this.e.setStyle({left:c+"px",top:l+"px"});
if((this.onTrigger||this.onTooltip)&&this.shown){this.e.show()}return}var h=this.trigger.cumulativeOffset();var i=document.viewport.getScrollOffsets();var k=document.viewport.getDimensions();var c;if(this.triggerPosition){c=this.triggerPosition.left
}else{c=h.left+this.trigger.getWidth()}if(c+this.e.getWidth()>i.left+k.width){c=Math.max(h.left-this.e.getWidth(),i.left)}var l=h.top+this.trigger.getHeight();if(l+this.e.getHeight()>i.top+k.height){l=Math.max(h.top-this.e.getHeight(),i.top)
}this.e.setStyle({left:c+"px",top:l+"px"});if((this.onTrigger||this.onTooltip)&&this.shown){this.e.show()}},_hide:function(a){if(!a&&(this.onTrigger||this.onTooltip)){return}if(this.hideTimeout){clearTimeout(this.hideTimeout);
this.hideTimeout=undefined}if(this.showTimeout){clearTimeout(this.showTimeout);this.showTimeout=undefined}this.e.hide();this.shown=false;if(this.onTooltipEnterEvent){this.e.stopObserving("mouseenter",this.onTooltipEnterEvent);
this.e.stopObserving("mouseleave",this.onTooltipLeaveEvent)}if(this.onMouseMoveEvent){this.trigger.stopObserving("mousemove",this.onMouseMoveEvent);this.e.stopObserving("mousemove",this.onMouseMoveEvent)
}this.onTrigger=false;this.onTooltip=false;this.triggerPosition=undefined;if(!a){SL.ui._registerActiveTooltip(null)}},cleanup:function(){this.trigger.stopObserving("mouseenter",this.onTriggerEnterEvent);
this.trigger.stopObserving("mouseleave",this.onTriggerLeaveEvent);if(this.onTooltipEnterEvent){this.e.stopObserving("mouseenter",this.onTooltipEnterEvent);this.e.stopObserving("mouseleave",this.onTooltipLeaveEvent)
}this.e.hide();this.e.remove()}});SL.ui.Bubble=Class.create(SL.Component,{init:function(){this.attached=$(this.config.get("attach_id"));this.position=this.config.get("position");this.isStatic=this.config.get("static");
SL.utils.reparentToBody(this.e);this.e.setStyle({display:"block",position:"absolute",zIndex:"999"});this.e.hide();if(this.isStatic){this.show()}else{this.trigger=this.attached.down("input");if(this.trigger){this.trigger.observe("focus",this.show.bind(this));
this.trigger.observe("blur",this.hide.bind(this));if(document.activeElement==this.trigger){this.show()}else{if(this.config.get("visible")){this.trigger.focus()}}}if(this.config.get("visible")){this.show()
}}this.connectDestroy(this.attached)},show:function(){if(!this.shown){this.shown=true;this._update()}},hide:function(){if(!this.isStatic&&this.shown){this.e.hide();this.shown=false}},_update:function(){new SL.effects.Preloader(this.e,this._updatePositions.bind(this)).run()
},_updatePositions:function(){if(!this.shown){return}var b=this.attached.getWidth();var h=this.attached.getHeight();var c=this.attached.cumulativeOffset();var a=this.attached.tagName.toLowerCase();if(a=="td"||a=="th"){var d=this.attached.up("tr");
c.top=d.cumulativeOffset().top;h=d.getHeight()}var g;var f;if(this.position=="top"){f=c.left+b/2-this.e.getWidth()/2;g=c.top-this.e.getHeight()-5}else{if(this.position.startsWith("bottom")){g=c.top+h+5;
if(this.position.endsWith("_left")){f=c.left}else{f=c.left+b/2-this.e.getWidth()/2}}else{g=c.top+h/2-this.e.getHeight()/2;if(this.position=="left"){f=c.left-this.e.getWidth()-5}else{f=c.left+b+5}}}this.e.setStyle({left:f+"px",top:g+"px"});
this.e.show();setTimeout(this._updatePositions.bind(this),250)}});SL.ui._registerActiveTooltip=function(a){if(SL.ui._activeTooltip){if(SL.ui._activeTooltip==a){return}SL.ui._activeTooltip._hide(true)}SL.ui._activeTooltip=a
};SL.ui._closeActiveTooltips=function(){if(SL.ui._activeTooltip){try{SL.ui._activeTooltip._hide(true)}catch(a){}}};SL.ui._hasStaticTooltip=function(a){return SL.ui._staticTooltip?true:false};SL.ui._registerStaticTooltip=function(a){if(SL.ui._staticTooltip){if(SL.ui._staticTooltip==a){return
}SL.ui._staticTooltip._hide(true)}SL.ui._staticTooltip=a};SL.ui._closeStaticTooltips=function(){if(SL.ui._staticTooltip){try{SL.ui._staticTooltip._hide(true)}catch(a){}}}})();(function(){SL.effects.ContentChanger=Class.create(SL.Component,{init:function(){this.config.setDefault("timeout",5000);
this.config.setDefault("duration",500);this.content=this.config.get("content");this.current=0;this.mode=this.config.get("mode");if(this.content.length<=1){return}if(this.mode=="slideshow_horizontal"){this.count=this.config.get("count");
if(this.content.length<this.count){return}this.current=0;this.contentDiv=this.e.down(".slideshow_horizontal_content_inner");this.leftBtn=this.e.down(".slideshow_horizontal_left");if(this.leftBtn){this.leftBtn.observe("click",this.onPrev.bind(this));
this.leftBtn.addClassName("disabled")}this.rightBtn=this.e.down(".slideshow_horizontal_right");if(this.rightBtn){this.rightBtn.observe("click",this.onNext.bind(this,false));if(this.current>=this.content.length-this.count){this.rightBtn.addClassName("disabled")
}}if(this.config.get("autostart")){this.startSlideshow.bind(this).defer()}}else{if(this.mode=="slideshow_horizontal_auto_left_right"){this.contentDiv=this.e.down(".slideshow_horizontal_content_inner");
this.horizontalTimer=setTimeout(this.nextHorizontalAuto.bind(this,true),this.config.get("timeout"))}else{if(this.mode=="slideshow_horizontal_auto_right_left"){this.contentDiv=this.e.down(".slideshow_horizontal_content_inner");
this.rl=true;this.horizontalTimer=setTimeout(this.nextHorizontalAuto.bind(this,true),this.config.get("timeout"))}else{this.currentElement=$(this.content[0].id);if(this.config.get("timeout")>0){setTimeout(this.next.bind(this,true),this.content[0].timeout||this.config.get("timeout"))
}}}}this.nav=this.e.down(".content_changer_nav");if(this.nav){var b=this.nav.up().findZIndex()||0;this.nav.setStyle({zIndex:(b+5)+""});this.nav=this.nav.down().childElements();this.nav[0].addClassName("active");
for(var a=0;a<this.nav.length;a++){this.nav[a].observe("click",this.switchTo.bind(this,a));this.nav[a].setStyle({cursor:"pointer"})}}this.e.select(".content_changer_next").each(function(c){c.observe("click",this.next.bind(this,false))
}.bind(this));this.e.select(".content_changer_prev").each(function(c){c.observe("click",this.prev.bind(this,false))}.bind(this));this.mouseOverCSS=this.config.get("mouse_over_css");if(this.mouseOverCSS){this.e.observe("mouseenter",this.mouseOverEnter.bind(this));
this.e.observe("mouseleave",this.mouseOverLeave.bind(this));this.e.select("."+this.mouseOverCSS).each(function(c){c.hide()}.bind(this))}},mouseOverEnter:function(){this.e.select("."+this.mouseOverCSS).each(function(a){SL.effects.registerCurrent(Effect.Appear(a,{duration:0.25}))
}.bind(this))},mouseOverLeave:function(){this.e.select("."+this.mouseOverCSS).each(function(a){SL.effects.registerCurrent(Effect.Fade(a,{duration:0.25}))}.bind(this))},startSlideshow:function(){this.autostart=true;
this.onNext(true)},next:function(a){if(this.disabled){return}if(a||!this.hasAnimation){if(!a&&this.timeout){clearTimeout(this.timeout);this.timeout=undefined;this.userNavigation=true}this.current++;if(this.current>=this.content.length){this.current=0
}var b=$(this.content[this.current].id);if(!b){console.log("Unable to get element for id:",this.content[this.current].id);this.switchToCurrent.bind(this).defer();return}new SL.effects.Preloader(b,this.switchToCurrent.bind(this)).run()
}},prev:function(a){if(this.disabled){return}if(a||!this.hasAnimation){if(!a&&this.timeout){clearTimeout(this.timeout);this.timeout=undefined;this.userNavigation=true}this.current--;if(this.current<0){this.current=this.content.length-1
}new SL.effects.Preloader($(this.content[this.current].id),this.switchToCurrent.bind(this)).run()}},switchTo:function(a){if(this.disabled){return}if(!this.hasAnimation&&this.current!=a){if(this.mode=="slideshow_horizontal_auto_right_left"||this.mode=="slideshow_horizontal_auto_left_right"){this.switchToHorizontal(a);
return}if(this.timeout){clearTimeout(this.timeout);this.timeout=undefined;this.userNavigation=true}this.current=a;new SL.effects.Preloader($(this.content[this.current].id),this.switchToCurrent.bind(this)).run()
}},switchToCurrent:function(){if(this.hasAnimation||this.disabled){return}this.hasAnimation=true;var b=this.currentElement.up().findZIndex()||0;this.currentElement.setStyle({zIndex:b+""});var a=this.config.get("duration");
new Effect.Fade(this.currentElement,{from:1,to:0,duration:a/2000,transition:Effect.Transitions.linear,delay:a/2000});this.currentElement=$(this.content[this.current].id);this.currentElement.setOpacity(0);
this.currentElement.setStyle({visibility:"visible",zIndex:(b+1)+""});new Effect.Appear(this.currentElement,{from:0,to:1,duration:a/1000,transition:Effect.Transitions.linear,afterFinish:function(){this.hasAnimation=false;
this.activateTimeout()}.bind(this)});if(this.nav){setTimeout(this.updateNav.bind(this),a/2)}},updateNav:function(){this.nav.each(function(a){a.removeClassName("active")});this.nav[this.current].addClassName("active")
},activateTimeout:function(){if(!this.userNavigation&&this.config.get("timeout")>0){this.timeout=setTimeout(this.next.bind(this,true),this.content[this.current].timeout||this.config.get("timeout"))}},onNext:function(a){if(this.disabled){return
}if(this.hasAnimation){if(!a){this.autostart=undefined}return}if(this.current>=this.content.length-this.count){if(a){this.autostart=undefined}return}if(!a){this.autostart=undefined}this.hasAnimation=true;
this.current+=this.count;if(this.current>=this.content.length-this.count){this.current=this.content.length-this.count;if(this.rightBtn){this.rightBtn.addClassName("disabled")}}else{if(this.rightBtn){this.rightBtn.removeClassName("disabled")
}}if(this.current>0){if(this.leftBtn){this.leftBtn.removeClassName("disabled")}}this.scrollToCurrent(true)},onPrev:function(){if(this.disabled){return}if(this.hasAnimation){this.autostart=undefined;return
}if(this.current<=0){return}this.autostart=undefined;this.hasAnimation=true;this.current-=this.count;if(this.current<=0){this.current=0;if(this.leftBtn){this.leftBtn.addClassName("disabled")}}else{if(this.leftbtn){this.leftBtn.removeClassName("disabled")
}}if(this.current<this.content.length-this.count){if(this.rightBtn){this.rightBtn.removeClassName("disabled")}}this.scrollToCurrent(false)},scrollToCurrent:function(b){if(this.disabled){return}var a=$(this.content[this.current].id).positionedOffset().left;
new Effect.Move(this.contentDiv,{x:a*-1,y:0,mode:"absolute",duration:this.config.get("duration")/1000,transition:b?Effect.Transitions.linear:Effect.Transitions.sinoidal,afterFinish:function(){this.hasAnimation=false;
if(this.autostart){this.onNext(true)}}.bind(this)})},nextHorizontalAuto:function(){this.switchToHorizontal(this.current+1)},switchToHorizontal:function(a){if(this.hasAnimation||this.disabled){return}if(this.horizontalTimer){clearTimeout(this.horizontalTimer);
this.horizontalTimer=undefined}var b=$(this.content[this.current].id);this.current=a;if(this.current>this.content.length-1){this.current=0}var d=$(this.content[this.current].id);var c=this.contentDiv.getWidth();
this.hasAnimation=true;var f=function(){this.hasAnimation=false;this.horizontalTimer=setTimeout(this.nextHorizontalAuto.bind(this,true),this.config.get("timeout"))}.bind(this);if(this.rl){d.setStyle({left:(c)+"px"});
d.show();new Effect.Move(d,{x:-c,mode:"relative",duration:this.config.get("duration")/1000,afterFinish:f});new Effect.Move(b,{x:-c,mode:"relative",duration:this.config.get("duration")/1000})}else{d.setStyle({left:(-1*c)+"px"});
d.show();new Effect.Move(d,{x:c,mode:"relative",duration:this.config.get("duration")/1000,afterFinish:f});new Effect.Move(b,{x:c,mode:"relative",duration:this.config.get("duration")/1000})}if(this.nav){setTimeout(this.updateNav.bind(this),this.config.get("duration")/2)
}},cleanup:function(){this.disabled=true}});SL.effects.ImageMagnifier=Class.create(SL.Element,{init:function(){this.config.setDefault("position","none");this.url=this.config.get("url");this.attachElement=$(this.config.get("attach_id"));
var a=new Image();a.onload=function(){this.initView.bind(this,a.width,a.height).defer()}.bind(this);a.src=this.url;this.box=new Element("div");this.box.setStyle({position:"absolute",backgroundColor:"#fff"});
this.box.setOpacity(0.3);this.box.hide();this.attachElement.up().appendChild(this.box);this.attachElement.up().setStyle({position:"relative"});var b=new Element("div");this.attachElement.up().appendChild(b);
b.setStyle({position:"absolute",left:0,top:0,width:this.attachElement.getWidth()+"px",height:this.attachElement.getHeight()+"px"});b.observe("mouseenter",this.onMouseEnter.bind(this));b.observe("mouseleave",this.onMouseLeave.bind(this));
b.observe("mousemove",this.onMouseMove.bind(this))},initView:function(c,a){var b=this.attachElement.getWidth()/this.attachElement.getHeight();var f=a*b;var d=this.e.getWidth()/c*this.attachElement.getWidth();
var h=this.e.getHeight()/a*this.attachElement.getHeight();if(f<c){var g=(c/this.attachElement.getWidth()*d);this.width=c+g;this.height=(c/b)+g}else{var g=(a/this.attachElement.getHeight()*h);this.width=(a*b)+g;
this.height=a+g}this.box.setStyle({width:d+"px",height:h+"px"});this.e.down().down().setStyle({position:"absolute",top:0,left:0,width:this.width+"px",height:this.height+"px",backgroundImage:"url("+this.url+")"})
},onMouseEnter:function(b){var a=this.config.get("position");if(a=="right"){this.e.setStyle({position:"absolute",marginLeft:this.attachElement.getWidth()+"px",top:0})}this.setPosition(b.pageX,b.pageY);
this.e.show();this.box.show()},onMouseLeave:function(a){this.e.hide();this.box.hide()},onMouseMove:function(a){this.setPosition(a.pageX,a.pageY)},setPosition:function(j,g){var c=this.attachElement.cumulativeOffset();
var b=this.attachElement.getWidth();var l=this.attachElement.getHeight();var k=j-c.left;var i=g-c.top;var d=this.box.getWidth();var f=this.box.getHeight();if(k<d/2){k=d/2}else{if(k>b-d/2){k=b-d/2}}if(i<f/2){i=f/2
}else{if(i>l-f/2){i=l-f/2}}this.box.setStyle({left:(k-d/2)+"px",top:(i-f/2)+"px"});var a=(this.width-this.e.getWidth())*(k/b*-1);var h=(this.height-this.e.getHeight())*(i/l*-1);this.e.down().down().setStyle({left:a+"px",top:h+"px"})
}})})();(function(){SL.ui.HTMLEditor=Class.create(SL.Component,{init:function(){this.config.setDefault("textarea",this.id+"_t");this.config.setDefault("toolbar","Basic");this.config.setDefault("editor","fck");
this.config.setDefault("language","de");this._init.bind(this).defer()},_init:function(){if(this.config.get("editor")=="mce"){var a=$(this.config.get("textarea"));this.e.setStyle({visibility:"hidden"});
a.setStyle({visibility:"hidden"});setTimeout(function(c,b){if(c.getStyle("visibility")=="hidden"){c.setStyle({visibility:"visible"});b.setStyle({visibility:"visible"})}}.curry(this.e,a),2000);SL.utils.loadScript("/go/gui/_ws/mediabase/_ts_1312459638000/lib/tinymce-3.4.4/tiny_mce.js",this.initMCE.bind(this),function(){tinymce.dom.Event.domLoaded=true
})}else{this.editor=CKEDITOR.replace($(this.config.get("textarea")),{toolbar:this.config.get("toolbar")});this.editor.on("instanceReady",this._instanceReady.bind(this))}},initMCE:function(){console.log("Init MCE");
var a={mode:"none",theme:"advanced",skin:"o2k7",skin_variant:"silver",content_css:"/go/gui/_ws/mediabase/_ts_1311771171000/styles/tinymce.css",theme_advanced_toolbar_location:"top",theme_advanced_toolbar_align:"left",theme_advanced_statusbar_location:"bottom",theme_advanced_resizing:true,plugins:"safari,pagebreak,style,layer,table,advlink,emotions,inlinepopups,preview,media,searchreplace,contextmenu,paste,fullscreen,visualchars,nonbreaking,xhtmlxtras",theme_advanced_buttons1:"paste,pastetext,pasteword,|,bold,italic,underline,sub,sup,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,link,unlink,charmap,cleanup,table,|,code,|,fullscreen",theme_advanced_buttons2:"",theme_advanced_buttons3:"",language:this.config.get("language"),extended_valid_elements:"iframe[src|width|height|name|id|class|align|style|frameborder|border|allowtransparency],script[charset|defer|language|src|type]",init_instance_callback:this._instanceReady.bind(this)};
if(this.config.get("toolbar")=="Advanced"){a.theme_advanced_buttons1="bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,formatselect,fontselect,fontsizeselect";
a.theme_advanced_buttons2="cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,code,|,insertdate,inserttime,preview,|,forecolor,backcolor";
a.theme_advanced_buttons3="tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,fullscreen"}else{if(this.config.get("toolbar")=="easy"){a.theme_advanced_statusbar_location=undefined;a.theme_advanced_buttons1="pastetext,pasteword,|,bold,italic,underline,sub,sup,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,link,unlink,charmap,|,code,fullscreen"
}}tinyMCE.init(a);tinyMCE.execCommand("mceAddControl",false,this.config.get("textarea"))},_instanceReady:function(){console.log("Editor ready");this._emitContentChanged.bind(this,true).defer();if(this.e.getStyle("visibility")=="hidden"){setTimeout(function(a){a.setOpacity(0);
a.setStyle({visibility:"visible"});a.appear({duration:0.075})}.curry(this.e),1)}},updateForPost:function(){try{if(this.config.get("editor")=="mce"){tinyMCE.execCommand("mceRemoveControl",false,this.config.get("textarea"))
}else{if(this.editor){this.editor.updateElement();this.editor.destroy();this.editor=undefined}}}catch(a){console.log(a)}},cleanup:function(){this.updateForPost()},})})();(function(){SL.ui.Rating=Class.create(SL.Component,{init:function(){this.formElement=$(this.config.get("element_id"));
new SL.effects.Preloader(this.e,this._init.bind(this)).run();this.steps=this.e.childElements().length-1},_init:function(){this.active=parseInt(this.formElement.getValue());for(var a=0;a<this.e.childElements().length;
a++){var b=this.e.childElements()[a];if(a!=this.active){b.hide()}}this.e.show();this.e.observe("mousemove",this.onMouseMove.bind(this));this.e.observe("mouseenter",this.onMouseMove.bind(this));this.e.observe("mouseleave",this.onMouseLeave.bind(this));
this.e.observe("click",this.onClick.bind(this));this.formElement.hide()},onMouseMove:function(c){var a=c.pageX-this.e.cumulativeOffset().left;var b=(a/(this.e.getWidth()/this.steps)+0.5).toFixed();if(b>this.teps){b=this.steps
}else{if(b<=0){b=1}}if(this.active!=b){this.e.childElements()[this.active].hide();this.e.childElements()[b].show();this.active=b}},onMouseLeave:function(b){var a=parseInt(this.formElement.getValue());if(this.active!=a){this.e.childElements()[this.active].hide();
this.e.childElements()[a].show();this.active=a;this.formElement.setValue(a)}},onClick:function(){this.formElement.setValue(this.active)}});SL.ui.UrlOrFile=Class.create(SL.Component,{init:function(){this.file=$(this.id+"_f");
this.fakefile=$(this.id+"_ff");this.fileButton=$(this.id+"_fb");this.url=$(this.id+"_u");this.urlButton=$(this.id+"_ub");this.deleteButton=$(this.id+"_d");this.resetButton=$(this.id+"_r");this.origData=$(this.id+"_orig");
this.previewData=$(this.id+"_piid");this.deleteFileField=$(this.id+"_df");this.assetsField=$(this.id+"_ass");this.fallback=!SL.utils.supportsFileClick();if(this.fallback){this.file.setStyle({visibility:"visible",position:"static"});
this.fileButton.hide()}this.inputName=this.file.down().readAttribute("name");this.resetInput();this.fileButton.down().observe("click",this.onFileButtonClicked.bind(this));this.fakefile.observe("click",this.onFileButtonClicked.bind(this));
this.urlButton.down().observe("click",this.onUrlButtonClicked.bind(this));if(this.deleteButton){this.deleteButton.down().observe("click",this.onDeleteClicked.bind(this))}if(this.origData||this.previewData){this.resetButton.down().observe("click",this.onResetClicked.bind(this))
}},onFileChange:function(){this.url.hide();this.urlButton.removeClassName("inactive");if(!this.fallback){var b=this.file.down().value;if(!b){b="file"}else{var c=b.lastIndexOf("/");var a=b.lastIndexOf("\\");
if(c>=0||a>=0){if(c<0){b=b.substring(a+1)}else{if(a<0){b=b.substring(c+1)}else{if(c<a){b=b.substring(a+1)}else{b=b.substring(c+1)}}}}}this.fakefile.show();this.fakefile.down("input").value=b}if(this.deleteButton){this.deleteButton.show()
}this.deleteFileField.down().checked=false;if(this.origData){this.origData.hide();this.resetButton.show()}if(this.previewData){this.previewData.hide();this.resetButton.show()}if(this.assetsField){this.assetsField.value=""
}},resetInput:function(){if(this.file.down()){this.file.down().remove()}var a=new Element("input",{type:"file",name:this.inputName});this.file.appendChild(a);this.file.down().observe("change",this.onFileChange.bind(this))
},onFileButtonClicked:function(a){a.stop();this.file.down().click()},onUrlButtonClicked:function(a){a.stop();this.url.show();this.urlButton.addClassName("inactive");this.fakefile.hide();this.fakefile.down("input").value="";
this.resetInput();if(this.deleteButton){this.deleteButton.hide()}this.deleteFileField.down().checked=true;if(this.origData){this.origData.hide();this.resetButton.show()}if(this.previewData){this.previewData.hide();
this.previewData.show()}if(this.assetsField){this.assetsField.value=""}},onDeleteClicked:function(a){a.stop();this.deleteFileField.down().checked=true;this.fakefile.hide();this.fakefile.down("input").value="";
this.resetInput();this.urlButton.removeClassName("inactive");if(this.deleteButton){this.deleteButton.hide()}if(this.origData){this.origData.hide();this.resetButton.show()}if(this.previewData){this.previewData.hide();
this.resetButton.show()}if(this.assetsField){this.assetsField.value=""}},onResetClicked:function(a){a.stop();this.url.hide();this.url.down("input").value="";this.deleteFileField.down().checked=false;this.fakefile.hide();
this.fakefile.down("input").value="";this.resetInput();this.urlButton.removeClassName("inactive");this.resetButton.hide();if(this.origData){this.origData.show();if(this.origData.down(".gui_orig_file")&&this.deleteButton){this.deleteButton.show()
}}if(this.previewData){this.previewData.show();if(this.deleteButton){this.deleteButton.show()}}if(this.assetsField){this.assetsField.value=""}},setAsset:function(b,a){this.url.hide();this.url.down("input").value="";
this.deleteFileField.down().checked=false;this.resetInput();this.urlButton.removeClassName("inactive");this.resetButton.hide();if(this.origData){this.origData.hide()}if(this.deleteButton){this.deleteButton.hide()
}this.assetsField.value=b;this.fakefile.down("input").value=a;this.fakefile.show()}});SL.ui.FileField=Class.create(SL.Component,{init:function(){this.file=$(this.id+"_f");this.fakefile=$(this.id+"_ff");
this.fileButton=$(this.id+"_fb");this.deleteButton=$(this.id+"_d");this.resetButton=$(this.id+"_r");this.origData=$(this.id+"_orig");this.deleteFileField=$(this.id+"_df");this.assetsField=$(this.id+"_ass");
this.fallback=!SL.utils.supportsFileClick();if(this.fallback){this.file.setStyle({visibility:"visible",position:"static"});this.fileButton.hide()}else{this.fileButton.down().observe("click",this.onFileButtonClicked.bind(this));
this.fakefile.observe("click",this.onFileButtonClicked.bind(this))}this.inputName=this.file.down().readAttribute("name");this.resetInput();if(this.deleteButton){this.deleteButton.down().observe("click",this.onDeleteClicked.bind(this))
}if(this.origData){this.resetButton.down().observe("click",this.onResetClicked.bind(this))}},onFileChange:function(){if(!this.fallback){var b=this.file.down().value;if(!b){b="file"}else{var c=b.lastIndexOf("/");
var a=b.lastIndexOf("\\");if(c>=0||a>=0){if(c<0){b=b.substring(a+1)}else{if(a<0){b=b.substring(c+1)}else{if(c<a){b=b.substring(a+1)}else{b=b.substring(c+1)}}}}}this.fakefile.show();this.fakefile.down("input").value=b
}if(this.deleteButton){this.deleteButton.show()}this.deleteFileField.down().checked=false;if(this.origData){this.origData.hide();this.resetButton.show()}},resetInput:function(){if(this.file.down()){this.file.down().remove()
}var a=new Element("input",{type:"file",name:this.inputName});this.file.appendChild(a);this.file.down().observe("change",this.onFileChange.bind(this))},onFileButtonClicked:function(a){a.stop();this.file.down().click()
},onDeleteClicked:function(a){a.stop();this.deleteFileField.down().checked=true;this.fakefile.hide();this.fakefile.down("input").value="";this.resetInput();if(this.deleteButton){this.deleteButton.hide()
}if(this.origData){this.origData.hide();this.resetButton.show()}if(this.assetsField){this.assetsField.value=""}},onResetClicked:function(a){a.stop();this.deleteFileField.down().checked=false;this.fakefile.hide();
this.fakefile.down("input").value="";this.resetInput();this.resetButton.hide();this.origData.show();if(this.deleteButton){this.deleteButton.show()}if(this.origData.down(".gui_orig_file")&&this.deleteButton){this.deleteButton.show()
}if(this.assetsField){this.assetsField.value=""}},setAsset:function(b,a){this.resetInput();this.assetsField.value=b;this.fakefile.down("input").value=a;this.fakefile.show();if(this.origData){this.origData.hide();
this.resetButton.show()}}})})();(function(){SL.ui.AutoComplete=Class.create(SL.Component,{init:function(){this.config.setDefault("css_prefix","autocomplete");this.config.setDefault("multi",false);this.config.ensureHash("options");
this.input=this.e.down("input");this.input.writeAttribute("autocomplete","off");var form=this.input.up("form");if(form){this.input.writeAttribute("autocomplete","off")}new Form.Element.Observer(this.input,0.2,this.onInputChange.bind(this));
this.input.observe("blur",this.hideDelayed.bind(this))},onInputChange:function(e){if(!this.initialized){this.dd=new Element("div",{"class":this.config.get("css_prefix")+"_dropdown"});this.options=this.config.get("options");
this.url=this.config.get("options_url");this.input.insert({after:this.dd});this.e.setStyle({position:"relative"});this.dd.setStyle({position:"absolute",left:"0px",top:this.input.getHeight()+"px"});this.dd.hide();
this.initialized=true}var values=this.input.getValue().strip();if(!this.config.get("multi")){var value=values}else{var pos=values.lastIndexOf(",");if(pos<0){value=values}else{value=values.substr(pos+1).strip()
}}if(this.lastValue==value){return}this.lastValue=value;if(value.empty()){return}this.updateDropdown(value)},updateDropdown:function(value){options=this.options.get(value);if(!options){if(!this.url){this.hide();
return}if(this.config.get("multi")){var pos=value.lastIndexOf(",");if(pos>0){value=value.substr(pos+1)}}var url=this.url.replace("@value@",value);new Ajax.Request(url,{onSuccess:this.onOptionsResponse.bind(this)});
return}if(options.length>0){this.updateDropdownOptions(options)}else{this.hide()}},updateDropdownOptions:function(options){var inner=new Element("div",{"class":this.config.get("css_prefix")+"_dowpdown_inner"});
this.dd.update(inner);for(var i=0;i<options.length;i++){var o=options[i];if(o.link){var e=new Element("div");inner.appendChild(e);e.update(o.html);e.store("sl_ac_link",o.link);e.observe("click",o.link)
}else{var e=new Element("div");inner.appendChild(e);e.update(o.html);e.store("sl_ac_id",o.id);e.observe("click",this.onOptionClick.bind(this,o.id))}}if(!this.shown){this.dd.show();if(!this.keyHandler){this.keyHandler=this.onInputKey.bind(this);
document.observe("keydown",this.keyHandler)}this.shown=true}},onOptionsResponse:function(o){var options=eval("("+o.responseText+")");if(options&&options.data.length>0){this.options.set(options.id,options.data);
this.updateDropdownOptions(options.data)}else{this.hide()}},onInputKey:function(event){if(!this.shown){return}if(event.keyCode==Event.KEY_DOWN){event.stop();var current=this.dd.down(".selected");var next;
if(!current){next=this.dd.down().down()}else{next=current.next();current.removeClassName("selected");if(!next){return}}next.addClassName("selected")}else{if(event.keyCode==Event.KEY_UP){event.stop();var current=this.dd.down(".selected");
var prev;if(!current){var children=this.dd.down().childElements();prev=children[children.length-1]}else{prev=current.previous();current.removeClassName("selected");if(!prev){return}}prev.addClassName("selected")
}else{if(event.keyCode==Event.KEY_RETURN){var current=this.dd.down(".selected");if(current){event.stop();var link=current.retrieve("sl_ac_link");if(link){link()}else{this.selectOption(current.retrieve("sl_ac_id"))
}}this.hide()}else{if(event.keyCode==Event.KEY_ESC){event.stop();this.hide()}}}}},onOptionClick:function(id,event){this.selectOption(id);this.hide.bind(this).defer()},hideDelayed:function(){setTimeout(this.hide.bind(this),150)
},hide:function(){if(this.shown){this.dd.hide();this.shown=false}},add:function(value){this.selectOption(value,true)},selectOption:function(value,append){if(!this.config.get("multi")){this.lastValue=value;
this.input.value=value;this.input.focus();return}if(!value||this.contains(value)){this.input.focus();return}var values=this.input.value;if(values){var pos=values.lastIndexOf(",");if(pos<0){if(append){values+=", "+value
}else{values=value}}else{if(append){values=values.strip();if(values.endsWith(",")){values+=value}else{values+=", "+value}}else{values=values.substr(0,pos+1)+" "+value}}}else{values=value}this.lastValue=value;
this.input.value=values;this.input.focus();this.hide.bind(this).defer()},contains:function(id){var data=this.input.value;if(!data){return false}data=data.split(",");for(var i=0;i<data.length;i++){if(data[i].strip()==id){return true
}}return false}})})();(function(){SL.ui.Tabs=Class.create(SL.Component,{init:function(){this.headItems=this.e.select("div."+this.config.get("head_items"));this.bodyItems=this.e.select("div."+this.config.get("body_items"));
this.active=this.config.get("active");if(this.active>=0){this.bodyItems[this.active].show()}},activate:function(a){if(this.active==a){return}if(this.active>=0){this.headItems[this.active].removeClassName("active");
this.headItems[this.active].addClassName("inactive");this.bodyItems[this.active].hide()}this.active=a;this.headItems[this.active].addClassName("active");this.headItems[this.active].removeClassName("inactive");
this.bodyItems[this.active].show();this._emitContentChanged(true)}})})();(function(){SL.ui.Slider=Class.create(SL.Component,{init:function(){this.config.setDefault("range_min",0);this.config.setDefault("range_max",100);
this.left=this.e.down(".left");this.grip=this.e.down(".grip");this.right=this.e.down(".right");this.input=$(this.config.get("input_id"));this.cb=this.config.ensureHash("cb");this.draggable=new SL.dnd.Draggable(this.grip,{orientation:"horizontal",spacer_width:0,cb:{moved:this.moved.bind(this)}});
this.e.observe("click",this.onClick.bind(this));if(this.input&&this.input.value){var rangeMin=this.config.get("range_min");var rangeMax=this.config.get("range_max");var pct=(this.input.value-rangeMin)/(rangeMax-rangeMin)*100;
this.setPCT(pct,true)}else{if(this.config.get("init_value")!=undefined){var rangeMin=this.config.get("range_min");var rangeMax=this.config.get("range_max");var pct=(this.config.get("init_value")-rangeMin)/(rangeMax-rangeMin)*100;
this.setPCT(pct,true)}}},setCB:function(cb){this.cb=cb},onClick:function(e){var xOffset=e.pageX-this.e.cumulativeOffset().left;var gripWidth=this.grip.getWidth();var width=this.e.getWidth();var pos=xOffset-gripWidth/2;
if(pos<0){pos=0}else{if(pos>(width-gripWidth/2)){pos=this.e.getWidth()-gripWidth/2}}this.grip.setStyle({left:pos+"px"});this.moved()},moved:function(){var pos=this.grip.positionedOffset().left;var gripWidth=this.grip.getWidth();
var width=this.e.getWidth();this.percentage=pos*100/(width-gripWidth);var value=this.getValue();if(this.cb.moved){this.cb.moved(this,pos,this.percentage,value)}if(this.input){this.input.value=value}this.sendAsyncUpdate()
},sendAsyncUpdate:function(){if(!this.config.get("update_url")){return}if(this.asyncUpdate){clearTimeout(this.asyncUpdate)}var url=this.config.get("update_url");url=url.replace("@value@",this.getValue());
this.asyncUpdate=setTimeout(function(){new Ajax.Request(url,{method:"get",onSuccess:function(o){eval(o.responseText);this.asyncUpdate=undefined}.bind(this)})},250)},emitMoved:function(){if(this.cb.moved){var value=this.getValue();
var pos=this.grip.positionedOffset().left;this.cb.moved(this,pos,this.percentage,value)}},getValue:function(){var rangeMin=this.config.get("range_min");var rangeMax=this.config.get("range_max");return rangeMin+Math.round(((rangeMax-rangeMin)*this.percentage/100))
},setValue:function(value,init){var rangeMin=this.config.get("range_min");var rangeMax=this.config.get("range_max");var pct=(value-rangeMin)/(rangeMax-rangeMin)*100;this.setPCT(pct,init)},setPCT:function(pct,init){this.percentage=pct;
var eWidth=this.e.getWidth();var gripWidth=this.grip.getWidth();if(eWidth<=0){eWidth=this.config.get("width")}if(gripWidth<=0){gripWidth=5}if(pct<0){pct=0}else{if(pct>100){pct=100}}var pos=Math.round((eWidth-gripWidth)*pct/100);
this.grip.setStyle({left:pos+"px"});var rangeMin=this.config.get("range_min");var rangeMax=this.config.get("range_max");var value=rangeMin+Math.round(((rangeMax-rangeMin)*this.percentage/100));if(this.input){if(this.input.value!=value){this.input.value=value;
if(!init){this.sendAsyncUpdate()}}}else{if(!init){this.sendAsyncUpdate()}}},getPCT:function(){return this.percentage},refresh:function(){this.setPCT(this.percentage)}});SL.ui.Dropdown=Class.create(SL.Component,{init:function(){this.config.setDefault("min_width",50);
this.input=$(this.config.get("input_id"));this.cb=this.config.ensureHash("cb");this.label=this.e.down("."+this.config.get("css")+"_label");this.options=this.e.down("."+this.config.get("css")+"_options");
this.optionsPanel=new SL.ui.Panel(this.options,{attach_id:this.id});this.label.observe("click",this.optionsPanel.toggle.bind(this.optionsPanel));var elements=this.options.childElements();for(var i=0;i<elements.length;
i++){var e=elements[i];e.observe("click",this.onItemClicked.bind(this,i))}this.updateMinWidth()},setCB:function(cb){this.cb=cb},onItemClicked:function(index){var item=this.config.get("data")[index];if(this.input){this.input.value=item.id
}this.label.down().update(item.label);if(this.cb.changed){this.cb.changed(this,item.id,item.label)}if(item.on_select){item.on_select(this,item)}this.optionsPanel.toggle();this.updateMinWidth()},updateMinWidth:function(){if(this.label.getWidth()<=0){return
}var lw=this.label.down().getWidth()+10;if(lw<=10||lw<this.config.get("min_width")){return}if(lw>this.label.getWidth()){this.label.setStyle({width:lw+"px"})}}})})();SL.color={};(function(){SL.color.Color=new function(){this.hsv2rgb=function(h,s,v){var r,g,b;
if(s==0){r=v*255;g=v*255;b=v*255}else{var var_h=h*6;if(var_h==6){var_h=0}var var_i=Math.floor(var_h);var var_1=v*(1-s);var var_2=v*(1-s*(var_h-var_i));var var_3=v*(1-s*(1-(var_h-var_i)));if(var_i==0){var_r=v;
var_g=var_3;var_b=var_1}else{if(var_i==1){var_r=var_2;var_g=v;var_b=var_1}else{if(var_i==2){var_r=var_1;var_g=v;var_b=var_3}else{if(var_i==3){var_r=var_1;var_g=var_2;var_b=v}else{if(var_i==4){var_r=var_3;
var_g=var_1;var_b=v}else{var_r=v;var_g=var_1;var_b=var_2}}}}}r=var_r*255;g=var_g*255;b=var_b*255}return[Math.round(r),Math.round(g),Math.round(b)]};this.rgb2hsv=function(r,g,b){r=(r/255);g=(g/255);b=(b/255);
var min=Math.min(r,g,b);var max=Math.max(r,g,b);deltaMax=max-min;var v=max;var s,h;var deltaRed,deltaGreen,deltaBlue;if(deltaMax==0){h=0;s=0}else{s=deltaMax/max;deltaRed=(((max-r)/6)+(deltaMax/2))/deltaMax;
deltaGreen=(((max-g)/6)+(deltaMax/2))/deltaMax;deltaBlue=(((max-b)/6)+(deltaMax/2))/deltaMax;if(r==max){h=deltaBlue-deltaGreen}else{if(g==max){h=(1/3)+deltaRed-deltaBlue}else{if(b==max){h=(2/3)+deltaGreen-deltaRed
}else{h=0}}}if(h<0){h+=1}if(h>1){h-=1}}return[h,s,v]};this.rgb2hex=function(r,g,b){return this.toHex(r)+this.toHex(g)+this.toHex(b)};this.hexchars="0123456789ABCDEF";this.toHex=function(n){n=n||0;n=parseInt(n,10);
if(isNaN(n)){n=0}n=Math.round(Math.min(Math.max(0,n),255));return this.hexchars.charAt((n-n%16)/16)+this.hexchars.charAt(n%16)};this.toDec=function(hexchar){return this.hexchars.indexOf(hexchar.toUpperCase())
};this.hex2rgb=function(str){var rgb=[];rgb[0]=(this.toDec(str.substr(0,1))*16)+this.toDec(str.substr(1,1));rgb[1]=(this.toDec(str.substr(2,1))*16)+this.toDec(str.substr(3,1));rgb[2]=(this.toDec(str.substr(4,1))*16)+this.toDec(str.substr(5,1));
return rgb};this.isValidRGB=function(a){if((!a[0]&&a[0]!=0)||isNaN(a[0])||a[0]<0||a[0]>255){return false}if((!a[1]&&a[1]!=0)||isNaN(a[1])||a[1]<0||a[1]>255){return false}if((!a[2]&&a[2]!=0)||isNaN(a[2])||a[2]<0||a[2]>255){return false
}return true}},SL.color.Picker=Class.create(SL.Component,{init:function(){this.field=$(this.config.get("input_id"));this.cb=this.config.ensureHash("cb");if(this.config.get("admin")){this.e.setStyle({zIndex:(SL.admin._overlayIndex+1)+""})
}else{this.e.setStyle({zIndex:SL.ui._getNewOverlayIndex()+""})}this.connectDestroy(this.field);this.rgb={};this.hsv={};this.shown=false;SL.utils.reparentToBody(this.e);this.pickerArea=this.e.down(".gui_color_picker_view");
this.selector=this.e.down(".gui_color_picker_selector");this.picker=new SL.dnd.Draggable(this.selector,{orientation:"both",maxY:-21,maxX:-21,cb:{moved:function(picker){var pos=picker.getPos();this.update(pos.left,pos.top,true)
}.bind(this)}});this.thumb=this.e.down(".gui_color_picker_hue_thumb");this.slider=this.e.down(".gui_color_picker_hue_slider");this.thumbDnD=new SL.dnd.Draggable(this.thumb,{orientation:"vertical",minY:-10,maxY:-20,cb:{moved:this.updateHue.bind(this,true)}});
this.field.observe("click",this.toggle.bind(this));new Form.Element.Observer(this.field,0.2,this.updateFromFieldValue.bind(this));this.slider.observe("click",this.onSliderClick.bind(this));this.updateInputColor()
},setCB:function(cb){this.cb=cb},toggle:function(){if(!this.shown){this.show()}},show:function(){this.shown=true;this.e.show();this.updatePosition(true);this.updateFromFieldValue(null,true);this.pickerArea.observe("mousedown",this.updateSelector.bind(this));
this.bodyCB=this.onBodyClicked.bind(this);(function(){$$("body")[0].observe("click",this.bodyCB)}).bind(this).defer()},updatePosition:function(first){if(!this.shown){if(this.updateCB){clearTimeout(this.updateCB)
}return}if(first&&this.updateCB){clearTimeout(this.updateCB)}var offset=this.field.cumulativeOffset();offset.left+=this.field.getWidth()+5;var fixedElement=this.field.getFixedParent();if(fixedElement){var fixedScrollOffset=this.field.cumulativeScrollOffsetFixed();
offset.left-=fixedScrollOffset.left;offset.top-=fixedScrollOffset.top}var parentScrollOffset=this.field.cumulativeScrollOffset();offset.left-=parentScrollOffset.left;offset.right-=parentScrollOffset.right;
var scrollOffsets=document.viewport.getScrollOffsets();if(fixedElement){offset.top+=scrollOffsets.top}this.e.setStyle({left:offset.left+"px",top:offset.top+"px"});this.updateCB=setTimeout(this.updatePosition.bind(this),250)
},hide:function(){this.shown=false;this.e.hide();if(this.bodyCB){$$("body")[0].stopObserving("click",this.bodyCB);this.bodyCB=undefined}},updateHue:function(updateInput){var h=this.getHue();var rgb=SL.color.Color.hsv2rgb(h,1,1);
if(!SL.color.Color.isValidRGB(rgb)){return}this.pickerArea.setStyle({backgroundColor:"rgb("+rgb[0]+","+rgb[1]+","+rgb[2]+")"});this.update(undefined,undefined,updateInput)},updateFromFieldValue:function(event,keepInitial){var value=this.field.value;
if(this.lastValue&&this.lastValue==value){return}if(keepInitial){this.initialValue=value}if(!value){value="ffffff"}else{if(value.startsWith("#")){value=value.substring(1)}}if(value.length!=3&&value.length!=6){this.field.setStyle({backgroundColor:"#ffffff",color:"#000000"});
return}if(value.length==3){value=value.substring(0,1)+value.substring(0,1)+value.substring(1,2)+value.substring(1,2)+value.substring(2,3)+value.substring(2,3)}var rgb=SL.color.Color.hex2rgb(value);if(!SL.color.Color.isValidRGB(rgb)){this.field.setStyle({backgroundColor:"#ffffff",color:"#000000"});
return}var hsv=SL.color.Color.rgb2hsv(rgb[0],rgb[1],rgb[2]);this.selector.setStyle({left:Math.round(hsv[1]*this.pickerArea.offsetWidth)+"px",top:Math.round((1-hsv[2])*this.pickerArea.offsetWidth)+"px"});
this.thumb.setStyle({top:(((hsv[0]==0?0:1-hsv[0])*this.slider.getHeight())-this.thumb.getHeight()/2)+"px"});this.field.setStyle({backgroundColor:"rgb("+rgb[0]+", "+rgb[1]+", "+rgb[2]+")",color:(hsv[2]>0.65)?"#000000":"#FFFFFF"});
if(event){this.sendAsyncUpdate()}this.updateHue(false)},updateSelector:function(event){var xPos=event.pointerX();var yPos=event.pointerY();var pos=this.pickerArea.down().cumulativeOffset();this.selector.setStyle({left:(xPos-pos[0]-2)+"px",top:(yPos-pos[1]-2)+"px"});
var x=(xPos-pos[0]);var y=(yPos-pos[1]);this.picker.onMouseDown(event);this.update(x,y,true)},updateInputColor:function(){var value=this.field.value;if(!value){value="ffffff"}else{if(value.startsWith("#")){value=value.substring(1)
}}if(value.length!=3&&value.length!=6){value="ffffff"}if(value.length==3){value=value.substring(0,1)+value.substring(0,1)+value.substring(1,2)+value.substring(1,2)+value.substring(2,3)+value.substring(2,3)
}var rgb=SL.color.Color.hex2rgb(value);if(!SL.color.Color.isValidRGB(rgb)){return}var hsv=SL.color.Color.rgb2hsv(rgb[0],rgb[1],rgb[2]);this.field.setStyle({backgroundColor:"rgb("+rgb[0]+", "+rgb[1]+", "+rgb[2]+")",color:(hsv[2]>0.65)?"#000000":"#FFFFFF"})
},getHue:function(){var h=1-(this.thumb.positionedOffset().top+this.thumb.getHeight()/2)/this.slider.getHeight();if(h>=1){h=0}else{if(h<0){h=0}}return h},update:function(x,y,updateInput){if(!x){x=this.picker.getPos().left
}if(!y){y=this.picker.getPos().top}var h=this.getHue();this.hsv={hue:h,saturation:x/this.pickerArea.offsetWidth,brightness:(this.pickerArea.offsetHeight-y)/this.pickerArea.offsetHeight};var rgb=SL.color.Color.hsv2rgb(this.hsv.hue,this.hsv.saturation,this.hsv.brightness);
this.rgb={red:rgb[0],green:rgb[1],blue:rgb[2]};if(updateInput){this.lastValue=(this.config.get("with_prefix")?"#":"")+SL.color.Color.rgb2hex(rgb[0],rgb[1],rgb[2]);this.field.value=this.lastValue;if(this.cb.changed){this.cb.changed(this,this.field.value)
}this.sendAsyncUpdate()}this.updateInputColor()},onBodyClicked:function(e){if(this.shown){var offset=this.e.cumulativeOffset();var x=e.pageX;var left=offset.left;var w=this.e.offsetWidth;var y=e.pageY;
var top=offset.top;var h=this.e.offsetHeight;if(x>left&&x<left+w&&y>top&&y<top+h){return}var offset=this.field.cumulativeOffset();var x=e.pageX;var left=offset.left;var w=this.field.offsetWidth;var y=e.pageY;
var top=offset.top;var h=this.field.offsetHeight;if(x>left&&x<left+w&&y>top&&y<top+h){return}this.hide()}},onSliderClick:function(event){var pos=event.pointerY();pos=pos-this.slider.cumulativeOffset().top-10;
this.thumbDnD.updatePos(undefined,pos);event.stop()},sendAsyncUpdate:function(){if(!this.config.get("update_url")){return}if(this.asyncUpdate){clearTimeout(this.asyncUpdate)}var url=this.config.get("update_url");
v=this.field.value;if(v.startsWith("#")){v=v.substring(1)}url=url.replace("@value@",v);this.asyncUpdate=setTimeout(function(){new Ajax.Request(url,{method:"get",onSuccess:function(o){eval(o.responseText);
this.asyncUpdate=undefined}.bind(this)})},250)}})})();(function(){SL.ui.DatePicker=Class.create(SL.ui.Panel,{init:function($super){this.config.setDefault("overlay",true);this.e.up().setStyle({position:"relative"});
this.input=$(this.config.get("input_id"));$super()},setDateString:function(a){this.input.value=a;this.hide()}})})();SL.mobile={};(function(){SL.mobile.Nav=Class.create(SL.Component,{init:function(){this.attachE=$(this.config.get("attach_id"));
if(!this.attachE){this.attachE=this.e.up(this.config.get("attach_class"));if(!this.attachE){this.attachE=this.e.up().up()}}this.activeE=$(this.config.get("active_id"));this.e.select("li.with_children>div.item").each(function(a){a.observe("click",this.showChildren.bind(this,a))
}.bind(this));this.e.select("li.with_children>div.children div.item>div").each(function(a){a.observe("click",this.showParent.bind(this,a))}.bind(this));(function(){var a=this.attachE.cumulativeOffset().top+this.attachE.getHeight();
this.e.setStyle({top:a+"px"})}.bind(this)).defer()},showChildren:function(a){a.up().down("div.children>ul").setStyle({marginLeft:"0"})},showParent:function(a){a.up("ul").setStyle({marginLeft:""})},toggle:function(){if(this.shown){this.hide()
}else{this.show()}},show:function(){if(this.shown){return}var c=this.attachE.cumulativeOffset().top+this.attachE.getHeight();var b=document.viewport.getHeight()-this.attachE.getHeight();var a=0;this.e.select("ul").each(function(f){var d=f.getHeight();
if(d>a){a=d}});this.e.select("ul").each(function(d){d.setStyle({height:a+"px"})});this.e.setStyle({top:c+"px",minHeight:b+"px",height:a+"px"});this.activeE.addClassName("active");this.shown=true},hide:function(){if(!this.shown){return
}this.e.setStyle({height:"0",minHeight:"0"});this.activeE.removeClassName("active");this.shown=false}})})();var CKEDITOR_BASEPATH="/go/gui/_ws/mediabase/_ts_1287064519000/lib/ckeditor-3.3.2/";(function(){if(!window.CKEDITOR){window.CKEDITOR=(function(){var a={timestamp:"A73H4H9",version:"3.3.2",revision:"5805",_:{},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}}if(!d){throw'The CKEditor installation path could not be automatically detected. Please set the global variable "CKEDITOR_BASEPATH" before creating editor instances.'
}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,e){var f=this;f._={instanceConfig:b,element:c,data:e};f.elementMode=d||0;a.event.call(f);f._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,d){var e=b;if(typeof e!="object"){e=document.getElementById(b);if(!e){throw'[CKEDITOR.editor.appendTo] The element with id "'+b+'" was not found.'
}}return new a.editor(c,e,2,d)};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",mobile:b.indexOf("mobile")>-1,isCustomDomain:function(){var g=document.domain,h=window.location.hostname;
return this.ie&&g!=h&&g!="["+h+"]"}};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.mobile&&(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,h){if(b.isCompatible){if(a.loadFullCore){a.loadFullCore()
}var i=g(e,f,h);a.add(i);return i}return null};a.replace=function(e,f){return d(e,f,a.editor.replace)};a.appendTo=function(e,f,g){return d(e,f,a.editor.appendTo,g)};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("(?:^|\\s)"+arguments[0]+"(?:$|\\s)");
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.on("reset",function(){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||f instanceof RegExp){return f}g=new f.constructor();for(var i in f){var j=f[i];
g[i]=this.clone(j)}return g},capitalize:function(f){return f.charAt(0).toUpperCase()+f.substring(1).toLowerCase()},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},isEmpty:function(f){for(var g in f){if(f.hasOwnProperty(g)){return false}}return true},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()})}}})(),buildStyleHtml:function(f){f=[].concat(f);var g,h=[];for(var i=0;i<f.length;i++){g=f[i];
if(/@import|[{}]/.test(g)){h.push("<style>"+g+"</style>")}else{h.push('<link type="text/css" rel=stylesheet href="'+g+'">')}}return h.join("")},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)},htmlEncodeAttr:function(f){return f.replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")},escapeCssSelector:function(f){return f.replace(/[\s#:.,$*^\[\]()~=+>]/g,"\\$&")
},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},removeFunction:function(f){e[f]=null},callFunction:function(f){var g=e[f];return g&&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)},tryThese:function(){var f;for(var g=0,h=arguments.length;g<h;g++){var i=arguments[g];try{f=i();break}catch(j){}}return f},genKey:function(){return Array.prototype.slice.call(arguments).join("-")
}}})();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,style: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={style:1,script:1},y={base:1,link:1,meta:1,title:1},z=f(y,x),A={head:1,body:1},B={html:1},C={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{$nonBodyContent:f(B,A,y),$block:C,$blockLimit:{body:1,div:1,td:1,th:1,caption:1,form:1},$inline:r,$body:f({script:1,style:1},C),$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,param: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},html:A,head:z,style:t,script:t,body:v,base:{},link:{},meta:{},title:t,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:r,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:r,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]}}},removeAllListeners:function(){var k=this;var h=k.getCustomData("_cke_nativeListeners");
for(var i in h){var j=h[i];if(k.$.removeEventListener){k.$.removeEventListener(i,j,false)}else{if(k.$.detachEvent){k.$.detachEvent("on"+i,j)}}delete h[i]}}}})();(function(g){var h={};a.on("reset",function(){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.clearCustomData=function(){this.removeAllListeners();
var i=this.$._cke_expando;i&&delete h[i]};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)}},appendStyleText:function(h){var k=this;if(k.$.createStyleSheet){var i=k.$.createStyleSheet("");i.cssText=h}else{var j=new d.element("style",k);j.append(new d.text(h,k));k.getHead().append(j)
}},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 9:return new g(h);
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_DOCUMENT=9;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;if(l){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=l}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 k=this;var i=k.getLast();while(i&&i.type==3&&!e.rtrim(i.getText())){i=i.getPrevious()}if(!i||!i.is||!i.is("br")){var j=b.opera?k.getDocument().createText(""):k.getDocument().createElement("br");
b.gecko&&j.setAttribute("type","_moz");k.append(j)}},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(){var i=this.$.innerHTML;return c?i.replace(/<\?[^>]*>/g,""):i},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 n=this;
switch(j){case"class":j="className";break;case"tabindex":var k=i.call(n,j);if(k!==0&&n.$.tabIndex===0){k=null}return k;break;case"checked":var l=n.$.attributes.getNamedItem(j),m=l.specified?l.nodeValue:n.$.checked;
return m?"checked":null;case"hspace":return n.$.hspace;case"style":return n.$.style.cssText}return i.call(n,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(i){var j=this.$.firstChild,k=j&&new d.node(j);if(k&&i&&!i(k)){k=k.getNext(i)}return k},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(o.specified&&o.nodeName!="_cke_expando"&&o.nodeValue!=this.getAttribute(o.nodeName)){return false
}}}return true},isVisible:function(){var i=!!this.$.offsetHeight&&this.getComputedStyle("visibility")!="hidden",j,k;if(i&&(b.webkit||b.opera)){j=this.getWindow();if(!j.equals(a.document.getWindow())&&(k=j.$.frameElement)){i=new h(k).isVisible()
}}return i},isEmptyInlineRemoveable:function(){if(!f.$removeEmpty[this.getName()]){return false}var i=this.getChildren();for(var j=0,k=i.count();j<k;j++){var l=i.getItem(j);if(l.type==1&&l.getAttribute("_fck_bookmark")){continue
}if(l.type==1&&!l.isEmptyInlineRemoveable()||l.type==3&&e.trim(l.getText())){return false}}return true},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,j=i.length,k={_cke_expando:1,_moz_dirty:1};
return j>0&&(j>2||!k[i[0].nodeName]||j==2&&!k[i[1].nodeName])},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))
}}},mergeSiblings:(function(){function i(j,k,l){if(k&&k.type==1){var m=[];while(k.getAttribute("_fck_bookmark")||k.isEmptyInlineRemoveable()){m.push(k);k=l?k.getNext():k.getPrevious();if(!k||k.type!=1){return
}}if(j.isIdentical(k)){var n=l?j.getLast():j.getFirst();while(m.length){m.shift().move(j,!l)}k.moveChildren(j,!l);k.remove();if(n&&n.type==1){n.mergeSiblings()}}}}return function(){var j=this;if(!(f.$removeEmpty[j.getName()]||j.is("a"))){return
}i(j,j.getNext(),true);i(j,j.getPrevious())}})(),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){if(e.isArray(i)){for(var j=0;j<i.length;j++){this.removeAttribute(i[j])}}else{for(var k in i){i.hasOwnProperty(k)&&this.removeAttribute(k)
}}},removeStyle:function(i){var j=this;j.setStyle(i,"");if(j.$.style.removeAttribute){j.$.style.removeAttribute(e.cssStyleToDomStyle(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";this.on("dragstart",function(i){i.data.preventDefault()})}:b.webkit?function(){this.$.style.KhtmlUserSelect="none";
this.on("dragstart",function(i){i.data.preventDefault()})}: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],n=m.nodeName.toLowerCase(),o;if(n in j){continue
}if(n=="checked"&&(o=p.getAttribute(n))){i.setAttribute(n,o)}else{if(m.specified||c&&m.nodeValue&&n=="value"){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.getParent()&&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:"config.js",autoUpdateElement:true,baseHref:"",contentsCss:a.basePath+"contents.css",contentsLangDirection:"ui",contentsLanguage:"",language:"",defaultLanguage:"en",enterMode:1,forceEnterMode:false,shiftEnterMode:2,corePlugins:"",docType:'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">',bodyId:"",bodyClass:"",fullPage:false,height:200,plugins:"about,a11yhelp,basicstyles,blockquote,button,clipboard,colorbutton,colordialog,contextmenu,div,elementspath,enterkey,entities,filebrowser,find,flash,font,format,forms,horizontalrule,htmldataprocessor,image,indent,justify,keystrokes,link,list,liststyle,maximize,newpage,pagebreak,pastefromword,pastetext,popup,preview,print,removeformat,resize,save,scayt,smiley,showblocks,showborders,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.getChild(1).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.getChild(1).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,cy:1,da:1,de:1,el:1,"en-au":1,"en-ca":1,"en-gb":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,p){var q=typeof l=="string";if(q){l=[l]}if(!n){n=a}var r=l.length,s=[],t=[],u=function(z){if(m){if(q){m.call(n,z)}else{m.call(n,s,t)}}};if(r===0){u(true);return}var v=function(z,A){(A?s:t).push(z);
if(--r<=0){p&&a.document.getDocumentElement().removeStyle("cursor");u(A)}},w=function(z,A){j[z]=1;var B=k[z];delete k[z];for(var C=0;C<B.length;C++){B[C](z,A)}},x=function(z){if(o!==true&&j[z]){v(z,true);
return}var A=k[z]||(k[z]=[]);A.push(v);if(A.length>1){return}var B=new h("script");B.setAttributes({type:"text/javascript",src:z});if(m){if(c){B.$.onreadystatechange=function(){if(B.$.readyState=="loaded"||B.$.readyState=="complete"){B.$.onreadystatechange=null;
w(z,true)}}}else{B.$.onload=function(){setTimeout(function(){w(z,true)},0)};B.$.onerror=function(){w(z,false)}}}B.appendTo(a.document.getHead())};p&&a.document.getDocumentElement().setStyle("cursor","wait");
for(var y=0;y<r;y++){x(l[y])}},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.'
}a.fire(j+e.capitalize(this.fileName)+"Ready",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&&typeof k.file=="string"?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),o=n.lang||(n.lang={});o[l]=m};(function(){var k={},l=function(m,n){var o=function(){p.removeAllListeners();
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,r){var s=k[p];if(!o.skin){o.skin=s;if(s.init){s.init(o)}}var t=function(D){for(var E=0;E<D.length;E++){D[E]=a.getUrl(m[p]+D[E])
}};function u(D,E){return D.replace(/url\s*\(([\s'"]*)(.*?)([\s"']*)\)/g,function(F,G,H,I){if(/^\/|^\w?:/.test(H)){return F}else{return"url("+E+G+H+I+")"}})}if(!l[p]){var v=s.preload;if(v&&v.length>0){t(v);
a.imageCacher.load(v,function(){l[p]=1;n(o,p,q,r)});return}l[p]=1}q=s[q];var w=!q||!!q._isLoaded;if(w){r&&r()}else{var x=q._pending||(q._pending=[]);x.push(r);if(x.length>1){return}var y=!q.css||!q.css.length,z=!q.js||!q.js.length,A=function(){if(y&&z){q._isLoaded=1;
for(var D=0;D<x.length;D++){if(x[D]){x[D]()}}}};if(!y){var B=q.css;if(e.isArray(B)){t(B);for(var C=0;C<B.length;C++){a.document.appendStyleSheet(B[C])}}else{B=u(B,a.getUrl(m[p]));a.document.appendStyleText(B)
}q.css=B;y=1}if(!z){t(q.js);a.scriptLoader.load(q.js,function(){z=1;A()})}A()}};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(o,r,p,q)}else{m[r]=s;a.scriptLoader.load(a.getUrl(s+"skin.js"),function(){n(o,r,p,q)})}}}})();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}y=a.getUrl(y);var z=n[y]||(n[y]={});if(z.fn){z.fn.call(x,x.config);if(a.getUrl(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.tabIndex=x.config.tabIndex||x.element.getAttribute("tabindex")||0;
x.fireOnce("configLoaded");t(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"
}var A=x.config;A.contentsLangDirection=="ui"&&(A.contentsLangDirection=x.lang.dir);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");u(x)})})},t=function(x){a.skins.load(x,"editor",function(){r(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.startDisabled?"disable":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 r=this;
if(!l){r.updateElement()}if(r.mode){r._.modes[r.mode].unload(r.getThemeSpace("contents"))}r.theme.destroy(r);var m,n=0,o,p,q;if(r.toolbox){m=r.toolbox.toolbars;for(;n<m.length;n++){p=m[n].items;for(o=0;
o<p.length;o++){q=p[o];if(q.clickFn){e.removeFunction(q.clickFn)}if(q.keyDownFn){e.removeFunction(q.keyDownFn)}if(q.index){k.button._.instances[q.index]=null}}}}if(r.contextMenu){e.removeFunction(r.contextMenu._.functionId)
}if(r._.filebrowserFn){e.removeFunction(r._.filebrowserFn)}r.fire("destroy");a.remove(r);a.fire("instanceDestroyed",null,r)},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 n=this;var l=n.element;if(l&&n.elementMode==1){var m=n.getData();if(n.config.htmlEncodeOutput){m=e.htmlEncode(m)
}if(l.is("textarea")){l.setValue(m)}else{l.setHtml(m)}}}});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();if(/="/.test(p)){continue}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,this))){return}if(typeof n!="string"){n.parent=this.parent;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=[],w=t,x=false,y;function z(E){var F;if(u.length>0){for(var G=0;G<u.length;G++){var H=u[G],I=H.name,J=f[I],K=w.name&&f[w.name];
if((!K||K[I])&&(!E||!J||J[E]||!f[E])){if(!F){A();F=1}H=H.clone();H.parent=w;w=H;u.splice(G,1);G--}}}}function A(E){while(v.length-(E||0)>0){w.add(v.shift())}}function B(E,F,G){F=F||w||t;if(q&&!F.type){var H,I;
if(E.attributes&&(I=E.attributes._cke_real_element_type)){H=I}else{H=E.name}if(H&&!(H in f.$body)&&!(H in f.$nonBodyContent)){var J=w;w=F;r.onTagOpen(q,{});F=w;if(G){w=J}}}if(E._.isBlockLike&&E.name!="pre"){var K=E.children.length,L=E.children[K-1],M;
if(L&&L.type==3){if(!(M=e.rtrim(L.value))){E.children.length=K-1}else{L.value=M}}}F.add(E);if(E.returnPoint){w=E.returnPoint;delete E.returnPoint}}r.onTagOpen=function(E,F,G){var H=new a.htmlParser.element(E,F);
if(H.isUnknown&&G){H.isEmpty=true}if(f.$removeEmpty[E]){u.push(H);return}else{if(E=="pre"){x=true}else{if(E=="br"&&x){w.add(new a.htmlParser.text("\n"));return}}}if(E=="br"){v.push(H);return}var I=w.name,J=I&&(f[I]||(w._.isBlockLike?f.div:f.span));
if(J&&!H.isUnknown&&!w.isUnknown&&!J[E]){var K=false,L;if(E in n&&I in n){var M=w.children,N=M[M.length-1];if(!(N&&N.name in o)){B(N=new a.htmlParser.element("li"),w)}y=w,L=N}else{if(E==I){B(w,w.parent)
}else{if(m[I]){if(!y){y=w}}else{B(w,w.parent,true);if(!l[I]){u.unshift(w)}}K=true}}if(L){w=L}else{w=w.returnPoint||w.parent}if(K){r.onTagOpen.apply(this,arguments);return}}z(E);A();H.parent=w;H.returnPoint=y;
y=0;if(H.isEmpty){B(H)}else{w=H}};r.onTagClose=function(E){for(var F=u.length-1;F>=0;F--){if(E==u[F].name){u.splice(F,1);return}}var G=[],H=[],I=w;while(I.type&&I.name!=E){if(!I._.isBlockLike){H.unshift(I)
}G.push(I);I=I.parent}if(I.type){for(F=0;F<G.length;F++){var J=G[F];B(J,J.parent)}w=I;if(w.name=="pre"){x=false}if(I._.isBlockLike){A()}B(I,I.parent);if(I==w){w=w.parent}u=u.concat(H)}if(E=="body"){q=false
}};r.onText=function(E){if(!w._.hasInlineStarted&&!x){E=e.ltrim(E);if(E.length===0){return}}A();z();if(q&&(!w.type||w.name=="body")&&e.trim(E)){this.onTagOpen(q,{})}if(!x){E=E.replace(/[\t\r\n ]{2,}|[\t\r\n]/g," ")
}w.add(new a.htmlParser.text(E))};r.onCDATA=function(E){w.add(new a.htmlParser.cdata(E))};r.onComment=function(E){w.add(new a.htmlParser.comment(E))};r.parse(p);A(!c&&1);while(w.type){var C=w.parent,D=w;
if(q&&(!C.type||C.name=="body")&&!f.$body[D.name]){w=C;r.onTagOpen(q,{});C=w}C.add(D);w=C}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){var r;this.filterChildren=function(){var s=new a.htmlParser.basicWriter();this.writeChildrenHtml.call(this,s,q,true);var t=s.getHtml();this.children=new a.htmlParser.fragment.fromHtml(t).children;
r=1};!this.name&&q&&q.onFragment(this);this.writeChildrenHtml(p,r?null:q)},writeChildrenHtml:function(p,q){for(var r=0;r<this.children.length;r++){this.children[r].writeHtml(p,q)}}}})();a.htmlParser.element=function(l,m){var r=this;
r.name=l;r.attributes=m||(m={});r.children=[];var n=m._cke_real_element_type||l,o=f,p=!!(o.$nonBodyContent[n]||o.$block[n]||o.$listItem[n]||o.$tableContent[n]||o.$nonEditable[n]||n=="br"),q=!!o.$empty[l];
r.isEmpty=q;r.isUnknown=!o[l];r._={isBlockLike:p,hasInlineStarted:q||!p}};(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,p=this,q=p.name,r,s,t,u;p.filterChildren=function(){if(!u){var z=new a.htmlParser.basicWriter();a.htmlParser.fragment.prototype.writeChildrenHtml.call(p,z,n);
p.children=new a.htmlParser.fragment.fromHtml(z.getHtml()).children;u=1}};if(n){for(;;){if(!(q=n.onElementName(q))){return}p.name=q;if(!(p=n.onElement(p))){return}p.parent=this.parent;if(p.name==q){break
}if(p.type!=1){p.writeHtml(m,n);return}q=p.name;if(!q){this.writeChildrenHtml.call(p,m,u?null:n);return}}o=p.attributes}m.openTag(q,o);var v=[];for(var w=0;w<2;w++){for(r in o){s=r;t=o[r];if(w==1){v.push([r,t])
}else{if(n){for(;;){if(!(s=n.onAttributeName(r))){delete o[r];break}else{if(s!=r){delete o[r];r=s;continue}else{break}}}if(s){if((t=n.onAttribute(p,s,t))===false){delete o[s]}else{o[s]=t}}}}}}if(m.sortAttributes){v.sort(l)
}var x=v.length;for(w=0;w<x;w++){var y=v[w];m.attribute(y[0],y[1])}m.openTagClose(q,p.isEmpty);if(!p.isEmpty){this.writeChildrenHtml.call(p,m,u?null:n);m.closeTag(q)}},writeChildrenHtml:function(m,n){a.htmlParser.fragment.prototype.writeChildrenHtml.apply(this,arguments)
}}})();(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;s._.root=o(s._.root,q.root,r)||s._.root},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,r){var s=this._.comment;return s?s.filter(q,r):q},onFragment:function(q){var r=this._.root;return r?r.filter(q):q},onElement:function(q){var v=this;
var r=[v._.elements["^"],v._.elements[q.name],v._.elements.$],s,t;for(var u=0;u<3;u++){s=r[u];if(s){t=s.filter(q,v);if(t===false){return null}if(t&&t!=q){return v.onNode(t)}if(q.parent&&!q.name){break}}}return q
},onNode:function(q){var r=q.type;return r==1?this.onElement(q):r==3?new a.htmlParser.text(this.onText(q.value)):r==8?new a.htmlParser.comment(this.onComment(q.value)):null},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){if(typeof r=="function"){r=[r]
}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];if(x){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=q.type||q instanceof a.htmlParser.fragment;
for(var s=0;s<this.length;s++){if(r){var t=q.type,u=q.name}var v=this[s],w=v.apply(window,arguments);if(w===false){return w}if(r){if(w&&(w.name!=u||w.type!=t)){return w}}else{if(typeof w!="string"){return w
}}w!=undefined&&(q=w)}return q}})();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){if(typeof m=="string"){m=e.htmlEncodeAttr(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=[];this._.indent=false},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.on("instanceDestroyed",function(){if(e.isEmpty(this.instances)){a.fire("reset")
}});a.TRISTATE_ON=1;a.TRISTATE_OFF=2;a.TRISTATE_DISABLED=0;d.comment=e.createClass({base:d.node,$:function(l,m){if(typeof l=="string"){l=(m?m.$:document).createComment(l)}this.base(l)},proto:{type:8,getOuterHtml:function(){return"<!--"+this.$.nodeValue+"-->"
}}});(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,dd: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},contains:function(l){var m=this.elements;for(var n=0;n<m.length;n++){if(m[n].getName() in l){return m[n]}}return null}};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(t,u){if(this._.end){return null}var v,w=this.range,x,y=this.guard,z=this.type,A=t?"getPreviousSourceNode":"getNextSourceNode";if(!this._.start){this._.start=1;w.trim();if(w.collapsed){this.end();
return null}}if(!t&&!this._.guardLTR){var B=w.endContainer,C=B.getChild(w.endOffset);this._.guardLTR=function(G,H){return(!H||!B.equals(G))&&(!C||!G.equals(C))&&(G.type!=1||!H||G.getName()!="body")}}if(t&&!this._.guardRTL){var D=w.startContainer,E=w.startOffset>0&&D.getChild(w.startOffset-1);
this._.guardRTL=function(G,H){return(!H||!D.equals(G))&&(!E||!G.equals(E))&&(G.type!=1||!H||G.getName()!="body")}}var F=t?this._.guardRTL:this._.guardLTR;if(y){x=function(G,H){if(F(G,H)===false){return false
}return y(G,H)}}else{x=F}if(this.current){v=this.current[A](false,z,x)}else{if(t){v=w.endContainer;if(w.endOffset>0){v=v.getChild(w.endOffset-1);if(x(v)===false){v=null}}else{v=x(v,true)===false?null:v.getPreviousSourceNode(true,z,x)
}}else{v=w.startContainer;v=v.getChild(w.startOffset);if(v){if(x(v)===false){v=null}}else{v=x(w.startContainer,true)===false?null:w.startContainer.getNextSourceNode(true,z,x)}}}while(v&&!this._.end){this.current=v;
if(!this.evaluator||this.evaluator(v)!==false){if(!u){return v}}else{if(u&&this.evaluator){return false}}v=v[A](false,z,x)}this.end();return this.current=null}function m(t){var u,v=null;while(u=l.call(this,t)){v=u
}return v}d.walker=e.createClass({$:function(t){this.range=t;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(t){var u=e.extend({},o,t||{});return n[this.getComputedStyle("display")]||u[this.getName()]};d.walker.blockBoundary=function(t){return function(u,v){return !(u.type==1&&u.isBlockBoundary(t))
}};d.walker.listItemBoundary=function(){return this.blockBoundary({br:1})};d.walker.bookmark=function(t,u){function v(w){return w&&w.getName&&w.getName()=="span"&&w.hasAttribute("_fck_bookmark")}return function(w){var x,y;
x=w&&!w.getName&&(y=w.getParent())&&v(y);x=t?x:x||v(w);return u^x}};d.walker.whitespaces=function(t){return function(u){var v=u&&u.type==3&&!e.trim(u.getText());return t^v}};d.walker.invisible=function(t){var u=d.walker.whitespaces();
return function(v){var w=u(v)||v.is&&!v.$.offsetHeight;return t^w}};var p=/^[\t\r\n ]*(?:&nbsp;|\xa0)$/,q=d.walker.whitespaces(true),r=d.walker.bookmark(false,true),s=function(t){return r(t)&&q(t)};h.prototype.getBogus=function(){var t=this.getLast(s);
if(t&&(!c?t.is&&t.is("br"):t.getText&&p.test(t.getText()))){return t}return false}})();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(t){t.collapsed=t.startContainer&&t.endContainer&&t.startContainer.equals(t.endContainer)&&t.startOffset==t.endOffset},m=function(t,u,v){t.optimizeBookmark();var w=t.startContainer,x=t.endContainer,y=t.startOffset,z=t.endOffset,A,B;
if(x.type==3){x=x.split(z)}else{if(x.getChildCount()>0){if(z>=x.getChildCount()){x=x.append(t.document.createText(""));B=true}else{x=x.getChild(z)}}}if(w.type==3){w.split(y);if(w.equals(x)){x=w.getNext()
}}else{if(!y){w=w.getFirst().insertBeforeMe(t.document.createText(""));A=true}else{if(y>=w.getChildCount()){w=w.append(t.document.createText(""));A=true}else{w=w.getChild(y).getPrevious()}}}var C=w.getParents(),D=x.getParents(),E,F,G;
for(E=0;E<C.length;E++){F=C[E];G=D[E];if(!F.equals(G)){break}}var H=v,I,J,K,L;for(var M=E;M<C.length;M++){I=C[M];if(H&&!I.equals(w)){J=H.append(I.clone())}K=I.getNext();while(K){if(K.equals(D[M])||K.equals(x)){break
}L=K.getNext();if(u==2){H.append(K.clone(true))}else{K.remove();if(u==1){H.append(K)}}K=L}if(H){H=J}}H=v;for(var N=E;N<D.length;N++){I=D[N];if(u>0&&!I.equals(x)){J=H.append(I.clone())}if(!C[N]||I.$.parentNode!=C[N].$.parentNode){K=I.getPrevious();
while(K){if(K.equals(C[N])||K.equals(w)){break}L=K.getPrevious();if(u==2){H.$.insertBefore(K.$.cloneNode(true),H.$.firstChild)}else{K.remove();if(u==1){H.$.insertBefore(K.$,H.$.firstChild)}}K=L}}if(H){H=J
}}if(u==2){var O=t.startContainer;if(O.type==3){O.$.data+=O.$.nextSibling.data;O.$.parentNode.removeChild(O.$.nextSibling)}var P=t.endContainer;if(P.type==3&&P.$.nextSibling){P.$.data+=P.$.nextSibling.data;
P.$.parentNode.removeChild(P.$.nextSibling)}}else{if(F&&G&&(w.$.parentNode!=F.$.parentNode||x.$.parentNode!=G.$.parentNode)){var Q=G.getIndex();if(A&&G.$.parentNode==w.$.parentNode){Q--}t.setStart(G.getParent(),Q)
}t.collapse(true)}if(A){w.remove()}if(B&&x.$.parentNode){x.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(t){var u=false,v=d.walker.bookmark(true);return function(w){if(v(w)){return true}if(w.type==3){if(e.trim(w.getText()).length){return false}}else{if(w.type==1){if(!n[w.getName()]){if(!t&&!c&&w.getName()=="br"&&!u){u=true
}else{return false}}}}return true}}function p(t){return t.type!=3&&t.getName() in f.$removeEmpty||!e.trim(t.getText())||t.getParent().hasAttribute("_fck_bookmark")}var q=new d.walker.whitespaces(),r=new d.walker.bookmark();
function s(t){return !q(t)&&!r(t)}d.range.prototype={clone:function(){var u=this;var t=new d.range(u.document);t.startContainer=u.startContainer;t.startOffset=u.startOffset;t.endContainer=u.endContainer;
t.endOffset=u.endOffset;t.collapsed=u.collapsed;return t},collapse:function(t){var u=this;if(t){u.endContainer=u.startContainer;u.endOffset=u.startOffset}else{u.startContainer=u.endContainer;u.startOffset=u.endOffset
}u.collapsed=true},cloneContents:function(){var t=new d.documentFragment(this.document);if(!this.collapsed){m(this,2,t)}return t},deleteContents:function(){if(this.collapsed){return}m(this,0)},extractContents:function(){var t=new d.documentFragment(this.document);
if(!this.collapsed){m(this,1,t)}return t},createBookmark:function(t){var y=this;var u,v,w,x;u=y.document.createElement("span");u.setAttribute("_fck_bookmark",1);u.setStyle("display","none");u.setHtml("&nbsp;");
if(t){w="cke_bm_"+e.getNextNumber();u.setAttribute("id",w+"S")}if(!y.collapsed){v=u.clone();v.setHtml("&nbsp;");if(t){v.setAttribute("id",w+"E")}x=y.clone();x.collapse();x.insertNode(v)}x=y.clone();x.collapse(true);
x.insertNode(u);if(v){y.setStartAfter(u);y.setEndBefore(v)}else{y.moveToPosition(u,4)}return{startNode:t?w+"S":u,endNode:t?w+"E":v,serializable:t}},createBookmark2:function(t){var A=this;var u=A.startContainer,v=A.endContainer,w=A.startOffset,x=A.endOffset,y,z;
if(!u||!v){return{start:0,end:0}}if(t){if(u.type==1){y=u.getChild(w);if(y&&y.type==3&&w>0&&y.getPrevious().type==3){u=y;w=0}}while(u.type==3&&(z=u.getPrevious())&&z.type==3){u=z;w+=z.getLength()}if(!A.isCollapsed){if(v.type==1){y=v.getChild(x);
if(y&&y.type==3&&x>0&&y.getPrevious().type==3){v=y;x=0}}while(v.type==3&&(z=v.getPrevious())&&z.type==3){v=z;x+=z.getLength()}}}return{start:u.getAddress(t),end:A.isCollapsed?null:v.getAddress(t),startOffset:w,endOffset:x,normalized:t,is2:true}
},moveToBookmark:function(t){var B=this;if(t.is2){var u=B.document.getByAddress(t.start,t.normalized),v=t.startOffset,w=t.end&&B.document.getByAddress(t.end,t.normalized),x=t.endOffset;B.setStart(u,v);
if(w){B.setEnd(w,x)}else{B.collapse(true)}}else{var y=t.serializable,z=y?B.document.getById(t.startNode):t.startNode,A=y?B.document.getById(t.endNode):t.endNode;B.setStartBefore(z);z.remove();if(A){B.setEndBefore(A);
A.remove()}else{B.collapse(true)}}},getBoundaryNodes:function(){var y=this;var t=y.startContainer,u=y.endContainer,v=y.startOffset,w=y.endOffset,x;if(t.type==1){x=t.getChildCount();if(x>v){t=t.getChild(v)
}else{if(x<1){t=t.getPreviousSourceNode()}else{t=t.$;while(t.lastChild){t=t.lastChild}t=new d.node(t);t=t.getNextSourceNode()||t}}}if(u.type==1){x=u.getChildCount();if(x>w){u=u.getChild(w).getPreviousSourceNode(true)
}else{if(x<1){u=u.getPreviousSourceNode()}else{u=u.$;while(u.lastChild){u=u.lastChild}u=new d.node(u)}}}if(t.getPosition(u)&2){t=u}return{startNode:t,endNode:u}},getCommonAncestor:function(t,u){var y=this;
var v=y.startContainer,w=y.endContainer,x;if(v.equals(w)){if(t&&v.type==1&&y.startOffset==y.endOffset-1){x=v.getChild(y.startOffset)}else{x=v}}else{x=v.getCommonAncestor(w)}return u&&!x.is?x.getParent():x
},optimize:function(){var v=this;var t=v.startContainer,u=v.startOffset;if(t.type!=1){if(!u){v.setStartBefore(t)}else{if(u>=t.getLength()){v.setStartAfter(t)}}}t=v.endContainer;u=v.endOffset;if(t.type!=1){if(!u){v.setEndBefore(t)
}else{if(u>=t.getLength()){v.setEndAfter(t)}}}},optimizeBookmark:function(){var v=this;var t=v.startContainer,u=v.endContainer;if(t.is&&t.is("span")&&t.hasAttribute("_fck_bookmark")){v.setStartAt(t,3)}if(u&&u.is&&u.is("span")&&u.hasAttribute("_fck_bookmark")){v.setEndAt(u,4)
}},trim:function(t,u){var B=this;var v=B.startContainer,w=B.startOffset,x=B.collapsed;if((!t||x)&&v&&v.type==3){if(!w){w=v.getIndex();v=v.getParent()}else{if(w>=v.getLength()){w=v.getIndex()+1;v=v.getParent()
}else{var y=v.split(w);w=v.getIndex()+1;v=v.getParent();if(B.startContainer.equals(B.endContainer)){B.setEnd(y,B.endOffset-B.startOffset)}else{if(v.equals(B.endContainer)){B.endOffset+=1}}}}B.setStart(v,w);
if(x){B.collapse(true);return}}var z=B.endContainer,A=B.endOffset;if(!(u||x)&&z&&z.type==3){if(!A){A=z.getIndex();z=z.getParent()}else{if(A>=z.getLength()){A=z.getIndex()+1;z=z.getParent()}else{z.split(A);
A=z.getIndex()+1;z=z.getParent()}}B.setEnd(z,A)}},enlarge:function(t){switch(t){case 1:if(this.collapsed){return}var u=this.getCommonAncestor(),v=this.document.getBody(),w,x,y,z,A,B=false,C,D,E=this.startContainer,F=this.startOffset;
if(E.type==3){if(F){E=!e.trim(E.substring(0,F)).length&&E;B=!!E}if(E){if(!(z=E.getPrevious())){y=E.getParent()}}}else{if(F){z=E.getChild(F-1)||E.getLast()}if(!z){y=E}}while(y||z){if(y&&!z){if(!A&&y.equals(u)){A=true
}if(!v.contains(y)){break}if(!B||y.getComputedStyle("display")!="inline"){B=false;if(A){w=y}else{this.setStartBefore(y)}}z=y.getPrevious()}while(z){C=false;if(z.type==3){D=z.getText();if(/[^\s\ufeff]/.test(D)){z=null
}C=/[\s\ufeff]$/.test(D)}else{if(z.$.offsetWidth>0&&!z.getAttribute("_fck_bookmark")){if(B&&f.$removeEmpty[z.getName()]){D=z.getText();if(/[^\s\ufeff]/.test(D)){z=null}else{var G=z.$.all||z.$.getElementsByTagName("*");
for(var H=0,I;I=G[H++];){if(!f.$removeEmpty[I.nodeName.toLowerCase()]){z=null;break}}}if(z){C=!!D.length}}else{z=null}}}if(C){if(B){if(A){w=y}else{if(y){this.setStartBefore(y)}}}else{B=true}}if(z){var J=z.getPrevious();
if(!y&&!J){y=z;z=null;break}z=J}else{y=null}}if(y){y=y.getParent()}}E=this.endContainer;F=this.endOffset;y=z=null;A=B=false;if(E.type==3){E=!e.trim(E.substring(F)).length&&E;B=!(E&&E.getLength());if(E){if(!(z=E.getNext())){y=E.getParent()
}}}else{z=E.getChild(F);if(!z){y=E}}while(y||z){if(y&&!z){if(!A&&y.equals(u)){A=true}if(!v.contains(y)){break}if(!B||y.getComputedStyle("display")!="inline"){B=false;if(A){x=y}else{if(y){this.setEndAfter(y)
}}}z=y.getNext()}while(z){C=false;if(z.type==3){D=z.getText();if(/[^\s\ufeff]/.test(D)){z=null}C=/^[\s\ufeff]/.test(D)}else{if(z.$.offsetWidth>0&&!z.getAttribute("_fck_bookmark")){if(B&&f.$removeEmpty[z.getName()]){D=z.getText();
if(/[^\s\ufeff]/.test(D)){z=null}else{G=z.$.all||z.$.getElementsByTagName("*");for(H=0;I=G[H++];){if(!f.$removeEmpty[I.nodeName.toLowerCase()]){z=null;break}}}if(z){C=!!D.length}}else{z=null}}}if(C){if(B){if(A){x=y
}else{this.setEndAfter(y)}}}if(z){J=z.getNext();if(!y&&!J){y=z;z=null;break}z=J}else{y=null}}if(y){y=y.getParent()}}if(w&&x){u=w.contains(x)?x:w;this.setStartBefore(u);this.setEndAfter(u)}break;case 2:case 3:var K=new d.range(this.document);
v=this.document.getBody();K.setStartAt(v,1);K.setEnd(this.startContainer,this.startOffset);var L=new d.walker(K),M,N,O=d.walker.blockBoundary(t==3?{br:1}:null),P=function(R){var S=O(R);if(!S){M=R}return S
},Q=function(R){var S=P(R);if(!S&&R.is&&R.is("br")){N=R}return S};L.guard=P;y=L.lastBackward();M=M||v;this.setStartAt(M,!M.is("br")&&(!y&&this.checkStartOfBlock()||y&&M.contains(y))?1:4);K=this.clone();
K.collapse();K.setEndAt(v,2);L=new d.walker(K);L.guard=t==3?Q:P;M=null;y=L.lastForward();M=M||v;this.setEndAt(M,!y&&this.checkEndOfBlock()||y&&M.contains(y)?2:3);if(N){this.setEndAfter(N)}}},shrink:function(t,u){if(!this.collapsed){t=t||2;
var v=this.clone(),w=this.startContainer,x=this.endContainer,y=this.startOffset,z=this.endOffset,A=this.collapsed,B=1,C=1;if(w&&w.type==3){if(!y){v.setStartBefore(w)}else{if(y>=w.getLength()){v.setStartAfter(w)
}else{v.setStartBefore(w);B=0}}}if(x&&x.type==3){if(!z){v.setEndBefore(x)}else{if(z>=x.getLength()){v.setEndAfter(x)}else{v.setEndAfter(x);C=0}}}var D=new d.walker(v);D.evaluator=function(H){return H.type==(t==1?1:3)
};var E;D.guard=function(H,I){if(t==1&&H.type==3){return false}if(I&&H.equals(E)){return false}if(!I&&H.type==1){E=H}return true};if(B){var F=D[t==1?"lastForward":"next"]();F&&this.setStartAt(F,u?1:3)}if(C){D.reset();
var G=D[t==1?"lastBackward":"previous"]();G&&this.setEndAt(G,u?2:4)}return !!(B||C)}},insertNode:function(t){var x=this;x.optimizeBookmark();x.trim(false,true);var u=x.startContainer,v=x.startOffset,w=u.getChild(v);
if(w){t.insertBefore(w)}else{u.append(t)}if(t.getParent().equals(x.endContainer)){x.endOffset++}x.setStartBefore(t)},moveToPosition:function(t,u){this.setStartAt(t,u);this.collapse(true)},selectNodeContents:function(t){this.setStart(t,0);
this.setEnd(t,t.type==3?t.getLength():t.getChildCount())},setStart:function(t,u){var v=this;if(t.type==1&&f.$empty[t.getName()]){t=t.getParent(),u=t.getIndex()}v.startContainer=t;v.startOffset=u;if(!v.endContainer){v.endContainer=t;
v.endOffset=u}l(v)},setEnd:function(t,u){var v=this;if(t.type==1&&f.$empty[t.getName()]){t=t.getParent(),u=t.getIndex()+1}v.endContainer=t;v.endOffset=u;if(!v.startContainer){v.startContainer=t;v.startOffset=u
}l(v)},setStartAfter:function(t){this.setStart(t.getParent(),t.getIndex()+1)},setStartBefore:function(t){this.setStart(t.getParent(),t.getIndex())},setEndAfter:function(t){this.setEnd(t.getParent(),t.getIndex()+1)
},setEndBefore:function(t){this.setEnd(t.getParent(),t.getIndex())},setStartAt:function(t,u){var v=this;switch(u){case 1:v.setStart(t,0);break;case 2:if(t.type==3){v.setStart(t,t.getLength())}else{v.setStart(t,t.getChildCount())
}break;case 3:v.setStartBefore(t);break;case 4:v.setStartAfter(t)}l(v)},setEndAt:function(t,u){var v=this;switch(u){case 1:v.setEnd(t,0);break;case 2:if(t.type==3){v.setEnd(t,t.getLength())}else{v.setEnd(t,t.getChildCount())
}break;case 3:v.setEndBefore(t);break;case 4:v.setEndAfter(t)}l(v)},fixBlock:function(t,u){var x=this;var v=x.createBookmark(),w=x.document.createElement(u);x.collapse(t);x.enlarge(2);x.extractContents().appendTo(w);
w.trim();if(!c){w.appendBogus()}x.insertNode(w);x.moveToBookmark(v);return w},splitBlock:function(t){var D=this;var u=new d.elementPath(D.startContainer),v=new d.elementPath(D.endContainer),w=u.blockLimit,x=v.blockLimit,y=u.block,z=v.block,A=null;
if(!w.equals(x)){return null}if(t!="br"){if(!y){y=D.fixBlock(true,t);z=new d.elementPath(D.endContainer).block}if(!z){z=D.fixBlock(false,t)}}var B=y&&D.checkStartOfBlock(),C=z&&D.checkEndOfBlock();D.deleteContents();
if(y&&y.equals(z)){if(C){A=new d.elementPath(D.startContainer);D.moveToPosition(z,4);z=null}else{if(B){A=new d.elementPath(D.startContainer);D.moveToPosition(y,3);y=null}else{z=D.splitElement(y);if(!c&&!y.is("ul","ol")){y.appendBogus()
}}}}return{previousBlock:y,nextBlock:z,wasStartOfBlock:B,wasEndOfBlock:C,elementPath:A}},splitElement:function(t){var w=this;if(!w.collapsed){return null}w.setEndAt(t,2);var u=w.extractContents(),v=t.clone(false);
u.appendTo(v);v.insertAfter(t);w.moveToPosition(t,4);return v},checkBoundaryOfElement:function(t,u){var v=this.clone();v[u==1?"setStartAt":"setEndAt"](t,u==1?1:2);var w=new d.walker(v);w.evaluator=p;return w[u==1?"checkBackward":"checkForward"]()
},checkStartOfBlock:function(){var z=this;var t=z.startContainer,u=z.startOffset;if(u&&t.type==3){var v=e.ltrim(t.substring(0,u));if(v.length){return false}}z.trim();var w=new d.elementPath(z.startContainer),x=z.clone();
x.collapse(true);x.setStartAt(w.block||w.blockLimit,1);var y=new d.walker(x);y.evaluator=o(true);return y.checkBackward()},checkEndOfBlock:function(){var z=this;var t=z.endContainer,u=z.endOffset;if(t.type==3){var v=e.rtrim(t.substring(u));
if(v.length){return false}}z.trim();var w=new d.elementPath(z.endContainer),x=z.clone();x.collapse(false);x.setEndAt(w.block||w.blockLimit,2);var y=new d.walker(x);y.evaluator=o(false);return y.checkForward()
},moveToElementEditablePosition:function(t,u){var v;if(f.$empty[t.getName()]){return false}while(t&&t.type==1){v=t.isEditable();if(v){this.moveToPosition(t,u?2:1)}else{if(f.$inline[t.getName()]){this.moveToPosition(t,u?4:3);
return true}}if(f.$empty[t.getName()]){t=t[u?"getPrevious":"getNext"](s)}else{t=t[u?"getLast":"getFirst"](s)}if(t&&t.type==3){this.moveToPosition(t,u?4:3);return true}}return v},moveToElementEditStart:function(t){return this.moveToElementEditablePosition(t)
},moveToElementEditEnd:function(t){return this.moveToElementEditablePosition(t,true)},getEnclosedNode:function(){var t=this.clone();t.optimize();if(t.startContainer.type!=1||t.endContainer.type!=1){return null
}var u=new d.walker(t),v=d.walker.bookmark(true),w=d.walker.whitespaces(true),x=function(z){return w(z)&&v(z)};t.evaluator=x;var y=u.next();u.reset();return y&&y.equals(u.previous())?y:null},getTouchedStartNode:function(){var t=this.startContainer;
if(this.collapsed||t.type!=1){return t}return t.getChild(this.startOffset)||t},getTouchedEndNode:function(){var t=this.endContainer;if(this.collapsed||t.type!=1){return t}return t.getChild(this.endOffset-1)||t
}}})();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;a.SHRINK_ELEMENT=1;a.SHRINK_TEXT=2;(function(){if(b.webkit){b.hc=false;return}var l=c&&b.version<7,m=c&&b.version==7,n=l?a.basePath+"images/spacer.gif":m?"about:blank":"data:image/png;base64,",o=h.createFromHtml('<div style="width:0px;height:0px;position:absolute;left:-10000px;background-image:url('+n+')"></div>',a.document);
o.appendTo(a.document.getHead());try{b.hc=o.getComputedStyle("background-image")=="none"}catch(p){b.hc=false}if(b.hc){b.cssClass+=" cke_hc"}o.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])}}});a.skins.add("kama",(function(){var l=[],m="cke_ui_color";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(n){if(n.config.width&&!isNaN(n.config.width)){n.config.width-=12
}var o=[],p=/\$color/g,q="/* 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){q=q.split("}").slice(0,-1);for(var r=0;r<q.length;r++){q[r]=q[r].split("{")}}function s(v){var w=v.getById(m);if(!w){w=v.getHead().append("style");w.setAttribute("id",m);w.setAttribute("type","text/css")
}return w}function t(v,w,x){var y,z,A;for(var B=0;B<v.length;B++){if(b.webkit){for(z=0;z<w.length;z++){A=w[z][1];for(y=0;y<x.length;y++){A=A.replace(x[y][0],x[y][1])}v[B].$.sheet.addRule(w[z][0],A)}}else{A=w;
for(y=0;y<x.length;y++){A=A.replace(x[y][0],x[y][1])}if(c){v[B].$.styleSheet.cssText+=A}else{v[B].$.innerHTML+=A}}}}var u=/\$color/g;e.extend(n,{uiColor:null,getUiColor:function(){return this.uiColor},setUiColor:function(v){var w,x=s(a.document),y=".cke_editor_"+e.escapeCssSelector(n.name),z=[y+" .cke_wrapper",y+"_dialog .cke_dialog_contents",y+"_dialog a.cke_dialog_tab",y+"_dialog .cke_dialog_footer"].join(","),A="background-color: $color !important;";
if(b.webkit){w=[[z,A]]}else{w=z+"{"+A+"}"}return(this.setUiColor=function(B){var C=[[u,B]];n.uiColor=B;t([x],w,C);t(o,q,C)})(v)}});n.on("menuShow",function(v){var w=v.data[0],x=w.element.getElementsByTag("iframe").getItem(0).getFrameDocument();
if(!x.getById("cke_ui_color")){var y=s(x);o.push(y);var z=n.getUiColor();if(z){t([y],q,[[u,z]])}}});if(n.config.uiColor){n.setUiColor(n.config.uiColor)}}}})());(function(){a.dialog?l():a.on("dialogPluginReady",l);
function l(){a.dialog.on("resize",function(m){var n=m.data,o=n.width,p=n.height,q=n.dialog,r=q.parts.contents;if(n.skin!="kama"){return}r.setStyles({width:o+"px",height:p+"px"});setTimeout(function(){var s=q.parts.dialog.getChild([0,0,0]),t=s.getChild(0),u=s.getChild(2);
u.setStyle("width",t.$.offsetWidth+"px");u=s.getChild(7);u.setStyle("width",t.$.offsetWidth-28+"px");u=s.getChild(4);u.setStyle("height",t.$.offsetHeight-31-14+"px");u=s.getChild(5);u.setStyle("height",t.$.offsetHeight-31-14+"px")
},100)})}})();j.add("about",{requires:["dialog"],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")}});(function(){var l="a11yhelp",m="a11yHelp";j.add(l,{availableLangs:{en:1,he:1},init:function(n){var o=this;n.addCommand(m,{exec:function(){var p=n.langCode;
p=o.availableLangs[p]?p:"en";a.scriptLoader.load(a.getUrl(o.path+"lang/"+p+".js"),function(){e.extend(n.lang,o.lang[p]);n.openDialog(m)})},modes:{wysiwyg:1,source:1},canUndo:false});a.dialog.add(m,this.path+"dialogs/a11yhelp.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("\ufeff",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(),p="",q=this.command,r,s;
this._.editor=l;var t={id:o,button:this,editor:l,focus:function(){var v=a.document.getById(o);v.focus()},execute:function(){this.button.click(l)}};t.clickFn=r=e.addFunction(t.execute,t);t.index=s=k.button._.instances.push(t)-1;
if(this.modes){l.on("mode",function(){this.setState(this.modes[l.mode]?2:0)},this)}else{if(q){q=l.getCommand(q);if(q){q.on("state",function(){this.setState(q.state)},this);p+="cke_"+(q.state==1?"on":q.state==0?"disabled":"off")
}}}if(!q){p+="cke_off"}if(this.className){p+=" "+this.className}m.push('<span class="cke_button">','<a id="',o,'" class="',p,'"',n.gecko&&n.version>=10900&&!n.hc?"":'" href="javascript:void(\''+(this.title||"").replace("'","")+"')\"",' title="',this.title,'" tabindex="-1" hidefocus="true" role="button" aria-labelledby="'+o+'_label"'+(this.hasArrow?' aria-haspopup="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(',s,', event);" onfocus="return CKEDITOR.ui.button._.focus(',s,', event);" onclick="CKEDITOR.tools.callFunction(',r,', 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('>&nbsp;</span><span id="',o,'_label" class="cke_label">',this.label,"</span>");
if(this.hasArrow){m.push('<span class="cke_buttonarrow">'+(b.hc?"&#9660;":"&nbsp;")+"</span>")}m.push("</a>","</span>");if(this.onRender){this.onRender()}return t},setState:function(l){if(this._.state==l){return false
}this._.state=l;var m=a.document.getById(this._.id);if(m){m.setState(l);l==0?m.setAttribute("aria-disabled",true):m.removeAttribute("aria-disabled");l==1?m.setAttribute("aria-pressed",true):m.removeAttribute("aria-pressed");
return true}else{return false}}};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)};a.on("reset",function(){k.button._.instances=[]
});(function(){var l=function(s,t){var u=s.document,v=u.getBody(),w=false,x=function(){w=true};v.on(t,x);(b.version>7?u.$:u.$.selection.createRange()).execCommand(t);v.removeListener(t,x);return w},m=c?function(s,t){return l(s,t)
}:function(s,t){try{return s.document.$.execCommand(t)}catch(u){return false}},n=function(s){this.type=s;this.canUndo=this.type=="cut"};n.prototype={exec:function(s,t){this.type=="cut"&&r(s);var u=m(s,this.type);
if(!u){alert(s.lang.clipboard[this.type+"Error"])}return u}};var o={canUndo:false,exec:c?function(s){s.focus();if(!s.document.getBody().fire("beforepaste")&&!l(s,"paste")){s.fire("pasteDialog");return false
}}:function(s){try{if(!s.document.getBody().fire("beforepaste")&&!s.document.$.execCommand("Paste",false,null)){throw 0}}catch(t){setTimeout(function(){s.fire("pasteDialog")},0);return false}}},p=function(s){if(this.mode!="wysiwyg"){return
}switch(s.data.keyCode){case 1000+86:case 2000+45:var t=this.document.getBody();if(!c&&t.fire("beforepaste")){s.cancel()}else{if(b.opera||b.gecko&&b.version<10900){t.fire("paste")}}return;case 1000+88:case 2000+46:var u=this;
this.fire("saveSnapshot");setTimeout(function(){u.fire("saveSnapshot")},0)}};function q(s,t,u){var v=this.document;if(c&&v.getById("cke_pastebin")){return}if(t=="text"&&s.data&&s.data.$.clipboardData){var w=s.data.$.clipboardData.getData("text/plain");
if(w){s.data.preventDefault();u(w);return}}var x=this.getSelection(),y=new d.range(v),z=new h(t=="text"?"textarea":b.webkit?"body":"div",v);z.setAttribute("id","cke_pastebin");b.webkit&&z.append(v.createText("\xa0"));
v.getBody().append(z);z.setStyles({position:"absolute",top:x.getStartElement().getDocumentPosition().y+"px",width:"1px",height:"1px",overflow:"hidden"});z.setStyle(this.config.contentsLangDirection=="ltr"?"left":"right","-1000px");
var A=x.createBookmarks();if(t=="text"){if(c){var B=v.getBody().$.createTextRange();B.moveToElementText(z.$);B.execCommand("Paste");s.data.preventDefault()}else{v.$.designMode="off";z.$.focus()}}else{y.setStartAt(z,1);
y.setEndAt(z,2);y.select(true)}window.setTimeout(function(){t=="text"&&!c&&(v.$.designMode="on");z.remove();var C;z=b.webkit&&(C=z.getFirst())&&C.is&&C.hasClass("Apple-style-span")?C:z;x.selectBookmarks(A);
u(z["get"+(t=="text"?"Value":"Html")]())},0)}function r(s){if(!c||s.document.$.compatMode=="BackCompat"){return}var t=s.getSelection(),u;if(t.getType()==3&&(u=t.getSelectedElement())){var v=t.getRanges()[0],w=s.document.createText("");
w.insertBefore(u);v.setStartBefore(w);v.setEndAfter(u);t.selectRanges([v]);setTimeout(function(){if(u.getParent()){w.remove();t.selectElement(u)}},0)}}j.add("clipboard",{requires:["dialog","htmldataprocessor"],init:function(s){s.on("paste",function(x){var y=x.data;
if(y.html){s.insertHtml(y.html)}else{if(y.text){s.insertText(y.text)}}},null,null,1000);s.on("pasteDialog",function(x){setTimeout(function(){s.openDialog("paste")},0)});function t(x,y,z,A){var B=s.lang[y];
s.addCommand(y,z);s.ui.addButton(x,{label:B,command:y});if(s.addMenuItems){s.addMenuItem(y,{label:B,command:y,group:"clipboard",order:A})}}t("Cut","cut",new n("cut"),1);t("Copy","copy",new n("copy"),4);
t("Paste","paste",o,8);a.dialog.add("paste",a.getUrl(this.path+"dialogs/paste.js"));s.on("key",p,s);var u=s.config.forcePasteAsPlainText?"text":"html";s.on("contentDom",function(){var x=s.document.getBody();
x.on(u=="text"&&c||b.webkit?"paste":"beforepaste",function(y){if(v){return}q.call(s,y,u,function(z){if(!z){return}var A={};A[u]=z;s.fire("paste",A)})});x.on("beforecut",function(){!v&&r(s)})});if(s.contextMenu){var v;
function w(x){c&&(v=1);var y=s.document.$.queryCommandEnabled(x)?2:0;v=0;return y}s.contextMenu.addListener(function(){return{cut:w("Cut"),copy:w("Cut"),paste:b.webkit?2:w("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:l.skin.editor.css,attributes:{role:"listbox","aria-label":n.panelTitle}},onBlock:function(u,v){v.autoSize=true;
v.element.addClass("cke_colorblock");v.element.setHtml(q(u,s));v.element.getDocument().getBody().setStyle("overflow","hidden");var w=v.keys,x=l.lang.dir=="rtl";w[x?37:39]="next";w[40]="next";w[9]="next";
w[x?39:37]="prev";w[38]="prev";w[2000+9]="prev";w[32]="click"}})}function q(r,s){var t=[],u=m.colorButton_colors.split(","),v=u.length+(m.colorButton_enableMore?2:1),w=e.addFunction(function(C,D){if(C=="?"){var E=arguments.callee;
function F(H){this.removeListener("ok",F);this.removeListener("cancel",F);H.name=="ok"&&E(this.getContentElement("picker","selectedColor").getValue(),D)}l.openDialog("colordialog",function(){this.on("ok",F);
this.on("cancel",F)});return}l.focus();r.hide();l.fire("saveSnapshot");new a.style(m["colorButton_"+D+"Style"],{color:"inherit"}).remove(l.document);if(C){var G=m["colorButton_"+D+"Style"];G.childRule=D=="back"?function(){return false
}:function(H){return H.getName()!="a"};new a.style(G,{color:C}).apply(l.document)}l.fire("saveSnapshot")});t.push('<a class="cke_colorauto" _cke_focus=1 hidefocus=true title="',n.auto,'" onclick="CKEDITOR.tools.callFunction(',w,",null,'",s,"');return false;\" href=\"javascript:void('",n.auto,'\')" role="option" aria-posinset="1" aria-setsize="',v,'"><table role="presentation" 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 role="presentation" cellspacing=0 cellpadding=0 width="100%">');
for(var x=0;x<u.length;x++){if(x%8===0){t.push("</tr><tr>")}var y=u[x].split("/"),z=y[0],A=y[1]||z;if(!y[1]){z="#"+z.replace(/^(.)(.)(.)$/,"$1$1$2$2$3$3")}var B=l.lang.colors[A]||A;t.push('<td><a class="cke_colorbox" _cke_focus=1 hidefocus=true title="',B,'" onclick="CKEDITOR.tools.callFunction(',w,",'",z,"','",s,"'); return false;\" href=\"javascript:void('",B,'\')" role="option" aria-posinset="',x+2,'" aria-setsize="',v,'"><span class="cke_colorbox" style="background-color:#',A,'"></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(',w,",'?','",s,"');return false;\" href=\"javascript:void('",n.more,"')\"",' role="option" aria-posinset="',v,'" aria-setsize="',v,'">',n.more,"</a></td>")
}t.push("</tr></table>");return t.join("")}}});i.colorButton_enableMore=true;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);this.definition={panel:{className:l.skinClass+" cke_contextmenu",attributes:{"aria-label":l.lang.contextmenu.options}}}
},_:{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,this.definition);p.onClick=e.bind(function(z){p.hide();if(z.onClick){z.onClick()
}else{if(z.command){q.execCommand(z.command)}}},this);p.onEscape=function(z){var A=this.parent;if(A){A._.panel.hideChild();var B=A._.panel._.panel._.currentBlock,C=B._.focusIndex;B._.markItem(C)}else{if(z==27){this.hide();
q.focus()}}return false}}var r=this._.listeners,s=[],t=this.editor.getSelection(),u=t&&t.getStartElement();p.onHide=e.bind(function(){p.onHide=null;if(c){var z=q.getSelection();z&&z.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.items.length&&p.show(l,m||(q.lang.dir=="rtl"?2:1),n,o)}},proto:{addTarget:function(l,m){if(b.opera){var n;
l.on("mousedown",function(r){r=r.data;if(r.$.button!=2){if(r.getKeystroke()==1000+1){l.fire("contextmenu",r)}return}if(m&&(b.mac?r.$.metaKey:r.$.ctrlKey)){return}var s=r.getTarget();if(!n){var t=s.getDocument();
n=t.createElement("input");n.$.type="button";t.getBody().append(n)}n.setAttribute("style","position:absolute;top:"+(r.$.clientY-2)+"px;left:"+(r.$.clientX-2)+"px;width:5px;height:5px;opacity:0.01")});l.on("mouseup",function(r){if(n){n.remove();
n=undefined;l.fire("contextmenu",r.data)}})}l.on("contextmenu",function(r){var s=r.data;if(m&&(b.webkit?o:b.mac?s.$.metaKey:s.$.ctrlKey)){return}s.preventDefault();var t=s.getTarget().getDocument().getDocumentElement(),u=s.$.clientX,v=s.$.clientY;
e.setTimeout(function(){this.show(t,null,u,v)},0,this)},this);if(b.webkit){var o,p=function(r){o=b.mac?r.data.$.metaKey:r.data.$.ctrlKey},q=function(){o=0};l.on("keydown",p);l.on("keyup",q);l.on("contextmenu",q)
}},addListener:function(l){this._.listeners.push(l)},show:function(l,m,n,o){this.editor.focus();if(c){var p=this.editor.getSelection();p&&p.lock()}this._.onMenu(l||a.document.getDocumentElement(),m,n||0,o||0)
}}});(function(){j.add("div",{requires:["editingblock","domiterator","styles"],init:function(l){var m=l.lang.div;l.addCommand("creatediv",new a.dialogCommand("creatediv"));l.addCommand("editdiv",new a.dialogCommand("editdiv"));
l.addCommand("removediv",{exec:function(n){var o=n.getSelection(),p=o&&o.getRanges(),q,r=o.createBookmarks(),s,t=[];function u(w){var x=new d.elementPath(w),y=x.blockLimit,z=y.is("div")&&y;if(z&&!z.getAttribute("_cke_div_added")){t.push(z);
z.setAttribute("_cke_div_added")}}for(var v=0;v<p.length;v++){q=p[v];if(q.collapsed){u(o.getStartElement())}else{s=new d.walker(q);s.evaluator=u;s.lastForward()}}for(v=0;v<t.length;v++){t[v].remove(true)
}o.selectBookmarks(r)}});l.ui.addButton("CreateDiv",{label:m.toolbar,command:"creatediv"});if(l.addMenuItems){l.addMenuItems({editdiv:{label:m.edit,command:"editdiv",group:"div",order:1},removediv:{label:m.remove,command:"removediv",group:"div",order:5}});
if(l.contextMenu){l.contextMenu.addListener(function(n,o){if(!n){return null}var p=new d.elementPath(n),q=p.blockLimit;if(q&&q.getAscendant("div",true)){return{editdiv:2,removediv:2}}return null})}}a.dialog.add("creatediv",this.path+"dialogs/div.js");
a.dialog.add("editdiv",this.path+"dialogs/div.js")}})})();(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,filters:[]};
n.on("themeSpace",function(s){if(s.data.space=="bottom"){s.data.html+='<span id="'+o+'_label" class="cke_voice_label">'+n.lang.elementsPath.eleLabel+'</span><div id="'+o+'" class="cke_path" role="group" aria-labelledby="'+o+'_label">'+m+"</div>"
}});n.on("selectionChange",function(s){var t=b,u=s.data.selection,v=u.getStartElement(),w=[],x=s.editor,y=x._.elementsPath.list=[],z=x._.elementsPath.filters;while(v){var A=0;for(var B=0;B<z.length;B++){if(z[B](v)===false){A=1;
break}}if(!A){var C=y.push(v)-1,D;if(v.getAttribute("_cke_real_element_type")){D=v.getAttribute("_cke_real_element_type")}else{D=v.getName()}var E="";if(t.opera||t.gecko&&t.mac){E+=' onkeypress="return false;"'
}if(t.gecko){E+=' onblur="this.style.cssText = this.style.cssText;"'}var F=x.lang.elementsPath.eleTitle.replace(/%1/,D);w.unshift('<a id="',r,C,'" href="javascript:void(\'',D,'\')" tabindex="-1" title="',F,'"'+(b.gecko&&b.version<10900?' onfocus="event.preventBubble();"':"")+' hidefocus="true"  onkeydown="return CKEDITOR._.elementsPath.keydown(\'',x.name,"',",C,', event);"'+E," onclick=\"return CKEDITOR._.elementsPath.click('",x.name,"',",C,');"',' role="button" aria-labelledby="'+r+C+'_label">',D,'<span id="',r,C,'_label" class="cke_label">'+F+"</span>","</a>")
}if(D=="body"){break}v=v.getParent()}q().setHtml(w.join("")+m)});n.on("contentDomUnload",function(){p&&p.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);
var s=p.lang.dir=="rtl";switch(n.getKeystroke()){case s?39:37:case 9:r=a.document.getById(q+(m+1));if(!r){r=a.document.getById(q+"0")}r.focus();return false;case s?37: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]=q;t[2000+13]=p}});j.enterkey={enterBlock:function(s,t,u,v){u=u||r(s);var w=u.document;if(u.checkStartOfBlock()&&u.checkEndOfBlock()){var x=new d.elementPath(u.startContainer),y=x.block;if(y&&(y.is("li")||y.getParent().is("li"))){s.execCommand("outdent");
return}}var z=t==3?"div":"p",A=u.splitBlock(z);if(!A){return}var B=A.previousBlock,C=A.nextBlock,D=A.wasStartOfBlock,E=A.wasEndOfBlock,F;if(C){F=C.getParent();if(F.is("li")){C.breakParent(F);C.move(C.getNext(),true)
}}else{if(B&&(F=B.getParent())&&F.is("li")){B.breakParent(F);u.moveToElementEditStart(B.getNext());B.move(B.getPrevious())}}if(!D&&!E){if(C.is("li")&&(F=C.getFirst(d.walker.invisible(true)))&&F.is&&F.is("ul","ol")){(c?w.createText("\xa0"):w.createElement("br")).insertBefore(F)
}if(C){u.moveToElementEditStart(C)}}else{var G;if(B){if(B.is("li")||!o.test(B.getName())){G=B.clone()}}else{if(C){G=C.clone()}}if(!G){G=w.createElement(z)}else{if(v&&!G.is("li")){G.renameNode(z)}}var H=A.elementPath;
if(H){for(var I=0,J=H.elements.length;I<J;I++){var K=H.elements[I];if(K.equals(H.block)||K.equals(H.blockLimit)){break}if(f.$removeEmpty[K.getName()]){K=K.clone();G.moveChildren(K);G.append(K)}}}if(!c){G.appendBogus()
}u.insertNode(G);if(c&&D&&(!E||!B.getChildCount())){u.moveToElementEditStart(E?B:G);u.select()}u.moveToElementEditStart(D&&!E?C:G)}if(!c){if(C){var L=w.createElement("span");L.setHtml("&nbsp;");u.insertNode(L);
L.scrollIntoView();u.deleteContents()}else{G.scrollIntoView()}}u.select()},enterBr:function(s,t,u,v){u=u||r(s);var w=u.document,x=t==3?"div":"p",y=u.checkEndOfBlock(),z=new d.elementPath(s.getSelection().getStartElement()),A=z.block,B=A&&z.block.getName(),C=false;
if(!v&&B=="li"){n(s,t,u,v);return}if(!v&&y&&o.test(B)){w.createElement("br").insertAfter(A);if(b.gecko){w.createText("").insertAfter(A)}u.setStartAt(A.getNext(),c?3:1)}else{var D;C=B=="pre";if(C&&!b.gecko){D=w.createText(c?"\r":"\n")
}else{D=w.createElement("br")}u.deleteContents();u.insertNode(D);if(!c){w.createText("\ufeff").insertAfter(D)}if(y&&!c){D.getParent().appendBogus()}if(!c){D.getNext().$.nodeValue=""}if(c){u.setStartAt(D,4)
}else{u.setStartAt(D.getNext(),1)}if(!c){var E=null;if(!b.gecko){E=w.createElement("span");E.setHtml("&nbsp;")}else{E=w.createElement("br")}E.insertBefore(D.getNext());E.scrollIntoView();E.remove()}}u.collapse(true);
u.select(C)}};var l=j.enterkey,m=l.enterBr,n=l.enterBlock,o=/^h[1-6]$/;function p(s){if(s.mode!="wysiwyg"){return false}if(s.getSelection().getStartElement().hasAscendant("pre",true)){setTimeout(function(){n(s,s.config.enterMode,null,true)
},0);return true}else{return q(s,s.config.shiftEnterMode,true)}}function q(s,t,u){u=s.config.forceEnterMode||u;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)){m(s,t,null,u)}else{n(s,t,null,u)}},0);return true}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){var D=y.onClick;y.onClick=function(E){var F=E.sender;if(D&&D.call(F,E)===false){return false}return o.call(F,E)};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}var z=u.getContents(v).get(w).filebrowser;return z&&z.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(typeof v=="function"&&v.call(z._.filebrowserSe)===false){return}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(u){var v=u.data.definition,w;for(var x in v.contents){w=v.contents[x];q(u.editor,u.data.name,v,w.elements);
if(w.hidden&&w.filebrowser){w.hidden=!s(v,w.id,w.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"}})}q.on("doubleclick",function(r){var s=r.data.element;if(s.is("img")&&s.getAttribute("_cke_real_element_type")=="flash"){r.data.dialog="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=="cke: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=u[x];if(y){y=y.split("/");var z={},A=u[x]=y[0];z[o]=v[x]=y[1]||A;w[A]=new a.style(s,z);w[A]._.definition.name=A
}else{u.splice(x--,1)}}m.ui.addRichCombo(n,{label:p.label,title:p.panelTitle,className:"cke_"+(o=="size"?"fontSize":"font"),panel:{css:m.skin.editor.css.concat(t.contentsCss),multiSelect:false,attributes:{"aria-label":p.panelTitle}},init:function(){this.startGroup(p.panelTitle);
for(var B=0;B<u.length;B++){var C=u[B];this.add(C,w[C].buildPreview(),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]);p[r]._.enterMode=l.config.enterMode}l.ui.addRichCombo("Format",{label:n.label,title:n.panelTitle,className:"cke_format",panel:{css:l.skin.editor.css.concat(m.contentsCss),multiSelect:false,attributes:{"aria-label":n.panelTitle}},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);setTimeout(function(){l.fire("saveSnapshot")},0)},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;}\n");l.addCss("img.cke_hidden{background-image: url("+a.getUrl(this.path+"images/hiddenfield.gif")+");background-position: center center;background-repeat: no-repeat;border: 1px solid #a9a9a9;width: 16px !important;height: 16px !important;}");
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",true)){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}}}})}l.on("doubleclick",function(p){var q=p.data.element;
if(q.is("form")){p.data.dialog="form"}else{if(q.is("select")){p.data.dialog="select"}else{if(q.is("textarea")){p.data.dialog="textarea"}else{if(q.is("img")&&q.getAttribute("_cke_real_element_type")=="hiddenfield"){p.data.dialog="hiddenfield"
}else{if(q.is("input")){var r=q.getAttribute("type");switch(r){case"text":case"password":p.data.dialog="textfield";break;case"button":case"submit":case"reset":p.data.dialog="button";break;case"checkbox":p.data.dialog="checkbox";
break;case"radio":p.data.dialog="radio";break;case"image":p.data.dialog="imagebutton";break}}}}}}})},afterInit:function(l){var m=l.dataProcessor,n=m&&m.htmlFilter,o=m&&m.dataFilter;if(c){n&&n.addRules({elements:{input:function(p){var q=p.attributes,r=q.type;
if(r=="checkbox"||r=="radio"){q.value=="on"&&delete q.value}}}})}if(o){o.addRules({elements:{input:function(p){if(p.attributes.type=="hidden"){return l.createFakeParserElement(p,"cke_hidden","hiddenfield")
}}}})}},requires:["image","fakeobjects"]});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={canUndo:false,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(Q){var R=Q.children.length,S=Q.children[R-1];while(S&&S.type==3&&!e.trim(S.value)){S=Q.children[--R]}return S}function o(Q,R){var S=Q.children,T=n(Q);if(T){if((R||!c)&&T.type==1&&T.name=="br"){S.pop()
}if(T.type==3&&l.test(T.value)){S.pop()}}}function p(Q){var R=n(Q);return !R||R.type==1&&R.name=="br"||Q.name=="form"&&R.name=="input"}function q(Q){o(Q,true);if(p(Q)){if(c){Q.add(new a.htmlParser.text("\xa0"))
}else{Q.add(new a.htmlParser.element("br",{}))}}}function r(Q){o(Q);if(p(Q)){Q.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={elements:{},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.*/,""],["hidefocus",""]],elements:{$:function(Q){var R=Q.attributes;
if(R){if(R.cke_temp){return false}var S=["name","href","src"],T;for(var U=0;U<S.length;U++){T="_cke_saved_"+S[U];T in R&&delete R[S[U]]}}return Q},embed:function(Q){var R=Q.parent;if(R&&R.name=="object"){var S=R.attributes.width,T=R.attributes.height;
S&&(Q.attributes.width=S);T&&(Q.attributes.height=T)}},param:function(Q){Q.children=[];Q.isEmpty=true;return Q},a:function(Q){if(!(Q.children.length||Q.attributes.name||Q.attributes._cke_saved_name)){return false
}},html:function(Q){delete Q.attributes.contenteditable;delete Q.attributes["class"]},body:function(Q){delete Q.attributes.spellcheck;delete Q.attributes.contenteditable},style:function(Q){var R=Q.children[0];
R&&R.value&&(R.value=e.trim(R.value));if(!Q.attributes.type){Q.attributes.type="text/css"}},title:function(Q){var R=Q.children[0];R&&(R.value=Q.attributes._cke_title||"")}},attributes:{"class":function(Q,R){return e.ltrim(Q.replace(/(?:^|\s+)cke_[^\s]*/g,""))||false
}},comment:function(Q){if(Q.substr(0,m.length)==m){if(Q.substr(m.length,3)=="{C}"){Q=Q.substr(m.length+3)}else{Q=Q.substr(m.length)}return new a.htmlParser.cdata(decodeURIComponent(Q))}return Q}},y={elements:{}};
for(u in t){y.elements[u]=r}if(c){x.attributes.style=function(Q,R){return Q.toLowerCase()}}function z(Q){Q.attributes.contenteditable="false"}function A(Q){delete Q.attributes.contenteditable}for(u in {input:1,textarea:1}){v.elements[u]=z;
x.elements[u]=A}var B=/<(?:a|area|img|input)[\s\S]*?\s((?:href|src|name)\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|(?:[^ "'>]+)))/gi,C=/(?:<style(?=[ >])[^>]*>[\s\S]*<\/style>)|(?:<(:?link|meta|base)[^>]*>)/gi,D=/<cke:encoded>([^<]*)<\/cke:encoded>/gi,E=/(<\/?)((?:object|embed|param|html|body|head|title)[^>]*>)/gi,F=/(<\/?)cke:((?:html|body|head|title)[^>]*>)/gi,G=/<cke:(param|embed)([^>]*?)\/?>(?!\s*<\/cke:\1)/gi;
function H(Q){return Q.replace(B,"$& _cke_saved_$1")}function I(Q){return Q.replace(C,function(R){return"<cke:encoded>"+encodeURIComponent(R)+"</cke:encoded>"})}function J(Q){return Q.replace(D,function(R,S){return decodeURIComponent(S)
})}function K(Q){return Q.replace(E,"$1cke:$2")}function L(Q){return Q.replace(F,"$1$2")}function M(Q){return Q.replace(G,"<cke:$1$2></cke:$1>")}function N(Q){return Q.replace(/<!--(?!{cke_protected})[\s\S]+?-->/g,function(R){return"<!--"+m+"{C}"+encodeURIComponent(R).replace(/--/g,"%2D%2D")+"-->"
})}function O(Q){return Q.replace(/<!--\{cke_protected\}\{C\}([\s\S]+?)-->/g,function(R,S){return decodeURIComponent(S)})}function P(Q,R){var S=[],T=/<\!--\{cke_temp(comment)?\}(\d*?)-->/g,U=[/<script[\s\S]*?<\/script>/gi,/<noscript[\s\S]*?<\/noscript>/gi].concat(R);
Q=Q.replace(/<!--[\s\S]*?-->/g,function(W){return"<!--{cke_tempcomment}"+(S.push(W)-1)+"-->"});for(var V=0;V<U.length;V++){Q=Q.replace(U[V],function(W){W=W.replace(T,function(X,Y,Z){return S[Z]});return"<!--{cke_temp}"+(S.push(W)-1)+"-->"
})}Q=Q.replace(T,function(W,X,Y){return"<!--"+m+(X?"{C}":"")+encodeURIComponent(S[Y]).replace(/--/g,"%2D%2D")+"-->"});return Q}j.add("htmldataprocessor",{requires:["htmlwriter"],init:function(Q){var R=Q.dataProcessor=new a.htmlDataProcessor(Q);
R.writer.forceSimpleAmpersand=Q.config.forceSimpleAmpersand;R.dataFilter.addRules(v);R.dataFilter.addRules(w);R.htmlFilter.addRules(x);R.htmlFilter.addRules(y)}});a.htmlDataProcessor=function(Q){var R=this;
R.editor=Q;R.writer=new a.htmlWriter();R.dataFilter=new a.htmlParser.filter();R.htmlFilter=new a.htmlParser.filter()};a.htmlDataProcessor.prototype={toHtml:function(Q,R){Q=P(Q,this.editor.config.protectedSource);
Q=H(Q);Q=I(Q);Q=K(Q);Q=M(Q);var S=new h("div");S.setHtml("a"+Q);Q=S.getHtml().substr(1);Q=L(Q);Q=J(Q);Q=O(Q);var T=a.htmlParser.fragment.fromHtml(Q,R),U=new a.htmlParser.basicWriter();T.writeHtml(U,this.dataFilter);
Q=U.getHtml(true);Q=N(Q);return Q},toDataFormat:function(Q,R){var S=this.writer,T=a.htmlParser.fragment.fromHtml(Q,R);S.reset();T.writeHtml(S,this.htmlFilter);return S.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});l.on("doubleclick",function(n){var o=n.data.element;
if(o.is("img")&&!o.getAttribute("_cke_realelement")){n.data.dialog="image"}});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},m=d.walker.whitespaces(true),n=d.walker.bookmark(false,true);function o(v,w){v.getCommand(this.name).setState(w)}function p(v){var E=this;
var w=v.editor,x=v.data.path,y=x&&x.contains(l);if(y){return o.call(E,w,2)}if(!E.useIndentClasses&&E.name=="indent"){return o.call(E,w,2)}var z=v.data.path,A=z.block||z.blockLimit;if(!A){return o.call(E,w,0)
}if(E.useIndentClasses){var B=A.$.className.match(E.classNameRegex),C=0;if(B){B=B[1];C=E.indentClassMap[B]}if(E.name=="outdent"&&!C||E.name=="indent"&&C==w.config.indentClasses.length){return o.call(E,w,0)
}return o.call(E,w,2)}else{var D=parseInt(A.getStyle(E.indentCssProperty),10);if(isNaN(D)){D=0}if(D<=0){return o.call(E,w,0)}return o.call(E,w,2)}}function q(v,w,x){var y=w.startContainer,z=w.endContainer;
while(y&&!y.getParent().equals(x)){y=y.getParent()}while(z&&!z.getParent().equals(x)){z=z.getParent()}if(!y||!z){return}var A=y,B=[],C=false;while(!C){if(A.equals(z)){C=true}B.push(A);A=A.getNext()}if(B.length<1){return
}var D=x.getParents(true);for(var E=0;E<D.length;E++){if(D[E].getName&&l[D[E].getName()]){x=D[E];break}}var F=this.name=="indent"?1:-1,G=B[0],H=B[B.length-1],I={},J=j.list.listToArray(x,I),K=J[H.getCustomData("listarray_index")].indent;
for(E=G.getCustomData("listarray_index");E<=H.getCustomData("listarray_index");E++){J[E].indent+=F;var L=J[E].parent;J[E].parent=new h(L.getName(),L.getDocument())}for(E=H.getCustomData("listarray_index")+1;
E<J.length&&J[E].indent>K;E++){J[E].indent+=F}var M=j.list.arrayToList(J,I,null,v.config.enterMode,0);if(this.name=="outdent"){var N;if((N=x.getParent())&&N.is("li")){var O=M.listNode.getChildren(),P=[],Q=O.count(),R;
for(E=Q-1;E>=0;E--){if((R=O.getItem(E))&&R.is&&R.is("li")){P.push(R)}}}}if(M){M.listNode.replace(x)}if(P&&P.length){for(E=0;E<P.length;E++){var S=P[E],T=S;while((T=T.getNext())&&T.is&&T.getName() in l){if(c&&!S.getFirst(function(U){return m(U)&&n(U)
})){S.append(w.document.createText("\xa0"))}S.append(T)}S.insertAfter(N)}}h.clearAllMarkers(I)}function r(v,w){var x=w.createIterator(),y=v.config.enterMode;x.enforceRealBlocks=true;x.enlargeBr=y!=2;var z;
while(z=x.getNextParagraph()){s.call(this,v,z)}}function s(v,w){var B=this;if(B.useIndentClasses){var x=w.$.className.match(B.classNameRegex),y=0;if(x){x=x[1];y=B.indentClassMap[x]}if(B.name=="outdent"){y--
}else{y++}if(y<0){return false}y=Math.min(y,v.config.indentClasses.length);y=Math.max(y,0);var z=e.ltrim(w.$.className.replace(B.classNameRegex,""));if(y<1){w.$.className=z}else{w.addClass(v.config.indentClasses[y-1])
}}else{var A=parseInt(w.getStyle(B.indentCssProperty),10);if(isNaN(A)){A=0}A+=(B.name=="indent"?1:-1)*v.config.indentOffset;if(A<0){return false}A=Math.max(A,0);A=Math.ceil(A/v.config.indentOffset)*v.config.indentOffset;
w.setStyle(B.indentCssProperty,A?A+v.config.indentUnit:"");if(w.getAttribute("style")===""){w.removeAttribute("style")}}return true}function t(v,w){var y=this;y.name=w;y.useIndentClasses=v.config.indentClasses&&v.config.indentClasses.length>0;
if(y.useIndentClasses){y.classNameRegex=new RegExp("(?:^|\\s+)("+v.config.indentClasses.join("|")+")(?=$|\\s)");y.indentClassMap={};for(var x=0;x<v.config.indentClasses.length;x++){y.indentClassMap[v.config.indentClasses[x]]=x+1
}}else{y.indentCssProperty=v.config.contentsLangDirection=="ltr"?"margin-left":"margin-right"}y.startDisabled=w=="outdent"}function u(v){return v.type=1&&v.is("li")}t.prototype={exec:function(v){var w=v.getSelection(),x=w&&w.getRanges()[0],y=x.startContainer,z=x.endContainer,A=x.getCommonAncestor(),B=A;
while(B&&!(B.type==1&&l[B.getName()])){B=B.getParent()}if(B&&y.type==1&&y.getName() in l){var C=new d.walker(x);C.evaluator=u;x.startContainer=C.next()}if(B&&z.type==1&&z.getName() in l){C=new d.walker(x);
C.evaluator=u;x.endContainer=C.previous()}var D=w.createBookmarks(true);if(B){var E=B.getFirst(function(H){return H.type==1&&H.is("li")}),F=x.startContainer,G=E.equals(F)||E.contains(F);if(!(G&&s.call(this,v,B))){q.call(this,v,x,B)
}}else{r.call(this,v,x)}v.focus();v.forceNextSelectionCheck();w.selectBookmarks(D)}};j.add("indent",{init:function(v){var w=new t(v,"indent"),x=new t(v,"outdent");v.addCommand("indent",w);v.addCommand("outdent",x);
v.ui.addButton("Indent",{label:v.lang.indent,command:"indent"});v.ui.addButton("Outdent",{label:v.lang.outdent,command:"outdent"});v.on("selectionChange",e.bind(p,w));v.on("selectionChange",e.bind(p,x));
if(b.ie6Compat||b.ie7Compat){v.addCss("ul,ol{\tmargin-left: 0px;\tpadding-left: 40px;}")}},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 z=this;var q=p.getSelection(),r=p.config.enterMode;if(!q){return}var s=q.createBookmarks(),t=q.getRanges(),u=z.cssClassName,v,w;for(var x=t.length-1;x>=0;x--){v=t[x].createIterator();
v.enlargeBr=r!=2;while(w=v.getNextParagraph()){w.removeAttribute("align");if(u){var y=w.$.className=e.ltrim(w.$.className.replace(z.cssClassRegex,""));if(z.state==2&&!z.isDefaultAlign){w.addClass(u)}else{if(!y){w.removeAttribute("class")
}}}else{if(z.state==2&&!z.isDefaultAlign){w.setStyle("text-align",z.value)}else{w.removeStyle("text-align")}}}}p.focus();p.forceNextSelectionCheck();q.selectBookmarks(s)}};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"],[4000+48,"a11yHelp"]];
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 !important;height: 18px !important;}\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)}});l.on("doubleclick",function(m){var n=j.link.getSelectedLink(l)||m.data.element;
if(n.is("a")){m.data.dialog=n.getAttribute("name")&&!n.getAttribute("href")?"anchor":"link"}else{if(n.is("img")&&n.getAttribute("_cke_real_element_type")=="anchor"){m.data.dialog="anchor"}}});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=j.link.getSelectedLink(l))){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"]});j.link={getSelectedLink:function(l){var m;try{m=l.getSelection().getRanges()[0]}catch(o){return null
}m.shrink(2);var n=m.getCommonAncestor();return n.getAscendant("a",true)}};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)
},startDisabled:true};e.extend(i,{linkShowAdvancedTab:true,linkShowTargetTab:true});(function(){var l={ol:1,ul:1},m=/^[\n\r\t ]*$/;j.list={listToArray:function(B,C,D,E,F){if(!l[B.getName()]){return[]}if(!E){E=0
}if(!D){D=[]}for(var G=0,H=B.getChildCount();G<H;G++){var I=B.getChild(G);if(I.$.nodeName.toLowerCase()!="li"){continue}var J={parent:B,indent:E,element:I,contents:[]};if(!F){J.grandparent=B.getParent();
if(J.grandparent&&J.grandparent.$.nodeName.toLowerCase()=="li"){J.grandparent=J.grandparent.getParent()}}else{J.grandparent=F}if(C){h.setMarker(C,I,"listarray_index",D.length)}D.push(J);for(var K=0,L=I.getChildCount(),M;
K<L;K++){M=I.getChild(K);if(M.type==1&&l[M.getName()]){j.list.listToArray(M,C,D,E+1,J.grandparent)}else{J.contents.push(M)}}}return D},arrayToList:function(B,C,D,E){if(!D){D=0}if(!B||B.length<D+1){return null
}var F=B[D].parent.getDocument(),G=new d.documentFragment(F),H=null,I=D,J=Math.max(B[D].indent,0),K=null,L=E==1?"p":"div";for(;;){var M=B[I];if(M.indent==J){if(!H||B[I].parent.getName()!=H.getName()){H=B[I].parent.clone(false,true);
G.append(H)}K=H.append(M.element.clone(false,true));for(var N=0;N<M.contents.length;N++){K.append(M.contents[N].clone(true,true))}I++}else{if(M.indent==Math.max(J,0)+1){var O=j.list.arrayToList(B,null,I,E);
K.append(O.listNode);I=O.nextIndex}else{if(M.indent==-1&&!D&&M.grandparent){K;if(l[M.grandparent.getName()]){K=M.element.clone(false,true)}else{if(E!=2&&M.grandparent.getName()!="td"){K=F.createElement(L)
}else{K=new d.documentFragment(F)}}for(N=0;N<M.contents.length;N++){K.append(M.contents[N].clone(true,true))}if(K.type==11&&I!=B.length-1){if(K.getLast()&&K.getLast().type==1&&K.getLast().getAttribute("type")=="_moz"){K.getLast().remove()
}K.appendBogus()}if(K.type==1&&K.getName()==L&&K.$.firstChild){K.trim();var P=K.getFirst();if(P.type==1&&P.isBlockBoundary()){var Q=new d.documentFragment(F);K.moveChildren(Q);K=Q}}var R=K.$.nodeName.toLowerCase();
if(!c&&(R=="div"||R=="p")){K.appendBogus()}G.append(K);H=null;I++}else{return null}}}if(B.length<=I||Math.max(B[I].indent,0)<J){break}}if(C){var S=G.getFirst();while(S){if(S.type==1){h.clearMarkers(C,S)
}S=S.getNextSourceNode()}}return{listNode:G,nextIndex:I}}};function n(B,C){B.getCommand(this.name).setState(C)}function o(B){var C=B.data.path,D=C.blockLimit,E=C.elements,F;for(var G=0;G<E.length&&(F=E[G])&&!F.equals(D);
G++){if(l[E[G].getName()]){return n.call(this,B.editor,this.type==E[G].getName()?1:2)}}return n.call(this,B.editor,2)}function p(B,C,D,E){var F=j.list.listToArray(C.root,D),G=[];for(var H=0;H<C.contents.length;
H++){var I=C.contents[H];I=I.getAscendant("li",true);if(!I||I.getCustomData("list_item_processed")){continue}G.push(I);h.setMarker(D,I,"list_item_processed",true)}var J=C.root,K=J.getDocument().createElement(this.type);
J.copyAttributes(K,{start:1,type:1});K.removeStyle("list-style-type");for(H=0;H<G.length;H++){var L=G[H].getCustomData("listarray_index");F[L].parent=K}var M=j.list.arrayToList(F,D,null,B.config.enterMode),N,O=M.listNode.getChildCount();
for(H=0;H<O&&(N=M.listNode.getChild(H));H++){if(N.getName()==this.type){E.push(N)}}M.listNode.replace(C.root)}var q=/^h[1-6]$/;function r(B,C,D){var E=C.contents,F=C.root.getDocument(),G=[];if(E.length==1&&E[0].equals(C.root)){var H=F.createElement("div");
E[0].moveChildren&&E[0].moveChildren(H);E[0].append(H);E[0]=H}var I=C.contents[0].getParent();for(var J=0;J<E.length;J++){I=I.getCommonAncestor(E[J].getParent())}for(J=0;J<E.length;J++){var K=E[J],L;while(L=K.getParent()){if(L.equals(I)){G.push(K);
break}K=L}}if(G.length<1){return}var M=G[G.length-1].getNext(),N=F.createElement(this.type);D.push(N);while(G.length){var O=G.shift(),P=F.createElement("li");if(q.test(O.getName())){O.appendTo(P)}else{O.copyAttributes(P);
O.moveChildren(P);O.remove()}P.appendTo(N);if(!c){P.appendBogus()}}if(M){N.insertBefore(M)}else{N.appendTo(I)}}function s(B,C,D){var E=j.list.listToArray(C.root,D),F=[];for(var G=0;G<C.contents.length;
G++){var H=C.contents[G];H=H.getAscendant("li",true);if(!H||H.getCustomData("list_item_processed")){continue}F.push(H);h.setMarker(D,H,"list_item_processed",true)}var I=null;for(G=0;G<F.length;G++){var J=F[G].getCustomData("listarray_index");
E[J].indent=-1;I=J}for(G=I+1;G<E.length;G++){if(E[G].indent>E[G-1].indent+1){var K=E[G-1].indent+1-E[G].indent,L=E[G].indent;while(E[G]&&E[G].indent>=L){E[G].indent+=K;G++}G--}}var M=j.list.arrayToList(E,D,null,B.config.enterMode),N=M.listNode,O,P;
function Q(R){if((O=N[R?"getFirst":"getLast"]())&&!(O.is&&O.isBlockBoundary())&&(P=C.root[R?"getPrevious":"getNext"](d.walker.whitespaces(true)))&&!(P.is&&P.isBlockBoundary({br:1}))){B.document.createElement("br")[R?"insertBefore":"insertAfter"](O)
}}Q(true);Q();N.replace(C.root)}function t(B,C){this.name=B;this.type=C}t.prototype={exec:function(B){B.focus();var C=B.document,D=B.getSelection(),E=D&&D.getRanges();if(!E||E.length<1){return}if(this.state==2){var F=C.getBody();
F.trim();if(!F.getFirst()){var G=C.createElement(B.config.enterMode==1?"p":B.config.enterMode==3?"div":"br");G.appendTo(F);E=[new d.range(C)];if(G.is("br")){E[0].setStartBefore(G);E[0].setEndAfter(G)}else{E[0].selectNodeContents(G)
}D.selectRanges(E)}else{var H=E.length==1&&E[0],I=H&&H.getEnclosedNode();if(I&&I.is&&this.type==I.getName()){n.call(this,B,1)}}}var J=D.createBookmarks(true),K=[],L={};while(E.length>0){H=E.shift();var M=H.createIterator(),N;
M.forceBrBreak=this.state==2;while(N=M.getNextParagraph()){var O=new d.elementPath(N),P=O.elements,Q=P.length,R=null,S=false,T=O.blockLimit,U;for(var V=Q-1;V>=0&&(U=P[V]);V--){if(l[U.getName()]&&T.contains(U)){T.removeCustomData("list_group_object");
var W=U.getCustomData("list_group_object");if(W){W.contents.push(N)}else{W={root:U,contents:[N]};K.push(W);h.setMarker(L,U,"list_group_object",W)}S=true;break}}if(S){continue}var X=T;if(X.getCustomData("list_group_object")){X.getCustomData("list_group_object").contents.push(N)
}else{W={root:X,contents:[N]};h.setMarker(L,X,"list_group_object",W);K.push(W)}}}var Y=[];while(K.length>0){W=K.shift();if(this.state==2){if(l[W.root.getName()]){p.call(this,B,W,L,Y)}else{r.call(this,B,W,Y)
}}else{if(this.state==1&&l[W.root.getName()]){s.call(this,B,W,L)}}}for(V=0;V<Y.length;V++){R=Y[V];var Z,aa=this;(Z=function(ab){var ac=R[ab?"getPrevious":"getNext"](d.walker.whitespaces(true));if(ac&&ac.getName&&ac.getName()==aa.type){ac.remove();
ac.moveChildren(R,ab?true:false)}})();Z(true)}h.clearAllMarkers(L);D.selectBookmarks(J);B.focus()}};var u=f,v=/[\t\r\n ]*(?:&nbsp;|\xa0)$/;function w(B,C){var D,E=B.children,F=E.length;for(var G=0;G<F;
G++){D=E[G];if(D.name&&D.name in C){return G}}return F}function x(B){return function(C){var D=C.children,E=w(C,u.$list),F=D[E],G=F&&F.previous,H;if(G&&(G.name&&G.name=="br"||G.value&&(H=G.value.match(v)))){var I=G;
if(!(H&&H.index)&&I==D[0]){D[0]=B||c?new a.htmlParser.text("\xa0"):new a.htmlParser.element("br",{})}else{if(I.name=="br"){D.splice(E-1,1)}else{I.value=I.value.replace(v,"")}}}}}var y={elements:{}};for(var z in u.$listItem){y.elements[z]=x()
}var A={elements:{}};for(z in u.$listItem){A.elements[z]=x(true)}j.add("list",{init:function(B){var C=new t("numberedlist","ol"),D=new t("bulletedlist","ul");B.addCommand("numberedlist",C);B.addCommand("bulletedlist",D);
B.ui.addButton("NumberedList",{label:B.lang.numberedlist,command:"numberedlist"});B.ui.addButton("BulletedList",{label:B.lang.bulletedlist,command:"bulletedlist"});B.on("selectionChange",e.bind(o,C));B.on("selectionChange",e.bind(o,D))
},afterInit:function(B){var C=B.dataProcessor;if(C){C.dataFilter.addRules(y);C.htmlFilter.addRules(A)}},requires:["domiterator"]})})();(function(){j.liststyle={requires:["dialog"],init:function(l){l.addCommand("numberedListStyle",new a.dialogCommand("numberedListStyle"));
a.dialog.add("numberedListStyle",this.path+"dialogs/liststyle.js");l.addCommand("bulletedListStyle",new a.dialogCommand("bulletedListStyle"));a.dialog.add("bulletedListStyle",this.path+"dialogs/liststyle.js");
if(l.addMenuItems){l.addMenuGroup("list",108);l.addMenuItems({numberedlist:{label:l.lang.list.numberedTitle,group:"list",command:"numberedListStyle"},bulletedlist:{label:l.lang.list.bulletedTitle,group:"list",command:"bulletedListStyle"}})
}if(l.contextMenu){l.contextMenu.addListener(function(m,n){while(m){var o=m.getName();if(o=="ol"){return{numberedlist:2}}else{if(o=="ul"){return{bulletedlist:2}}}m=m.getParent()}return null})}}};j.add("liststyle",j.liststyle)
})();(function(){function l(r){if(!r||r.type!=1||r.getName()!="form"){return[]}var s=[],t=["style","className"];for(var u=0;u<t.length;u++){var v=t[u],w=r.$.elements.namedItem(v);if(w){var x=new h(w);s.push([x,x.nextSibling]);
x.remove()}}return s}function m(r,s){if(!r||r.type!=1||r.getName()!="form"){return}if(s.length>0){for(var t=s.length-1;t>=0;t--){var u=s[t][0],v=s[t][1];if(v){u.insertBefore(v)}else{u.appendTo(r)}}}}function n(r,s){var t=l(r),u={},v=r.$;
if(!s){u["class"]=v.className||"";v.className=""}u.inline=v.style.cssText||"";if(!s){v.style.cssText="position: static; overflow: visible"}m(t);return u}function o(r,s){var t=l(r),u=r.$;if("class" in s){u.className=s["class"]
}if("inline" in s){u.style.cssText=s.inline}m(t)}function p(r){var s=a.instances;for(var t in s){var u=s[t];if(u.mode=="wysiwyg"){var v=u.document.getBody();v.setAttribute("contentEditable",false);v.setAttribute("contentEditable",true)
}}if(r.focusManager.hasFocus){r.toolbox.focus();r.focus()}}function q(r){if(!c||b.version>6){return null}var s=h.createFromHtml('<iframe frameborder="0" tabindex="-1" src="javascript:void((function(){document.open();'+(b.isCustomDomain()?"document.domain='"+this.getDocument().$.domain+"';":"")+'document.close();})())" style="display:block;position:absolute;z-index:-1;progid:DXImageTransform.Microsoft.Alpha(opacity=0);"></iframe>');
return r.append(s,true)}j.add("maximize",{init:function(r){var s=r.lang,t=a.document,u=t.getWindow(),v,w,x,y;function z(){var B=u.getViewPaneSize();y&&y.setStyles({width:B.width+"px",height:B.height+"px"});
r.resize(B.width,B.height,null,true)}var A=2;r.addCommand("maximize",{modes:{wysiwyg:1,source:1},editorFocus:false,exec:function(){var B=r.container.getChild(1),C=r.getThemeSpace("contents");if(r.mode=="wysiwyg"){var D=r.getSelection();
v=D&&D.getRanges();w=u.getScrollPosition()}else{var E=r.textarea.$;v=!c&&[E.selectionStart,E.selectionEnd];w=[E.scrollLeft,E.scrollTop]}if(this.state==2){u.on("resize",z);x=u.getScrollPosition();var F=r.container;
while(F=F.getParent()){F.setCustomData("maximize_saved_styles",n(F));F.setStyle("z-index",r.config.baseFloatZIndex-1)}C.setCustomData("maximize_saved_styles",n(C,true));B.setCustomData("maximize_saved_styles",n(B,true));
if(c){t.$.documentElement.style.overflow=t.getBody().$.style.overflow="hidden"}else{t.getBody().setStyles({overflow:"hidden",width:"0px",height:"0px"})}c?setTimeout(function(){u.$.scrollTo(0,0)},0):u.$.scrollTo(0,0);
var G=u.getViewPaneSize();B.setStyle("position","absolute");B.$.offsetLeft;B.setStyles({"z-index":r.config.baseFloatZIndex-1,left:"0px",top:"0px"});y=q(B);B.addClass("cke_maximized");z();var H=B.getDocumentPosition();
B.setStyles({left:-1*H.x+"px",top:-1*H.y+"px"});b.gecko&&p(r)}else{if(this.state==1){u.removeListener("resize",z);var I=[C,B];for(var J=0;J<I.length;J++){o(I[J],I[J].getCustomData("maximize_saved_styles"));
I[J].removeCustomData("maximize_saved_styles")}F=r.container;while(F=F.getParent()){o(F,F.getCustomData("maximize_saved_styles"));F.removeCustomData("maximize_saved_styles")}c?setTimeout(function(){u.$.scrollTo(x.x,x.y)
},0):u.$.scrollTo(x.x,x.y);B.removeClass("cke_maximized");if(y){y.remove();y=null}r.fire("resize")}}this.toggleState();var K=this.uiItems[0],L=this.state==2?s.maximize:s.minimize,M=r.element.getDocument().getById(K._.id);
M.getChild(1).setHtml(L);M.setAttribute("title",L);M.setAttribute("href",'javascript:void("'+L+'");');if(r.mode=="wysiwyg"){if(v){b.gecko&&p(r);r.getSelection().selectRanges(v);var N=r.getSelection().getStartElement();
N&&N.scrollIntoView(true)}else{u.$.scrollTo(w.x,w.y)}}else{if(v){E.selectionStart=v[0];E.selectionEnd=v[1]}E.scrollLeft=w[0];E.scrollTop=w[1]}v=w=null;A=this.state},canUndo:false});r.ui.addButton("Maximize",{label:s.maximize,command:"maximize"});
r.on("mode",function(){r.getCommand("maximize").setState(A)},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(){setTimeout(function(){m.fire("afterCommandExec",{name:n.name,command:n})
},200)});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% !important; _width:99.9% !important;border-top: #999999 1px dotted;border-bottom: #999999 1px dotted;height: 5px !important;page-break-after: always;}")
},afterInit:function(l){var m=l.dataProcessor,n=m&&m.dataFilter;if(n){n.addRules({elements:{div:function(o){var p=o.attributes,q=p&&p.style,r=q&&o.children.length==1&&o.children[0],s=r&&r.name=="span"&&r.attributes.style;
if(s&&/page-break-after\s*:\s*always/i.test(q)&&/display\s*:\s*none/i.test(s)){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();l.fire("saveSnapshot");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);if(p==n.length-1){o.moveToPosition(m,4);
o.select()}var q=m.getPrevious();if(f[q.getName()].div){m.move(q)}}l.fire("saveSnapshot")}};(function(){j.add("pastefromword",{init:function(l){var m=0,n=function(){setTimeout(function(){m=0},0)};l.addCommand("pastefromword",{canUndo:false,exec:function(){m=1;
if(l.execCommand("paste")===false){l.on("dialogHide",function(o){o.removeListener();n()})}else{n()}}});l.ui.addButton("PasteFromWord",{label:l.lang.pastefromword.toolbar,command:"pastefromword"});l.on("paste",function(o){var p=o.data,q;
if((q=p.html)&&(m||/(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/.test(q))){var r=this.loadFilterRules(function(){if(r){l.fire("paste",p)}else{if(!l.config.pasteFromWordPromptCleanup||m||confirm(l.lang.pastefromword.confirmCleanup)){p.html=a.cleanWord(q,l)
}}});r&&o.cancel()}},this)},loadFilterRules:function(l){var m=a.cleanWord;if(m){l()}else{var n=a.getUrl(i.pasteFromWordCleanupFile||this.path+"filter/default.js");a.scriptLoader.load(n,l,null,false,true)
}return !m}})})();(function(){var l={exec:function(o){var p=e.tryThese(function(){var q=window.clipboardData.getData("Text");if(!q){throw 0}return q});if(!p){o.openDialog("pastetext");return false}else{o.fire("paste",{text:p})
}return true}};function m(o,p){if(c){var q=o.selection;if(q.type=="Control"){q.clear()}q.createRange().pasteHTML(p)}else{o.execCommand("inserthtml",false,p)}}j.add("pastetext",{init:function(o){var p="pastetext",q=o.addCommand(p,l);
o.ui.addButton("PasteText",{label:o.lang.pasteText.button,command:p});a.dialog.add(p,a.getUrl(this.path+"dialogs/pastetext.js"));if(o.config.forcePasteAsPlainText){o.on("beforeCommandExec",function(r){if(r.data.name=="paste"){o.execCommand("pastetext");
r.cancel()}},null,null,0)}},requires:["clipboard"]});function n(o,p,q,r){while(q--){j.enterkey[p==2?"enterBr":"enterBlock"](o,p,null,r)}}a.editor.prototype.insertText=function(o){this.focus();this.fire("saveSnapshot");
var p=this.getSelection().getStartElement().hasAscendant("pre",true)?2:this.config.enterMode,q=p==2,r=this.document.$,s=this,t;o=e.htmlEncode(o.replace(/\r\n|\r/g,"\n"));var u=0;o.replace(/\n+/g,function(v,w){t=o.substring(u,w);
u=w+v.length;t.length&&m(r,t);var x=v.length,y=q?0:Math.floor(x/2),z=q?x:x%2;n(s,p,y);n(s,2,z,q?false:true)});t=o.substring(u,o.length);t.length&&m(r,t);this.fire("saveSnapshot")}})();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=n.config,q=p.baseHref?'<base href="'+p.baseHref+'"/>':"",r=b.isCustomDomain();
if(p.fullPage){o=n.getData().replace(/<head>/,"$&"+q).replace(/[^>]*(?=<\/title>)/,n.lang.preview)}else{var s="<body ",t=n.document&&n.document.getBody();if(t){if(t.getAttribute("id")){s+='id="'+t.getAttribute("id")+'" '
}if(t.getAttribute("class")){s+='class="'+t.getAttribute("class")+'" '}}s+=">";o=n.config.docType+'<html dir="'+n.config.contentsLangDirection+'"><head>'+q+"<title>"+n.lang.preview+"</title>"+e.buildStyleHtml(n.config.contentsCss)+"</head>"+s+n.getData()+"</body></html>"
}var u=640,v=420,w=80;try{var x=window.screen;u=Math.round(x.width*0.8);v=Math.round(x.height*0.7);w=Math.round(x.width*0.1)}catch(A){}var y="";if(r){window._cke_htmlToLoad=o;y='javascript:void( (function(){document.open();document.domain="'+document.domain+'";document.write( window.opener._cke_htmlToLoad );document.close();window.opener._cke_htmlToLoad = null;})() )'
}var z=window.open(y,null,"toolbar=yes,location=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width="+u+",height="+v+",left="+w);if(!r){z.document.open();z.document.write(o);z.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"});l._.removeFormat={filters:[]}}});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=j.removeformat.filter,p=l.getSelection().getRanges();
for(var q=0,r;r=p[q];q++){if(r.collapsed){continue}r.enlarge(1);var s=r.createBookmark(),t=s.startNode,u=s.endNode,v=function(y){var z=new d.elementPath(y),A=z.elements;for(var B=1,C;C=A[B];B++){if(C.equals(z.block)||C.equals(z.blockLimit)){break
}if(m.test(C.getName())&&o(l,C)){y.breakParent(C)}}};v(t);v(u);var w=t.getNextSourceNode(true,1);while(w){if(w.equals(u)){break}var x=w.getNextSourceNode(false,1);if(!(w.getName()=="img"&&w.getAttribute("_cke_realelement"))&&o(l,w)){if(m.test(w.getName())){w.remove(true)
}else{w.removeAttributes(n);l.fire("removeFormatCleanup",w)}}w=x}r.moveToBookmark(s)}l.getSelection().selectRanges(p)}}},filter:function(l,m){var n=l._.removeFormat.filters;for(var o=0;o<n.length;o++){if(n[o](m)===false){return false
}}return true}};a.editor.prototype.addRemoveFormatFilter=function(l){this._.removeFormat.filters.push(l)};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;!m.resize_dir&&(m.resize_dir="both");m.resize_maxWidth==undefined&&(m.resize_maxWidth=3000);
m.resize_maxHeight==undefined&&(m.resize_maxHeight=3000);m.resize_minWidth==undefined&&(m.resize_minWidth=750);m.resize_minHeight==undefined&&(m.resize_minHeight=250);if(m.resize_enabled!==false){var n=null,o,p,q=(m.resize_dir=="both"||m.resize_dir=="horizontal")&&m.resize_minWidth!=m.resize_maxWidth,r=(m.resize_dir=="both"||m.resize_dir=="vertical")&&m.resize_minHeight!=m.resize_maxHeight;
function s(v){var w=v.data.$.screenX-o.x,x=v.data.$.screenY-o.y,y=p.width,z=p.height,A=y+w*(l.lang.dir=="rtl"?-1:1),B=z+x;if(q){y=Math.max(m.resize_minWidth,Math.min(A,m.resize_maxWidth))}if(r){z=Math.max(m.resize_minHeight,Math.min(B,m.resize_maxHeight))
}l.resize(y,z)}function t(v){a.document.removeListener("mousemove",s);a.document.removeListener("mouseup",t);if(l.document){l.document.removeListener("mousemove",s);l.document.removeListener("mouseup",t)
}}var u=e.addFunction(function(v){if(!n){n=l.getResizable()}p={width:n.$.offsetWidth||0,height:n.$.offsetHeight||0};o={x:v.screenX,y:v.screenY};m.resize_minWidth>p.width&&(m.resize_minWidth=p.width);m.resize_minHeight>p.height&&(m.resize_minHeight=p.height);
a.document.on("mousemove",s);a.document.on("mouseup",t);if(l.document){l.document.on("mousemove",s);l.document.on("mouseup",t)}});l.on("destroy",function(){e.removeFunction(u)});l.on("themeSpace",function(v){if(v.data.space=="bottom"){var w="";
if(q&&!r){w=" cke_resizer_horizontal"}if(!q&&r){w=" cke_resizer_vertical"}v.data.html+='<div class="cke_resizer'+w+'" title="'+e.htmlEncode(l.lang.resize)+'" onmousedown="CKEDITOR.tools.callFunction('+u+', event)"></div>'
}},l,null,100)}}});(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="";function n(s,t){var u=false,v;for(v in t){if(t[v]===s||t[v]==s){u=true;
break}}return u}var o=function(){var s=this,t=function(){var x={};x.srcNodeRef=s.document.getWindow().$.frameElement;x.assocApp="CKEDITOR."+a.version+"@"+a.revision;x.customerid=s.config.scayt_customerid||"1:WvF0D4-UtPqN1-43nkD4-NKvUm2-daQqk3-LmNiI-z7Ysb4-mwry24-T8YrS3-Q2tpq2";
x.customDictionaryIds=s.config.scayt_customDictionaryIds||"";x.userDictionaryName=s.config.scayt_userDictionaryName||"";x.sLang=s.config.scayt_sLang||"en_US";x.onLoad=function(){if(!(c&&b.version<8)){this.addStyle(this.selectorCss(),"padding-bottom: 2px !important;")
}if(s.focusManager.hasFocus&&!p.isControlRestored(s)){this.focus()}};x.onBeforeChange=function(){if(p.getScayt(s)&&!s.checkDirty()){setTimeout(function(){s.resetDirty()})}};var y=window.scayt_custom_params;
if(typeof y=="object"){for(var z in y){x[z]=y[z]}}if(p.getControlId(s)){x.id=p.getControlId(s)}var A=new window.scayt(x);A.afterMarkupRemove.push(function(H){new h(H,A.document).mergeSiblings()});var B=p.instances[s.name];
if(B){A.sLang=B.sLang;A.option(B.option());A.paused=B.paused}p.instances[s.name]=A;var C="scaytButton",D=window.scayt.uiTags,E=[];for(var F=0,G=4;F<G;F++){E.push(D[F]&&p.uiTabs[F])}p.uiTabs=E;try{A.setDisabled(p.isPaused(s)===false)
}catch(H){}s.fire("showScaytState")};s.on("contentDom",t);s.on("contentDomUnload",function(){var x=a.document.getElementsByTag("script"),y=/^dojoIoScript(\d+)$/i,z=/^https?:\/\/svc\.spellchecker\.net\/spellcheck\/script\/ssrv\.cgi/i;
for(var A=0;A<x.count();A++){var B=x.getItem(A),C=B.getId(),D=B.getAttribute("src");if(C&&D&&C.match(y)&&D.match(z)){B.remove()}}});s.on("beforeCommandExec",function(x){if((x.data.name=="source"||x.data.name=="newpage")&&s.mode=="wysiwyg"){var y=p.getScayt(s);
if(y){p.setPaused(s,!y.disabled);p.setControlId(s,y.id);y.destroy(true);delete p.instances[s.name]}}else{if(x.data.name=="source"&&s.mode=="source"){p.markControlRestore(s)}}});s.on("afterCommandExec",function(x){if(!p.isScaytEnabled(s)){return
}if(s.mode=="wysiwyg"&&(x.data.name=="undo"||x.data.name=="redo")){window.setTimeout(function(){p.getScayt(s).refresh()},10)}});s.on("destroy",function(x){var y=x.editor,z=p.getScayt(y);if(!z){return}delete p.instances[y.name];
p.setControlId(y,z.id);z.destroy(true)});s.on("afterSetData",function(){if(p.isScaytEnabled(s)){window.setTimeout(function(){var x=p.getScayt(s);x&&x.refresh()},10)}});s.on("insertElement",function(){var x=p.getScayt(s);
if(p.isScaytEnabled(s)){if(c){s.getSelection().unlock(true)}window.setTimeout(function(){x.focus();x.refresh()},10)}},this,null,50);s.on("insertHtml",function(){var x=p.getScayt(s);if(p.isScaytEnabled(s)){if(c){s.getSelection().unlock(true)
}window.setTimeout(function(){x.focus();x.refresh()},10)}},this,null,50);s.on("scaytDialog",function(x){x.data.djConfig=window.djConfig;x.data.scayt_control=p.getScayt(s);x.data.tab=m;x.data.scayt=window.scayt
});var u=s.dataProcessor,v=u&&u.htmlFilter;if(v){v.addRules({elements:{span:function(x){if(x.attributes.scayt_word&&x.attributes.scaytid){delete x.name;return x}}}})}var w=j.undo.Image.prototype;w.equals=e.override(w.equals,function(x){return function(y){var D=this;
var z=D.contents,A=y.contents,B=p.getScayt(D.editor);if(B&&p.isScaytReady(D.editor)){D.contents=B.reset(z)||"";y.contents=B.reset(A)||""}var C=x.apply(D,arguments);D.contents=z;y.contents=A;return C}});
if(s.document){t()}};j.scayt={engineLoaded:false,instances:{},controlInfo:{},setControlInfo:function(s,t){if(s&&s.name&&typeof this.controlInfo[s.name]!="object"){this.controlInfo[s.name]={}}for(var u in t){this.controlInfo[s.name][u]=t[u]
}},isControlRestored:function(s){if(s&&s.name&&this.controlInfo[s.name]){return this.controlInfo[s.name].restored}return false},markControlRestore:function(s){this.setControlInfo(s,{restored:true})},setControlId:function(s,t){this.setControlInfo(s,{id:t})
},getControlId:function(s){if(s&&s.name&&this.controlInfo[s.name]&&this.controlInfo[s.name].id){return this.controlInfo[s.name].id}return null},setPaused:function(s,t){this.setControlInfo(s,{paused:t})
},isPaused:function(s){if(s&&s.name&&this.controlInfo[s.name]){return this.controlInfo[s.name].paused}return undefined},getScayt:function(s){return this.instances[s.name]},isScaytReady:function(s){return this.engineLoaded===true&&"undefined"!==typeof window.scayt&&this.getScayt(s)
},isScaytEnabled:function(s){var t=this.getScayt(s);return t?t.disabled===false:false},loadEngine:function(s){if(b.gecko&&b.version<10900||b.opera){return s.fire("showScaytState")}if(this.engineLoaded===true){return o.apply(s)
}else{if(this.engineLoaded==-1){return a.on("scaytReady",function(){o.apply(s)})}}a.on("scaytReady",o,s);a.on("scaytReady",function(){this.engineLoaded=true},this,null,0);this.engineLoaded=-1;var t=document.location.protocol;
t=t.search(/https?:/)!=-1?t:"http:";var u="svc.spellchecker.net/scayt25/loader__base.js",v=s.config.scayt_srcUrl||t+"//"+u,w=p.parseUrl(v).path+"/";if(window.scayt==undefined){a._djScaytConfig={baseUrl:w,addOnLoad:[function(){a.fireOnce("scaytReady")
}],isDebug:false};a.document.getHead().append(a.document.createElement("script",{attributes:{type:"text/javascript",async:"true",src:v}}))}else{a.fireOnce("scaytReady")}return null},parseUrl:function(s){var t;
if(s.match&&(t=s.match(/(.*)[\/\\](.*?\.\w+)$/))){return{path:t[1],file:t[2]}}else{return s}}};var p=j.scayt,q=function(s,t,u,v,w,x,y){s.addCommand(v,w);s.addMenuItem(v,{label:u,command:v,group:x,order:y})
},r={preserveState:true,editorFocus:false,exec:function(s){if(p.isScaytReady(s)){var t=p.isScaytEnabled(s);this.setState(t?2:1);var u=p.getScayt(s);u.focus();u.setDisabled(t)}else{if(!s.config.scayt_autoStartup&&p.engineLoaded>=0){this.setState(0);
p.loadEngine(s)}}}};j.add("scayt",{requires:["menubutton"],beforeInit:function(s){var t=s.config.scayt_contextMenuItemsOrder||"suggest|moresuggest|control",u="";t=t.split("|");if(t&&t.length){for(var v in t){u+="scayt_"+t[v]+(t.length!=parseInt(v,10)+1?",":"")
}}if(s.config.scayt_contextMenuOntop){s.config.menu_groups=u+","+s.config.menu_groups}else{s.config.menu_groups=s.config.menu_groups+","+u}},init:function(s){var t={},u={},v=s.addCommand(l,r);a.dialog.add(l,a.getUrl(this.path+"dialogs/options.js"));
var w=s.config.scayt_uiTabs||"1,1,1",x=[];w=w.split(",");for(var y=0,z=3;y<z;y++){var A=parseInt(w[y]||"1",10);x.push(A)}var B="scaytButton";s.addMenuGroup(B);var C={};C.scaytToggle={label:s.lang.scayt.enable,command:l,group:B};
if(x[0]==1){C.scaytOptions={label:s.lang.scayt.options,group:B,onClick:function(){m="options";s.openDialog(l)}}}if(x[1]==1){C.scaytLangs={label:s.lang.scayt.langs,group:B,onClick:function(){m="langs";s.openDialog(l)
}}}if(x[2]==1){C.scaytDict={label:s.lang.scayt.dictionariesTab,group:B,onClick:function(){m="dictionaries";s.openDialog(l)}}}C.scaytAbout={label:s.lang.scayt.about,group:B,onClick:function(){m="about";
s.openDialog(l)}};x[3]=1;p.uiTabs=x;s.addMenuItems(C);s.ui.add("Scayt",5,{label:s.lang.scayt.title,title:b.opera?s.lang.scayt.opera_title:s.lang.scayt.title,className:"cke_button_scayt",onRender:function(){v.on("state",function(){this.setState(v.state)
},this)},onMenu:function(){var E=p.isScaytEnabled(s);s.getMenuItem("scaytToggle").label=s.lang.scayt[E?"disable":"enable"];return{scaytToggle:2,scaytOptions:E&&p.uiTabs[0]?2:0,scaytLangs:E&&p.uiTabs[1]?2:0,scaytDict:E&&p.uiTabs[2]?2:0,scaytAbout:E&&p.uiTabs[3]?2:0}
}});if(s.contextMenu&&s.addMenuItems){s.contextMenu.addListener(function(){if(!p.isScaytEnabled(s)){return null}var E=p.getScayt(s),F=E.getScaytNode();if(!F){return null}var G=E.getWord(F);if(!G){return null
}var H=E.getLang(),I={},J=window.scayt.getSuggestion(G,H);if(!J||!J.length){return null}for(y in t){delete s._.menuItems[y];delete s._.commands[y]}for(y in u){delete s._.menuItems[y];delete s._.commands[y]
}t={};u={};var K=s.config.scayt_moreSuggestions||"on",L=false,M=s.config.scayt_maxSuggestions;typeof M!="number"&&(M=5);!M&&(M=J.length);var N=s.config.scayt_contextCommands||"all";N=N.split("|");for(var O=0,P=J.length;
O<P;O+=1){var Q="scayt_suggestion_"+J[O].replace(" ","_"),R=(function(V,W){return{exec:function(){E.replace(V,W)}}})(F,J[O]);if(O<M){q(s,"button_"+Q,J[O],Q,R,"scayt_suggest",O+1);I[Q]=2;u[Q]=2}else{if(K=="on"){q(s,"button_"+Q,J[O],Q,R,"scayt_moresuggest",O+1);
t[Q]=2;L=true}}}if(L){s.addMenuItem("scayt_moresuggest",{label:s.lang.scayt.moreSuggestions,group:"scayt_moresuggest",order:10,getItems:function(){return t}});u.scayt_moresuggest=2}if(n("all",N)||n("ignore",N)){var S={exec:function(){E.ignore(F)
}};q(s,"ignore",s.lang.scayt.ignore,"scayt_ignore",S,"scayt_control",1);u.scayt_ignore=2}if(n("all",N)||n("ignoreall",N)){var T={exec:function(){E.ignoreAll(F)}};q(s,"ignore_all",s.lang.scayt.ignoreAll,"scayt_ignore_all",T,"scayt_control",2);
u.scayt_ignore_all=2}if(n("all",N)||n("add",N)){var U={exec:function(){window.scayt.addWordToUserDictionary(F)}};q(s,"add_word",s.lang.scayt.addWord,"scayt_add_word",U,"scayt_control",3);u.scayt_add_word=2
}if(E.fireOnContextMenu){E.fireOnContextMenu(s)}return u})}var D=function(){s.removeListener("showScaytState",D);if(!b.opera){v.setState(p.isScaytEnabled(s)?1:2)}else{v.setState(0)}};s.on("showScaytState",D);
if(b.opera){s.on("instanceReady",function(){D()})}if(s.config.scayt_autoStartup){s.on("instanceReady",function(){p.loadEngine(s)})}},afterInit:function(s){var t,u=function(v){if(v.hasAttribute("scaytid")){return false
}};if(s._.elementsPath&&(t=s._.elementsPath.filters)){t.push(u)}s.addRemoveFormatFilter&&s.addRemoveFormatFilter(u)}})})();j.add("smiley",{requires:["dialog"],init:function(l){l.config.smiley_path=l.config.smiley_path||this.path+"images/";
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_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=["smiley","sad","wink","laugh","frown","cheeky","blush","surprise","indecision","angry","angel","cool","devil","crying","enlightened","no","yes","heart","broken heart","kiss","mail"];
(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;(function(){var l="cke_show_border",m,n=(b.ie6Compat?[".%1 table.%2,",".%1 table.%2 td, .%1 table.%2 th,","{","border : #d3d3d3 1px dotted","}"]:[".%1 table.%2,",".%1 table.%2 > tr > td, .%1 table.%2 > tr > th,",".%1 table.%2 > tbody > tr > td, .%1 table.%2 > tbody > tr > th,",".%1 table.%2 > thead > tr > td, .%1 table.%2 > thead > tr > th,",".%1 table.%2 > tfoot > tr > td, .%1 table.%2 > tfoot > tr > th","{","border : #d3d3d3 1px dotted","}"]).join("");
m=n.replace(/%2/g,l).replace(/%1/g,"cke_show_borders ");var 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_borders")}};j.add("showborders",{requires:["wysiwygarea"],modes:{wysiwyg:1},init:function(p){var q=p.addCommand("showborders",o);q.canUndo=false;if(p.config.startupShowBorders!==false){q.setState(1)
}p.addCss(m);p.on("mode",function(){if(q.state!=0){q.refresh(p)}},null,null,100);p.on("contentDom",function(){if(q.state!=0){q.refresh(p)}});p.on("removeFormatCleanup",function(r){var s=r.data;if(p.getCommand("showborders").state==1&&s.is("table")&&(!s.hasAttribute("border")||parseInt(s.getAttribute("border"),10)<=0)){s.addClass(l)
}})},afterInit:function(p){var q=p.dataProcessor,r=q&&q.dataFilter,s=q&&q.htmlFilter;if(r){r.addRules({elements:{table:function(t){var u=t.attributes,v=u["class"],w=parseInt(u.border,10);if(!w||w<=0){u["class"]=(v||"")+" "+l
}}}})}if(s){s.addRules({elements:{table:function(t){var u=t.attributes,v=u["class"];v&&(u["class"]=v.replace(l,"").replace(/\s{2}/," ").replace(/^\s+|\s+$/,""))}}})}}});a.on("dialogDefinition",function(p){var q=p.data.name;
if(q=="table"||q=="tableProperties"){var r=p.data.definition,s=r.getContents("info"),t=s.get("txtBorder"),u=t.commit;t.commit=e.override(u,function(v){return function(w,x){v.apply(this,arguments);var y=parseInt(this.getValue(),10);
x[!y||y<=0?"addClass":"removeClass"](l)}})}})})();j.add("sourcearea",{requires:["editingblock"],init:function(l){var m=j.sourcearea,n=a.document.getWindow();l.on("editingBlockReady",function(){var o,p;
l.addMode("source",{load:function(q,r){if(c&&b.version<8){q.setStyle("position","relative")}l.textarea=o=new h("textarea");o.setAttributes({dir:"ltr",tabIndex:b.webkit?-1:l.tabIndex,role:"textbox","aria-label":l.lang.editorTitle.replace("%1",l.name)});
o.addClass("cke_source");o.addClass("cke_enable_context_menu");var s={width:b.ie7Compat?"99%":"100%",height:"100%",resize:"none",outline:"none","text-align":"left"};if(c){p=function(){o.hide();o.setStyle("height",q.$.clientHeight+"px");
o.setStyle("width",q.$.clientWidth+"px");o.show()};l.on("resize",p);n.on("resize",p);setTimeout(p,0)}else{o.on("mousedown",function(u){u.data.stopPropagation()})}q.setHtml("");q.append(o);o.setStyles(s);
l.fire("ariaWidget",o);o.on("blur",function(){l.focusManager.blur()});o.on("focus",function(){l.focusManager.focus()});l.mayBeDirty=true;this.loadData(r);var t=l.keystrokeHandler;if(t){t.attach(o)}setTimeout(function(){l.mode="source";
l.fire("mode")},b.gecko||b.webkit?100:0)},loadData:function(q){o.setValue(q);l.fire("dataReady")},getData:function(){return o.getValue()},getSnapshotData:function(){return o.getValue()},unload:function(q){o.clearCustomData();
l.textarea=o=null;if(p){l.removeListener("resize",p);n.removeListener("resize",p)}if(c&&b.version<8){q.removeStyle("position")}},focus:function(){o.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},editorFocus:false,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(m){var n=m.config,o=m.lang.stylesCombo,p={},q=[];
function r(s){m.getStylesSet(function(t){if(!q.length){var u,v;for(var w=0;w<t.length;w++){var x=t[w];v=x.name;u=p[v]=new a.style(x);u._name=v;u._.enterMode=n.enterMode;q.push(u)}q.sort(l)}s&&s()})}m.ui.addRichCombo("Styles",{label:o.label,title:o.panelTitle,className:"cke_styles",panel:{css:m.skin.editor.css.concat(n.contentsCss),multiSelect:true,attributes:{"aria-label":o.panelTitle}},init:function(){var s=this;
r(function(){var t,u,v;for(var w=0;w<q.length;w++){t=q[w];u=t._name;var x=t.type;if(x!=v){s.startGroup(o["panelTitle"+String(x)]);v=x}s.add(u,t.type==3?u:t.buildPreview(),u)}s.commit();s.onOpen()})},onClick:function(s){m.focus();
m.fire("saveSnapshot");var t=p[s],u=m.getSelection(),v=new d.elementPath(u.getStartElement());if(t.type==2&&t.checkActive(v)){t.remove(m.document)}else{t.apply(m.document)}m.fire("saveSnapshot")},onRender:function(){m.on("selectionChange",function(s){var t=this.getValue(),u=s.data.path,v=u.elements;
for(var w=0,x;w<v.length;w++){x=v[w];for(var y in p){if(p[y].checkElementRemovable(x,true)){if(y!=t){this.setValue(y)}return}}}this.setValue("")},this)},onOpen:function(){var z=this;if(c||b.webkit){m.focus()
}var s=m.getSelection(),t=s.getSelectedElement(),u=new d.elementPath(t||s.getStartElement()),v=[0,0,0,0];z.showAll();z.unmarkAll();for(var w in p){var x=p[w],y=x.type;if(x.checkActive(u)){z.mark(w)}else{if(y==3&&!x.checkApplicable(u)){z.hideItem(w);
v[y]--}}v[y]++}if(!v[1]){z.hideGroup(o["panelTitle"+String(1)])}if(!v[2]){z.hideGroup(o["panelTitle"+String(2)])}if(!v[3]){z.hideGroup(o["panelTitle"+String(3)])}}});m.on("instanceReady",function(){r()
})}});function l(m,n){var o=m.type,p=n.type;return o==p?0:o==3?-1:p==3?1:p==1?1:-1}})();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}})
}l.on("doubleclick",function(o){var p=o.data.element;if(p.is("table")){o.data.dialog="tableProperties"}});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(G,H){if(c){G.removeAttribute(H)}else{delete G[H]}}var m=/^(?:td|th)$/;function n(G){var H=G.createBookmarks(),I=G.getRanges(),J=[],K={};
function L(T){if(J.length>0){return}if(T.type==1&&m.test(T.getName())&&!T.getCustomData("selected_cell")){h.setMarker(K,T,"selected_cell",true);J.push(T)}}for(var M=0;M<I.length;M++){var N=I[M];if(N.collapsed){var O=N.getCommonAncestor(),P=O.getAscendant("td",true)||O.getAscendant("th",true);
if(P){J.push(P)}}else{var Q=new d.walker(N),R;Q.guard=L;while(R=Q.next()){var S=R.getParent();if(S&&m.test(S.getName())&&!S.getCustomData("selected_cell")){h.setMarker(K,S,"selected_cell",true);J.push(S)
}}}}h.clearAllMarkers(K);G.selectBookmarks(H);return J}function o(G){var H=0,I=G.length-1,J={},K,L,M;while(K=G[H++]){h.setMarker(J,K,"delete_cell",true)}H=0;while(K=G[H++]){if((L=K.getPrevious())&&!L.getCustomData("delete_cell")||(L=K.getNext())&&!L.getCustomData("delete_cell")){h.clearAllMarkers(J);
return L}}h.clearAllMarkers(J);M=G[0].getParent();if(M=M.getPrevious()){return M.getLast()}M=G[I].getParent();if(M=M.getNext()){return M.getChild(0)}return null}function p(G){var H=G.cells;for(var I=0;
I<H.length;I++){H[I].innerHTML="";if(!c){new h(H[I]).appendBogus()}}}function q(G,H){var I=G.getStartElement().getAscendant("tr");if(!I){return}var J=I.clone(true);J.insertBefore(I);p(H?J.$:I.$)}function r(G){if(G instanceof d.selection){var H=n(G),I=H.length,J=[],K,L,M;
for(var N=0;N<I;N++){var O=H[N].getParent(),P=O.$.rowIndex;!N&&(L=P-1);J[P]=O;N==I-1&&(M=P+1)}var Q=O.getAscendant("table"),R=Q.$.rows,S=R.length;K=new h(M<S&&Q.$.rows[M]||L>0&&Q.$.rows[L]||Q.$.parentNode);
for(N=J.length;N>=0;N--){if(J[N]){r(J[N])}}return K}else{if(G instanceof h){Q=G.getAscendant("table");if(Q.$.rows.length==1){Q.remove()}else{G.remove()}}}return 0}function s(G,H){var I=G.getStartElement(),J=I.getAscendant("td",true)||I.getAscendant("th",true);
if(!J){return}var K=J.getAscendant("table"),L=J.$.cellIndex;for(var M=0;M<K.$.rows.length;M++){var N=K.$.rows[M];if(N.cells.length<L+1){continue}J=new h(N.cells[L]).clone(false);if(!c){J.appendBogus()}var O=new h(N.cells[L]);
if(H){J.insertBefore(O)}else{J.insertAfter(O)}}}function t(G){var H=[],I=G[0]&&G[0].getAscendant("table"),J,K,L,M;for(J=0,K=G.length;J<K;J++){H.push(G[J].$.cellIndex)}H.sort();for(J=1,K=H.length;J<K;J++){if(H[J]-H[J-1]>1){L=H[J-1]+1;
break}}if(!L){L=H[0]>0?H[0]-1:H[H.length-1]+1}var N=I.$.rows;for(J=0,K=N.length;J<K;J++){M=N[J].cells[L];if(M){break}}return M?new h(M):I.getPrevious()}function u(G){if(G instanceof d.selection){var H=n(G),I=t(H);
for(var J=H.length-1;J>=0;J--){if(H[J]){u(H[J])}}return I}else{if(G instanceof h){var K=G.getAscendant("table");if(!K){return null}var L=G.$.cellIndex;for(J=K.$.rows.length-1;J>=0;J--){var M=new h(K.$.rows[J]);
if(!L&&M.$.cells.length==1){r(M);continue}if(M.$.cells[L]){M.$.removeChild(M.$.cells[L])}}}}return null}function v(G,H){var I=G.getStartElement(),J=I.getAscendant("td",true)||I.getAscendant("th",true);
if(!J){return}var K=J.clone();if(!c){K.appendBogus()}if(H){K.insertBefore(J)}else{K.insertAfter(J)}}function w(G){if(G instanceof d.selection){var H=n(G),I=H[0]&&H[0].getAscendant("table"),J=o(H);for(var K=H.length-1;
K>=0;K--){w(H[K])}if(J){y(J,true)}else{if(I){I.remove()}}}else{if(G instanceof h){var L=G.getParent();if(L.getChildCount()==1){L.remove()}else{G.remove()}}}}function x(G){var H=G.getBogus();H&&H.remove();
G.trim()}function y(G,H){var I=new d.range(G.getDocument());if(!I["moveToElementEdit"+(H?"End":"Start")](G)){I.selectNodeContents(G);I.collapse(H?false:true)}I.select(true)}function z(G){var H=G.$.rows,I=-1,J=[];
for(var K=0;K<H.length;K++){I++;!J[I]&&(J[I]=[]);var L=-1;for(var M=0;M<H[K].cells.length;M++){var N=H[K].cells[M];L++;while(J[I][L]){L++}var O=isNaN(N.colSpan)?1:N.colSpan,P=isNaN(N.rowSpan)?1:N.rowSpan;
for(var Q=0;Q<P;Q++){if(!J[I+Q]){J[I+Q]=[]}for(var R=0;R<O;R++){J[I+Q][L+R]=H[K].cells[M]}}L+=O-1}}return J}function A(G,H,I){var J=G[H];if(typeof I=="undefined"){return J}for(var K=0;J&&K<J.length;K++){if(I.is&&J[K]==I.$){return K
}else{if(K==I){return new h(J[K])}}}return I.is?-1:null}function B(G,H,I){var J=[];for(var K=0;K<G.length;K++){var L=G[K];if(typeof I=="undefined"){J.push(L[H])}else{if(I.is&&L[H]==I.$){return K}else{if(K==I){return new h(L[H])
}}}}return typeof I=="undefined"?J:I.is?-1:null}function C(G,H,I){var J=n(G),K;if((H?J.length!=1:J.length<2)||(K=G.getCommonAncestor())&&K.type==1&&K.is("table")){return false}var L,M=J[0],N=M.getAscendant("table"),O=z(N),P=O.length,Q=O[0].length,R=M.getParent().$.rowIndex,S=A(O,R,M);
if(H){var T;try{T=O[H=="up"?R-1:H=="down"?R+1:R][H=="left"?S-1:H=="right"?S+1:S]}catch(al){return false}if(!T||M.$==T){return false}J[H=="up"||H=="left"?"unshift":"push"](new h(T))}var U=M.getDocument(),V=R,W=0,X=0,Y=!I&&new d.documentFragment(U),Z=0;
for(var aa=0;aa<J.length;aa++){L=J[aa];var ab=L.getParent(),ac=L.getFirst(),ad=L.$.colSpan,ae=L.$.rowSpan,af=ab.$.rowIndex,ag=A(O,af,L);Z+=ad*ae;X=Math.max(X,ag-S+ad);W=Math.max(W,af-R+ae);if(!I){if(x(L),L.getChildren().count()){if(af!=V&&ac&&!(ac.isBlockBoundary&&ac.isBlockBoundary({br:1}))){var ah=Y.getLast(d.walker.whitespaces(true));
if(ah&&!(ah.is&&ah.is("br"))){Y.append(new h("br"))}}L.moveChildren(Y)}aa?L.remove():L.setHtml("")}V=af}if(!I){Y.moveChildren(M);if(!c){M.appendBogus()}if(X>=Q){M.removeAttribute("rowSpan")}else{M.$.rowSpan=W
}if(W>=P){M.removeAttribute("colSpan")}else{M.$.colSpan=X}var ai=new d.nodeList(N.$.rows),aj=ai.count();for(aa=aj-1;aa>=0;aa--){var ak=ai.getItem(aa);if(!ak.$.cells.length){ak.remove();aj++;continue}}return M
}else{return W*X==Z}}function D(G,H){var I=n(G);if(I.length>1){return false}else{if(H){return true}}var J=I[0],K=J.getParent(),L=K.getAscendant("table"),M=z(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.rowSpan,Q,R,S,T;
if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2);T=N+R;var U=new h(L.$.rows[T]),V=A(M,T),W;Q=J.clone();for(var X=0;X<V.length;X++){W=V[X];if(W.parentNode==U.$&&X>O){Q.insertBefore(new h(W));break}else{W=null
}}if(!W){U.append(Q,true)}}else{S=R=1;U=K.clone();U.insertAfter(K);U.append(Q=J.clone());var Y=A(M,N);for(var Z=0;Z<Y.length;Z++){Y[Z].rowSpan++}}if(!c){Q.appendBogus()}J.$.rowSpan=R;Q.$.rowSpan=S;if(R==1){J.removeAttribute("rowSpan")
}if(S==1){Q.removeAttribute("rowSpan")}return Q}function E(G,H){var I=n(G);if(I.length>1){return false}else{if(H){return true}}var J=I[0],K=J.getParent(),L=K.getAscendant("table"),M=z(L),N=K.$.rowIndex,O=A(M,N,J),P=J.$.colSpan,Q,R,S;
if(P>1){R=Math.ceil(P/2);S=Math.floor(P/2)}else{S=R=1;var T=B(M,O);for(var U=0;U<T.length;U++){T[U].colSpan++}}Q=J.clone();Q.insertAfter(J);if(!c){Q.appendBogus()}J.$.colSpan=R;Q.$.colSpan=S;if(R==1){J.removeAttribute("colSpan")
}if(S==1){Q.removeAttribute("colSpan")}return Q}var F={thead:1,tbody:1,tfoot:1,td:1,tr:1,th:1};j.tabletools={init:function(G){var H=G.lang.table;G.addCommand("cellProperties",new a.dialogCommand("cellProperties"));
a.dialog.add("cellProperties",this.path+"dialogs/tableCell.js");G.addCommand("tableDelete",{exec:function(I){var J=I.getSelection(),K=J&&J.getStartElement(),L=K&&K.getAscendant("table",true);if(!L){return
}J.selectElement(L);var M=J.getRanges()[0];M.collapse();J.selectRanges([M]);var N=L.getParent();if(N.getChildCount()==1&&N.getName()!="body"){N.remove()}else{L.remove()}}});G.addCommand("rowDelete",{exec:function(I){var J=I.getSelection();
y(r(J))}});G.addCommand("rowInsertBefore",{exec:function(I){var J=I.getSelection();q(J,true)}});G.addCommand("rowInsertAfter",{exec:function(I){var J=I.getSelection();q(J)}});G.addCommand("columnDelete",{exec:function(I){var J=I.getSelection(),K=u(J);
K&&y(K,true)}});G.addCommand("columnInsertBefore",{exec:function(I){var J=I.getSelection();s(J,true)}});G.addCommand("columnInsertAfter",{exec:function(I){var J=I.getSelection();s(J)}});G.addCommand("cellDelete",{exec:function(I){var J=I.getSelection();
w(J)}});G.addCommand("cellMerge",{exec:function(I){y(C(I.getSelection()),true)}});G.addCommand("cellMergeRight",{exec:function(I){y(C(I.getSelection(),"right"),true)}});G.addCommand("cellMergeDown",{exec:function(I){y(C(I.getSelection(),"down"),true)
}});G.addCommand("cellVerticalSplit",{exec:function(I){y(D(I.getSelection()))}});G.addCommand("cellHorizontalSplit",{exec:function(I){y(E(I.getSelection()))}});G.addCommand("cellInsertBefore",{exec:function(I){var J=I.getSelection();
v(J,true)}});G.addCommand("cellInsertAfter",{exec:function(I){var J=I.getSelection();v(J)}});if(G.addMenuItems){G.addMenuItems({tablecell:{label:H.cell.menu,group:"tablecell",order:1,getItems:function(){var I=G.getSelection(),J=n(I);
return{tablecell_insertBefore:2,tablecell_insertAfter:2,tablecell_delete:2,tablecell_merge:C(I,null,true)?2:0,tablecell_merge_right:C(I,"right",true)?2:0,tablecell_merge_down:C(I,"down",true)?2:0,tablecell_split_vertical:D(I,true)?2:0,tablecell_split_horizontal:E(I,true)?2:0,tablecell_properties:J.length>0?2:0}
}},tablecell_insertBefore:{label:H.cell.insertBefore,group:"tablecell",command:"cellInsertBefore",order:5},tablecell_insertAfter:{label:H.cell.insertAfter,group:"tablecell",command:"cellInsertAfter",order:10},tablecell_delete:{label:H.cell.deleteCell,group:"tablecell",command:"cellDelete",order:15},tablecell_merge:{label:H.cell.merge,group:"tablecell",command:"cellMerge",order:16},tablecell_merge_right:{label:H.cell.mergeRight,group:"tablecell",command:"cellMergeRight",order:17},tablecell_merge_down:{label:H.cell.mergeDown,group:"tablecell",command:"cellMergeDown",order:18},tablecell_split_horizontal:{label:H.cell.splitHorizontal,group:"tablecell",command:"cellHorizontalSplit",order:19},tablecell_split_vertical:{label:H.cell.splitVertical,group:"tablecell",command:"cellVerticalSplit",order:20},tablecell_properties:{label:H.cell.title,group:"tablecellproperties",command:"cellProperties",order:21},tablerow:{label:H.row.menu,group:"tablerow",order:1,getItems:function(){return{tablerow_insertBefore:2,tablerow_insertAfter:2,tablerow_delete:2}
}},tablerow_insertBefore:{label:H.row.insertBefore,group:"tablerow",command:"rowInsertBefore",order:5},tablerow_insertAfter:{label:H.row.insertAfter,group:"tablerow",command:"rowInsertAfter",order:10},tablerow_delete:{label:H.row.deleteRow,group:"tablerow",command:"rowDelete",order:15},tablecolumn:{label:H.column.menu,group:"tablecolumn",order:1,getItems:function(){return{tablecolumn_insertBefore:2,tablecolumn_insertAfter:2,tablecolumn_delete:2}
}},tablecolumn_insertBefore:{label:H.column.insertBefore,group:"tablecolumn",command:"columnInsertBefore",order:5},tablecolumn_insertAfter:{label:H.column.insertAfter,group:"tablecolumn",command:"columnInsertAfter",order:10},tablecolumn_delete:{label:H.column.deleteColumn,group:"tablecolumn",command:"columnDelete",order:15}})
}if(G.contextMenu){G.contextMenu.addListener(function(I,J){if(!I){return null}while(I){if(I.getName() in F){return{tablecell:2,tablerow:2,tablecolumn:2}}I=I.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={editorFocus:false,modes:{wysiwyg:1,source:1}},m={exec:function(o){o.container.focusNext(true,o.tabIndex)}},n={exec:function(o){o.container.focusPrevious(true,o.tabIndex)}};j.add("tab",{requires:["keystrokes"],init:function(o){var p=o.config.tabSpaces||0,q="";
while(p--){q+="\xa0"}if(q){o.on("key",function(r){if(r.data.keyCode==9){o.insertHtml(q);r.cancel()}})}if(b.webkit||b.gecko){o.on("key",function(r){var s=r.data.keyCode;if(s==9&&!q){r.cancel();o.execCommand("blur")
}if(s==2000+9){o.execCommand("blurBack");r.cancel()}})}o.addCommand("blur",e.extend(m,l));o.addCommand("blurBack",e.extend(n,l))}})})();h.prototype.focusNext=function(l,m){var v=this;var n=v.$,o=m===undefined?v.getTabIndex():m,p,q,r,s,t,u;
if(o<=0){t=v.getNextSourceNode(l,1);while(t){if(t.isVisible()&&t.getTabIndex()===0){r=t;break}t=t.getNextSourceNode(false,1)}}else{t=v.getDocument().getBody().getFirst();while(t=t.getNextSourceNode(false,1)){if(!p){if(!q&&t.equals(v)){q=true;
if(l){if(!(t=t.getNextSourceNode(true,1))){break}p=1}}else{if(q&&!v.contains(t)){p=1}}}if(!t.isVisible()||(u=t.getTabIndex())<0){continue}if(p&&u==o){r=t;break}if(u>o&&(!r||!s||u<s)){r=t;s=u}else{if(!r&&u===0){r=t;
s=u}}}}if(r){r.focus()}};h.prototype.focusPrevious=function(l,m){var v=this;var n=v.$,o=m===undefined?v.getTabIndex():m,p,q,r,s=0,t,u=v.getDocument().getBody().getLast();while(u=u.getPreviousSourceNode(false,1)){if(!p){if(!q&&u.equals(v)){q=true;
if(l){if(!(u=u.getPreviousSourceNode(true,1))){break}p=1}}else{if(q&&!v.contains(u)){p=1}}}if(!u.isVisible()||(t=u.getTabIndex())<0){continue}if(o<=0){if(p&&t===0){r=u;break}if(t>s){r=u;s=t}}else{if(p&&t==o){r=u;
break}if(t<o&&(!r||t>s)){r=u;s=t}}}if(r){r.focus()}};(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){var r,s,t,u=n.lang.dir=="rtl";switch(q){case u?37:39:case 9:do{r=p.next;if(!r){s=p.toolbar.next;t=s&&s.items.length;while(t===0){s=s.next;
t=s&&s.items.length}if(s){r=s.items[0]}}p=r}while(p&&!p.focus);if(p){p.focus()}else{n.toolbox.focus()}return false;case u?39:37:case 2000+9:do{r=p.previous;if(!r){s=p.toolbar.previous;t=s&&s.items.length;
while(t===0){s=s.previous;t=s&&s.items.length}if(s){r=s.items[t-1]}}p=r}while(p&&!p.focus);if(p){p.focus()}else{var v=n.toolbox.toolbars[n.toolbox.toolbars.length-1].items;v[v.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="cke_"+e.getNextNumber(),r=['<div class="cke_toolbox" role="toolbar" aria-labelledby="',q,'"'],s=n.config.toolbarStartupExpanded!==false,t;
r.push(s?">":' style="display:none">');r.push('<span id="',q,'" class="cke_voice_label">',n.lang.toolbar,"</span>");var u=n.toolbox.toolbars,v=n.config.toolbar instanceof Array?n.config.toolbar:n.config["toolbar_"+n.config.toolbar];
for(var w=0;w<v.length;w++){var x=v[w];if(!x){continue}var y="cke_"+e.getNextNumber(),z={id:y,items:[]};if(t){r.push("</div>");t=0}if(x==="/"){r.push('<div class="cke_break"></div>');continue}r.push('<span id="',y,'" class="cke_toolbar" role="presentation"><span class="cke_toolbar_start"></span>');
var A=u.push(z)-1;if(A>0){z.previous=u[A-1];z.previous.next=z}for(var B=0;B<x.length;B++){var C,D=x[B];if(D=="-"){C=k.separator}else{C=n.ui.create(D)}if(C){if(C.canGroup){if(!t){r.push('<span class="cke_toolgroup" role="presentation">');
t=1}}else{if(t){r.push("</span>");t=0}}var E=C.render(n,r);A=z.items.push(E)-1;if(A>0){E.previous=z.items[A-1];E.previous.next=E}E.toolbar=z;E.onkey=o;E.onfocus=function(){if(!n.toolbox.focusCommandExecuted){n.focus()
}}}}if(t){r.push("</span>");t=0}r.push('<span class="cke_toolbar_end"></span></span>')}r.push("</div>");if(n.config.toolbarCanCollapse){var F=e.addFunction(function(){n.execCommand("toolbarCollapse")});
n.on("destroy",function(){e.removeFunction(F)});var G="cke_"+e.getNextNumber();n.addCommand("toolbarCollapse",{exec:function(H){var I=a.document.getById(G),J=I.getPrevious(),K=H.getThemeSpace("contents"),L=J.getParent(),M=parseInt(K.$.style.height,10),N=L.$.offsetHeight,O=!J.isVisible();
if(!O){J.hide();I.addClass("cke_toolbox_collapser_min");I.setAttribute("title",H.lang.toolbarExpand)}else{J.show();I.removeClass("cke_toolbox_collapser_min");I.setAttribute("title",H.lang.toolbarCollapse)
}I.getFirst().setText(O?"▲":"◀");var P=L.$.offsetHeight-N;K.setStyle("height",M-P+"px");H.fire("resize")},modes:{wysiwyg:1,source:1}});r.push('<a title="'+(s?n.lang.toolbarCollapse:n.lang.toolbarExpand)+'" id="'+G+'" tabIndex="-1" class="cke_toolbox_collapser');
if(!s){r.push(" cke_toolbox_collapser_min")}r.push('" onclick="CKEDITOR.tools.callFunction('+F+')">',"<span>&#9650;</span>","</a>")}p.data.html+=r.join("")}});n.addCommand("toolbarFocus",m.toolbarFocus)
}})})();k.separator={render:function(l,m){m.push('<span class="cke_separator" role="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","CreateDiv"],["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;(function(){j.add("undo",{requires:["selection","wysiwygarea"],init:function(r){var s=new n(r),t=r.addCommand("undo",{exec:function(){if(s.undo()){r.selectionChange();
this.fire("afterUndo")}},state:0,canUndo:false}),u=r.addCommand("redo",{exec:function(){if(s.redo()){r.selectionChange();this.fire("afterRedo")}},state:0,canUndo:false});s.onChange=function(){t.setState(s.undoable()?2:0);
u.setState(s.redoable()?2:0)};function v(w){if(s.enabled&&w.data.command.canUndo!==false){s.save()}}r.on("beforeCommandExec",v);r.on("afterCommandExec",v);r.on("saveSnapshot",function(){s.save()});r.on("contentDom",function(){r.document.on("keydown",function(w){if(!w.data.$.ctrlKey&&!w.data.$.metaKey){s.type(w)
}})});r.on("beforeModeUnload",function(){r.mode=="wysiwyg"&&s.save(true)});r.on("mode",function(){s.enabled=r.mode=="wysiwyg";s.onChange()});r.ui.addButton("Undo",{label:r.lang.undo,command:"undo"});r.ui.addButton("Redo",{label:r.lang.redo,command:"redo"});
r.resetUndo=function(){s.reset();r.fire("saveSnapshot")};r.on("updateSnapshot",function(){if(s.currentImage&&new l(r).equals(s.currentImage)){setTimeout(function(){s.update()},0)}})}});j.undo={};var l=j.undo.Image=function(r){this.editor=r;
var s=r.getSnapshot(),t=s&&r.getSelection();c&&s&&(s=s.replace(/\s+_cke_expando=".*?"/g,""));this.contents=s;this.bookmarks=t&&t.createBookmarks2(true)},m=/\b(?:href|src|name)="[^"]*?"/gi;l.prototype={equals:function(r,s){var t=this.contents,u=r.contents;
if(c&&(b.ie7Compat||b.ie6Compat)){t=t.replace(m,"");u=u.replace(m,"")}if(t!=u){return false}if(s){return true}var v=this.bookmarks,w=r.bookmarks;if(v||w){if(!v||!w||v.length!=w.length){return false}for(var x=0;
x<v.length;x++){var y=v[x],z=w[x];if(y.startOffset!=z.startOffset||y.endOffset!=z.endOffset||!e.arrayCompare(y.start,z.start)||!e.arrayCompare(y.end,z.end)){return false}}}return true}};function n(r){this.editor=r;
this.reset()}var o={8:1,46:1},p={16:1,17:1,18:1},q={37:1,38:1,39:1,40:1};n.prototype={type:function(r){var s=r&&r.data.getKey(),t=s in p,u=s in o,v=this.lastKeystroke in o,w=u&&s==this.lastKeystroke,x=s in q,y=this.lastKeystroke in q,z=!u&&!x,A=u&&!w,B=!(t||this.typing)||z&&(v||y);
if(B||A){var C=new l(this.editor);e.setTimeout(function(){var E=this;var D=E.editor.getSnapshot();if(c){D=D.replace(/\s+_cke_expando=".*?"/g,"")}if(C.contents!=D){E.typing=true;if(!E.save(false,C,false)){E.snapshots.splice(E.index+1,E.snapshots.length-E.index-1)
}E.hasUndo=true;E.hasRedo=false;E.typesCount=1;E.modifiersCount=1;E.onChange()}},0,this)}this.lastKeystroke=s;if(u){this.typesCount=0;this.modifiersCount++;if(this.modifiersCount>25){this.save(false,null,false);
this.modifiersCount=1}}else{if(!x){this.modifiersCount=0;this.typesCount++;if(this.typesCount>25){this.save(false,null,false);this.typesCount=1}}}},reset:function(){var r=this;r.lastKeystroke=0;r.snapshots=[];
r.index=-1;r.limit=r.editor.config.undoStackSize;r.currentImage=null;r.hasUndo=false;r.hasRedo=false;r.resetType()},resetType:function(){var r=this;r.typing=false;delete r.lastKeystroke;r.typesCount=0;
r.modifiersCount=0},fireChange:function(){var r=this;r.hasUndo=!!r.getNextImage(true);r.hasRedo=!!r.getNextImage(false);r.resetType();r.onChange()},save:function(r,s,t){var v=this;var u=v.snapshots;if(!s){s=new l(v.editor)
}if(s.contents===false){return false}if(v.currentImage&&s.equals(v.currentImage,r)){return false}u.splice(v.index+1,u.length-v.index-1);if(u.length==v.limit){u.shift()}v.index=u.push(s)-1;v.currentImage=s;
if(t!==false){v.fireChange()}return true},restoreImage:function(r){var t=this;t.editor.loadSnapshot(r.contents);if(r.bookmarks){t.editor.getSelection().selectBookmarks(r.bookmarks)}else{if(c){var s=t.editor.document.getBody().$.createTextRange();
s.collapse(true);s.select()}}t.index=r.index;t.update();t.fireChange()},getNextImage:function(r){var w=this;var s=w.snapshots,t=w.currentImage,u,v;if(t){if(r){for(v=w.index-1;v>=0;v--){u=s[v];if(!t.equals(u,true)){u.index=v;
return u}}}else{for(v=w.index+1;v<s.length;v++){u=s[v];if(!t.equals(u,true)){u.index=v;return u}}}}return null},redoable:function(){return this.enabled&&this.hasRedo},undoable:function(){return this.enabled&&this.hasUndo
},undo:function(){var s=this;if(s.undoable()){s.save(true);var r=s.getNextImage(true);if(r){return s.restoreImage(r),true}}return false},redo:function(){var s=this;if(s.redoable()){s.save(true);if(s.redoable()){var r=s.getNextImage(false);
if(r){return s.restoreImage(r),true}}}return false},update:function(){var r=this;r.snapshots.splice(r.index,1,r.currentImage=new l(r.editor))}}})();i.undoStackSize=20;(function(){var l={table:1,pre:1},m=/\s*<(p|div|address|h\d|center|li)[^>]*>\s*(?:<br[^>]*>|&nbsp;|\u00A0|&#160;)?\s*(:?<\/\1>)?\s*(?=$|<\/body>)/gi,n=d.walker.whitespaces(true);
function o(z){if(this.mode=="wysiwyg"){this.focus();this.fire("saveSnapshot");var A=this.getSelection(),B=z.data;if(this.dataProcessor){B=this.dataProcessor.toHtml(B)}if(c){var C=A.isLocked;if(C){A.unlock()
}var D=A.getNative();if(D.type=="Control"){D.clear()}D.createRange().pasteHTML(B);if(C){this.getSelection().lock()}}else{this.document.$.execCommand("inserthtml",false,B)}if(b.webkit){this.document.$.execCommand("inserthtml",false,'<span id="cke_paste_marker" cke_temp="1"></span>');
var E=this.document.getById("cke_paste_marker");E.scrollIntoView();E.remove()}e.setTimeout(function(){this.fire("saveSnapshot")},0,this)}}function p(z){if(this.mode=="wysiwyg"){this.focus();this.fire("saveSnapshot");
var A=z.data,B=A.getName(),C=f.$block[B],D=this.getSelection(),E=D.getRanges(),F=D.isLocked;if(F){D.unlock()}var G,H,I,J;for(var K=E.length-1;K>=0;K--){G=E[K];G.deleteContents();H=!K&&A||A.clone(true);
var L,M;if(C){while((L=G.getCommonAncestor(false,true))&&(M=f[L.getName()])&&!(M&&M[B])){if(L.getName() in f.span){G.splitElement(L)}else{if(G.checkStartOfBlock()&&G.checkEndOfBlock()){G.setStartBefore(L);
G.collapse(true);L.remove()}else{G.splitBlock()}}}}G.insertNode(H);if(!I){I=H}}G.moveToPosition(I,4);if(C){var N=I.getNext(n),O=N&&N.type==1&&N.getName();if(O&&f.$block[O]&&f[O]["#"]){G.moveToElementEditStart(N)
}}D.selectRanges([G]);if(F){this.getSelection().lock()}e.setTimeout(function(){this.fire("saveSnapshot")},0,this)}}function q(z){if(!z.checkDirty()){setTimeout(function(){z.resetDirty()})}}var r=d.walker.whitespaces(true),s=d.walker.bookmark(false,true);
function t(z){return r(z)&&s(z)}function u(z){return z.type==3&&e.trim(z.getText()).match(/^(?:&nbsp;|\xa0)$/)}function v(z){if(z.isLocked){z.unlock();setTimeout(function(){z.lock()},0)}}function w(z){return z.getOuterHtml().match(m)
}r=d.walker.whitespaces(true);function x(z){var A=z.window,B=z.document,C=z.document.getBody(),D=C.getChildren().count();if(!D||D==1&&C.getFirst().hasAttribute("_moz_editor_bogus_node")){q(z);var E=B.$.createEvent("KeyEvents");
E.initKeyEvent("keypress",true,true,A.$,false,false,false,false,0,32);B.$.dispatchEvent(E);D&&C.getFirst().remove();B.getBody().appendBogus();var F=new d.range(B);F.setStartAt(C,1);F.select()}}function y(z){var A=z.editor,B=z.data.path,C=B.blockLimit,D=z.data.selection,E=D.getRanges()[0],F=A.document.getBody(),G=A.config.enterMode;
b.gecko&&x(A);if(G!=2&&E.collapsed&&C.getName()=="body"&&!B.block){A.fire("updateSnapshot");q(A);c&&v(D);var H=E.fixBlock(true,A.config.enterMode==3?"div":"p");if(c){var I=H.getFirst(t);I&&u(I)&&I.remove()
}if(w(H)){var J=H.getNext(r);if(J&&J.type==1&&!l[J.getName()]){E.moveToElementEditStart(J);H.remove()}else{J=H.getPrevious(r);if(J&&J.type==1&&!l[J.getName()]){E.moveToElementEditEnd(J);H.remove()}}}E.select();
if(!c){A.selectionChange()}}var K=new d.range(A.document),L=new d.walker(K);K.selectNodeContents(F);L.evaluator=function(N){return N.type==1&&N.getName() in l};L.guard=function(N,O){return !(N.type==3&&r(N)||O)
};if(L.previous()){A.fire("updateSnapshot");q(A);c&&v(D);var M;if(G!=2){M=F.append(new h(G==1?"p":"div"))}else{M=F}if(!c){M.appendBogus()}}}j.add("wysiwygarea",{requires:["editingblock"],init:function(z){var A=z.config.enterMode!=2?z.config.enterMode==3?"div":"p":false,B=z.lang.editorTitle.replace("%1",z.name),C;
z.on("editingBlockReady",function(){var I,J,K,L,M,N,O=b.isCustomDomain(),P=function(S){if(J){J.remove()}var T="document.open();"+(O?'document.domain="'+document.domain+'";':"")+"document.close();";J=h.createFromHtml('<iframe style="width:100%;height:100%" frameBorder="0" title="'+B+'" src="'+(c?"javascript:void(function(){"+encodeURIComponent(T)+"}())":"")+'" tabIndex="'+(b.webkit?-1:z.tabIndex)+'" allowTransparency="true"></iframe>');
J.on("load",function(U){M=1;U.removeListener();var V=J.getFrameDocument().$;V.open("text/html","replace");V.write(S);V.close()});I.append(J)};C=e.addFunction(R);var Q='<script id="cke_actscrpt" type="text/javascript" cke_temp="1">'+(O?'document.domain="'+document.domain+'";':"")+"window.parent.CKEDITOR.tools.callFunction( "+C+", window );<\/script>";
function R(S){if(!M){return}M=0;z.fire("ariaWidget",J);var T=S.document,U=T.body,V=T.getElementById("cke_actscrpt");V.parentNode.removeChild(V);U.spellcheck=!z.config.disableNativeSpellChecker;if(c){U.hideFocus=true;
U.disabled=true;U.contentEditable=true;U.removeAttribute("disabled")}else{setTimeout(function(){if(b.gecko&&b.version>=10900||b.opera){T.$.body.contentEditable=true}else{if(b.webkit){T.$.body.parentNode.contentEditable=true
}else{T.$.designMode="on"}}},0)}b.gecko&&e.setTimeout(x,0,null,z);S=z.window=new d.window(S);T=z.document=new g(T);T.on("dblclick",function(Z){var aa=Z.data.getTarget(),ab={element:aa,dialog:""};z.fire("doubleclick",ab);
ab.dialog&&z.openDialog(ab.dialog)});if(!(c||b.opera)){T.on("mousedown",function(Z){var aa=Z.data.getTarget();if(aa.is("img","hr","input","textarea","select")){z.getSelection().selectElement(aa)}})}if(b.gecko){T.on("mouseup",function(Z){if(Z.data.$.button==2){var aa=Z.data.getTarget();
if(!aa.getOuterHtml().replace(m,"")){var ab=new d.range(T);ab.moveToElementEditStart(aa);ab.select(true)}}})}if(b.webkit){T.on("click",function(Z){if(Z.data.getTarget().is("input","select")){Z.data.preventDefault()
}});T.on("mouseup",function(Z){if(Z.data.getTarget().is("input","textarea")){Z.data.preventDefault()}})}if(c&&T.$.compatMode=="CSS1Compat"||b.gecko||b.opera){var W=T.getDocumentElement();W.on("mousedown",function(Z){if(Z.data.getTarget().equals(W)){if(b.gecko&&b.version>=10900){G()
}H.focus()}})}S.on("blur",function(){z.focusManager.blur()});S.on("focus",function(){var Z=z.document;if(b.gecko&&b.version>=10900){G()}else{if(b.opera){Z.getBody().focus()}}z.focusManager.focus()});var X=z.keystrokeHandler;
if(X){X.attach(T)}if(c){T.getDocumentElement().addClass(T.$.compatMode);T.on("keydown",function(Z){var aa=Z.data.getKeystroke();if(aa in {8:1,46:1}){var ab=z.getSelection(),ac=ab.getSelectedElement();if(ac){z.fire("saveSnapshot");
var ad=ab.getRanges()[0].createBookmark();ac.remove();ab.selectBookmarks([ad]);z.fire("saveSnapshot");Z.data.preventDefault()}}});if(T.$.compatMode=="CSS1Compat"){var Y={33:1,34:1};T.on("keydown",function(Z){if(Z.data.getKeystroke() in Y){setTimeout(function(){z.getSelection().scrollIntoView()
},0)}})}}if(z.contextMenu){z.contextMenu.addTarget(T,z.config.browserContextMenuOnCtrl!==false)}setTimeout(function(){z.fire("contentDom");if(N){z.mode="wysiwyg";z.fire("mode");N=false}K=false;if(L){z.focus();
L=false}setTimeout(function(){z.fire("dataReady")},0);try{z.document.$.execCommand("enableObjectResizing",false,!z.config.disableObjectResizing)}catch(Z){}try{z.document.$.execCommand("enableInlineTableEditing",false,!z.config.disableNativeTableHandles)
}catch(aa){}if(c){setTimeout(function(){if(z.document){var ab=z.document.$.body;ab.runtimeStyle.marginBottom="0px";ab.runtimeStyle.marginBottom=""}},1000)}},0)}z.addMode("wysiwyg",{load:function(S,T,U){I=S;
if(c&&b.quirks){S.setStyle("position","relative")}z.mayBeDirty=true;N=true;if(U){this.loadSnapshotData(T)}else{this.loadData(T)}},loadData:function(S){K=true;var T=z.config,U=T.fullPage,V=T.docType,W='<style type="text/css" cke_temp="1">'+z._.styles.join("\n")+"</style>";
!U&&(W=e.buildStyleHtml(z.config.contentsCss)+W);var X=T.baseHref?'<base href="'+T.baseHref+'" cke_temp="1" />':"";if(U){S=S.replace(/<!DOCTYPE[^>]*>/i,function(Y){z.docType=V=Y;return""})}if(z.dataProcessor){S=z.dataProcessor.toHtml(S,A)
}if(U){if(!/<body[\s|>]/.test(S)){S="<body>"+S}if(!/<html[\s|>]/.test(S)){S="<html>"+S+"</html>"}if(!/<head[\s|>]/.test(S)){S=S.replace(/<html[^>]*>/,"$&<head><title></title></head>")}else{if(!/<title[\s|>]/.test(S)){S=S.replace(/<head[^>]*>/,"$&<title></title>")
}}X&&(S=S.replace(/<head>/,"$&"+X));S=S.replace(/<\/head\s*>/,W+"$&");S=V+S}else{S=T.docType+'<html dir="'+T.contentsLangDirection+'" lang="'+(T.contentsLanguage||z.langCode)+'"><head><title>'+B+"</title>"+X+W+"</head><body"+(T.bodyId?' id="'+T.bodyId+'"':"")+(T.bodyClass?' class="'+T.bodyClass+'"':"")+">"+S+"</html>"
}S+=Q;this.onDispose();P(S)},getData:function(){var S=z.config,T=S.fullPage,U=T&&z.docType,V=J.getFrameDocument(),W=T?V.getDocumentElement().getOuterHtml():V.getBody().getHtml();if(z.dataProcessor){W=z.dataProcessor.toDataFormat(W,A)
}if(S.ignoreEmptyParagraph){W=W.replace(m,"")}if(U){W=U+"\n"+W}return W},getSnapshotData:function(){return J.getFrameDocument().getBody().getHtml()},loadSnapshotData:function(S){J.getFrameDocument().getBody().setHtml(S)
},onDispose:function(){if(!z.document){return}z.document.getDocumentElement().clearCustomData();z.document.getBody().clearCustomData();z.window.clearCustomData();z.document.clearCustomData();J.clearCustomData();
J.remove()},unload:function(S){this.onDispose();z.window=z.document=J=I=L=null;z.fire("contentDomUnload")},focus:function(){if(K){L=true}else{if(z.window){z.window.focus();z.selectionChange()}}}});z.on("insertHtml",o,null,null,20);
z.on("insertElement",p,null,null,20);z.on("selectionChange",y,null,null,1)});var D;z.on("contentDom",function(){var I=z.document.getElementsByTag("title").getItem(0);I.setAttribute("_cke_title",z.document.$.title);
z.document.$.title=B});if(b.ie8Compat){z.addCss("html.CSS1Compat [contenteditable=false]{ min-height:0 !important;}");var E=[];for(var F in f.$removeEmpty){E.push("html.CSS1Compat "+F+"[contenteditable=false]")
}z.addCss(E.join(",")+"{ display:inline-block;}")}function G(I){e.tryThese(function(){z.document.$.designMode="on";setTimeout(function(){z.document.$.designMode="off";z.document.getBody().focus()},50)},function(){z.document.$.designMode="off";
var J=z.document.getBody();J.setAttribute("contentEditable",false);J.setAttribute("contentEditable",true);!I&&G(1)})}if(b.gecko||c||b.opera){var H;z.on("uiReady",function(){H=z.container.append(h.createFromHtml('<span tabindex="-1" style="position:absolute; left:-10000" role="presentation"></span>'));
H.on("focus",function(){z.focus()})});z.on("destroy",function(){e.removeFunction(C);H.clearCustomData()})}z.on("insertElement",function(I){var J=I.data;if(J.type==1&&(J.is("input")||J.is("textarea"))){J.setAttribute("contentEditable",false)
}})}});if(b.gecko){(function(){var z=document.body;if(!z){window.addEventListener("load",arguments.callee,false)}else{var A=z.getAttribute("onpageshow");z.setAttribute("onpageshow",(A?A+";":"")+'event.persisted && (function(){var allInstances = CKEDITOR.instances, editor, doc;for ( var i in allInstances ){\teditor = allInstances[ i ];\tdoc = editor.document;\tif ( doc )\t{\t\tdoc.$.designMode = "off";\t\tdoc.$.designMode = "on";\t}}})();')
}})()}})();i.disableObjectResizing=false;i.disableNativeTableHandles=true;i.disableNativeSpellChecker=true;i.ignoreEmptyParagraph=true;j.add("wsc",{requires:["dialog"],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;a.DIALOG_RESIZE_NONE=0;a.DIALOG_RESIZE_WIDTH=1;a.DIALOG_RESIZE_HEIGHT=2;a.DIALOG_RESIZE_BOTH=3;(function(){function l(M){return !!this._.tabs[M][0].$.offsetHeight
}function m(){var Q=this;var M=Q._.currentTabId,N=Q._.tabIdList.length,O=e.indexOf(Q._.tabIdList,M)+N;for(var P=O-1;P>O-N;P--){if(l.call(Q,Q._.tabIdList[P%N])){return Q._.tabIdList[P%N]}}return null}function n(){var Q=this;
var M=Q._.currentTabId,N=Q._.tabIdList.length,O=e.indexOf(Q._.tabIdList,M);for(var P=O+1;P<O+N;P++){if(l.call(Q,Q._.tabIdList[P%N])){return Q._.tabIdList[P%N]}}return null}a.dialog=function(M,N){var O=a.dialog._.dialogDefinitions[N];
O=e.extend(O(M),p);O=e.clone(O);O=new t(this,O);var P=a.document,Q=M.theme.buildDialog(M);this._={editor:M,element:Q.element,name:N,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=Q.parts;e.setTimeout(function(){M.fire("ariaWidget",this.parts.contents)},0,this);this.parts.dialog.setStyles({position:b.ie6Compat?"absolute":"fixed",top:0,left:0,visibility:"hidden"});a.event.call(this);
this.definition=O=a.fire("dialogDefinition",{name:N,definition:O},M).definition;if(O.onLoad){this.on("load",O.onLoad)}if(O.onShow){this.on("show",O.onShow)}if(O.onHide){this.on("hide",O.onHide)}if(O.onOk){this.on("ok",function(ac){M.fire("saveSnapshot");
setTimeout(function(){M.fire("saveSnapshot")},0);if(O.onOk.call(this,ac)===false){ac.data.hide=false}})}if(O.onCancel){this.on("cancel",function(ac){if(O.onCancel.call(this,ac)===false){ac.data.hide=false
}})}var R=this,S=function(ac){var ad=R._.contents,ae=false;for(var af in ad){for(var ag in ad[af]){ae=ac.call(this,ad[af][ag]);if(ae){return}}}};this.on("ok",function(ac){S(function(ad){if(ad.validate){var ae=ad.validate(this);
if(typeof ae=="string"){alert(ae);ae=false}if(ae===false){if(ad.select){ad.select()}else{ad.focus()}ac.data.hide=false;ac.stop();return true}}})},this,null,0);this.on("cancel",function(ac){S(function(ad){if(ad.isChanged()){if(!confirm(M.lang.common.confirmCancel)){ac.data.hide=false
}return true}})},this,null,0);this.parts.close.on("click",function(ac){if(this.fire("cancel",{hide:true}).hide!==false){this.hide()}ac.data.preventDefault()},this);function T(){var ac=R._.focusList;ac.sort(function(af,ag){if(af.tabIndex!=ag.tabIndex){return ag.tabIndex-af.tabIndex
}else{return af.focusIndex-ag.focusIndex}});var ad=ac.length;for(var ae=0;ae<ad;ae++){ac[ae].focusIndex=ae}}function U(ac){var ad=R._.focusList,ae=ac?1:-1;if(ad.length<1){return}var af=R._.currentFocusIndex;
try{ad[af].getInputElement().$.blur()}catch(ai){}var ag=(af+ae+ad.length)%ad.length,ah=ag;while(!ad[ah].isFocusable()){ah=(ah+ae+ad.length)%ad.length;if(ah==ag){break}}ad[ah].focus();if(ad[ah].type=="text"){ad[ah].select()
}}this.changeFocus=U;var V;function W(ac){var ah=this;if(R!=a.dialog._.currentTop){return}var ad=ac.data.getKeystroke(),ae=M.lang.dir=="rtl";V=0;if(ad==9||ad==2000+9){var af=ad==2000+9;if(R._.tabBarMode){var ag=af?m.call(R):n.call(R);
R.selectPage(ag);R._.tabs[ag][0].focus()}else{U(!af)}V=1}else{if(ad==4000+121&&!R._.tabBarMode&&R.getPageCount()>1){R._.tabBarMode=true;R._.tabs[R._.currentTabId][0].focus();V=1}else{if((ad==37||ad==39)&&R._.tabBarMode){ag=ad==(ae?39:37)?m.call(R):n.call(R);
R.selectPage(ag);R._.tabs[ag][0].focus();V=1}else{if((ad==13||ad==32)&&R._.tabBarMode){ah.selectPage(ah._.currentTabId);ah._.tabBarMode=false;ah._.currentFocusIndex=-1;U(true);V=1}}}}if(V){ac.stop();ac.data.preventDefault()
}}function X(ac){V&&ac.data.preventDefault()}var Y=this._.element;this.on("show",function(){Y.on("keydown",W,this,null,0);if(b.opera||b.gecko&&b.mac){Y.on("keypress",X,this)}});this.on("hide",function(){Y.removeListener("keydown",W);
if(b.opera||b.gecko&&b.mac){Y.removeListener("keypress",X)}});this.on("iframeAdded",function(ac){var ad=new g(ac.data.iframe.$.contentWindow.document);ad.on("keydown",W,this,null,0)});this.on("show",function(){var ag=this;
T();if(M.config.dialog_startupFocusTab&&R._.pageCount>1){R._.tabBarMode=true;R._.tabs[R._.currentTabId][0].focus()}else{if(!ag._.hasFocus){ag._.currentFocusIndex=-1;if(O.onFocus){var ac=O.onFocus.call(ag);
ac&&ac.focus()}else{U(true)}if(ag._.editor.mode=="wysiwyg"&&c){var ad=M.document.$.selection,ae=ad.createRange();if(ae){if(ae.parentElement&&ae.parentElement().ownerDocument==M.document.$||ae.item&&ae.item(0).ownerDocument==M.document.$){var af=document.body.createTextRange();
af.moveToElementText(ag.getElement().getFirst().$);af.collapse(true);af.select()}}}}}},this,null,4294967295);if(b.ie6Compat){this.on("load",function(ac){var ad=this.getElement(),ae=ad.getFirst();ae.remove();
ae.appendTo(ad)},this)}v(this);w(this);new d.text(O.title,a.document).appendTo(this.parts.title);for(var Z=0;Z<O.contents.length;Z++){this.addPage(O.contents[Z])}this.parts.tabs.on("click",function(ac){var af=this;
var ad=ac.data.getTarget();if(ad.hasClass("cke_dialog_tab")){var ae=ad.$.id;af.selectPage(ae.substr(0,ae.lastIndexOf("_")));if(af._.tabBarMode){af._.tabBarMode=false;af._.currentFocusIndex=-1;U(true)}ac.data.preventDefault()
}},this);var aa=[],ab=a.dialog._.uiElementBuilders.hbox.build(this,{type:"hbox",className:"cke_dialog_footer_buttons",widths:[],children:O.buttons},aa).getChild();this.parts.footer.setHtml(aa.join(""));
for(Z=0;Z<ab.length;Z++){this._.buttons[ab[Z].id]=ab[Z]}};function o(M,N,O){this.element=N;this.focusIndex=O;this.tabIndex=0;this.isFocusable=function(){return !N.getAttribute("disabled")&&N.isVisible()
};this.focus=function(){M._.currentFocusIndex=this.focusIndex;this.element.focus()};N.on("keydown",function(P){if(P.data.getKeystroke() in {32:1,13:1}){this.fire("click")}});N.on("focus",function(){this.fire("mouseover")
});N.on("blur",function(){this.fire("mouseout")})}a.dialog.prototype={destroy:function(){this.hide();this._.element.remove()},resize:(function(){return function(M,N){var O=this;if(O._.contentSize&&O._.contentSize.width==M&&O._.contentSize.height==N){return
}a.dialog.fire("resize",{dialog:O,skin:O._.editor.skinName,width:M,height:N},O._.editor);O._.contentSize={width:M,height:N};O._.updateSize=true}})(),getSize:function(){var O=this;if(!O._.updateSize){return O._.size
}var M=O._.element.getFirst(),N=O._.size={width:M.$.offsetWidth||0,height:M.$.offsetHeight||0};O._.updateSize=!N.width||!N.height;return N},move:(function(){var M;return function(N,O){var R=this;var P=R._.element.getFirst();
if(M===undefined){M=P.getComputedStyle("position")=="fixed"}if(M&&R._.position&&R._.position.x==N&&R._.position.y==O){return}R._.position={x:N,y:O};if(!M){var Q=a.document.getWindow().getScrollPosition();
N+=Q.x;O+=Q.y}P.setStyles({left:(N>0?N:0)+"px",top:(O>0?O:0)+"px"})}})(),getPosition:function(){return e.extend({},this._.position)},show:function(){var M=this._.editor;if(M.mode=="wysiwyg"&&c){var N=M.getSelection();
N&&N.lock()}var O=this._.element,P=this.definition;if(!(O.getParent()&&O.getParent().equals(a.document.getBody()))){O.appendTo(a.document.getBody())}else{O.setStyle("display","block")}if(b.gecko&&b.version<10900){var Q=this.parts.dialog;
Q.setStyle("position","absolute");setTimeout(function(){Q.setStyle("position","fixed")},0)}this.resize(P.minWidth,P.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);O.on("keydown",E);O.on(b.opera?"keypress":"keyup",F);
for(var R in {keyup:1,keydown:1,keypress:1}){O.on(R,L)}}else{this._.parentDialog=a.dialog._.currentTop;var S=this._.parentDialog.getElement().getFirst();S.$.style.zIndex-=Math.floor(this._.editor.config.baseFloatZIndex/2);
a.dialog._.currentTop=this}G(this,this,"\x1b",null,function(){this.getButton("cancel")&&this.getButton("cancel").click()});this._.hasFocus=false;e.setTimeout(function(){var T=a.document.getWindow().getViewPaneSize(),U=this.getSize();
this.move((T.width-P.minWidth)/2,(T.height-U.height)/2);this.parts.dialog.setStyle("visibility","");this.fireOnce("load",{});this.fire("show",{});this._.editor.fire("dialogShow",this);this.foreach(function(V){V.setInitValue&&V.setInitValue()
})},100,this)},foreach:function(M){var P=this;for(var N in P._.contents){for(var O in P._.contents[N]){M(P._.contents[N][O])}}return P},reset:(function(){var M=function(N){if(N.reset){N.reset()}};return function(){this.foreach(M);
return this}})(),setupContent:function(){var M=arguments;this.foreach(function(N){if(N.setup){N.setup.apply(N,M)}})},commitContent:function(){var M=arguments;this.foreach(function(N){if(N.commit){N.commit.apply(N,M)
}})},hide:function(){if(!this.parts.dialog.isVisible()){return}this.fire("hide",{});this._.editor.fire("dialogHide",this);var M=this._.element;M.setStyle("display","none");this.parts.dialog.setStyle("visibility","hidden");
H(this);while(a.dialog._.currentTop!=this){a.dialog._.currentTop.hide()}if(!this._.parentDialog){B()}else{var N=this._.parentDialog.getElement().getFirst();N.setStyle("z-index",parseInt(N.$.style.zIndex,10)+Math.floor(this._.editor.config.baseFloatZIndex/2))
}a.dialog._.currentTop=this._.parentDialog;if(!this._.parentDialog){a.dialog._.currentZIndex=null;M.removeListener("keydown",E);M.removeListener(b.opera?"keypress":"keyup",F);for(var O in {keyup:1,keydown:1,keypress:1}){M.removeListener(O,L)
}var P=this._.editor;P.focus();if(P.mode=="wysiwyg"&&c){var Q=P.getSelection();Q&&Q.unlock(true)}}else{a.dialog._.currentZIndex-=10}delete this._.parentDialog;this.foreach(function(R){R.resetInitValue&&R.resetInitValue()
})},addPage:function(M){var Y=this;var N=[],O=M.label?' title="'+e.htmlEncode(M.label)+'"':"",P=M.elements,Q=a.dialog._.uiElementBuilders.vbox.build(Y,{type:"vbox",className:"cke_dialog_page_contents",children:M.elements,expand:!!M.expand,padding:M.padding,style:M.style||"width: 100%; height: 100%;"},N),R=h.createFromHtml(N.join(""));
R.setAttribute("role","tabpanel");var S=b,T=M.id+"_"+e.getNextNumber(),U=h.createFromHtml(['<a class="cke_dialog_tab"',Y._.pageCount>0?" cke_last":"cke_first",O,!!M.hidden?' style="display:none"':"",' id="',T,'"',S.gecko&&S.version>=10900&&!S.hc?"":' href="javascript:void(0)"',' tabIndex="-1"',' hidefocus="true"',' role="tab">',M.label,"</a>"].join(""));
R.setAttribute("aria-labelledby",T);Y._.tabs[M.id]=[U,R];Y._.tabIdList.push(M.id);!M.hidden&&Y._.pageCount++;Y._.lastTab=U;Y.updateStyle();var V=Y._.contents[M.id]={},W,X=Q.getChild();while(W=X.shift()){V[W.id]=W;
if(typeof W.getChild=="function"){X.push.apply(X,W.getChild())}}R.setAttribute("name",M.id);R.appendTo(Y.parts.contents);U.unselectable();Y.parts.tabs.append(U);if(M.accessKey){G(Y,Y,"CTRL+"+M.accessKey,J,I);
Y._.accessKeyMap["CTRL+"+M.accessKey]=M.id}},selectPage:function(M){var R=this;if(R._.currentTabId==M){return}if(R.fire("selectPage",{page:M,currentPage:R._.currentTabId})===true){return}for(var N in R._.tabs){var O=R._.tabs[N][0],P=R._.tabs[N][1];
if(N!=M){O.removeClass("cke_dialog_tab_selected");P.hide()}P.setAttribute("aria-hidden",N!=M)}var Q=R._.tabs[M];Q[0].addClass("cke_dialog_tab_selected");Q[1].show();R._.currentTabId=M;R._.currentTabIndex=e.indexOf(R._.tabIdList,M)
},updateStyle:function(){this.parts.dialog[(this._.pageCount===1?"add":"remove")+"Class"]("cke_single_page")},hidePage:function(M){var O=this;var N=O._.tabs[M]&&O._.tabs[M][0];if(!N||O._.pageCount==1){return
}else{if(M==O._.currentTabId){O.selectPage(m.call(O))}}N.hide();O._.pageCount--;O.updateStyle()},showPage:function(M){var O=this;var N=O._.tabs[M]&&O._.tabs[M][0];if(!N){return}N.show();O._.pageCount++;
O.updateStyle()},getElement:function(){return this._.element},getName:function(){return this._.name},getContentElement:function(M,N){var O=this._.contents[M];return O&&O[N]},getValueOf:function(M,N){return this.getContentElement(M,N).getValue()
},setValueOf:function(M,N,O){return this.getContentElement(M,N).setValue(O)},getButton:function(M){return this._.buttons[M]},click:function(M){return this._.buttons[M].click()},disableButton:function(M){return this._.buttons[M].disable()
},enableButton:function(M){return this._.buttons[M].enable()},getPageCount:function(){return this._.pageCount},getParentEditor:function(){return this._.editor},getSelectedElement:function(){return this.getParentEditor().getSelection().getSelectedElement()
},addFocusable:function(M,N){var P=this;if(typeof N=="undefined"){N=P._.focusList.length;P._.focusList.push(new o(P,M,N))}else{P._.focusList.splice(N,0,new o(P,M,N));for(var O=N+1;O<P._.focusList.length;
O++){P._.focusList[O].focusIndex++}}}};e.extend(a.dialog,{add:function(M,N){if(!this._.dialogDefinitions[M]||typeof N=="function"){this._.dialogDefinitions[M]=N}},exists:function(M){return !!this._.dialogDefinitions[M]
},getCurrent:function(){return a.dialog._.currentTop},okButton:(function(){var M=function(N,O){O=O||{};return e.extend({id:"ok",type:"button",label:N.lang.common.ok,"class":"cke_dialog_ui_button_ok",onClick:function(P){var Q=P.data.dialog;
if(Q.fire("ok",{hide:true}).hide!==false){Q.hide()}}},O,true)};M.type="button";M.override=function(N){return e.extend(function(O){return M(O,N)},{type:"button"},true)};return M})(),cancelButton:(function(){var M=function(N,O){O=O||{};
return e.extend({id:"cancel",type:"button",label:N.lang.common.cancel,"class":"cke_dialog_ui_button_cancel",onClick:function(P){var Q=P.data.dialog;if(Q.fire("cancel",{hide:true}).hide!==false){Q.hide()
}}},O,true)};M.type="button";M.override=function(N){return e.extend(function(O){return M(O,N)},{type:"button"},true)};return M})(),addUIElement:function(M,N){this._.uiElementBuilders[M]=N}});a.dialog._={uiElementBuilders:{},dialogDefinitions:{},currentTop:null,currentZIndex:null};
a.event.implementOn(a.dialog);a.event.implementOn(a.dialog.prototype,true);var p={resizable:3,minWidth:600,minHeight:400,buttons:[a.dialog.okButton,a.dialog.cancelButton]};b.mac&&p.buttons.reverse();var q=function(M,N,O){for(var P=0,Q;
Q=M[P];P++){if(Q.id==N){return Q}if(O&&Q[O]){var R=q(Q[O],N,O);if(R){return R}}}return null},r=function(M,N,O,P,Q){if(O){for(var R=0,S;S=M[R];R++){if(S.id==O){M.splice(R,0,N);return N}if(P&&S[P]){var T=r(S[P],N,O,P,true);
if(T){return T}}}if(Q){return null}}M.push(N);return N},s=function(M,N,O){for(var P=0,Q;Q=M[P];P++){if(Q.id==N){return M.splice(P,1)}if(O&&Q[O]){var R=s(Q[O],N,O);if(R){return R}}}return null},t=function(M,N){this.dialog=M;
var O=N.contents;for(var P=0,Q;Q=O[P];P++){O[P]=new u(M,Q)}e.extend(this,N)};t.prototype={getContents:function(M){return q(this.contents,M)},getButton:function(M){return q(this.buttons,M)},addContents:function(M,N){return r(this.contents,M,N)
},addButton:function(M,N){return r(this.buttons,M,N)},removeContents:function(M){s(this.contents,M)},removeButton:function(M){s(this.buttons,M)}};function u(M,N){this._={dialog:M};e.extend(this,N)}u.prototype={get:function(M){return q(this.elements,M,"children")
},add:function(M,N){return r(this.elements,M,N,"children")},remove:function(M){s(this.elements,M,"children")}};function v(M){var N=null,O=null,P=M.getElement().getFirst(),Q=M.getParentEditor(),R=Q.config.dialog_magnetDistance,S=Q.skin.margins||[0,0,0,0];
if(typeof R=="undefined"){R=20}function T(V){var W=M.getSize(),X=a.document.getWindow().getViewPaneSize(),Y=V.data.$.screenX,Z=V.data.$.screenY,aa=Y-N.x,ab=Z-N.y,ac,ad;N={x:Y,y:Z};O.x+=aa;O.y+=ab;if(O.x+S[3]<R){ac=-S[3]
}else{if(O.x-S[1]>X.width-W.width-R){ac=X.width-W.width+S[1]}else{ac=O.x}}if(O.y+S[0]<R){ad=-S[0]}else{if(O.y-S[2]>X.height-W.height-R){ad=X.height-W.height+S[2]}else{ad=O.y}}M.move(ac,ad);V.data.preventDefault()
}function U(V){a.document.removeListener("mousemove",T);a.document.removeListener("mouseup",U);if(b.ie6Compat){var W=z.getChild(0).getFrameDocument();W.removeListener("mousemove",T);W.removeListener("mouseup",U)
}}M.parts.title.on("mousedown",function(V){M._.updateSize=true;N={x:V.data.$.screenX,y:V.data.$.screenY};a.document.on("mousemove",T);a.document.on("mouseup",U);O=M.getPosition();if(b.ie6Compat){var W=z.getChild(0).getFrameDocument();
W.on("mousemove",T);W.on("mouseup",U)}V.data.preventDefault()},M)}function w(M){var N=M.definition,O=N.minWidth||0,P=N.minHeight||0,Q=N.resizable,R=M.getParentEditor().skin.margins||[0,0,0,0];function S(ad,ae){ad.y+=ae
}function T(ad,ae){ad.x2+=ae}function U(ad,ae){ad.y2+=ae}function V(ad,ae){ad.x+=ae}var W=null,X=null,Y=M._.editor.config.magnetDistance,Z=["tl","t","tr","l","r","bl","b","br"];function aa(ad){var ae=ad.listenerData.part,af=M.getSize();
X=M.getPosition();e.extend(X,{x2:X.x+af.width,y2:X.y+af.height});W={x:ad.data.$.screenX,y:ad.data.$.screenY};a.document.on("mousemove",ab,M,{part:ae});a.document.on("mouseup",ac,M,{part:ae});if(b.ie6Compat){var ag=z.getChild(0).getFrameDocument();
ag.on("mousemove",ab,M,{part:ae});ag.on("mouseup",ac,M,{part:ae})}ad.data.preventDefault()}function ab(ad){var ae=ad.data.$.screenX,af=ad.data.$.screenY,ag=ae-W.x,ah=af-W.y,ai=a.document.getWindow().getViewPaneSize(),aj=ad.listenerData.part;
if(aj.search("t")!=-1){S(X,ah)}if(aj.search("l")!=-1){V(X,ag)}if(aj.search("b")!=-1){U(X,ah)}if(aj.search("r")!=-1){T(X,ag)}W={x:ae,y:af};var ak,al,am,an;if(X.x+R[3]<Y){ak=-R[3]}else{if(aj.search("l")!=-1&&X.x2-X.x<O+Y){ak=X.x2-O
}else{ak=X.x}}if(X.y+R[0]<Y){al=-R[0]}else{if(aj.search("t")!=-1&&X.y2-X.y<P+Y){al=X.y2-P}else{al=X.y}}if(X.x2-R[1]>ai.width-Y){am=ai.width+R[1]}else{if(aj.search("r")!=-1&&X.x2-X.x<O+Y){am=X.x+O}else{am=X.x2
}}if(X.y2-R[2]>ai.height-Y){an=ai.height+R[2]}else{if(aj.search("b")!=-1&&X.y2-X.y<P+Y){an=X.y+P}else{an=X.y2}}M.move(ak,al);M.resize(am-ak,an-al);ad.data.preventDefault()}function ac(ad){a.document.removeListener("mouseup",ac);
a.document.removeListener("mousemove",ab);if(b.ie6Compat){var ae=z.getChild(0).getFrameDocument();ae.removeListener("mouseup",ac);ae.removeListener("mousemove",ab)}}}var x,y={},z;function A(M){var N=a.document.getWindow(),O=M.config.dialog_backgroundCoverColor||"white",P=M.config.dialog_backgroundCoverOpacity,Q=M.config.baseFloatZIndex,R=e.genKey(O,P,Q),S=y[R];
if(!S){var T=['<div style="position: ',b.ie6Compat?"absolute":"fixed","; z-index: ",Q,"; top: 0px; left: 0px; ",!b.ie6Compat?"background-color: "+O:"",'" class="cke_dialog_background_cover">'];if(b.ie6Compat){var U=b.isCustomDomain(),V="<html><body style=\\'background-color:"+O+";\\'></body></html>";
T.push('<iframe hidefocus="true" frameborder="0" id="cke_dialog_background_iframe" src="javascript:');T.push("void((function(){document.open();"+(U?"document.domain='"+document.domain+"';":"")+"document.write( '"+V+"' );document.close();})())");
T.push('" style="position:absolute;left:0;top:0;width:100%;height: 100%;progid:DXImageTransform.Microsoft.Alpha(opacity=0)"></iframe>')}T.push("</div>");S=h.createFromHtml(T.join(""));S.setOpacity(P!=undefined?P:0.5);
S.appendTo(a.document.getBody());y[R]=S}else{S.show()}z=S;var W=function(){var Z=N.getViewPaneSize();S.setStyles({width:Z.width+"px",height:Z.height+"px"})},X=function(){var Z=N.getScrollPosition(),aa=a.dialog._.currentTop;
S.setStyles({left:Z.x+"px",top:Z.y+"px"});do{var ab=aa.getPosition();aa.move(ab.x,ab.y)}while(aa=aa._.parentDialog)};x=W;N.on("resize",W);W();if(b.ie6Compat){var Y=function(){X();arguments.callee.prevScrollHandler.apply(this,arguments)
};N.$.setTimeout(function(){Y.prevScrollHandler=window.onscroll||(function(){});window.onscroll=Y},0);X()}}function B(){if(!z){return}var M=a.document.getWindow();z.hide();M.removeListener("resize",x);
if(b.ie6Compat){M.$.setTimeout(function(){var N=window.onscroll&&window.onscroll.prevScrollHandler;window.onscroll=N||null},0)}x=null}function C(){for(var M in y){y[M].remove()}y={}}var D={},E=function(M){var N=M.data.$.ctrlKey||M.data.$.metaKey,O=M.data.$.altKey,P=M.data.$.shiftKey,Q=String.fromCharCode(M.data.$.keyCode),R=D[(N?"CTRL+":"")+(O?"ALT+":"")+(P?"SHIFT+":"")+Q];
if(!R||!R.length){return}R=R[R.length-1];R.keydown&&R.keydown.call(R.uiElement,R.dialog,R.key);M.data.preventDefault()},F=function(M){var N=M.data.$.ctrlKey||M.data.$.metaKey,O=M.data.$.altKey,P=M.data.$.shiftKey,Q=String.fromCharCode(M.data.$.keyCode),R=D[(N?"CTRL+":"")+(O?"ALT+":"")+(P?"SHIFT+":"")+Q];
if(!R||!R.length){return}R=R[R.length-1];if(R.keyup){R.keyup.call(R.uiElement,R.dialog,R.key);M.data.preventDefault()}},G=function(M,N,O,P,Q){var R=D[O]||(D[O]=[]);R.push({uiElement:M,dialog:N,key:O,keyup:Q||M.accessKeyUp,keydown:P||M.accessKeyDown})
},H=function(M){for(var N in D){var O=D[N];for(var P=O.length-1;P>=0;P--){if(O[P].dialog==M||O[P].uiElement==M){O.splice(P,1)}}if(O.length===0){delete D[N]}}},I=function(M,N){if(M._.accessKeyMap[N]){M.selectPage(M._.accessKeyMap[N])
}},J=function(M,N){},K={27:1,13:1},L=function(M){if(M.data.getKeystroke() in K){M.data.stopPropagation()}};(function(){k.dialog={uiElement:function(M,N,O,P,Q,R,S){if(arguments.length<4){return}var T=(P.call?P(N):P)||"div",U=["<",T," "],V=(Q&&Q.call?Q(N):Q)||{},W=(R&&R.call?R(N):R)||{},X=(S&&S.call?S.call(this,M,N):S)||"",Y=this.domId=W.id||e.getNextNumber()+"_uiElement",Z=this.id=N.id,aa;
W.id=Y;var ab={};if(N.type){ab["cke_dialog_ui_"+N.type]=1}if(N.className){ab[N.className]=1}var ac=W["class"]&&W["class"].split?W["class"].split(" "):[];for(aa=0;aa<ac.length;aa++){if(ac[aa]){ab[ac[aa]]=1
}}var ad=[];for(aa in ab){ad.push(aa)}W["class"]=ad.join(" ");if(N.title){W.title=N.title}var ae=(N.style||"").split(";");for(aa in V){ae.push(aa+":"+V[aa])}if(N.hidden){ae.push("display:none")}for(aa=ae.length-1;
aa>=0;aa--){if(ae[aa]===""){ae.splice(aa,1)}}if(ae.length>0){W.style=(W.style?W.style+"; ":"")+ae.join("; ")}for(aa in W){U.push(aa+'="'+e.htmlEncode(W[aa])+'" ')}U.push(">",X,"</",T,">");O.push(U.join(""));
(this._||(this._={})).dialog=M;if(typeof N.isChanged=="boolean"){this.isChanged=function(){return N.isChanged}}if(typeof N.isChanged=="function"){this.isChanged=N.isChanged}a.event.implementOn(this);this.registerEvents(N);
if(this.accessKeyUp&&this.accessKeyDown&&N.accessKey){G(this,M,"CTRL+"+N.accessKey)}var af=this;M.on("load",function(){if(af.getInputElement()){af.getInputElement().on("focus",function(){M._.tabBarMode=false;
M._.hasFocus=true;af.fire("focus")},af)}});if(this.keyboardFocusable){this.tabIndex=N.tabIndex||0;this.focusIndex=M._.focusList.push(this)-1;this.on("focus",function(){M._.currentFocusIndex=af.focusIndex
})}e.extend(this,N)},hbox:function(M,N,O,P,Q){if(arguments.length<4){return}this._||(this._={});var R=this._.children=N,S=Q&&Q.widths||null,T=Q&&Q.height||null,U={},V,W=function(){var Y=['<tbody><tr class="cke_dialog_ui_hbox">'];
for(V=0;V<O.length;V++){var Z="cke_dialog_ui_hbox_child",aa=[];if(V===0){Z="cke_dialog_ui_hbox_first"}if(V==O.length-1){Z="cke_dialog_ui_hbox_last"}Y.push('<td class="',Z,'" role="presentation" ');if(S){if(S[V]){aa.push("width:"+e.cssLength(S[V]))
}}else{aa.push("width:"+Math.floor(100/O.length)+"%")}if(T){aa.push("height:"+e.cssLength(T))}if(Q&&Q.padding!=undefined){aa.push("padding:"+e.cssLength(Q.padding))}if(aa.length>0){Y.push('style="'+aa.join("; ")+'" ')
}Y.push(">",O[V],"</td>")}Y.push("</tr></tbody>");return Y.join("")},X={role:"presentation"};Q&&Q.align&&(X.align=Q.align);k.dialog.uiElement.call(this,M,Q||{type:"hbox"},P,"table",U,X,W)},vbox:function(M,N,O,P,Q){if(arguments.length<3){return
}this._||(this._={});var R=this._.children=N,S=Q&&Q.width||null,T=Q&&Q.heights||null,U=function(){var V=['<table role="presentation" cellspacing="0" border="0" '];V.push('style="');if(Q&&Q.expand){V.push("height:100%;")
}V.push("width:"+e.cssLength(S||"100%"),";");V.push('"');V.push('align="',e.htmlEncode(Q&&Q.align||(M.getParentEditor().lang.dir=="ltr"?"left":"right")),'" ');V.push("><tbody>");for(var W=0;W<O.length;
W++){var X=[];V.push('<tr><td role="presentation" ');if(S){X.push("width:"+e.cssLength(S||"100%"))}if(T){X.push("height:"+e.cssLength(T[W]))}else{if(Q&&Q.expand){X.push("height:"+Math.floor(100/O.length)+"%")
}}if(Q&&Q.padding!=undefined){X.push("padding:"+e.cssLength(Q.padding))}if(X.length>0){V.push('style="',X.join("; "),'" ')}V.push(' class="cke_dialog_ui_vbox_child">',O[W],"</td></tr>")}V.push("</tbody></table>");
return V.join("")};k.dialog.uiElement.call(this,M,Q||{type:"vbox"},P,"div",null,{role:"presentation"},U)}}})();k.dialog.uiElement.prototype={getElement:function(){return a.document.getById(this.domId)},getInputElement:function(){return this.getElement()
},getDialog:function(){return this._.dialog},setValue:function(M){this.getInputElement().setValue(M);this.fire("change",{value:M});return this},getValue:function(){return this.getInputElement().getValue()
},isChanged:function(){return false},selectParentTab:function(){var P=this;var M=P.getInputElement(),N=M,O;while((N=N.getParent())&&N.$.className.search("cke_dialog_page_contents")==-1){}if(!N){return P
}O=N.getAttribute("name");if(P._.dialog._.currentTabId!=O){P._.dialog.selectPage(O)}return P},focus:function(){this.selectParentTab().getInputElement().focus();return this},registerEvents:function(M){var N=/^on([A-Z]\w+)/,O,P=function(R,S,T,U){S.on("load",function(){R.getInputElement().on(T,U,R)
})};for(var Q in M){if(!(O=Q.match(N))){continue}if(this.eventProcessors[Q]){this.eventProcessors[Q].call(this,this._.dialog,M[Q])}else{P(this,this._.dialog,O[1].toLowerCase(),M[Q])}}return this},eventProcessors:{onLoad:function(M,N){M.on("load",N,this)
},onShow:function(M,N){M.on("show",N,this)},onHide:function(M,N){M.on("hide",N,this)}},accessKeyDown:function(M,N){this.focus()},accessKeyUp:function(M,N){},disable:function(){var M=this.getInputElement();
M.setAttribute("disabled","true");M.addClass("cke_disabled")},enable:function(){var M=this.getInputElement();M.removeAttribute("disabled");M.removeClass("cke_disabled")},isEnabled:function(){return !this.getInputElement().getAttribute("disabled")
},isVisible:function(){return this.getInputElement().isVisible()},isFocusable:function(){if(!this.isEnabled()||!this.isVisible()){return false}return true}};k.dialog.hbox.prototype=e.extend(new k.dialog.uiElement(),{getChild:function(M){var N=this;
if(arguments.length<1){return N._.children.concat()}if(!M.splice){M=[M]}if(M.length<2){return N._.children[M[0]]}else{return N._.children[M[0]]&&N._.children[M[0]].getChild?N._.children[M[0]].getChild(M.slice(1,M.length)):null
}}},true);k.dialog.vbox.prototype=new k.dialog.hbox();(function(){var M={build:function(N,O,P){var Q=O.children,R,S=[],T=[];for(var U=0;U<Q.length&&(R=Q[U]);U++){var V=[];S.push(V);T.push(a.dialog._.uiElementBuilders[R.type].build(N,R,V))
}return new k.dialog[O.type](N,T,S,P,O)}};a.dialog.addUIElement("hbox",M);a.dialog.addUIElement("vbox",M)})();a.dialogCommand=function(M){this.dialogName=M};a.dialogCommand.prototype={exec:function(M){M.openDialog(this.dialogName)
},canUndo:false,editorFocus:c||b.webkit};(function(){var M=/^([a]|[^a])+$/,N=/^\d*$/,O=/^\d*(?:\.\d+)?$/;a.VALIDATE_OR=1;a.VALIDATE_AND=2;a.dialog.validate={functions:function(){return function(){var V=this;
var P=V&&V.getValue?V.getValue():arguments[0],Q=undefined,R=2,S=[],T;for(T=0;T<arguments.length;T++){if(typeof arguments[T]=="function"){S.push(arguments[T])}else{break}}if(T<arguments.length&&typeof arguments[T]=="string"){Q=arguments[T];
T++}if(T<arguments.length&&typeof arguments[T]=="number"){R=arguments[T]}var U=R==2?true:false;for(T=0;T<S.length;T++){if(R==2){U=U&&S[T](P)}else{U=U||S[T](P)}}if(!U){if(Q!==undefined){alert(Q)}if(V&&(V.select||V.focus)){V.select||V.focus()
}return false}return true}},regex:function(P,Q){return function(){var S=this;var R=S&&S.getValue?S.getValue():arguments[0];if(!P.test(R)){if(Q!==undefined){alert(Q)}if(S&&(S.select||S.focus)){if(S.select){S.select()
}else{S.focus()}}return false}return true}},notEmpty:function(P){return this.regex(M,P)},integer:function(P){return this.regex(N,P)},number:function(P){return this.regex(O,P)},equals:function(P,Q){return this.functions(function(R){return R==P
},Q)},notEqual:function(P,Q){return this.functions(function(R){return R!=P},Q)}};a.on("instanceDestroyed",function(P){if(e.isEmpty(a.instances)){var Q;while(Q=a.dialog._.currentTop){Q.hide()}C()}var R=P.editor._.storedDialogs;
for(var S in R){R[S].destroy()}})})()})();e.extend(a.editor.prototype,{openDialog:function(l,m){var n=a.dialog._.dialogDefinitions[l],o=this.skin.dialog;if(typeof n=="function"&&o._isLoaded){var p=this._.storedDialogs||(this._.storedDialogs={}),q=p[l]||(p[l]=new a.dialog(this,l));
m&&m.call(q,q);q.show();return q}else{if(n=="failed"){throw new Error('[CKEDITOR.dialog.openDialog] Dialog "'+l+'" failed when loading definition.')}}var r=a.document.getBody(),s=r.$.style.cursor,t=this;
r.setStyle("cursor","wait");function u(w){var x=a.dialog._.dialogDefinitions[l],y=t.skin.dialog;if(!y._isLoaded||v&&typeof w=="undefined"){return}if(typeof x!="function"){a.dialog._.dialogDefinitions[l]="failed"
}t.openDialog(l,m);r.setStyle("cursor",s)}if(typeof n=="string"){var v=1;a.scriptLoader.load(a.getUrl(n),u)}a.skins.load(this,"dialog",u);return null}});j.add("dialog",{requires:["dialogui"]});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,th:1,ul:1,dl:1,dt:1,dd:1,form:1},n=/\s*(?:;\s*|$)/;
a.style=function(O,P){if(P){O=e.clone(O);G(O.attributes,P);G(O.styles,P)}var Q=this.element=(O.element||"*").toLowerCase();this.type=Q=="#"||l[Q]?1:m[Q]?3:2;this._={definition:O}};a.style.prototype={apply:function(O){N.call(this,O,false)
},remove:function(O){N.call(this,O,true)},applyToRange:function(O){var P=this;return(P.applyToRange=P.type==2?o:P.type==1?r:P.type==3?q:null).call(P,O)},removeFromRange:function(O){return(this.removeFromRange=this.type==2?p:null).call(this,O)
},applyToObject:function(O){E(O,this)},checkActive:function(O){var S=this;switch(S.type){case 1:return S.checkElementRemovable(O.block||O.blockLimit,true);case 3:case 2:var P=O.elements;for(var Q=0,R;Q<P.length;
Q++){R=P[Q];if(S.type==2&&(R==O.block||R==O.blockLimit)){continue}if(S.type==3&&!(R.getName() in m)){continue}if(S.checkElementRemovable(R,true)){return true}}}return false},checkApplicable:function(O){switch(this.type){case 2:case 1:break;
case 3:return O.lastElement.getAscendant(this.element,true)}return true},checkElementRemovable:function(O,P){if(!O){return false}var Q=this._.definition,R;if(O.getName()==this.element){if(!P&&!O.hasAttributes()){return true
}R=H(Q);if(R._length){for(var S in R){if(S=="_length"){continue}var T=O.getAttribute(S)||"";if(S=="style"?M(R[S],K(T,false)):R[S]==T){if(!P){return true}}else{if(P){return false}}}if(P){return true}}else{return true
}}var U=I(this)[O.getName()];if(U){if(!(R=U.attributes)){return true}for(var V=0;V<R.length;V++){S=R[V][0];var W=O.getAttribute(S);if(W){var X=R[V][1];if(X===null||typeof X=="string"&&W==X||X.test(W)){return true
}}}}return false},buildPreview:function(){var O=this._.definition,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("")}};a.style.getStyleText=function(O){var P=O._ST;if(P){return P}P=O.styles;var Q=O.attributes&&O.attributes.style||"",R="";if(Q.length){Q=Q.replace(n,";")
}for(var S in P){var T=P[S],U=(S+":"+T).replace(n,";");if(T=="inherit"){R+=U}else{Q+=U}}if(Q.length){Q=K(Q)}Q+=R;return O._ST=Q};function o(O){var al=this;var P=O.document;if(O.collapsed){var Q=D(al,P);
O.insertNode(Q);O.moveToPosition(Q,2);return}var R=al.element,S=al._.definition,T,U=f[R]||(T=true,f.span),V=O.createBookmark();O.enlarge(1);O.trim();var W=O.createBookmark(),X=W.startNode,Y=W.endNode,Z=X,aa;
while(Z){var ab=false;if(Z.equals(Y)){Z=null;ab=true}else{var ac=Z.type,ad=ac==1?Z.getName():null;if(ad&&Z.getAttribute("_fck_bookmark")){Z=Z.getNextSourceNode(true);continue}if(!ad||U[ad]&&(Z.getPosition(Y)|4|0|8)==4+0+8&&(!S.childRule||S.childRule(Z))){var ae=Z.getParent();
if(ae&&((ae.getDtd()||f.span)[R]||T)&&(!S.parentRule||S.parentRule(ae))){if(!aa&&(!ad||!f.$removeEmpty[ad]||(Z.getPosition(Y)|4|0|8)==4+0+8)){aa=new d.range(P);aa.setStartBefore(Z)}if(ac==3||ac==1&&!Z.getChildCount()){var af=Z,ag;
while(!af.$.nextSibling&&(ag=af.getParent(),U[ag.getName()])&&(ag.getPosition(X)|2|0|8)==2+0+8&&(!S.childRule||S.childRule(ag))){af=ag}aa.setEndAfter(af);if(!af.$.nextSibling){ab=true}}}else{ab=true}}else{ab=true
}Z=Z.getNextSourceNode()}if(ab&&aa&&!aa.collapsed){var ah=D(al,P),ai=aa.getCommonAncestor();while(ah&&ai){if(ai.getName()==R){for(var aj in S.attributes){if(ah.getAttribute(aj)==ai.getAttribute(aj)){ah.removeAttribute(aj)
}}for(var ak in S.styles){if(ah.getStyle(ak)==ai.getStyle(ak)){ah.removeStyle(ak)}}if(!ah.hasAttributes()){ah=null;break}}ai=ai.getParent()}if(ah){aa.extractContents().appendTo(ah);A(al,ah);aa.insertNode(ah);
ah.mergeSiblings();if(!c){ah.$.normalize()}}aa=null}}X.remove();Y.remove();O.moveToBookmark(V);O.shrink(2)}function p(O){O.enlarge(1);var P=O.createBookmark(),Q=P.startNode;if(O.collapsed){var R=new d.elementPath(Q.getParent()),S;
for(var T=0,U;T<R.elements.length&&(U=R.elements[T]);T++){if(U==R.block||U==R.blockLimit){break}if(this.checkElementRemovable(U)){var V=O.checkBoundaryOfElement(U,2),W=!V&&O.checkBoundaryOfElement(U,1);
if(W||V){S=U;S.match=W?"start":"end"}else{U.mergeSiblings();z(this,U)}}}if(S){var X=Q;for(T=0;true;T++){var Y=R.elements[T];if(Y.equals(S)){break}else{if(Y.match){continue}else{Y=Y.clone()}}Y.append(X);
X=Y}X[S.match=="start"?"insertBefore":"insertAfter"](S)}}else{var Z=P.endNode,aa=this;function ab(){var ae=new d.elementPath(Q.getParent()),af=new d.elementPath(Z.getParent()),ag=null,ah=null;for(var ai=0;
ai<ae.elements.length;ai++){var aj=ae.elements[ai];if(aj==ae.block||aj==ae.blockLimit){break}if(aa.checkElementRemovable(aj)){ag=aj}}for(ai=0;ai<af.elements.length;ai++){aj=af.elements[ai];if(aj==af.block||aj==af.blockLimit){break
}if(aa.checkElementRemovable(aj)){ah=aj}}if(ah){Z.breakParent(ah)}if(ag){Q.breakParent(ag)}}ab();var ac=Q.getNext();while(!ac.equals(Z)){var ad=ac.getNextSourceNode();if(ac.type==1&&this.checkElementRemovable(ac)){if(ac.getName()==this.element){z(this,ac)
}else{B(ac,I(this)[ac.getName()])}if(ad.type==1&&ad.contains(Q)){ab();ad=Q.getNext()}}ac=ad}}O.moveToBookmark(P)}function q(O){var P=O.getCommonAncestor(true,true),Q=P.getAscendant(this.element,true);Q&&E(Q,this)
}function r(O){var P=O.createBookmark(true),Q=O.createIterator();Q.enforceRealBlocks=true;if(this._.enterMode){Q.enlargeBr=this._.enterMode!=2}var R,S=O.document,T;while(R=Q.getNextParagraph()){var U=D(this,S);
s(R,U)}O.moveToBookmark(P)}function s(O,P){var Q=P.is("pre"),R=O.is("pre"),S=Q&&!R,T=!Q&&R;if(S){P=y(O,P)}else{if(T){P=x(v(O),P)}else{O.moveChildren(P)}}P.replace(O);if(Q){u(P)}}var t=d.walker.whitespaces(true);
function u(O){var P;if(!((P=O.getPrevious(t))&&P.is&&P.is("pre"))){return}var Q=w(P.getHtml(),/\n$/,"")+"\n\n"+w(O.getHtml(),/^\n/,"");if(c){O.$.outerHTML="<pre>"+Q+"</pre>"}else{O.setHtml(Q)}P.remove()
}function v(O){var P=/(\S\s*)\n(?:\s|(<span[^>]+_fck_bookmark.*?\/span>))*\n(?!$)/gi,Q=O.getName(),R=w(O.getOuterHtml(),P,function(T,U,V){return U+"</pre>"+V+"<pre>"}),S=[];R.replace(/<pre\b.*?>([\s\S]*?)<\/pre>/gi,function(T,U){S.push(U)
});return S}function w(O,P,Q){var R="",S="";O=O.replace(/(^<span[^>]+_fck_bookmark.*?\/span>)|(<span[^>]+_fck_bookmark.*?\/span>$)/gi,function(T,U,V){U&&(R=U);V&&(S=V);return""});return R+O.replace(P,Q)+S
}function x(O,P){var Q=new d.documentFragment(P.getDocument());for(var R=0;R<O.length;R++){var S=O[R];S=S.replace(/(\r\n|\r)/g,"\n");S=w(S,/^[ \t]*\n/,"");S=w(S,/\n$/,"");S=w(S,/^[ \t]+|[ \t]+$/g,function(U,V,W){if(U.length==1){return"&nbsp;"
}else{if(!V){return e.repeat("&nbsp;",U.length-1)+" "}else{return" "+e.repeat("&nbsp;",U.length-1)}}});S=S.replace(/\n/g,"<br>");S=S.replace(/[ \t]{2,}/g,function(U){return e.repeat("&nbsp;",U.length-1)+" "
});var T=P.clone();T.setHtml(S);Q.append(T)}return Q}function y(O,P){var Q=O.getHtml();Q=w(Q,/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,"");Q=Q.replace(/[ \t\r\n]*(<br[^>]*>)[ \t\r\n]*/gi,"$1");Q=Q.replace(/([ \t\n\r]+|&nbsp;)/g," ");
Q=Q.replace(/<br\b[^>]*>/gi,"\n");if(c){var R=O.getDocument().createElement("div");R.append(P);P.$.outerHTML="<pre>"+Q+"</pre>";P=R.getFirst().remove()}else{P.setHtml(Q)}return P}function z(O,P){var Q=O._.definition,R=e.extend({},Q.attributes,I(O)[P.getName()]),S=Q.styles,T=e.isEmpty(R)&&e.isEmpty(S);
for(var U in R){if((U=="class"||O._.definition.fullMatch)&&P.getAttribute(U)!=J(U,R[U])){continue}T=P.hasAttribute(U);P.removeAttribute(U)}for(var V in S){if(O._.definition.fullMatch&&P.getStyle(V)!=J(V,S[V],true)){continue
}T=T||!!P.getStyle(V);P.removeStyle(V)}T&&C(P)}function A(O,P){var Q=O._.definition,R=Q.attributes,S=Q.styles,T=I(O),U=P.getElementsByTag(O.element);for(var V=U.count();--V>=0;){z(O,U.getItem(V))}for(var W in T){if(W!=O.element){U=P.getElementsByTag(W);
for(V=U.count()-1;V>=0;V--){var X=U.getItem(V);B(X,T[W])}}}}function B(O,P){var Q=P&&P.attributes;if(Q){for(var R=0;R<Q.length;R++){var S=Q[R][0],T;if(T=O.getAttribute(S)){var U=Q[R][1];if(U===null||U.test&&U.test(T)||typeof U=="string"&&T==U){O.removeAttribute(S)
}}}}C(O)}function C(O){if(!O.hasAttributes()){var P=O.getFirst(),Q=O.getLast();O.remove(true);if(P){P.type==1&&P.mergeSiblings();if(Q&&!P.equals(Q)&&Q.type==1){Q.mergeSiblings()}}}}function D(O,P){var Q,R=O._.definition,S=O.element;
if(S=="*"){S="span"}Q=new h(S,P);return E(Q,O)}function E(O,P){var Q=P._.definition,R=Q.attributes,S=a.style.getStyleText(Q);if(R){for(var T in R){O.setAttribute(T,R[T])}}if(S){O.setAttribute("style",S)
}return O}var F=/#\((.+?)\)/g;function G(O,P){for(var Q in O){O[Q]=O[Q].replace(F,function(R,S){return P[S]})}}function H(O){var P=O._AC;if(P){return P}P={};var Q=0,R=O.attributes;if(R){for(var S in R){Q++;
P[S]=R[S]}}var T=a.style.getStyleText(O);if(T){if(!P.style){Q++}P.style=T}P._length=Q;return O._AC=P}function I(O){if(O._.overrides){return O._.overrides}var P=O._.overrides={},Q=O._.definition.overrides;
if(Q){if(!e.isArray(Q)){Q=[Q]}for(var R=0;R<Q.length;R++){var S=Q[R],T,U,V;if(typeof S=="string"){T=S.toLowerCase()}else{T=S.element?S.element.toLowerCase():O.element;V=S.attributes}U=P[T]||(P[T]={});if(V){var W=U.attributes=U.attributes||[];
for(var X in V){W.push([X.toLowerCase(),V[X]])}}}}return P}function J(O,P,Q){var R=new h("span");R[Q?"setStyle":"setAttribute"](O,P);return R[Q?"getStyle":"getAttribute"](O)}function K(O,P){var Q;if(P!==false){var R=new h("span");
R.setAttribute("style",O);Q=R.getAttribute("style")||""}else{Q=O}return Q.replace(/\s*([;:])\s*/,"$1").replace(/([^\s;])$/,"$1;").replace(/,\s+/g,",").toLowerCase()}function L(O){var P={};O.replace(/&quot;/g,'"').replace(/\s*([^ :;]+)\s*:\s*([^;]+)\s*(?=;|$)/g,function(Q,R,S){P[R]=S
});return P}function M(O,P){typeof O=="string"&&(O=L(O));typeof P=="string"&&(P=L(P));for(var Q in O){if(!(Q in P&&(P[Q]==O[Q]||O[Q]=="inherit"||P[Q]=="inherit"))){return false}}return true}function N(O,P){var Q=O.getSelection(),R=Q.getRanges(),S=P?this.removeFromRange:this.applyToRange;
for(var T=0;T<R.length;T++){S.call(this,R[T])}Q.selectRanges(R)}})();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};a.stylesSet=new a.resourceManager("","stylesSet");a.addStylesSet=e.bind(a.stylesSet.add,a.stylesSet);a.loadStylesSet=function(l,m,n){a.stylesSet.addExternal(l,m,"");
a.stylesSet.load(l,n)};a.editor.prototype.getStylesSet=function(l){if(!this._.stylesDefinitions){var m=this,n=m.config.stylesCombo_stylesSet||m.config.stylesSet||"default";if(n instanceof Array){m._.stylesDefinitions=n;
l(n);return}var o=n.split(":"),p=o[0],q=o[1],r=j.registered.styles.path;a.stylesSet.addExternal(p,q?o.slice(1).join(":"):r+"styles/"+p+".js","");a.stylesSet.load(p,function(s){m._.stylesDefinitions=s[p];
l(m._.stylesDefinitions)})}else{l(this._.stylesDefinitions)}};j.add("domiterator");(function(){function l(o){var p=this;if(arguments.length<1){return}p.range=o;p.forceBrBreak=false;p.enlargeBr=true;p.enforceRealBlocks=false;
p._||(p._={})}var m=/^[\r\n\t ]+$/,n=d.walker.bookmark();l.prototype={getNextParagraph:function(o){var N=this;var p,q,r,s,t;if(!N._.lastNode){q=N.range.clone();q.shrink(1,true);q.enlarge(N.forceBrBreak||!N.enlargeBr?3:2);
var u=new d.walker(q),v=d.walker.bookmark(true,true);u.evaluator=v;N._.nextNode=u.next();u=new d.walker(q);u.evaluator=v;var w=u.previous();N._.lastNode=w.getNextSourceNode(true);if(N._.lastNode&&N._.lastNode.type==3&&!e.trim(N._.lastNode.getText())&&N._.lastNode.getParent().isBlockBoundary()){var x=new d.range(q.document);
x.moveToPosition(N._.lastNode,4);if(x.checkEndOfBlock()){var y=new d.elementPath(x.endContainer),z=y.block||y.blockLimit;N._.lastNode=z.getNextSourceNode(true)}}if(!N._.lastNode){N._.lastNode=N._.docEndMarker=q.document.createText("");
N._.lastNode.insertAfter(w)}q=null}var A=N._.nextNode;w=N._.lastNode;N._.nextNode=null;while(A){var B=false,C=A.type!=1,D=false;if(!C){var E=A.getName();if(A.isBlockBoundary(N.forceBrBreak&&{br:1})){if(E=="br"){C=true
}else{if(!q&&!A.getChildCount()&&E!="hr"){p=A;r=A.equals(w);break}}if(q){q.setEndAt(A,3);if(E!="br"){N._.nextNode=A}}B=true}else{if(A.getFirst()){if(!q){q=new d.range(N.range.document);q.setStartAt(A,3)
}A=A.getFirst();continue}C=true}}else{if(A.type==3){if(m.test(A.getText())){C=false}}}if(C&&!q){q=new d.range(N.range.document);q.setStartAt(A,3)}r=(!B||C)&&A.equals(w);if(q&&!B){while(!A.getNext()&&!r){var F=A.getParent();
if(F.isBlockBoundary(N.forceBrBreak&&{br:1})){B=true;r=r||F.equals(w);break}A=F;C=true;r=A.equals(w);D=true}}if(C){q.setEndAt(A,4)}A=A.getNextSourceNode(D,null,w);r=!A;if(r||B&&q){break}}if(!p){if(!q){N._.docEndMarker&&N._.docEndMarker.remove();
N._.nextNode=null;return null}var G=new d.elementPath(q.startContainer),H=G.blockLimit,I={div:1,th:1,td:1};p=G.block;if(!p&&!N.enforceRealBlocks&&I[H.getName()]&&q.checkStartOfBlock()&&q.checkEndOfBlock()){p=H
}else{if(!p||N.enforceRealBlocks&&p.getName()=="li"){p=N.range.document.createElement(o||"p");q.extractContents().appendTo(p);p.trim();q.insertNode(p);s=t=true}else{if(p.getName()!="li"){if(!q.checkStartOfBlock()||!q.checkEndOfBlock()){p=p.clone(false);
q.extractContents().appendTo(p);p.trim();var J=q.splitBlock();s=!J.wasStartOfBlock;t=!J.wasEndOfBlock;q.insertNode(p)}}else{if(!r){N._.nextNode=p.equals(w)?null:q.getBoundaryNodes().endNode.getNextSourceNode(true,null,w)
}}}}}if(s){var K=p.getPrevious();if(K&&K.type==1){if(K.getName()=="br"){K.remove()}else{if(K.getLast()&&K.getLast().$.nodeName.toLowerCase()=="br"){K.getLast().remove()}}}}if(t){var L=d.walker.bookmark(false,true),M=p.getLast();
if(M&&M.type==1&&M.getName()=="br"){if(c||M.getPrevious(L)||M.getNext(L)){M.remove()}}}if(!N._.nextNode){N._.nextNode=r||p.equals(w)?null:p.getNextSourceNode(true,null,w)}return p}};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;n.block={attributes:n.attributes};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=this._.panelDefinition.block,q=o.parent||a.document.getBody(),r=this._.panel=new k.floatPanel(m,q,o),s=r.addBlock(n.id,p),t=this;
r.onShow=function(){if(t.className){this.element.getFirst().addClass(t.className+"_panel")}n.oldState=t._.state;t.setState(1);n.on=1;if(t.onOpen){t.onOpen()}};r.onHide=function(){if(t.className){this.element.getFirst().removeClass(t.className+"_panel")
}t.setState(n.oldState);n.on=0;if(t.onClose){t.onClose()}};r.onEscape=function(){r.hide();t.document.getById(n.id).focus()};if(this.onBlock){this.onBlock(r,s)}s.onHide=function(){n.on=0;t.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;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:"-30000px",display:""});v.setOpacity(0);v.getFirst().removeStyle("width");if(!this._.blurSet){var C=c?w:new d.window(w.$.contentWindow);
a.event.useCapture=true;C.on("blur",function(D){var F=this;if(!F.allowBlur()){return}var E;if(c&&!F.allowBlur()||(E=D.data.getTarget())&&E.getName&&E.getName()!="iframe"){return}if(F.visible&&!F._.activeChild&&!m){F.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(D){if(this.onEscape&&this.onEscape(D)===false){return false
}},this);e.setTimeout(function(){if(z){A-=v.$.offsetWidth}var D=e.bind(function(){var E=v.getFirst();if(u.autoSize){var F=u.element.$;if(b.gecko||b.opera){F=F.parentNode}if(c){F=F.document.body}var G=F.scrollWidth;
if(c&&b.quirks&&G>0){G+=(E.$.offsetWidth||0)-(E.$.clientWidth||0)}G+=4;E.setStyle("width",G+"px");u.element.addClass("cke_frameLoaded");var H=u.element.$.scrollHeight;if(c&&b.quirks&&H>0){H+=(E.$.offsetHeight||0)-(E.$.clientHeight||0)
}E.setStyle("height",H+"px");t._.currentBlock.element.setStyle("display","none").removeStyle("display")}else{E.removeStyle("height")}var I=t.element,J=I.getWindow(),K=J.getScrollPosition(),L=J.getViewPaneSize(),M={height:I.$.offsetHeight,width:I.$.offsetWidth};
if(z?A<0:A+M.width>L.width+K.x){A+=M.width*(z?1:-1)}if(B+M.height>L.height+K.y){B-=M.height}v.setStyles({top:B+"px",left:A+"px"});v.setOpacity(1)},this);t.isLoaded?D():t.onLoad=D;e.setTimeout(function(){w.$.contentWindow.focus();
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()}}}});a.on("instanceDestroyed",function(){var o=e.isEmpty(a.instances);for(var p in l){var q=l[p];
if(o){q.destroy()}else{q.element.hide()}}o&&(l={})})})();j.add("menu",{beforeInit:function(l){var m=l.config.menu_groups.split(","),n=l._.menuGroups={},o=l._.menuItems={};for(var p=0;p<m.length;p++){n[m[p]]=p+1
}l.addMenuGroup=function(q,r){n[q]=r||100};l.addMenuItem=function(q,r){if(n[r.group]){o[q]=new a.menuItem(this,q,r)}};l.addMenuItems=function(q){for(var r in q){this.addMenuItem(r,q[r])}};l.getMenuItem=function(q){return o[q]
}},requires:["floatpanel"]});(function(){a.menu=e.createClass({$:function(m,n){var q=this;n=q._.definition=n||{};q.id="cke_"+e.getNextNumber();q.editor=m;q.items=[];q._.level=n.level||1;var o=e.extend({},n.panel,{css:m.skin.editor.css,level:q._.level-1,block:{}}),p=o.block.attributes=o.attributes||{};
!p.role&&(p.role="menu");q._.panelDefinition=o},_:{showSubMenu:function(m){var u=this;var n=u._.subMenu,o=u.items[m],p=o.getItems&&o.getItems();if(!p){u._.panel.hideChild();return}var q=u._.panel.getBlock(u.id);
q._.focusIndex=m;if(n){n.removeAll()}else{n=u._.subMenu=new a.menu(u.editor,e.extend({},u._.definition,{level:u._.level+1},true));n.parent=u;n.onClick=e.bind(u.onClick,u);n.onEscape=u.onEscape}for(var r in p){var s=u.editor.getMenuItem(r);
if(s){s.state=p[r];n.add(s)}}var t=u._.panel.getBlock(u.id).element.getDocument().getById(u.id+String(m));n.show(t,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(),this._.panelDefinition,this._.level);s.onEscape=e.bind(function(C){if(this.onEscape&&this.onEscape(C)===false){return false
}},this);s.onHide=e.bind(function(){this.onHide&&this.onHide()},this);var u=s.addBlock(this.id,this._.panelDefinition.block);u.autoSize=true;var v=u.keys;v[40]="next";v[9]="next";v[38]="prev";v[2000+9]="prev";
v[32]="click";v[r.lang.dir=="rtl"?37: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" role="presentation">'],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" role="separator"></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 u=this;var o=l.id+String(m),p=typeof u.state=="undefined"?2:u.state,q=" cke_"+(p==1?"on":p==0?"disabled":"off"),r=u.label;if(u.className){q+=" "+u.className}var s=u.getItems;
n.push('<span class="cke_menuitem"><a id="',o,'" class="',q,'" href="javascript:void(\'',(u.label||"").replace("'",""),'\')" title="',u.label,'" tabindex="-1"_cke_focus=1 hidefocus="true" role="menuitem"'+(s?'aria-haspopup="true"':"")+(p==0?'aria-disabled="true"':"")+(p==1?'aria-pressed="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 t=(u.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"'+(u.icon?' style="background-image:url('+a.getUrl(u.icon)+");background-position:0 "+t+'px;"':"")+'></span></span><span class="cke_label">');
if(s){n.push('<span class="cke_menuarrow">',"<span>&#",u.editor.lang.dir=="rtl"?"9668":"9658",";</span>","</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,div";
(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();b.webkit&&n.container.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;(function(){function l(){var v=this;
try{var s=v.getSelection();if(!s||!s.document.getWindow().$){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={modes:{wysiwyg:1,source:1},exec:function(s){switch(s.mode){case"wysiwyg":s.document.$.execCommand("SelectAll",false,null);
break;case"source":var t=s.textarea.$;if(c){t.createTextRange().execCommand("SelectAll")}else{t.selectionStart=0;t.selectionEnd=t.value.length}t.focus()}},canUndo:false};j.add("selection",{init:function(s){s.on("contentDom",function(){var t=s.document,u=t.getBody(),v=t.getDocumentElement();
if(c){var w,x,y=1;u.on("focusin",function(B){if(B.data.$.srcElement.nodeName!="BODY"){return}if(w){if(y){try{w.select()}catch(C){}}w=null}});u.on("focus",function(){x=true;A()});u.on("beforedeactivate",function(B){if(B.data.$.toElement){return
}x=false;y=1});if(c&&b.version<8){s.on("blur",function(B){s.document&&s.document.$.selection.empty()})}v.on("mousedown",function(){y=0});v.on("mouseup",function(){y=1});if(c&&(b.ie7Compat||b.version<8||b.quirks)){v.on("click",function(B){if(B.data.getTarget().getName()=="html"){s.getSelection().getRanges()[0].select()
}})}u.on("mousedown",function(){z()});u.on("mouseup",function(){x=true;setTimeout(function(){A(true)},0)});u.on("keydown",z);u.on("keyup",function(){x=true;A()});t.on("selectionchange",A);function z(){x=false
}function A(B){if(x){var C=s.document,D=s.getSelection(),E=D&&D.getNative();if(B&&E&&E.type=="None"){if(!C.$.queryCommandEnabled("InsertImage")){e.setTimeout(A,50,this,true);return}}var F;if(E&&E.type&&E.type!="Control"&&(F=E.createRange())&&(F=F.parentElement())&&(F=F.nodeName)&&F.toLowerCase() in {input:1,textarea:1}){return
}w=E&&D.getRanges()[0];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,th: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);var A=x.compareEndPoints("StartToStart",t),B=x.compareEndPoints("EndToStart",t);
x.collapse();if(A>0){break}else{if(!A||B==1&&A==-1){return{container:v,offset:y}}else{if(!B){return{container:v,offset:y+1}}}}x=null}}if(!x){x=t.duplicate();x.moveToElementText(v);x.collapse(false)}x.setEndPoint("StartToStart",t);
var C=x.text.replace(/(\r\n|\r)/g,"\n").length;try{while(C>0){C-=w[--y].nodeValue.length}}catch(D){C=0}if(C===0){return{container:v,offset:y}}else{return{container:w[y],offset:-C}}};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())&&!w.isBlockBoundary()){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=this,u=e.tryThese(function(){return t.getNative().createRange().item(0)},function(){var v=t.getRanges()[0],w,x;for(var y=2;y&&!((w=v.getEnclosedNode())&&w.type==1&&r[w.getName()]&&(x=w));
y--){v.shrink(1)}return x.$});return s.selectedElement=u?new h(u):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()}finally{v.document.fire("selectionchange")}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
},getCommonAncestor:function(){var s=this.getRanges(),t=s[0].startContainer,u=s[s.length-1].endContainer;return t.getCommonAncestor(u)},scrollIntoView:function(){var s=this.getStartElement();s.scrollIntoView()
}}})();(function(){var l=d.walker.whitespaces(true),m=/\ufeff|\u00a0/,n={table:1,tbody:1,tr:1};d.range.prototype.select=c?function(o){var y=this;var p=y.collapsed,q,r;if(y.startContainer.type==1&&y.startContainer.getName() in n||y.endContainer.type==1&&y.endContainer.getName() in n){y.shrink(1,true)
}var s=y.createBookmark(),t=s.startNode,u;if(!p){u=s.endNode}var v=y.document.$.body.createTextRange();v.moveToElementText(t.$);v.moveStart("character",1);if(u){var w=y.document.$.body.createTextRange();
w.moveToElementText(u.$);v.setEndPoint("EndToEnd",w);v.moveEnd("character",-1)}else{var x=t.getNext(l);q=!(x&&x.getText&&x.getText().match(m))&&(o||!t.hasPrevious()||t.getPrevious().is&&t.getPrevious().is("br"));
r=y.document.createElement("span");r.setHtml("&#65279;");r.insertBefore(t);if(q){y.document.createText("\ufeff").insertBefore(t)}}y.setStartBefore(t);t.remove();if(p){if(q){v.moveStart("character",-1);
v.select();y.document.$.selection.clear()}else{v.select()}y.moveToPosition(r,3);r.remove()}else{y.setEndBefore(u);u.remove();v.select()}y.document.fire("selectionchange")}:function(){var r=this;var o=r.startContainer;
if(r.collapsed&&o.type==1&&!o.getChildCount()){o.append(new d.text(""))}var p=r.document.$.createRange();p.setStart(o.$,r.startOffset);try{p.setEnd(r.endContainer.$,r.endOffset)}catch(s){if(s.toString().indexOf("NS_ERROR_ILLEGAL_VALUE")>=0){r.collapse(true);
p.setEnd(r.endContainer.$,r.endOffset)}else{throw s}}var q=r.document.getSelection().getNative();q.removeAllRanges();q.addRange(p)}})();(function(){var l={elements:{$:function(m){var n=m.attributes,o=n&&n._cke_realelement,p=o&&new a.htmlParser.fragment.fromHtml(decodeURIComponent(o)),q=p&&p.children[0];
if(q&&m.attributes._cke_resizable){var r=m.attributes.style;if(r){var s=/(?:^|\s)width\s*:\s*(\d+)/i.exec(r),t=s&&s[1];s=/(?:^|\s)height\s*:\s*(\d+)/i.exec(r);var u=s&&s[1];if(t){q.attributes.width=t}if(u){q.attributes.height=u
}}}return q}}};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()),_cke_real_node_type:l.type,alt:p[n]||p.unknown,align:l.getAttribute("align")||""};
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=this.lang.fakeobjects,q,r=new a.htmlParser.basicWriter();
l.writeHtml(r);q=r.getHtml();var s={"class":m,src:a.getUrl("images/spacer.gif"),_cke_realelement:encodeURIComponent(q),_cke_real_node_type:l.type,alt:p[n]||p.unknown,align:l.attributes.align||""};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){if(l.getAttribute("_cke_real_node_type")!=1){return null}return h.createFromHtml(decodeURIComponent(l.getAttribute("_cke_realelement")),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";m.block={multiSelect:m.multiSelect,attributes:m.attributes};
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=b,o="cke_"+this.id,p=e.addFunction(function(s){var v=this;
var t=v._;if(t.state==0){return}v.createPanel(l);if(t.on){t.panel.hide();return}if(!t.committed){t.list.commit();t.committed=1}var u=v.getValue();if(u){t.list.mark(u)}else{t.list.unmarkAll()}t.panel.showBlock(v.id,new h(s),4)
},this),q={id:o,combo:this,focus:function(){var s=a.document.getById(o).getChild(1);s.focus()},clickFn:p};l.on("mode",function(){this.setState(this.modes[l.mode]?2:0)},this);var r=e.addFunction(function(s,t){s=new d.event(s);
var u=s.getKeystroke();switch(u){case 13:case 32:case 40:e.callFunction(p,t);break;default:q.onkey(q,u)}s.preventDefault()});q.keyDownFn=r;m.push('<span class="cke_rcombo">',"<span id=",o);if(this.className){m.push(' class="',this.className,' cke_off"')
}m.push(">",'<span id="'+o+'_label" class=cke_label>',this.label,"</span>",'<a hidefocus=true title="',this.title,'" tabindex="-1"',n.gecko&&n.version>=10900&&!n.hc?"":" href=\"javascript:void('"+this.label+"')\"",' role="button" aria-labelledby="',o,'_label" aria-describedby="',o,'_text" aria-haspopup="true"');
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( ',r,', event, this );" onclick="CKEDITOR.tools.callFunction(',p,', this); return false;"><span><span id="'+o+'_text" class="cke_text cke_inline_label">'+this.label+"</span></span><span class=cke_openbutton>"+(b.hc?"<span>&#9660;</span>":"")+"</span></a></span></span>");
if(this.onRender){this.onRender()}return q},createPanel:function(l){if(this._.panel){return}var m=this._.panelDefinition,n=this._.panelDefinition.block,o=m.parent||a.document.getBody(),p=new k.floatPanel(l,o,m),q=p.addListBlock(this.id,n),r=this;
p.onShow=function(){if(r.className){this.element.getFirst().addClass(r.className+"_panel")}r.setState(1);q.focus(!r.multiSelect&&r.getValue());r._.on=1;if(r.onOpen){r.onOpen()}};p.onHide=function(){if(r.className){this.element.getFirst().removeClass(r.className+"_panel")
}r.setState(2);r._.on=0;if(r.onClose){r.onClose()}};p.onEscape=function(){p.hide();r.document.getById("cke_"+r.id).getFirst().getNext().focus()};q.onClick=function(s,t){r.document.getWindow().focus();if(r.onClick){r.onClick.call(r,s,t)
}if(t){r.setValue(s,r._.items[s])}else{r.setValue("")}p.hide()};this._.panel=p;this._.list=q;p.getBlock(this.id).onHide=function(){r._.on=0;r.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)){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.$nonBodyContent,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("title",{indent:false,breakAfterOpen:false});n.setRules("style",{indent:false,breakBeforeClose: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(typeof m=="string"){this.forceSimpleAmpersand&&(m=m.replace(/&amp;/g,"&"));
m=e.htmlEncodeAttr(m)}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){var n=this._.rules[l];if(n){e.extend(n,m,true)}else{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.definition.panel.attributes["aria-label"]=m.lang.common.options;
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("dialogui");(function(){var l=function(t){var w=this;w._||(w._={});
w._["default"]=w._.initValue=t["default"]||"";w._.required=t.required||false;var u=[w._];for(var v=1;v<arguments.length;v++){u.push(arguments[v])}u.push(true);e.extend.apply(e,u);return w._},m={build:function(t,u,v){return new k.dialog.textInput(t,u,v)
}},n={build:function(t,u,v){return new k.dialog[u.type](t,u,v)}},o={build:function(t,u,v){var w=u.children,x,y=[],z=[];for(var A=0;A<w.length&&(x=w[A]);A++){var B=[];y.push(B);z.push(a.dialog._.uiElementBuilders[x.type].build(t,x,B))
}return new k.dialog[u.type](t,z,y,v,u)}},p={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}},q=e.extend({},k.dialog.uiElement.prototype.eventProcessors,{onChange:function(t,u){if(!this._.domOnChangeRegistered){t.on("load",function(){this.getInputElement().on("change",function(){if(!t.parts.dialog.isVisible()){return
}this.fire("change",{value:this.getValue()})},this)},this);this._.domOnChangeRegistered=true}this.on("change",u)}},true),r=/^on([A-Z]\w+)/,s=function(t){for(var u in t){if(r.test(u)||u=="title"||u=="type"){delete t[u]
}}return t};e.extend(k.dialog,{labeledElement:function(t,u,v,w){if(arguments.length<4){return}var x=l.call(this,u);x.labelId=e.getNextNumber()+"_label";var y=this._.children=[],z=function(){var A=[],B=u.required?" cke_required":"";
if(u.labelLayout!="horizontal"){A.push('<label class="cke_dialog_ui_labeled_label'+B+'" ',' id="'+x.labelId+'"',' for="'+x.inputId+'"',' style="'+u.labelStyle+'">',u.label,"</label>",'<div class="cke_dialog_ui_labeled_content" role="presentation">',w.call(this,t,u),"</div>")
}else{var C={type:"hbox",widths:u.widths,padding:0,children:[{type:"html",html:'<label class="cke_dialog_ui_labeled_label'+B+'" id="'+x.labelId+'" for="'+x.inputId+'" style="'+u.labelStyle+'">'+e.htmlEncode(u.label)+"</span>"},{type:"html",html:'<span class="cke_dialog_ui_labeled_content">'+w.call(this,t,u)+"</span>"}]};
a.dialog._.uiElementBuilders.hbox.build(t,C,A)}return A.join("")};k.dialog.uiElement.call(this,t,u,v,"div",null,{role:"presentation"},z)},textInput:function(t,u,v){if(arguments.length<3){return}l.call(this,u);
var w=this._.inputId=e.getNextNumber()+"_textInput",x={"class":"cke_dialog_ui_input_"+u.type,id:w,type:"text"},y;if(u.validate){this.validate=u.validate}if(u.maxLength){x.maxlength=u.maxLength}if(u.size){x.size=u.size
}if(u.controlStyle){x.style=u.controlStyle}var z=this,A=false;t.on("load",function(){z.getInputElement().on("keydown",function(C){if(C.data.getKeystroke()==13){A=true}});z.getInputElement().on("keyup",function(C){if(C.data.getKeystroke()==13&&A){t.getButton("ok")&&setTimeout(function(){t.getButton("ok").click()
},0);A=false}},null,null,1000)});var B=function(){var C=['<div class="cke_dialog_ui_input_',u.type,'" role="presentation"'];if(u.width){C.push('style="width:'+u.width+'" ')}C.push("><input ");x["aria-labelledby"]=this._.labelId;
this._.required&&(x["aria-required"]=this._.required);for(var D in x){C.push(D+'="'+x[D]+'" ')}C.push(" /></div>");return C.join("")};k.dialog.labeledElement.call(this,t,u,v,B)},textarea:function(t,u,v){if(arguments.length<3){return
}l.call(this,u);var w=this,x=this._.inputId=e.getNextNumber()+"_textarea",y={};if(u.validate){this.validate=u.validate}y.rows=u.rows||5;y.cols=u.cols||20;var z=function(){y["aria-labelledby"]=this._.labelId;
this._.required&&(y["aria-required"]=this._.required);var A=['<div class="cke_dialog_ui_input_textarea" role="presentation"><textarea class="cke_dialog_ui_input_textarea" id="',x,'" '];for(var B in y){A.push(B+'="'+e.htmlEncode(y[B])+'" ')
}A.push(">",e.htmlEncode(w._["default"]),"</textarea></div>");return A.join("")};k.dialog.labeledElement.call(this,t,u,v,z)},checkbox:function(t,u,v){if(arguments.length<3){return}var w=l.call(this,u,{"default":!!u["default"]});
if(u.validate){this.validate=u.validate}var x=function(){var y=e.extend({},u,{id:u.id?u.id+"_checkbox":e.getNextNumber()+"_checkbox"},true),z=[],A=e.getNextNumber()+"_label",B={"class":"cke_dialog_ui_checkbox_input",type:"checkbox","aria-labelledby":A};
s(y);if(u["default"]){B.checked="checked"}if(typeof y.controlStyle!="undefined"){y.style=y.controlStyle}w.checkbox=new k.dialog.uiElement(t,y,z,"input",null,B);z.push(' <label id="',A,'" for="',B.id,'">',e.htmlEncode(u.label),"</label>");
return z.join("")};k.dialog.uiElement.call(this,t,u,v,"span",null,null,x)},radio:function(t,u,v){if(arguments.length<3){return}l.call(this,u);if(!this._["default"]){this._["default"]=this._.initValue=u.items[0][1]
}if(u.validate){this.validate=u.valdiate}var w=[],x=this,y=function(){var z=[],A=[],B={"class":"cke_dialog_ui_radio_item","aria-labelledby":this._.labelId},C=u.id?u.id+"_radio":e.getNextNumber()+"_radio";
for(var D=0;D<u.items.length;D++){var E=u.items[D],F=E[2]!==undefined?E[2]:E[0],G=E[1]!==undefined?E[1]:E[0],H=e.getNextNumber()+"_radio_input",I=H+"_label",J=e.extend({},u,{id:H,title:null,type:null},true),K=e.extend({},J,{title:F},true),L={type:"radio","class":"cke_dialog_ui_radio_input",name:C,value:G,"aria-labelledby":I},M=[];
if(x._["default"]==G){L.checked="checked"}s(J);s(K);if(typeof J.controlStyle!="undefined"){J.style=J.controlStyle}w.push(new k.dialog.uiElement(t,J,M,"input",null,L));M.push(" ");new k.dialog.uiElement(t,K,M,"label",null,{id:I,"for":L.id},E[0]);
z.push(M.join(""))}new k.dialog.hbox(t,[],z,A);return A.join("")};k.dialog.labeledElement.call(this,t,u,v,y);this._.children=w},button:function(t,u,v){if(!arguments.length){return}if(typeof u=="function"){u=u(t.getParentEditor())
}l.call(this,u,{disabled:u.disabled||false});a.event.implementOn(this);var w=this;t.on("load",function(z){var A=this.getElement();(function(){A.on("click",function(B){w.fire("click",{dialog:w.getDialog()});
B.data.preventDefault()});A.on("keydown",function(B){if(B.data.getKeystroke() in {32:1}){w.click();B.data.preventDefault()}})})();A.unselectable()},this);var x=e.extend({},u);delete x.style;var y=e.getNextNumber()+"_label";
k.dialog.uiElement.call(this,t,x,v,"a",null,{style:u.style,href:"javascript:void(0)",title:u.label,hidefocus:"true","class":u["class"],role:"button","aria-labelledby":y},'<span id="'+y+'" class="cke_dialog_ui_button">'+e.htmlEncode(u.label)+"</span>")
},select:function(t,u,v){if(arguments.length<3){return}var w=l.call(this,u);if(u.validate){this.validate=u.validate}w.inputId=e.getNextNumber()+"_select";var x=function(){var y=e.extend({},u,{id:u.id?u.id+"_select":e.getNextNumber()+"_select"},true),z=[],A=[],B={id:w.inputId,"class":"cke_dialog_ui_input_select","aria-labelledby":this._.labelId};
if(u.size!=undefined){B.size=u.size}if(u.multiple!=undefined){B.multiple=u.multiple}s(y);for(var C=0,D;C<u.items.length&&(D=u.items[C]);C++){A.push('<option value="',e.htmlEncode(D[1]!==undefined?D[1]:D[0]),'" /> ',e.htmlEncode(D[0]))
}if(typeof y.controlStyle!="undefined"){y.style=y.controlStyle}w.select=new k.dialog.uiElement(t,y,z,"select",null,B,A.join(""));return z.join("")};k.dialog.labeledElement.call(this,t,u,v,x)},file:function(t,u,v){if(arguments.length<3){return
}if(u["default"]===undefined){u["default"]=""}var w=e.extend(l.call(this,u),{definition:u,buttons:[]});if(u.validate){this.validate=u.validate}var x=function(){w.frameId=e.getNextNumber()+"_fileInput";
var y=b.isCustomDomain(),z=['<iframe frameborder="0" allowtransparency="0" class="cke_dialog_ui_input_file" id="',w.frameId,'" title="',u.label,'" src="javascript:void('];z.push(y?"(function(){document.open();document.domain='"+document.domain+"';document.close();})()":"0");
z.push(')"></iframe>');return z.join("")};t.on("load",function(){var y=a.document.getById(w.frameId),z=y.getParent();z.addClass("cke_dialog_ui_input_file")});k.dialog.labeledElement.call(this,t,u,v,x)},fileButton:function(t,u,v){if(arguments.length<3){return
}var w=l.call(this,u),x=this;if(u.validate){this.validate=u.validate}var y=e.extend({},u),z=y.onClick;y.className=(y.className?y.className+" ":"")+"cke_dialog_ui_button";y.onClick=function(A){var B=u["for"];
if(!z||z.call(this,A)!==false){t.getContentElement(B[0],B[1]).submit();this.disable()}};t.on("load",function(){t.getContentElement(u["for"][0],u["for"][1])._.buttons.push(x)});k.dialog.button.call(this,t,y,v)
},html:(function(){var t=/^\s*<[\w:]+\s+([^>]*)?>/,u=/^(\s*<[\w:]+(?:\s+[^>]*)?)((?:.|\r|\n)+)$/,v=/\/$/;return function(w,x,y){if(arguments.length<3){return}var z=[],A,B=x.html,C,D;if(B.charAt(0)!="<"){B="<span>"+B+"</span>"
}var E=x.focus;if(E){var F=this.focus;this.focus=function(){F.call(this);typeof E=="function"&&E.call(this);this.fire("focus")};if(x.isFocusable){var G=this.isFocusable;this.isFocusable=G}this.keyboardFocusable=true
}k.dialog.uiElement.call(this,w,x,z,"span",null,null,"");A=z.join("");C=A.match(t);D=B.match(u)||["","",""];if(v.test(D[1])){D[1]=D[1].slice(0,-1);D[2]="/"+D[2]}y.push([D[1]," ",C[1]||"",D[2]].join(""))
}})(),fieldset:function(t,u,v,w,x){var y=x.label,z=function(){var A=[];y&&A.push("<legend>"+y+"</legend>");for(var B=0;B<v.length;B++){A.push(v[B])}return A.join("")};this._={children:u};k.dialog.uiElement.call(this,t,x,w,"fieldset",null,null,z)
}},true);k.dialog.html.prototype=new k.dialog.uiElement();k.dialog.labeledElement.prototype=e.extend(new k.dialog.uiElement(),{setLabel:function(t){var u=a.document.getById(this._.labelId);if(u.getChildCount()<1){new d.text(t,a.document).appendTo(u)
}else{u.getChild(0).$.nodeValue=t}return this},getLabel:function(){var t=a.document.getById(this._.labelId);if(!t||t.getChildCount()<1){return""}else{return t.getChild(0).getText()}},eventProcessors:q},true);
k.dialog.button.prototype=e.extend(new k.dialog.uiElement(),{click:function(){var t=this;if(!t._.disabled){return t.fire("click",{dialog:t._.dialog})}t.getElement().$.blur();return false},enable:function(){this._.disabled=false;
var t=this.getElement();t&&t.removeClass("disabled")},disable:function(){this._.disabled=true;this.getElement().addClass("disabled")},isVisible:function(){return this.getElement().getFirst().isVisible()
},isEnabled:function(){return !this._.disabled},eventProcessors:e.extend({},k.dialog.uiElement.prototype.eventProcessors,{onClick:function(t,u){this.on("click",u)}},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 t=this.selectParentTab();setTimeout(function(){var u=t.getInputElement();u&&u.$.focus()},0)},select:function(){var t=this.selectParentTab();setTimeout(function(){var u=t.getInputElement();
if(u){u.$.focus();u.$.select()}},0)},accessKeyUp:function(){this.select()},setValue:function(t){!t&&(t="");return k.dialog.uiElement.prototype.setValue.call(this,t)},keyboardFocusable:true},p,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(t,u,v){var w=new h("option",this.getDialog().getParentEditor().document),x=this.getInputElement().$;
w.$.text=t;w.$.value=u===undefined||u===null?t:u;if(v===undefined||v===null){if(c){x.add(w.$)}else{x.add(w.$,null)}}else{x.add(w.$,v)}return this},remove:function(t){var u=this.getInputElement().$;u.remove(t);
return this},clear:function(){var t=this.getInputElement().$;while(t.length>0){t.remove(0)}return this},keyboardFocusable:true},p,true);k.dialog.checkbox.prototype=e.extend(new k.dialog.uiElement(),{getInputElement:function(){return this._.checkbox.getElement()
},setValue:function(t){this.getInputElement().$.checked=t;this.fire("change",{value:t})},getValue:function(){return this.getInputElement().$.checked},accessKeyUp:function(){this.setValue(!this.getValue())
},eventProcessors:{onChange:function(t,u){if(!c){return q.onChange.apply(this,arguments)}else{t.on("load",function(){var v=this._.checkbox.getElement();v.on("propertychange",function(w){w=w.data.$;if(w.propertyName=="checked"){this.fire("change",{value:v.$.checked})
}},this)},this);this.on("change",u)}return null}},keyboardFocusable:true},p,true);k.dialog.radio.prototype=e.extend(new k.dialog.uiElement(),{setValue:function(t){var u=this._.children,v;for(var w=0;w<u.length&&(v=u[w]);
w++){v.getElement().$.checked=v.getValue()==t}this.fire("change",{value:t})},getValue:function(){var t=this._.children;for(var u=0;u<t.length;u++){if(t[u].getElement().$.checked){return t[u].getValue()
}}return null},accessKeyUp:function(){var t=this._.children,u;for(u=0;u<t.length;u++){if(t[u].getElement().$.checked){t[u].getElement().focus();return}}t[0].getElement().focus()},eventProcessors:{onChange:function(t,u){if(!c){return q.onChange.apply(this,arguments)
}else{t.on("load",function(){var v=this._.children,w=this;for(var x=0;x<v.length;x++){var y=v[x].getElement();y.on("propertychange",function(z){z=z.data.$;if(z.propertyName=="checked"&&this.$.checked){w.fire("change",{value:this.getAttribute("value")})
}})}},this);this.on("change",u)}return null}},keyboardFocusable:true},p,true);k.dialog.file.prototype=e.extend(new k.dialog.labeledElement(),p,{getInputElement:function(){var t=a.document.getById(this._.frameId).getFrameDocument();
return t.$.forms.length>0?new h(t.$.forms[0].elements[0]):this.getElement()},submit:function(){this.getInputElement().getParent().$.submit();return this},getAction:function(){return this.getInputElement().getParent().$.action
},registerEvents:function(t){var u=/^on([A-Z]\w+)/,v,w=function(y,z,A,B){y.on("formLoaded",function(){y.getInputElement().on(A,B,y)})};for(var x in t){if(!(v=x.match(u))){continue}if(this.eventProcessors[x]){this.eventProcessors[x].call(this,this._.dialog,t[x])
}else{w(this,this._.dialog,v[1].toLowerCase(),t[x])}}return this},reset:function(){var t=a.document.getById(this._.frameId),u=t.getFrameDocument(),v=this._.definition,w=this._.buttons,x=this.formLoadedNumber,y=this.formUnloadNumber,z=this._.dialog._.editor.lang.dir,A=this._.dialog._.editor.langCode;
if(!x){x=this.formLoadedNumber=e.addFunction(function(){this.fire("formLoaded")},this);y=this.formUnloadNumber=e.addFunction(function(){this.getInputElement().clearCustomData()},this);this.getDialog()._.editor.on("destroy",function(){e.removeFunction(x);
e.removeFunction(y)})}function B(){u.$.open();if(b.isCustomDomain()){u.$.domain=document.domain}var C="";if(v.size){C=v.size-(c?7:0)}u.$.write(['<html dir="'+z+'" lang="'+A+'"><head><title></title></head><body style="margin: 0; overflow: hidden; background: transparent;">','<form enctype="multipart/form-data" method="POST" dir="'+z+'" lang="'+A+'" action="',e.htmlEncode(v.action),'">','<input type="file" name="',e.htmlEncode(v.id||"cke_upload"),'" size="',e.htmlEncode(C>0?C:""),'" />',"</form>","</body></html>","<script>window.parent.CKEDITOR.tools.callFunction("+x+");","window.onbeforeunload = function() {window.parent.CKEDITOR.tools.callFunction("+y+")}<\/script>"].join(""));
u.$.close();for(var D=0;D<w.length;D++){w[D].enable()}}if(b.gecko){setTimeout(B,500)}else{B()}},getValue:function(){return this.getInputElement().$.value},setInitValue:function(){this._.initValue=""},eventProcessors:{onChange:function(t,u){if(!this._.domOnChangeRegistered){this.on("formLoaded",function(){this.getInputElement().on("change",function(){this.fire("change",{value:this.getValue()})
},this)},this);this._.domOnChangeRegistered=true}this.on("change",u)}},keyboardFocusable:true},true);k.dialog.fileButton.prototype=new k.dialog.button();k.dialog.fieldset.prototype=e.clone(k.dialog.hbox.prototype);
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.dialog.addUIElement("fieldset",o)})();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,'" role="presentation" style="display:none;z-index:'+(l.config.baseFloatZIndex+1)+'"><div id=',n," dir=",l.lang.dir,' role="presentation" 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" role="application" 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>'+e.buildStyleHtml(this.css)+"</html>");
r.$.close();var t=r.getWindow();t.$.CKEDITOR=a;r.on("keydown",function(u){var x=this;var v=u.data.getKeystroke(),w=x.document.getById("cke_"+x.id).getAttribute("dir");if(x._.onKeyDown&&x._.onKeyDown(v)===false){u.data.preventDefault();
return}if(v==27||v==(w=="rtl"?39:37)){if(x.onEscape&&x.onEscape(v)===false){u.data.preventDefault()}}},this);l=r.getBody();l.unselectable()}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 instanceof k.panel.block?m:new k.panel.block(n.getHolderElement(),m);if(!n._.currentBlock){n.showBlock(l)}return m},getBlock:function(l){return this._.blocks[l]
},showBlock:function(l){var m=this._.blocks,n=m[l],o=this._.currentBlock,p=this.forceIFrame?this.document.getById("cke_"+this.id+"_frame"):this._.holder;p.getParent().getParent().disableContextMenu();if(o){p.removeAttributes(o.attributes);
o.hide()}this._.currentBlock=n;p.setAttributes(n.attributes);a.fire("ariaWidget",p);n._.focusIndex=-1;this._.onKeyDown=n.onKeyDown&&e.bind(n.onKeyDown,n);n.onMark=function(q){p.setAttribute("aria-activedescendant",q.getId()+"_option")
};n.onUnmark=function(){p.removeAttribute("aria-activedescendant")};n.show();return n},destroy:function(){this.element&&this.element.remove()}};k.panel.block=e.createClass({$:function(l,m){var n=this;n.element=l.append(l.getDocument().createElement("div",{attributes:{tabIndex:-1,"class":"cke_panel_block",role:"presentation"},styles:{display:"none"}}));
if(m){e.extend(n,m)}if(!n.attributes.title){n.attributes.title=n.attributes["aria-label"]}n.keys={};n._.focusIndex=-1;n.element.disableContextMenu()},_:{markItem:function(l){var o=this;if(l==-1){return
}var m=o.element.getElementsByTag("a"),n=m.getItem(o._.focusIndex=l);if(b.webkit){n.getDocument().getWindow().focus()}n.focus();o.onMark&&o.onMark(n)}},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 p=this;m=m||{};var n=m.attributes||(m.attributes={});(p.multiSelect=!!m.multiSelect)&&(n["aria-multiselectable"]=true);!n.role&&(n.role="listbox");
p.base.apply(p,arguments);var o=p.keys;o[40]="next";o[9]="next";o[38]="prev";o[2000+9]="prev";o[32]="click";p._.pendingHtml=[];p._.items={};p._.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 role="presentation" class=cke_panel_list>');q._.started=1;q._.size=q._.size||0
}q._.items[l]=p;o.push("<li id=",p,' class=cke_panel_listItem><a id="',p,'_option" _cke_focus=1 hidefocus=true title="',n||l,'" href="javascript:void(\'',l,'\')" onclick="CKEDITOR.tools.callFunction(',q._.getClick(),",'",l,"'); return false;\"",' role="option" aria-posinset="'+ ++q._.size+'">',m||l,"</a></li>")
},startGroup:function(l){this._.close();var m="cke_"+e.getNextNumber();this._.groups[l]=m;this._.pendingHtml.push('<h1 role="presentation" id=',m," class=cke_panel_grouptitle>",l,"</h1>")},commit:function(){var o=this;
o._.close();o.element.appendHtml(o._.pendingHtml.join(""));var l=o._.items,m=o.element.getDocument();for(var n in l){m.getById(l[n]+"_option").setAttribute("aria-setsize",o._.size)}delete o._.size;o._.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 o=this;
if(!o.multiSelect){o.unmarkAll()}var m=o._.items[l],n=o.element.getDocument().getById(m);n.addClass("cke_selected");o.element.getDocument().getById(m+"_option").setAttribute("aria-selected",true);o.element.setAttribute("aria-activedescendant",m+"_option");
o.onMark&&o.onMark(n)},unmark:function(l){var m=this;m.element.getDocument().getById(m._.items[l]).removeClass("cke_selected");m.onUnmark&&m.onUnmark(m._.items[l])},unmarkAll:function(){var o=this;var l=o._.items,m=o.element.getDocument();
for(var n in l){m.getById(l[n]).removeClass("cke_selected")}o.onUnmark&&o.onUnmark()},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)}}}})}});a.themes.add("default",(function(){function l(m,n){var o,p;p=m.config.sharedSpaces;p=p&&p[n];p=p&&a.document.getById(p);if(p){var q='<span class="cke_shared"><span class="'+m.skinClass+" cke_editor_"+m.name+'"><span class="'+b.cssClass+'"><span class="cke_wrapper cke_'+m.lang.dir+'"><span class="cke_editor"><div class="cke_'+n+'"></div></span></span></span></span></span>',r=p.append(h.createFromHtml(q,p.getDocument()));
if(p.getCustomData("cke_hasshared")){r.hide()}else{p.setCustomData("cke_hasshared",1)}o=r.getChild([0,0,0,0]);m.on("focus",function(){for(var s=0,t,u=p.getChildren();t=u.getItem(s);s++){if(t.type==1&&!t.equals(r)&&t.hasClass("cke_shared")){t.hide()
}}r.show()});m.on("destroy",function(){r.remove()})}return o}return{build:function(m,n){var o=m.name,p=m.element,q=m.elementMode;if(!p||q==0){return}if(q==1){p.hide()}var r=m.fire("themeSpace",{space:"top",html:""}).html,s=m.fire("themeSpace",{space:"contents",html:""}).html,t=m.fireOnce("themeSpace",{space:"bottom",html:""}).html,u=s&&m.config.height,v=m.config.tabIndex||m.element.getAttribute("tabindex")||0;
if(!s){u="auto"}else{if(!isNaN(u)){u+="px"}}var w="",x=m.config.width;if(x){if(!isNaN(x)){x+="px"}w+="width: "+x+";"}var y=r&&l(m,"top"),z=l(m,"bottom");y&&(y.setHtml(r),r="");z&&(z.setHtml(t),t="");var A=h.createFromHtml(['<span id="cke_',o,'" onmousedown="return false;" class="',m.skinClass," cke_editor_",o,'" dir="',m.lang.dir,'" title="',b.gecko?" ":"",'" lang="',m.langCode,'"'+(b.webkit?' tabindex="'+v+'"':"")+' role="application" aria-labelledby="cke_',o,'_arialbl"'+(w?' style="'+w+'"':"")+'><span id="cke_',o,'_arialbl" class="cke_voice_label">'+m.lang.editor+'</span><span class="',b.cssClass,'" role="presentation"><span class="cke_wrapper cke_',m.lang.dir,'" role="presentation"><table class="cke_editor" border="0" cellspacing="0" cellpadding="0" role="presentation"><tbody><tr',r?"":' style="display:none"',' role="presentation"><td id="cke_top_',o,'" class="cke_top" role="presentation">',r,"</td></tr><tr",s?"":' style="display:none"',' role="presentation"><td id="cke_contents_',o,'" class="cke_contents" style="height:',u,'" role="presentation">',s,"</td></tr><tr",t?"":' style="display:none"',' role="presentation"><td id="cke_bottom_',o,'" class="cke_bottom" role="presentation">',t,"</td></tr></tbody></table><style>.",m.skinClass,"{visibility:hidden;}</style></span></span></span>"].join(""));
A.getChild([1,0,0,0,0]).unselectable();A.getChild([1,0,0,0,2]).unselectable();if(q==1){A.insertAfter(p)}else{p.append(A)}m.container=A;A.disableContextMenu();m.fireOnce("themeLoaded");m.fireOnce("uiReady")
},buildDialog:function(m){var n=e.getNextNumber(),o=h.createFromHtml(['<div class="cke_editor_'+m.name.replace(".","\\.")+"_dialog cke_skin_",m.skinName,'" dir="',m.lang.dir,'" lang="',m.langCode,'" role="dialog" aria-labelledby="%title#"><table class="cke_dialog'," "+b.cssClass," cke_",m.lang.dir,'" style="position:absolute" role="presentation"><tr><td role="presentation"><div class="%body" role="presentation"><div id="%title#" class="%title" role="presentation"></div><a id="%close_button#" class="%close_button" href="javascript:void(0)" title="'+m.lang.common.close+'" role="button"><span class="cke_label">X</span></a><div id="%tabs#" class="%tabs" role="tablist"></div><table class="%contents" role="presentation"><tr><td id="%contents#" class="%contents" role="presentation"></td></tr></table><div id="%footer#" class="%footer" role="presentation"></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></td></tr></table>',c?"":"<style>.cke_dialog{visibility:hidden;}</style>","</div>"].join("").replace(/#/g,"_"+n).replace(/%/g,"cke_dialog_")),p=o.getChild([0,0,0,0,0]),q=p.getChild(0),r=p.getChild(1);
q.unselectable();r.unselectable();return{element:o,parts:{dialog:o.getChild(0),title:q,close:r,tabs:p.getChild(2),contents:p.getChild([3,0,0,0]),footer:p.getChild(4)}}},destroy:function(m){var n=m.container;
n.clearCustomData();m.element.clearCustomData();if(n){n.remove()}if(m.elementMode==1){m.element.show()}delete m.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=this.container,r=a.document.getById("cke_contents_"+this.name),s=o?q.getChild(1):q;b.webkit&&s.setStyle("display","none");
s.setStyle("width",l);if(b.webkit){s.$.offsetWidth;s.setStyle("display","")}var t=n?0:(s.$.offsetHeight||0)-(r.$.clientHeight||0);r.setStyle("height",Math.max(m-t,0)+"px");this.fire("resize")};a.editor.prototype.getResizable=function(){return this.container.getChild(1)
}})();if(!SL.ext){SL.ext={}}(function(){SL.ext.GoogleMaps=Class.create(SL.Component,{init:function(){this.config.setDefault("type",google.maps.MapTypeId.ROADMAP);this.config.setDefault("map_type_control",false);
this.config.setDefault("navigation_control",false);this.config.setDefault("street_view_control",false);var a={zoom:this.config.get("zoom"),mapTypeId:this.config.get("type"),mapTypeControl:this.config.get("map_type_control"),navigationControl:this.config.get("navigation_control"),streetViewControl:this.config.get("street_view_control")};
this.map=new google.maps.Map(this.e,a);this.geocoder=new google.maps.Geocoder();this.latlng=[];var b=this.config.get("markers");this.multi=b.length>1;$A(b).each(function(c){if(c.latlng){var d=new google.maps.Marker({map:this.map,position:c.latlng,title:c.title});
if(!this.multi){this.map.setCenter(c.latlng)}this.latlng.push(c.latlng);if(c.tooltip){var f=new google.maps.InfoWindow({content:c.tooltip});google.maps.event.addListener(d,"click",function(g){if(g.win){g.win.close()
}f.open(this.map,d);g.win=f}.curry(this))}}else{this.geocoder.geocode({address:c.address},this.onGeoResult.bind(this,c))}}.bind(this));if(this.multi||!this.config.get("zoom")){this.updateMap()}},onGeoResult:function(a,d,c){if(c==google.maps.GeocoderStatus.OK){if(!this.multi){this.map.setCenter(d[0].geometry.location)
}var b=new google.maps.Marker({map:this.map,position:d[0].geometry.location,title:a.title});this.latlng.push(d[0].geometry.location);if(a.tooltip){var f=new google.maps.InfoWindow({content:a.tooltip});
google.maps.event.addListener(b,"click",function(g){if(g.win){g.win.close()}f.open(this.map,b);g.win=f}.curry(this))}if(this.multi||!this.config.get("zoom")){this.updateMap()}else{this.map.setCenter(d[0].geometry.location)
}}else{console.log("No location for address",a.address+c)}},updateMap:function(){var b=new google.maps.LatLngBounds();for(var a=0;a<this.latlng.length;a++){b.extend(this.latlng[a])}this.map.fitBounds(b);
this.map.setCenter(b.getCenter())}})})();
