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; G < E; G += 1) { H[G] = z(G, K) || "null" } M = H.length === 0 ? "[]": B ? "[\n" + B + H.join(",\n" + B) + "\n" + J + "]": "[" + H.join(",") + "]"; B = J; return M } if (C && typeof C === "object") { E = C.length; for (G = 0; G < E; G += 1) { if (typeof C[G] === "string") { F = C[G]; M = z(F, K); if (M) { H.push(e(F) + (B ? ": ": ":") + M) } } } } else { for (F in K) { if (Object.prototype.hasOwnProperty.call(K, F)) { M = z(F, K); if (M) { H.push(e(F) + (B ? ": ": ":") + M) } } } } M = H.length === 0 ? "{}": B ? "{\n" + B + H.join(",\n" + B) + "\n" + J + "}": "{" + H.join(",") + "}"; B = J; return M } } if (typeof JSON.stringify !== "function") { JSON.stringify = function (H, F, G) { var E; B = ""; w = ""; if (typeof G === "number") { for (E = 0; E < G; E += 1) { w += " " } } else { if (typeof G === "string") { w = G } } C = F; if (F && typeof F !== "function" && (typeof F !== "object" || typeof F.length !== "number")) { throw new Error("JSON.stringify") } return z("", { "": H }) } } if (typeof JSON.parse !== "function") { JSON.parse = function (H, E) { var G; function F(L, K) { var J, I, M = L[K]; if (M && typeof M === "object") { for (J in M) { if (Object.prototype.hasOwnProperty.call(M, J)) { I = F(M, J); if (I !== undefined) { M[J] = I } else { delete M[J] } } } } return E.call(L, K, M) } H = String(H); x.lastIndex = 0; if (x.test(H)) { H = H.replace(x, function (I) { return "\\u" + ("0000" + I.charCodeAt(0).toString(16)).slice( - 4) }) } if (/^[\],:{}\s]*$/.test(H.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) { G = txEval("(" + H + ")"); return typeof E === "function" ? F({ "": G }, "") : G } throw new SyntaxError("JSON.parse") } } } ()); var t = {}; (function () { Object.extend = function (z, B) { for (var A in B) { z[A] = B[A] } return z }; h.Class = { create: function () { return function () { this.initialize.apply(this, arguments) } } }; h.$break = {}; Function.prototype.bind = function () { var z = this, B = $A(arguments), A = B.shift(); return function () { return z.apply(A, B.concat($A(arguments))) } }; Function.prototype.bindAsEventListener = function () { var z = this, B = $A(arguments), A = B.shift(); return function (C) { return z.apply(A, [C || h.event].concat(B)) } }; var y = function (B) { var z = arguments; if (z.length > 1) { for (var A = 0, D = [], C = z.length; A < C; A++) { D.push(t(z[A])) } return D } if (typeof B == "string") { B = b.getElementById(B) } return B }; t = y; var x = navigator.userAgent.toLowerCase(); var e = function (z) { return x.indexOf(z) != -1 }; var w = function (z) { return z.test(x) }; Object.extend(t, { chrome: e("chrome"), safari: e("safari") && e("chrome") == c, gecko: e("firefox"), gecko_ver: e("firefox") ? parseFloat(x.replace(/.*firefox\/([\d\.]+).*/g, "$1")) : 0, msie: e("msie") || e("trident"), msie_ver: e("msie") || e("trident") ? (function () { return e("msie") ? parseFloat(x.split("msie")[1]) : parseFloat(x.split("rv:")[1]) })() : 0, msie_docmode: b.documentMode || 0, webkit: e("applewebkit"), webkit_ver: e("applewebkit") ? parseFloat(x.replace(/.*safari\//g, "")) : 0, opera: e("opera"), presto: e("presto"), os_win: e("win"), os_win7: e("windows nt 6.1"), os_win8: e("windows nt 6.2"), os_win8_1: e("windows nt 6.3"), os_mac: e("mac"), iphone: e("iphone"), ipod: e("ipod"), ipad: e("ipad"), ios: e("like mac os x") && e("mobile"), ios_ver: (e("like mac os x") && e("mobile")) ? parseFloat(x.replace(/^.*os (\d+)([_\d]*) .*$/g, "$1.$2").replace(/_/g, "")) : 0, android: e("android"), android_ver: e("android") ? parseFloat(x.replace(/.*android[\s]*([\d\.]+).*/g, "$1")) : 0, blackberry: e("blackberry"), winphone: e("windows phone os"), wince: e("windows ce") }); Object.extend(t, { msie_std: (t.msie && !b.selection), msie_nonstd: (t.msie && !!b.selection), msie6: (t.msie && 6 <= t.msie_ver && t.msie_ver < 7) }); Object.extend(t, { extend: Object.extend, browser: function () { if (t.msie) { return "msie" } else { if (t.gecko) { return "firefox" } else { if (t.chrome) { return "chrome" } else { if (t.webkit) { return "safari" } else { if (t.opera) { return "opera" } else { return "" } } } } } } () }); h.$must = function (B, z) { var A = t(B); if (!A) { throw new Error("[Exception] " + z + ": cannot find element: id='" + B + "'") } return A }; h.txlib = y })(); (function () { t.extend(t, { classNames: function (e) { return e.className.split(" ") }, hasClassName: function (w, e) { if (e && w.className) { var x = w.className.split(/\s+/); return x.contains(e) } return c }, addClassName: function (e, w) { if (!this.hasClassName(e, w)) { e.className += " " + w } }, removeClassName: function (w, e) { var x = w.className.split(/\s+/); w.className = x.without(e).compact().join(" ") }, visible: function (e) { return t.getStyle(e, "display") != "none" }, toggle: function (e) { e = t(e); t[t.visible(e) ? "hide": "show"](e); return e }, show: function (e) { t(e).style.display = "block"; return e }, hide: function (e) { t(e).style.display = "none"; return e } }) })(); t.extend(t, { getStyle: function (w, x) { w = t(w); x = x == "float" ? "cssFloat": x.camelize(); var y = w.style[x]; if (!y) { var e = b.defaultView.getComputedStyle(w, i); y = e ? e[x] : i } if (x == "opacity") { return y ? parseFloat(y) : 1 } return y == "auto" ? i: y }, setStyle: function (e, x, w) { e = t(e); var z = e.style; for (var y in x) { if (x.hasOwnProperty(y)) { if (y === "opacity") { t.setOpacity(e, x[y]) } else { z[(y === "float" || y === "cssFloat") ? (z.styleFloat === q ? "cssFloat": "styleFloat") : (w ? y: y.camelize())] = x[y] } } } return e }, setStyleProperty: function (e, x) { var w = u; this.setStyle(e, x, w) }, getOpacity: function (e) { return t(e).getStyle("opacity") }, setOpacity: function (e, w) { e = t(e); e.style.opacity = (w == 1 || w === "") ? "": (w < 0.00001) ? 0 : w; return e }, applyCSSText: function (x, w) { var e = x.createElement("style"); e.setAttribute("type", "text/css"); if (e.styleSheet) { e.styleSheet.cssText = w } else { e.textContent = w } x.getElementsByTagName("head")[0].appendChild(e) } }); (function () { if (t.msie_nonstd) { t.getStyle = function (w, x) { w = t(w); x = (x == "float" || x == "cssFloat") ? "styleFloat": x.camelize(); var y = w.style[x]; if (!y && w.currentStyle) { y = w.currentStyle[x] } if (x == "opacity") { if (y = (t.getStyle(w, "filter") || "").match(/alpha\(opacity=(.*)\)/)) { if (y[1]) { return parseFloat(y[1]) / 100 } } return 1 } if (y == "auto") { if ((x == "width" || x == "height") && (t.getStyle(w, "display") != "none")) { return w["offset" + x.capitalize()] + "px" } return i } return y } } if (t.msie_nonstd) { t.setOpacity = function (w, z) { w = t(w); var y = t.getStyle(w, "filter"), x = w.style; if (z == 1 || z === "") { x.filter = y.replace(/alpha\([^\)]*\)/gi, ""); return w } else { if (z < 0.00001) { z = 0 } } x.filter = y.replace(/alpha\([^\)]*\)/gi, "") + "alpha(opacity=" + (z * 100) + ")"; return w } } if (t.gecko) { t.extend(t, { setOpacity: function (w, x) { w = t(w); w.style.opacity = (x == 1) ? 0.999999 : (x === "") ? "": (x < 0.00001) ? 0 : x; return w } }) } t.JSONHelper = { encodeURIComponentReplacer: function (w, x) { if (typeof x === "string") { if (!e(x)) { return encodeURIComponent(x) } } return x }, decodeURIComponentReviver: function (w, x) { if (typeof x === "string") { if (!e(x)) { return decodeURIComponent(x) } else { return JSON.parse(x, arguments.callee) } } return x } }; var e = function (w) { return (w.charAt(0) == "[" && w.charAt(w.length - 1) == "]") } })(); (function () { t.extend(t, { cumulativeOffset: function (w) { var e = 0, x = 0; do { e += w.offsetTop || 0; x += w.offsetLeft || 0; w = w.offsetParent } while (w); return [x, e] }, positionedOffset: function (w) { var e = 0, y = 0; do { e += w.offsetTop || 0; y += w.offsetLeft || 0; w = w.offsetParent; if (w) { if (w.tagName == "BODY") { break } var x = t.getStyle(w, "position"); if (x == "relative" || x == "absolute") { break } } } while (w); return [y, e] }, getDimensions: function (x) { var B = t.getStyle(x, "display"); if (B != "none" && B != i) { return { width: x.offsetWidth, height: x.offsetHeight } } var w = x.style; var A = w.visibility; var y = w.position; var e = w.display; w.visibility = "hidden"; w.position = "absolute"; w.display = "block"; var C = x.clientWidth; var z = x.clientHeight; w.display = e; w.position = y; w.visibility = A; return { width: C, height: z } }, getCoords: function (D, z) { var y = z || false; var x = D.offsetWidth; var A = D.offsetHeight; var B = { left: 0, top: 0, right: 0, bottom: 0 }; var C; while (D) { B.left += D.offsetLeft || 0; B.top += D.offsetTop || 0; D = D.offsetParent; if (y) { if (D) { if (D.tagName == "BODY") { break } C = t.getStyle(D, "position"); if (C !== "static") { break } } } } B.right = B.left + x; B.bottom = B.top + A; return B }, getCoordsTarget: function (e) { return this.getCoords(e, u) } }); if (t.webkit) { t.cumulativeOffset = function (w) { var e = 0, x = 0; do { e += w.offsetTop || 0; x += w.offsetLeft || 0; if (w.offsetParent == b.body) { if (t.getStyle(w, "position") == "absolute") { break } } w = w.offsetParent } while (w); return [x, e] } } })(); (function () { t.extend(t, { KEY_BACKSPACE: 8, KEY_TAB: 9, KEY_RETURN: 13, KEY_ESC: 27, KEY_LEFT: 37, KEY_UP: 38, KEY_RIGHT: 39, KEY_DOWN: 40, KEY_DELETE: 46, KEY_HOME: 36, KEY_END: 35, KEY_PAGEUP: 33, KEY_PAGEDOWN: 34, element: function (e) { return t(e.target || e.srcElement) }, isLeftClick: function (e) { return (((e.which) && (e.which == 1)) || ((e.button) && (e.button == 1))) }, pointerX: function (e) { return e.pageX || (e.clientX + (b.documentElement.scrollLeft || b.body.scrollLeft)) }, pointerY: function (e) { return e.pageY || (e.clientY + (b.documentElement.scrollTop || b.body.scrollTop)) }, stop: function (e) { if (e.preventDefault) { e.preventDefault(); e.stopPropagation() } else { e.returnValue = c; e.cancelBubble = u } }, findElement: function (x, w) { var e = t.element(x); while (e.parentNode && (!e.tagName || !e.tagName.toUpperCase || (e.tagName.toUpperCase() != w.toUpperCase()))) { e = e.parentNode } return e }, observers: c, _observeAndCache: function (y, x, w, e) { if (!this.observers) { this.observers = [] } if (y.addEventListener) { this.observers.push([y, x, w, e]); y.addEventListener(x, w, e) } else { if (y.attachEvent) { this.observers.push([y, x, w, e]); y.attachEvent("on" + x, w) } } }, simulateEvent: function (A, w, z) { var B = t.observers; if (!B) { return } for (var x = 0, y = B.length; x < y; x++) { var e = B[x]; if (e && e[1] === w && e[0] === A) { e[2](z) } } }, unloadCache: function () { if (!t.observers) { return } for (var e = 0, w = t.observers.length; e < w; e++) { t.stopObserving.apply(this, t.observers[e]); t.observers[e][0] = i } t.observers = c }, observe: function (y, x, w, e) { y = t(y); e = e || c; if (x == "keypress" && (t.webkit || y.attachEvent)) { x = "keydown" } t._observeAndCache(y, x, w, e) }, stopObserving: function (z, y, x, w) { z = t(z); w = w || c; if (y == "keypress" && (t.webkit || z.attachEvent)) { y = "keydown" } if (z.removeEventListener) { z.removeEventListener(y, x, w) } else { if (z.detachEvent) { try { z.detachEvent("on" + y, x) } catch(A) {} } } } }); if (t.msie) { t.observe(window, "unload", t.unloadCache, c) } })(); (function () { t.extend(Object, { clone: function (e) { return Object.extend({}, e) } }); t.extend(t, { isPrimitiveType: function (w) { var e = new t.Set("string", "number", "boolean", "date", "function"); return e.contains(typeof w) }, deepcopy: function (y, e) { var x = y; if (!e) { return x } for (var w in e) { switch (typeof(e[w])) { case "string": case "number": case "boolean": case "date": case "function": x[w] = e[w]; break; default: if (e[w]) { if (e[w].constructor == Array) { x[w] = [].concat(e[w]) } else { x[w] = x[w] || {}; this.deepcopy(x[w], e[w]) } } else { x[w] = i } break } } return x } }) })(); (function () { t.extend(String, { interpret: function (e) { return e == i ? "": String(e) }, specialChar: { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", "\\": "\\\\" } }); t.extend(String.prototype, { gsub: function (z, x) { var e = "", y = this, w; x = arguments.callee.prepareReplacement(x); while (y.length > 0) { 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 < x; w++) { e += this } return e }, camelize: function () { var y = this.split("-"), e = y.length; if (e == 1) { return y[0] } var x = this.charAt(0) == "-" ? y[0].charAt(0).toUpperCase() + y[0].substring(1) : y[0]; for (var w = 1; w < e; w++) { x += y[w].charAt(0).toUpperCase() + y[w].substring(1) } return x }, capitalize: function () { return this.charAt(0).toUpperCase() + this.substring(1).toLowerCase() }, include: function (e) { return this.indexOf(e) > -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; w < x.length; w++) { e += (escape(x.charAt(w)).charAt(1) == "u") ? 2 : 1 } return e }, cutRealLength: function (x) { var y = this; var e = 0; for (var w = 0; w < y.length; w++) { e += (escape(y.charAt(w)).charAt(1) == "u") ? 2 : 1; if (e > x) { 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) }, toByteUnit: function () { return this.toNumber().toByteUnit() }, toCurrency: function () { var w = this; for (var e = 0; e < Math.floor((w.length - (1 + e)) / 3); e++) { w = w.substring(0, w.length - (4 * e + 3)) + "," + w.substring(w.length - (4 * e + 3)) } return w }, replaceAll: function (e, w) { e = e.replace(new RegExp("(\\W)", "g"), "\\$1"); w = w.replace(new RegExp("\\$", "g"), "$$$$"); return this.replace(new RegExp(e, "gm"), w) } }) })(); (function () { t.extend(Number.prototype, { toPaddedString: function (x, w) { var e = this.toString(w || 10); return "0".times(x - e.length) + e }, toTime: function () { return Math.floor(this / 60).toString().toPaddedString(2) + ":" + (this % 60).toString().toPaddedString(2) }, toByteUnit: function () { var x; var e = ["GB", "MB", "KB"]; if (this == 0) { return "0" + e[2] } for (var w = 0; w < e.length; w++) { x = this / Math.pow(1024, 3 - w); if (x < 1) { continue } return (Math.round(x * 10) / 10) + e[w] } return "1" + e[2] }, toPx: function () { return this.toString() + "px" }, parsePx: function () { return this + 0 }, isPx: function () { return u }, toNumber: function () { return this + 0 }, toCurrency: function () { return this.toString().toCurrency() }, getRegExp: function () { return this.toString().getRegExp() } }) })(); (function () { t.extend(Array.prototype, { each: function (x) { try { for (var w = 0, y = this.length; w < y; w++) { x(this[w]) } } catch(z) { if (z != $break) { throw z } } return this }, indexOf: function (w) { for (var e = 0; e < this.length; e++) { if (this[e] == w) { return e } } return - 1 }, map: function (x) { for (var e = [], w = 0, y = this.length; w < y; ++w) { e[w] = x(this[w]) } return e }, include: function (e) { return this.contains(e) }, contains: function (e) { return this.indexOf(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; w < e; w++) { var x = this[w]; if (y(x, w)) { return x } } return i }, findAll: function (z) { var x = []; for (var w = 0, e = this.length; w < e; w++) { var y = this[w]; if (z(y, w)) { x.push(y) } } return x }, inject: function (z, x) { for (var w = 0, e = this.length; w < e; w++) { var y = this[w]; z = x(z, y, w) } return z }, without: function () { var e = $A(arguments); return this.findAll(function (w) { return ! e.include(w) }) }, last: function () { return this[this.length - 1] }, flatten: function () { return this.inject([], function (w, e) { return w.concat(e && e.constructor == Array ? e.flatten() : [e]) }) }, compact: function () { return this.findAll(function (e) { return (e != i) && (e != "") }) }, uniq: function (e) { return this.inject([], function (y, x, w) { if (0 == w || (e ? y.last() != x: !y.contains(x))) { y.push(x) } return y }) }, toMap: function (w) { var e = {}; this.each(function (x) { e[x[w]] = x }); return e } }); Array.prototype.select = Array.prototype.findAll; Array.prototype.detect = Array.prototype.find; h.$A = function (x) { if (!x) { return [] } if (typeof x.toArray === "function") { return x.toArray() } else { var y = []; for (var w = 0, e = x.length; w < e; w++) { y.push(x[w]) } return y } }; t.Set = function () { var w = arguments; for (var x = 0, e = w.length; x < e; x++) { this[w[x]] = u } }; t.Set.prototype.contains = function (e) { return e in this }; t.objectToQueryString = function (x) { var y = []; for (var e in x) { if (x.hasOwnProperty(e)) { var w = x[e]; if (w === i || w === q) { w = "" } y.push(encodeURIComponent(e) + "=" + encodeURIComponent(w)) } } return y.join("&") } })(); (function () { if (typeof(HTMLElement) != q + "") { var x = HTMLElement.prototype; var w = x.__proto__ = { __proto__: x.__proto__ }; if (HTMLElement.prototype.__defineSetter__) { w.__defineSetter__("innerText", function (A) { this.textContent = A }) } if (HTMLElement.prototype.__defineGetter__) { w.__defineGetter__("innerText", function () { return this.textContent }) } } if (typeof(XMLDocument) != q + "") { var z = XMLDocument; if (z.prototype.__defineGetter__) { z.prototype.__defineGetter__("xml", function () { return (new XMLSerializer()).serializeToString(this) }) } } if (typeof(Node) != q + "") { if (Node.prototype && Node.prototype.__defineGetter__) { Node.prototype.__defineGetter__("xml", function () { return (new XMLSerializer()).serializeToString(this) }) } } if (typeof(b.implementation) != q + "") { if (b.implementation.hasFeature("XPath", "3.0")) { if (typeof(z) != q + "") { z.prototype.selectNodes = function (C, E) { if (!E) { E = this } var D = this.defaultNS; var A = this.evaluate(C, E, { normalResolver: this.createNSResolver(this.documentElement), lookupNamespaceURI: function (G) { switch (G) { case "dflt": return D; default: return this.normalResolver.lookupNamespaceURI(G) } } }, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, i); var F = []; for (var B = 0; B < A.snapshotLength; B++) { F[B] = A.snapshotItem(B) } return F }; z.prototype.setProperty = function (B, A) { if (B == "SelectionNamespaces" && A.indexOf("xmlns:dflt") == 0) { this.defaultNS = A.replace(/^.*=\'(.+)\'/, "$1") } }; z.prototype.defaultNS; z.prototype.selectSingleNode = function (B, C) { if (!C) { C = this } var A = this.selectNodes(B, C); if (A.length > 0) { 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" && isTypeOfUndefined(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 && B < A; B++) { var e = E[B] || ""; var I = D[B] || ""; var F = new RegExp("(\\d*)(\\D*)", "g"); var z = new RegExp("(\\d*)(\\D*)", "g"); do { var H = F.exec(e) || ["", "", ""]; var G = z.exec(I) || ["", "", ""]; if (H[0].length == 0 && G[0].length == 0) { break } var C = H[1].length == 0 ? 0 : parseInt(H[1], 10); var y = G[1].length == 0 ? 0 : parseInt(G[1], 10); x = d.string.compareElements_(C, y) || d.string.compareElements_(H[2].length == 0, G[2].length == 0) || d.string.compareElements_(H[2], G[2]) } while (x == 0) } return x }; d.string.compareElements_ = function (w, e) { if (w < e) { return - 1 } else { if (w > e) { 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.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.isVersionCache_ = {}; d.userAgent.isVersion = function (e) { return d.userAgent.isVersionCache_[e] || (d.userAgent.isVersionCache_[e] = d.string.compareVersions(d.userAgent.VERSION, e) >= 0) }; d.userAgent.isDocumentModeCache_ = {}; d.userAgent.isDocumentMode = function (e) { return d.userAgent.isDocumentModeCache_[e] || (d.userAgent.isDocumentModeCache_[e] = d.userAgent.IE && b.documentMode && b.documentMode >= e) }; 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 < e.length; x++) { if (x in e && e[x] === z) { return x } } return - 1 }; d.array.forEach = d.NATIVE_ARRAY_PROTOTYPES && d.array.ARRAY_PROTOTYPE_.forEach ? function (e, x, w) { d.array.ARRAY_PROTOTYPE_.forEach.call(e, x, w) }: function (e, A, z) { var w = e.length; var x = d.isString(e) ? e.split("") : e; for (var y = 0; y < w; y++) { if (y in x) { A.call(z, x[y], y, e) } } }; d.array.forEachRight = function (e, A, z) { var w = e.length; var x = d.isString(e) ? e.split("") : e; for (var y = w - 1; y >= 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 < x; y++) { if (y in C) { var w = C[y]; if (A.call(e, w, y, z)) { B[D++] = w } } } return B }; d.array.map = d.NATIVE_ARRAY_PROTOTYPES && d.array.ARRAY_PROTOTYPE_.map ? function (e, x, w) { return d.array.ARRAY_PROTOTYPE_.map.call(e, x, w) }: function (e, B, A) { var w = e.length; var z = new Array(w); var x = d.isString(e) ? e.split("") : e; for (var y = 0; y < w; y++) { if (y in x) { z[y] = B.call(A, x[y], y, e) } } return z }; d.array.some = d.NATIVE_ARRAY_PROTOTYPES && d.array.ARRAY_PROTOTYPE_.some ? function (e, x, w) { return d.array.ARRAY_PROTOTYPE_.some.call(e, x, w) }: function (e, A, z) { var w = e.length; var x = d.isString(e) ? e.split("") : e; for (var y = 0; y < w; y++) { if (y in x && A.call(z, x[y], y, e)) { return u } } return c }; d.array.every = d.NATIVE_ARRAY_PROTOTYPES && d.array.ARRAY_PROTOTYPE_.every ? function (e, x, w) { return d.array.ARRAY_PROTOTYPE_.every.call(e, x, w) }: function (e, A, z) { var w = e.length; var x = d.isString(e) ? e.split("") : e; for (var y = 0; y < w; y++) { if (y in x && !A.call(z, x[y], y, e)) { return c } } return u }; d.array.contains = function (e, w) { return d.array.indexOf(e, w) >= 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; x < e; x++) { y[x] = w[x] } return y } }; d.array.toArray = function (e) { if (d.isArray(e)) { return d.array.concat((e)) } return d.array.clone((e)) }; d.array.splice = function (e, w, x, y) { return d.array.ARRAY_PROTOTYPE_.splice.apply(e, d.array.slice(arguments, 1)) }; d.array.slice = function (w, x, e) { if (arguments.length <= 2) { return d.array.ARRAY_PROTOTYPE_.slice.call(w, x) } else { return d.array.ARRAY_PROTOTYPE_.slice.call(w, x, e) } }; d.array.sort = function (e, w) { d.array.ARRAY_PROTOTYPE_.sort.call(e, w || d.array.defaultCompare) }; d.array.equals = function (x, w, A) { if (!d.isArrayLike(x) || !d.isArrayLike(w) || x.length != w.length) { return c } var e = x.length; var z = A || d.array.defaultCompareEquality; for (var y = 0; y < e; y++) { if (!z(x[y], w[y])) { return c } } return u }; d.array.compare = function (w, e, x) { return d.array.equals(w, e, x) }; d.array.defaultCompare = function (w, e) { return w > e ? 1 : w < e ? -1 : 0 }; d.array.defaultCompareEquality = function (w, e) { return w === e }; d.array.repeat = function (w, y) { var x = []; for (var e = 0; e < y; e++) { x[e] = w } return x }; d.provide("goog.dom.classes"); d.dom.classes.get = function (e) { var w = e.className; return w && typeof w.split == "function" ? w.split(/\s+/) : [] }; d.dom.classes.add = function (y, z) { var x = d.dom.classes.get(y); var w = d.array.slice(arguments, 1); var e = d.dom.classes.add_(x, w); y.className = x.join(" "); return e }; d.dom.classes.add_ = function (x, e) { var y = 0; for (var w = 0; w < e.length; w++) { if (!d.array.contains(x, e[w])) { x.push(e[w]); y++ } } return y == e.length }; d.provide("goog.object"); d.object.forEach = function (y, x, w) { for (var e in y) { x.call(w, y[e], e, y) } }; d.object.filter = function (z, y, x) { var w = {}; for (var e in z) { if (y.call(x, z[e], e, z)) { w[e] = z[e] } } return w }; d.object.map = function (z, y, x) { var w = {}; for (var e in z) { w[e] = y.call(x, z[e], e, z) } return w }; d.object.every = function (y, x, w) { for (var e in y) { if (!x.call(w, y[e], e, y)) { return c } } return u }; d.object.getCount = function (w) { var x = 0; for (var e in w) { x++ } return x }; d.object.contains = function (e, w) { return d.object.containsValue(e, w) }; d.object.getValues = function (y) { var x = []; var w = 0; for (var e in y) { x[w++] = y[e] } return x }; d.object.getKeys = function (y) { var x = []; var w = 0; for (var e in y) { x[w++] = e } return x }; d.object.containsValue = function (w, x) { for (var e in w) { if (w[e] == x) { return u } } return c }; d.object.isEmpty = function (w) { for (var e in w) { return c } return u }; d.object.clear = function (w) { for (var e in w) { delete w[e] } }; d.object.remove = function (w, e) { var x; if ((x = e in w)) { delete w[e] } return x }; d.object.add = function (w, e, x) { if (e in w) { throw Error('The object already contains the key "' + e + '"') } d.object.set(w, e, x) }; d.object.get = function (x, e, w) { if (e in x) { return x[e] } return w }; d.object.set = function (x, e, w) { x[e] = w }; d.object.clone = function (x) { var w = {}; for (var e in x) { w[e] = x[e] } return w }; d.object.PROTOTYPE_FIELDS_ = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"]; d.object.extend = function (z, A) { var x, y; for (var w = 1; w < arguments.length; w++) { y = arguments[w]; for (x in y) { z[x] = y[x] } for (var e = 0; e < d.object.PROTOTYPE_FIELDS_.length; e++) { x = d.object.PROTOTYPE_FIELDS_[e]; if (Object.prototype.hasOwnProperty.call(y, x)) { z[x] = y[x] } } } }; d.object.create = function (w) { var y = arguments.length; if (y == 1 && d.isArray(arguments[0])) { return d.object.create.apply(i, arguments[0]) } if (y % 2) { throw Error("Uneven number of arguments") } var x = {}; for (var e = 0; e < y; e += 2) { x[arguments[e]] = arguments[e + 1] } return x }; d.provide("goog.dom.TagName"); d.dom.TagName = { A: "A", ABBR: "ABBR", ACRONYM: "ACRONYM", ADDRESS: "ADDRESS", APPLET: "APPLET", AREA: "AREA", B: "B", BASE: "BASE", BASEFONT: "BASEFONT", BDO: "BDO", BIG: "BIG", BLOCKQUOTE: "BLOCKQUOTE", BODY: "BODY", BR: "BR", BUTTON: "BUTTON", CANVAS: "CANVAS", CAPTION: "CAPTION", CENTER: "CENTER", CITE: "CITE", CODE: "CODE", COL: "COL", COLGROUP: "COLGROUP", DD: "DD", DEL: "DEL", DFN: "DFN", DIR: "DIR", DIV: "DIV", DL: "DL", DT: "DT", EM: "EM", FIELDSET: "FIELDSET", FONT: "FONT", FORM: "FORM", FRAME: "FRAME", FRAMESET: "FRAMESET", H1: "H1", H2: "H2", H3: "H3", H4: "H4", H5: "H5", H6: "H6", HEAD: "HEAD", HR: "HR", HTML: "HTML", I: "I", IFRAME: "IFRAME", IMG: "IMG", INPUT: "INPUT", INS: "INS", ISINDEX: "ISINDEX", KBD: "KBD", LABEL: "LABEL", LEGEND: "LEGEND", LI: "LI", LINK: "LINK", MAP: "MAP", MENU: "MENU", META: "META", NOFRAMES: "NOFRAMES", NOSCRIPT: "NOSCRIPT", OBJECT: "OBJECT", OL: "OL", OPTGROUP: "OPTGROUP", OPTION: "OPTION", P: "P", PARAM: "PARAM", PRE: "PRE", Q: "Q", S: "S", SAMP: "SAMP", SCRIPT: "SCRIPT", SELECT: "SELECT", SMALL: "SMALL", SPAN: "SPAN", STRIKE: "STRIKE", STRONG: "STRONG", STYLE: "STYLE", SUB: "SUB", SUP: "SUP", TABLE: "TABLE", TBODY: "TBODY", TD: "TD", TEXTAREA: "TEXTAREA", TFOOT: "TFOOT", TH: "TH", THEAD: "THEAD", TITLE: "TITLE", TR: "TR", TT: "TT", U: "U", UL: "UL", VAR: "VAR" }; d.provide("goog.math.Size"); d.math.Size = function (w, e) { this.width = w; this.height = e }; d.math.Size.equals = function (w, e) { if (w == e) { return u } if (!w || !e) { return c } return w.width == e.width && w.height == e.height }; d.math.Size.prototype.clone = function () { return new d.math.Size(this.width, this.height) }; d.math.Size.prototype.area = function () { return this.width * this.height }; d.math.Size.prototype.isEmpty = function () { return ! this.area() }; d.provide("goog.dom.BrowserFeature"); d.dom.BrowserFeature = { CAN_ADD_NAME_OR_TYPE_ATTRIBUTES: !d.userAgent.IE || d.userAgent.isVersion("9"), CAN_USE_CHILDREN_ATTRIBUTE: !d.userAgent.GECKO && !d.userAgent.IE || d.userAgent.IE && d.userAgent.isVersion("9") || d.userAgent.GECKO && d.userAgent.isVersion("1.9.1"), CAN_USE_INNER_TEXT: d.userAgent.IE && !d.userAgent.isVersion("9"), INNER_HTML_NEEDS_SCOPED_ELEMENT: d.userAgent.IE }; d.provide("goog.math.Coordinate"); d.math.Coordinate = function (w, e) { this.x = d.isDef(w) ? w: 0; this.y = d.isDef(e) ? e: 0 }; d.math.Coordinate.prototype.clone = function () { return new d.math.Coordinate(this.x, this.y) }; d.math.Coordinate.equals = function (w, e) { if (w == e) { return u } if (!w || !e) { return c } return w.x == e.x && w.y == e.y }; d.provide("goog.dom"); d.provide("goog.dom.DomHelper"); d.provide("goog.dom.NodeType"); d.dom.ASSUME_QUIRKS_MODE = c; d.dom.ASSUME_STANDARDS_MODE = c; d.dom.COMPAT_MODE_KNOWN_ = d.dom.ASSUME_QUIRKS_MODE || d.dom.ASSUME_STANDARDS_MODE; d.dom.NodeType = { ELEMENT: 1, ATTRIBUTE: 2, TEXT: 3, CDATA_SECTION: 4, ENTITY_REFERENCE: 5, ENTITY: 6, PROCESSING_INSTRUCTION: 7, COMMENT: 8, DOCUMENT: 9, DOCUMENT_TYPE: 10, DOCUMENT_FRAGMENT: 11, NOTATION: 12 }; d.dom.getDomHelper = function (e) { return e ? new d.dom.DomHelper(d.dom.getOwnerDocument(e)) : (d.dom.defaultDomHelper_ || (d.dom.defaultDomHelper_ = new d.dom.DomHelper())) }; d.dom.defaultDomHelper_; d.dom.getDocument = function () { return document }; d.dom.getElement = function (e) { return d.isString(e) ? b.getElementById(e) : e }; d.dom.$ = d.dom.getElement; d.dom.getElementsByTagNameAndClass = function (x, e, w) { return d.dom.getElementsByTagNameAndClass_(document, x, e, w) }; d.dom.getElementsByClass = function (x, w) { var e = w || document; if (d.dom.canUseQuerySelector_(e)) { return e.querySelectorAll("." + x) } else { if (e.getElementsByClassName) { return e.getElementsByClassName(x) } } return d.dom.getElementsByTagNameAndClass_(document, "*", x, w) }; d.dom.getElementByClass = function (x, w) { var e = w || document; var y = i; if (d.dom.canUseQuerySelector_(e)) { y = e.querySelector("." + x) } else { y = d.dom.getElementsByClass(x, w)[0] } return y || i }; d.dom.canUseQuerySelector_ = function (e) { return e.querySelectorAll && e.querySelector && (!d.userAgent.WEBKIT || d.dom.isCss1CompatMode_(document) || d.userAgent.isVersion("528")) }; d.dom.getElementsByTagNameAndClass_ = function (E, D, x, G) { var F = G || E; var w = (D && D != "*") ? D.toUpperCase() : ""; if (d.dom.canUseQuerySelector_(F) && (w || x)) { var C = w + (x ? "." + x: ""); return F.querySelectorAll(C) } if (x && F.getElementsByClassName) { var y = F.getElementsByClassName(x); if (w) { var H = {}; var A = 0; for (var z = 0, e; e = y[z]; z++) { if (w == e.nodeName) { H[A++] = e } } H.length = A; return H } else { return y } } var y = F.getElementsByTagName(w || "*"); if (x) { var H = {}; var A = 0; for (var z = 0, e; e = y[z]; z++) { var B = e.className; if (typeof B.split == "function" && d.array.contains(B.split(/\s+/), x)) { H[A++] = e } } H.length = A; return H } else { return y } }; d.dom.$$ = d.dom.getElementsByTagNameAndClass; d.dom.setProperties = function (w, e) { d.object.forEach(e, function (y, x) { if (x == "style") { w.style.cssText = y } else { if (x == "class") { w.className = y } else { if (x == "for") { w.htmlFor = y } else { if (x in d.dom.DIRECT_ATTRIBUTE_MAP_) { w.setAttribute(d.dom.DIRECT_ATTRIBUTE_MAP_[x], y) } else { w[x] = y } } } } }) }; d.dom.DIRECT_ATTRIBUTE_MAP_ = { cellpadding: "cellPadding", cellspacing: "cellSpacing", colspan: "colSpan", rowspan: "rowSpan", valign: "vAlign", height: "height", width: "width", usemap: "useMap", frameborder: "frameBorder", maxlength: "maxLength", type: "type" }; d.dom.getViewportSize = function (e) { return d.dom.getViewportSize_(e || window) }; d.dom.getViewportSize_ = function (z) { var y = z.document; if (d.userAgent.WEBKIT && !d.userAgent.isVersion("500") && !d.userAgent.MOBILE) { if (typeof z.innerHeight == q + "") { z = window } var x = z.innerHeight; var w = z.document.documentElement.scrollHeight; if (z == z.top) { if (w < x) { x -= 15 } } return new d.math.Size(z.innerWidth, x) } var e = d.dom.isCss1CompatMode_(y) ? y.documentElement: y.body; return new d.math.Size(e.clientWidth, e.clientHeight) }; d.dom.getWindow = function (e) { return e ? d.dom.getWindow_(e) : window }; d.dom.getWindow_ = function (e) { return e.parentWindow || e.defaultView }; d.dom.createDom = function (w, e, x) { return d.dom.createDom_(document, arguments) }; d.dom.createDom_ = function (z, w) { var y = w[0]; var e = w[1]; if (!d.dom.BrowserFeature.CAN_ADD_NAME_OR_TYPE_ATTRIBUTES && e && (e.name || e.type)) { var B = ["<", y]; if (e.name) { B.push(' name="', d.string.htmlEscape(e.name), '"') } if (e.type) { B.push(' type="', d.string.htmlEscape(e.type), '"'); var A = {}; d.object.extend(A, e); e = A; delete e.type } B.push(">"); 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; x < w.length; x++) { var e = w[x]; if (d.isArrayLike(e) && !d.dom.isNodeLike(e)) { d.array.forEach(d.dom.isNodeList(e) ? d.array.clone(e) : e, y) } else { y(e) } } }; d.dom.$dom = d.dom.createDom; d.dom.createElement = function (e) { return b.createElement(e) }; d.dom.createTextNode = function (e) { return b.createTextNode(e) }; d.dom.isCss1CompatMode_ = function (e) { if (d.dom.COMPAT_MODE_KNOWN_) { return d.dom.ASSUME_STANDARDS_MODE } return e.compatMode == "CSS1Compat" }; d.dom.canHaveChildren_OLD = function (e) { if (e.nodeType != d.dom.NodeType.ELEMENT) { return c } switch (e.tagName) { case d.dom.TagName.APPLET: case d.dom.TagName.AREA: case d.dom.TagName.BASE: case d.dom.TagName.BR: case d.dom.TagName.COL: case d.dom.TagName.FRAME: case d.dom.TagName.HR: case d.dom.TagName.IMG: case d.dom.TagName.INPUT: case d.dom.TagName.IFRAME: case d.dom.TagName.ISINDEX: case d.dom.TagName.LINK: case d.dom.TagName.NOFRAMES: case d.dom.TagName.NOSCRIPT: case d.dom.TagName.META: case d.dom.TagName.OBJECT: case d.dom.TagName.PARAM: case d.dom.TagName.SCRIPT: case d.dom.TagName.STYLE: return c } return u }; d.dom.TAGS_CANT_HAVE_CHILDREN = { APPLET: u, AREA: u, BASE: u, BR: u, COL: u, FRAME: u, HR: u, IMG: u, INPUT: u, IFRAME: u, ISINDEX: u, LINK: u, NOFRAMES: u, NOSCRIPT: u, META: u, OBJECT: u, PARAM: u, SCRIPT: u, STYLE: u }; d.dom.canHaveChildren = function (e) { return e.nodeType == d.dom.NodeType.ELEMENT && !d.dom.TAGS_CANT_HAVE_CHILDREN[e.tagName] }; d.dom.appendChild = function (e, w) { e.appendChild(w) }; d.dom.append = function (e, w) { d.dom.append_(d.dom.getOwnerDocument(e), e, arguments, 1) }; d.dom.removeChildren = function (e) { var w; while ((w = e.firstChild)) { e.removeChild(w) } }; d.dom.insertSiblingBefore = function (w, e) { if (e.parentNode) { e.parentNode.insertBefore(w, e) } }; d.dom.insertSiblingAfter = function (w, e) { if (e.parentNode) { e.parentNode.insertBefore(w, e.nextSibling) } }; d.dom.removeNode = function (e) { return e && e.parentNode ? e.parentNode.removeChild(e) : i }; d.dom.replaceNode = function (e, x) { var w = x.parentNode; if (w) { w.replaceChild(e, x) } }; d.dom.flattenElement = function (e) { var x, w = e.parentNode; if (w && w.nodeType != d.dom.NodeType.DOCUMENT_FRAGMENT) { if (e.removeNode) { return (e.removeNode(c)) } else { while ((x = e.firstChild)) { w.insertBefore(x, e) } return (d.dom.removeNode(e)) } } }; d.dom.isNodeLike = function (e) { return d.isObject(e) && e.nodeType > 0 }; 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 < B; z++) { var E = []; var x = arguments[z]; while (x) { E.unshift(x); x = x.parentNode } D.push(E); e = Math.min(e, E.length) } var w = i; for (z = 0; z < e; z++) { var A = D[0][z]; for (var y = 1; y < B; y++) { if (A != D[y][z]) { return w } } w = A } return w }; d.dom.getOwnerDocument = function (e) { return (e.nodeType == d.dom.NodeType.DOCUMENT ? e: e.ownerDocument || e.document) }; d.dom.getOuterHtml = function (e) { if ("outerHTML" in e) { return e.outerHTML } else { var w = d.dom.getOwnerDocument(e); var x = w.createElement("div"); x.appendChild(e.cloneNode(u)); return x.innerHTML } }; d.dom.TAGS_TO_IGNORE_ = { SCRIPT: 1, STYLE: 1, HEAD: 1, IFRAME: 1, OBJECT: 1 }; d.dom.PREDEFINED_TAG_VALUES_ = { IMG: " ", BR: "\n" }; d.dom.getTextContent = function (x) { var w; if (d.dom.BrowserFeature.CAN_USE_INNER_TEXT && ("innerText" in x)) { w = d.string.canonicalizeNewlines(x.innerText) } else { var e = []; d.dom.getTextContent_(x, e, u); w = e.join("") } w = w.replace(/ \xAD /g, " ").replace(/\xAD/g, ""); w = w.replace(/\u200B/g, ""); if (!d.userAgent.IE) { w = w.replace(/ +/g, " ") } if (w != " ") { w = w.replace(/^\s*/, "") } return w }; d.dom.getRawTextContent = function (w) { var e = []; d.dom.getTextContent_(w, e, c); return e.join("") }; d.dom.getTextContent_ = function (x, w, e) { if (x.nodeName in d.dom.TAGS_TO_IGNORE_) {} else { if (x.nodeType == d.dom.NodeType.TEXT) { if (e) { w.push(String(x.nodeValue).replace(/(\r\n|\r|\n)/g, "")) } else { w.push(x.nodeValue) } } else { if (x.nodeName in d.dom.PREDEFINED_TAG_VALUES_) { w.push(d.dom.PREDEFINED_TAG_VALUES_[x.nodeName]) } else { var y = x.firstChild; while (y) { d.dom.getTextContent_(y, w, e); y = y.nextSibling } } } } }; d.dom.isNodeList = function (e) { if (e && typeof e.length == "number") { if (d.isObject(e)) { return typeof e.item == "function" || typeof e.item == "string" } else { if (d.isFunction(e)) { return typeof e.item == "function" } } } return c }; d.dom.DomHelper = function (e) { this.document_ = e || d.global.document || document }; d.dom.DomHelper.prototype.getDomHelper = d.dom.getDomHelper; d.dom.DomHelper.prototype.setDocument = function (e) { this.document_ = e }; d.dom.DomHelper.prototype.getDocument = function () { return this.document_ }; d.dom.DomHelper.prototype.getElement = function (e) { if (d.isString(e)) { return this.document_.getElementById(e) } else { return e } }; d.dom.DomHelper.prototype.$ = d.dom.DomHelper.prototype.getElement; d.dom.DomHelper.prototype.getElementsByTagNameAndClass = function (x, e, w) { return d.dom.getElementsByTagNameAndClass_(this.document_, x, e, w) }; d.dom.DomHelper.prototype.getElementsByClass = function (w, e) { var x = e || this.document_; return d.dom.getElementsByClass(w, x) }; d.dom.DomHelper.prototype.getElementByClass = function (w, e) { var x = e || this.document_; return d.dom.getElementByClass(w, x) }; d.dom.DomHelper.prototype.$$ = d.dom.DomHelper.prototype.getElementsByTagNameAndClass; d.dom.DomHelper.prototype.setProperties = d.dom.setProperties; d.dom.DomHelper.prototype.getViewportSize = function (e) { return d.dom.getViewportSize(e || this.getWindow()) }; d.dom.Appendable; d.dom.DomHelper.prototype.createDom = function (w, e, x) { return d.dom.createDom_(this.document_, arguments) }; d.dom.DomHelper.prototype.$dom = d.dom.DomHelper.prototype.createDom; d.dom.DomHelper.prototype.createElement = function (e) { return this.document_.createElement(e) }; d.dom.DomHelper.prototype.createTextNode = function (e) { return this.document_.createTextNode(e) }; d.dom.DomHelper.prototype.getWindow = function () { return d.dom.getWindow_(this.document_) }; d.dom.DomHelper.prototype.appendChild = d.dom.appendChild; d.dom.DomHelper.prototype.append = d.dom.append; d.dom.DomHelper.prototype.removeChildren = d.dom.removeChildren; d.dom.DomHelper.prototype.insertSiblingBefore = d.dom.insertSiblingBefore; d.dom.DomHelper.prototype.insertSiblingAfter = d.dom.insertSiblingAfter; d.dom.DomHelper.prototype.removeNode = d.dom.removeNode; d.dom.DomHelper.prototype.replaceNode = d.dom.replaceNode; d.dom.DomHelper.prototype.flattenElement = d.dom.flattenElement; d.dom.DomHelper.prototype.isNodeLike = d.dom.isNodeLike; d.dom.DomHelper.prototype.contains = d.dom.contains; d.dom.DomHelper.prototype.getOwnerDocument = d.dom.getOwnerDocument; d.dom.DomHelper.prototype.getTextContent = d.dom.getTextContent; d.provide("goog.iter"); d.provide("goog.iter.Iterator"); d.provide("goog.iter.StopIteration"); d.iter.Iterable; if ("StopIteration" in d.global) { d.iter.StopIteration = d.global.StopIteration } else { d.iter.StopIteration = Error("StopIteration") } d.iter.Iterator = function () {}; d.iter.Iterator.prototype.next = function () { throw d.iter.StopIteration }; d.iter.Iterator.prototype.__iterator__ = function (e) { return this }; d.iter.toIterator = function (w) { if (w instanceof d.iter.Iterator) { return w } if (typeof w.__iterator__ == "function") { return w.__iterator__(c) } if (d.isArrayLike(w)) { var e = 0; var x = new d.iter.Iterator; x.next = function () { while (u) { if (e >= 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; x < e; x++) { y.push(w[x]) } return y } return d.object.getValues(w) }; d.structs.getKeys = function (w) { if (typeof w.getKeys == "function") { return w.getKeys() } if (typeof w.getValues == "function") { return q } if (d.isArrayLike(w) || d.isString(w)) { var y = []; var e = w.length; for (var x = 0; x < e; x++) { y.push(x) } return y } return d.object.getKeys(w) }; d.structs.contains = function (e, w) { if (typeof e.contains == "function") { return e.contains(w) } if (typeof e.containsValue == "function") { return e.containsValue(w) } if (d.isArrayLike(e) || d.isString(e)) { return d.array.contains((e), w) } return d.object.containsValue(e, w) }; d.structs.isEmpty = function (e) { if (typeof e.isEmpty == "function") { return e.isEmpty() } if (d.isArrayLike(e) || d.isString(e)) { return d.array.isEmpty((e)) } return d.object.isEmpty(e) }; d.structs.clear = function (e) { if (typeof e.clear == "function") { e.clear() } else { if (d.isArrayLike(e)) { d.array.clear((e)) } else { d.object.clear(e) } } }; d.structs.forEach = function (x, B, A) { if (typeof x.forEach == "function") { x.forEach(B, A) } else { if (d.isArrayLike(x) || d.isString(x)) { d.array.forEach((x), B, A) } else { var z = d.structs.getKeys(x); var w = d.structs.getValues(x); var e = w.length; for (var y = 0; y < e; y++) { B.call(A, w[y], z && z[y], x) } } } }; d.structs.filter = function (x, B, A) { if (typeof x.filter == "function") { return x.filter(B, A) } if (d.isArrayLike(x) || d.isString(x)) { return d.array.filter((x), B, A) } var C; var z = d.structs.getKeys(x); var w = d.structs.getValues(x); var e = w.length; if (z) { C = {}; for (var y = 0; y < e; y++) { if (B.call(A, w[y], z[y], x)) { C[z[y]] = w[y] } } } else { C = []; for (var y = 0; y < e; y++) { if (B.call(A, w[y], q, x)) { C.push(w[y]) } } } return C }; d.structs.map = function (x, B, A) { if (typeof x.map == "function") { return x.map(B, A) } if (d.isArrayLike(x) || d.isString(x)) { return d.array.map((x), B, A) } var C; var z = d.structs.getKeys(x); var w = d.structs.getValues(x); var e = w.length; if (z) { C = {}; for (var y = 0; y < e; y++) { C[z[y]] = B.call(A, w[y], z[y], x) } } else { C = []; for (var y = 0; y < e; y++) { C[y] = B.call(A, w[y], q, x) } } return C }; d.structs.some = function (x, B, A) { if (typeof x.some == "function") { return x.some(B, A) } if (d.isArrayLike(x) || d.isString(x)) { return d.array.some((x), B, A) } var z = d.structs.getKeys(x); var w = d.structs.getValues(x); var e = w.length; for (var y = 0; y < e; y++) { if (B.call(A, w[y], z && z[y], x)) { return u } } return c }; d.structs.every = function (x, B, A) { if (typeof x.every == "function") { return x.every(B, A) } if (d.isArrayLike(x) || d.isString(x)) { return d.array.every((x), B, A) } var z = d.structs.getKeys(x); var w = d.structs.getValues(x); var e = w.length; for (var y = 0; y < e; y++) { if (!B.call(A, w[y], z && z[y], x)) { return c } } return u }; d.provide("goog.structs.Map"); d.structs.Map = function (w, x) { this.map_ = {}; this.keys_ = []; var y = arguments.length; if (y > 1) { if (y % 2) { throw Error("Uneven number of arguments") } for (var e = 0; e < y; e += 2) { this.set(arguments[e], arguments[e + 1]) } } else { if (w) { this.addAll((w)) } } }; d.structs.Map.prototype.count_ = 0; d.structs.Map.prototype.version_ = 0; d.structs.Map.prototype.getCount = function () { return this.count_ }; d.structs.Map.prototype.getValues = function () { this.cleanupKeysArray_(); var x = []; for (var w = 0; w < this.keys_.length; w++) { var e = this.keys_[w]; x.push(this.map_[e]) } return x }; d.structs.Map.prototype.getKeys = function () { this.cleanupKeysArray_(); return (this.keys_.concat()) }; d.structs.Map.prototype.containsKey = function (e) { return d.structs.Map.hasKey_(this.map_, e) }; d.structs.Map.prototype.containsValue = function (x) { for (var w = 0; w < this.keys_.length; w++) { var e = this.keys_[w]; if (d.structs.Map.hasKey_(this.map_, e) && this.map_[e] == x) { return u } } return c }; d.structs.Map.prototype.equals = function (x, e) { if (this === x) { return u } if (this.count_ != x.getCount()) { return c } var w = e || d.structs.Map.defaultEquals; this.cleanupKeysArray_(); for (var z, y = 0; z = this.keys_[y]; y++) { if (!w(this.get(z), x.get(z))) { return c } } return u }; d.structs.Map.defaultEquals = function (w, e) { return w === e }; d.structs.Map.prototype.isEmpty = function () { return this.count_ == 0 }; d.structs.Map.prototype.clear = function () { this.map_ = {}; this.keys_.length = 0; this.count_ = 0; this.version_ = 0 }; d.structs.Map.prototype.remove = function (e) { if (d.structs.Map.hasKey_(this.map_, e)) { delete this.map_[e]; this.count_--; this.version_++; if (this.keys_.length > 2 * 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 < this.keys_.length) { var y = this.keys_[x]; if (d.structs.Map.hasKey_(this.map_, y)) { this.keys_[w++] = y } x++ } this.keys_.length = w } if (this.count_ != this.keys_.length) { var e = {}; var x = 0; var w = 0; while (x < this.keys_.length) { var y = this.keys_[x]; if (! (d.structs.Map.hasKey_(e, y))) { this.keys_[w++] = y; e[y] = 1 } x++ } this.keys_.length = w } }; d.structs.Map.prototype.get = function (e, w) { if (d.structs.Map.hasKey_(this.map_, e)) { return this.map_[e] } return w }; d.structs.Map.prototype.set = function (e, w) { if (! (d.structs.Map.hasKey_(this.map_, e))) { this.count_++; this.keys_.push(e); this.version_++ } this.map_[e] = w }; d.structs.Map.prototype.addAll = function (y) { var x, e; if (y instanceof d.structs.Map) { x = y.getKeys(); e = y.getValues() } else { x = d.object.getKeys(y); e = d.object.getValues(y) } for (var w = 0; w < x.length; w++) { this.set(x[w], e[w]) } }; d.structs.Map.prototype.clone = function () { return new d.structs.Map(this) }; d.structs.Map.prototype.toObject = function () { this.cleanupKeysArray_(); var x = {}; for (var w = 0; w < this.keys_.length; w++) { var e = this.keys_[w]; x[e] = this.map_[e] } return x }; d.structs.Map.prototype.__iterator__ = function (B) { this.cleanupKeysArray_(); var w = 0; var x = this.keys_; var y = this.map_; var e = this.version_; var A = this; var z = new d.iter.Iterator; z.next = function () { while (u) { if (e != A.version_) { throw Error("The map has changed since the iterator was created") } if (w >= 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; y < e; y++) { this.add(w[y]) } }; d.structs.Set.prototype.remove = function (e) { return this.map_.remove(d.structs.Set.getKey_(e)) }; d.structs.Set.prototype.clear = function () { this.map_.clear() }; d.structs.Set.prototype.isEmpty = function () { return this.map_.isEmpty() }; d.structs.Set.prototype.contains = function (e) { return this.map_.containsKey(d.structs.Set.getKey_(e)) }; d.structs.Set.prototype.containsAll = function (e) { return d.structs.every(e, this.contains, this) }; d.structs.Set.prototype.getValues = function () { return this.map_.getValues() }; d.structs.Set.prototype.clone = function () { return new d.structs.Set(this) }; d.structs.Set.prototype.equals = function (e) { return this.getCount() == d.structs.getCount(e) && this.isSubsetOf(e) }; d.structs.Set.prototype.isSubsetOf = function (e) { var w = d.structs.getCount(e); if (this.getCount() > w) { 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 < e; x++) { w.push(this.getTextRange(x)) } return w }; d.dom.AbstractRange.prototype.getContainer = d.abstractMethod; d.dom.AbstractRange.prototype.getStartNode = d.abstractMethod; d.dom.AbstractRange.prototype.getStartOffset = d.abstractMethod; d.dom.AbstractRange.prototype.getEndNode = d.abstractMethod; d.dom.AbstractRange.prototype.getEndOffset = d.abstractMethod; d.dom.AbstractRange.prototype.getAnchorNode = function () { return this.isReversed() ? this.getEndNode() : this.getStartNode() }; d.dom.AbstractRange.prototype.getAnchorOffset = function () { return this.isReversed() ? this.getEndOffset() : this.getStartOffset() }; d.dom.AbstractRange.prototype.getFocusNode = function () { return this.isReversed() ? this.getStartNode() : this.getEndNode() }; d.dom.AbstractRange.prototype.getFocusOffset = function () { return this.isReversed() ? this.getStartOffset() : this.getEndOffset() }; d.dom.AbstractRange.prototype.isReversed = function () { return c }; d.dom.AbstractRange.prototype.getDocument = function () { return d.dom.getOwnerDocument(d.userAgent.IE ? this.getContainer() : this.getStartNode()) }; d.dom.AbstractRange.prototype.getWindow = function () { return d.dom.getWindow(this.getDocument()) }; d.dom.AbstractRange.prototype.containsRange = d.abstractMethod; d.dom.AbstractRange.prototype.containsNode = function (e, w) { return this.containsRange(d.dom.Range.createFromNodeContents(e), w) }; d.dom.AbstractRange.prototype.isRangeInDocument = d.abstractMethod; d.dom.AbstractRange.prototype.isCollapsed = d.abstractMethod; d.dom.AbstractRange.prototype.getText = d.abstractMethod; d.dom.AbstractRange.prototype.getHtmlFragment = d.abstractMethod; d.dom.AbstractRange.prototype.getValidHtml = d.abstractMethod; d.dom.AbstractRange.prototype.getPastableHtml = d.abstractMethod; d.dom.AbstractRange.prototype.__iterator__ = d.abstractMethod; d.dom.AbstractRange.prototype.select = d.abstractMethod; d.dom.AbstractRange.prototype.removeContents = d.abstractMethod; d.dom.AbstractRange.prototype.insertNode = d.abstractMethod; d.dom.AbstractRange.prototype.surroundWithNodes = d.abstractMethod; d.dom.AbstractRange.prototype.saveUsingDom = d.abstractMethod; d.dom.AbstractRange.prototype.saveUsingCarets = function () { return (this.getStartNode() && this.getEndNode()) ? new d.dom.SavedCaretRange(this) : i }; d.dom.AbstractRange.prototype.collapse = d.abstractMethod; d.dom.RangeIterator = function (e, w) { d.dom.TagIterator.call(this, e, w, u) }; d.inherits(d.dom.RangeIterator, d.dom.TagIterator); d.dom.RangeIterator.prototype.getStartTextOffset = d.abstractMethod; d.dom.RangeIterator.prototype.getEndTextOffset = d.abstractMethod; d.dom.RangeIterator.prototype.getStartNode = d.abstractMethod; d.dom.RangeIterator.prototype.getEndNode = d.abstractMethod; d.dom.RangeIterator.prototype.isLast = d.abstractMethod; d.provide("goog.dom.AbstractMultiRange"); d.dom.AbstractMultiRange = function () {}; d.inherits(d.dom.AbstractMultiRange, d.dom.AbstractRange); d.dom.AbstractMultiRange.prototype.containsRange = function (z, y) { var e = this.getTextRanges(); var x = z.getTextRanges(); var w = y ? d.array.some: d.array.every; return w(x, function (A) { return d.array.some(e, function (B) { return B.containsRange(A, y) }) }) }; d.dom.AbstractMultiRange.prototype.insertNode = function (e, w) { if (w) { d.dom.insertSiblingBefore(e, this.getStartNode()) } else { d.dom.insertSiblingAfter(e, this.getEndNode()) } return e }; d.dom.AbstractMultiRange.prototype.surroundWithNodes = function (w, e) { this.insertNode(w, u); this.insertNode(e, c) }; d.provide("goog.dom.TextRangeIterator"); d.dom.TextRangeIterator = function (x, B, y, C, A) { var D; if (x) { this.startNode_ = x; this.startOffset_ = B; this.endNode_ = y; this.endOffset_ = C; if (x.nodeType == d.dom.NodeType.ELEMENT && x.tagName != d.dom.TagName.BR) { var w = x.childNodes; var E = w[B]; if (E) { this.startNode_ = E; this.startOffset_ = 0 } else { if (w.length) { this.startNode_ = (d.array.peek(w)) } D = u } } if (y.nodeType == d.dom.NodeType.ELEMENT) { this.endNode_ = y.childNodes[C]; if (this.endNode_) { this.endOffset_ = 0 } else { this.endNode_ = y } } } d.dom.RangeIterator.call(this, A ? this.endNode_: this.startNode_, A); if (D) { try { this.next() } catch(z) { if (z != d.iter.StopIteration) { throw z } } } }; d.inherits(d.dom.TextRangeIterator, d.dom.RangeIterator); d.dom.TextRangeIterator.prototype.startNode_ = i; d.dom.TextRangeIterator.prototype.endNode_ = i; d.dom.TextRangeIterator.prototype.startOffset_ = 0; d.dom.TextRangeIterator.prototype.endOffset_ = 0; d.dom.TextRangeIterator.prototype.getStartTextOffset = function () { return this.node.nodeType != d.dom.NodeType.TEXT ? -1 : this.node == this.startNode_ ? this.startOffset_: 0 }; d.dom.TextRangeIterator.prototype.getEndTextOffset = function () { return this.node.nodeType != d.dom.NodeType.TEXT ? -1 : this.node == this.endNode_ ? this.endOffset_: this.node.nodeValue.length }; d.dom.TextRangeIterator.prototype.getStartNode = function () { return this.startNode_ }; d.dom.TextRangeIterator.prototype.setStartNode = function (e) { if (!this.isStarted()) { this.setPosition(e) } this.startNode_ = e; this.startOffset_ = 0 }; d.dom.TextRangeIterator.prototype.getEndNode = function () { return this.endNode_ }; d.dom.TextRangeIterator.prototype.setEndNode = function (e) { this.endNode_ = e; this.endOffset_ = 0 }; d.dom.TextRangeIterator.prototype.isLast = function () { return this.isStarted() && this.node == this.endNode_ && (!this.endOffset_ || !this.isStartTag()) }; d.dom.TextRangeIterator.prototype.next = function () { if (this.isLast()) { throw d.iter.StopIteration } return d.dom.TextRangeIterator.superClass_.next.call(this) }; d.dom.TextRangeIterator.prototype.skipTag = function () { d.dom.TextRangeIterator.superClass_.skipTag.apply(this); if (d.dom.contains(this.node, this.endNode_)) { throw d.iter.StopIteration } }; d.dom.TextRangeIterator.prototype.copyFrom = function (e) { this.startNode_ = e.startNode_; this.endNode_ = e.endNode_; this.startOffset_ = e.startOffset_; this.endOffset_ = e.endOffset_; this.isReversed_ = e.isReversed_; d.dom.TextRangeIterator.superClass_.copyFrom.call(this, e) }; d.dom.TextRangeIterator.prototype.clone = function () { var e = new d.dom.TextRangeIterator(this.startNode_, this.startOffset_, this.endNode_, this.endOffset_, this.isReversed_); e.copyFrom(this); return e }; d.provide("goog.userAgent.jscript"); d.userAgent.jscript.ASSUME_NO_JSCRIPT = c; d.userAgent.jscript.init_ = function () { var e = "ScriptEngine" in d.global; d.userAgent.jscript.DETECTED_HAS_JSCRIPT_ = e && d.global.ScriptEngine() == "JScript"; d.userAgent.jscript.DETECTED_VERSION_ = d.userAgent.jscript.DETECTED_HAS_JSCRIPT_ ? (d.global.ScriptEngineMajorVersion() + "." + d.global.ScriptEngineMinorVersion() + "." + d.global.ScriptEngineBuildVersion()) : "0" }; if (!d.userAgent.jscript.ASSUME_NO_JSCRIPT) { d.userAgent.jscript.init_() } d.userAgent.jscript.HAS_JSCRIPT = d.userAgent.jscript.ASSUME_NO_JSCRIPT ? c: d.userAgent.jscript.DETECTED_HAS_JSCRIPT_; d.userAgent.jscript.VERSION = d.userAgent.jscript.ASSUME_NO_JSCRIPT ? "0": d.userAgent.jscript.DETECTED_VERSION_; d.userAgent.jscript.isVersion = function (e) { return d.string.compareVersions(d.userAgent.jscript.VERSION, e) >= 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 < arguments.length; x++) { this.buffer_ += arguments[x] } } return this } } d.string.StringBuffer.prototype.clear = function () { if (d.userAgent.jscript.HAS_JSCRIPT) { this.buffer_.length = 0; this.bufferLength_ = 0 } else { this.buffer_ = "" } }; d.string.StringBuffer.prototype.getLength = function () { return this.toString().length }; d.string.StringBuffer.prototype.toString = function () { if (d.userAgent.jscript.HAS_JSCRIPT) { var e = this.buffer_.join(""); this.clear(); if (e) { this.append(e) } return e } else { return (this.buffer_) } }; d.provide("goog.dom.RangeEndpoint"); d.dom.RangeEndpoint = { START: 1, END: 0 }; d.provide("goog.dom.browserrange.AbstractRange"); d.dom.browserrange.AbstractRange = function () {}; d.dom.browserrange.AbstractRange.prototype.clone = d.abstractMethod; d.dom.browserrange.AbstractRange.prototype.getBrowserRange = d.abstractMethod; d.dom.browserrange.AbstractRange.prototype.getContainer = d.abstractMethod; d.dom.browserrange.AbstractRange.prototype.getStartNode = d.abstractMethod; d.dom.browserrange.AbstractRange.prototype.getStartOffset = d.abstractMethod; d.dom.browserrange.AbstractRange.prototype.getEndNode = d.abstractMethod; d.dom.browserrange.AbstractRange.prototype.getEndOffset = d.abstractMethod; d.dom.browserrange.AbstractRange.prototype.compareBrowserRangeEndpoints = d.abstractMethod; d.dom.browserrange.AbstractRange.prototype.containsRange = function (C, A) { var y = A && !C.isCollapsed(); var x = C.getBrowserRange(); var B = d.dom.RangeEndpoint.START, w = d.dom.RangeEndpoint.END; try { if (y) { return this.compareBrowserRangeEndpoints(x, w, B) >= 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 < D; B++) { var w = F[B]; if (d.dom.browserrange.canContainRangeEndpoint(w)) { var z = d.dom.browserrange.IeRange.getBrowserRangeForNode_(w); var e = d.dom.RangeEndpoint.START; var A = d.dom.RangeEndpoint.END; var C = (z.htmlText != w.outerHTML); var E = this.isCollapsed() && C; var x = E ? (this.compareBrowserRangeEndpoints(z, e, e) >= 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; F < z; F++) { var G = A ? F: z - F - 1; var y = B.childNodes[G]; var C; try { C = d.dom.browserrange.createRangeFromNodeContents(y) } catch(H) { continue } var w = C.getBrowserRange(); if (this.isCollapsed()) { if (!d.dom.browserrange.canContainRangeEndpoint(y)) { if (this.compareBrowserRangeEndpoints(w, x, x) == 0) { this.startOffset_ = this.endOffset_ = G; return B } } else { if (C.containsRange(this)) { return this.getEndpointNode_(I, y) } } } else { if (this.containsRange(C)) { if (!d.dom.browserrange.canContainRangeEndpoint(y)) { if (A) { this.startOffset_ = G } else { this.endOffset_ = G + 1 } return B } while (y.childNodes.length == 1) { y = y.firstChild } return this.getEndpointNode_(I, y) } else { if (this.compareBrowserRangeEndpoints(w, x, E) < 0 && this.compareBrowserRangeEndpoints(w, E, x) > 0) { 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 < H; F += E) { var y = B[F]; if (d.dom.browserrange.canContainRangeEndpoint(y)) { continue } var e = this.compareNodeEndpoints_(y, I, I); if (e == 0) { return A ? F: F + 1 } } return F == -1 ? 0 : F } else { var G = this.range_.duplicate(); var D = d.dom.browserrange.IeRange.getBrowserRangeForNode_(x); G.setEndPoint(A ? "EndToEnd": "StartToStart", D); var C = G.text.length; return A ? x.length - C: C } }; d.dom.browserrange.IeRange.getNodeText_ = function (e) { return e.nodeType == d.dom.NodeType.TEXT ? e.nodeValue: e.innerText }; d.dom.browserrange.IeRange.prototype.isRangeInDocument = function () { var e = this.doc_.body.createTextRange(); e.moveToElementText(this.doc_.body); return this.containsRange(new d.dom.browserrange.IeRange(e, this.doc_), u) }; d.dom.browserrange.IeRange.prototype.isCollapsed = function () { return this.range_.compareEndPoints("StartToEnd", this.range_) == 0 }; d.dom.browserrange.IeRange.prototype.getText = function () { return this.range_.text }; d.dom.browserrange.IeRange.prototype.getValidHtml = function () { return this.range_.htmlText }; d.dom.browserrange.IeRange.prototype.select = function (e) { this.range_.select() }; d.dom.browserrange.IeRange.prototype.removeContents = function () { if (this.range_.htmlText) { var x = this.getStartNode(); var A = this.getEndNode(); var F = this.range_.text; var C = this.range_.duplicate(); C.moveStart("character", 1); C.moveStart("character", -1); if (C.text != F) { var D = new d.dom.NodeIterator(x, c, u); var z = []; d.iter.forEach(D, function (e) { if (e.nodeType != d.dom.NodeType.TEXT && this.containsNode(e)) { z.push(e); D.skipTag() } if (e == A) { throw d.iter.StopIteration } }); this.collapse(u); d.array.forEach(z, d.dom.removeNode); this.clearCachedValues_(); return } this.range_ = C; this.range_.text = ""; this.clearCachedValues_(); var w = this.getStartNode(); var y = this.getStartOffset(); try { var E = x.nextSibling; if (x == A && x.parentNode && x.nodeType == d.dom.NodeType.TEXT && E && E.nodeType == d.dom.NodeType.TEXT) { x.nodeValue += E.nodeValue; d.dom.removeNode(E); this.range_ = d.dom.browserrange.IeRange.getBrowserRangeForNode_(w); this.range_.move("character", y); this.clearCachedValues_() } } catch(B) {} } }; d.dom.browserrange.IeRange.getDomHelper_ = function (e) { return d.dom.getDomHelper(e.parentElement()) }; d.dom.browserrange.IeRange.pasteElement_ = function (w, y, x) { x = x || d.dom.browserrange.IeRange.getDomHelper_(w); var z; var e = z = y.id; if (!z) { z = y.id = d.string.createUniqueString() } w.pasteHTML(y.outerHTML); y = x.getElement(z); if (y) { if (!e) { y.removeAttribute("id") } } return y }; d.dom.browserrange.IeRange.prototype.surroundContents = function (e) { d.dom.removeNode(e); e.innerHTML = this.range_.htmlText; e = d.dom.browserrange.IeRange.pasteElement_(this.range_, e); if (e) { this.range_.moveToElementText(e) } this.clearCachedValues_(); return e }; d.dom.browserrange.IeRange.insertNode_ = function (A, y, z, w) { w = w || d.dom.browserrange.IeRange.getDomHelper_(A); var e; if (y.nodeType != d.dom.NodeType.ELEMENT) { e = u; y = w.createDom(d.dom.TagName.DIV, i, y) } A.collapse(z); y = d.dom.browserrange.IeRange.pasteElement_(A, (y), w); if (e) { var x = y.firstChild; w.flattenElement(y); y = x } return y }; d.dom.browserrange.IeRange.prototype.insertNode = function (w, x) { var e = d.dom.browserrange.IeRange.insertNode_(this.range_.duplicate(), w, x); this.clearCachedValues_(); return e }; d.dom.browserrange.IeRange.prototype.surroundWithNodes = function (w, e) { var y = this.range_.duplicate(); var x = this.range_.duplicate(); d.dom.browserrange.IeRange.insertNode_(y, w, u); d.dom.browserrange.IeRange.insertNode_(x, e, c); this.clearCachedValues_() }; d.dom.browserrange.IeRange.prototype.collapse = function (e) { this.range_.collapse(e); if (e) { this.endNode_ = this.startNode_; this.endOffset_ = this.startOffset_ } else { this.startNode_ = this.endNode_; this.startOffset_ = this.endOffset_ } }; d.provide("goog.dom.browserrange.GeckoRange"); d.dom.browserrange.GeckoRange = function (e) { d.dom.browserrange.W3cRange.call(this, e) }; d.inherits(d.dom.browserrange.GeckoRange, d.dom.browserrange.W3cRange); d.dom.browserrange.GeckoRange.createFromNodeContents = function (e) { return new d.dom.browserrange.GeckoRange(d.dom.browserrange.W3cRange.getBrowserRangeForNode(e)) }; d.dom.browserrange.GeckoRange.createFromNodes = function (y, w, e, x) { return new d.dom.browserrange.GeckoRange(d.dom.browserrange.W3cRange.getBrowserRangeForNodes(y, w, e, x)) }; d.dom.browserrange.GeckoRange.prototype.selectInternal = function (x, A) { var w = A ? this.getEndNode() : this.getStartNode(); var y = A ? this.getEndOffset() : this.getStartOffset(); var z = A ? this.getStartNode() : this.getEndNode(); var e = A ? this.getStartOffset() : this.getEndOffset(); x.collapse(w, y); if (w != z || y != e) { x.extend(z, e) } }; d.provide("goog.dom.browserrange.OperaRange"); d.dom.browserrange.OperaRange = function (e) { d.dom.browserrange.W3cRange.call(this, e) }; d.inherits(d.dom.browserrange.OperaRange, d.dom.browserrange.W3cRange); d.dom.browserrange.OperaRange.createFromNodeContents = function (e) { return new d.dom.browserrange.OperaRange(d.dom.browserrange.W3cRange.getBrowserRangeForNode(e)) }; d.dom.browserrange.OperaRange.createFromNodes = function (y, w, e, x) { return new d.dom.browserrange.OperaRange(d.dom.browserrange.W3cRange.getBrowserRangeForNodes(y, w, e, x)) }; d.dom.browserrange.OperaRange.prototype.selectInternal = function (e, w) { e.collapse(this.getStartNode(), this.getStartOffset()); if (this.getEndNode() != this.getStartNode() || this.getEndOffset() != this.getStartOffset()) { e.extend(this.getEndNode(), this.getEndOffset()) } if (e.rangeCount == 0) { e.addRange(this.range_) } }; d.provide("goog.dom.browserrange"); d.provide("goog.dom.browserrange.Error"); d.dom.browserrange.Error = { NOT_IMPLEMENTED: "Not Implemented" }; d.dom.browserrange.createRange = function (e) { if (d.userAgent.IE && !d.userAgent.isDocumentMode(9)) { return new d.dom.browserrange.IeRange((e), d.dom.getOwnerDocument(e.parentElement())) } else { if (d.userAgent.WEBKIT) { return new d.dom.browserrange.WebKitRange((e)) } else { if (d.userAgent.GECKO) { return new d.dom.browserrange.GeckoRange((e)) } else { if (d.userAgent.OPERA) { return new d.dom.browserrange.OperaRange((e)) } else { return new d.dom.browserrange.W3cRange((e)) } } } } }; d.dom.browserrange.createRangeFromNodeContents = function (e) { if (d.userAgent.IE && !d.userAgent.isDocumentMode(9)) { return d.dom.browserrange.IeRange.createFromNodeContents(e) } else { if (d.userAgent.WEBKIT) { return d.dom.browserrange.WebKitRange.createFromNodeContents(e) } else { if (d.userAgent.GECKO) { return d.dom.browserrange.GeckoRange.createFromNodeContents(e) } else { if (d.userAgent.OPERA) { return d.dom.browserrange.OperaRange.createFromNodeContents(e) } else { return d.dom.browserrange.W3cRange.createFromNodeContents(e) } } } } }; d.dom.browserrange.createRangeFromNodes = function (y, w, e, x) { if (d.userAgent.IE && !d.userAgent.isDocumentMode(9)) { return d.dom.browserrange.IeRange.createFromNodes(y, w, e, x) } else { if (d.userAgent.WEBKIT) { return d.dom.browserrange.WebKitRange.createFromNodes(y, w, e, x) } else { if (d.userAgent.GECKO) { return d.dom.browserrange.GeckoRange.createFromNodes(y, w, e, x) } else { if (d.userAgent.OPERA) { return d.dom.browserrange.OperaRange.createFromNodes(y, w, e, x) } else { return d.dom.browserrange.W3cRange.createFromNodes(y, w, e, x) } } } } }; d.dom.browserrange.canContainRangeEndpoint = function (e) { return d.dom.canHaveChildren(e) || e.nodeType == d.dom.NodeType.TEXT }; d.provide("goog.dom.TextRange"); d.dom.TextRange = function () {}; d.inherits(d.dom.TextRange, d.dom.AbstractRange); d.dom.TextRange.createFromBrowserRange = function (e, w) { return d.dom.TextRange.createFromBrowserRangeWrapper_(d.dom.browserrange.createRange(e), w) }; d.dom.TextRange.createFromBrowserRangeWrapper_ = function (x, w) { var e = new d.dom.TextRange(); e.browserRangeWrapper_ = x; e.isReversed_ = !!w; return e }; d.dom.TextRange.createFromNodeContents = function (w, e) { return d.dom.TextRange.createFromBrowserRangeWrapper_(d.dom.browserrange.createRangeFromNodeContents(w), e) }; d.dom.TextRange.createFromNodes = function (x, z, A, e) { var w = new d.dom.TextRange(); w.isReversed_ = d.dom.Range.isReversed(x, z, A, e); if (x.tagName == "BR") { var y = x.parentNode; z = d.array.indexOf(y.childNodes, x); x = y } if (A.tagName == "BR") { var y = A.parentNode; e = d.array.indexOf(y.childNodes, A); A = y } if (w.isReversed_) { w.startNode_ = A; w.startOffset_ = e; w.endNode_ = x; w.endOffset_ = z } else { w.startNode_ = x; w.startOffset_ = z; w.endNode_ = A; w.endOffset_ = e } return w }; d.dom.TextRange.prototype.browserRangeWrapper_ = i; d.dom.TextRange.prototype.startNode_ = i; d.dom.TextRange.prototype.startOffset_ = i; d.dom.TextRange.prototype.endNode_ = i; d.dom.TextRange.prototype.endOffset_ = i; d.dom.TextRange.prototype.isReversed_ = c; d.dom.TextRange.prototype.clone = function () { var e = new d.dom.TextRange(); e.browserRangeWrapper_ = this.browserRangeWrapper_; e.startNode_ = this.startNode_; e.startOffset_ = this.startOffset_; e.endNode_ = this.endNode_; e.endOffset_ = this.endOffset_; e.isReversed_ = this.isReversed_; return e }; d.dom.TextRange.prototype.getType = function () { return d.dom.RangeType.TEXT }; d.dom.TextRange.prototype.getBrowserRangeObject = function () { return this.getBrowserRangeWrapper_().getBrowserRange() }; d.dom.TextRange.prototype.setBrowserRangeObject = function (e) { if (d.dom.AbstractRange.isNativeControlRange(e)) { return c } this.browserRangeWrapper_ = d.dom.browserrange.createRange(e); this.clearCachedValues_(); return u }; d.dom.TextRange.prototype.clearCachedValues_ = function () { this.startNode_ = this.startOffset_ = this.endNode_ = this.endOffset_ = i }; d.dom.TextRange.prototype.getTextRangeCount = function () { return 1 }; d.dom.TextRange.prototype.getTextRange = function (e) { return this }; d.dom.TextRange.prototype.getBrowserRangeWrapper_ = function () { return this.browserRangeWrapper_ || (this.browserRangeWrapper_ = d.dom.browserrange.createRangeFromNodes(this.getStartNode(), this.getStartOffset(), this.getEndNode(), this.getEndOffset())) }; d.dom.TextRange.prototype.getContainer = function () { return this.getBrowserRangeWrapper_().getContainer() }; d.dom.TextRange.prototype.getStartNode = function () { return this.startNode_ || (this.startNode_ = this.getBrowserRangeWrapper_().getStartNode()) }; d.dom.TextRange.prototype.getStartOffset = function () { return this.startOffset_ != i ? this.startOffset_: (this.startOffset_ = this.getBrowserRangeWrapper_().getStartOffset()) }; d.dom.TextRange.prototype.getEndNode = function () { return this.endNode_ || (this.endNode_ = this.getBrowserRangeWrapper_().getEndNode()) }; d.dom.TextRange.prototype.getEndOffset = function () { return this.endOffset_ != i ? this.endOffset_: (this.endOffset_ = this.getBrowserRangeWrapper_().getEndOffset()) }; d.dom.TextRange.prototype.moveToNodes = function (y, w, e, x, z) { this.startNode_ = y; this.startOffset_ = w; this.endNode_ = e; this.endOffset_ = x; this.isReversed_ = z; this.browserRangeWrapper_ = i }; d.dom.TextRange.prototype.isReversed = function () { return this.isReversed_ }; d.dom.TextRange.prototype.containsRange = function (z, y) { var e = z.getType(); if (e == d.dom.RangeType.TEXT) { return this.getBrowserRangeWrapper_().containsRange(z.getBrowserRangeWrapper_(), y) } else { if (e == d.dom.RangeType.CONTROL) { var x = z.getElements(); var w = y ? d.array.some: d.array.every; return w(x, function (A) { return this.containsNode(A, y) }, this) } } return c }; d.dom.TextRange.isAttachedNode = function (x) { if (d.userAgent.IE && !d.userAgent.isDocumentMode(9)) { var w = c; try { w = x.parentNode } catch(y) {} return !! w } else { return d.dom.contains(x.ownerDocument.body, x) } }; d.dom.TextRange.prototype.isRangeInDocument = function () { return (!this.startNode_ || d.dom.TextRange.isAttachedNode(this.startNode_)) && (!this.endNode_ || d.dom.TextRange.isAttachedNode(this.endNode_)) && (!(d.userAgent.IE && !d.userAgent.isDocumentMode(9)) || this.getBrowserRangeWrapper_().isRangeInDocument()) }; d.dom.TextRange.prototype.isCollapsed = function () { return this.getBrowserRangeWrapper_().isCollapsed() }; d.dom.TextRange.prototype.getText = function () { return this.getBrowserRangeWrapper_().getText() }; d.dom.TextRange.prototype.getHtmlFragment = function () { return this.getBrowserRangeWrapper_().getHtmlFragment() }; d.dom.TextRange.prototype.getValidHtml = function () { return this.getBrowserRangeWrapper_().getValidHtml() }; d.dom.TextRange.prototype.getPastableHtml = function () { var w = this.getValidHtml(); if (w.match(/^\s*" } 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; x < e; x++) { w.browserRanges_.push(y.getRangeAt(x)) } return w }; d.dom.MultiRange.createFromBrowserRanges = function (w) { var e = new d.dom.MultiRange(); e.browserRanges_ = d.array.clone(w); return e }; d.dom.MultiRange.createFromTextRanges = function (w) { var e = new d.dom.MultiRange(); e.ranges_ = w; e.browserRanges_ = w.map(function (x) { return x.getBrowserRangeObject() }); return e }; d.dom.MultiRange.prototype.clearCachedValues_ = function () { this.ranges_ = []; this.sortedRanges_ = i; this.container_ = i }; d.dom.MultiRange.prototype.clone = function () { return d.dom.MultiRange.createFromBrowserRanges(this.browserRanges_) }; d.dom.MultiRange.prototype.getType = function () { return d.dom.RangeType.MULTI }; d.dom.MultiRange.prototype.getBrowserRangeObject = function () { return this.browserRanges_[0] }; d.dom.MultiRange.prototype.setBrowserRangeObject = function (e) { return c }; d.dom.MultiRange.prototype.getTextRangeCount = function () { return this.browserRanges_.length }; d.dom.MultiRange.prototype.getTextRange = function (e) { if (!this.ranges_[e]) { this.ranges_[e] = d.dom.TextRange.createFromBrowserRange(this.browserRanges_[e]) } return this.ranges_[e] }; d.dom.MultiRange.prototype.getContainer = function () { if (!this.container_) { var w = []; for (var x = 0, e = this.getTextRangeCount(); x < e; x++) { w.push(this.getTextRange(x).getContainer()) } this.container_ = d.dom.findCommonAncestor.apply(i, w) } return this.container_ }; d.dom.MultiRange.prototype.getSortedRanges = function () { if (!this.sortedRanges_) { this.sortedRanges_ = this.getTextRanges(); this.sortedRanges_.sort(function (w, e) { var y = w.getStartNode(); var z = w.getStartOffset(); var x = e.getStartNode(); var A = e.getStartOffset(); if (y == x && z == A) { return 0 } return d.dom.Range.isReversed(y, z, x, A) ? 1 : -1 }) } return this.sortedRanges_ }; d.dom.MultiRange.prototype.getStartNode = function () { return this.getSortedRanges()[0].getStartNode() }; d.dom.MultiRange.prototype.getStartOffset = function () { return this.getSortedRanges()[0].getStartOffset() }; d.dom.MultiRange.prototype.getEndNode = function () { return this.getSortedRanges().last().getEndNode() }; d.dom.MultiRange.prototype.getEndOffset = function () { return this.getSortedRanges().last().getEndOffset() }; d.dom.MultiRange.prototype.isRangeInDocument = function () { return this.getTextRanges().every(function (e) { return e.isRangeInDocument() }) }; d.dom.MultiRange.prototype.isCollapsed = function () { return this.browserRanges_.length == 0 || this.browserRanges_.length == 1 && this.getTextRange(0).isCollapsed() }; d.dom.MultiRange.prototype.getText = function () { return this.getTextRanges().map(function (e) { return e.getText() }).join("") }; d.dom.MultiRange.prototype.getHtmlFragment = function () { return this.getValidHtml() }; d.dom.MultiRange.prototype.getValidHtml = function () { return this.getTextRanges().map(function (e) { return e.getValidHtml() }).join("") }; d.dom.MultiRange.prototype.getPastableHtml = function () { return this.getValidHtml() }; d.dom.MultiRange.prototype.__iterator__ = function (e) { return new d.dom.MultiRangeIterator(this) }; d.dom.MultiRange.prototype.select = function () { var x = d.dom.AbstractRange.getBrowserSelectionForWindow(this.getWindow()); x.removeAllRanges(); for (var w = 0, e = this.getTextRangeCount(); w < e; w++) { x.addRange(this.getTextRange(w).getBrowserRangeObject()) } }; d.dom.MultiRange.prototype.removeContents = function () { this.getTextRanges().each(function (e) { e.removeContents() }) }; d.dom.MultiRange.prototype.saveUsingDom = function () { return new d.dom.DomSavedMultiRange_(this) }; d.dom.MultiRange.prototype.collapse = function (w) { if (!this.isCollapsed()) { var e = w ? this.getTextRange(0) : this.getTextRange(this.getTextRangeCount() - 1); this.clearCachedValues_(); e.collapse(w); this.ranges_ = [e]; this.sortedRanges_ = [e]; this.browserRanges_ = [e.getBrowserRangeObject()] } }; d.dom.DomSavedMultiRange_ = function (e) { this.savedRanges_ = e.getTextRanges().map(function (w) { return w.saveUsingDom() }) }; d.inherits(d.dom.DomSavedMultiRange_, d.dom.SavedRange); d.dom.DomSavedMultiRange_.prototype.restoreInternal = function () { var e = this.savedRanges_.map(function (w) { return w.restore() }); return d.dom.MultiRange.createFromTextRanges(e) }; d.dom.DomSavedMultiRange_.prototype.disposeInternal = function () { d.dom.DomSavedMultiRange_.superClass_.disposeInternal.call(this); this.savedRanges_.map(function (e) { e.dispose() }); delete this.savedRanges_ }; d.dom.MultiRangeIterator = function (e) { if (e) { this.iterators_ = e.getSortedRanges().map(function (w) { return d.iter.toIterator(w) }) } d.dom.RangeIterator.call(this, e ? this.getStartNode() : i, c) }; d.inherits(d.dom.MultiRangeIterator, d.dom.RangeIterator); d.dom.MultiRangeIterator.prototype.iterators_ = i; d.dom.MultiRangeIterator.prototype.currentIdx_ = 0; d.dom.MultiRangeIterator.prototype.getStartTextOffset = function () { return this.iterators_[this.currentIdx_].getStartTextOffset() }; d.dom.MultiRangeIterator.prototype.getEndTextOffset = function () { return this.iterators_[this.currentIdx_].getEndTextOffset() }; d.dom.MultiRangeIterator.prototype.getStartNode = function () { return this.iterators_[0].getStartNode() }; d.dom.MultiRangeIterator.prototype.getEndNode = function () { return this.iterators_.last().getEndNode() }; d.dom.MultiRangeIterator.prototype.isLast = function () { return this.iterators_[this.currentIdx_].isLast() }; d.dom.MultiRangeIterator.prototype.next = function () { try { var x = this.iterators_[this.currentIdx_]; var w = x.next(); this.setPosition(x.node, x.tagType, x.depth); return w } catch(e) { if (e !== d.iter.StopIteration || this.iterators_.length - 1 == this.currentIdx_) { throw e } else { this.currentIdx_++; return this.next() } } }; d.dom.MultiRangeIterator.prototype.copyFrom = function (e) { this.iterators_ = d.array.clone(e.iterators_); d.dom.MultiRangeIterator.superClass_.copyFrom.call(this, e) }; d.dom.MultiRangeIterator.prototype.clone = function () { var e = new d.dom.MultiRangeIterator(i); e.copyFrom(this); return e }; d.provide("goog.dom.ControlRange"); d.provide("goog.dom.ControlRangeIterator"); d.dom.ControlRange = function () {}; d.inherits(d.dom.ControlRange, d.dom.AbstractMultiRange); d.dom.ControlRange.createFromBrowserRange = function (w) { var e = new d.dom.ControlRange(); e.range_ = w; return e }; d.dom.ControlRange.createFromElements = function (y) { var w = d.dom.getOwnerDocument(arguments[0]).body.createControlRange(); for (var x = 0, e = arguments.length; x < e; x++) { w.addElement(arguments[x]) } return d.dom.ControlRange.createFromBrowserRange(w) }; d.dom.ControlRange.prototype.range_ = i; d.dom.ControlRange.prototype.elements_ = i; d.dom.ControlRange.prototype.sortedElements_ = i; d.dom.ControlRange.prototype.clearCachedValues_ = function () { this.elements_ = i; this.sortedElements_ = i }; d.dom.ControlRange.prototype.clone = function () { return d.dom.ControlRange.createFromElements.apply(this, this.getElements()) }; d.dom.ControlRange.prototype.getType = function () { return d.dom.RangeType.CONTROL }; d.dom.ControlRange.prototype.getBrowserRangeObject = function () { return this.range_ || b.body.createControlRange() }; d.dom.ControlRange.prototype.setBrowserRangeObject = function (e) { if (!d.dom.AbstractRange.isNativeControlRange(e)) { return c } this.range_ = e; return u }; d.dom.ControlRange.prototype.getTextRangeCount = function () { return this.range_ ? this.range_.length: 0 }; d.dom.ControlRange.prototype.getTextRange = function (e) { return d.dom.TextRange.createFromNodeContents(this.range_.item(e)) }; d.dom.ControlRange.prototype.getContainer = function () { return d.dom.findCommonAncestor.apply(i, this.getElements()) }; d.dom.ControlRange.prototype.getStartNode = function () { return this.getSortedElements()[0] }; d.dom.ControlRange.prototype.getStartOffset = function () { return 0 }; d.dom.ControlRange.prototype.getEndNode = function () { var w = this.getSortedElements(); var e = (w.last()); return (w.find(function (x) { return d.dom.contains(x, e) })) }; d.dom.ControlRange.prototype.getEndOffset = function () { return this.getEndNode().childNodes.length }; d.dom.ControlRange.prototype.getElements = function () { if (!this.elements_) { this.elements_ = []; if (this.range_) { for (var e = 0; e < this.range_.length; e++) { this.elements_.push(this.range_.item(e)) } } } return this.elements_ }; d.dom.ControlRange.prototype.getSortedElements = function () { if (!this.sortedElements_) { this.sortedElements_ = this.getElements().concat(); this.sortedElements_.sort(function (w, e) { return w.sourceIndex - e.sourceIndex }) } return this.sortedElements_ }; d.dom.ControlRange.prototype.isRangeInDocument = function () { var w = c; try { w = this.getElements().every(function (e) { return d.userAgent.IE ? e.parentNode: d.dom.contains(e.ownerDocument.body, e) }) } catch(x) {} return w }; d.dom.ControlRange.prototype.isCollapsed = function () { return ! this.range_ || !this.range_.length }; d.dom.ControlRange.prototype.getText = function () { return "" }; d.dom.ControlRange.prototype.getHtmlFragment = function () { return this.getSortedElements().map(d.dom.getOuterHtml).join("") }; d.dom.ControlRange.prototype.getValidHtml = function () { return this.getHtmlFragment() }; d.dom.ControlRange.prototype.getPastableHtml = d.dom.ControlRange.prototype.getValidHtml; d.dom.ControlRange.prototype.__iterator__ = function (e) { return new d.dom.ControlRangeIterator(this) }; d.dom.ControlRange.prototype.select = function () { if (this.range_) { this.range_.select() } }; d.dom.ControlRange.prototype.removeContents = function () { if (this.range_) { var w = []; for (var x = 0, e = this.range_.length; x < e; x++) { w.push(this.range_.item(x)) } w.each(d.dom.removeNode); this.collapse(c) } }; d.dom.ControlRange.prototype.saveUsingDom = function () { return new d.dom.DomSavedControlRange_(this) }; d.dom.ControlRange.prototype.collapse = function (e) { this.range_ = i; this.clearCachedValues_() }; d.dom.DomSavedControlRange_ = function (e) { this.elements_ = e.getElements() }; d.inherits(d.dom.DomSavedControlRange_, d.dom.SavedRange); d.dom.DomSavedControlRange_.prototype.restoreInternal = function () { var y = this.elements_.length ? d.dom.getOwnerDocument(this.elements_[0]) : document; var x = y.body.createControlRange(); for (var w = 0, e = this.elements_.length; w < e; w++) { x.addElement(this.elements_[w]) } return d.dom.ControlRange.createFromBrowserRange(x) }; d.dom.DomSavedControlRange_.prototype.disposeInternal = function () { d.dom.DomSavedControlRange_.superClass_.disposeInternal.call(this); delete this.elements_ }; d.dom.ControlRangeIterator = function (e) { if (e) { this.elements_ = e.getSortedElements(); this.startNode_ = this.elements_.shift(); this.endNode_ = (this.elements_.last()) || this.startNode_ } d.dom.RangeIterator.call(this, this.startNode_, c) }; d.inherits(d.dom.ControlRangeIterator, d.dom.RangeIterator); d.dom.ControlRangeIterator.prototype.startNode_ = i; d.dom.ControlRangeIterator.prototype.endNode_ = i; d.dom.ControlRangeIterator.prototype.elements_ = i; d.dom.ControlRangeIterator.prototype.getStartTextOffset = function () { return 0 }; d.dom.ControlRangeIterator.prototype.getEndTextOffset = function () { return 0 }; d.dom.ControlRangeIterator.prototype.getStartNode = function () { return this.startNode_ }; d.dom.ControlRangeIterator.prototype.getEndNode = function () { return this.endNode_ }; d.dom.ControlRangeIterator.prototype.isLast = function () { return ! this.depth && !this.elements_.length }; d.dom.ControlRangeIterator.prototype.next = function () { if (this.isLast()) { throw d.iter.StopIteration } else { if (!this.depth) { var e = this.elements_.shift(); this.setPosition(e, d.dom.TagWalkType.START_TAG, d.dom.TagWalkType.START_TAG); return e } } return d.dom.ControlRangeIterator.superClass_.next.call(this) }; d.dom.ControlRangeIterator.prototype.copyFrom = function (e) { this.elements_ = e.elements_; this.startNode_ = e.startNode_; this.endNode_ = e.endNode_; d.dom.ControlRangeIterator.superClass_.copyFrom.call(this, e) }; d.dom.ControlRangeIterator.prototype.clone = function () { var e = new d.dom.ControlRangeIterator(i); e.copyFrom(this); return e }; d.provide("goog.dom.Range"); d.dom.Range.createFromWindow = function (w) { var e = d.dom.AbstractRange.getBrowserSelectionForWindow(w || window); return e && d.dom.Range.createFromBrowserSelection(e) }; d.dom.Range.createFromBrowserSelection = function (x) { var w; var y = c; if (x.createRange) { try { w = x.createRange() } catch(z) { return i } } else { if (x.rangeCount) { if (x.rangeCount > 1) { 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 e < x } var z; if (w.nodeType == d.dom.NodeType.ELEMENT && x) { z = w.childNodes[x]; if (z) { w = z; x = 0 } else { if (d.dom.contains(w, y)) { return u } } } if (y.nodeType == d.dom.NodeType.ELEMENT && e) { z = y.childNodes[e]; if (z) { y = z; e = 0 } else { if (d.dom.contains(y, w)) { return c } } } return (d.dom.compareNodeOrder(w, y) || x - e) > 0 }; d.provide("export_dep"); h.tx = {}; function a(w, y) { for (var x = 0, e = w.length; x < e; x++) { y(w[x]) } } h.installHyperscript = function (w, e) { a("a big blockquote br b center code dd dl dt div em font form h1 h2 h3 h4 h5 h6 hr img iframe input i li ol option pre p script select small span strike strong style sub sup table tbody td textarea tr ul u".split(" "), function (x) { w[x] = function () { var y = e.createElement(x); a(arguments, function (A) { if (A.nodeType) { y.appendChild(A) } else { if (typeof A == "string" || typeof A == "number") { if (x == "textarea") { if (t.msie) { y.value += A } else { y.text += A } } else { y.innerHTML += A } } else { if (typeof A == "array") { for (var C = 0; C < A.length; C++) { y.appendChild(A[C]) } } else { for (var z in A) { if (z == "style") { for (var B in A[z]) { if ((B == "float" || B == "cssFloat")) { y[z][y[z].styleFloat === q ? "cssFloat": "styleFloat"] = A[z][B] } else { y[z][B] = A[z][B] } } } else { if (["more", "less", "longDesc"].contains(z)) { if (y.setAttribute) { y.setAttribute(z, A[z]) } } else { if (["colSpan", "rowSpan", "cellPadding", "cellSpacing"].contains(z)) { if (y.setAttribute) { y.setAttribute(z, A[z]) } } else { if (A[z]) { y[z] = A[z] } } } } } } } } }); return y } }) }; installHyperscript(h.tx, b); (function () { function w(y, x) { if (!y) { return "" } if (x.indexOf("{if:") > -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); D < F; D++) { A.push(w(C[D], E)) } return A.join("").substring(B) }) } return x.replace(/#\{([_\w]+)\}/g, function (A, z) { if (y[z] != i) { return y[z] } else { return A } }) } var e = h.Template = function (x) { this.template = x }; e.prototype = { evaluate: function (x) { return w(x, this.template) }, evaluateToDom: function (y, x) { if (typeof(x) === "string") { x = b.getElementById(x) } x.innerHTML = w(y, this.template) }, evaluateAsDom: function (z, y) { var x = (y || document).createElement("div"); x.innerHTML = w(z, this.template); return x.firstChild } } })(); (function () { var e, z, x; var A = { "#": function (D, E) { if ((e = /(\S*)#(\S+)/.exec(E)) !== i) { var C = e[1]; var F = e[2]; if (!D.getElementById) { D = D.ownerDocument } if (z = D.getElementById(F)) { if (C.length < 1 || z.nodeName.toLowerCase() == C) { return [z] } } } return [] }, ".": function (E, I) { if ((e = /(\S*)\.(\S+)/.exec(I)) !== i) { var D = ((e[1] === "") ? "*": e[1]); var C = e[2]; if ((x = E.getElementsByTagName(D)).length > 0) { var G = []; for (var F = 0; F < x.length; F++) { var H = x[F]; if ((new RegExp("(^| )" + C + "($| )")).test(H.className)) { G.push(H) } } return G } } return [] }, "*": function (C, F) { if ((x = C.getElementsByTagName(F)).length > 0) { var E = []; for (var D = 0; D < x.length; D++) { E.push(x[D]) } return E } return [] } }; var w = function (C, G) { if (C.length < 1) { return [] } var F; if ((f = /(\.|#)/.exec(G)) !== i) { if (A[f[1]]) { F = f[1] } } F = F || "*"; var E = []; for (var D = 0; D < C.length; D++) { E = E.concat(A[F](C[D], G)) } return E }; var B = function (C, F) { var E = [C]; var G = F.split(" "); for (var D = 0; D < G.length; D++) { E = w(E, G[D]) } return E }; var y = function (F, C, G) { G = !!G; if (F.nodeType !== 1 && F.nodeType !== 9) { return (G ? [] : i) } if (!C || typeof C !== "string") { return (G ? [] : i) } var E; var H = []; var I = C.split(","); for (var D = 0; D < I.length; D++) { E = B(F, I[D]); if (E && E.length > 0) { 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 < F.length; C++) { E = w(D, F[C]); if (E) { break } } return E }; h.dChecky = function () { var B = arguments; if (B.length == 2) { if (B[0].nodeType && typeof(B[1]) === "string") { return y(B[0], B[1]) } } return c } })(); (function () { var e, y, x; var z = { "#": function (C, E) { if ((e = /(\S*)#(\S+)/.exec(E)) !== i) { var B = ((e[1] === "") ? "*": e[1]); var F = e[2]; var D = C; while (D) { if (D.nodeName.toLowerCase() == "body") { break } if (B == "*" || D.nodeName.toLowerCase() == B) { if (D.id == F) { return D } } D = D.parentNode } } return i }, ".": function (D, F) { if ((e = /(\S*)\.(\S+)/.exec(F)) !== i) { var C = ((e[1] === "") ? "*": e[1]); var B = e[2]; var E = D; while (E) { if (E.nodeName.toLowerCase() == "body") { break } if (C == "*" || E.nodeName.toLowerCase() == C) { if (E.className.indexOf(B) > -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; D < B; D++) { F[H[D]] = u } while (E) { if (E.nodeName.toLowerCase() == "body") { break } if (F[E.nodeName.toLowerCase()]) { return E } E = E.parentNode } return i } }; var A = function (C, E) { var D; if ((f = /(\.|#|:\w+)/.exec(E)) !== i) { if (z[f[1]]) { D = f[1] } } D = D || "*"; var B = i; if ((B = z[D](C, E)) != i) { return B } return i }; var w = function (F, C) { if (!C || typeof C !== "string") { return i } var E = F; var G = C.split(" "); for (var D = 0, B = G.length; D < B; D++) { if ((E = A(E, G[D])) == i) { return i } } return E }; h.dFindy = function () { var B = arguments; if (B.length == 1) { throw new Error("need more arguments") } else { if (B.length == 2) { if (B[0].nodeType && typeof(B[1]) === "string") { return w(B[0], B[1]) } } } return i } })(); (function () { var e = function (x) { this.selectSingleNode = function (y) { if (!x) { return i } return x.selectSingleNode(y) }; this.selectNodes = function (y) { if (!x) { return [] } return x.selectNodes(y) }; this.getAttributeNode = function (y) { if (!x) { return i } return x.getAttributeNode(y) }; this.hasChildNodes = function () { if (!x) { return c } return x.hasChildNodes() }; this.text = x ? (x.textContent || x.text) : i; this.type = x ? x.nodeType: 0; this.name = (x && x.nodeType == 1) ? (x.nodeName || "") : ""; return this }; e.prototype = { getValueOrDefault: function (y, x) { if (y === "") { return x } else { if (typeof(x) === "number") { return (isNaN(y) ? 0 : parseInt(y)) } else { if (typeof(x) === "boolean") { return !! y } else { return y } } } }, xText: function (x) { x = x || ""; var y = this.text; y = (y || "").trim(); return this.getValueOrDefault(y, x) }, xAttr: function (z, y) { y = y || ""; var x = this.getAttributeNode(z); var A = (!x) ? "": x.nodeValue.trim(); return this.getValueOrDefault(A, y) }, xGet: function (x) { return xGetty(this, x) }, xGets: function (x) { return xGetties(this, x) } }; var w = ["MSXML2.DOMDocument.6.0", "MSXML2.DOMDocument.5.0", "MSXML2.DOMDocument.4.0", "MSXML4.DOMDocument", "MSXML3.DOMDocument", "MSXML2.DOMDocument", "MSXML.DOMDocument", "Microsoft.XmlDom"]; h.xCreate = function (z) { if ( !! (h.attachEvent && !h.opera)) { var y = (function () { var B = i; for (var A = 0; A < w.length; A++) { try { B = new ActiveXObject(w[A]) } catch(C) {} if (B !== i) { return B } } return i })(); if (y === i) { return i } y.async = c; y.loadXML(z); if (y.parseError.errorCode !== 0) { return i } return new e(y) } else { var x = new DOMParser(); var y = x.parseFromString(new String(z), "text/xml"); return new e(y) } }; h.xGetty = function (x, y) { if (x === i) { return i } return new e(x.selectSingleNode(y)) }; h.xGetties = function (A, C) { if (A === i) { return [] } var B = []; var y = A.selectNodes(C); for (var z = 0, x = y.length; z < x; z++) { B.push(new e(y[z])) } return B } })(); function r(e, x) { for (var w in x) { e[w] = x[w] } return e } var l = function () { this.empty = true; this.shorthand = false; this.properties = {} }; l.TAGS_FOR_PRESENTATION = { U: { textDecoration: "underline" }, B: { fontWeight: "bold" }, STRONG: { fontWeight: "bold" }, I: { fontStyle: "italic" }, EM: { fontStyle: "italic" }, S: { textDecoration: "line-through" }, STRIKE: { textDecoration: "line-through" }, INS: { textDecoration: "underline" }, DEL: { textDecoration: "line-through" }, FONT: function (w) { var e = {}; if (w.face) { e.fontFamily = w.face } if (w.color) { e.color = w.color } var x = ["", "x-small", "small", "medium", "large", "x-large", "xx-large"]; if (w.size) { var y = w.size; e.fontSize = isNaN(y) ? y: x[Math.min(Math.max(1, y), 6)] } return e } }; l.FONT_RELATED_CSS_PROPERTIES = { font: "font", "font-style": "fontStyle", "font-weight": "fontWeight", "font-size": "fontSize", "font-family": "fontFamily", "text-decoration": "textDecoration", color: "color", "background-color": "backgroundColor" }; l.create = function (D, z) { var E = new l(); var y = l.TAGS_FOR_PRESENTATION[D]; if (y) { var C = (typeof y == "function") ? y(z) : y; for (var e in C) { E.setProperty(e, C[e]) } } var x = z.style; if (x) { x = x.replace(/[\w-]+:\s?;/g, ""); var B = x.split(/; ?|: ?/); for (var A = 0; A < B.length - 1; A += 2) { var w = l.FONT_RELATED_CSS_PROPERTIES[B[A].toLowerCase()]; if (w) { if (w != "backgroundColor" || (l.TAGS_FOR_PRESENTATION[D] || D == "SPAN")) { E.setProperty(w, B[A + 1]) } } } } return E.getComputedStyles() }; l.FONT_CSS_REGEXP = /(.*?)(\w+)(\/\w+)?\s+(['"]?[\w\uac00-\ud7a3]+['"]?)$/; l.NORMAL_VALUE = "normal"; l.prototype.isEmpty = function () { return this.empty }; l.prototype.setProperty = function (e, w) { if (/^font$/i.test(e)) { var x = this.fromShorthand(w); if (x) { this.shorthand = true; r(this.properties, this.fromShorthand(w)) } } else { this.properties[e] = w } this.empty = false }; l.prototype.getComputedStyles = function () { if (this.shorthand) { return this.toShorthand() } else { return r({}, this.properties) } }; l.prototype.fromShorthand = function (y) { var w = y.indexOf(","), x = ""; if (w > 0) { 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 < B; z++) { var C = E[z]; C(A, D, w, x, y) } }, invokeInstallation: function (y, z, A, x, w) { e.invoke(e.installs, y, z, A, x, w) }, invokeRegisters: function (y, z, A, x, w) { e.invoke(e.registers, y, z, A, x, w) }, invokeModules: function (y, z, A, x, w) { e.invoke(e.modules, y, z, A, x, w) }, group: function () {}, groupEnd: function () {} }) })(g); h.Trex = g; (function (e) { e.Ev = { __EDITOR_PANEL_MOUSEDOWN: "editor.panel.mousedown", __CANVAS_PANEL_KEYDOWN: "canvas.panel.keydown", __CANVAS_PANEL_KEYUP: "canvas.panel.keyup", __CANVAS_PANEL_MOUSEDOWN: "canvas.panel.mousedown", __CANVAS_PANEL_MOUSEUP: "canvas.panel.mouseup", __CANVAS_PANEL_MOUSEOVER: "canvas.panel.mouseover", __CANVAS_PANEL_MOUSEOUT: "canvas.panel.mouseout", __CANVAS_PANEL_CLICK: "canvas.panel.click", __CANVAS_PANEL_DBLCLICK: "canvas.panel.dbclick", __CANVAS_PANEL_PASTE: "canvas.panel.paste", __CANVAS_PANEL_SCROLLING: "canvas.panel.scrolling", __IFRAME_LOAD_COMPLETE: "iframe.load.complete", __IFRAME_LOADING_TIME: "iframe.loading.time", __CANVAS_SOURCE_PANEL_CLICK: "canvas.source.panel.click", __CANVAS_SOURCE_PANEL_KEYDOWN: "canvas.source.panel.mousedown", __CANVAS_SOURCE_PANEL_MOUSEDOWN: "canvas.source.panel.mousedown", __CANVAS_TEXT_PANEL_CLICK: "canvas.text.panel.click", __CANVAS_MODE_CHANGE: "canvas.mode.change", __TOOL_CLICK: "toolbar.button.click", __TOOL_SHORTCUT_KEY: "toolbar.shortcut", __ON_SUBMIT: "editor.submit", __CANVAS_WRAP_WIDTH_CHANGE: "canvas.wrap.width.change", __CANVAS_HEIGHT_CHANGE: "canvas.height.change", __CANVAS_PANEL_QUERY_STATUS: "canvas.panel.style.change", __CANVAS_PANEL_DELETE_SOMETHING: "canvas.panel.delkey.press", __ENTRYBOX_ENTRY_ADDED: "entrybox.entryadded", __ENTRYBOX_ENTRY_MODIFIED: "entrybox.entrymodified", __ENTRYBOX_ENTRY_REMOVED: "entrybox.entryremoved", __ENTRYBOX_ALL_ENTRY_REMOVED: "entrybox.removed.all.perfectly", __ENTRYBOX_CAPACITY_UPDATE: "entrybox.capacity.update", __ATTACHBOX_SHOW: "attachbox.show", __ATTACHBOX_HIDE: "attachbox.hide", __CANVAS_BEFORE_UNLOAD: "canvas.unload", __CANVAS_ENTRY_ADDED: "canvas.entry.added", __COMMAND_NODE_ADDED: "cmd.entry.added", __CMD_ALIGN_LEFT: "align.left", __CMD_ALIGN_CENTER: "align.center", __CMD_ALIGN_RIGHT: "align.right", __CMD_ALIGN_FULL: "align.full", __CMD_ALIGN_IMG_LEFT: "align.img.left", __CMD_ALIGN_IMG_CENTER: "align.img.center", __CMD_ALIGN_IMG_FLOAT_LEFT: "align.img.floatleft", __CMD_ALIGN_IMG_FLOAT_RIGHT: "align.img.floatright", __TOOL_CELL_LINE_CHANGE: "tool.cell.line.change", __CANVAS_MODE_INITIALIZE: "canvas.mode.initialize", __CANVAS_DATA_INITIALIZE: "canvas.load.data", __ENTRYBOX_ENTRY_REFRESH: "entrybox.entryrefresh", __PASTE_SEARCHRESULT: "trex.paste.info", __RUNTIME_EXCEPTION: "editor.runtime.exception", __REPORT_TO_MAGPIE: "editor.report.magpie", __SHOULD_CLOSE_MENUS: "editor.shouldclosemenus", __AUTOSAVER_LIST_OPENED: "editor.autosaver.listopened", __CANVAS_IMAGE_PLACEHOLDER_DBLCLICK: "canvas.image.placeholder.dbclick" } })(g); var k = { fire: function (x, e) { if (x && x.tagName) { var w = e[x.tagName.toLowerCase()]; if (w) { w(x, e) } else { k.propagateToParent(x, e) } } else {} }, propagateToParent: function (w, e) { var y = w.parentNode; if (y && y.tagName && y.tagName.toLowerCase) { var x = e[y.tagName.toLowerCase()]; if (x) { x(y, e) } else { k.propagateToParent(y, e) } } }, stopPropagation: function () {} }; var m = function (x, y, e, w) { return { data: x, style: { padding: y, backgroundColor: e, border: w } } }; g.__CONFIG_COMMON = { thumbs: { options: [{ color: "#FF0000" }, { color: "#FF5E00" }, { color: "#FFBB00" }, { color: "#FFE400" }, { color: "#ABF200" }, { color: "#1FDA11" }, { color: "#00D8FF" }, { color: "#0055FF" }, { color: "#0900FF" }, { color: "#6600FF" }, { color: "#FF00DD" }, { color: "#FF007F" }, { color: "#000000" }, { color: "#FFFFFF" }, { color: "#FFD8D8" }, { color: "#FAE0D4" }, { color: "#FAECC5" }, { color: "#FAF4C0" }, { color: "#E4F7BA" }, { color: "#CEFBC9" }, { color: "#D4F4FA" }, { color: "#D9E5FF" }, { color: "#DAD9FF" }, { color: "#E8D9FF" }, { color: "#FFD9FA" }, { color: "#FFD9EC" }, { color: "#F6F6F6" }, { color: "#EAEAEA" }, { color: "#FFA7A7" }, { color: "#FFC19E" }, { color: "#FFE08C" }, { color: "#FAED7D" }, { color: "#CEF279" }, { color: "#B7F0B1" }, { color: "#B2EBF4" }, { color: "#B2CCFF" }, { color: "#B5B2FF" }, { color: "#D1B2FF" }, { color: "#FFB2F5" }, { color: "#FFB2D9" }, { color: "#D5D5D5" }, { color: "#BDBDBD" }, { color: "#F15F5F" }, { color: "#F29661" }, { color: "#F2CB61" }, { color: "#E5D85C" }, { color: "#BCE55C" }, { color: "#86E57F" }, { color: "#5CD1E5" }, { color: "#6699FF" }, { color: "#6B66FF" }, { color: "#A366FF" }, { color: "#F261DF" }, { color: "#F261AA" }, { color: "#A6A6A6" }, { color: "#8C8C8C" }, { color: "#CC3D3D" }, { color: "#CC723D" }, { color: "#CCA63D" }, { color: "#C4B73B" }, { color: "#9FC93C" }, { color: "#47C83E" }, { color: "#3DB7CC" }, { color: "#4174D9" }, { color: "#4641D9" }, { color: "#7E41D9" }, { color: "#D941C5" }, { color: "#D9418D" }, { color: "#747474" }, { color: "#5D5D5D" }, { color: "#980000" }, { color: "#993800" }, { color: "#997000" }, { color: "#998A00" }, { color: "#6B9900" }, { color: "#2F9D27" }, { color: "#008299" }, { color: "#003399" }, { color: "#050099" }, { color: "#3D0099" }, { color: "#990085" }, { color: "#99004C" }, { color: "#4C4C4C" }, { color: "#353535" }, { color: "#670000" }, { color: "#662500" }, { color: "#664B00" }, { color: "#665C00" }, { color: "#476600" }, { color: "#22741C" }, { color: "#005766" }, { color: "#002266" }, { color: "#030066" }, { color: "#290066" }, { color: "#660058" }, { color: "#660033" }, { color: "#212121" }, { color: "#000000" }], transparent: { color: "transparent", border: "#999999", image: "#iconpath/ic_transparent4.gif?v=2", thumb: "#iconpath/txt_transparent.gif?v=2", thumbImage: "#iconpath/color_transparent_prev.gif?v=2" } }, textbox: { options: [m("txc-textbox1", "10px", "#ffffff", "1px solid #f7f7f7"), m("txc-textbox2", "10px", "#eeeeee", "1px solid #eeeeee"), m("txc-textbox3", "10px", "#fefeb8", "1px solid #fefeb8"), m("txc-textbox4", "10px", "#fedec7", "1px solid #fedec7"), m("txc-textbox5", "10px", "#e7fdb5", "1px solid #e7fdb5"), m("txc-textbox6", "10px", "#dbe8fb", "1px solid #dbe8fb"), m("txc-textbox7", "10px", "#ffffff", "1px dashed #cbcbcb"), m("txc-textbox8", "10px", "#eeeeee", "1px dashed #c1c1c1"), m("txc-textbox9", "10px", "#fefeb8", "1px dashed #f3c534"), m("txc-textbox10", "10px", "#fedec7", "1px dashed #fe8943"), m("txc-textbox11", "10px", "#e7fdb5", "1px dashed #9fd331"), m("txc-textbox12", "10px", "#dbe8fb", "1px dashed #79a5e4"), m("txc-textbox13", "10px", "#ffffff", "1px solid #cbcbcb"), m("txc-textbox14", "10px", "#eeeeee", "1px solid #c1c1c1"), m("txc-textbox15", "10px", "#fefeb8", "1px solid #f3c534"), m("txc-textbox16", "10px", "#fedec7", "1px solid #fe8943"), m("txc-textbox17", "10px", "#e7fdb5", "1px solid #9fd331"), m("txc-textbox18", "10px", "#dbe8fb", "1px solid #79a5e4"), m("txc-textbox19", "10px", "#ffffff", "3px double #cbcbcb"), m("txc-textbox20", "10px", "#eeeeee", "3px double #c1c1c1"), m("txc-textbox21", "10px", "#fefeb8", "3px double #f3c534"), m("txc-textbox22", "10px", "#fedec7", "3px double #fe8943"), m("txc-textbox23", "10px", "#e7fdb5", "3px double #9fd331"), m("txc-textbox24", "10px", "#dbe8fb", "3px double #79a5e4")] } }; var p = function () { var w = c; var e = []; var B = {}; var E = { cdnHost: "//s1.daumcdn.net/editor", cmnHost: "http://editor.daum.net", wrapper: "tx_trex_container", form: "tx_editor_form", txIconPath: "images/icon/editor/", txDecoPath: "images/deco/contents/", params: [], events: { preventUnload: u, useHotKey: u }, save: {}, adaptor: {}, toolbar: {}, sidebar: { attachbox: {}, embeder: {}, attacher: {}, searcher: {} }, plugin: {} }; var y = function () { return { Tool: E.toolbar, Sidebar: E.sidebar, Plugin: E.plugin, Adaptor: E.adaptor, Save: E.save, Attacher: E.sidebar.attacher, Embeder: E.sidebar.embeder, Searcher: E.sidebar.searcher } }; var D = function (H, G) { if (w) { throw new Error("configure is already setup (addParameter)") } B[H] = G }; var x = { getUrl: function (I, J) { if (I == i) { return i } I = I.replace(/#host#path\/pages\//g, EditorJSLoader.getPageBasePath()); I = I.replace(/#host/g, E.txHost); I = I.replace(/#path\/?/g, E.txPath); I = I.replace(/#cdnhost/g, E.cdnHost); I = I.replace(/#cmnhost/g, E.cmnHost); for (var G in B) { I = I.replace(new RegExp("#".concat(G), "g"), E[B[G]]) } if (J) { for (var H in J) { I = I.replace(new RegExp("#".concat(H), "g"), J[H]) } } return I }, getPopFeatures: function (G) { if (G == i) { return i } if (typeof(G) === "string") { return G } var H = []; ["toolbar", "location", "directories", "menubar"].each(function (I) { H.push(I + "=" + (G[I] || "no")) }); ["scrollbars", "resizable"].each(function (I) { H.push(I + "=" + (G[I] || "yes")) }); ["width", "height"].each(function (I) { H.push(I + "=" + (G[I] || "500")) }); ["left", "top"].each(function (I) { H.push(I + "=" + (G[I] || "100")) }); return H.join(",") }, getDecoPath: function (G) { return G.replace(/#decopath\/?/, this.getUrl(E.txDecoPath)) }, getIconPath: function (G) { return G.replace(/#iconpath\/?/, this.getUrl(E.txIconPath)) }, setup: function (G) { t.deepcopy(E, G); E.params.each(function (H) { D(H, H) }); e.each(function (H) { H(E) }); w = u; this.setupVersion(); return E }, setupVersion: function () { E.txVersion = Editor.version }, addParameter: function (H, G) { D(H, G) }, clone: function (G) { return t.deepcopy({}, G) }, merge: function () { var G = {}; $A(arguments).each(function (H) { t.deepcopy(G, H) }); return G } }; x.add = function (G, H) { if (w) { throw new Error("configure is already setup (mergeConfig)") } t.deepcopy(E, G); if (H) { e.push(H) } }; x.get = function (G) { return E[G] }; var A = function (H, G, I) { if (w) { throw new Error("configure is already setup (mergeConfig)") } this[H] = this[H] || {}; t.deepcopy(this[H], G); if (I) { e.push(I) } }; var z = function (G) { return this[G] }; var F = y(); for (var C in F) { x["add" + C] = A.bind(F[C]); x["get" + C] = z.bind(F[C]) } return x } (); h.TrexConfig = p; var j = function () { var x = {}; function e(y) { return (y.indexOf("#iconpath") > -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; y < z.length - 1; y++) { var x = z[y]; if (!w[x]) { w[x] = {} } w = w[x] } if (t.isPrimitiveType(A)) { w[e] = A } else { if (!w[e]) { w[e] = {} } t.deepcopy(w[e], A) } }; o.prototype.getConfig = function () { return this.config }; h.EditorConfigBuilder = o; g.MarkupTemplate = {}; (function () { var e = {}; g.define(g.MarkupTemplate, { add: function (w, x) { e[w] = x }, get: function (w) { if (!e[w]) { return { evaluate: function () { return "" }, evaluateToDom: function () { return "" } } } if (typeof(e[w]) == "string") { var x = e[w].replace(/@[\w\.]+/g, function (y) { return TXMSG(y) }); e[w] = new Template(x) } return e[w] }, splitList: function (F, B, z) { var y = { row: [] }; var D = z.length; var C = y.row; for (var E = 0; E < F; E++) { C.push({ col: [] }); var w = C.last().col; for (var x = 0; x < B; x++) { var A = { image: "", data: " ", klass: "" }; if (E * B + x < D) { if (typeof(z[E * B + x]) == "string") { A.data = z[E * B + x] } else { A = Object.extend(A, z[E * B + x]) } } w.push(A) } } return y } }) })(); var v = {}; (function () { var A = { "%body": ["body"], "%text": ["#text", "br"], "%element": ["#element"], "%control": ["img", "object", "hr", "table", "button", "iframe"], "%inline": ["span", "font", "u", "i", "b", "em", "strong", "big", "small", "a", "sub", "sup", "span"], "%block": ["p", "div", "ul", "ol", "h1", "h2", "h3", "h4", "h5", "h6", "pre", "dl", "hr", "table", "button"], "%paragraph": ["p", "li", "dd", "dt", "h1", "h2", "h3", "h4", "h5", "h6", "td", "th", "div", "caption"], "%wrapper": ["div", "ul", "ol", "dl", "pre", "xmp", "table", "button"], "%innergroup": ["li", "dd", "dt", "td", "th"], "%outergroup": ["ul", "ol", "dl", "tr", "tbody", "thead", "tfoot", "table"], "%tablegroup": ["td", "th", "tr", "tbody", "thead", "tfoot", "table"], "%listgroup": ["li", "ul", "ol"], "Útagroup": ["dd", "dt", "dl"], "%listhead": ["ul", "ol"] }; var w = {}; for (var x in A) { w[x] = {}; if (A[x]) { $A(A[x]).each(function (B) { w[x][B] = u }) } } function e(B) { var D = {}; var C = B.split(","); C.each(function (F) { if (w[F]) { for (var E in w[F]) { D[E] = u } } else { D[F] = u } }); return D } var z = g.Class.create({ initialize: function (B) { this.patterns = B; this.map = e(B) }, hasParts: function () { return (this.patterns.length > 0) }, 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") }, 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 < e; w++) { if (y[w] == x) { return w } } return - 1 }, hasContent: function (w, e) { if (!w || w.nodeType != 3) { return u } var x = v.removeMeaninglessSpace(w.nodeValue); if (e) { x = x.replace(g.__WORD_JOINER_REGEXP, "") } return (x != "") }, removeEmptyTextNode: function (e) { if (e && e.nodeType == 3 && !e.nodeValue) { v.remove(e) } }, hasUsefulChildren: function (w, e) { if (!w) { return c } var x = v.removeMeaninglessSpace(w.innerHTML); if (e) { x = x.replace(g.__WORD_JOINER_REGEXP, "") } if (!x) { return c } if (x.stripTags()) { return u } if (x.search(/<(img|br|hr)\s?[^>]*>/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 == "") { 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 < D.length; A++) { if (E[D[A]]) { return u } } return c } else { if (z == 3) { return this.matchesText } } } }); Object.extend(v, { tagName: function (A, z) { if (!A) { return i } return A.tagName }, kindOf: function (A, B) { if (!A || !B) { return c } var z = e(B); return z.test(A) }, kindOf_old: function (z, A) { if (!z || !A) { return c } return x(A)(z) }, ancestor: function (B, C) { if (!B || !B.parentNode) { return i } var A = e(C); var z = B.parentNode; while (z) { if (v.isBody(z)) { return i } if (A.test(z)) { break } z = z.parentNode } return z }, findAncestor: function (B, z, A) { while (!A(B)) { if (z(B)) { return B } B = B.parentNode } return i }, descendant: function (z, A) { var B = v.descendants(z, A, u); if (B.length == 0) { return i } return B[0] }, descendants: function (A, D, F) { F = F || c; if (!A || !A.firstChild) { return [] } var z = c; var B = e(D); var E = []; var C = function (I) { if (F && z) { return } if (!v.first(I)) { return } var J = v.children(I); for (var H = 0, G = J.length; H < G; H++) { if (B.test(J[H])) { E.push(J[H]); z = u } else { C(J[H]) } } }; C(A); return E }, children: function (B, C) { var D = []; if (!B || !B.firstChild) { return D } var A = e(C); var z = v.first(B); while (z) { if (A.test(z)) { D.push(z) } z = z.nextSibling } return D }, next: function (B, C) { if (!B || !B.nextSibling) { return i } var A = e(C); var z = B.nextSibling; while (z) { if (v.hasContent(z)) { if (A.test(z)) { break } } z = z.nextSibling } return z }, previous: function (B, C) { if (!B || !B.previousSibling) { return i } var A = e(C); var z = B.previousSibling; while (z) { if (v.hasContent(z)) { if (A.test(z)) { break } } z = z.previousSibling } return z }, first: function (B, C) { if (!B || !B.firstChild) { return i } var A = e(C); var z = B.firstChild; while (z) { if (v.hasContent(z)) { if (A.test(z)) { break } } z = z.nextSibling } return z }, last: function (B, C) { if (!B || !B.lastChild) { return i } var A = e(C); var z = B.lastChild; while (z) { if (v.hasContent(z)) { if (A.test(z)) { break } } z = z.previousSibling } return z }, extract: function (C, F, D) { var E = []; if (!C || !F || !D) { return E } var B = e(D); var z = c; var A = C.firstChild; while (A) { if (v.include(A, F)) { z = u } if (B.test(A)) { E.push(A) } else { if (z) { break } else { E = [] } } A = A.nextSibling } return z ? E: [] }, parent: function (z) { if (!z || !z.parentNode) { return i } return z.parentNode }, body: function (A) { if (!A || !A.parentNode) { return i } var z = A.parentNode; while (z) { if (v.isBody(z)) { return z } z = z.parentNode } return i }, top: function (A, B) { B = B || c; var z = A; while (v.first(z)) { z = v.first(z) } if (B) { return z } else { if (v.kindOf(z, "#tx_start_marker,#tx_end_marker")) { z = z.nextSibling || z.parentNode } else { if (v.kindOf(z, "%control")) { z = z.parentNode } } return z } }, bottom: function (A, B) { B = B || c; var z = A; while (v.last(z)) { z = v.last(z) } if (B) { return z } else { if (v.kindOf(z, "#tx_start_marker,#tx_end_marker")) { z = z.previousSibling || z.parentNode } else { if (v.kindOf(z, "%control")) { z = z.parentNode } } return z } }, include: function (A, B) { if (!A || !B) { return c } if (A == B) { return u } var z = B; while (z) { if (v.isBody(z)) { return c } else { if (z == A) { return u } } z = z.parentNode } return c } }) })(); Object.extend(v, { insertFirst: function (e, w) { if (!e || !w) { return } if (e.firstChild) { e.insertBefore(w, e.firstChild) } else { e.appendChild(w) } return w }, insertAt: function (e, w) { if (!e || !w) { return } w.parentNode.insertBefore(e, w); return e }, insertNext: function (w, x) { if (!w || !x) { return } var e = x.nextSibling; if (e) { e.parentNode.insertBefore(w, e) } else { x.parentNode.appendChild(w) } return w }, append: function (e, w) { if (!e || !w) { return } e.appendChild(w); return w }, remove: function (e) { if (!e) { return } if (e.parentNode) { e.parentNode.removeChild(e) } e = i }, html: function (w, e) { if (!w) { return } w.innerHTML = e || ""; return w }, clean: function (e) { return v.html(e) }, stuff: function (x, w) { if (!x) { return x } if (v.hasUsefulChildren(x, u)) { return x } if (x.lastChild) { var e = x; while (e.lastChild) { e = e.lastChild } v.insertNext(w, e) } else { v.append(x, w) } return x } }); Object.extend(v, { removeListIfEmpty: function (e) { while (v.kindOf(e, "%listhead") && e.childNodes.length == 1 && v.kindOf(e.firstChild, "%listhead")) { e = e.firstChild } while (v.kindOf(e, "%listhead") && e.childNodes.length == 0) { var w = e.parentNode; v.remove(e); e = w } } }); Object.extend(v, { moveChild: function (e, x, w, z) { if (!e || !x) { return } w = Math.min(Math.max(w || 0), e.childNodes.length); z = Math.min(Math.max(z || e.childNodes.length), e.childNodes.length); if (w >= 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 < w; x++) { v.insertFirst(e, y.lastChild) } v.insertNext(e, y); return e }, splitAt: function (w, e) { if (!v.isElement(w)) { return } var x = v.clone(w); v.moveChild(w, x, e + 1, w.childNodes.length); v.insertNext(x, w); return x }, divideTree: function (e, y) { var w = y, z, x; do { x = w.parentNode; z = v.indexOf(w); w = v.divideNode(x, z) } while (w.previousSibling != e); return w }, divideParagraph: function (y) { var w = y; var e = v.indexOf(y); var x = w; while (w) { if (v.isBody(w)) { break } else { if (v.kindOf(w, "td,th,%wrapper,%outergroup")) { break } else { if (v.kindOf(w, "#tx_start_marker,#tx_end_marker")) { e = v.indexOf(w) } else { if (v.isControl(w)) { e = v.indexOf(w) } else { if (v.isText(w)) { w = v.divideText(w, e); e = v.indexOf(w) } else { w = v.divideNode(w, e); e = v.indexOf(w); x = w; if (v.kindOf(w, "p,li,dd,dt,h1,h2,h3,h4,h5,h6")) { break } } } } } } w = w.parentNode } return x }, wrapInlinesWithP: function (z, y) { var e = v.getOwnerDocument(z); var x = v.extract(y || e.body, z, "%text,%inline,%control"); if (this.hasOnlySavedCaret(x, z)) { return i } var w = e.createElement("p"); v.wrap(w, x); return w }, hasOnlySavedCaret: function (e, x) { var w = e.findAll(function (y) { return y.nodeType != 3 || y.nodeValue.trim() != "" }); return this.isGoogRangeCaret(x) && w.length == 1 && w[0] == x }, isGoogRangeCaret: function (e) { return e && /goog_[0-9]+/.test(e.id) } }); Object.extend(v, { paragraphOf: function (e) { if (!e) { return "p" } var w = v.translate(e); if (w.memberOf("ul,ol")) { return "li" } else { if (w.memberOf("dl")) { return "dd" } else { if (w.memberOf("tr,tbody,thead,tfoot,table")) { return "td" } else { return "p" } } } }, inlineOf: function () { return "span" }, outerOf: function (e) { if (!e) { return "span" } var w = v.translate(e); if (w.memberOf("li")) { return "ol" } else { if (w.memberOf("dd,dt")) { return "dl" } else { if (w.memberOf("td,th,tr")) { return "table" } else { return "p" } } } } }); (function () { var w = 0; var y = g.Class.create({ $const: { __FONT_SIZE_BASIS: 9, __REG_EXT_NUMBER: new RegExp("[0-9.]+"), __REG_EXT_UNIT: new RegExp("px|pt|em") }, initialize: function () { this.unitConverter = { px2em: 1 / 12, px2pt: 9 / 12, em2px: 12, em2pt: 9, pt2px: 12 / 9, pt2em: 1 / 9 } }, calculate: function (D, B) { if (D == i || D.length == 0) { D = "0em" } if (B == i || B.length == 0) { B = "0em" } var G = this.extractSign(B); var E = this.extractUnit(D); var C = this.extractUnit(B); var A = this.extractNumber(D).toNumber(); var z = this.extractNumber(B).toNumber(); if (E != C) { if (this.unitConverter[E + "2" + C]) { A *= this.unitConverter[E + "2" + C] } } var F = 0; if (G == "-") { F = Math.max(A - z, 0) } else { F = (A + z) } F = (Math.round(F * 10) / 10); if (F == 0) { return i } else { return F + C } }, needCalculation: function (z) { if (z == i || typeof z != "string") { return c } else { return (z.charAt(0) == "+" || z.charAt(0) == "-") } }, extractSign: function (z) { var A = "+"; if (z.charAt(0) == "+" || z.charAt(0) == "-") { A = z.charAt(0) } return A }, extractNumber: function (B) { var z = 0; var A; if ((A = B.match(y.__REG_EXT_NUMBER)) != i) { z = A[0] } if (B.indexOf("%") > -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) }, getScrollTop: function (e) { if (!e) { return 0 } return (e.documentElement.scrollTop || e.body.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_PARAGRAPH_HTML: (t.msie_nonstd ? "

 

": "


") }); 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 < A.length; z++) { y = A[z]; if (t.hasClassName(B, y)) { x = y; break } } return x }, getAllAttributesFromEmbed: function (y) { var B = {}; y = y.replace(//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 < F; E++) { y.push(""); for (var x = 0; x < B; x++) { if (E * B + x < D) { A = z[E * B + x]; if (A.image) { var C = p.getIconPath(A.image); y.push('') } 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.currentpage < this.totalpage) ? this.currentpage + 1 : 0 }, getPrevPage: function () { return (this.currentpage > 1) ? this.currentpage - 1 : 0 }, getNextBlock: function () { var x = Math.ceil(this.currentpage / this.blocksize); return (x < this.totalblock) ? x * this.blocksize + 1 : 0 }, getPrevBlock: function () { var x = Math.ceil(this.currentpage / this.blocksize); return (x > 1) ? (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; z < y; z++) { x.push(this.data[z]) } return x }, getTotalRow: function () { return this.data.length } }); e.Slidebar = e.Class.create({ initialize: function (x) { this.elContext = x.el; this.knobWidth = x.knobWidth; this.isDisabled = c; this.handler = function (z) { if (!this.isDisabled && typeof x.handler == "function") { x.handler(z) } }; this.logicObj = { interval: x.interval || 5, min: x.min || 0, max: x.max || 100 }; this.physicObj = { min: 0, width: x.barSize || 100 }; this.physicObj.max = this.physicObj.width - this.knobWidth; this.physicObj.interval = this.logicObj.interval * this.physicObj.max / this.logicObj.max; this.startPos = 0; this.startX = 0; this.isDrag = c; this.result = 0; var y = v.collect(this.elContext, "dd.tx-slide"); v.collect(y, "span.tx-slide-min").innerHTML = ""; v.collect(y, "span.tx-slide-max").innerHTML = ""; this.bindEvent(); this.setKnobPosition(x.defaultValue || x.min || 0) }, regenerate: function (x) { x = parseInt(x * this.physicObj.width / this.logicObj.max); this.setKnobPosition(x) }, bindEvent: function () { var z = v.collect(this.elContext, "dd.tx-slide"); var y = v.collect(z, "a.tx-slide-prev"); var x = v.collect(z, "a.tx-slide-next"); var B = v.collect(z, "div.tx-slide-bar"); var A = this.elKnob = v.collect(z, "div.tx-slide-knob"); t.observe(A, "mousedown", function (C) { this.isDrag = u; this.startPos = this.getKnobPosition(); this.startX = C.clientX; t.stop(C) }.bind(this)); t.observe(A, "mouseup", function () { this.isDrag = c }.bind(this)); t.observe(this.elContext, "mousemove", function (C) { if (this.isDrag) { this.setKnobPosition(this.startPos + C.clientX - this.startX); t.stop(C); this.handler(this.result) } }.bind(this)); t.observe(y, "click", function (E) { var D = Math.round(this.physicObj.interval) - 1; 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(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 = (x < this.physicObj.max) ? x: this.physicObj.max; x = (x > this.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; A < y.MAX_SIZE.ROW; A++) { var D = tx.tr(); for (var x = 0; x < y.MAX_SIZE.COL; x++) { var E = tx.td(tx.div({ style: y.DEFAULT_TD_STYLE })); E = this.setCoordToAttr(E, x + 1, A + 1); D.appendChild(E) } z.appendChild(D) } var C = tx.table(y.DEFAULT_TABLE_PROPERTY); t.addClassName(C, B || ""); C.appendChild(z); return C }, moveSelectionPos: function (A, y) { var z = (y * this.cellSize.width).toPx(); var x = (A * this.cellSize.height).toPx(); t.setStyle(this.elSelection, { width: z, height: x }) }, setCoordToAttr: function (y, x, z) { y.setAttribute("col", x); y.setAttribute("row", z); return y }, getCoordFromAttr: function (x) { return { col: x.getAttribute("col") || 0, row: x.getAttribute("row") || 0 } }, eventBinding: function () { this.mouseOverHandler = this.config.mouseOverHandler; this.mouseClickHandler = this.config.mouseClickHandler; var x = this; var z = function (C) { var B = t.element(C) || {}; var A = (B.tagName || "").toUpperCase(); if (B && A == "TD") { var D = x.getCoordFromAttr(B); x.mouseOverHandler(D.row, D.col) } t.stop(C) }; var y = function (A) { x.mouseClickHandler(A) }; t.observe(this.elTable, "mouseover", z); t.observe(this.elTable, "click", y) } }); e.ImageScale = e.Class.create({ initialize: function (z, y) { if (!z.imageurl) { return } if (z.actualwidth) { return } var x = function (B, A) { z.actualwidth = B; z.actualheight = A; if (y) { y(B, A) } }; setTimeout(function () { var A = new Image(); A.onerror = function () { A = i }; if (A.onreadystatechange) { A.onreadystatechange = function () { if (this.readyState == "complete") { x(this.width, this.height); A = i } } } else { A.onload = function () { x(this.width, this.height); A = i } } A.src = z.imageurl }, 10) } }); function w(x) { var y = p.getIconPath(x); return y + "" } })(g); g.ImageResizer = g.Class.create({ initialize: function (C, x) { var z = C; var B = x.maxWidth || 200; var A = x.maxHeight || 200; var y = x.defImgUrl; var e = x.onComplete || function () {}; function w(I, F) { var G, E; var H = I.width; var D = I.height; if (H == B && D == A) { E = B; G = A } else { if (H < B && D < A) { E = H; G = D } else { G = A; E = Math.floor(A * (H / D)); if (E > B) { 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 (1 < w.colSpan && w.style.width) { e = parseInt(w.style.width, 10); v.setStyles(w, { width: Math.floor(e / w.colSpan) + "px" }, u) } }, splitHeightByRowSpan: function (w) { var e; if (1 < w.rowSpan && w.style.height) { e = parseInt(w.style.height, 10); v.setStyles(w, { height: Math.floor(e / w.rowSpan) + "px" }, u) } }, collapseCaret: function (x, w) { var e; try { e = x.getProcessor().createGoogRangeFromNodes(w, 0, w, 0); e.select() } catch(y) {} }, getClosestByTagNames: function (e, x) { var w; if (x && typeof x.tagName === "string") { w = x.tagName.toLowerCase(); if (w !== "body") { if (e.contains(w)) { return x } else { return arguments.callee(e, x.parentNode) } } } return i }, getTableIndexerFromTd: function (w) { var e; e = g.TableUtil.getClosestByTagNames(["table"], w); return new g.TableUtil.Indexer(e) } }; g.TableUtil.Boundary = g.Class.create({ initialize: function (e) { this.top = -1; this.left = -1; this.bottom = -1; this.right = -1; if (e) { this.set(e) } }, getTop: function () { return this.top }, getLeft: function () { return this.left }, getBottom: function () { return this.bottom }, getRight: function () { return this.right }, setTop: function (e) { this.top = e }, setLeft: function (e) { this.left = e }, setBottom: function (e) { this.bottom = e }, setRight: function (e) { this.right = e }, set: function (e) { if ("top" in e) { this.setTop(e.top) } if ("left" in e) { this.setLeft(e.left) } if ("bottom" in e) { this.setBottom(e.bottom) } if ("right" in e) { this.setRight(e.right) } }, isValid: function () { if (this.top === -1) { return c } if (this.left === -1) { return c } if (this.bottom === -1) { return c } if (this.right === -1) { return c } return u }, addBoundary: function (y, w) { var x, e; x = this.addStartBoundary(y, w); e = this.addEndBoundary(y, w); return x || e }, merge: function (x) { var w, e; w = this.addStartBoundary(x.top, x.left); e = this.addEndBoundary(x.bottom, x.right); return w || e }, addStartBoundary: function (x, e) { var w; w = c; if (this.top === -1 || x < this.top) { this.top = x; w = u } if (this.left === -1 || e < this.left) { this.left = e; w = u } return w }, addEndBoundary: function (x, e) { var w; w = c; if (this.bottom === -1 || this.bottom < x) { this.bottom = x; w = u } if (this.right === -1 || this.right < e) { this.right = e; w = u } return w } }); g.TableUtil.Indexer = g.Class.create({ initialize: function (e) { this.indexData = i; this.table = i; this.resetIndex(); this.setTable(e); this.makeIndex() }, getRowSize: function () { return this.indexData.length }, getColSize: function () { if (0 < this.indexData.length) { return this.indexData[0].length } return 0 }, getTd: function (w, e) { if (this.indexData[w]) { if (this.indexData[w][e]) { return this.indexData[w][e] } } return i }, getTdArr: function (z) { var e, y, x, w; e = []; y = z.top; while (y <= z.bottom) { x = this.indexData[y]; w = z.left; while (w <= z.right) { if (e.contains(x[w]) === c) { e.push(x[w]) } w += 1 } y += 1 } return e }, getTdArrHasTop: function (x) { var w, A, z, e, y; w = []; e = this.getColSize(); for (y = 0; y < e; y += 1) { A = this.getTd(x, y); z = this.getTd(x - 1, y); this.uniquePushWhenDifferent(w, A, z) } return w }, getTdArrHasBottom: function (x) { var w, A, z, e, y; w = []; e = this.getColSize(); for (y = 0; y < e; y += 1) { A = this.getTd(x, y); z = this.getTd(x + 1, y); this.uniquePushWhenDifferent(w, A, z) } return w }, getTdArrHasLeft: function (x) { var w, A, z, e, y; w = []; e = this.getRowSize(); for (y = 0; y < e; y += 1) { A = this.getTd(y, x); z = this.getTd(y, x - 1); this.uniquePushWhenDifferent(w, A, z) } return w }, getTdArrHasRight: function (x) { var w, A, z, e, y; w = []; e = this.getRowSize(); for (y = 0; y < e; y += 1) { A = this.getTd(y, x); z = this.getTd(y, x + 1); this.uniquePushWhenDifferent(w, A, z) } return w }, getBoundary: function (C) { var e, A, z, B, x, y, w; e = new g.TableUtil.Boundary(); A = this.indexData; z = A.length; for (B = 0; B < z; B += 1) { x = A[B]; if (x) { y = x.length; for (w = 0; w < y; w += 1) { if (x[w] === C) { e.addBoundary(B, w) } } } } return e }, reload: function () { this.resetIndex(); this.makeIndex() }, uniquePushWhenDifferent: function (e, x, w) { if (x !== w) { if (e.contains(x) === c) { e.push(x) } } }, resetIndex: function () { this.indexData = [] }, setTable: function (e) { this.table = e }, makeIndex: function () { var A, z, C, B, x, y, w, e; A = this.table.rows; z = A.length; for (C = 0; C < z; C += 1) { B = A[C]; x = B.cells; y = x.length; for (w = 0; w < y; w += 1) { e = x[w]; this.addCellIndex(C, e) } } }, addCellIndex: function (C, e) { var B, A, y, w, x, z; B = this.getNextCellIndex(this.indexData[C]); y = e.rowSpan; for (A = 0; A < y; A += 1) { w = C + A; if (!this.indexData[w]) { this.indexData[w] = [] } z = e.colSpan; for (x = 0; x < z; x += 1) { this.indexData[w][B + x] = e } } }, getNextCellIndex: function (w) { var x, e; if (!w) { return 0 } e = w.length; for (x = 0; x < e; x += 1) { if (!w[x]) { break } } return x } }); g.I.XHRequester = g.Faculty.create({ createXMLHttp: function () { var x = i; try { if (h.XMLHttpRequest) { x = new XMLHttpRequest() } else { if (h.ActiveXObject) { x = new ActiveXObject("Msxml2.XMLHTTP"); if (!x) { x = new ActiveXObject("Microsoft.XMLHTTP") } } } return x } catch(w) { return i } }, sendRequest: function (w, x, y, z, D, E) { if (x == i && x != "") { return i } var B = i; var A = this.createXMLHttp(); if (A == i) { return i } var F = function () { if (A.status == 200) { if (w.toUpperCase() == "HEAD") { B = D(A.getAllResponseHeaders()) } else { B = D(A.responseText) } } else { B = E(A.status) } A = i }; try { if (z) { A.onreadystatechange = function () { if (A.readyState == 4) { F() } } } if (w.toUpperCase() == "POST") { A.open("POST", x, z); A.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=utf-8"); A.setRequestHeader("X-Requested-With", "XMLHttpRequest"); A.setRequestHeader("Content-Length", y.length); A.setRequestHeader("Connetion", "close"); A.send(y) } else { if (y && y.length > 0) { 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(x); 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) { console.log(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) }) }, fireJobs: function (y) { var w = this; var x = $A(arguments).slice(1); if (!this.jobObservers[y]) { return } try { this.jobObservers[y].each(function (e) { e.apply(w, x) }) } catch(z) { if (z != $stop) { throw z } } } }); g.I.KeyObservable = g.Faculty.create({ keyObservers: {}, observeKey: function (x, w) { var e = function (y) { return (y.ctrlKey ? "T": "F") + (y.altKey ? "T": "F") + (y.shiftKey ? "T": "F") + "_" + y.keyCode } (x); if (!this.keyObservers[e]) { this.keyObservers[e] = [] } this.keyObservers[e].push(w) }, fireKeys: function (y) { var x = function (A) { return (A.ctrlKey ? "T": "F") + (A.altKey ? "T": "F") + (A.shiftKey ? "T": "F") + "_" + A.keyCode } (y); if (!this.keyObservers[x]) { return } var w = this; var z = c; var e = function () { if (!z) { t.stop(y); z = u } }; this.keyObservers[x].each(function (A) { try { A.apply(w, [y]); e() } catch(B) { if (B === $stop) { e() } else { if (B !== $propagate) {} } } }) }, registerKeyEvent: function (w) { try { t.observe(w, "keydown", this.fireKeys.bind(this), u) } catch(x) {} } }); g.I.ElementObservable = g.Faculty.create({ elementObservers: {}, observeElement: function (x, e) { if (x == i) { this.observeElement({ tag: "*tx-final-body*" }, e) } else { if (x.length) { for (var w = 0; w < x.length; w++) { var y = x[w]; this.observeElement(y, e) } } else { if (!this.elementObservers[x.tag]) { this.elementObservers[x.tag] = {} } if (!x.klass) { x.klass = "*tx-all-class*" } if (!this.elementObservers[x.tag][x.klass]) { this.elementObservers[x.tag][x.klass] = [] } this.elementObservers[x.tag][x.klass].push(e) } } }, fireElements: function (z) { if (!z) { return } var y = z; var x = $A(arguments).slice(1); var w = this; try { var B; if (v.kindOf(y, "img,hr,table,button,iframe")) { B = this.collectObserverByElement(y.nodeName.toLowerCase(), y.className); if (B) { B.each(function (e) { e.apply(w, [y].concat(x)) }) } } else { while (y) { B = this.collectObserverByElement(y.nodeName.toLowerCase(), y.className); if (B) { B.each(function (e) { e.apply(w, [y].concat(x)) }) } if (v.isBody(y)) { break } y = v.parent(y) } } } catch(A) { if (A != $stop) { throw A } } this.fireFinally() }, fireFinally: function () { var e = this; var w = $A(arguments).slice(1); var x = this.collectObserverByElement("*tx-final-body*"); if (x) { x.each(function (y) { y.apply(e, [i].concat(w)) }) } }, collectObserverByElement: function (w, e) { if (!this.elementObservers[w]) { return i } var z = []; e = e || ""; if (e != "") { var x = e.split(" "); for (var y in this.elementObservers[w]) { if (x.contains(y)) { z.push(this.elementObservers[w][y]) } } } if (this.elementObservers[w]["*tx-all-class*"]) { z.push(this.elementObservers[w]["*tx-all-class*"]) } return z.flatten() } }); g.I.MouseoverObservable = g.Faculty.create({ mouseoverObservers: {}, observeMouseover: function (e, w, x) { if (!this.mouseoverObservers[e]) { this.mouseoverObservers[e] = { success: [], fail: [], flag: c } } this.mouseoverObservers[e]["success"].push(w); if (x) { this.mouseoverObservers[e]["fail"].push(x) } }, fireMouseover: function (z) { if (!z) { return } var y = z; var w = this; try { for (var x in this.mouseoverObservers) { this.mouseoverObservers[x].flag = c } while (y) { var C = this.collectMouseoverObserver(y); if (C.length > 0) { 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; A < e; A++) { var z = w + "." + y[A]; if (this.mouseoverObservers[z]) { C.push(this.mouseoverObservers[z]["success"]); this.mouseoverObservers[z]["flag"] = u } } } return C.flatten() } }); g.I.Runnable = g.Faculty.create({ isRunning: c, repeater: i, threads: [], startThread: function (e) { if (this.repeater) { this.repeater.clear() } else { this.repeater = new g.Repeater(this.runThread.bind(this)) } this.repeater.start(e) }, stopThread: function () { this.repeater.clear() }, runThread: function () { if (this.isRunning) { return } if (this.threads.length > 0) { 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; y < e; y++) { var x = A[y]; var z = w[y]; t.observe(x, "click", this.onSelect.bindAsEventListener(this, z.color + (z.text ? "|" + z.text: ""))) } }, _generatePicker: function () { var w = this.elPicker; var x = v.collect(w, "div.tx-pallete-pickerbox"); t.observe(x, "mouseout", this.onMouseOut.bind(this)); var y = this.elChromaBar = v.collect(x, "div.tx-chromabar"); v.replacePngPath(y); t.observe(y, "mousedown", this.onChromDown.bindAsEventListener(this)); t.observe(y, "mousemove", this.onChromMove.bindAsEventListener(this)); t.observe(y, "mouseup", this.onChromUp.bindAsEventListener(this)); this.elHueBar = v.collect(x, "div.tx-huebar"); var e = this.elHueBar; this.hueDownHandler = this.onHueDown.bindAsEventListener(this); this.hueMoveHandler = this.onHueMove.bindAsEventListener(this); this.hueUpHandler = this.onHueUp.bindAsEventListener(this); this.hueClickHandler = this.onHueClick.bindAsEventListener(this); t.observe(e, "mousedown", this.hueDownHandler); t.observe(e, "click", this.hueClickHandler); this.nColWidth = 150; this.nColHeight = 120; this.nHueHeight = 120; this.mRGB = { r: 0, g: 0, b: 0 }; this.mHSV = { h: 0, s: 100, v: 100 }; this.setHueColor("FF0000") }, reinitGrade: function () { var w = t.cumulativeOffset(this.elMenu); var e = t.positionedOffset(this.elChromaBar); this.iChromPos = { x: (w[0] + e[0]), y: (w[1] + e[1]) }; e = t.positionedOffset(this.elHueBar); this.iHuePos = { x: (w[0] + e[0]), y: (w[1] + e[1]) } }, onColorEnter: function (w) { var e; if (this.elInput.value == TXMSG("@adoptor.transparent")) { e = "transparent" } else { e = g.Color.getValidColor(this.elInput.value) } if (e !== i) { this.onSelect(w, e) } this.hide() }, previewColor: function (e) { this.changeColor(e) }, onMouseOut: function () { if (this.lastValue !== i && this.lastValue !== q && this.mousedownDetected) { this.changeColor(this.lastValue) } }, changeColor: function (e) { e = g.Color.getHexColor(e); this.elPreview.style.backgroundColor = e; if (e == "transparent") { this.elInput.value = TXMSG("@adoptor.transparent") } else { this.elInput.value = e } }, enterColor: function () { if (this.elInput.value == TXMSG("@adoptor.transparent")) { this.changeColor("transparent") } else { if (this.elInput.value.length == 7) { var e = g.Color.getValidColor(this.elInput.value); if (e !== i) { this.changeColor(e) } } } }, togglePicker: function (x) { var e = this.elMore; var w = this.elPicker; if (this.isPickerDisplayed) { e.className = "tx-more-down"; t.hide(w) } else { e.className = "tx-more-up"; t.show(w); if (t.msie6) { w.style.padding = "1px"; setTimeout(function () { w.style.padding = "0px" }, 0) } if (!this.isGradeInit) { this._generatePicker(); this.isGradeInit = u; this.reinitGrade() } } this.isPickerDisplayed = !this.isPickerDisplayed; t.stop(x) }, getChromCoords: function (w) { var x = (w.clientX - this.iChromPos.x) + n.scrollLeft; var e = (w.clientY - this.iChromPos.y) + n.scrollTop; x = Math.min(this.nColWidth, Math.max(0, x)); e = Math.min(this.nColHeight, Math.max(0, e)); return { x: x, y: e } }, getHueCoords: function (e) { var w = e.offsetY || e.layerY; return Math.min(this.nHueHeight, Math.max(0, w)) }, getColorByEvent: function (e, B) { var z = (e / (this.nColWidth)) * 100; var w = (1 - B / (this.nColHeight)) * 100; var A = 3; z = Math.floor(Math.min(Math.max(z, 0), 100)); if (z < A) { z = 0 } else { if (z > 100 - A) { z = 100 } } w = Math.floor(Math.min(Math.max(w, 0), 100)); if (w < A) { w = 0 } else { if (w > 100 - 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 < z.length; y++) { var x = z[y].replace(/^\s+/, ""); if (x.indexOf(e + "=") == 0) { return x.substring(e.length + 1) } } return i } () || ""; this.maxCnt = w || 3 }, writeCookie: function (w, z) { var e = this.cookieName, y; if (z) { var x = new Date(); x.setTime(new Date().getTime() + z * 24 * 60 * 60 * 1000); y = "; expires=" + x.toGMTString() } else { y = "" } if (w === i) { w = "" } b.cookie = e + "=" + w + y + "; path=/"; this.cookieValue = w }, readCookie: function () { if (this.cookieValue === i + "") { return i } return this.cookieValue }, eraseCookie: function () { var e = this.cookieName; this.writeCookie(e, "", -1) }, extractOptions: function (e, x) { var y = e.toMap("data"); var w = []; x.split("|").compact().each(function (z) { if (y[z]) { w.push(y[z]) } }.bind(this)); return w }, mergeValues: function (x, w) { var e = x.split("|").compact(); if (e.contains(w)) { return x } if (e.length >= 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 < e.length; x++) { var w = e[x]; var z = g.Button.__borderClasses[w]; if (z) { return w } } } }, hasState: i, isDisabled: i, lastValue: i, lastText: i, elButton: i, elIcon: i, borderClass: i, _command: function () {}, setCommand: function (e) { this._command = e }, initialize: function (e) { var z = this.config = e; if (z.borderClass) { g.Button.addBorderClass(z.borderClass) } this.itsNew = !!z.itsnew; this.hasState = !!z.status; this.isDisabled = c; this.lastValue = z.selectedValue || i; if (e.el) { this.elButton = e.el } else { var w = z.id || "tx_" + z.identity; this.elButton = $must(w + (z.initializedId || "")) } var y = this.elButton; var x = this.elIcon = v.collect(y, "a"); if (!x) { throw new Error("[Exception]Trex.Button : can't find elIcon for button '" + w + "'") } this.borderClass = g.Button.getBorderClass(y); if (this.oninitialized) { this.oninitialized.bind(this)(z) } this.generate(); if (this.itsNew) { v.append(x, g.MarkupTemplate.get("button.itsnew").evaluateAsDom({})) } if (z.selectedValue && this.setValue) { this.setValue(z.selectedValue) } if (z.selectedText && this.setText) { this.setText(z.selectedText) } if (z.selectedState && this.setState) { this.setState(z.selectedState) } }, generate: function () { var e = this.elIcon; this.hdlMouseDown = this.onMouseDown.bindAsEventListener(this); this.hdlMouseOver = this.onMouseOver.bindAsEventListener(this); this.hdlMouseOut = this.onMouseOut.bindAsEventListener(this); this.hdlKeydown = this.onKeyDown.bindAsEventListener(this); this.hdlClick = this.onClick.bindAsEventListener(this); t.observe(e, "mousedown", this.hdlMouseDown); t.observe(e, "mouseover", this.hdlMouseOver); t.observe(e, "mouseout", this.hdlMouseOut); t.observe(e, "keydown", this.hdlKeydown); t.observe(e, "click", this.hdlClick); if (this.ongenerated) { this.ongenerated.bind(this)(this.config) } }, removeHandler: function () { if (!this.hdlMouseDown) { return } var e = this.elIcon; t.stopObserving(e, "mousedown", this.hdlMouseDown); t.stopObserving(e, "mouseover", this.hdlMouseOver); t.stopObserving(e, "mouseout", this.hdlMouseOut); t.stopObserving(e, "keydown", this.hdlKeydown); t.stopObserving(e, "click", this.hdlClick) }, getCurrentBorderClass: function (y) { var e = t.classNames(y); for (var x = 0; x < e.length; x++) { var w = e[x]; if (w.indexOf(this.borderClass) != -1) { return w } } return q + "" }, normalState: function () { var e = this.getCurrentBorderClass(this.elButton); if (e == this.borderClass) { return } t.removeClassName(this.elButton, e); t.addClassName(this.elButton, this.borderClass) }, hoveredState: function () { var e = this.getCurrentBorderClass(this.elButton); t.removeClassName(this.elButton, e); t.addClassName(this.elButton, this.borderClass + "-hovered"); this.decreaseZindex() }, pushedState: function () { var e = this.getCurrentBorderClass(this.elButton); t.removeClassName(this.elButton, e); t.addClassName(this.elButton, this.borderClass + "-pushed") }, currentState: function () { var w = this.getCurrentBorderClass(this.elButton); var e = "normal"; if (w.indexOf("-pushed") != -1) { e = "pushed" } else { if (w.indexOf("-hovered") != -1) { e = "hovered" } } return e }, isPushed: function () { return ("pushed" == this.currentState()) }, hasMenu: function () { return this.tool ? !!(this.tool.menu) : c }, onMouseDown: function (e) { if (e) { t.stop(e) } if (this.isDisabled) { return } if (this.hasMenu() || this.hasState) { if (this._command(e) === c) { return } } else { this.evsessionstarted = u } if (this.isPushed()) { this.normalState() } else { this.pushedState() } }, onMouseOver: function () { if (this.isDisabled || this.isPushed()) { return } this.hoveredState() }, onMouseOut: function () { if (this.evsessionstarted) { this.normalState(); this.evsessionstarted = c } if (this.isDisabled || this.isPushed()) { return } this.normalState() }, onClick: function (e) { if (e) { t.stop(e) } if (this.isDisabled) { return } if (!this.hasState) { this._command(); this.normalState(); this.evsessionstarted = c } }, onKeyDown: function (e) { if (e.keyCode === 13) { this.onMouseDown(e); this.onClick(e) } }, updateAfterCommand: function (e, w) { this.setValueAndText(e, w); this.normalState() }, setValueAndText: function (e, w) { this.setValue(e); this.setText(w) }, setValue: function (e) { if (e) { this.lastValue = e } }, setText: function (e) { this.lastText = e }, getValue: function () { return this.lastValue }, getText: function () { return this.lastText }, setState: function (e) { if (e) { this.pushedState() } else { this.normalState() } }, setClassName: function (e) { this.elIcon.className = e }, disable: function () { if (this.elButton) { this.isDisabled = u; t.addClassName(this.elButton, "tx-disable") } }, enable: function () { if (this.elButton) { this.isDisabled = c; t.removeClassName(this.elButton, "tx-disable") } }, release: function () { if (this.isDisabled) { return } if (this.hasMenu() || !this.hasState) { this.normalState() } }, increaseZindex: function () { var e = 10; if (v.parent(this.elButton)) { t.setStyle(v.parent(this.elButton), { zIndex: e }) } }, decreaseZindex: function () { var e = 4; if (v.parent(this.elButton)) { t.setStyle(v.parent(this.elButton), { zIndex: e }) } } }); g.Button.Select = g.Class.create({ $extend: g.Button, ongenerated: function () { g.MarkupTemplate.get("button.select.text").evaluateToDom({ data: v.getText(this.elIcon) }, this.elIcon); this.elText = v.collect(this.elIcon, "span"); var e = v.collect(this.elButton, "a.tx-arrow"); if (e) { t.observe(e, "mousedown", this.onMouseDown.bindAsEventListener(this)); t.observe(e, "mouseover", this.onArrowMouseOver.bindAsEventListener(this)); t.observe(e, "mouseout", this.onArrowMouseOut.bindAsEventListener(this)); t.observe(e, "click", this.onClick.bindAsEventListener(this)) } }, setText: function (e) { this.elText.innerText = e }, onArrowMouseOver: function () { if (this.isDisabled || this.isPushed()) { return } this.hoveredState() }, onArrowMouseOut: function () { if (this.isDisabled || this.isPushed()) { return } this.normalState() } }); g.Button.Splits = g.Class.create({ $extend: g.Button, ongenerated: function () { var w = this.elButton; var e = this.elArrow = v.collect(w, "a.tx-arrow"); if (!e) { throw new Error("[Exception]Trex.Button.Splits : not exist element(a.tx-arrow)") } t.observe(e, "mousedown", this.onArrowMouseDown.bindAsEventListener(this)); t.observe(e, "mouseover", this.onArrowMouseOver.bindAsEventListener(this)); t.observe(e, "mouseout", this.onArrowMouseOut.bindAsEventListener(this)); t.observe(e, "click", this.onArrowClick.bindAsEventListener(this)) }, arrowHoveredState: function () { var e = this.getCurrentBorderClass(this.elButton); t.removeClassName(this.elButton, e); t.addClassName(this.elButton, this.borderClass + "-arrow-hovered") }, arrowPushedState: function () { var e = this.getCurrentBorderClass(this.elButton); t.removeClassName(this.elButton, e); t.addClassName(this.elButton, this.borderClass + "-arrow-pushed") }, onMouseDown: function () { if (this.isDisabled) { return } if (this.isPushed()) { this._command(); this.normalState(); this.commandexecuted = u } else { this.pushedState(); this.commandexecuted = c; this.evsessionstarted = u } }, onClick: function (e) { if (e) { t.stop(e) } if (this.isDisabled) { return } if (!this.commandexecuted) { this.tool.execute(this.lastValue, this.lastText); this.evsessionstarted = c } else { this.commandexecuted = c } this.normalState() }, onArrowMouseDown: function () { if (this.isDisabled) { return } if (this._command() === c) { return } if (this.isPushed()) { this.normalState() } else { this.arrowPushedState() } }, onArrowClick: function (e) { if (e) { t.stop(e) } if (this.isDisabled) { return } }, onArrowMouseOver: function () { if (this.isDisabled || this.isPushed()) { return } this.arrowHoveredState() }, onArrowMouseOut: function () { if (this.isDisabled || this.isPushed()) { return } if (this.commandexecuted) { this.commandexecuted = c } this.normalState() } }); g.Button.Toggle = g.Class.create({ $extend: g.Button, setValue: function (e) { if (e) { this.pushedState() } else { this.normalState() } } }); g.Button.Widget = g.Class.create({ $extend: g.Button.Select, setText: function (e) { this.elIcon.innerText = e; if (this.lastText) { t.removeClassName(this.elIcon, this.lastText) } t.addClassName(this.elIcon, e); this.lastText = e }, setMenu: function (x, e) { this.hasState = u; var w = this; x.setCommand(function () { var y = e.apply(this, arguments); w.updateAfterCommand.apply(w, arguments); return y }); w.setCommand(function () { if (!w.isPushed()) { var y = w.getValue(); x.show(y) } else { x.hide() } return u }) } }); g.Button.ColorWidget = g.Class.create({ $extend: g.Button.Widget, setValue: function (e) { t.setStyle(this.elIcon.parentNode, { backgroundColor: e }); this.lastValue = e }, setText: function () {} }); j.addMsg({ "@menu.pallete.enter": "\uc785\ub825", "@menu.pallete.more": "\ub354\ubcf4\uae30" }); g.Menu = g.Class.create({ isInit: c, isDisplayed: c, _command: function () {}, setCommand: function (e) { this._command = e }, initialize: function (e) { var x = this.config = e; var y; if (x.el) { y = x.el; if (!y) { throw new Error("[Exception]Trex.Menu : not exist element(" + x.el + ")") } } else { var w = x.id; var z = ((x.initializedId) ? x.initializedId: ""); if (!w) { if (!x.identity) { throw new Error("[Exception]Trex.Menu : not exist config - id") } w = "tx_" + x.identity + "_menu" } y = t(w + z); if (!y) { throw new Error("[Exception]Trex.Menu : not exist element(" + w + ")") } } this.elMenu = y; if (x.top) { y.style.top = x.top + "px" } if (x.left) { y.style.left = x.left + "px" } if (this.oninitialized) { this.oninitialized.bind(this)(e) } if (this.ongenerated) { this.generateHandler = this.ongenerated.bind(this) } if (this.onregenerated) { this.regenerateHandler = this.onregenerated.bind(this) } }, generate: function (e) { if (this.generateHandler) { var w = this.config; this.generateHandler(w, e) } }, regenerate: function (e) { if (this.initHandler) { this.initHandler() } if (this.regenerateHandler) { var w = this.config; this.regenerateHandler(w, e) } }, getValidOptions: function (e) { return e.options.findAll(function (w) { return ! w.expired }) }, onSelect: function () { var e = $A(arguments); var w = e.shift(); this._command.apply(this, e); this.hide(); t.stop(w) }, onCancel: function () { if (this.cancelHandler) { this.cancelHandler() } this.hide() }, visible: function () { return this.isDisplayed }, show: function (e) { t.show(this.elMenu); if (this.isInit) { this.regenerate(e) } else { if ( !! this.config.listseturl) { this.lazyGenerate(e) } else { this.generate(e); this.isInit = u; this.regenerate(e) } } if (this.showSpecial) { this.showSpecial() } this.isDisplayed = u }, lazyGenerate: function (e) { var w = this; new(g.Class.create({ $mixins: [g.I.JSRequester], initialize: function () { this.importScript(w.config.listseturl, "utf-8", b, function () { w.generate(); w.isInit = u; w.regenerate(e) }) } }))() }, hide: function () { t.hide(this.elMenu); this.isDisplayed = c }, toggle: function () { if (this.isDisplayed) { this.hide() } else { this.show() } }, release: function (e) { if (!this.isInit) { return } this.hide(e) } }); g.MarkupTemplate.add("menu.select", '
      #{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 < z.length; e++) { var A = z[e]; var x = y[e]; t.observe(x, "click", this.onSelect.bindAsEventListener(this, A.data, A.title)) } return w }, generateListItem: function (x) { var e = []; for (var w = 0; w < x.length; w++) { e.push(g.MarkupTemplate.get("menu.select.item").evaluate(x[w])) } return e.join("") }, onSelect: function () { var w = $A(arguments); var e = w.shift(); this._command.apply(this, w); this.hide(); t.stop(e) } }); g.MarkupTemplate.add("menu.items", ['', " #{for:row}", ' #{for:col}#{/for:col}", " #{/for:row}", "
    ', '', '#{if:image!=""}#{/if:image}', '#{if:image=""}#{data}#{/if:image}', "", "
    "].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 < H; G++) { if (E[G].defaultshow) { return G } } return 0 } (); this.defaultElListItem = B[y]; this.defaultElTitleItem = w[y]; for (var x = 0; x < E.length; x++) { var e = B[x]; t.observe(e, "click", F.onSelect.bindAsEventListener(F)); t.observe(e, "mouseover", F.onItemMouseOver.bindAsEventListener(F)); t.observe(e, "mouseout", F.onItemMouseOut.bindAsEventListener(F)); var z = w[x]; t.observe(z, "click", F.onTitleClick.bindAsEventListener(F, z, e)) } return C }, onTitleClick: function (x, w, e) { if (this.lastElList != e) { t.show(e); if (this.lastElList) { t.hide(this.lastElList) } this.lastElList = e; if (this.lastElTitleItem) { t.removeClassName(this.lastElTitleItem, "tx-selected") } t.addClassName(w, "tx-selected"); this.lastElTitleItem = w } if (x) { t.stop(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 (e) { var w = t.findElement(e, "span"); if (w.tagName && w.tagName.toLowerCase() == "span") { this._command(w.innerText); this.hide() } t.stop(e) } }); g.MarkupTemplate.add("menu.colorPallete", ['
    ', '
      ', '
        ', '

        @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) } }, 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) } } }); 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 }, initialize: function (x) { if (g.hmailLogging) { g.hmailLogging(x) } Editor.initStartTime = new Date().getTime(); var z = null; try { Editor.__EDITOR_LOADED = c; Editor.__PANEL_LOADED = c; z = new g.Editor(x); var A = z.getInitializedId(); if (A != i) { var w = A == "" ? 0 : A; Editor.__MULTI_LIST[w] = z; Editor.__SELECTED_INDEX = w } Object.extend(Editor, z); Editor.__EDITOR_LOADED = u; Editor.__ACTIVE = u } catch(y) { if (z) { z.fireJobs(g.Ev.__RUNTIME_EXCEPTION, y) } else { throw "failed to initialize editor. caused by " + y } throw y } } }); 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; y < z.length; y++) { w.push(z[y]) } var e = { content: "", attachments: w }; if (Editor.__PANEL_LOADED && Editor.__EDITOR_LOADED) { if (this.loadEditor) { this.loadEditor(e); var A = Editor.getAttachBox().datalist; for (var x = 0; x < A.length; x++) { A[x].execAppend() } } } else { setTimeout(this.fromHdrive.bind(this, z), 10) } }; Editor.refreshSize = function () { this.canvas.fireJobs(g.Ev.__CANVAS_WRAP_WIDTH_CHANGE) }; Editor.prototype.switchEditor = Editor.switchEditor; Editor.prototype.focusOnForm = Editor.focusOnForm })(); g.Toolbar = g.Class.create({ $mixins: [g.I.JobObservable], el: i, tools: i, initialize: function (e, w) { this.canvas = e.getCanvas(); var x = w.initializedId || ""; this.el = $must("tx_toolbar_basic" + x, "Trex.Toolbar") }, disableToolbar: function () { var w = this.tools; for (var e in w) { if (w[e].button) { w[e].button.disable() } } }, serializeToolValues: function () { var y = this.tools; var e = {}; for (var x in y) { var w = y[x]; e[x] = w.button.lastValue } return e }, widgetSeq: 0, makeWidget: function (x, A, y) { var w = this; var z = this.canvas; var e = new(function () { this.identity = "widget" + (++w.widgetSeq); this.wysiwygonly = u; this.menuFoldAuto = u; this.canvas = z; this.toolbar = w })(); g.Tool.prototype.weave.bind(e)(x, A, y); this.tools[e.identity] = e; return e } }); g.install("editor.getTool", function (w, x) { var e = x.tools = {}; w.getTool = function (y) { if (e[y] != i) { return e[y] } else { if (arguments.length == 0) { return e } else { return i } } } }); g.register("new tools", function (A, C, e, w, x) { var B = C.tools; var y = x.initializedId || ""; for (var E in g.Tool) { var D = g.Tool[E]["__Identity"]; if (D) { var z = p.getTool(D, x); z.initializedId = y; if (g.available(z, D + y)) { B[D] = new g.Tool[E](A, C, z) } } } if ( !! w.config.readonly) { C.disableToolbar() } }); g.module("bind events with tools", function (y, C, e, w) { var A = C.tools; var x = function () { var E, G, F, H; E = t.ios || t.android; if (!E) { return } for (G in A) { F = A[G]; if (F.disabledonmobile) { H = F.button; H.disable() } } }; x(); var B = function (I, H) { if (I == H) { return } for (var F in A) { var E = A[F]; var G = E.button; if (g.Canvas.__WYSIWYG_MODE == H) { G.enable() } else { if (g.Canvas.__WYSIWYG_MODE == I) { if (E.wysiwygonly) { G.disable() } else { G.enable() } } } } x() }; w.observeJob(g.Ev.__CANVAS_MODE_CHANGE, B); w.observeJob(g.Ev.__CANVAS_MODE_INITIALIZE, B); var D = function (G) { for (var F in A) { var E = A[F]; if (G != E.identity) { if (E.button) { E.button.release(); E.button.decreaseZindex() } if (E.menu && E.menuFoldAuto) { E.menu.release() } } } }; w.observeJob(g.Ev.__CANVAS_PANEL_CLICK, D); w.observeJob(g.Ev.__CANVAS_SOURCE_PANEL_CLICK, D); w.observeJob(g.Ev.__CANVAS_TEXT_PANEL_CLICK, D); C.observeJob(g.Ev.__TOOL_CLICK, D); w.observeKey({ ctrlKey: c, altKey: c, shiftKey: c, keyCode: 27 }, D); y.observeKey({ ctrlKey: c, altKey: c, shiftKey: c, keyCode: 27 }, D); t.observe(b, "click", function (F) { var G = t.element(F); var E = ["tx-sidebar", "tx-toolbar-basic", "tx-toolbar-advanced", "tx-sidebar-boundary", "tx-toolbar-boundary", "tx-toolbar-boundary"]; if (g.Util.getMatchedClassName(G, E)) { D("-") } }, c); var z = function () { y.fireJobs(g.Ev.__SHOULD_CLOSE_MENUS) }; C.observeJob(g.Ev.__TOOL_CLICK, z) }); g.Tool = g.Class.draft({ identity: i, button: i, menu: i, initialize: function (w, x, e) { if (!this.constructor.__Identity) { throw new Error("[Exception]Trex.Tool : not implement const(__Identity)") } this.identity = this.constructor.__Identity; if (!w) { throw new Error("[Exception]Trex.Tool : not exist argument(editor)") } this.editor = w; this.toolbar = x; this.canvas = w.getCanvas(); this.config = e; this.wysiwygonly = ((e.wysiwygonly != i) ? e.wysiwygonly: u); this.menuFoldAuto = ((e.menuFoldAuto != i) ? e.menuFoldAuto: u); if (e.disabledonmobile != i) { this.disabledonmobile = e.disabledonmobile } this.buttonCfg = p.merge({ id: "tx_" + this.identity }, e); this.menuCfg = p.merge({ id: "tx_" + this.identity + "_menu" }, e); this.oninitialized.bind(this)(e) }, oninitialized: function () { throw new Error("[Exception]Trex.Tool : not implements function(oninitialized)") }, weave: function (z, e, w, C) { var y = this; var D = this.identity; var B = this.toolbar; var A = this.canvas; this.button = z; z.tool = this; var x = i; if (!e) { z.setCommand(x = function () { B.fireJobs(g.Ev.__TOOL_CLICK, D); return w.apply(y, arguments) }) } else { this.menu = e; e.tool = this; e.initHandler = C || function () {}; e.cancelHandler = function () { z.setState(c) }; e.setCommand(x = function () { var E = arguments; var F = w.apply(y, E); if (F === $stop) { z.normalState.apply(z, E) } else { z.updateAfterCommand.apply(z, E) } return F }); z.setCommand(function (F) { B.fireJobs(g.Ev.__TOOL_CLICK, D, F); if (!z.isPushed()) { var G = z.getValue(); z.increaseZindex(); e.show(G) } else { e.hide(); if (t.msie) { var E = A.getProcessor(); if (E.restoreRange) { setTimeout(function () { E.restoreRange() }, 0) } } } return u }) } this.execute = x }, resetWeave: function () { this.button.removeHandler(); this.button.normalState(); this.button = i; this.menu = i; this.execute = i }, forceActivate: function () { if (this.button && this.menu) { this.button.pushedState(); this.button.increaseZindex(); this.menu.show() } }, bindKeyboard: function (x, y) { var w = this.toolbar; var e = this.identity; this.canvas.observeKey(x, function (z) { y(z); w.fireJobs(g.Ev.__TOOL_SHORTCUT_KEY, e) }) } }); g.AsyncTool = g.Class.draft({ $extend: g.Tool, oninitialized: function () { this.loaded = false; throw new Error("[Exception]Trex.AsyncTool : not implements function(oninitialized)") }, onLoadModule: function () { var e = this; var w = this.config.asyncUrl; if (/^(?:\/\/)|(?:\w+:\/\/)/.test(w) === false) { w = this.getJSBasePath() + w } Editor.editorForAsyncLoad = this.editor; EditorJSLoader.asyncLoadModule({ url: p.getUrl(w), callback: function () { e.loaded = true } }) }, getJSBasePath: function () { var x; try { x = EditorJSLoader.getJSBasePath("editor.js") } catch(w) { x = EditorJSLoader.getJSBasePath() } return x } }); g.Sidebar = g.Class.create({ $const: { __REG_ENTRY_ATTR_PAIR_Q: new RegExp('([\\w]+)="([^"]+)"', "g"), __REG_ENTRY_ATTR_PAIR_NQ: new RegExp("([\\w]+)=([\\w]+)", "g") }, $mixins: [g.I.JobObservable], entryboxRegistry: i, initialize: function (e) { var w = e.getCanvas(); this.entryboxRegistry = {}; this.getFields = function () { var x = []; for (var z in this.entryboxRegistry) { var y = this.entryboxRegistry[z]; x = x.concat(y.getFields()) } return x }; this.syncSidebar = function () { var x = w.getContent(); for (var y in this.entryboxRegistry) { this.entryboxRegistry[y].syncBox(x) } }; this.emptyEntries = function () { for (var x in this.entryboxRegistry) { this.entryboxRegistry[x].empty() } }; w.observeJob(g.Ev.__CANVAS_PANEL_DELETE_SOMETHING, function () { this.syncSidebar() }.bind(this)) } }); g.EntryBox = g.Class.draft({ $mixins: [g.I.JobObservable], autoSeq: 0, datalist: [], initialize: function () { throw new Error("[Exception]Trex.EntryBox : not implements function(initialize)") }, newSeq: function () { return (++this.autoSeq) }, syncSeq: function (e) { this.autoSeq = (e > this.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 () { return ((this.getDatalist().length == 0) ? c: u) }, getFirstEntryData: function () { var e = this.getDatalist(); 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; x < y.length; x++) { e = y[x]; if (! ["select", "input", "textarea"].contains(e.tagName.toLowerCase())) { continue } if (!e.name && !e.id) { continue } if (e.tagName.toLowerCase() == "select") { if (e.selectedIndex > 0) { 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 < A.length; z++) { y = A[z]; if (! ["select", "input", "textarea"].contains(y.tagName.toLowerCase())) { continue } if (y.name === i || y.name.length === 0) { continue } if (!e[y.name]) { continue } w = e[y.name]; if (y.tagName.toLowerCase() == "select") { for (var x = 0; x < y.options.length; x++) { if (y.options[x].value == w) { y.options[x].selected = u; break } } } else { if (y.type == "radio" || y.type == "checkbox") { if (y.value == w) { y.checked = u } } else { y.value = w } } } } }); g.install("editor.getSaver & editor.getDataAsJSON & editor.setDataByJSON", function (x, y, z, w, e) { var A = new g.Save(x, y, z, w, e); x.getSaver = function () { return A }; x.getDataAsJSON = function () { var B = w.getContent(); var C = new g.Validator(); if (!C.exists(B)) { return i } return { inputmode: w.getCurrentPanel().getName(), content: B, attachments: function () { var D = z.getAttachments(); return x.getEntryProxy().getAttachments(D, u) } (), resultBox: function () { var E = x.getResultBox(); var D = []; E.datalist.each(function (F) { D.push(F.data) }); return D } (), formfield: x.getForm().getFormField() } }; x.setDataByJSON = function (E) { if (!E) { return } var C = w.mode; var B = E.inputmode || C; if (B == "original") {} else { if (B != C) { w.fireJobs(g.Ev.__CANVAS_MODE_INITIALIZE, C, B); w.changeMode(B) } } var D = E.content; if (E.attachments) { x.getEntryProxy().setAttachments(E.attachments, D) } if (D) { D = x.getDocParser().convertAtLoad(D, C, B); w.initContent(D) } if (E.resultBox) { E.resultBox.each(function (G) { var F; F = z.searchers[G._meta.type]; if (F) { F.execReload(G, D) } }) } z.syncSidebar(); if (E.formfield) { x.getForm().setFormField(E.formfield) } } }); g.Save = g.Class.create({ editor: i, toolbar: i, sidebar: i, canvas: i, config: i, form: i, initialize: function (x, y, z, w, e) { this.editor = x; this.toolbar = y; this.sidebar = z; this.canvas = w; this.config = e; this.form = x.getForm(); this.docparser = x.getDocParser(); this.entryproxy = x.getEntryProxy() }, save: function () { try { if (typeof validForm == "function") { if (!validForm(this.editor)) { return c } } if (typeof setForm == "function") { if (!setForm(this.editor)) { return c } } return u } catch(w) { this.editor.fireJobs(g.Ev.__RUNTIME_EXCEPTION, w); return c } }, submit: function () { if (this.save()) { this.editor.fireJobs(g.Ev.__ON_SUBMIT, this.editor); if (this.config.save && typeof this.config.save.onSave == "function") { var e = this.config.save.onSave; e() } else { this.form.submit() } } }, getContent: function (w) { var y = this.canvas; var e = y.mode; var z = w || "original"; var x = y.getContent(); x = this.docparser.convertAtSave(x, e, z); return x }, getAttachments: function (w, e) { e = e || c; var x = this.sidebar.getAttachments(w); return this.entryproxy.getAttachments(x, e) }, getEmbeddedData: function (e) { return this.sidebar.getEmbeddedData(e) }, getResults: function (e) { return this.sidebar.getResults(e) }, load: function (w) { if (!w) { throw new Error("[Exception]Trex.Save : not exist argument(data)") } if (typeof loadForm == "function") { loadForm(this.editor, w) } try { this.setDataByJSONToEditor(w) } catch(e) { alert(" - Error: " + e.message + "\n\uc18c\uc2a4\ubcf4\uae30 \ubaa8\ub4dc\ub85c \uc804\ud658\ud569\ub2c8\ub2e4.\n\uc798\ubabb\ub41c HTML\uc774 \uc788\ub294\uc9c0 \ud655\uc778\ud574\uc8fc\uc138\uc694."); w.inputmode = g.Canvas.__HTML_MODE; this.setDataByJSONToEditor(w) } if (typeof postLoad == "function") { postLoad(this.editor, w) } }, setDataByJSONToEditor: function (e) { this.editor.setDataByJSON({ inputmode: (!e.inputmode || e.inputmode == "html") ? "original": e.inputmode, content: function () { var w = e.content; if (typeof w == "string") { return e.content } else { if (w && w.nodeType && (w.nodeType == 1)) { return e.content.value } else { return "" } } } (), attachments: e.attachments }) }, makeField: function () { var y = this.sidebar; var x = this.form; var e = this.getContent(); x.createField(tx.textarea({ name: "tx_content", style: { display: "none" } }, e)); var w = y.getFields(); w.each(function (z) { x.createField(tx.input({ type: "hidden", name: z.name, value: z.value })) }) } }); g.module("new Trex.Resizer", function (y, z, B, x, w) { var C = w.initializedId || ""; var e = p.get("resizer", w); var A = i; y.setMinHeight = function (D) { return A.setMinHeight(D) }; y.restoreMinHeight = function () { return A.restoreMinHeight() }; if (g.available(e, "resizer" + C)) { A = new g.Resizer(y, e) } }); p.add({ resizer: { minHeight: 200 } }); g.Resizer = g.Class.create({ $const: { __Identity: "resizer" }, $mixins: [g.I.JobObservable], initialize: function (x, e) { var A = 0; if (!x) { return } this.config = e; var B = x.getInitializedId(); var w = this.elBar = t("tx_resizer" + B); if (!w) { return } if (t.msie_ver == "5.5") { w.setAttribute("align", "center") } this.resizeHeightAtService = function (C) { if (typeof resizeHeight == "function") { resizeHeight(C) } }; this.resizingHeightAtService = function (C) { if (typeof resizingEditorHeight == "function") { resizingEditorHeight(C) } }; this.minDragHeight = e.minHeight; var z; this.startDrag = function (D) { var F = x.getCanvas(); var E = F.getCurrentPanel(); if (E == i) { return } var C = E.getPosition(); this.panelHeight = C.height; this.dragStartPosY = D.clientY; this.isDragging = u; t.observe(b, "mousemove", this.documentDraggingHandler); t.observe(b, "mouseup", this.stopDragHandler); if (E.getName() == g.Canvas.__WYSIWYG_MODE) { this.panelTop = C.y; z = E.getDocument(); if (z == i) { return } F.fireJobs("canvas.height.beforechange"); t.observe(z, "mousemove", this.wysiwygDraggingHandler); t.observe(z, "mouseup", this.stopDragHandler) } t.stop(D) }; this.stopDrag = function (C) { var E = x.getCanvas(); var D = E.getCurrentPanel(); if (D == i) { return } this.isDragging = c; t.stopObserving(b, "mousemove", this.documentDraggingHandler); t.stopObserving(b, "mouseup", this.stopDragHandler); if (z == i) { return } t.stopObserving(z, "mousemove", this.wysiwygDraggingHandler); t.stopObserving(z, "mouseup", this.stopDragHandler); z = i; this.resizeHeightAtService(A); E.fireJobs("canvas.height.afterchange"); t.stop(C) }; this.dragingAtDocument = function (D) { var F = x.getCanvas(); if (this.isDragging) { var E = F.getCurrentPanel(); if (E == i) { return } try { var C = Math.max((this.panelHeight + D.clientY - this.dragStartPosY), this.minDragHeight.parsePx()).toPx(); E.setPanelHeight(C); A = C; F.fireJobs("canvas.height.change", C); this.resizingHeightAtService(C) } catch(G) {} } t.stop(D) }; this.dragingAtWysiwyg = function (E) { var G = x.getCanvas(); if (this.isDragging) { var F = G.getCurrentPanel(); if (F == i) { return } try { var I = b.body.scrollTop || n.scrollTop || h.pageYOffset; var D = G.getCanvasPos(); var C = Math.max((this.panelHeight + E.clientY + D.y - this.dragStartPosY + this.panelTop - I), this.minDragHeight.parsePx()).toPx(); F.setPanelHeight(C); G.fireJobs("canvas.height.change", C) } catch(H) {} } t.stop(E) }; this.startDragHandler = this.startDrag.bindAsEventListener(this); this.stopDragHandler = this.stopDrag.bindAsEventListener(this); this.documentDraggingHandler = this.dragingAtDocument.bindAsEventListener(this); this.wysiwygDraggingHandler = this.dragingAtWysiwyg.bindAsEventListener(this); this.isDragging = c; t.observe(w, "mousedown", this.startDragHandler); var y = x.getCanvas(); y.observeJob("canvas.fullscreen.change", function () { t.hide(w) }); y.observeJob("canvas.normalscreen.change", function () { t.show(w) }) }, setMinHeight: function (e) { return this.minDragHeight = e.toPx() }, restoreMinHeight: function () { return this.minDragHeight = this.config.minHeight || 200 } }); (function () { function e(z, y) { while (z.length >= y) { z.shift() } } var x = 20; g.History = g.Class.create({}); g.History.prototype = { 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 y = this.canvas; return function (z) { y.setContent(z.content); setTimeout(function () { y.setScrollTop(z.scrollTop) }, 0) } }, getTextData: function () { return { content: this.canvas.getContent(), scrollTop: this.canvas.getScrollTop() } } }; 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: "html", 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 } }, 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("")) }); 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 ((t.ios && t.ios_ver < 5) || (t.android && t.android_ver < 3)) { 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) }) }, changeMode: function (z) { var y = this.editor; var D = this.mode; if (D == z) { 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()); A.hide(); B.show(); 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 () { if (!this.isWYSIWYG()) { return } this.getProcessor().focusOnTop() }, focusOnBottom: function () { if (!this.isWYSIWYG()) { return } 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 { A(y); y.focus(); 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 (y) { this.fireJobs(w.Ev.__CANVAS_PANEL_KEYDOWN, y); if (this.config.useHotKey) { this.fireKeys(y) } }, 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) {} }, 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 (x, y, z, w) { var A = 0; var e = 0; w.observeJob(g.Ev.__CANVAS_HEIGHT_CHANGE, function (B) { A = B.parsePx() }); w.observeJob("canvas.apply.background", function () { var C = w.getPanel(g.Canvas.__WYSIWYG_MODE); var B = v.getPosition(C.el); e = B.y }); w.reserveJob(g.Ev.__IFRAME_LOAD_COMPLETE, function () { var C = w.getPanel(g.Canvas.__WYSIWYG_MODE); A = C.getPanelHeight().parsePx(); var B = v.getPosition(C.el); e = B.y }, 300); w.getIframeHeight = function () { return A }; w.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.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 (G) { var C = this; h.__tx_wysiwyg_iframe_load_complete = function () { C.loadLocalIframe(G, "") }; if (!this.iframeUrl) { try { var F = EditorJSLoader.getPageBasePath("editor.js") } catch(D) { F = EditorJSLoader.getPageBasePath() } var B = this.doctype; switch (B) { case "edge": case "loose": case "strict": this.iframeUrl = F + "trex/iframe_loader_catalyst_" + B + ".html"; break; default: this.iframeUrl = F + "trex/iframe_loader_catalyst.html" } } var E = (document.location.hostname != document.domain); if (E) { this.iframeUrl = this.iframeUrl + ((this.iframeUrl.indexOf("?") > -1) ? "&": "?") + "xssDomain=" + document.domain } this.iframe.src = this.iframeUrl }, 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