window.txEval=function(source,target){if(typeof source=="function"){return source.call(target||this)}else{if(typeof source=="string"){return(target)?target.eval(source):this.eval(source)}}};(function(){try{EditorJSLoader.readyState="loading"}catch(s){}var b=document,h=window,n=b.documentElement,c=false,u=true,i=null,q;if(typeof JSON!=="object"){JSON={}}(function(){function y(E){return E<10?"0"+E:E}if(typeof Date.prototype.toJSON!=="function"){Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+y(this.getUTCMonth()+1)+"-"+y(this.getUTCDate())+"T"+y(this.getUTCHours())+":"+y(this.getUTCMinutes())+":"+y(this.getUTCSeconds())+"Z":null};String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}}var x=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,A=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,B,w,D={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},C; function e(E){A.lastIndex=0;return A.test(E)?'"'+E.replace(A,function(F){var G=D[F];return typeof G==="string"?G:"\\u"+("0000"+F.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+E+'"'}function z(L,I){var G,F,M,E,J=B,H,K=I[L];if(K&&typeof K==="object"&&typeof K.toJSON==="function"){K=K.toJSON(L)}if(typeof C==="function"){K=C.call(I,L,K)}switch(typeof K){case"string":return e(K);case"number":return isFinite(K)?String(K):"null";case"boolean":case"null":return String(K);case"object":if(!K){return"null"}B+=w;H=[];if(Object.prototype.toString.apply(K)==="[object Array]"){E=K.length;for(G=0;G1){for(var A=0,D=[],C=z.length;A0){if(w=y.match(z)){e+=y.slice(0,w.index); e+=String.interpret(x(w));y=y.slice(w.index+w[0].length)}else{e+=y,y=""}}return e},strip:function(){return this.replace(/^\s+/,"").replace(/\s+$/,"")},stripTags:function(){return this.replace(/<\/?[^>]+>/gi,"")},toQueryParams:function(y){var e=this.strip().match(/([^?#]*)(#.*)?$/);if(!e){return{}}var x={};var w=i;e[1].split(y||"&").each(function(C){var B=i,z=i;var A=C.match(/([\w_]+)=(.*)/);if(A){w=B=decodeURIComponent(A[1]);if(A[2]){z=decodeURIComponent(A[2])}}else{if(w){B=w;z=x[B];z+="&"+decodeURIComponent(C)}else{return}}if(B in x){if(x[B].constructor!=Array){x[B]=[x[B]]}x[B].push(z)}else{x[B]=z}});return x},toArray:function(){return this.split("")},times:function(x){var e="";for(var w=0;w-1},empty:function(){return this==""},blank:function(){return/^\s*$/.test(this)}});String.prototype.gsub.prepareReplacement=function(w){if(typeof w=="function"){return w}var e=new Template(w);return function(x){return e.evaluate(x)}};t.extend(String.prototype,{trim:function(){return this.replace(/(^\s*)|(\s*$)/g,"")},getRegExp:function(){return this.replace(/\\/g,"\\\\").replace(/\./g,"\\.").replace(/\//g,"\\/").replace(/\?/g,"\\?").replace(/\^/g,"\\^").replace(/\)/g,"\\)").replace(/\(/g,"\\(").replace(/\]/g,"\\]").replace(/\[/g,"\\[").replace(/\$/g,"\\$").replace(/\+/g,"\\+").replace(/\|/g,"\\|").replace(/&/g,"(&|&)")},toNumber:function(){return(isNaN(this)?0:parseInt(this,10))},toFloat:function(){return(isNaN(this)?0:parseFloat(this))},getRealLength:function(){var x=this;var e=0;for(var w=0;wx){return y.substring(0,w-3).concat("...")}}return y},getCut:function(e){return this.cutRealLength(e)},parsePx:function(){if(this==i||this.length==0){return 0}else{if(this.indexOf("px")>-1){return this.substring(0,this.indexOf("px")).toNumber()}else{return this.toNumber()}}},toPx:function(){if(this.indexOf("px")>-1){return this+""}else{return this+"px"}},isPx:function(){var e=this;if(e.trim()==""){return false}else{if(e.indexOf("px")!=-1){e=this.parsePx()}}return !isNaN(e)},isPercent:function(){var e=this.trim();return parseInt(e,10)+"%"===e},toByteUnit:function(){return this.toNumber().toByteUnit()},toCurrency:function(){var w=this;for(var e=0;e=0},pluck:function(w){var e=[];this.each(function(x){e.push(x[w])});return e},find:function(y){for(var w=0,e=this.length;w0){return A[0]}else{return i}};z.prototype.createNode=function(A,C,B){if(A==1){return this.createElementNS(B,C)}else{return i}}}if(typeof(Element)!=q+""){Element.prototype.selectNodes=function(A){if(this.ownerDocument.selectNodes){return this.ownerDocument.selectNodes(A,this)}else{throw"For XML Elements Only"}};Element.prototype.selectSingleNode=function(A){if(this.ownerDocument.selectSingleNode){return this.ownerDocument.selectSingleNode(A,this)}else{throw"For XML Elements Only"}};Element.prototype.text;var y=Element.prototype;var e=y.__proto__={__proto__:y.__proto__};if(Element.prototype.__defineSetter__){e.__defineSetter__("text",function(A){this.textContent=A})}if(Element.prototype.__defineGetter__){e.__defineGetter__("text",function(){return this.textContent})}if(h.origElement){h.origElement.prototype.selectNodes=Element.prototype.selectNodes;h.origElement.prototype.selectSingleNode=Element.prototype.selectSingleNode}}}}})();h.$tx=t;var d=h.goog=h.goog||{}; d.global=h;d.LOCALE="en";d.provide=function(e){d.exportPath_(e)};d.exportPath_=function(x,e,A){var y=x.split(".");var z=A||d.global;if(!(y[0] in z)&&z.execScript){z.execScript("var "+y[0])}for(var w;y.length&&(w=y.shift());){if(!y.length&&d.isDef(e)){z[w]=e}else{if(z[w]){z=z[w]}else{z=z[w]={}}}}};d.abstractMethod=function(){throw Error("unimplemented abstract method")};d.typeOf=function(x){var w=typeof x;if(w=="object"){if(x){if(x instanceof Array){return"array"}else{if(x instanceof Object){return w}}var e=Object.prototype.toString.call((x));if(e=="[object Window]"){return"object"}if((e=="[object Array]"||typeof x.length=="number"&&typeof x.splice!=q+""&&typeof x.propertyIsEnumerable!=q+""&&!x.propertyIsEnumerable("splice"))){return"array"}if((e=="[object Function]"||typeof x.call!=q+""&&typeof x.propertyIsEnumerable!=q+""&&!x.propertyIsEnumerable("call"))){return"function"}}else{return i+""}}else{if(w=="function"&&typeof x.call==q+""){return"object"}}return w};d.isDef=function(e){return e!==q };d.isNull=function(e){return e===i};d.isDefAndNotNull=function(e){return e!=i};d.isArray=function(e){return d.typeOf(e)=="array"};d.isArrayLike=function(w){var e=d.typeOf(w);return e=="array"||e=="object"&&typeof w.length=="number"};d.isDateLike=function(e){return d.isObject(e)&&typeof e.getFullYear=="function"};d.isString=function(e){return typeof e=="string"};d.isBoolean=function(e){return typeof e=="boolean"};d.isNumber=function(e){return typeof e=="number"};d.isFunction=function(e){return d.typeOf(e)=="function"};d.isObject=function(w){var e=d.typeOf(w);return e=="object"||e=="array"||e=="function"};d.getUid=function(e){return e[d.UID_PROPERTY_]||(e[d.UID_PROPERTY_]=++d.uidCounter_)};d.UID_PROPERTY_="closure_uid_"+Math.floor(Math.random()*2147483648).toString(36);d.uidCounter_=0;Object.prototype.clone;d.bindNative_=function(e,x,w){return(e.call.apply(e.bind,arguments))};d.bindJs_=function(w,z,x){var e=z||d.global;if(arguments.length>2){var y=Array.prototype.slice.call(arguments,2); return function(){var A=Array.prototype.slice.call(arguments);Array.prototype.unshift.apply(A,y);return w.apply(e,A)}}else{return function(){return w.apply(e,arguments)}}};d.bind=function(e,x,w){if(Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1){d.bind=d.bindNative_}else{d.bind=d.bindJs_}return d.bind.apply(i,arguments)};d.partial=function(w,x){var e=Array.prototype.slice.call(arguments,1);return function(){var y=Array.prototype.slice.call(arguments);y.unshift.apply(y,e);return w.apply(this,y)}};d.now=Date.now||(function(){return +new Date()});d.inherits=function(w,e){function x(){}x.prototype=e.prototype;w.superClass_=e.prototype;w.prototype=new x();w.prototype.constructor=w};d.base=function(z,e,B){var x=arguments.callee.caller;if(x.superClass_){return x.superClass_.constructor.apply(z,Array.prototype.slice.call(arguments,1))}var w=Array.prototype.slice.call(arguments,2);var A=c;for(var y=z.constructor;y;y=y.superClass_&&y.superClass_.constructor){if(y.prototype[e]===x){A=u }else{if(A){return y.prototype[e].apply(z,w)}}}if(z[e]===x){return z.constructor.prototype[e].apply(z,w)}else{throw Error("goog.base called from a method of one name to a method of a different name")}};d.provide("goog.string");d.provide("goog.string.Unicode");d.string.Unicode={NBSP:"\xa0"};d.string.startsWith=function(w,e){return w.lastIndexOf(e,0)==0};d.string.isEmpty=function(e){return/^[\s\xa0]*$/.test(e)};d.string.stripNewlines=function(e){return e.replace(/ ?(\r\n|\r|\n)+/g," ")};d.string.canonicalizeNewlines=function(e){return e.replace(/(\r\n|\r|\n)/g,"\n")};d.string.trim=function(e){return e.replace(/^[\s\xa0]+|[\s\xa0]+$/g,"")};d.string.htmlEscape=function(w,e){if(e){return w.replace(d.string.amperRe_,"&").replace(d.string.ltRe_,"<").replace(d.string.gtRe_,">").replace(d.string.quotRe_,""")}else{if(!d.string.allRe_.test(w)){return w}if(w.indexOf("&")!=-1){w=w.replace(d.string.amperRe_,"&")}if(w.indexOf("<")!=-1){w=w.replace(d.string.ltRe_,"<")}if(w.indexOf(">")!=-1){w=w.replace(d.string.gtRe_,">") }if(w.indexOf('"')!=-1){w=w.replace(d.string.quotRe_,""")}return w}};d.string.amperRe_=/&/g;d.string.ltRe_=//g;d.string.quotRe_=/\"/g;d.string.allRe_=/[&<>\"]/;d.string.contains=function(w,e){return w.indexOf(e)!=-1};d.string.buildString=function(e){return Array.prototype.join.call(arguments,"")};d.string.compareVersions=function(w,J){var x=0;var E=d.string.trim(String(w)).split(".");var D=d.string.trim(String(J)).split(".");var A=Math.max(E.length,D.length);for(var B=0;x==0&&Be){return 1}}return 0};d.string.uniqueStringCounter_=Math.random()*2147483648|0;d.string.createUniqueString=function(){return"goog_"+d.string.uniqueStringCounter_++};d.provide("goog.userAgent");d.userAgent.ASSUME_IE=c;d.userAgent.ASSUME_GECKO=c;d.userAgent.ASSUME_WEBKIT=c;d.userAgent.ASSUME_MOBILE_WEBKIT=c;d.userAgent.ASSUME_OPERA=c;d.userAgent.ASSUME_ANY_VERSION=c;d.userAgent.BROWSER_KNOWN_=d.userAgent.ASSUME_IE||d.userAgent.ASSUME_GECKO||d.userAgent.ASSUME_MOBILE_WEBKIT||d.userAgent.ASSUME_WEBKIT||d.userAgent.ASSUME_OPERA;d.userAgent.getUserAgentString=function(){return d.global.navigator?d.global.navigator.userAgent:i};d.userAgent.getNavigator=function(){return d.global.navigator};d.userAgent.init_=function(){d.userAgent.detectedOpera_=c;d.userAgent.detectedIe_=c;d.userAgent.detectedWebkit_=c;d.userAgent.detectedMobile_=c;d.userAgent.detectedGecko_=c;var w;if(!d.userAgent.BROWSER_KNOWN_&&(w=d.userAgent.getUserAgentString())){var e=d.userAgent.getNavigator();d.userAgent.detectedOpera_=d.string.startsWith(w,"Opera"); d.userAgent.detectedIe_=!d.userAgent.detectedOpera_&&(d.string.contains(w,"MSIE")||d.string.contains(w,"Trident"));d.userAgent.detectedWebkit_=!d.userAgent.detectedOpera_&&d.string.contains(w,"WebKit");d.userAgent.detectedMobile_=d.userAgent.detectedWebkit_&&d.string.contains(w,"Mobile");d.userAgent.detectedGecko_=!d.userAgent.detectedOpera_&&!d.userAgent.detectedWebkit_&&!d.userAgent.detectedIe_&&e.product=="Gecko"}};if(!d.userAgent.BROWSER_KNOWN_){d.userAgent.init_()}d.userAgent.OPERA=d.userAgent.BROWSER_KNOWN_?d.userAgent.ASSUME_OPERA:d.userAgent.detectedOpera_;d.userAgent.IE=d.userAgent.BROWSER_KNOWN_?d.userAgent.ASSUME_IE:d.userAgent.detectedIe_;d.userAgent.GECKO=d.userAgent.BROWSER_KNOWN_?d.userAgent.ASSUME_GECKO:d.userAgent.detectedGecko_;d.userAgent.WEBKIT=d.userAgent.BROWSER_KNOWN_?d.userAgent.ASSUME_WEBKIT||d.userAgent.ASSUME_MOBILE_WEBKIT:d.userAgent.detectedWebkit_;d.userAgent.MOBILE=d.userAgent.ASSUME_MOBILE_WEBKIT||d.userAgent.detectedMobile_;d.userAgent.SAFARI=d.userAgent.WEBKIT; d.userAgent.determinePlatform_=function(){var e=d.userAgent.getNavigator();return e&&e.platform||""};d.userAgent.PLATFORM=d.userAgent.determinePlatform_();d.userAgent.ASSUME_MAC=c;d.userAgent.ASSUME_WINDOWS=c;d.userAgent.ASSUME_LINUX=c;d.userAgent.ASSUME_X11=c;d.userAgent.PLATFORM_KNOWN_=d.userAgent.ASSUME_MAC||d.userAgent.ASSUME_WINDOWS||d.userAgent.ASSUME_LINUX||d.userAgent.ASSUME_X11;d.userAgent.initPlatform_=function(){d.userAgent.detectedMac_=d.string.contains(d.userAgent.PLATFORM,"Mac");d.userAgent.detectedWindows_=d.string.contains(d.userAgent.PLATFORM,"Win");d.userAgent.detectedLinux_=d.string.contains(d.userAgent.PLATFORM,"Linux");d.userAgent.detectedX11_=!!d.userAgent.getNavigator()&&d.string.contains(d.userAgent.getNavigator()["appVersion"]||"","X11")};if(!d.userAgent.PLATFORM_KNOWN_){d.userAgent.initPlatform_()}d.userAgent.MAC=d.userAgent.PLATFORM_KNOWN_?d.userAgent.ASSUME_MAC:d.userAgent.detectedMac_;d.userAgent.WINDOWS=d.userAgent.PLATFORM_KNOWN_?d.userAgent.ASSUME_WINDOWS:d.userAgent.detectedWindows_; d.userAgent.LINUX=d.userAgent.PLATFORM_KNOWN_?d.userAgent.ASSUME_LINUX:d.userAgent.detectedLinux_;d.userAgent.X11=d.userAgent.PLATFORM_KNOWN_?d.userAgent.ASSUME_X11:d.userAgent.detectedX11_;d.userAgent.determineVersion_=function(){var w="",z;if(d.userAgent.OPERA&&d.global.opera){var y=d.global.opera.version;w=typeof y=="function"?y():y}else{if(d.userAgent.GECKO){z=/rv\:([^\);]+)(\)|;)/}else{if(d.userAgent.IE){z=/MSIE\s+([^\);]+)(\)|;)/}else{if(d.userAgent.WEBKIT){z=/WebKit\/(\S+)/}}}if(z){var e=z.exec(d.userAgent.getUserAgentString());w=e?e[1]:""}}if(d.userAgent.IE){var x=d.userAgent.getDocumentMode_();if(x>parseFloat(w)){return String(x)}}return w};d.userAgent.getDocumentMode_=function(){var e=d.global.document;return e?e.documentMode:q};d.userAgent.VERSION=d.userAgent.determineVersion_();d.userAgent.compare=function(w,e){return d.string.compareVersions(w,e)};d.userAgent.isVersionOrHigherCache_={};d.userAgent.isVersionOrHigher=function(e){return d.userAgent.ASSUME_ANY_VERSION||d.userAgent.isVersionOrHigherCache_[e]||(d.userAgent.isVersionOrHigherCache_[e]=d.string.compareVersions(d.userAgent.VERSION,e)>=0) };d.userAgent.isVersion=d.userAgent.isVersionOrHigher;d.userAgent.isDocumentModeCache_={};d.userAgent.isDocumentModeOrHigher=function(e){return d.userAgent.IE&&d.userAgent.DOCUMENT_MODE>=e};d.userAgent.isDocumentMode=d.userAgent.isDocumentModeOrHigher;d.userAgent.DOCUMENT_MODE=(function(){var e=d.global.document;if(!e||!d.userAgent.IE){return undefined}var w=d.userAgent.getDocumentMode_();return w||(e.compatMode=="CSS1Compat"?parseInt(d.userAgent.VERSION,10):5)})();d.provide("goog.array");d.provide("goog.array.ArrayLike");d.NATIVE_ARRAY_PROTOTYPES=u;d.array.ArrayLike;d.array.peek=function(e){return e[e.length-1]};d.array.ARRAY_PROTOTYPE_=Array.prototype;d.array.indexOf=d.NATIVE_ARRAY_PROTOTYPES&&d.array.ARRAY_PROTOTYPE_.indexOf?function(e,x,w){return d.array.ARRAY_PROTOTYPE_.indexOf.call(e,x,w)}:function(e,z,w){var y=w==i?0:(w<0?Math.max(0,e.length+w):w);if(d.isString(e)){if(!d.isString(z)||z.length!=1){return -1}return e.indexOf(z,y)}for(var x=y;x=0;--y){if(y in x){A.call(z,x[y],y,e)}}};d.array.filter=d.NATIVE_ARRAY_PROTOTYPES&&d.array.ARRAY_PROTOTYPE_.filter?function(e,x,w){return d.array.ARRAY_PROTOTYPE_.filter.call(e,x,w)}:function(z,A,e){var x=z.length;var B=[];var D=0;var C=d.isString(z)?z.split(""):z;for(var y=0;y=0};d.array.isEmpty=function(e){return e.length==0};d.array.clear=function(e){if(!d.isArray(e)){for(var w=e.length-1;w>=0;w--){delete e[w]}}e.length=0};d.array.insertAt=function(e,x,w){d.array.splice(e,w,0,x)};d.array.remove=function(e,x){var w=d.array.indexOf(e,x);var y;if((y=w>=0)){d.array.removeAt(e,w)}return y};d.array.removeAt=function(e,w){return d.array.ARRAY_PROTOTYPE_.splice.call(e,w,1).length==1 };d.array.concat=function(e){return d.array.ARRAY_PROTOTYPE_.concat.apply(d.array.ARRAY_PROTOTYPE_,arguments)};d.array.clone=function(w){if(d.isArray(w)){return d.array.concat((w))}else{var y=[];for(var x=0,e=w.length;xe?1:w");y=B.join("")}var x=z.createElement(y);if(e){if(d.isString(e)){x.className=e}else{if(d.isArray(e)){d.dom.classes.add.apply(i,[x].concat(e))}else{d.dom.setProperties(x,e)}}}if(w.length>2){d.dom.append_(z,x,w,2)}return x};d.dom.append_=function(A,z,w,B){function y(C){if(C){z.appendChild(d.isString(C)?A.createTextNode(C):C) }}for(var x=B;x0};d.dom.contains=function(w,e){if(w.contains&&e.nodeType==d.dom.NodeType.ELEMENT){return w==e||w.contains(e)}if(typeof w.compareDocumentPosition!=q+""){return w==e||Boolean(w.compareDocumentPosition(e)&16)}while(e&&w!=e){e=e.parentNode}return e==w};d.dom.compareNodeOrder=function(C,B){if(C==B){return 0}if(C.compareDocumentPosition){return C.compareDocumentPosition(B)&2?1:-1}if("sourceIndex" in C||(C.parentNode&&"sourceIndex" in C.parentNode)){var x=C.nodeType==d.dom.NodeType.ELEMENT;var e=B.nodeType==d.dom.NodeType.ELEMENT;if(x&&e){return C.sourceIndex-B.sourceIndex}else{var y=C.parentNode;var w=B.parentNode;if(y==w){return d.dom.compareSiblingOrder_(C,B)}if(!x&&d.dom.contains(y,B)){return -1*d.dom.compareParentsDescendantNodeIe_(C,B)}if(!e&&d.dom.contains(w,C)){return d.dom.compareParentsDescendantNodeIe_(B,C)}return(x?C.sourceIndex:y.sourceIndex)-(e?B.sourceIndex:w.sourceIndex) }}var z=d.dom.getOwnerDocument(C);var D,A;D=z.createRange();D.selectNode(C);D.collapse(u);A=z.createRange();A.selectNode(B);A.collapse(u);return D.compareBoundaryPoints(d.global.Range.START_TO_END,A)};d.dom.compareParentsDescendantNodeIe_=function(y,x){var w=y.parentNode;if(w==x){return -1}var e=x;while(e.parentNode!=w){e=e.parentNode}return d.dom.compareSiblingOrder_(e,y)};d.dom.compareSiblingOrder_=function(w,e){var x=e;while((x=x.previousSibling)){if(x==w){return -1}}return 1};d.dom.findCommonAncestor=function(C){var z,B=arguments.length;if(!B){return i}else{if(B==1){return arguments[0]}}var D=[];var e=Infinity;for(z=0;z=w.length){throw d.iter.StopIteration }if(!(e in w)){e++;continue}return w[e++]}};return x}throw Error("Not implemented")};d.iter.forEach=function(y,x,w){if(d.isArrayLike(y)){try{d.array.forEach((y),x,w)}catch(e){if(e!==d.iter.StopIteration){throw e}}}else{y=d.iter.toIterator(y);try{while(u){x.call(w,y.next(),q,y)}}catch(e){if(e!==d.iter.StopIteration){throw e}}}};d.iter.filter=function(x,w,e){x=d.iter.toIterator(x);var y=new d.iter.Iterator;y.next=function(){while(u){var z=x.next();if(w.call(e,z,q,x)){return z}}};return y};d.iter.join=function(w,e){return d.iter.toArray(w).join(e)};d.iter.map=function(x,w,e){x=d.iter.toIterator(x);var y=new d.iter.Iterator;y.next=function(){while(u){var z=x.next();return w.call(e,z,q,x)}};return y};d.iter.some=function(y,x,w){y=d.iter.toIterator(y);try{while(u){if(x.call(w,y.next(),q,y)){return u}}}catch(e){if(e!==d.iter.StopIteration){throw e}}return c};d.iter.every=function(y,x,w){y=d.iter.toIterator(y);try{while(u){if(!x.call(w,y.next(),q,y)){return c}}}catch(e){if(e!==d.iter.StopIteration){throw e }}return u};d.iter.toArray=function(e){if(d.isArrayLike(e)){return d.array.toArray((e))}e=d.iter.toIterator(e);var w=[];d.iter.forEach(e,function(x){w.push(x)});return w};d.iter.equals=function(w,e){w=d.iter.toIterator(w);e=d.iter.toIterator(e);var y,x;try{while(u){y=x=c;var C=w.next();y=u;var B=e.next();x=u;if(C!=B){return c}}}catch(z){if(z!==d.iter.StopIteration){throw z}else{if(y&&!x){return c}if(!x){try{B=e.next();return c}catch(A){if(A!==d.iter.StopIteration){throw A}return u}}}}return c};d.provide("goog.dom.TagIterator");d.provide("goog.dom.TagWalkType");d.dom.TagWalkType={START_TAG:1,OTHER:0,END_TAG:-1};d.dom.TagIterator=function(z,e,x,y,w){this.reversed=!!e;if(z){this.setPosition(z,y)}this.depth=w!=q?w:this.tagType||0;if(this.reversed){this.depth*=-1}this.constrained=!x};d.inherits(d.dom.TagIterator,d.iter.Iterator);d.dom.TagIterator.prototype.node=i;d.dom.TagIterator.prototype.tagType=d.dom.TagWalkType.OTHER;d.dom.TagIterator.prototype.depth;d.dom.TagIterator.prototype.reversed; d.dom.TagIterator.prototype.constrained;d.dom.TagIterator.prototype.started_=c;d.dom.TagIterator.prototype.setPosition=function(w,x,e){this.node=w;if(w){if(d.isNumber(x)){this.tagType=x}else{this.tagType=this.node.nodeType!=d.dom.NodeType.ELEMENT?d.dom.TagWalkType.OTHER:this.reversed?d.dom.TagWalkType.END_TAG:d.dom.TagWalkType.START_TAG}}if(d.isNumber(e)){this.depth=e}};d.dom.TagIterator.prototype.copyFrom=function(e){this.node=e.node;this.tagType=e.tagType;this.depth=e.depth;this.reversed=e.reversed;this.constrained=e.constrained};d.dom.TagIterator.prototype.clone=function(){return new d.dom.TagIterator(this.node,this.reversed,!this.constrained,this.tagType,this.depth)};d.dom.TagIterator.prototype.skipTag=function(){var e=this.reversed?d.dom.TagWalkType.END_TAG:d.dom.TagWalkType.START_TAG;if(this.tagType==e){this.tagType=(e*-1);this.depth+=this.tagType*(this.reversed?-1:1)}};d.dom.TagIterator.prototype.restartTag=function(){var e=this.reversed?d.dom.TagWalkType.START_TAG:d.dom.TagWalkType.END_TAG; if(this.tagType==e){this.tagType=(e*-1);this.depth+=this.tagType*(this.reversed?-1:1)}};d.dom.TagIterator.prototype.next=function(){var x;if(this.started_){if(!this.node||this.constrained&&this.depth==0){throw d.iter.StopIteration}x=this.node;var e=this.reversed?d.dom.TagWalkType.END_TAG:d.dom.TagWalkType.START_TAG;if(this.tagType==e){var y=this.reversed?x.lastChild:x.firstChild;if(y){this.setPosition(y)}else{this.setPosition(x,(e*-1))}}else{var w=this.reversed?x.previousSibling:x.nextSibling;if(w&&x.parentNode==w.parentNode){this.setPosition(w)}else{this.setPosition(x.parentNode,(e*-1))}}this.depth+=this.tagType*(this.reversed?-1:1)}else{this.started_=u}x=this.node;if(!this.node){throw d.iter.StopIteration}return x};d.dom.TagIterator.prototype.isStarted=function(){return this.started_};d.dom.TagIterator.prototype.isStartTag=function(){return this.tagType==d.dom.TagWalkType.START_TAG};d.dom.TagIterator.prototype.isEndTag=function(){return this.tagType==d.dom.TagWalkType.END_TAG};d.dom.TagIterator.prototype.equals=function(e){return e.node==this.node&&(!this.node||e.tagType==this.tagType) };d.dom.TagIterator.prototype.splice=function(y){var x=this.node;this.restartTag();this.reversed=!this.reversed;d.dom.TagIterator.prototype.next.call(this);this.reversed=!this.reversed;var e=d.isArrayLike(arguments[0])?arguments[0]:arguments;for(var w=e.length-1;w>=0;w--){d.dom.insertSiblingAfter(e[w],x)}d.dom.removeNode(x)};d.provide("goog.structs");d.structs.getCount=function(e){if(typeof e.getCount=="function"){return e.getCount()}if(d.isArrayLike(e)||d.isString(e)){return e.length}return d.object.getCount(e)};d.structs.getValues=function(w){if(typeof w.getValues=="function"){return w.getValues()}if(d.isString(w)){return w.split("")}if(d.isArrayLike(w)){var y=[];var e=w.length;for(var x=0;x1){if(y%2){throw Error("Uneven number of arguments")}for(var e=0;e2*this.count_){this.cleanupKeysArray_()}return u}return c};d.structs.Map.prototype.cleanupKeysArray_=function(){if(this.count_!=this.keys_.length){var x=0;var w=0;while(x=x.length){throw d.iter.StopIteration}var C=x[w++];return B?C:y[C]}};return z};d.structs.Map.hasKey_=function(w,e){return Object.prototype.hasOwnProperty.call(w,e)};d.provide("goog.structs.Set");d.structs.Set=function(e){this.map_=new d.structs.Map;if(e){this.addAll(e)}};d.structs.Set.getKey_=function(w){var e=typeof w;if(e=="object"&&w||e=="function"){return"o"+d.getUid((w))}else{return e.substr(0,1)+w}};d.structs.Set.prototype.getCount=function(){return this.map_.getCount()};d.structs.Set.prototype.add=function(e){this.map_.set(d.structs.Set.getKey_(e),e)};d.structs.Set.prototype.addAll=function(x){var w=d.structs.getValues(x);var e=w.length;for(var y=0;yw){return c}if(!(e instanceof d.structs.Set)&&w>5){e=new d.structs.Set(e)}return d.structs.every(this,function(x){return d.structs.contains(e,x)})};d.structs.Set.prototype.__iterator__=function(e){return this.map_.__iterator__(c)};d.provide("goog.disposable.IDisposable");d.disposable.IDisposable=function(){};d.disposable.IDisposable.prototype.dispose;d.disposable.IDisposable.prototype.isDisposed;d.provide("goog.Disposable");d.provide("goog.dispose");d.Disposable=function(){if(d.Disposable.ENABLE_MONITORING){d.Disposable.instances_[d.getUid(this)]=this }};d.Disposable.ENABLE_MONITORING=c;d.Disposable.instances_={};d.Disposable.prototype.disposed_=c;d.Disposable.prototype.isDisposed=function(){return this.disposed_};d.Disposable.prototype.getDisposed=d.Disposable.prototype.isDisposed;d.Disposable.prototype.dispose=function(){if(!this.disposed_){this.disposed_=u;this.disposeInternal();if(d.Disposable.ENABLE_MONITORING){var e=d.getUid(this);if(!d.Disposable.instances_.hasOwnProperty(e)){throw Error(this+" did not call the goog.Disposable base constructor or was disposed of after a clearUndisposedObjects call")}delete d.Disposable.instances_[e]}}};d.Disposable.prototype.disposeInternal=function(){};d.dispose=function(e){if(e&&typeof e.dispose=="function"){e.dispose()}};d.provide("goog.dom.SavedRange");d.dom.SavedRange=function(){d.Disposable.call(this)};d.inherits(d.dom.SavedRange,d.Disposable);d.dom.SavedRange.prototype.restore=function(w){var e=this.restoreInternal();if(!w){this.dispose()}return e};d.dom.SavedRange.prototype.restoreInternal=d.abstractMethod; d.provide("goog.dom.SavedCaretRange");d.dom.SavedCaretRange=function(e){d.dom.SavedRange.call(this);this.startCaretId_=d.string.createUniqueString();this.endCaretId_=d.string.createUniqueString();this.dom_=d.dom.getDomHelper(e.getDocument());e.surroundWithNodes(this.createCaret_(u),this.createCaret_(c));this.removeIncidentalTextNode_()};d.inherits(d.dom.SavedCaretRange,d.dom.SavedRange);d.dom.SavedCaretRange.prototype.getCaret=function(e){return this.dom_.getElement(e?this.startCaretId_:this.endCaretId_)};d.dom.SavedCaretRange.prototype.removeIncidentalTextNode_=function(){var w=this.getCaret(u);this.removeIfEmptyText_(w.previousSibling);this.removeIfEmptyText_(w.nextSibling);var e=this.getCaret(c);this.removeIfEmptyText_(e.previousSibling);this.removeIfEmptyText_(e.nextSibling)};d.dom.SavedCaretRange.prototype.removeIfEmptyText_=function(e){if(e&&e.nodeType===d.dom.NodeType.TEXT&&!e.nodeValue){d.dom.removeNode(e)}};d.dom.SavedCaretRange.prototype.removeCarets=function(e){d.dom.removeNode(this.getCaret(u)); d.dom.removeNode(this.getCaret(c));return e};d.dom.SavedCaretRange.prototype.restoreInternal=function(){var y=i;var B=this.getCaret(u);var x=this.getCaret(c);if(B&&x){var A=B.parentNode;var w=d.array.indexOf(A.childNodes,B);var e=x.parentNode;var z=d.array.indexOf(e.childNodes,x);y=d.dom.Range.createFromNodes(A,w+1,e,z);y.select()}return y};d.dom.SavedCaretRange.prototype.disposeInternal=function(){this.removeCarets();this.dom_=i};d.dom.SavedCaretRange.prototype.createCaret_=function(e){return this.dom_.createDom(d.dom.TagName.SPAN,{id:e?this.startCaretId_:this.endCaretId_})};d.dom.SavedCaretRange.CARET_REGEX=/<\/span>/ig;d.provide("goog.dom.AbstractRange");d.provide("goog.dom.RangeIterator");d.provide("goog.dom.RangeType");d.dom.RangeType={TEXT:"text",CONTROL:"control",MULTI:"mutli"};d.dom.AbstractRange=function(){};d.dom.AbstractRange.getBrowserSelectionForWindow=function(A){if(A.getSelection){return A.getSelection()}else{var z=A.document;var x=z.selection;if(x){try{var w=x.createRange(); if(w.parentElement){if(w.parentElement().document!=z){return i}}else{if(!w.length||w.item(0).document!=z){return i}}}catch(y){return i}return x}return i}};d.dom.AbstractRange.isNativeControlRange=function(e){return !!e&&!!e.addElement};d.dom.AbstractRange.prototype.clone=d.abstractMethod;d.dom.AbstractRange.prototype.getType=d.abstractMethod;d.dom.AbstractRange.prototype.getBrowserRangeObject=d.abstractMethod;d.dom.AbstractRange.prototype.setBrowserRangeObject=function(e){return c};d.dom.AbstractRange.prototype.getTextRangeCount=d.abstractMethod;d.dom.AbstractRange.prototype.getTextRange=d.abstractMethod;d.dom.AbstractRange.prototype.getTextRanges=function(){var w=[];for(var x=0,e=this.getTextRangeCount();x=0};d.provide("goog.string.StringBuffer");d.string.StringBuffer=function(e,w){this.buffer_=d.userAgent.jscript.HAS_JSCRIPT?[]:"";if(e!=i){this.append.apply(this,arguments)}};d.string.StringBuffer.prototype.set=function(e){this.clear();this.append(e)};if(d.userAgent.jscript.HAS_JSCRIPT){d.string.StringBuffer.prototype.bufferLength_=0;d.string.StringBuffer.prototype.append=function(w,e,x){if(e==i){this.buffer_[this.bufferLength_++]=w}else{this.buffer_.push.apply((this.buffer_),arguments);this.bufferLength_=this.buffer_.length}return this}}else{d.string.StringBuffer.prototype.append=function(w,e,y){this.buffer_+=w;if(e!=i){for(var x=1;x=0&&this.compareBrowserRangeEndpoints(x,B,w)<=0}else{return this.compareBrowserRangeEndpoints(x,w,w)>=0&&this.compareBrowserRangeEndpoints(x,B,B)<=0}}catch(z){if(!d.userAgent.IE){throw z}return c}};d.dom.browserrange.AbstractRange.prototype.containsNode=function(e,w){return this.containsRange(d.dom.browserrange.createRangeFromNodeContents(e),w)};d.dom.browserrange.AbstractRange.prototype.isCollapsed=d.abstractMethod;d.dom.browserrange.AbstractRange.prototype.getText=d.abstractMethod;d.dom.browserrange.AbstractRange.prototype.getHtmlFragment=function(){var e=new d.string.StringBuffer();d.iter.forEach(this,function(z,B,y){if(z.nodeType==d.dom.NodeType.TEXT){e.append(d.string.htmlEscape(z.nodeValue.substring(y.getStartTextOffset(),y.getEndTextOffset())))}else{if(z.nodeType==d.dom.NodeType.ELEMENT){if(y.isEndTag()){if(d.dom.canHaveChildren(z)){e.append("") }}else{var A=z.cloneNode(c);var x=d.dom.getOuterHtml(A);if(d.userAgent.IE&&z.tagName==d.dom.TagName.LI){e.append(x)}else{var w=x.lastIndexOf("<");e.append(w?x.substr(0,w):x)}}}}},this);return e.toString()};d.dom.browserrange.AbstractRange.prototype.getValidHtml=d.abstractMethod;d.dom.browserrange.AbstractRange.prototype.__iterator__=function(e){return new d.dom.TextRangeIterator(this.getStartNode(),this.getStartOffset(),this.getEndNode(),this.getEndOffset())};d.dom.browserrange.AbstractRange.prototype.select=d.abstractMethod;d.dom.browserrange.AbstractRange.prototype.removeContents=d.abstractMethod;d.dom.browserrange.AbstractRange.prototype.surroundContents=d.abstractMethod;d.dom.browserrange.AbstractRange.prototype.insertNode=d.abstractMethod;d.dom.browserrange.AbstractRange.prototype.surroundWithNodes=d.abstractMethod;d.dom.browserrange.AbstractRange.prototype.collapse=d.abstractMethod;d.provide("goog.dom.browserrange.W3cRange");d.dom.browserrange.W3cRange=function(e){this.range_=e};d.inherits(d.dom.browserrange.W3cRange,d.dom.browserrange.AbstractRange); d.dom.browserrange.W3cRange.getBrowserRangeForNode=function(y){var A=d.dom.getOwnerDocument(y).createRange();if(y.nodeType==d.dom.NodeType.TEXT){A.setStart(y,0);A.setEnd(y,y.length)}else{if(!d.dom.browserrange.canContainRangeEndpoint(y)){var x=y.parentNode;var w=d.array.indexOf(x.childNodes,y);A.setStart(x,w);A.setEnd(x,w+1)}else{var z,e=y;while((z=e.firstChild)&&d.dom.browserrange.canContainRangeEndpoint(z)){e=z}A.setStart(e,0);e=y;while((z=e.lastChild)&&d.dom.browserrange.canContainRangeEndpoint(z)){e=z}A.setEnd(e,e.nodeType==d.dom.NodeType.ELEMENT?e.childNodes.length:e.length)}}return A};d.dom.browserrange.W3cRange.getBrowserRangeForNodes=function(y,w,e,x){var z=d.dom.getOwnerDocument(y).createRange();z.setStart(y,w);z.setEnd(e,x);return z};d.dom.browserrange.W3cRange.createFromNodeContents=function(e){return new d.dom.browserrange.W3cRange(d.dom.browserrange.W3cRange.getBrowserRangeForNode(e))};d.dom.browserrange.W3cRange.createFromNodes=function(y,w,e,x){return new d.dom.browserrange.W3cRange(d.dom.browserrange.W3cRange.getBrowserRangeForNodes(y,w,e,x)) };d.dom.browserrange.W3cRange.prototype.clone=function(){return new this.constructor(this.range_.cloneRange())};d.dom.browserrange.W3cRange.prototype.getBrowserRange=function(){return this.range_};d.dom.browserrange.W3cRange.prototype.getContainer=function(){return this.range_.commonAncestorContainer};d.dom.browserrange.W3cRange.prototype.getStartNode=function(){return this.range_.startContainer};d.dom.browserrange.W3cRange.prototype.getStartOffset=function(){return this.range_.startOffset};d.dom.browserrange.W3cRange.prototype.getEndNode=function(){return this.range_.endContainer};d.dom.browserrange.W3cRange.prototype.getEndOffset=function(){return this.range_.endOffset};d.dom.browserrange.W3cRange.prototype.compareBrowserRangeEndpoints=function(w,x,e){return this.range_.compareBoundaryPoints(e==d.dom.RangeEndpoint.START?(x==d.dom.RangeEndpoint.START?d.global.Range.START_TO_START:d.global.Range.START_TO_END):(x==d.dom.RangeEndpoint.START?d.global.Range.END_TO_START:d.global.Range.END_TO_END),(w)) };d.dom.browserrange.W3cRange.prototype.isCollapsed=function(){return this.range_.collapsed};d.dom.browserrange.W3cRange.prototype.getText=function(){return this.range_.toString()};d.dom.browserrange.W3cRange.prototype.getValidHtml=function(){var y=d.dom.getDomHelper(this.range_.startContainer).createDom("div");y.appendChild(this.range_.cloneContents());var e=y.innerHTML;if(d.string.startsWith(e,"<")||!this.isCollapsed()&&!d.string.contains(e,"<")){return e}var w=this.getContainer();w=w.nodeType==d.dom.NodeType.ELEMENT?w:w.parentNode;var x=d.dom.getOuterHtml((w.cloneNode(c)));return x.replace(">",">"+e)};d.dom.browserrange.W3cRange.prototype.select=function(e){var w=d.dom.getWindow(d.dom.getOwnerDocument(this.getStartNode()));this.selectInternal(w.getSelection(),e)};d.dom.browserrange.W3cRange.prototype.selectInternal=function(w,e){w.removeAllRanges();w.addRange(this.range_)};d.dom.browserrange.W3cRange.prototype.removeContents=function(){var e=this.range_;e.extractContents();if(e.startContainer.hasChildNodes()){var x=e.startContainer.childNodes[e.startOffset]; if(x){var w=x.previousSibling;if(d.dom.getRawTextContent(x)==""){d.dom.removeNode(x)}if(w&&d.dom.getRawTextContent(w)==""){d.dom.removeNode(w)}}}};d.dom.browserrange.W3cRange.prototype.surroundContents=function(e){this.range_.surroundContents(e);return e};d.dom.browserrange.W3cRange.prototype.insertNode=function(w,x){var e=this.range_.cloneRange();e.collapse(x);e.insertNode(w);e.detach();return w};d.dom.browserrange.W3cRange.prototype.surroundWithNodes=function(w,y){var z=d.dom.getWindow(d.dom.getOwnerDocument(this.getStartNode()));var e=d.dom.Range.createFromWindow(z);if(e){var A=e.getStartNode();var E=e.getEndNode();var F=e.getStartOffset();var x=e.getEndOffset()}var C=this.range_.cloneRange();var B=this.range_.cloneRange();C.collapse(c);B.collapse(u);C.insertNode(y);B.insertNode(w);C.detach();B.detach();if(e){var D=function(G){return G==w||G==y};if(A.nodeType==d.dom.NodeType.TEXT){while(F>A.length){F-=A.length;do{A=A.nextSibling}while(D(A))}}if(E.nodeType==d.dom.NodeType.TEXT){while(x>E.length){x-=E.length; do{E=E.nextSibling}while(D(E))}}d.dom.Range.createFromNodes(A,(F),E,(x)).select()}};d.dom.browserrange.W3cRange.prototype.collapse=function(e){this.range_.collapse(e)};d.provide("goog.dom.browserrange.WebKitRange");d.dom.browserrange.WebKitRange=function(e){d.dom.browserrange.W3cRange.call(this,e)};d.inherits(d.dom.browserrange.WebKitRange,d.dom.browserrange.W3cRange);d.dom.browserrange.WebKitRange.createFromNodeContents=function(e){return new d.dom.browserrange.WebKitRange(d.dom.browserrange.W3cRange.getBrowserRangeForNode(e))};d.dom.browserrange.WebKitRange.createFromNodes=function(y,w,e,x){return new d.dom.browserrange.WebKitRange(d.dom.browserrange.W3cRange.getBrowserRangeForNodes(y,w,e,x))};d.dom.browserrange.WebKitRange.prototype.compareBrowserRangeEndpoints=function(w,x,e){if(d.userAgent.isVersion("528")){return(d.dom.browserrange.WebKitRange.superClass_.compareBrowserRangeEndpoints.call(this,w,x,e))}return this.range_.compareBoundaryPoints(e==d.dom.RangeEndpoint.START?(x==d.dom.RangeEndpoint.START?d.global.Range.START_TO_START:d.global.Range.END_TO_START):(x==d.dom.RangeEndpoint.START?d.global.Range.START_TO_END:d.global.Range.END_TO_END),(w)) };d.dom.browserrange.WebKitRange.prototype.selectInternal=function(e,w){e.removeAllRanges();if(w){e.setBaseAndExtent(this.getEndNode(),this.getEndOffset(),this.getStartNode(),this.getStartOffset())}else{e.setBaseAndExtent(this.getStartNode(),this.getStartOffset(),this.getEndNode(),this.getEndOffset())}};d.provide("goog.dom.NodeIterator");d.dom.NodeIterator=function(y,e,x,w){d.dom.TagIterator.call(this,y,e,x,i,w)};d.inherits(d.dom.NodeIterator,d.dom.TagIterator);d.dom.NodeIterator.prototype.next=function(){do{d.dom.NodeIterator.superClass_.next.call(this)}while(this.isEndTag());return this.node};d.provide("goog.dom.browserrange.IeRange");d.dom.browserrange.IeRange=function(e,w){this.range_=e;this.doc_=w};d.inherits(d.dom.browserrange.IeRange,d.dom.browserrange.AbstractRange);d.dom.browserrange.IeRange.getBrowserRangeForNode_=function(x){var z=d.dom.getOwnerDocument(x).body.createTextRange();if(x.nodeType==d.dom.NodeType.ELEMENT){z.moveToElementText(x);if(d.dom.browserrange.canContainRangeEndpoint(x)&&!x.childNodes.length){z.collapse(c) }}else{var y=0;var w=x;while(w=w.previousSibling){var e=w.nodeType;if(e==d.dom.NodeType.TEXT){y+=w.length}else{if(e==d.dom.NodeType.ELEMENT){z.moveToElementText(w);break}}}if(!w){z.moveToElementText(x.parentNode)}z.collapse(!w);if(y){z.move("character",y)}z.moveEnd("character",x.length)}return z};d.dom.browserrange.IeRange.getBrowserRangeForNodes_=function(y,w,e,x){var C,B=c;if(y.nodeType==d.dom.NodeType.ELEMENT){C=y.childNodes[w];B=!C;y=C||y.lastChild||y;w=0}var z=d.dom.browserrange.IeRange.getBrowserRangeForNode_(y);if(w){z.move("character",w)}if(y==e&&w==x){z.collapse(u);return z}if(B){z.collapse(c)}B=c;if(e.nodeType==d.dom.NodeType.ELEMENT){C=e.childNodes[x];e=C||e.lastChild||e;x=0;B=!C}var A=d.dom.browserrange.IeRange.getBrowserRangeForNode_(e);A.collapse(!B);if(x){A.moveEnd("character",x)}z.setEndPoint("EndToEnd",A);return z};d.dom.browserrange.IeRange.createFromNodeContents=function(x){var w=new d.dom.browserrange.IeRange(d.dom.browserrange.IeRange.getBrowserRangeForNode_(x),d.dom.getOwnerDocument(x)); if(!d.dom.browserrange.canContainRangeEndpoint(x)){w.startNode_=w.endNode_=w.parentNode_=x.parentNode;w.startOffset_=d.array.indexOf(w.parentNode_.childNodes,x);w.endOffset_=w.startOffset_+1}else{var y,e=x;while((y=e.firstChild)&&d.dom.browserrange.canContainRangeEndpoint(y)){e=y}w.startNode_=e;w.startOffset_=0;e=x;while((y=e.lastChild)&&d.dom.browserrange.canContainRangeEndpoint(y)){e=y}w.endNode_=e;w.endOffset_=e.nodeType==d.dom.NodeType.ELEMENT?e.childNodes.length:e.length;w.parentNode_=x}return w};d.dom.browserrange.IeRange.createFromNodes=function(z,w,e,y){var x=new d.dom.browserrange.IeRange(d.dom.browserrange.IeRange.getBrowserRangeForNodes_(z,w,e,y),d.dom.getOwnerDocument(z));x.startNode_=z;x.startOffset_=w;x.endNode_=e;x.endOffset_=y;return x};d.dom.browserrange.IeRange.prototype.parentNode_=i;d.dom.browserrange.IeRange.prototype.startNode_=i;d.dom.browserrange.IeRange.prototype.endNode_=i;d.dom.browserrange.IeRange.prototype.startOffset_=-1;d.dom.browserrange.IeRange.prototype.endOffset_=-1; d.dom.browserrange.IeRange.prototype.clone=function(){var e=new d.dom.browserrange.IeRange(this.range_.duplicate(),this.doc_);e.parentNode_=this.parentNode_;e.startNode_=this.startNode_;e.endNode_=this.endNode_;return e};d.dom.browserrange.IeRange.prototype.getBrowserRange=function(){return this.range_};d.dom.browserrange.IeRange.prototype.clearCachedValues_=function(){this.parentNode_=this.startNode_=this.endNode_=i;this.startOffset_=this.endOffset_=-1};d.dom.browserrange.IeRange.prototype.getContainer=function(){if(!this.parentNode_){var y=this.range_.text;var e=this.range_.duplicate();var x=y.replace(/ +$/,"");var A=y.length-x.length;if(A){e.moveEnd("character",-A)}var w=e.parentElement();var B=e.htmlText;var z=d.string.stripNewlines(B).length;if(this.isCollapsed()&&z>0){return(this.parentNode_=w)}while(z>d.string.stripNewlines(w.outerHTML).length){w=w.parentNode}while(w.childNodes.length==1&&w.firstChild&&w.innerText==d.dom.browserrange.IeRange.getNodeText_(w.firstChild)){if(!d.dom.browserrange.canContainRangeEndpoint(w.firstChild)){break }w=w.firstChild}if(y.length==0){w=this.findDeepestContainer_(w)}this.parentNode_=w}return this.parentNode_};d.dom.browserrange.IeRange.prototype.findDeepestContainer_=function(y){var F=y.childNodes;for(var B=0,D=F.length;B=0&&this.compareBrowserRangeEndpoints(z,e,A)<=0):this.range_.inRange(z);if(x){return this.findDeepestContainer_(w)}}}return y};d.dom.browserrange.IeRange.prototype.getStartNode=function(){if(!this.startNode_){this.startNode_=this.getEndpointNode_(d.dom.RangeEndpoint.START);if(this.isCollapsed()){this.endNode_=this.startNode_}}return this.startNode_};d.dom.browserrange.IeRange.prototype.getStartOffset=function(){if(this.startOffset_<0){this.startOffset_=this.getOffset_(d.dom.RangeEndpoint.START); if(this.isCollapsed()){this.endOffset_=this.startOffset_}}return this.startOffset_};d.dom.browserrange.IeRange.prototype.getEndNode=function(){if(this.isCollapsed()){return this.getStartNode()}if(!this.endNode_){this.endNode_=this.getEndpointNode_(d.dom.RangeEndpoint.END)}return this.endNode_};d.dom.browserrange.IeRange.prototype.getEndOffset=function(){if(this.isCollapsed()){return this.getStartOffset()}if(this.endOffset_<0){this.endOffset_=this.getOffset_(d.dom.RangeEndpoint.END);if(this.isCollapsed()){this.startOffset_=this.endOffset_}}return this.endOffset_};d.dom.browserrange.IeRange.prototype.compareBrowserRangeEndpoints=function(w,x,e){return this.range_.compareEndPoints((x==d.dom.RangeEndpoint.START?"Start":"End")+"To"+(e==d.dom.RangeEndpoint.START?"Start":"End"),w)};d.dom.browserrange.IeRange.prototype.getEndpointNode_=function(I,D){var B=D||this.getContainer();if(!B||!B.firstChild){return B}var x=d.dom.RangeEndpoint.START,E=d.dom.RangeEndpoint.END;var A=I==x;for(var F=0,z=B.childNodes.length; F0){while(y.childNodes.length==1&&y.firstChild){y=y.firstChild}return this.getEndpointNode_(I,y)}}}}return B};d.dom.browserrange.IeRange.prototype.compareNodeEndpoints_=function(x,w,e){return this.range_.compareEndPoints((w==d.dom.RangeEndpoint.START?"Start":"End")+"To"+(e==d.dom.RangeEndpoint.START?"Start":"End"),d.dom.browserrange.createRangeFromNodeContents(x).getBrowserRange()) };d.dom.browserrange.IeRange.prototype.getOffset_=function(I,w){var A=I==d.dom.RangeEndpoint.START;var x=w||(A?this.getStartNode():this.getEndNode());if(x.nodeType==d.dom.NodeType.ELEMENT){var B=x.childNodes;var H=B.length;var z=A?0:H-1;var E=A?1:-1;for(var F=z;F>=0&&F"+w+""}else{if(w.match(/^\s*"}else{if(w.match(/^\s*"}else{if(w.match(/^\s*",w,"")}}}}return w};d.dom.TextRange.prototype.__iterator__=function(e){return new d.dom.TextRangeIterator(this.getStartNode(),this.getStartOffset(),this.getEndNode(),this.getEndOffset()) };d.dom.TextRange.prototype.select=function(){this.getBrowserRangeWrapper_().select(this.isReversed_)};d.dom.TextRange.prototype.removeContents=function(){this.getBrowserRangeWrapper_().removeContents();this.clearCachedValues_()};d.dom.TextRange.prototype.surroundContents=function(w){var e=this.getBrowserRangeWrapper_().surroundContents(w);this.clearCachedValues_();return e};d.dom.TextRange.prototype.insertNode=function(w,x){var e=this.getBrowserRangeWrapper_().insertNode(w,x);this.clearCachedValues_();return e};d.dom.TextRange.prototype.surroundWithNodes=function(w,e){this.getBrowserRangeWrapper_().surroundWithNodes(w,e);this.clearCachedValues_()};d.dom.TextRange.prototype.saveUsingDom=function(){return new d.dom.DomSavedTextRange_(this)};d.dom.TextRange.prototype.collapse=function(w){var e=this.isReversed()?!w:w;if(this.browserRangeWrapper_){this.browserRangeWrapper_.collapse(e)}if(e){this.endNode_=this.startNode_;this.endOffset_=this.startOffset_}else{this.startNode_=this.endNode_;this.startOffset_=this.endOffset_ }this.isReversed_=c};d.dom.DomSavedTextRange_=function(e){this.anchorNode_=e.getAnchorNode();this.anchorOffset_=e.getAnchorOffset();this.focusNode_=e.getFocusNode();this.focusOffset_=e.getFocusOffset()};d.inherits(d.dom.DomSavedTextRange_,d.dom.SavedRange);d.dom.DomSavedTextRange_.prototype.restoreInternal=function(){return d.dom.Range.createFromNodes(this.anchorNode_,this.anchorOffset_,this.focusNode_,this.focusOffset_)};d.dom.DomSavedTextRange_.prototype.disposeInternal=function(){d.dom.DomSavedTextRange_.superClass_.disposeInternal.call(this);this.anchorNode_=i;this.focusNode_=i};d.provide("goog.dom.MultiRange");d.provide("goog.dom.MultiRangeIterator");d.dom.MultiRange=function(){this.browserRanges_=[];this.ranges_=[];this.sortedRanges_=i;this.container_=i};d.inherits(d.dom.MultiRange,d.dom.AbstractMultiRange);d.dom.MultiRange.createFromBrowserSelection=function(y){var w=new d.dom.MultiRange();for(var x=0,e=y.rangeCount;x1){return d.dom.MultiRange.createFromBrowserSelection((x))}else{w=x.getRangeAt(0);y=d.dom.Range.isReversed(x.anchorNode,x.anchorOffset,x.focusNode,x.focusOffset)}}else{return i}}return d.dom.Range.createFromBrowserRange(w,y)};d.dom.Range.createFromBrowserRange=function(e,w){return d.dom.AbstractRange.isNativeControlRange(e)?d.dom.ControlRange.createFromBrowserRange(e):d.dom.TextRange.createFromBrowserRange(e,w)};d.dom.Range.createFromNodeContents=function(w,e){return d.dom.TextRange.createFromNodeContents(w,e)};d.dom.Range.createCaret=function(e,w){return d.dom.TextRange.createFromNodes(e,w,e,w)};d.dom.Range.createFromNodes=function(y,w,e,x){return d.dom.TextRange.createFromNodes(y,w,e,x)};d.dom.Range.clearSelection=function(x){var w=d.dom.AbstractRange.getBrowserSelectionForWindow(x||window);if(!w){return}if(w.empty){try{w.empty()}catch(y){}}else{w.removeAllRanges()}};d.dom.Range.isReversed=function(w,x,y,e){if(w==y){return e0};d.provide("export_dep");h.tx={};function a(w,y){for(var x=0,e=w.length;x-1){x=x.replace(/#\{if:([_\w]+)([=>-1){x=x.replace(/#\{for:([_\w]+):?(\d*):?(\d*)\}([\s\S]*?)#\{\/for:\1\}/gm,function(G,z,H,B,E){if(!y[z]||!y[z].length){return G}var C=y[z];var A=[];H=!!H?(isNaN(H)?C.length:parseInt(H)):C.length;B=!!B?(isNaN(B)?0:parseInt(B)):0;for(var D=0,F=Math.min(C.length,H);D0){var G=[];for(var F=0;F0){var E=[]; for(var D=0;D0){H=H.concat(E);if(!G){break}}}if(G){return H}else{return H[0]}};h.dGetty=function(){var C=arguments;if(C.length==1){if(typeof(C[0])==="string"){return y(b,C[0])}}else{if(C.length==2){if(C[0].nodeType&&typeof(C[1])==="string"){return y(C[0],C[1])}}}return i};h.dGetties=function(){var C=arguments;if(C.length==1){if(typeof(C[0])==="string"){return y(b,C[0],u)}}else{if(C.length==2){if(C[0].nodeType&&typeof(C[1])==="string"){return y(C[0],C[1],u)}}}return[] }})();(function(){var e,z,x;var A={"#":function(C,D){if((e=/(\S*)#(\S+)/.exec(D))!==i){var B=e[1];var E=e[2];if(B.length<1||C.nodeName.toLowerCase()==B){if(C.id==E){return u}}}return c},".":function(D,E){if((e=/(\S*)\.(\S+)/.exec(E))!==i){var C=e[1];var B=e[2];if(C.length<1||D.nodeName.toLowerCase()==C){if(D.className.indexOf(B)>-1){return u}}}return c},"*":function(C,D){var B=D;if(C.nodeName.toLowerCase()==B){return u}return c}};var w=function(B,D){var C;if((f=/(\.|#)/.exec(D))!==i){if(A[f[1]]){C=f[1]}}C=C||"*";return A[C](B,D)};var y=function(D,B){if(D.nodeType!==1){return c}var E=c;var F=B.split(",");for(var C=0;C-1){return E}}E=E.parentNode}}return i},"*":function(C,G){var E=C;var F={};var H=G.split(",");for(var D=0,B=H.length;D0){x=y.substring(w);y=y.substring(0,w)}var B=y.match(l.FONT_CSS_REGEXP);if(B===i){return i}var A=l.NORMAL_VALUE;var e={fontSize:B[2],lineHeight:(B[3]||A).replace("/",""),fontFamily:B[4]+x,fontWeight:A,fontStyle:A,fontVariant:A};var z=B[1];if(/bold|700/i.test(z)){e.fontWeight="bold"}if(/italic/i.test(z)){e.fontStyle="italic"}if(/small-caps/i.test(z)){e.fontVarient="small-caps"}return e};l.prototype.toShorthand=function(){var y=r({},this.properties);var x=l.NORMAL_VALUE;var w=[];["fontWeight","fontStyle","fontVarient"].each(function(z){if(y[z]!=x){w.push(y[z])}});if(y.lineHeight!=x){w.push(y.fontSize+"/"+y.lineHeight) }else{w.push(y.fontSize)}w.push(y.fontFamily);["fontWeight","fontStyle","fontVarient","fontSize","lineHeight","fontFamily"].each(function(z){delete y[z]});var e={font:w.join(" ")};e=r(e,y);return e};var g={__WORD_JOINER:"\ufeff",__WORD_JOINER_REGEXP:/\ufeff/g,__KEY:{ENTER:"13",DELETE:"46",SPACE:"32",BACKSPACE:"8",TAB:"9",PASTE:"86",CUT:"88"},I:{},X:{},define:function(e,w){return Object.extend(e,w)},available:function(w,e){if(!t("tx_"+e)){return c}if(!w){return c}if(w.use==c){return c}return u}};(function(w){function x(z){var y=z;while(y.$reference){y=y.$reference}return y}function e(C){var A=C.constructor.superclass;if(A){var E=A.prototype.initialize;A.prototype.initialize=function(){this.$reference=C};var D=new A();A.prototype.initialize=E;var z=function(F){if(!D[F]){return i}return function(){var J=arguments;var I=x(C);var G=I.$super;I.$super=D.$super;var H=D[F].apply(I,J);I.$super=G;return H}};var B={};for(var y in D){if(y.charAt(0)!="$"){if(typeof(D[y])=="function"){B[y]=z(y)}}}C.$super=B }}w.Class={create:function(z){var y=function(){var B=this.constructor.prototype;for(var A in B){if(B[A]&&typeof(B[A])==="object"){if(B[A].constructor==Array){this[A]=[].concat(B[A])}else{this[A]=Object.extend({},B[A])}}}e(this);var C=arguments;this.initialize.apply(this,C)};return w.Class.draft(z,y)},draft:function(B,C){var z=C?C:function(){e(this)};if(B.$const){Object.extend(z,B.$const)}if(B.$extend){Object.extend(z.prototype,B.$extend.prototype);z.superclass=B.$extend}if(B.$mixins){var A=$A(B.$mixins);A.each(function(D){Object.extend(z.prototype,D)})}for(var y in B){if(y.charAt(0)!="$"){z.prototype[y]=B[y]}}return z},overwrite:function(z,y){if(z.prototype){Object.extend(z.prototype,y)}return z}};w.Mixin=w.Faculty={create:function(A){var z={};for(var y in A){if(A[y]&&typeof(A[y])==="object"){if(A[y].constructor==Array){z[y]=[].concat(A[y])}else{z[y]=Object.extend({},A[y])}}else{z[y]=A[y]}}return z},toClass:function(y,z){return w.Class.create(Object.extend({initialize:z?z:function(){}},y)) }}})(g);(function(e){Object.extend(e,{installs:[],registers:[],modules:[],modulesX:[],install:function(x,w){w.desc="[install] "+x;e.installs.push(w)},register:function(x,w){w.desc="[register] "+x;e.registers.push(w)},module:function(x,w){w.desc="[module] "+x;e.modules.push(w)},moduleX:function(x,w){w.desc="[moduleX] "+x;e.modulesX.push(w)},invoke:function(E,A,D,w,x,y){for(var z=0,B=E.length;z-1)?p.getIconPath(y):y}function w(y){return(y.indexOf("#decopath")>-1)?p.getDecoPath(y):y}return{getMsg:function(z){var y=x[z]||"";return e(w(y))},addMsg:function(y){t.deepcopy(x,y)},printAll:function(){for(var y in x){if(x.hasOwnProperty(y)){}}}}}();h.TXMSG=j.getMsg;h.TrexMessage=j;var o=function(e){this.config=e||{}};o.prototype.set=function(B,A){var z=B.split(".");var e=z[z.length-1];var w=this.config;for(var y=0;y0)},include:function(D){var C=e(D);for(var B in C){if(this.map[B]){return u}}return c},memberOf:function(D){var C=e(D);for(var B in this.map){if(C[B]){return u}}return c},extract:function(E){var D=e(E);var C=[];for(var B in this.map){if(D[B]){C.push(B)}}return v.translate(C.join(","))},getExpression:function(){if(!this.exprs){var C=[];for(var B in this.map){C.push(B)}this.exprs=C.join(",")}return this.exprs}});var y={};Object.extend(v,{translate:function(B){if(!y[B]){y[B]=new z(B)}return y[B]}})})();Object.extend(v,{__POSITION:{__START_OF_TEXT:-1,__MIDDLE_OF_TEXT:0,__END_OF_TEXT:1,__EMPTY_TEXT:-2}});Object.extend(v,{isElement:function(e){return e&&e.nodeType==1},isBody:function(e){return v.isElement(e)&&e.tagName=="BODY" },isBlock:function(e){return v.kindOf(e,"%block")},isParagraph:function(e){return v.kindOf(e,"%paragraph")},isText:function(e){return v.kindOf(e,"%text")},isControl:function(e){return v.kindOf(e,"%control")},isTagName:function(w,e){e=e.toUpperCase();return w&&w.tagName===e},getOwnerDocument:function(e){return e.ownerDocument||e.document},getName:function(e){return((e&&e.nodeType==1)?e.nodeName.toLowerCase():"")},getText:function(e){return e.textContent||e.text||e.innerText||""},getLength:function(e){if(!e){return 0}if(e.nodeType==1){return e.childNodes.length}else{if(e.nodeType==3){return e.nodeValue.length}}return 0},indexOf:function(x){if(!x){return -1}var z=x.parentNode;for(var w=0,e=z.childNodes.length,y=z.childNodes;w]*>/i)>-1){return u}if(x.search(/<\/span>/i)>-1){return u}return c},hasData:function(w,e){if(!w){return c}var x="";if(w.nodeType==1){x=w.innerHTML}else{x=w.nodeValue}x=v.removeMeaninglessSpace(x);if(x.trim()==""){return c}if(x.stripTags()!=""){return u}if(e){return c}if(x.search(//i)>-1){return u}return c},removeMeaninglessSpace:function(e){return e.replace(/(^[\f\n\r\t\v\u2028\u2029]*)|([\f\n\r\t\v\u2028\u2029]*$)/g,"")}});Object.extend(v,{search:function(y,B,e){var z=(y.length==1)?b:y[0];var A=y[y.length-1];var x=(!A||!z||!z.nodeType||typeof A!="string");if(x){return e}var w=v.translate(A);return B(z,w.getExpression())},find:function(){return this.search(arguments,dFindy,i)},collect:function(){return this.search(arguments,dGetty,i) },collectAll:function(){return this.search(arguments,dGetties,[])}});(function(){function x(z){if(z){if(typeof(z)==="function"){return z}else{var A=v.translate(z);return function(B){if(B.nodeType==1){if(A.include("#element")){return u}else{return dChecky(B,A.getExpression())}}else{return A.include("#text")}}}}else{return i}}var y={};function e(A){A=A||"#element,#text";if(y[A]){return y[A]}var z=new w(A);y[A]=z;return z}var w=g.Class.create({initialize:function(z){this.pattern=z;this.translator=v.translate(z);this.hasClassPattern=z.indexOf(".")>=0;this.hasIdPattern=z.indexOf("#")>=0;this.matchesText=this.translator.include("#text");this.matchesElement=this.translator.include("#element")},test:function(C){var z=C.nodeType;var E=this.translator.map;if(z==1){if(this.matchesElement){return u}var B=C.tagName.toLowerCase();if(E[B]){return u}var D=[];if(this.hasClassPattern&&C.className){C.className.split(/\s/).each(function(G){D.push("."+G);D.push(B+"."+G)})}if(this.hasIdPattern&&C.id){var F=C.id; D.push("#"+F);D.push(B+"#"+F)}for(var A=0;A=z){return}var y=w;while(y++=w.length){return w}var e=w.cloneNode(c);w.deleteData(x,w.length-x);e.deleteData(0,x);v.insertNext(e,w);return e},divideNode:function(y,z){if(!v.isElement(y)){return i}var w=y.childNodes.length-z;var e=y.cloneNode(c);for(var x=0;x-1){z=z/100}return z},extractUnit:function(B){var z="em";var A;if((A=B.match(y.__REG_EXT_UNIT))!=i){z=A[0]}return z}});var x=new y();var e={colspan:"colSpan",rowspan:"rowSpan",valign:"vAlign",datetime:"dateTime",accesskey:"accessKey",tabindex:"tabIndex",enctype:"encType",maxlength:"maxLength",readonly:"readOnly",longdesc:"longDesc",cellPadding:"cellPadding",cellSpacing:"cellSpacing",more:"more",less:"less",style:"style"};Object.extend(v,{applyAttributes:function(B,A){if(!v.isElement(B)){return}for(var z in A){if(z=="style"){v.applyStyles(B,A[z])}else{v.setAttribute(B,z,A[z])}}},removeAttributes:function(B,A){if(!v.isElement(B)){return}for(var z in A){if(z=="style"){v.removeStyles(A[z])}else{B.removeAttribute(z,w)}}},getAttribute:function(A,z){if(!v.isElement(A)){return i}if(A&&A.getAttribute){return A.getAttribute(e[z]||z)}else{return i}},setAttribute:function(A,z,C){if(!v.isElement(A)){return}if(C==i||C.length==0||C==0){A.removeAttribute(z,w) }else{if(e[z]){A.setAttribute(e[z],C)}else{try{A[z]=C}catch(B){A.setAttribute(e[z]||z,C)}}}},setStyles:function(z,F,C){var D=z.style.cssText;var E;var H=Object.extend({},F);if(H.font){if(C){z.style.font=H.font}else{if(z.style.cssText.indexOf("font:")==-1){z.style.cssText="font: "+H.font+"; "+z.style.cssText}}delete H.font}for(var A in H){var G;if(x.needCalculation(H[A])){G=x.calculate(z.style[A],H[A])}else{G=H[A]}if(G==i){G=""}if(A=="float"){A=t.msie?"styleFloat":"cssFloat"}E=(!z.style[A]&&(A.indexOf("font")!=0||D.indexOf("font:")==-1))||C;var B=(A=="textDecoration")&&!z.style[A].include(G);if(E){z.style[A]=G}else{if(B){z.style[A]+=" "+G}}}v._clearUselessStyle(z)},applyStyles:function(A,z){this.setStyles(A,z,u)},addStyles:function(A,z){this.setStyles(A,z,c)},removeStyles:function(D,C){var B=D.style.cssText;var A=B;for(var z in C){z=z.replace(/([A-Z])/g,"-$1");B=B.replace(new RegExp("(^| )"+z+"\\s*:[^;]+;? ?","ig"),"")}if(A!=B){D.style.cssText=B;v._clearUselessStyle(D)}},_clearUselessStyle:function(z){var A=v.getAttribute(z,"style"); if(!A){z.removeAttribute("style",w)}},getStyleText:function(z){return z.style.cssText},setStyleText:function(z,A){z.style.cssText=A;!A&&v._clearUselessStyle(z)}})})();Object.extend(v,{goInto:function(w,e){if(!w||!w.scrollIntoView){return}w.scrollIntoView(e)},getWindow:function(e){return e.defaultView||e.parentWindow},getScrollTop:function(w){if(!w){return 0}var e=this.getWindow(w);var x="pageYOffset";return(x in e)?e[x]:w.documentElement.scrollTop},setScrollTop:function(w,e){if(!w){return}if(w.documentElement.scrollTop){w.documentElement.scrollTop=e}else{w.body.scrollTop=e}},getScrollLeft:function(e){if(!e){return 0}return(e.documentElement.scrollLeft||e.body.scrollLeft)},setScrollLeft:function(e,w){if(!e){return}if(e.documentElement.scrollLeft){e.documentElement.scrollLeft=w}else{e.body.scrollLeft=w}},getPosition:function(z,F){if(!z){return{x:0,y:0,width:0,height:0}}F=!!F;z=t(z);var D=(F)?t.cumulativeOffset(z):t.positionedOffset(z);var A;var C=z.style.display;if(C!="none"&&C!=i){A={width:z.offsetWidth,height:z.offsetHeight} }else{var x=z.style;var E=x.visibility;var B=x.position;var w=x.display;x.visibility="hidden";x.position="absolute";x.display="block";var e=z.clientWidth;var y=z.clientHeight;x.display=w;x.position=B;x.visibility=E;A={width:e,height:y}}return{x:D[0],y:D[1],width:A.width,height:A.height}},getWidth:function(w){var e=w.style.width;if(e.isPx()){return e.parsePx()}return w.offsetWidth},setWidth:function(w,e){v.applyStyles(w,{width:e})},getHeight:function(w){var e=w.style.height;if(e.isPx()){return e.parsePx()}return w.offsetHeight},setHeight:function(w,e){v.applyStyles(w,{height:e})},replacePngPath:function(y){if(t.msie6){if(b.location.href.indexOf("http://")>-1){return}try{var B=t.getStyle(y,"filter");var x=/src='([^']+)'/.exec(B)[1];if(!x||x=="none"){return}else{if(x.indexOf("http://")>-1){return}}var w=b.location.href.split("/");w.push("css");w.pop();x=x.replace(/\.\.\//g,function(){w.pop();return""});var z=w.join("/")+"/"+x;y.style.filter=B.replace(/src='([^']+)'/,"src='"+z+"'")}catch(A){alert(A) }}}});Object.extend(v,{EMPTY_BOGUS:(t.msie_quirks||t.msie&&t.msie_ver<11?" ":"
")});Object.extend(v,{EMPTY_PARAGRAPH_HTML:"

"+v.EMPTY_BOGUS+"

"});h.$tom=v;(function(e){e.Util={_dispElIds:[],getDispElId:function(){var x;do{x="tx_entry_"+(Math.floor(Math.random()*90000)+10000)+"_"}while(e.Util._dispElIds.contains(x));e.Util._dispElIds.push(x);return x},generateKey:function(){return parseInt(Math.random()*100000000)},toStyleString:function(y){var z=[];for(var x in y){if(y[x]){z.push(x.replace(/([A-Z])/g,"-$1").toLowerCase());z.push(":");z.push(y[x]);z.push(";")}}return z.join("")},toAttrString:function(y){var z=[];for(var x in y){if(y[x]){z.push(" "+x+'="'+y[x]+'"')}}return z.join("")},getMatchValue:function(z,y,A){var x;if((x=z.exec(y))!=i){return x[A]}else{return i}},getAttachmentType:function(y){y=(y||"").toLowerCase();var x=["image/jpg","image/jpeg","image/png","image/tiff","image/gif","image/bmp","image/x-jg","image/ief","image/pict","jpg","bmp","gif","png"];if(x.contains(y)){return"image" }return"file"},thumburl:function(x){x=(x||"").toLowerCase();switch(x){case"doc":case"docx":return w("#iconpath/pn_word.gif");case"xls":case"xlsx":return w("#iconpath/pn_xls.gif");case"ppt":case"pptx":return w("#iconpath/pn_ppt.gif");case"pdf":return w("#iconpath/pn_pdf.gif");case"txt":return w("#iconpath/pn_txt.gif");case"hwp":return w("#iconpath/pn_hwp.gif");case"zip":case"alz":return w("#iconpath/pn_zip.gif");case"mp3":case"wav":case"ogg":case"wma":case"mp4":case"ape":case"ra":case"ram":return w("#iconpath/pn_mp3.gif");case"avi":case"mpeg":case"wmv":case"asf":return w("#iconpath/pn_movie.gif");case"swf":return w("#iconpath/pn_swf.gif");case"htm":case"html":return w("#iconpath/pn_html.gif");case"jpg":case"gif":case"png":case"bmp":return w("#iconpath/pn_etc.gif");default:return w("#iconpath/pn_etc.gif")}},prevurl:function(x){x=(x||"").toLowerCase();switch(x){case"doc":case"docx":return w("#iconpath/p_word_s.gif");case"xls":case"xlsx":return w("#iconpath/p_xls_s.gif");case"ppt":case"pptx":return w("#iconpath/p_ppt_s.gif"); case"pdf":return w("#iconpath/p_pdf_s.gif");case"txt":return w("#iconpath/p_txt_s.gif");case"hwp":return w("#iconpath/p_hwp_s.gif");case"zip":case"alz":return w("#iconpath/p_zip_s.gif");case"mp3":case"wav":case"ogg":case"wma":case"mp4":case"ape":case"ra":case"ram":return w("#iconpath/p_mp3_s.gif");case"avi":case"mpeg":case"wmv":case"asf":return w("#iconpath/p_movie_s.gif");case"swf":return w("#iconpath/p_swf_s.gif");case"htm":case"html":return w("#iconpath/p_html_s.gif");case"jpg":return w("#iconpath/p_jpg_s.gif");case"gif":return w("#iconpath/p_gif_s.gif");case"png":case"bmp":return w("#iconpath/p_png_s.gif");default:return w("#iconpath/p_etc_s.gif")}},getMatchedClassName:function(B,A){var x=c;var y="";for(var z=0;z/ig,"");try{var A=/(\w+)=((?:\")[^\"]+(?:\"|$)|(?:')[^']+(?:'|$)|(?:[^\"'][^ \n]+($| |\n)))/ig;var x;while((x=A.exec(y))!=i){B[x[1].trim().toLowerCase()]=x[2].replace(/^(\"|')/i,"").replace(/(\"|')$/i,"").trim() }}catch(z){}return B},getAllAttributes:function(z){var A={};var x;var y=/style="(?:\s*|(?:[^"]*(?:;\s*)))width\s*:\s*([0-9]+)px[^"]*"/ig;while((x=y.exec(z))!=i){A.width=x[1]}y=/style="(?:\s*|(?:[^"]*(?:;\s*)))height\s*:\s*([0-9]+)px[^"]*"/ig;while((x=y.exec(z))!=i){A.height=x[1]}y=new RegExp('\\s+([a-zA-Z-]+)="([^"]*)"',"g");while((x=y.exec(z))!=i){if(!A[x[1].toLowerCase()]){A[x[1].toLowerCase()]=x[2]}}y=new RegExp("\\s+([a-zA-Z-]+)='([^']*)'","g");while((x=y.exec(z))!=i){if(!A[x[1].toLowerCase()]){A[x[1].toLowerCase()]=x[2]}}y=new RegExp("\\s+([a-zA-Z-]+)=([^\\s>]*)","g");while((x=y.exec(z))!=i){if(!A[x[1].toLowerCase()]){A[x[1].toLowerCase()]=x[2]}}return A}};e.HtmlCreator={createTableMarkup:function(F,B,z){var y=[];y.push('');y.push("");var D=z.length;var A;for(var E=0;E");for(var x=0;x') }else{y.push('")}}else{y.push('')}}y.push("")}y.push("");y.push("
'+A.data+" 
");return y.join("\n")}};e.String={escapeQuot:function(x){return x.replace(new RegExp('"',"g"),""").replace(new RegExp("'","g"),"'")},unescapeQuot:function(x){return x.replace(new RegExp(""","gi"),'"').replace(new RegExp("'","g"),"'")},htmlspecialchars:function(x){return e.String.escapeQuot(x.replace(new RegExp("&","g"),"&").replace(new RegExp("<","g"),"<").replace(new RegExp(">","g"),">"))},unHtmlspecialchars:function(x){return e.String.unescapeQuot(x.replace(new RegExp("&","gi"),"&").replace(new RegExp("<","gi"),"<").replace(new RegExp(">","gi"),">"))},parseAttribute:function(y,B){var C=new RegExp("(^|\\W)"+B+'="([^"]*)"',"gi");var A=new RegExp("(^|\\W)"+B+"='([^']*)'","gi"); var z=new RegExp("(^|\\W)"+B+"=([^\\s>]*)","gi");var x;if(x=C.exec(y)){return x[2]}else{if(x=A.exec(y)){return x[2]}else{if(x=z.exec(y)){return x[2]}else{return""}}}},changeAttribute:function(z,y,C,A){var F=new RegExp("(^|\\W)("+y+'=")'+C+'(")',"gi");var E=new RegExp("(^|\\W)("+y+"=')"+C+"(')","gi");var D=new RegExp("(^|\\W)("+y+"=)"+C,"gi");var B=new RegExp("<([\\w]+\\s*)","gi");var x=c;if(z.search(F)>-1){x=u;z=z.replace(F,"$1$2"+A+"$3")}if(z.search(E)>-1){x=u;z=z.replace(E,"$1$2"+A+"$3")}if(z.search(D)>-1){x=u;z=z.replace(D,"$1$2"+A)}if(!x){z=z.replace(B,"<$1"+y+"="+A+" ")}return z}};e.Validator=e.Class.create({initialize:function(){},strip:function(x){return x.stripTags().replace(/ /g,"").replace(e.__WORD_JOINER_REGEXP,"").trim()},exists:function(x){if(!x){return c}if(this.strip(x)==""){if(x.search(/<(img|iframe|object|embed|table|hr|script|TXDB)/i)<0){return c}}return u},equals:function(x,y){if(!x||!y){return c}if(x.search(/<(img|iframe|object|embed|table|hr|script|TXDB)/i)<0){if(this.strip(x)==this.strip(y)){return u }}return c}});e.Repeater=e.Class.create({initialize:function(x){this.execHandler=x},start:function(x){if(this.tItv){this.clear()}this.tItv=h.setInterval(this.onTimer.bind(this),x)},clear:function(){h.clearInterval(this.tItv);this.tItv=i},onTimer:function(){if(this.execHandler!=i){this.execHandler()}}});e.Timer=e.Class.create({initialize:function(x){this.execHandler=x},start:function(x){h.setTimeout(this.onTimer.bind(this),x)},onTimer:function(){if(this.execHandler!=i){this.execHandler()}}});e.Paging=e.Class.create({$const:{DEFAULT_PAGE_SIZE:5,DEFAULT_BLOCK_SIZE:10},initialize:function(y,x){this.data=y;this.currentpage=x.initPage||1;this.totalrow=x.totalrow||this.getTotalRow();this.pagesize=x.pagesize||e.Paging.DEFAULT_PAGE_SIZE;this.blocksize=x.blocksize||e.Paging.DEFAULT_PAGE_SIZE;this.totalpage=Math.ceil(this.totalrow/this.pagesize);this.totalblock=Math.ceil(this.totalpage/this.blocksize)},getNextPage:function(){return(this.currentpage1)?this.currentpage-1:0 },getNextBlock:function(){var x=Math.ceil(this.currentpage/this.blocksize);return(x1)?(x-2)*this.blocksize+1:0},getPageList:function(){var y=[];var x=Math.ceil(this.currentpage/this.blocksize)-1;var A=(x*this.blocksize+1);var B=Math.min(this.totalpage,(A+this.blocksize-1));for(var z=A;z<=B;z++){y.push(z)}return y},movePage:function(x){this.currentpage=x||this.currentpage},getOnePageData:function(){var x=[];var A=(this.currentpage-1)*this.pagesize;var y=Math.min(this.currentpage*this.pagesize,this.totalrow);for(var z=A;z0){setTimeout(F,10)}else{C.handler(C.result)}};F();t.stop(E)}.bind(this));t.observe(x,"click",function(E){var D=Math.round(this.physicObj.interval);var C=this;var F=function(){var G=C.getKnobPosition();C.setKnobPosition(G+1);if(--D>0){setTimeout(F,10)}else{C.handler(C.result)}};F();t.stop(E)}.bind(this));t.observe(this.elContext,"mouseup",function(){if(this.isDrag){this.isDrag=c}}.bind(this));t.observe(A,"click",function(C){t.stop(C)}.bind(this));t.observe(B,"click",function(D){if(!this.isDrag){var C=D.layerX||D.x;this.setKnobPosition(C-this.knobWidth/2);this.handler(this.result)}}.bind(this))},getKnobPosition:function(){var x=t.getStyle(this.elKnob,"left");return x.parsePx()},setKnobPosition:function(x){x=(xthis.physicObj.min)?x:this.physicObj.min; t.setStyle(this.elKnob,{left:x.toPx()});this.result=Math.round(x*this.logicObj.interval/this.physicObj.interval)},setDisable:function(){this.isDisabled=u},setEnable:function(){this.isDisabled=c},getDisabled:function(){return this.isDisabled}});e.DynamicSizer=e.Class.create({initialize:function(x){this.config=x;this.wrapper=x.el;this.elEventContext=tx.div({className:"tx-dynamic-sizer-context"});this.currentSize={row:0,col:0};this.dynamicSizingEnabled=u;if(!x.moveHandler){x.moveHandler=function(){}}if(!x.clickHandler){x.clickHandler=function(){}}this.wrapper.appendChild(this.elEventContext);this.previewTable=new e.DynamicSizer.PreviewTable({parentEl:this.elEventContext,mouseOverHandler:this.changeSize.bind(this),mouseClickHandler:this.selectSize.bind(this)})},clear:function(){this.dynamicSizingEnabled=u;this.changeSize(0,0)},changeSize:function(y,x){if(this.dynamicSizingEnabled){this.currentSize.row=y;this.currentSize.col=x;this._changeSelectionSize(y,x);this.config.moveHandler(y,x)}},_changeSelectionSize:function(y,x){this.previewTable.moveSelectionPos(y,x) },toggleDynamicSizing:function(){this.dynamicSizingEnabled=!this.dynamicSizingEnabled;if(this.dynamicSizingEnabled){this.selection.enableResize()}else{this.selection.disableResize()}},selectSize:function(x){this.config.clickHandler(x,this.currentSize)},getCurruentSize:function(){return this.currentSize}});e.DynamicSizer.PreviewTable=e.Class.create({$const:{DEFAULT_TD_STYLE:{},DEFAULT_TABLE_PROPERTY:{cellpadding:"0",cellspacing:"1"},MAX_SIZE:{COL:10,ROW:10}},initialize:function(y){this.config=y;this.elTable=i;this.elTable=this.generateTable("tx-event");this.elSelection=tx.div({className:"tx-selection"},this.generateTable("tx-selection"));var z=this.generateTable("tx-panel");this.eventBinding();y.parentEl.appendChild(this.elTable);y.parentEl.appendChild(this.elSelection);y.parentEl.appendChild(z);var A=v.getPosition(this.elTable);var x=e.DynamicSizer.PreviewTable.MAX_SIZE;this.cellSize={width:Math.round((A.width-A.x)/x.COL),height:(A.height-A.y)/x.ROW}},generateTable:function(B){var z=tx.tbody(); var y=e.DynamicSizer.PreviewTable;for(var A=0;AB){E=B;G=Math.floor(B*(D/H))}}}z.width=E;z.height=G;z.src=F;e(E,G)}this.execResize=function(D){var E=new Image();E.onerror=function(){z.width=B; z.height=A;z.src=y;E=i};if(E.onreadystatechange){E.onreadystatechange=function(){if(this.readyState=="complete"){w(E,D)}}}else{E.onload=function(){w(E,D)}}E.src=D}}});g.TableUtil={isDaumTable:function(e){return t.hasClassName(e,"txc-table")},cloneNodeForEmptyTd:function(w){var e;e=w.cloneNode(c);g.TableUtil.emptyTd(e);return e},emptyTd:function(e){e.innerHTML=" "},splitWidthByColSpan:function(w){var e;if(10){x=x+((x.indexOf("?")>-1)?"&":"?")+y}A.open(w.toUpperCase(),x,z);A.setRequestHeader("X-Requested-With","XMLHttpRequest");A.send(i)}if(!z){F()}return B}catch(C){return i}}});g.Responder={callbacks:{},process:function(){},newKey:function(){var e="exe_"+Math.floor(Math.random()*100000);if(this[e]){return this.newKey()}else{return e}},register:function(w){var e=this.newKey();this.callbacks[e]=function(x){w.apply(this,Array.prototype.slice.call(arguments,0));this.callbacks[e]=i}.bind(this);return e}};g.I.JSRequester=g.Faculty.create({importScript:function(y,B,A,D){if(y==i&&y!=""){return i}B=B||"utf-8";A=A||b;try{var z=A.getElementsByTagName("head")[0]||A.documentElement;var x=A.createElement("script");x.type="text/javascript";x.charset=B;x.src=y;var w=c;x.onload=x.onreadystatechange=function(){if(!w&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){w=u; if(D){D()}x.onload=x.onreadystatechange=i;if(z&&x.parentNode){z.removeChild(x)}}};z.insertBefore(x,z.firstChild)}catch(C){}}});h.$stop={};h.$propagate={};g.I.JobObservable=g.Faculty.create({jobObservers:{},observeJob:function(w,e){if(!this.jobObservers[w]){this.jobObservers[w]=[]}this.jobObservers[w].push(e)},reserveJob:function(y,w,x){x=x||500;if(!this.jobObservers[y]){this.jobObservers[y]=[]}var e=this;this.jobObservers[y].push(function(){var z=$A(arguments);setTimeout(function(){w.apply(e,z)},x)})},removeJob:function(e,x){if(!this.jobObservers[e]){return}if(!x){this.jobObservers[e].length=0}else{for(var w=0;w0){var B=this.getPositionByNode(y);C.each(function(e){e.apply(w,[y,B])})}if(v.isBody(y)){break}y=v.parent(y)}}catch(A){if(A!=$stop){throw A}}this.runMouseoverFailHandler()},runMouseoverFailHandler:function(){var w=[];for(var e in this.mouseoverObservers){if(!this.mouseoverObservers[e].flag){w.push(this.mouseoverObservers[e]["fail"])}}w.flatten().each(function(x){x()})},collectMouseoverObserver:function(B){var C=[];var x=B.className||"";var w=B.tagName;if(w){w=w.toLowerCase();if(this.mouseoverObservers[w]){C.push(this.mouseoverObservers[w]["success"]);this.mouseoverObservers[w]["flag"]=u}}if(x!=""){var y=x.split(" ");for(var A=0,e=y.length;A0){this.isRunning=u;(this.threads.shift())();this.isRunning=c}},putThread:function(e,w){if(w){this.threads.unshift(e)}else{this.threads.push(e)}}});j.addMsg({"@menu.pallete.revert":"\uae30\ubcf8\uc0c9\uc73c\ub85c","@adoptor.label":"\uac00\ub098\ub2e4","@adoptor.transparent":"\ud22c\uba85"});g.MarkupTemplate.add("menu.colorpallete.text",'#{for:items}
  • #{label}
  • #{/for:items}');g.MarkupTemplate.add("menu.colorpallete.thumb",'#{for:items}
  • #{/for:items}'); g.MarkupTemplate.add("menu.colorpallete.revert",'

    @menu.pallete.revert

    ');g.I.ColorPallete=g.Faculty.create({isGradeInit:c,isPickerDisplayed:c,onregenerated:function(e,w){this.setColorValueAtInputbox(w)},setColorValueAtInputbox:function(x){if(!x){return}if(typeof x!="string"&&x.toString){x=x.toString()}var y=x.split("|")[0];if(!g.Color.getValidColor(y)){y="#000000"}var e=v.collect(this.elInner,"p.tx-pallete-input input");var w=v.collect(this.elInner,"p.tx-pallete-input span");if(x&&e&&w){e.value=y;w.style.backgroundColor=y}},hookEvent:function(x){var E=this.elMenu;var H=this.elInner=v.collect(E,"div.tx-menu-inner");var D=v.collect(H,"ul.tx-pallete-text-list");if(x.texts){var K=x.texts.options;g.MarkupTemplate.get("menu.colorpallete.text").evaluateToDom({items:K},D);var z=v.collectAll(D,"li");this.addColorClickEvent(z,K)}else{H.removeChild(D);D=i}if(x.thumbs){var F=!!x.needTrans;var C=[].concat(x.thumbs.options); if(F){C.pop();C.push(Object.extend({},x.thumbs.transparent))}var I=v.collect(H,"ul.tx-pallete-thumb-list");g.MarkupTemplate.get("menu.colorpallete.thumb").evaluateToDom({items:C},I);var A=v.collectAll(I,"li");this.addColorClickEvent(A,C)}this.elPicker=v.collect(H,"div.tx-pallete-picker");var w=v.collect(H,"div.tx-pallete-buttons");var e=this.elMore=v.collect(w,"p.tx-pallete-more a");t.observe(e,"click",this.togglePicker.bind(this));if(x.needRevert){v.insertFirst(w,g.MarkupTemplate.get("menu.colorpallete.revert").evaluateAsDom({}));t.observe(v.collect(w,"p.tx-pallete-revert a"),"click",function(L){this.onSelect(L,i);this.hide()}.bind(this))}var J=v.collect(this.elInner,"p.tx-pallete-input");this.elPreview=v.collect(J,"span");var B=this.elInput=v.collect(J,"input");var y=this.elEnter=v.collect(J,"a");var G=this;t.observe(B,"blur",function(){G.lastValue=B.value});t.observe(y,"click",this.onColorEnter.bind(this))},addColorClickEvent:function(A,w){for(var y=0,e=A.length;y100-A){z=100}}w=Math.floor(Math.min(Math.max(w,0),100));if(w100-A){w=100}}this.mHSV.s=z;this.mHSV.v=w; this.mRGB=this.hsv2rgb(this.mHSV.h,this.mHSV.s,this.mHSV.v);return this.rgb2hex(this.mRGB.r,this.mRGB.g,this.mRGB.b)},onChromDown:function(){this.mousedownDetected=u},onChromMove:function(w){if(this.mousedownDetected){var x=this.getChromCoords(w);var e=this.getColorByEvent(x.x,x.y);this.previewColor(e)}},onChromUp:function(w){var x=this.getChromCoords(w);var e=this.getColorByEvent(x.x,x.y);this.previewColor(e);this.lastValue=e;this.mousedownDetected=c},getHueByEvent:function(x){var e=parseInt((x/(this.nHueHeight))*360);this.mHSV.h=Math.floor(Math.min(Math.max(e,0),360));var w=this.hsv2rgb(this.mHSV.h,100,100);return this.rgb2hex(w.r,w.g,w.b)},setHueColor:function(e){this.elChromaBar.style.backgroundColor=e},onHueDown:function(){t.observe(b,"mousemove",this.hueMoveHandler);t.observe(b,"mouseup",this.hueUpHandler)},onHueMove:function(w){var x=this.getHueCoords(w);var e=this.getHueByEvent(x);this.setHueColor(e)},onHueClick:function(w){var x=this.getHueCoords(w);var e=this.getHueByEvent(x); this.setHueColor(e)},onHueUp:function(){t.stopObserving(b,"mousemove",this.hueMoveHandler);t.stopObserving(b,"mouseup",this.hueUpHandler)},hex2rgb:function(e){this.mRGB.r=(this.toDec(e.substr(0,1))*16)+this.toDec(e.substr(1,1));this.mRGB.g=(this.toDec(e.substr(2,1))*16)+this.toDec(e.substr(3,1));this.mRGB.b=(this.toDec(e.substr(4,1))*16)+this.toDec(e.substr(5,1));return this.mRGB},toDec:function(w){var e="0123456789ABCDEF";return e.indexOf(w.toUpperCase())},rgb2hex:function(x,w,e){x=x.toString(16);if(x.length==1){x="0"+x}w=w.toString(16);if(w.length==1){w="0"+w}e=e.toString(16);if(e.length==1){e="0"+e}return"#"+x+w+e},hsv2rgb:function(x,I,H){x%=360;I/=100;H/=100;var e=0,y=0,C=0;if(I===0){e=Math.floor(H*255);y=Math.floor(H*255);C=Math.floor(H*255)}else{var A=x/60;var z=Math.floor(A);var G=H*(1-I);var E=H*(1-I*(A-z));var D=H*(1-I*(1-(A-z)));var w=0,B=0,F=0;if(z===0){w=H;B=D;F=G}else{if(z==1){w=E;B=H;F=G}else{if(z==2){w=G;B=H;F=D}else{if(z==3){w=G;B=E;F=H}else{if(z==4){w=D;B=G;F=H}else{if(z==5){w=H; B=G;F=E}}}}}}e=Math.floor(w*255);y=Math.floor(B*255);C=Math.floor(F*255)}return{r:e,g:y,b:C}},rgb2hsv:function(w,B,G){var y=(w/255);var E=(B/255);var I=(G/255);var A=0,J=0,H=0;var F=Math.min(y,E,I);var x=Math.max(y,E,I);var D=x-F;H=D;if(D===0){A=0;J=0}else{J=D/x;var C=(((x-y)/6)+(D/2))/D;var e=(((x-E)/6)+(D/2))/D;var z=(((x-I)/6)+(D/2))/D;if(y==x){A=z-e}else{if(E==x){A=(1/3)+C-z}else{if(I==x){A=(2/3)+e-C}}}if(A<0){A+=1}if(A>1){A-=1}}return{h:A,s:J,v:H}}});g.Color={getHexColor:function(w){w=w.trim();if(w.indexOf("rgb")<0){if(w.length>0&&(w.indexOf("-moz-use")>-1||w=="transparent")){return"transparent"}else{return w}}if(/rgba\s?\((0,\s?){3}0\)/i.test(w)){return"transparent"}var e=w.match(/rgba?\((\d+),\s*(\d+),\s*(\d+),?\s*\d*\)/i);if(!e){return w}e.shift();if(e.length<3){return w}var z;var y="#";for(var x=0;x<3;x++){z=parseInt(e[x].trim()).toString(16).toUpperCase();if(z.length==1){y=y.concat("0"+z)}else{if(z.length>2){y=y.concat("FF")}else{y=y.concat(""+z)}}}return y},getValidColor:function(w){if(w===i||w=="transparent"){return"transparent" }var e=w.match(/#?([0-9a-f]{6}|[0-9a-f]{3})/i);if(e===i||w.length>8){return i}if(e[1].length==3){return"#"+e[1]+e[1]}else{return"#"+e[1]}},getOptColor:function(w,x){if(!w||w.length!=7||w.charAt(0)!="#"){return"#e5e5e5"}w=w.substring(1,7).toLowerCase();x=isNaN(x)?100:x;var y="#";var A,e;for(var z=0;z<3;z++){A=parseInt(w.substr(z*2,2),16);e=Math.round(Math.floor((255-A)*(1-x*0.01)+A*(x*0.02))).toString(16);if(e.length==1){y+="0"+e}else{if(e.length>2){y+="ff"}else{y+=e}}}return y}};g.I.CookieBaker=g.Faculty.create({cookieName:i,cookieValue:i,initCookie:function(e,w){this.cookieName=e;this.cookieValue=function(){var z=b.cookie.split(";");for(var y=0;y=this.maxCnt){e.pop()}e.unshift(w);return e.join("|")}});g.MarkupTemplate.add("button.itsnew",'new');g.MarkupTemplate.add("button.select.text","#{data}");g.Button=g.Class.create({$const:{__borderClasses:{"tx-btn-trans":u,"tx-btn-lbg":u,"tx-btn-bg":u,"tx-btn-rbg":u,"tx-btn-lrbg":u,"tx-slt-tlbg":u,"tx-slt-tbg":u,"tx-slt-trbg":u,"tx-slt-blbg":u,"tx-slt-bbg":u,"tx-slt-brbg":u,"tx-slt-31bg":u,"tx-slt-31lbg":u,"tx-slt-31rbg":u,"tx-slt-70lbg":u,"tx-slt-70bg":u,"tx-slt-59bg":u,"tx-slt-42bg":u,"tx-slt-56bg":u,"tx-btn-nlrbg":u,"tx-btn-43lrbg":u,"tx-btn-52lrbg":u,"tx-btn-57lrbg":u,"tx-btn-71lrbg":u,"tx-btn-48lbg":u,"tx-btn-48rbg":u,"tx-btn-30lrbg":u,"tx-btn-46lrbg":u,"tx-btn-67lrbg":u,"tx-btn-49lbg":u,"tx-btn-58bg":u,"tx-btn-46bg":u,"tx-btn-49rbg":u,"tx-btn-widget":u,"tx-btn-widget-tbg":u,"tx-btn-widget-brbg":u},addBorderClass:function(e){g.Button.__borderClasses[e]=u },getBorderClass:function(y){var e=t.classNames(y);for(var x=0;x#{items}'); g.MarkupTemplate.add("menu.select.item",'
  • #{label}
  • ');g.Menu.Select=g.Class.create({$extend:g.Menu,generate:function(){var x=this.config;var e=this.getValidOptions(x);var w=this.generateList(e);v.insertFirst(this.elMenu,w);if(this.generateHandler){this.generateHandler(x)}if(this.ongeneratedList){this.generateList=this.ongeneratedList.bind(this)}if(this.ongeneratedListItem){this.generateListItem=this.ongeneratedListItem.bind(this)}},generateList:function(z){var w=g.MarkupTemplate.get("menu.select").evaluateAsDom({items:this.generateListItem(z)});var y=v.collectAll(w,"li a");for(var e=0;e'," #{for:row}",' #{for:col}','','#{if:image!=""}#{/if:image}','#{if:image=""}#{data}#{/if:image}',""," #{/for:col}"," #{/for:row}",""].join(""));g.MarkupTemplate.add("menu.list",['
    ','
    '," #{items}","
    ","
    "].join(""));g.Menu.List=g.Class.create({$extend:g.Menu,generate:function(){var x=this.config;var e=this.getValidOptions(x);this.cols=x.cols||1;this.rows=x.rows||e.length;var w=this.generateList(e);v.insertFirst(this.elMenu,w);if(this.ongeneratedList){this.generateList=this.ongeneratedList.bind(this)}if(this.ongeneratedListItem){this.generateListItem=this.ongeneratedListItem.bind(this)}if(this.generateHandler){this.generateHandler(x)}},generateList:function(w){var e=g.MarkupTemplate.splitList(this.rows,this.cols,w); var x=g.MarkupTemplate.get("menu.list").evaluateAsDom({items:g.MarkupTemplate.get("menu.items").evaluate(e)});t.observe(x,"click",this.onSelect.bindAsEventListener(this));t.observe(x,"mouseover",this.onItemMouseOver.bindAsEventListener(this));t.observe(x,"mouseout",this.onItemMouseOut.bindAsEventListener(this));return x},onItemMouseOver:function(e){var w=t.findElement(e,"span");if(w.tagName&&w.tagName.toLowerCase()=="span"){t.addClassName(w,"tx-item-hovered")}t.stop(e)},onItemMouseOut:function(e){var w=t.findElement(e,"span");if(w.tagName&&w.tagName.toLowerCase()=="span"){t.removeClassName(w,"tx-item-hovered")}t.stop(e)},onSelect:function(w){var x=t.findElement(w,"span");if(x.tagName&&x.tagName.toLowerCase()=="span"){var e;if(x.firstChild&&x.firstChild.nodeType==1&&x.firstChild.tagName.toLowerCase()=="img"){e=v.getAttribute(x.firstChild,"data")||""}else{e=x.innerText}this._command(e);this.hide()}t.stop(w)}});g.MarkupTemplate.add("menu.matrix",['
    ','
      ',' #{for:matrices}
    • #{title}
    • #{/for:matrices}',"
    ",'
    ',' #{for:matrices}
    '," #{items}","
    #{/for:matrices}","
    ","
    "].join("")); g.Menu.Matrix=g.Class.create({$extend:g.Menu,generate:function(){var x=this.config;var e=this.matrices=x.matrices.findAll(function(y){return !y.onlyIE||t.msie});this.cols=x.cols||10;this.rows=x.rows||5;var w=this.generateMatrix(e);v.insertFirst(this.elMenu,w);if(this.ongeneratedList){this.generateList=this.ongeneratedList.bind(this)}if(this.ongeneratedListItem){this.generateListItem=this.ongeneratedListItem.bind(this)}if(this.generateHandler){this.generateHandler(x)}this.showTab()},regenerate:function(){this.showTab();if(this.regenerateHandler){var e=this.config;this.regenerateHandler(e)}},showTab:function(){var x=this.lastElList;var w=this.lastElTitleItem;var e=(!x||!w);if(e){x=this.defaultElListItem;w=this.defaultElTitleItem}this.onTitleClick(i,w,x)},generateMatrix:function(E){var F=this;var A=this.cols;var D=this.rows;E.each(function(H){var G=g.MarkupTemplate.splitList(D,A,H.options);H.items=g.MarkupTemplate.get("menu.items").evaluate(G)});var C=g.MarkupTemplate.get("menu.matrix").evaluateAsDom({matrices:E}); var B=v.collectAll(C,"div.tx-menu-matrix-listset div.tx-menu-matrix-list");var w=v.collectAll(C,"ul.tx-menu-matrix-title li");var y=function(){for(var G=0,H=E.length;G','
      ','
        ','

        @menu.pallete.enter

        ','",'
        ','
        ','
        ',"
        ","
        ",""].join(""));g.Menu.ColorPallete=g.Class.create({$extend:g.Menu,$mixins:[g.I.ColorPallete],generate:function(){var w=this.config; var x=this.elMenu;g.MarkupTemplate.get("menu.colorPallete").evaluateToDom({},x);var e=w.thumbs.transparent;w.thumbs.transparent=Object.extend(w.thumbs.transparent,{image:p.getIconPath(e.image),thumb:p.getIconPath(e.thumb),thumbImage:p.getIconPath(e.thumbImage)});if(!this.hookEvent){throw new Error("[Exception]Trex.Menu.ColorPallete : not implement function(hookEvent)")}this.hookEvent(w);if(this.generateHandler){this.generateHandler(w)}this.bindEvents()},onSelect:function(){var w=$A(arguments);var e=w.shift();this._command.apply(this,w);this.remainColor(w);this.hide();t.stop(e)},remainColor:function(e){if(e){this.setColorValueAtInputbox(e)}},bindEvents:function(){var e=this;t.observe(this.elMore,"click",function(w){e.fireJobs(g.Ev.__MENU_LAYER_CHANGE_SIZE,{detail:{menu:e}})})}});t.msie&&g.module("add menu layer shield for IE flash object",function(y,A,B,x){g.MarkupTemplate.add("menu.shield",['
        ','',"
        "].join("")); var w=g.Class.create({initialize:function(E,D){this.id=E;this.menuEl=D;this.shieldEl=g.MarkupTemplate.get("menu.shield").evaluateAsDom({})},show:function(){this.update();v.insertAt(this.shieldEl,this.menuEl);t.show(this.shieldEl)},hide:function(){t.hide(this.shieldEl);v.remove(this.shieldEl)},update:function(){var D={width:this.menuEl.offsetWidth.toPx(),height:this.menuEl.offsetHeight.toPx(),left:t.getStyle(this.menuEl,"left"),top:t.getStyle(this.menuEl,"top")};t.setStyle(this.shieldEl,D)},destroy:function(){this.id=i;this.menuEl=i;this.shieldEl=i}});var e=g.Class.create({initialize:function(){this.entry={}},show:function(G,F){var D=this.entry[G];if(!D){var E=new w(G,F);this.entry[G]=D=E}D.show()},hide:function(E){var D=this.entry[E];if(D){D.hide();D.destroy();delete this.entry[E]}},updateAll:function(){var D=this.entry;setTimeout(function(){for(var E in D){if(D.hasOwnProperty(E)){D[E].update()}}},1)}});var z=new e();function C(E){var F;try{if(E.config.id){F=E.config.id+E.config.initializedId }else{F=E.config.el.className}}catch(D){F="unknown"}return F}A.observeJob(g.Ev.__MENU_LAYER_SHOW,function(D){var E=D.detail.menu;z.show(C(E),E.elMenu)});A.observeJob(g.Ev.__MENU_LAYER_HIDE,function(D){var E=D.detail.menu;z.hide(C(E))});A.observeJob(g.Ev.__MENU_LAYER_CHANGE_SIZE,function(D){z.updateAll()})});g.Editor=g.Class.create({$mixins:[g.I.JobObservable,g.I.KeyObservable],toolbar:i,sidebar:i,canvas:i,config:i,initialConfig:i,initialize:function(x){this.initialConfig=x;var C=this,B=this.config=p.setup(x);var A=this.canvas=new g.Canvas(C,B);var w=this.toolbar=new g.Toolbar(C,B);var z=this.sidebar=new g.Sidebar(C,B);g.invokeInstallation(C,w,z,A,B);var e=B.events;var y=function(D){if(e.useHotKey){C.fireKeys(D)}};t.observe(b,"keydown",y.bindAsEventListener(this),c);A.observeJob(g.Ev.__IFRAME_LOAD_COMPLETE,function(){var D=new Date().getTime();var G=Math.round((D-Editor.initStartTime)/100)/10;C.fireJobs(g.Ev.__IFRAME_LOADING_TIME,G);var F=C.getInitializedId();var E=t("tx_loading"+F);if(!E){return }if(A.mode!=g.Canvas.__WYSIWYG_MODE){A.fireJobs(g.Ev.__CANVAS_MODE_INITIALIZE,g.Canvas.__WYSIWYG_MODE,A.mode)}t.hide(E)});g.invokeRegisters(C,w,z,A,B);g.invokeModules(C,w,z,A,B)},getToolbar:function(){return this.toolbar},getSidebar:function(){return this.sidebar},getCanvas:function(){return this.canvas},getUsedWebfont:function(){return this.canvas.getUsedWebfont()},getConfig:function(){return this.config},getInitialConfig:function(){return this.initialConfig},getParam:function(w){var e={},x=this.config;x.params.each(function(y){if(x[y]){e[y]=x[y]}});return e[w]},getWrapper:function(){if(!this.initialConfig.wrapper){throw new Error("`wrapper` config variable should be provided")}return $must(this.initialConfig.wrapper)},getInitializedId:function(){return this.initialConfig.initializedId||""},saveEditor:function(){this.setDisableUnloadHandler();this.getSaver().submit()},loadEditor:function(e){this.getSaver().load(e)},getContent:function(){return this.getSaver().getContent()},getAttachments:function(w,e){return this.getSaver().getAttachments(w,e) },getEmbeddedData:function(e){return this.getSaver().getEmbeddedData(e)},getResults:function(e){return this.getSaver().getResults(e)},getAutosaveSeq:function(){return(this.getAutoSaver&&this.getAutoSaver())?this.getAutoSaver().getCurSeq():"0"}});(function(){h.Editor=g.Class.create({$const:{__ACTIVE:c,__PANEL_LOADED:c,__EDITOR_LOADED:c,__MULTI_LIST:[],__SELECTED_INDEX:0},_initEditor:function(x,w){Editor.__EDITOR_LOADED=c;Editor.__PANEL_LOADED=c;x=new g.Editor(w);var y=x.getInitializedId();if(y!=i){var e=y==""?0:y;Editor.__MULTI_LIST[e]=x;Editor.__SELECTED_INDEX=e}Object.extend(Editor,x);Editor.__EDITOR_LOADED=u;Editor.__ACTIVE=u},initialize:function(w){if(g.hmailLogging){g.hmailLogging(w)}Editor.initStartTime=new Date().getTime();var y=null;if(h.DEBUG){this._initEditor(y,w)}else{try{this._initEditor(y,w)}catch(x){if(y){y.fireJobs(g.Ev.__RUNTIME_EXCEPTION,x)}else{throw"failed to initialize editor. caused by "+x}throw x}}}});Editor.modify=function(e){if(Editor.__PANEL_LOADED&&Editor.__EDITOR_LOADED){if(this.loadEditor){this.loadEditor(e) }}else{setTimeout(this.modify.bind(this,e),10)}};Editor.restore=function(e){if(Editor.__PANEL_LOADED&&Editor.__EDITOR_LOADED){if(this.getAutoSaver&&this.getAutoSaver()){this.getAutoSaver().load(e)}}else{setTimeout(this.restore.bind(this,e),10)}};Editor.save=function(){if(Editor.__PANEL_LOADED&&Editor.__EDITOR_LOADED){if(this.saveEditor){this.saveEditor()}}else{setTimeout(this.saveEditor.bind(this),10)}return c};Editor.focus=function(){if(Editor.__PANEL_LOADED&&Editor.__EDITOR_LOADED){var e=this.getCanvas();if(e){e.focus()}}else{setTimeout(this.focus.bind(this),10)}return c};Editor.focusOnTop=function(){if(Editor.__PANEL_LOADED&&Editor.__EDITOR_LOADED){var e=this.getCanvas();if(e){e.focusOnTop()}}else{setTimeout(this.focusOnTop.bind(this),10)}return c};Editor.focusOnBottom=function(){if(Editor.__PANEL_LOADED&&Editor.__EDITOR_LOADED){var e=this.getCanvas();if(e){e.focusOnBottom()}}else{setTimeout(this.focusOnBottom.bind(this),10)}return c};Editor.permitUnload=function(){if(Editor.__PANEL_LOADED&&Editor.__EDITOR_LOADED){this.setDisableUnloadHandler() }else{setTimeout(this.permitUnload.bind(this),500)}};Editor.onPanelLoadComplete=function(e){if(Editor.__PANEL_LOADED==u&&Editor.__EDITOR_LOADED==u){if(e){e()}}else{setTimeout(Editor.onPanelLoadComplete.bind(Editor,e),500)}};Editor.switchEditor=function(e){Editor.__SELECTED_INDEX=e;Object.extend(Editor,Editor.__MULTI_LIST[e])};Editor.editorForAsyncLoad=Editor;Editor.forEachEditor=function(e){var x,w=Editor.__MULTI_LIST;for(x in w){if(w.hasOwnProperty(x)){e(w[x])}}};Editor.focusOnForm=function(e){if(Editor.__PANEL_LOADED&&Editor.__EDITOR_LOADED){h.focus();var w=Editor.getForm();if(w.getElementByName(e)){w.getElementByName(e).focus()}}else{setTimeout(Editor.focusOnForm.bind(Editor,e),500)}return c};Editor.fromHdrive=function(z){var w=[];for(var y=0;ythis.autoSeq)?e:this.autoSeq;return e},empty:function(){this.fireJobs(g.Ev.__ENTRYBOX_ALL_ENTRY_REMOVED);this.datalist=[]},append:function(e){this.datalist.push(e);this.fireJobs(g.Ev.__ENTRYBOX_ENTRY_ADDED,e)},modify:function(e){this.fireJobs(g.Ev.__ENTRYBOX_ENTRY_MODIFIED,e) },remove:function(e){e.deletedMark=u;this.fireJobs(g.Ev.__ENTRYBOX_ENTRY_REMOVED,e)},syncBox:function(e){this.datalist.each(function(w){w.execSync(e)})},getFields:function(){var e=[];this.datalist.each(function(w){e.push(w.getField())});return e.findAll(function(w){return(w!=i)})},getEntries:function(e){if(!e){return this.datalist}var w=[];this.datalist.each(function(x){if(x.type==e){w.push(x)}});return w}});g.Entry=g.Class.draft({$mixins:[g.I.JobObservable],existStage:c,deletedMark:c,initialize:function(){throw new Error("[Exception]Trex.Entry : not implements function(initialize)")},setExistStage:function(e){this.existStage=e},execRegister:function(){this.register();this.entryBox.append(this);this.setExistStage(u)},execReload:function(){if(this.reload){this.reload()}this.entryBox.append(this);this.exchangeHandlerAtReload()},execRemove:function(){this.remove();this.entryBox.remove(this)},execReplace:function(e){this.replace(e);this.entryBox.modify(this);this.setExistStage(u)},execAppend:function(){this.register(); this.setExistStage(u)},execSync:function(e){this.setExistStage(this.checkExisted(e))},checkExisted:function(e){if(this.canvas.isWYSIWYG()){return(e.search(this.regHtml)>-1)}else{return(e.search(this.regText)>-1)}},getChangedContent:function(w,z,y,x){var e=c;if(w.search(z)>-1){e=u;if(this.actor.canResized){w=this.getChangedContentWithAttr(w,z,y,x)}else{w=w.replace(z,y)}}this.setExistStage(e);return w},getChangedContentFromHtml:function(e){return this.getChangedContent(e,this.regHtml,this.dispText,["id","class"])},getChangedContentToHtml:function(e){return this.getChangedContent(e,this.regText,this.dispHtml)},getChangedContentAtSave:function(e){return this.getChangedContent(e,this.regHtml,this.saveHtml,["id","class"])},getChangedContentAtLoad:function(e){return this.getChangedContent(e,this.regLoad,this.dispHtml)},getChangedContentWithAttr:function(z,e,E,A){A=A||[];var x=g.Util.getAllAttributes(E);var B=function(J){var I=g.Util.getMatchValue(/<([a-z]*)/i,E,1);var K=["<"+I.toLowerCase()];var H=g.Util.getAllAttributes(J); for(var G in x){if(["width","height"].contains(G)){if(!H[G]){K.push(G+'="'+x[G]+'"')}}else{K.push(G+'="'+x[G]+'"')}}for(var G in H){if(!A.contains(G)){if(["width","height"].contains(G)){K.push(G+'="'+H[G]+'"')}else{if(!x[G]){K.push(G+'="'+H[G]+'"')}}}}K.push("/>");return K.join(" ")};var D=z;var y;e.lastIndex=0;while((y=e.exec(D))!=i){var w=y[0];var F=B(w);var C=w.getRegExp();z=z.replace(new RegExp(C,"gmi"),F)}return z},getField:function(){if(!this.field){return i}return{name:this.field.name,value:[this.field.value,this.existStage].join("|")}},exchangeHandlerAtReload:function(){}});g.Actor=g.Class.draft({$mixins:[g.I.JobObservable],isDisabled:c,initialize:function(){throw new Error("[Exception]Trex.Actor : not implements function(initialize)")},execAttach:function(x,w){var e=this.createEntry(this.getDataForEntry(x),w);e.execRegister();this.canvas.fireJobs("canvas."+(w||this.constructor.__Identity)+".added",e)},getDatalist:function(){return this.entryBox.getEntries(this.name)},execReattach:function(z,x){var y=this.getDatalist(); var A=this.getDataForEntry(z);if(y.length<1){var e=this.createEntry(A,x);e.execRegister()}else{var e=y[0];var w={regHtml:e.regHtml,regText:e.regText};e.setProperties(A);e.execReplace(w)}},execReload:function(z,y,x){var w=this.getDataForEntry(z,y);if(w){var e=this.createEntry(w,x);e.execReload()}},existEntry:function(){var e=this.getDatalist().findAll(function(w){return w.deletedMark!=u});return e.length!==0},getFirstEntryData:function(){var e=this.getDatalist().findAll(function(w){return w.deletedMark!=u});return((e.length==0)?i:e[0].data)}});g.install("editor.getDocParser",function(y,z,A,w,e){var x=new g.Docparser(y,A,e);y.getDocParser=function(){return x}});g.Docparser=g.Class.create({initialize:function(w,x,e){this.editor=w;this.sidebar=x;this.config=e},filters:{},registerFilter:function(e,w){this.filters[e]=w},getFilter:function(e){return this.filters[e]},executeFilters:function(x,w){var e=this.filters;["before "+x,x,"after "+x].each(function(A){var y,z;for(y in e){if(e.hasOwnProperty(y)){z=e[y]; if(z[A]){w=z[A](w)}}}});return w},getContentsAtChangingMode:function(w,e,x){if(e==x){return w}w=w.trim()||"";return this.executeFilters(e.concat("2").concat(x),w)},convertAtLoad:function(w,e,x){if(x=="original"){w=this.executeFilters(e.concat("@load"),w)}else{if(e!=x){w=this.executeFilters(x.concat("2").concat(e),w)}}return w},convertAtSave:function(x,w,e){if(e=="original"){x=this.executeFilters(w.concat("4save"),x)}else{if(w!=e){x=this.executeFilters(w.concat("2").concat(e),x)}}return x},text2source:function(e){return this.executeFilters("text2source",e)},text2html:function(e){if(e===""){return v.EMPTY_PARAGRAPH_HTML}return this.executeFilters("text2html",e)},source2text:function(e){return this.executeFilters("source2text",e)},source2html:function(e){if(e===""){return v.EMPTY_PARAGRAPH_HTML}return this.executeFilters("source2html",e)},html2text:function(e){return this.executeFilters("html2text",e)},html2source:function(e){return this.executeFilters("html2source",e)}});g.install("editor.getEntryProxy",function(y,z,A,x,w){var e=new g.EntryProxy(y,A,w); y.getEntryProxy=function(){return e}});g.EntryProxy=g.Class.create({initialize:function(w,x,e){this.editor=w;this.sidebar=x;this.config=e},commands:{},registerCommand:function(e,w){this.commands[e]=w},getcommand:function(e){return this.commands[e]},executeCommand:function(x,w){for(var e in this.commands){var y=this.commands[e];if(y[x]){y[x](w)}}},setAttachments:function(e,x){e=e||[];x=x||"";var w=this.editor.getAttachBox();w.empty();var y=this.sidebar.getAttacher();e.each(function(A){try{var z=y[A.attacher];if(z){z.execReload(A.data,x,A.type)}}catch(B){}})},getAttachments:function(e,w){w=!!w;var x=[];e.each(function(y){if(y.deletedMark){return}if(w||y.existStage){x.push({type:y.type,attacher:y.actor.name,existStage:y.existStage,data:Object.extend(y.data,{tmpSeq:y.dataSeq})})}});return x}});g.install("editor.getForm",function(x,y,z,w,e){var A=new g.FormProxy(x,z,e);x.getForm=function(){return A}});g.FormProxy=g.Class.create({initialize:function(w,y,e){this.editor=w;this.sidebar=y;this.config=e; var x=this.elForm=b.forms[e.form]||b.getElementById(e.form);if(!x){throw new Error("[Exception]Trex.Form : not exist element - "+e.form)}x.onsubmit=function(){return c}},submit:function(){this.elForm.submit()},createField:function(e){this.elForm.appendChild(e)},getElements:function(){return this.elForm.elements},getElementByName:function(e){return this.elForm[e]},getFormField:function(){var w={};var y=this.getElements();var e;for(var x=0;x0){w[e.name]=e.options[e.selectedIndex].value}}else{if(e.type=="radio"&&!e.checked){}else{if(e.type=="checkbox"&&!e.checked){}else{w[e.name||e.id]=e.value}}}}return w},setFormField:function(e){if(!e){return}var A=this.getElements();var y;var w;for(var z=0;z=e&&F.start<=C){B.setStart(x,F.start-e);y=true}if(y&&F.end>=e&&F.end<=C){B.setEnd(x,F.end-e);G=true}e=C}else{var z=x.childNodes.length;while(z--){A.push(x.childNodes[z])}}}var w=D.getSelection();w.removeAllRanges();w.addRange(B)}};g.I.History.Trident={getRangeData:function(){var B=this.canvas.getCurrentPanel().getDocument();var y=B.body;try{var w=B.selection.createRange()}catch(A){return{start:0,end:0}}var z=B.body.createTextRange();z.moveToElementText(y);try{z.setEndPoint("EndToStart",w);var C=z.text.length;return{start:C,end:C+w.text.length}}catch(A){}var x=z.text.length;return{start:x,end:x}},restoreRange:function(x){var y=this.canvas.getCurrentPanel().getDocument(); var w=y.body;var e=y.body.createTextRange();e.moveToElementText(w);e.collapse(true);e.moveEnd("character",x.end);e.moveStart("character",x.start);e.select()}};(function(){function e(z,y){while(z.length>=y){z.shift()}}var x=20;g.History=g.Class.create({$mixins:[g.I.History.Standard,((t.msie_nonstd)?g.I.History.Trident:g.I.History.Webkit)],maxUndoCount:x,canvas:i,undoMementoList:i,redoMementoList:i,currentMemento:i,contentModified:c,initialize:function(y){this.canvas=y;this.setupHistory();this.bindKeyEvent(y)},bindKeyEvent:function(z){var y=this;z.observeJob("canvas.panel.undo",function(){y.undoHandler()});z.observeJob("canvas.panel.redo",function(){y.redoHandler()})},setupHistory:function(){this.initHistory({content:v.EMPTY_PARAGRAPH_HTML,scrollTop:0})},canUndo:function(){return this.undoMementoList.length>0},canRedo:function(){return this.redoMementoList.length>0},setCurrentMemento:function(y){this.currentMemento=y},undoHandler:function(){var z=this;z.saveHistoryIfEdited();if(!z.canUndo()){return }var y=z.undoMementoList.pop();y.undo();z.redoMementoList.push(y);z.setCurrentMemento(y)},redoHandler:function(){var y=this;y.saveHistoryIfEdited();if(!y.canRedo()){return}var z=y.redoMementoList.pop();z.redo();y.undoMementoList.push(z);y.setCurrentMemento(z)},initHistory:function(B){var z=this;z.undoMementoList=[];z.redoMementoList=[];var A=new w();var y=Object.extend({content:v.EMPTY_PARAGRAPH_HTML,scrollTop:0},B);A.addUndoData(y);A.addHandler(z.getTextHandler());z.setCurrentMemento(A)},saveHistory:function(C,E,B){var z=this;var y=z.undoMementoList;var D=z.currentMemento;z.redoMementoList=[];if(arguments.length==3){D.addUndoRedData(C,E,B)}var F=z.getTextData();D.addRedoData(F);e(y,z.maxUndoCount);y.push(D);var A=new w();A.addHandler(z.getTextHandler());A.addUndoData(F);z.setCurrentMemento(A);z.contentModified=c},injectHistory:function(B,C,A){if(!this.canUndo()){return}var y=this.undoMementoList;var z=y[y.length-1];z.addUndoRedData(B,C,A)},saveHistoryIfEdited:function(){if(this.contentModified){this.saveHistory() }},saveHistoryByKeyEvent:function(A){var z={code:A.keyCode,ctrl:A.ctrlKey||(A.keyCode===17),alt:A.altKey||(A.keyCode===18),shift:A.shiftKey||(A.keyCode===16)};if(z.code==229){return}var y=this;if(z.code==g.__KEY.ENTER||z.code==g.__KEY.SPACE||z.code==g.__KEY.TAB){y.saveHistoryIfEdited()}else{if(z.code==g.__KEY.DELETE||z.code==g.__KEY.BACKSPACE){y.saveHistory()}else{if((z.code==g.__KEY.PASTE||z.code==g.__KEY.CUT)&&z.ctrl){y.saveHistory()}else{if(((z.code>32&&z.code<41)&&z.shift)||(z.code==65&&z.ctrl)){y.saveHistoryIfEdited()}else{if(z.ctrl||z.alt||(z.shift&&z.code==16)){}else{y.contentModified=u}}}}}},getTextHandler:function(){var z=this.canvas;var y=this;return function(C){z.setContent(C.content);var B={start:0,end:0};var A=C.range||B;y.restoreRange(A);if(t.msie_nonstd){setTimeout(function(){z.setScrollTop(C.scrollTop)},0)}}},getTextData:function(){return{content:this.canvas.getContent(),scrollTop:this.canvas.getScrollTop(),range:this.getRangeData()}}});var w=g.Class.create({initialize:function(){this.before={}; this.after={};this.handlers=[]},addUndoRedData:function(z,A,y){Object.extend(this.before,z);Object.extend(this.after,A);this.handlers.push(y)},addHandler:function(y){this.handlers.push(y)},addUndoData:function(y){Object.extend(this.before,y)},addRedoData:function(y){Object.extend(this.after,y)},undo:function(){var y=this;y.handlers.each(function(z){z(y.before)})},redo:function(){var y=this;y.handlers.each(function(z){z(y.after)})}})})();(function(w){var x=new t.Set(13,8,32,33,34,37,38,39,40,46);var e=function(y){return x.contains(y)};p.add({canvas:{doctype:"auto",mode:["text","html","source"],styles:{color:"#333333",fontFamily:"\ub3cb\uc6c0",fontSize:"9pt",backgroundColor:"#ffffff",lineHeight:"1.5",padding:"8px"},pMarginZero:true,selectedMode:"html",readonly:c,initHeight:400,minHeight:200,ext:"html",param:"",newlinepolicy:"p",showGuideArea:u,convertingText:u,escapeTextModeContents:u,removeTextModeBr:c,respectVisibilityInDesign:u}},function(z){var B=p.get("canvas",z);var y=z.events;B.initializedId=z.initializedId||""; B.useHotKey=y.useHotKey;var C=p.getTool("switcher",z);if(w.available(C,"switcher"+B.initializedId)){B.mode=C.options.pluck("data")}var D=p.getTool("fontfamily",z);if(w.available(D,"fontfamily"+B.initializedId)){if(D.webfont&&D.webfont.use){B.webfont=D.webfont;B.webfont.options.each(function(E){E.url=p.getUrl(E.url)})}}var A=p.get("resizer",z);if(A){B.minHeight=A.minHeight}B.wysiwygUrl=p.getUrl([(B.wysiwygPath||"#host#path/pages/daumx/"),"wysiwyg_",(B.serviceWysiwyg||""),((B.doctype=="html")?"html":"xhtml"),".",(B.ext?B.ext:"html"),"?prefix="+z.initializedId,"&",B.param].join(""));if(B.doctype=="auto"){if(t.msie&&t.msie_quirks){B.doctype="quirks"}else{B.doctype="edge"}}});p.add({size:{}});w.Canvas=w.Class.create({$const:{__TEXT_MODE:"text",__HTML_MODE:"source",__WYSIWYG_MODE:"html",__WYSIWYG_PADDING:8,__IMAGE_PADDING:5},$mixins:[w.I.JobObservable,w.I.KeyObservable,w.I.ElementObservable,w.I.MouseoverObservable],editor:i,elContainer:i,config:i,history:i,panels:i,initialize:function(y,A){this.editor=y; var z=this.config=p.get("canvas",A);var B=((A.initializedId)?A.initializedId:"");this.elContainer=t("tx_canvas"+B);this.wysiwygEl=t("tx_canvas_wysiwyg_holder"+B);this.sourceEl=t("tx_canvas_source_holder"+B);this.textEl=t("tx_canvas_text_holder"+B);this.initConfig(A);this.createPanel();this.history=new w.History(this,z);this.setCanvasSize({height:z.initHeight})},initConfig:function(A){var z=this.config;this.getRootConfig=function(){return A};this.getConfig=function(){return z};this.getStyleConfig=function(B){if(B){return z.styles[B]}else{return z.styles}};var y=p.get("size",A);this.measureWrapWidth=function(){y.wrapWidth=this.getContainerWidth()};this.measureWrapWidth();if(!y.contentWidth){y.contentWidth=y.wrapWidth}y.contentPadding=z.styles.padding.parsePx();this.getSizeConfig=function(){return y}},getContainerWidth:function(){return t.getDimensions(this.elContainer).width},createPanel:function(){var B=this;var A=this.config;this.panels={};this.mode=A.selectedMode||w.Canvas.__WYSIWYG_MODE; if(this._isForceTextMode()){this.mode=w.Canvas.__TEXT_MODE}var z={text:function(C){return new w.Canvas.TextPanel(B,C)},source:function(C){return new w.Canvas.HtmlPanel(B,C)},html:function(C){return new w.Canvas.WysiwygPanel(B,C)}};A.mode.each(function(C){if(z[C]){B.panels[C]=z[C](A)}});for(var y in B.panels){if(this.mode==y){B.panels[y].show()}else{B.panels[y].hide()}}B.observeJob("canvas.panel.iframe.load",function(C){B.fireJobs(w.Ev.__IFRAME_LOAD_COMPLETE,C)})},_isForceTextMode:function(){return t.ios||t.android},changeMode:function(z){var y=this.editor;var D=this.mode;if(D==z){return}if(this._isForceTextMode()&&D==w.Canvas.__TEXT_MODE){return}var A=this.panels[D];var B=this.panels[z];if(!A||!B){throw new Error("[Exception]Trex.Canvas : not suppored mode")}var F=A.getContent();var C=y.getDocParser().getContentsAtChangingMode(F,D,z);if(D==w.Canvas.__WYSIWYG_MODE){if(t.msie_ver===8){A.hide()}A.setContent("");try{this.focusOnTop()}catch(E){}}try{B.setContent(C)}catch(G){alert(" - Error: "+G.message+"\n\uc5d0\ub514\ud130 \ud0c0\uc785 \ubcc0\uacbd\uc5d0 \uc2e4\ud328\ud558\uc600\uc2b5\ub2c8\ub2e4.\n\uc798\ubabb\ub41c HTML\uc774 \uc788\ub294\uc9c0 \ud655\uc778\ud574\uc8fc\uc138\uc694."); A.setContent(F);A.show();return}this.mode=z;this.fireJobs(w.Ev.__CANVAS_MODE_CHANGE,D,z);B.setPanelHeight(A.getPanelHeight());B.show();A.hide();try{if(z=="html"&&!this.getPanel("html").designModeActivated&&t.gecko){this.getPanel("html").el.contentDocument.designMode="on";this.getPanel("html").designModeActivated=u}}catch(E){throw E}},focus:function(){this.panels[this.mode].focus()},focusOnTop:function(){this.getProcessor().focusOnTop()},focusOnBottom:function(){this.getProcessor().focusOnBottom()},getCanvasPos:function(){var y=t.cumulativeOffset(this.elContainer);return{x:y[0],y:y[1]}},setCanvasSize:function(y){if(this.panels[this.mode]&&y.height){this.panels[this.mode].setPanelHeight(y.height)}else{throw new Error("[Exception]Trex.Canvas : argument has no property - size.height ")}},canHTML:function(){return this.isWYSIWYG()},isWYSIWYG:function(){return this.mode===w.Canvas.__WYSIWYG_MODE},getPanel:function(y){if(this.panels[y]){return this.panels[y]}else{return i}},getCurrentPanel:function(){if(this.panels[this.mode]){return this.panels[this.mode] }else{return i}},getProcessor:function(y){if(!y){return this.panels[this.mode].getProcessor()}else{return this.panels[y].getProcessor()}},getContent:function(){var y=this.panels[this.mode].getContent();if(y){y=y.replace(w.__WORD_JOINER_REGEXP,"")}return y},getScrollTop:function(){if(!this.isWYSIWYG()){return 0}return this.panels[this.mode].getScrollTop()},setScrollTop:function(y){if(!this.isWYSIWYG()){return}this.panels[this.mode].setScrollTop(y)},setContent:function(y){this.panels[this.mode].setContent(y);this.includeWebfontCss(y)},initContent:function(y){this.history.initHistory({content:y});this.panels[this.mode].setContent(y);this.includeWebfontCss(y);this.fireJobs(w.Ev.__CANVAS_DATA_INITIALIZE,w.Canvas.__WYSIWYG_MODE,i)},includeWebfontCss:function(y){if(!this.isWYSIWYG()){return}return this.panels[this.mode].includeWebfontCss(y)},getUsedWebfont:function(){if(!this.isWYSIWYG()){return[]}return this.panels[this.mode].getUsedWebfont()},runScript:function(y){if(!this.isWYSIWYG()){return[] }this.panels[this.mode].runScript(y)},importScript:function(y,z){if(!this.isWYSIWYG()){return[]}this.panels[this.mode].importScript(y,z)},query:function(z){if(!this.isWYSIWYG()){return i}var y=this.getProcessor();return z(y)},execute:function(A){var z=this.history;var y=this.getProcessor();if(this.isWYSIWYG()){this.getPanel("html").ensureFocused();if(y.restoreRange){setTimeout(function(){y.restoreRange();A(y);z.saveHistory();y.restore()},0)}else{y.focus();A(y);z.saveHistory();y.restore()}}else{A(y)}},moveCaret:function(y){if(!y){return}if(!this.isWYSIWYG()){return}this.getProcessor().moveCaretWith(y)},pasteContent:function(A,y,z){y=y||c;this.execute(function(B){B.pasteContent(A,y,z)})},pasteNode:function(A,y,z){if(!this.isWYSIWYG()){return}y=y||c;this.execute(function(B){B.pasteNode(A,y,z)})},addStyle:function(y){this.panels[this.mode].addStyle(y)},getStyle:function(y){return this.panels[this.mode].getStyle(y)},getPositionByNode:function(y){if(!this.isWYSIWYG()){return{x:0,y:0,width:0,height:0} }return this.panels[this.mode].getPositionByNode(y)},onKeyDown:function(A){var C=this.getProcessor();var B=this.getCurrentPanel().getDocument();function D(){var E=d.dom.Range.createFromBrowserSelection(B.getSelection?B.getSelection():C.getSel());var F=E.getStartNode();var G=E.getStartOffset();return{node:F,offset:G}}var y=D();this.fireJobs(w.Ev.__CANVAS_PANEL_KEYDOWN,A);var z=null;if(A.keyCode==w.__KEY.BACKSPACE&&C.isCollapsed()&&(z=v.prevNodeUntilTagName(y.node,y.offset,"table"))&&v.isTagName(z,"table")){t.stop(A);this.fireJobs(w.Ev.__CANVAS_PANEL_BACKSPACE_TABLE,z)}if(this.config.useHotKey){this.fireKeys(A)}},onKeyUp:function(y){var z=y.keyCode+"";if(e(z)){this.getProcessor().clearDummy()}this.history.saveHistoryByKeyEvent(y);try{this.mayAttachmentChanged=u;this.fireJobs(w.Ev.__CANVAS_PANEL_KEYUP,y);if(this.isWYSIWYG()&&e(z)){this.triggerQueryStatus()}if(z===w.__KEY.DELETE||z===w.__KEY.BACKSPACE){this.fireJobs(w.Ev.__CANVAS_PANEL_DELETE_SOMETHING)}}catch(A){}},onMouseOver:function(y){try{this.fireMouseover(t.element(y)); this.fireJobs(w.Ev.__CANVAS_PANEL_MOUSEOVER,y)}catch(z){}},onMouseMove:function(y){try{this.fireJobs(w.Ev.__CANVAS_PANEL_MOUSEMOVE,y)}catch(z){}},onMouseOut:function(y){try{this.fireJobs(w.Ev.__CANVAS_PANEL_MOUSEOUT,y)}catch(z){}},onMouseDown:function(y){this.getProcessor().clearDummy();try{this.fireElements(t.element(y))}catch(A){}this.fireJobs(w.Ev.__CANVAS_PANEL_MOUSEDOWN,y);var z=this.history;z.saveHistoryIfEdited()},onMouseUp:function(z){try{var y=this;y.fireJobs(w.Ev.__CANVAS_PANEL_MOUSEUP,z);setTimeout(function(){var B=y.getProcessor().createGoogRange();if(B){y.fireJobs(w.Ev.__CANVAS_PANEL_QUERY_STATUS,B)}},20)}catch(A){}},mayAttachmentChanged:c,onClick:function(y){this.fireJobs(w.Ev.__CANVAS_PANEL_CLICK,y)},onDoubleClick:function(y){this.fireJobs(w.Ev.__CANVAS_PANEL_DBLCLICK,y)},onScroll:function(y){this.fireJobs(w.Ev.__CANVAS_PANEL_SCROLLING,y)},onPaste:function(y){this.fireJobs(w.Ev.__CANVAS_PANEL_PASTE,y)},triggerQueryStatus:function(){this.cancelReservedQueryStatusTrigger(); this.reserveQueryStatusTrigger()},reserveQueryStatusTrigger:function(){var y=this;this.reservedQueryStatusTrigger=setTimeout(function(){var z=y.getProcessor().createGoogRange();if(z){y.fireJobs(w.Ev.__CANVAS_PANEL_QUERY_STATUS,z);y.fireElements(y.getProcessor().getNode())}},20)},cancelReservedQueryStatusTrigger:function(){if(this.reservedQueryStatusTrigger){clearTimeout(this.reservedQueryStatusTrigger)}},syncProperty:function(){this.triggerQueryStatus()}})})(g);g.module("bind canvas events for close external menus",function(x,y,z,w){var e=function(){x.fireJobs(g.Ev.__SHOULD_CLOSE_MENUS)};w.observeJob(g.Ev.__CANVAS_PANEL_CLICK,e);w.observeJob(g.Ev.__CANVAS_SOURCE_PANEL_CLICK,e);w.observeJob(g.Ev.__CANVAS_TEXT_PANEL_CLICK,e)});g.module("make getter for 'iframeheight' and 'iframetop' size",function(y,A,B,x){var C=0;var e=0;function z(){var E=x.getPanel(g.Canvas.__WYSIWYG_MODE);C=E.getPanelHeight().parsePx();var D=v.getPosition(E.el);e=D.y}x.observeJob(g.Ev.__CANVAS_HEIGHT_CHANGE,function(D){z() });x.observeJob(g.Ev.__CANVAS_FULL_SCREEN_CHANGE,function(){z()});x.observeJob(g.Ev.__CANVAS_NORMAL_SCREEN_CHANGE,function(){z()});x.observeJob("canvas.apply.background",function(){z()});x.observeJob("canvas.apply.letterpaper",function(){z()});x.reserveJob(g.Ev.__IFRAME_LOAD_COMPLETE,function(){z()},300);var w=y.getAttachBox();w.observeJob(g.Ev.__ATTACHBOX_FULLSCREEN_SHOW,function(){z()});w.observeJob(g.Ev.__ATTACHBOX_FULLSCREEN_HIDE,function(){z()});t.observe(h,"resize",function(){z()});x.getIframeHeight=function(){return C};x.getIframeTop=function(){return e}});g.module("sync attachment data periodically",function(w,x,y,e){setTimeout(function(){setInterval(function(){if(e.mayAttachmentChanged){e.fireJobs(g.Ev.__CANVAS_PANEL_DELETE_SOMETHING);e.mayAttachmentChanged=c}},3000)},10000)});g.module("synchronize the font style when caret is in end of paragraph",function(w,x,y,e){t.gecko&&e.observeJob(g.Ev.__CANVAS_PANEL_MOUSEUP,function(I){if(e.isWYSIWYG()){var C=I.target;var D=C instanceof HTMLParagraphElement; var z=C instanceof HTMLHtmlElement;if(!D&&!z){return}var A=e.getProcessor();var K=I.pageX,H=I.pageY;var G=A.doc.caretPositionFromPoint(K,H);var B=G&&G.offsetNode;var E=B&&v.descendants(B,"#text");if(!E||!E.length){return}var F=E[E.length-1];if(F){var J=A.createGoogRangeFromNodes(F,F.length,F,F.length);J.select()}}})});g.module("apply respectVisibilityInDesign for old IE",function(x,z,A,w,e){var C=(t.msie&&(t.msie_docmode<9));C&&w.observeJob(g.Ev.__CANVAS_MODE_CHANGE,function(D,E){y()});C&&w.observeJob(g.Ev.__IFRAME_LOAD_COMPLETE,function(D){y()});var B="RespectVisibilityInDesign";function y(){if(w.isWYSIWYG()){var D=w.getProcessor();var F=D.doc.queryCommandState(B);var E=w.config.respectVisibilityInDesign;if(F!=E){D.doc.execCommand(B,false,E)}}}});g.Canvas.BasedPanel=g.Class.draft({initialize:function(x,w){this.config=w;this.canvas=x;this.elHolder=this.getHolder(w);this.el=this.getPanel(w);if(!this.el){throw new Error("[Exception]Trex.Canvas.Panel : panel element is not founded")}var e=this.constructor.__MODE; this.getName=function(){return e};this.lastHeight=i},focus:function(){this.el.focus()},show:function(){try{t.show(this.elHolder)}catch(w){}},hide:function(){try{t.hide(this.elHolder)}catch(w){}},getStyle:function(e){if(this.el.style[e]){return this.el.style[e]}else{return i}},addStyle:function(w){for(var e in w){if(this.el.style[e]){this.el.style[e]=w[e]}}},getPosition:function(){return v.getPosition(this.el)},getPanelHeight:function(){return v.getHeight(this.el).toPx()},setPanelHeight:function(e){e=e.toPx();if(this.lastHeight==e){return}v.setHeight(this.el,e);this.lastHeight=e}});(function(){g.WysiwygIframeLoader=g.Class.create({initialize:function(D,C,B){this.iframe=D;this.iframeUrl=C;this.doctype="";switch(B){case"edge":case"loose":case"strict":this.doctype=B}},load:function(C){try{this.loadLocalIframe(C,this.doctype)}catch(B){this.reloadUsingCatalyst(C)}},loadLocalIframe:function(D,B){var C=this.iframe.contentWindow.document;C.open();switch(B){case"edge":C.write(A);break;case"loose":C.write(x); break;case"strict":C.write(y);break}C.write(e);C.close();setTimeout(function(){D(C)},0)},reloadUsingCatalyst:function(F){var C=this;h.__tx_wysiwyg_iframe_load_complete=function(){C.loadLocalIframe(F,"")};if(!this.iframeUrl){var E=this.getIframePagePath();var B=this.doctype;switch(B){case"edge":case"loose":case"strict":this.iframeUrl=E+"trex/iframe_loader_catalyst_"+B+".html";break;default:this.iframeUrl=E+"trex/iframe_loader_catalyst.html"}}var D=(document.location.hostname!=document.domain);if(D){this.iframeUrl=this.iframeUrl+((this.iframeUrl.indexOf("?")>-1)?"&":"?")+"xssDomain="+document.domain}this.iframe.src=this.iframeUrl},getIframePagePath:function(){return EditorJSLoader.getPageBasePath("editor.js")},loadRemoteIframe:function(){var B=this.el;B.setAttribute("src",this.canvasConfig.wysiwygUrl)}});function z(D){var B=b.location;if(/^(https?:|file:|)\/\//.test(D)){}else{if(D.indexOf("/")===0){D="//"+B.host+":"+(B.port||"80")+D}else{var C=B.href;var E=C.lastIndexOf("/");D=C.substring(0,E+1)+D }}return D}var w=z(EditorJSLoader.getCSSBasePath());var A="";var x='';var y='';var e='DaumEditor Wygiwyg Panel