!function () { UEDITOR_CONFIG = window.UEDITOR_CONFIG || {}; var baidu = window.baidu || {}; window.baidu = baidu, window.UE = baidu.editor = window.UE || {}, UE.plugins = {}, UE.commands = {}, UE.instants = {}, UE.I18N = {}, UE._customizeUI = {}, UE.version = "1.4.3", UE.promptAlert = function () { }, UE.showFormulaDialogue = function () { }; var dom = UE.dom = {}, dom_key = "Q29weXJpZ2h0IOatpuaxieaAnee7tOi3s+i3g+enkeaKgOaciemZkOWFrOWPuCDniYjmnYPmiYDmnIk=", browser = UE.browser = function () { var e = navigator.userAgent.toLowerCase(), t = window.opera, i = { ie: /(msie\s|trident.*rv:)([\w.]+)/.test(e), opera: !!t && t.version, webkit: -1 < e.indexOf(" applewebkit/"), mac: -1 < e.indexOf("macintosh"), quirks: "BackCompat" == document.compatMode }; i.gecko = "Gecko" == navigator.product && !i.webkit && !i.opera && !i.ie; var n = 0; if (i.ie) { var o = e.match(/(?:msie\s([\w.]+))/), r = e.match(/(?:trident.*rv:([\w.]+))/); n = o && r && o[1] && r[1] ? Math.max(+o[1], +r[1]) : o && o[1] ? +o[1] : r && r[1] ? +r[1] : 0, i.ie11Compat = 11 == document.documentMode, i.ie9Compat = 9 == document.documentMode, i.ie8 = !!document.documentMode, i.ie8Compat = 8 == document.documentMode, i.ie7Compat = 7 == n && !document.documentMode || 7 == document.documentMode, i.ie6Compat = n < 7 || i.quirks, i.ie9above = 8 < n, i.ie9below = n < 9, i.ie11above = 10 < n, i.ie11below = n < 11 } if (i.gecko) { var a = e.match(/rv:([\d\.]+)/); a && (n = 1e4 * (a = a[1].split("."))[0] + 100 * (a[1] || 0) + +(a[2] || 0)) } return /chrome\/(\d+\.\d)/i.test(e) && (i.chrome = +RegExp.$1), /(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(e) && !/chrome/i.test(e) && (i.safari = +(RegExp.$1 || RegExp.$2)), i.opera && (n = parseFloat(t.version())), i.webkit && (n = parseFloat(e.match(/ applewebkit\/(\d+)/)[1])), i.version = n, i.isCompatible = !i.mobile && (i.ie && 6 <= n || i.gecko && 10801 <= n || i.opera && 9.5 <= n || i.air && 1 <= n || i.webkit && 522 <= n || !1), i }(), ie = browser.ie, webkit = browser.webkit, gecko = browser.gecko, opera = browser.opera, utils = UE.utils = { each: function (e, t, i) { if (null != e) if (e.length === +e.length) { for (var n = 0, o = e.length; n < o; n++)if (!1 === t.call(i, e[n], n, e)) return !1 } else for (var r in e) if (e.hasOwnProperty(r) && !1 === t.call(i, e[r], r, e)) return !1 }, makeInstance: function (e) { var t = new Function; return t.prototype = e, e = new t, t.prototype = null, e }, extend: function (e, t, i) { if (t) for (var n in t) i && e.hasOwnProperty(n) || (e[n] = t[n]); return e }, extend2: function (e) { for (var t = arguments, i = 1; i < t.length; i++) { var n = t[i]; for (var o in n) e.hasOwnProperty(o) || (e[o] = n[o]) } return e }, inherits: function (e, t) { var i = e.prototype, n = utils.makeInstance(t.prototype); return utils.extend(n, i, !0), (e.prototype = n).constructor = e }, bind: function (e, t) { return function () { return e.apply(t, arguments) } }, defer: function (e, t, i) { var n; return function () { i && clearTimeout(n), n = setTimeout(e, t) } }, indexOf: function (e, i, n) { var o = -1; return n = this.isNumber(n) ? n : 0, this.each(e, function (e, t) { if (n <= t && e === i) return o = t, !1 }), o }, removeItem: function (e, t) { for (var i = 0, n = e.length; i < n; i++)e[i] === t && (e.splice(i, 1), i--) }, trim: function (e) { return e.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g, "") }, listToMap: function (e) { if (!e) return {}; e = utils.isArray(e) ? e : e.split(","); for (var t, i = 0, n = {}; t = e[i++];)n[t.toUpperCase()] = n[t] = 1; return n }, unhtml: function (e, t) { return e ? e.replace(t || /[&<">'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g, function (e, t) { return t ? e : { "<": "<", "&": "&", '"': """, ">": ">", "'": "'" }[e] }) : "" }, unhtmlForUrl: function (e, t) { return e ? e.replace(t || /[<">']/g, function (e) { return { "<": "<", "&": "&", '"': """, ">": ">", "'": "'" }[e] }) : "" }, html: function (e) { return e ? e.replace(/&((g|l|quo)t|amp|#39|nbsp);/g, function (e) { return { "<": "<", "&": "&", """: '"', ">": ">", "'": "'", " ": " " }[e] }) : "" }, cssStyleToDomStyle: (ia = document.createElement("div").style, ja = { float: null != ia.cssFloat ? "cssFloat" : null != ia.styleFloat ? "styleFloat" : "float" }, function (e) { return ja[e] || (ja[e] = e.toLowerCase().replace(/-./g, function (e) { return e.charAt(1).toUpperCase() })) }), loadFile: (ma = [], function (t, i, e) { var n = na(t, i); if (n) n.ready ? e && e() : n.funs.push(e); else if (ma.push({ doc: t, url: i.src || i.href, funs: [e] }), t.body) { if (!i.id || !t.getElementById(i.id)) { var o = t.createElement(i.tag); for (var r in delete i.tag, i) o.setAttribute(r, i[r]); o.onload = o.onreadystatechange = function () { if (!this.readyState || /loaded|complete/.test(this.readyState)) { if (0 < (n = na(t, i)).funs.length) { n.ready = 1; for (var e; e = n.funs.pop();)e() } o.onload = o.onreadystatechange = null } }, o.onerror = function () { throw Error("The load " + (i.href || i.src) + " fails,check the url settings of file ueditor.config.js ") }, t.getElementsByTagName("head")[0].appendChild(o) } } else { var a = []; for (var r in i) "tag" != r && a.push(r + '="' + i[r] + '"'); t.write("<" + i.tag + " " + a.join(" ") + " >" + i.tag + ">") } }), isEmptyObject: function (e) { if (null == e) return !0; if (this.isArray(e) || this.isString(e)) return 0 === e.length; for (var t in e) if (e.hasOwnProperty(t)) return !1; return !0 }, fixColor: function (e, t) { if (/color/i.test(e) && /rgba?/.test(t)) { var i = t.split(","); if (3 < i.length) return ""; t = "#"; for (var n, o = 0; n = i[o++];)t += 1 == (n = parseInt(n.replace(/[^\d]/gi, ""), 10).toString(16)).length ? "0" + n : n; t = t.toUpperCase() } return t }, optCss: function (e) { var o, r; function t (e, t) { if (!e) return ""; var i = e.top, n = e.bottom, o = e.left, r = e.right, a = ""; if (i && o && n && r) a += ";" + t + ":" + (i == n && n == o && o == r ? i : i == n && o == r ? i + " " + o : o == r ? i + " " + o + " " + n : i + " " + r + " " + n + " " + o) + ";"; else for (var s in e) a += ";" + t + "-" + s + ":" + e[s] + ";"; return a } return e = e.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi, function (e, t, i, n) { if (1 == n.split(" ").length) switch (t) { case "padding": return (o = o || {})[i] = n, ""; case "margin": return (r = r || {})[i] = n, ""; case "border": return "initial" == n ? "" : e }return e }), (e += t(o, "padding") + t(r, "margin")).replace(/^[ \n\r\t;]*|[ \n\r\t]*$/, "").replace(/;([ \n\r\t]+)|\1;/g, ";").replace(/(&((l|g)t|quot|#39))?;{2,}/g, function (e, t) { return t ? t + ";;" : ";" }) }, clone: function (e, t) { var i; for (var n in t = t || {}, e) e.hasOwnProperty(n) && ("object" == typeof (i = e[n]) ? (t[n] = utils.isArray(i) ? [] : {}, utils.clone(e[n], t[n])) : t[n] = i); return t }, transUnitToPx: function (n) { if (!/(pt|cm)/.test(n)) return n; var o; switch (n.replace(/([\d.]+)(\w+)/, function (e, t, i) { n = t, o = i }), o) { case "cm": n = 25 * parseFloat(n); break; case "pt": n = Math.round(96 * parseFloat(n) / 72) }return n + (n ? "px" : "") }, domReady: (ib = [], function (e, t) { var i = (t = t || window).document; e && ib.push(e), "complete" === i.readyState ? jb(i) : (i.isReady && jb(i), browser.ie && 11 != browser.version ? (function () { if (!i.isReady) { try { i.documentElement.doScroll("left") } catch (e) { return setTimeout(arguments.callee, 0) } jb(i) } }(), t.attachEvent("onload", function () { jb(i) })) : (i.addEventListener("DOMContentLoaded", function () { i.removeEventListener("DOMContentLoaded", arguments.callee, !1), jb(i) }, !1), t.addEventListener("load", function () { jb(i) }, !1))) }), cssRule: browser.ie && 11 != browser.version ? function (e, t, i) { var n, o; return void 0 === t || t && t.nodeType && 9 == t.nodeType ? void 0 !== (o = (n = (i = t && t.nodeType && 9 == t.nodeType ? t : i || document).indexList || (i.indexList = {}))[e]) ? i.styleSheets[o].cssText : void 0 : (o = (n = (i = i || document).indexList || (i.indexList = {}))[e], "" === t ? void 0 !== o && (i.styleSheets[o].cssText = "", delete n[e], !0) : (void 0 !== o ? sheetStyle = i.styleSheets[o] : (sheetStyle = i.createStyleSheet("", o = i.styleSheets.length), n[e] = o), void (sheetStyle.cssText = t))) } : function (e, t, i) { var n; return void 0 === t || t && t.nodeType && 9 == t.nodeType ? (n = (i = t && t.nodeType && 9 == t.nodeType ? t : i || document).getElementById(e)) ? n.innerHTML : void 0 : (n = (i = i || document).getElementById(e), "" === t ? !!n && (n.parentNode.removeChild(n), !0) : void (n ? n.innerHTML = t : ((n = i.createElement("style")).id = e, n.innerHTML = t, i.getElementsByTagName("head")[0].appendChild(n)))) }, sort: function (e, t) { t = t || function (e, t) { return e.localeCompare(t) }; for (var i = 0, n = e.length; i < n; i++)for (var o = i, r = e.length; o < r; o++)if (0 < t(e[i], e[o])) { var a = e[i]; e[i] = e[o], e[o] = a } return e }, serializeParam: function (e) { var t = []; for (var i in e) if ("method" != i && "timeout" != i && "async" != i) if ("function" != (typeof e[i]).toLowerCase() && "object" != (typeof e[i]).toLowerCase()) t.push(encodeURIComponent(i) + "=" + encodeURIComponent(e[i])); else if (utils.isArray(e[i])) for (var n = 0; n < e[i].length; n++)t.push(encodeURIComponent(i) + "[]=" + encodeURIComponent(e[i][n])); return t.join("&") }, formatUrl: function (e) { var t = e.replace(/&&/g, "&"); return t = (t = (t = (t = t.replace(/\?&/g, "?")).replace(/&$/g, "")).replace(//g, "#")).replace(/&+/g, "&") }, isCrossDomainUrl: function (e) { var t = document.createElement("a"); return t.href = e, browser.ie && (t.href = t.href), !(t.protocol == location.protocol && t.hostname == location.hostname && (t.port == location.port || "80" == t.port && "" == location.port || "" == t.port && "80" == location.port)) }, clearEmptyAttrs: function (e) { for (var t in e) "" === e[t] && delete e[t]; return e }, str2json: function (e) { return utils.isString(e) ? window.JSON ? JSON.parse(e) : new Function("return " + utils.trim(e || ""))() : null }, json2str: function () { if (window.JSON) return JSON.stringify; var l = { "\b": "\\b", "\t": "\\t", "\n": "\\n", "\f": "\\f", "\r": "\\r", '"': '\\"', "\\": "\\\\" }; function d (e) { return e < 10 ? "0" + e : e } return function (e) { switch (typeof e) { case "undefined": return "undefined"; case "number": return isFinite(e) ? String(e) : "null"; case "string": return /["\\\x00-\x1f]/.test(s = e) && (s = s.replace(/["\\\x00-\x1f]/g, function (e) { var t = l[e]; return t || (t = e.charCodeAt(), "\\u00" + Math.floor(t / 16).toString(16) + (t % 16).toString(16)) })), '"' + s + '"'; case "boolean": return String(e); default: if (null === e) return "null"; if (utils.isArray(e)) return function (e) { var t, i, n, o = ["["], r = e.length; for (i = 0; i < r; i++)switch (typeof (n = e[i])) { case "undefined": case "function": case "unknown": break; default: t && o.push(","), o.push(utils.json2str(n)), t = 1 }return o.push("]"), o.join("") }(e); if (utils.isDate(e)) return '"' + (a = e).getFullYear() + "-" + d(a.getMonth() + 1) + "-" + d(a.getDate()) + "T" + d(a.getHours()) + ":" + d(a.getMinutes()) + ":" + d(a.getSeconds()) + '"'; var t, i, n = ["{"], o = utils.json2str; for (var r in e) if (Object.prototype.hasOwnProperty.call(e, r)) switch (typeof (i = e[r])) { case "undefined": case "unknown": case "function": break; default: t && n.push(","), t = 1, n.push(o(r) + ":" + o(i)) }return n.push("}"), n.join("") }var a, s } }() }, ib, ma, ia, ja; function jb (e) { e.isReady = !0; for (var t; t = ib.pop(); t()); } function na (e, t) { try { for (var i, n = 0; i = ma[n++];)if (i.doc === e && i.url == (t.src || t.href)) return i } catch (e) { return null } } utils.each(["String", "Function", "Array", "Number", "RegExp", "Object", "Date"], function (t) { UE.utils["is" + t] = function (e) { return Object.prototype.toString.apply(e) == "[object " + t + "]" } }); var EventBase = UE.EventBase = function () { }; function getListener (e, t, i) { var n; return t = t.toLowerCase(), (n = e.__allListeners || i && (e.__allListeners = {})) && (n[t] || i && (n[t] = [])) } EventBase.prototype = { addListener: function (e, t) { e = utils.trim(e).split(/\s+/); for (var i, n = 0; i = e[n++];)getListener(this, i, !0).push(t) }, on: function (e, t) { return this.addListener(e, t) }, off: function (e, t) { return this.removeListener(e, t) }, trigger: function () { return this.fireEvent.apply(this, arguments) }, removeListener: function (e, t) { e = utils.trim(e).split(/\s+/); for (var i, n = 0; i = e[n++];)utils.removeItem(getListener(this, i) || [], t) }, fireEvent: function () { var e = arguments[0]; e = utils.trim(e).split(" "); for (var t, i = 0; t = e[i++];) { var n, o, r, a = getListener(this, t); if (a) for (r = a.length; r--;)if (a[r]) { if (!0 === (o = a[r].apply(this, arguments))) return o; void 0 !== o && (n = o) } (o = this["on" + t.toLowerCase()]) && (n = o.apply(this, arguments)) } return n } }; var dtd = dom.dtd = (Oc = utils.extend2, Pc = Nc({ isindex: 1, fieldset: 1 }), Qc = Nc({ input: 1, button: 1, select: 1, textarea: 1, label: 1 }), Rc = Oc(Nc({ a: 1 }), Qc), Sc = Oc({ iframe: 1 }, Rc), Tc = Nc({ hr: 1, ul: 1, menu: 1, div: 1, blockquote: 1, noscript: 1, table: 1, center: 1, address: 1, dir: 1, pre: 1, h5: 1, dl: 1, h4: 1, noframes: 1, h6: 1, ol: 1, h1: 1, h3: 1, h2: 1 }), Uc = Nc({ ins: 1, del: 1, script: 1, style: 1 }), Vc = Oc(Nc({ b: 1, acronym: 1, bdo: 1, var: 1, "#": 1, abbr: 1, code: 1, br: 1, i: 1, cite: 1, kbd: 1, u: 1, strike: 1, s: 1, tt: 1, strong: 1, q: 1, samp: 1, em: 1, dfn: 1, span: 1 }), Uc), Wc = Oc(Nc({ sub: 1, img: 1, embed: 1, object: 1, sup: 1, basefont: 1, map: 1, applet: 1, font: 1, big: 1, small: 1 }), Vc), Xc = Oc(Nc({ p: 1 }), Wc), Yc = Oc(Nc({ iframe: 1 }), Wc, Qc), Zc = Nc({ img: 1, embed: 1, noscript: 1, br: 1, kbd: 1, center: 1, button: 1, basefont: 1, h5: 1, h4: 1, samp: 1, h6: 1, ol: 1, h1: 1, h3: 1, h2: 1, form: 1, font: 1, "#": 1, select: 1, menu: 1, ins: 1, abbr: 1, label: 1, code: 1, table: 1, script: 1, cite: 1, input: 1, iframe: 1, strong: 1, textarea: 1, noframes: 1, big: 1, small: 1, span: 1, hr: 1, sub: 1, bdo: 1, var: 1, div: 1, object: 1, sup: 1, strike: 1, dir: 1, map: 1, dl: 1, applet: 1, del: 1, isindex: 1, fieldset: 1, ul: 1, b: 1, acronym: 1, a: 1, blockquote: 1, i: 1, u: 1, s: 1, tt: 1, address: 1, q: 1, pre: 1, p: 1, em: 1, dfn: 1 }), $c = Oc(Nc({ a: 0 }), Yc), _c = Nc({ tr: 1 }), ad = Nc({ "#": 1 }), bd = Oc(Nc({ param: 1 }), Zc), cd = Oc(Nc({ form: 1 }), Pc, Sc, Tc, Xc), dd = Nc({ li: 1, ol: 1, ul: 1 }), ed = Nc({ style: 1, script: 1 }), fd = Nc({ base: 1, link: 1, meta: 1, title: 1 }), gd = Oc(fd, ed), hd = Nc({ head: 1, body: 1 }), id = Nc({ html: 1 }), jd = Nc({ address: 1, blockquote: 1, center: 1, dir: 1, div: 1, dl: 1, fieldset: 1, form: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1, hr: 1, isindex: 1, menu: 1, noframes: 1, ol: 1, p: 1, pre: 1, table: 1, ul: 1 }), kd = Nc({ area: 1, base: 1, basefont: 1, br: 1, col: 1, command: 1, dialog: 1, embed: 1, hr: 1, img: 1, input: 1, isindex: 1, keygen: 1, link: 1, meta: 1, param: 1, source: 1, track: 1, wbr: 1 }), Nc({ $nonBodyContent: Oc(id, hd, fd), $block: jd, $inline: $c, $inlineWithA: Oc(Nc({ a: 1 }), $c), $body: Oc(Nc({ script: 1, style: 1 }), jd), $cdata: Nc({ script: 1, style: 1 }), $empty: kd, $nonChild: Nc({ iframe: 1, textarea: 1 }), $listItem: Nc({ dd: 1, dt: 1, li: 1 }), $list: Nc({ ul: 1, ol: 1, dl: 1 }), $isNotEmpty: Nc({ table: 1, ul: 1, ol: 1, dl: 1, iframe: 1, area: 1, base: 1, col: 1, hr: 1, img: 1, embed: 1, input: 1, link: 1, meta: 1, param: 1, h1: 1, h2: 1, h3: 1, h4: 1, h5: 1, h6: 1 }), $removeEmpty: Nc({ a: 1, abbr: 1, acronym: 1, address: 1, b: 1, bdo: 1, big: 1, cite: 1, code: 1, del: 1, dfn: 1, em: 1, font: 1, i: 1, ins: 1, label: 1, kbd: 1, q: 1, s: 1, samp: 1, small: 1, span: 1, strike: 1, strong: 1, sub: 1, sup: 1, tt: 1, u: 1, var: 1 }), $removeEmptyBlock: Nc({ p: 1, div: 1 }), $tableContent: Nc({ caption: 1, col: 1, colgroup: 1, tbody: 1, td: 1, tfoot: 1, th: 1, thead: 1, tr: 1, table: 1 }), $notTransContent: Nc({ pre: 1, script: 1, style: 1, textarea: 1 }), html: hd, head: gd, style: ad, script: ad, body: cd, base: {}, link: {}, meta: {}, title: ad, col: {}, tr: Nc({ td: 1, th: 1 }), img: {}, embed: {}, colgroup: Nc({ thead: 1, col: 1, tbody: 1, tr: 1, tfoot: 1 }), noscript: cd, td: cd, br: {}, th: cd, center: cd, kbd: $c, button: Oc(Xc, Tc), basefont: {}, h5: $c, h4: $c, samp: $c, h6: $c, ol: dd, h1: $c, h3: $c, option: ad, h2: $c, form: Oc(Pc, Sc, Tc, Xc), select: Nc({ optgroup: 1, option: 1 }), font: $c, ins: $c, menu: dd, abbr: $c, label: $c, table: Nc({ thead: 1, col: 1, tbody: 1, tr: 1, colgroup: 1, caption: 1, tfoot: 1 }), code: $c, tfoot: _c, cite: $c, li: cd, input: {}, iframe: cd, strong: $c, textarea: ad, noframes: cd, big: $c, small: $c, span: Nc({ "#": 1, br: 1, b: 1, strong: 1, u: 1, i: 1, em: 1, sub: 1, sup: 1, strike: 1, span: 1 }), hr: $c, dt: $c, sub: $c, optgroup: Nc({ option: 1 }), param: {}, bdo: $c, var: $c, div: cd, object: bd, sup: $c, dd: cd, strike: $c, area: {}, dir: dd, map: Oc(Nc({ area: 1, form: 1, p: 1 }), Pc, Uc, Tc), applet: bd, dl: Nc({ dt: 1, dd: 1 }), del: $c, isindex: {}, fieldset: Oc(Nc({ legend: 1 }), Zc), thead: _c, ul: dd, acronym: $c, b: $c, a: Oc(Nc({ a: 1 }), Yc), blockquote: Oc(Nc({ td: 1, tr: 1, tbody: 1, li: 1 }), cd), caption: $c, i: $c, u: $c, tbody: _c, s: $c, address: Oc(Sc, Xc), tt: $c, legend: $c, q: $c, pre: Oc(Vc, Rc), p: Oc(Nc({ a: 1 }), $c), em: $c, dfn: $c })), Oc, Pc, Qc, Rc, Sc, Tc, Uc, Vc, Wc, Xc, Yc, Zc, $c, _c, ad, bd, cd, dd, ed, fd, gd, hd, id, jd, kd; function Nc (e) { for (var t in e) e[t.toUpperCase()] = e[t]; return e } function getDomNode (e, t, i, n, o, r) { var a, s = n && e[t]; for (s = s || e[i]; !s && (a = (a || e).parentNode);) { if ("BODY" == a.tagName || r && !r(a)) return null; s = a[i] } return s && o && !o(s) ? getDomNode(s, t, i, !1, o) : s } var attrFix = ie && browser.version < 9 ? { tabindex: "tabIndex", readonly: "readOnly", for: "htmlFor", class: "className", maxlength: "maxLength", cellspacing: "cellSpacing", cellpadding: "cellPadding", rowspan: "rowSpan", colspan: "colSpan", usemap: "useMap", frameborder: "frameBorder" } : { tabindex: "tabIndex", readonly: "readOnly" }, styleBlock = utils.listToMap(["-webkit-box", "-moz-box", "block", "list-item", "table", "table-row-group", "table-header-group", "table-footer-group", "table-row", "table-column-group", "table-column", "table-cell", "table-caption"]), domUtils = dom.domUtils = { NODE_ELEMENT: 1, NODE_DOCUMENT: 9, NODE_TEXT: 3, NODE_COMMENT: 8, NODE_DOCUMENT_FRAGMENT: 11, POSITION_IDENTICAL: 0, POSITION_DISCONNECTED: 1, POSITION_FOLLOWING: 2, POSITION_PRECEDING: 4, POSITION_IS_CONTAINED: 8, POSITION_CONTAINS: 16, fillChar: ie && "6" == browser.version ? "\ufeff" : "", keys: { 8: 1, 46: 1, 16: 1, 17: 1, 18: 1, 37: 1, 38: 1, 39: 1, 40: 1, 13: 1 }, getPosition: function (e, t) { if (e === t) return 0; var i, n = [e], o = [t]; for (i = e; i = i.parentNode;) { if (i === t) return 10; n.push(i) } for (i = t; i = i.parentNode;) { if (i === e) return 20; o.push(i) } if (n.reverse(), o.reverse(), n[0] !== o[0]) return 1; for (var r = -1; n[++r] === o[r];); for (e = n[r], t = o[r]; e = e.nextSibling;)if (e === t) return 4; return 2 }, getNodeIndex: function (e, t) { for (var i = e, n = 0; i = i.previousSibling;)(!t || 3 != i.nodeType || i.nodeType != i.nextSibling.nodeType) && n++; return n }, inDoc: function (e, t) { return 10 == domUtils.getPosition(e, t) }, findParent: function (e, t, i) { if (e && !domUtils.isBody(e)) for (e = i ? e : e.parentNode; e;) { if (!t || t(e) || domUtils.isBody(e)) return t && !t(e) && domUtils.isBody(e) ? null : e; e = e.parentNode } return null }, findParentByTagName: function (e, t, i, n) { return t = utils.listToMap(utils.isArray(t) ? t : [t]), domUtils.findParent(e, function (e) { return t[e.tagName] && !(n && n(e)) }, i) }, findParents: function (e, t, i, n) { for (var o = t && (i && i(e) || !i) ? [e] : []; e = domUtils.findParent(e, i);)o.push(e); return n ? o : o.reverse() }, insertAfter: function (e, t) { return e.nextSibling ? e.parentNode.insertBefore(t, e.nextSibling) : e.parentNode.appendChild(t) }, remove: function (e, t) { var i, n = e.parentNode; if (n) { if (t && e.hasChildNodes()) for (; i = e.firstChild;)n.insertBefore(i, e); n.removeChild(e) } return e }, getNextDomNode: function (e, t, i, n) { return getDomNode(e, "firstChild", "nextSibling", t, i, n) }, getPreDomNode: function (e, t, i, n) { return getDomNode(e, "lastChild", "previousSibling", t, i, n) }, isBookmarkNode: function (e) { return 1 == e.nodeType && e.id && /^_baidu_bookmark_/i.test(e.id) }, getWindow: function (e) { var t = e.ownerDocument || e; return t.defaultView || t.parentWindow }, getCommonAncestor: function (e, t) { if (e === t) return e; for (var i = [e], n = [t], o = e, r = -1; o = o.parentNode;) { if (o === t) return o; i.push(o) } for (o = t; o = o.parentNode;) { if (o === e) return o; n.push(o) } for (i.reverse(), n.reverse(); i[++r] === n[r];); return 0 == r ? null : i[r - 1] }, clearEmptySibling: function (e, t, i) { function n (e, t) { for (var i; e && !domUtils.isBookmarkNode(e) && (domUtils.isEmptyInlineElement(e) || !new RegExp("[^\t\n\r" + domUtils.fillChar + "]").test(e.nodeValue));)i = e[t], domUtils.remove(e), e = i } t || n(e.nextSibling, "nextSibling"), i || n(e.previousSibling, "previousSibling") }, split: function (e, t) { var i = e.ownerDocument; if (browser.ie && t == e.nodeValue.length) { var n = i.createTextNode(""); return domUtils.insertAfter(e, n) } var o = e.splitText(t); if (browser.ie8) { var r = i.createTextNode(""); domUtils.insertAfter(o, r), domUtils.remove(r) } return o }, isWhitespace: function (e) { return !new RegExp("[^ \t\n\r" + domUtils.fillChar + "]").test(e.nodeValue) }, getXY: function (e) { for (var t = 0, i = 0; e.offsetParent;)i += e.offsetTop, t += e.offsetLeft, e = e.offsetParent; return { x: t, y: i } }, on: function (e, t, i) { var n = utils.isArray(t) ? t : utils.trim(t).split(/\s+/), o = n.length; if (o) for (; o--;)if (t = n[o], e.addEventListener) e.addEventListener(t, i, !1); else { i._d || (i._d = { els: [] }); var r = t + i.toString(), a = utils.indexOf(i._d.els, e); i._d[r] && -1 != a || (-1 == a && i._d.els.push(e), i._d[r] || (i._d[r] = function (e) { return i.call(e.srcElement, e || window.event) }), e.attachEvent("on" + t, i._d[r])) } e = null }, un: function (e, t, i) { var n = utils.isArray(t) ? t : utils.trim(t).split(/\s+/), o = n.length; if (o) for (; o--;)if (t = n[o], e.removeEventListener) e.removeEventListener(t, i, !1); else { var r = t + i.toString(); try { e.detachEvent("on" + t, i._d ? i._d[r] : i) } catch (e) { } if (i._d && i._d[r]) { var a = utils.indexOf(i._d.els, e); -1 != a && i._d.els.splice(a, 1), 0 == i._d.els.length && delete i._d[r] } } }, isSameElement: function (e, t) { if (e.tagName != t.tagName) return !1; var i = e.attributes, n = t.attributes; if (!ie && i.length != n.length) return !1; for (var o, r, a = 0, s = 0, l = 0; o = i[l++];) { if ("style" == o.nodeName) { if (o.specified && a++, domUtils.isSameStyle(e, t)) continue; return !1 } if (ie) { if (!o.specified) continue; a++, r = n.getNamedItem(o.nodeName) } else r = t.attributes[o.nodeName]; if (!r.specified || o.nodeValue != r.nodeValue) return !1 } if (ie) { for (l = 0; r = n[l++];)r.specified && s++; if (a != s) return !1 } return !0 }, isSameStyle: function (e, t) { var i = e.style.cssText.replace(/( ?; ?)/g, ";").replace(/( ?: ?)/g, ":"), n = t.style.cssText.replace(/( ?; ?)/g, ";").replace(/( ?: ?)/g, ":"); if (browser.opera) { if (i = e.style, n = t.style, i.length != n.length) return !1; for (var o in i) if (!/^(\d+|csstext)$/i.test(o) && i[o] != n[o]) return !1; return !0 } if (!i || !n) return i == n; if (i = i.split(";"), n = n.split(";"), i.length != n.length) return !1; for (var r, a = 0; r = i[a++];)if (-1 == utils.indexOf(n, r)) return !1; return !0 }, isBlockElm: function (e) { return 1 == e.nodeType && (dtd.$block[e.tagName] || styleBlock[domUtils.getComputedStyle(e, "display")]) && !dtd.$nonChild[e.tagName] }, isBody: function (e) { return e && 1 == e.nodeType && "body" == e.tagName.toLowerCase() }, breakParent: function (e, t) { var i, n, o, r = e, a = e; do { for (r = r.parentNode, o = n ? ((i = r.cloneNode(!1)).appendChild(n), n = i, (i = r.cloneNode(!1)).appendChild(o), i) : (n = r.cloneNode(!1)).cloneNode(!1); i = a.previousSibling;)n.insertBefore(i, n.firstChild); for (; i = a.nextSibling;)o.appendChild(i); a = r } while (t !== r); return (i = t.parentNode).insertBefore(n, t), i.insertBefore(o, t), i.insertBefore(e, o), domUtils.remove(t), e }, isEmptyInlineElement: function (e) { if (1 != e.nodeType || !dtd.$removeEmpty[e.tagName]) return 0; for (e = e.firstChild; e;) { if (domUtils.isBookmarkNode(e)) return 0; if (1 == e.nodeType && !domUtils.isEmptyInlineElement(e) || 3 == e.nodeType && !domUtils.isWhitespace(e)) return 0; e = e.nextSibling } return 1 }, trimWhiteTextNode: function (i) { function e (e) { for (var t; (t = i[e]) && 3 == t.nodeType && domUtils.isWhitespace(t);)i.removeChild(t) } e("firstChild"), e("lastChild") }, mergeChild: function (e, t, i) { for (var n, o = domUtils.getElementsByTagName(e, e.tagName.toLowerCase()), r = 0; n = o[r++];)if (n.parentNode && !domUtils.isBookmarkNode(n)) if ("span" != n.tagName.toLowerCase()) domUtils.isSameElement(e, n) && domUtils.remove(n, !0); else { if (e === n.parentNode && (domUtils.trimWhiteTextNode(e), 1 == e.childNodes.length)) { e.style.cssText = n.style.cssText + ";" + e.style.cssText, domUtils.remove(n, !0); continue } if (n.style.cssText = e.style.cssText + ";" + n.style.cssText, i) { var a = i.style; if (a) { a = a.split(";"); for (var s, l = 0; s = a[l++];)n.style[utils.cssStyleToDomStyle(s.split(":")[0])] = s.split(":")[1] } } domUtils.isSameStyle(n, e) && domUtils.remove(n, !0) } }, getElementsByTagName: function (e, t, i) { if (i && utils.isString(i)) { var n = i; i = function (e) { return domUtils.hasClass(e, n) } } t = utils.trim(t).replace(/[ ]{2,}/g, " ").split(" "); for (var o, r = [], a = 0; o = t[a++];)for (var s, l = e.getElementsByTagName(o), d = 0; s = l[d++];)i && !i(s) || r.push(s); return r }, mergeToParent: function (e) { for (var t = e.parentNode; t && dtd.$removeEmpty[t.tagName];) { if (t.tagName == e.tagName || "A" == t.tagName) { if (domUtils.trimWhiteTextNode(t), "SPAN" == t.tagName && !domUtils.isSameStyle(t, e) || "A" == t.tagName && "SPAN" == e.tagName) { if (1 < t.childNodes.length || t !== e.parentNode) { e.style.cssText = t.style.cssText + ";" + e.style.cssText, t = t.parentNode; continue } t.style.cssText += ";" + e.style.cssText, "A" == t.tagName && (t.style.textDecoration = "underline") } if ("A" != t.tagName) { t === e.parentNode && domUtils.remove(e, !0); break } } t = t.parentNode } }, mergeSibling: function (e, t, i) { function n (e, t, i) { var n; if ((n = i[e]) && !domUtils.isBookmarkNode(n) && 1 == n.nodeType && domUtils.isSameElement(i, n)) { for (; n.firstChild;)"firstChild" == t ? i.insertBefore(n.lastChild, i.firstChild) : i.appendChild(n.firstChild); domUtils.remove(n) } } t || n("previousSibling", "firstChild", e), i || n("nextSibling", "lastChild", e) }, unSelectable: ie && browser.ie9below || browser.opera ? function (e) { e.onselectstart = function () { return !1 }, e.onclick = e.onkeyup = e.onkeydown = function () { return !1 }, e.unselectable = "on", e.setAttribute("unselectable", "on"); for (var t, i = 0; t = e.all[i++];)switch (t.tagName.toLowerCase()) { case "iframe": case "textarea": case "input": case "select": break; default: t.unselectable = "on", e.setAttribute("unselectable", "on") } } : function (e) { e.style.MozUserSelect = e.style.webkitUserSelect = e.style.msUserSelect = e.style.KhtmlUserSelect = "none" }, removeAttributes: function (e, t) { t = utils.isArray(t) ? t : utils.trim(t).replace(/[ ]{2,}/g, " ").split(" "); for (var i, n = 0; i = t[n++];) { switch (i = attrFix[i] || i) { case "className": e[i] = ""; break; case "style": e.style.cssText = ""; var o = e.getAttributeNode("style"); !browser.ie && o && e.removeAttributeNode(o) }e.removeAttribute(i) } }, createElement: function (e, t, i) { return domUtils.setAttributes(e.createElement(t), i) }, setAttributes: function (e, t) { for (var i in t) if (t.hasOwnProperty(i)) { var n = t[i]; switch (i) { case "class": e.className = n; break; case "style": e.style.cssText = e.style.cssText + ";" + n; break; case "innerHTML": e[i] = n; break; case "value": e.value = n; break; default: e.setAttribute(attrFix[i] || i, n) } } return e }, getComputedStyle: function (e, t) { if (-1 < "width height top left".indexOf(t)) return e["offset" + t.replace(/^\w/, function (e) { return e.toUpperCase() })] + "px"; if (3 == e.nodeType && (e = e.parentNode), browser.ie && browser.version < 9 && "font-size" == t && !e.style.fontSize && !dtd.$empty[e.tagName] && !dtd.$nonChild[e.tagName]) { var i = e.ownerDocument.createElement("span"); i.style.cssText = "padding:0;border:0;font-family:simsun;", i.innerHTML = ".", e.appendChild(i); var n = i.offsetHeight; return e.removeChild(i), i = null, n + "px" } try { var o = domUtils.getStyle(e, t) || (window.getComputedStyle ? domUtils.getWindow(e).getComputedStyle(e, "").getPropertyValue(t) : (e.currentStyle || e.style)[utils.cssStyleToDomStyle(t)]) } catch (e) { return "" } return utils.transUnitToPx(utils.fixColor(t, o)) }, removeClasses: function (e, t) { t = utils.isArray(t) ? t : utils.trim(t).replace(/[ ]{2,}/g, " ").split(" "); for (var i, n = 0, o = e.className; i = t[n++];)o = o.replace(new RegExp("\\b" + i + "\\b"), ""); (o = utils.trim(o).replace(/[ ]{2,}/g, " ")) ? e.className = o : domUtils.removeAttributes(e, ["class"]) }, addClass: function (e, t) { if (e) { t = utils.trim(t).replace(/[ ]{2,}/g, " ").split(" "); for (var i, n = 0, o = e.className; i = t[n++];)new RegExp("\\b" + i + "\\b").test(o) || (o += " " + i); e.className = utils.trim(o) } }, hasClass: function (e, t) { if (utils.isRegExp(t)) return t.test(e.className); t = utils.trim(t).replace(/[ ]{2,}/g, " ").split(" "); for (var i, n = 0, o = e.className; i = t[n++];)if (!new RegExp("\\b" + i + "\\b", "i").test(o)) return !1; return n - 1 == t.length }, preventDefault: function (e) { e.preventDefault ? e.preventDefault() : e.returnValue = !1 }, removeStyle: function (e, t) { browser.ie ? ("color" == t && (t = "(^|;)" + t), e.style.cssText = e.style.cssText.replace(new RegExp(t + "[^:]*:[^;]+;?", "ig"), "")) : e.style.removeProperty ? e.style.removeProperty(t) : e.style.removeAttribute(utils.cssStyleToDomStyle(t)), e.style.cssText || domUtils.removeAttributes(e, ["style"]) }, getStyle: function (e, t) { var i = e.style[utils.cssStyleToDomStyle(t)]; return utils.fixColor(t, i) }, setStyle: function (e, t, i) { e.style[utils.cssStyleToDomStyle(t)] = i, utils.trim(e.style.cssText) || this.removeAttributes(e, "style") }, setStyles: function (e, t) { for (var i in t) t.hasOwnProperty(i) && domUtils.setStyle(e, i, t[i]) }, removeDirtyAttr: function (e) { for (var t, i = 0, n = e.getElementsByTagName("*"); t = n[i++];)t.removeAttribute("_moz_dirty"); e.removeAttribute("_moz_dirty") }, getChildCount: function (e, t) { var i = 0, n = e.firstChild; for (t = t || function () { return 1 }; n;)t(n) && i++, n = n.nextSibling; return i }, isEmptyNode: function (e) { return !e.firstChild || 0 == domUtils.getChildCount(e, function (e) { return !domUtils.isBr(e) && !domUtils.isBookmarkNode(e) && !domUtils.isWhitespace(e) }) }, clearSelectedArr: function (e) { for (var t; t = e.pop();)domUtils.removeAttributes(t, ["class"]) }, scrollToView: function (e, t, i) { var n, o, r = (n = t.document, (o = "CSS1Compat" == n.compatMode) ? n.documentElement.clientWidth : n.body.clientWidth, (o ? n.documentElement.clientHeight : n.body.clientHeight) || 0), a = -1 * r + i; a += e.offsetHeight || 0, a += domUtils.getXY(e).y; var s = function (e) { if ("pageXOffset" in e) return { x: e.pageXOffset || 0, y: e.pageYOffset || 0 }; var t = e.document; return { x: t.documentElement.scrollLeft || t.body.scrollLeft || 0, y: t.documentElement.scrollTop || t.body.scrollTop || 0 } }(t).y; (s < a || a < s - r) && t.scrollTo(0, a + (a < 0 ? -20 : 20)) }, isBr: function (e) { return 1 == e.nodeType && "BR" == e.tagName }, isFillChar: function (e, t) { if (3 != e.nodeType) return !1; var i = e.nodeValue; return t ? new RegExp("^" + domUtils.fillChar).test(i) : !i.replace(new RegExp(domUtils.fillChar, "g"), "").length }, isStartInblock: function (e) { var t, i = e.cloneRange(), n = 0, o = i.startContainer; if (1 == o.nodeType && o.childNodes[i.startOffset]) for (var r = (o = o.childNodes[i.startOffset]).previousSibling; r && domUtils.isFillChar(r);)r = (o = r).previousSibling; for (this.isFillChar(o, !0) && 1 == i.startOffset && (i.setStartBefore(o), o = i.startContainer); o && domUtils.isFillChar(o);)o = (t = o).previousSibling; for (t && (i.setStartBefore(t), o = i.startContainer), 1 == o.nodeType && domUtils.isEmptyNode(o) && 1 == i.startOffset && i.setStart(o, 0).collapse(!0); !i.startOffset;) { if (o = i.startContainer, domUtils.isBlockElm(o) || domUtils.isBody(o)) { n = 1; break } var a; if (r = i.startContainer.previousSibling) { for (; r && domUtils.isFillChar(r);)r = (a = r).previousSibling; a ? i.setStartBefore(a) : i.setStartBefore(i.startContainer) } else i.setStartBefore(i.startContainer) } return n && !domUtils.isBody(i.startContainer) ? 1 : 0 }, isEmptyBlock: function (e, t) { if (1 != e.nodeType) return 0; if (t = t || new RegExp("[ \t\r\n" + domUtils.fillChar + "]", "g"), 0 < e[browser.ie ? "innerText" : "textContent"].replace(t, "").length) return 0; for (var i in dtd.$isNotEmpty) if (e.getElementsByTagName(i).length) return 0; return 1 }, setViewportOffset: function (e, t) { var i = 0 | parseInt(e.style.left), n = 0 | parseInt(e.style.top), o = e.getBoundingClientRect(), r = t.left - o.left, a = t.top - o.top; r && (e.style.left = i + r + "px"), a && (e.style.top = n + a + "px") }, fillNode: function (e, t) { var i = browser.ie ? e.createTextNode(domUtils.fillChar) : e.createElement("br"); t.innerHTML = "", t.appendChild(i) }, moveChild: function (e, t, i) { for (; e.firstChild;)i && t.firstChild ? t.insertBefore(e.lastChild, t.firstChild) : t.appendChild(e.firstChild) }, hasNoAttributes: function (e) { return browser.ie ? /^<\w+\s*?>/.test(e.outerHTML) : 0 == e.attributes.length }, isCustomeNode: function (e) { return 1 == e.nodeType && e.getAttribute("_ue_custom_node_") }, isTagNode: function (e, t) { return 1 == e.nodeType && new RegExp("\\b" + e.tagName + "\\b", "i").test(t) }, filterNodeList: function (e, t, i) { var n = []; if (!utils.isFunction(t)) { var o = t; t = function (e) { return -1 != utils.indexOf(utils.isArray(o) ? o : o.split(" "), e.tagName.toLowerCase()) } } return utils.each(e, function (e) { t(e) && n.push(e) }), 0 == n.length ? null : 1 != n.length && i ? n : n[0] }, isInNodeEndBoundary: function (e, t) { var i = e.startContainer; if (3 == i.nodeType && e.startOffset != i.nodeValue.length) return 0; if (1 == i.nodeType && e.startOffset != i.childNodes.length) return 0; for (; i !== t;) { if (i.nextSibling) return 0; i = i.parentNode } return 1 }, isBoundaryNode: function (e, t) { for (; !domUtils.isBody(e);)if (e !== (e = e.parentNode)[t]) return !1; return !0 }, fillHtml: browser.ie11below ? " " : "
" }, fillCharReg = new RegExp(domUtils.fillChar, "g"), si, qi, ri, xi; function ui (e) { return !e.collapsed && 1 == e.startContainer.nodeType && e.startContainer === e.endContainer && e.endOffset - e.startOffset == 1 } function vi (e, t, i, n) { var o; return 1 == t.nodeType && (dtd.$empty[t.tagName] || dtd.$nonChild[t.tagName]) && (i = domUtils.getNodeIndex(t) + (e ? 0 : 1), t = t.parentNode), e ? (n.startContainer = t, n.startOffset = i, n.endContainer || n.collapse(!0)) : (n.endContainer = t, n.endOffset = i, n.startContainer || n.collapse(!1)), (o = n).collapsed = o.startContainer && o.endContainer && o.startContainer === o.endContainer && o.startOffset == o.endOffset, n } function wi (e, t) { var i, n, o = e.startContainer, r = e.endContainer, a = e.startOffset, s = e.endOffset, l = e.document, d = l.createDocumentFragment(); if (1 == o.nodeType && (o = o.childNodes[a] || (i = o.appendChild(l.createTextNode("")))), 1 == r.nodeType && (r = r.childNodes[s] || (n = r.appendChild(l.createTextNode("")))), o === r && 3 == o.nodeType) return d.appendChild(l.createTextNode(o.substringData(a, s - a))), t && (o.deleteData(a, s - a), e.collapse(!0)), d; for (var c, u, m = d, f = domUtils.findParents(o, !0), h = domUtils.findParents(r, !0), p = 0; f[p] == h[p];)p++; for (var g, b = p; g = f[b]; b++) { for (c = g.nextSibling, g == o ? i || (3 == e.startContainer.nodeType ? (m.appendChild(l.createTextNode(o.nodeValue.slice(a))), t && o.deleteData(a, o.nodeValue.length - a)) : m.appendChild(t ? o : o.cloneNode(!0))) : (u = g.cloneNode(!1), m.appendChild(u)); c && c !== r && c !== h[b];)g = c.nextSibling, m.appendChild(t ? c : c.cloneNode(!0)), c = g; m = u } m = d, f[p] || (m.appendChild(f[p - 1].cloneNode(!1)), m = m.firstChild); var v; for (b = p; v = h[b]; b++) { if (c = v.previousSibling, v == r ? n || 3 != e.endContainer.nodeType || (m.appendChild(l.createTextNode(r.substringData(0, s))), t && r.deleteData(0, s)) : (u = v.cloneNode(!1), m.appendChild(u)), b != p || !f[p]) for (; c && c !== o;)v = c.previousSibling, m.insertBefore(t ? c : c.cloneNode(!0), m.firstChild), c = v; m = u } return t && e.setStartBefore(h[p] ? f[p] ? h[p] : f[p - 1] : h[p - 1]).collapse(!0), i && domUtils.remove(i), n && domUtils.remove(n), d } function yi (e, t) { try { if (si && domUtils.inDoc(si, e)) if (si.nodeValue.replace(fillCharReg, "").length) si.nodeValue = si.nodeValue.replace(fillCharReg, ""); else { var i = si.parentNode; for (domUtils.remove(si); i && domUtils.isEmptyInlineElement(i) && (browser.safari ? !(domUtils.getPosition(i, t) & domUtils.POSITION_CONTAINS) : !i.contains(t));)si = i.parentNode, domUtils.remove(i), i = si } } catch (e) { } } function zi (e, t) { var i; for (e = e[t]; e && domUtils.isFillChar(e);)i = e[t], domUtils.remove(e), e = i } function im (e, t) { var i = domUtils.getNodeIndex; (e = e.duplicate()).collapse(t); var n = e.parentElement(); if (!n.hasChildNodes()) return { container: n, offset: 0 }; for (var o, r, a = n.children, s = e.duplicate(), l = 0, d = a.length - 1, c = -1; l <= d;) { o = a[c = Math.floor((l + d) / 2)], s.moveToElementText(o); var u = s.compareEndPoints("StartToStart", e); if (0 < u) d = c - 1; else { if (!(u < 0)) return { container: n, offset: i(o) }; l = c + 1 } } if (-1 == c) { if (s.moveToElementText(n), s.setEndPoint("StartToStart", e), r = s.text.replace(/(\r\n|\r)/g, "\n").length, a = n.childNodes, !r) return { container: o = a[a.length - 1], offset: o.nodeValue.length }; for (var m = a.length; 0 < r;)r -= a[--m].nodeValue.length; return { container: a[m], offset: -r } } if (s.collapse(0 < u), s.setEndPoint(0 < u ? "StartToStart" : "EndToStart", e), !(r = s.text.replace(/(\r\n|\r)/g, "\n").length)) return dtd.$empty[o.tagName] || dtd.$nonChild[o.tagName] ? { container: n, offset: i(o) + (0 < u ? 0 : 1) } : { container: o, offset: 0 < u ? 0 : o.childNodes.length }; for (; 0 < r;)try { var f = o; r -= (o = o[0 < u ? "previousSibling" : "nextSibling"]).nodeValue.length } catch (e) { return { container: n, offset: i(f) } } return { container: o, offset: 0 < u ? -r : o.nodeValue.length + r } } function km (e) { var t; try { t = e.getNative().createRange() } catch (e) { return null } var i = t.item ? t.item(0) : t.parentElement(); return (i.ownerDocument || i) === e.document ? t : null } qi = 0, ri = domUtils.fillChar, xi = dom.Range = function (e) { var t = this; t.startContainer = t.startOffset = t.endContainer = t.endOffset = null, t.document = e, t.collapsed = !0 }, xi.prototype = { cloneContents: function () { return this.collapsed ? null : wi(this, 0) }, deleteContents: function () { var e; return this.collapsed || wi(this, 1), browser.webkit && (3 != (e = this.startContainer).nodeType || e.nodeValue.length || (this.setStartBefore(e).collapse(!0), domUtils.remove(e))), this }, extractContents: function () { return this.collapsed ? null : wi(this, 2) }, setStart: function (e, t) { return vi(!0, e, t, this) }, setEnd: function (e, t) { return vi(!1, e, t, this) }, setStartAfter: function (e) { return this.setStart(e.parentNode, domUtils.getNodeIndex(e) + 1) }, setStartBefore: function (e) { return this.setStart(e.parentNode, domUtils.getNodeIndex(e)) }, setEndAfter: function (e) { return this.setEnd(e.parentNode, domUtils.getNodeIndex(e) + 1) }, setEndBefore: function (e) { return this.setEnd(e.parentNode, domUtils.getNodeIndex(e)) }, setStartAtFirst: function (e) { return this.setStart(e, 0) }, setStartAtLast: function (e) { return this.setStart(e, 3 == e.nodeType ? e.nodeValue.length : e.childNodes.length) }, setEndAtFirst: function (e) { return this.setEnd(e, 0) }, setEndAtLast: function (e) { return this.setEnd(e, 3 == e.nodeType ? e.nodeValue.length : e.childNodes.length) }, selectNode: function (e) { return this.setStartBefore(e).setEndAfter(e) }, selectNodeContents: function (e) { return this.setStart(e, 0).setEndAtLast(e) }, cloneRange: function () { var e = this; return new xi(e.document).setStart(e.startContainer, e.startOffset).setEnd(e.endContainer, e.endOffset) }, collapse: function (e) { var t = this; return e ? (t.endContainer = t.startContainer, t.endOffset = t.startOffset) : (t.startContainer = t.endContainer, t.startOffset = t.endOffset), t.collapsed = !0, t }, shrinkBoundary: function (e) { var t, i = this, n = i.collapsed; function o (e) { return 1 == e.nodeType && !domUtils.isBookmarkNode(e) && !dtd.$empty[e.tagName] && !dtd.$nonChild[e.tagName] } for (; 1 == i.startContainer.nodeType && (t = i.startContainer.childNodes[i.startOffset]) && o(t);)i.setStart(t, 0); if (n) return i.collapse(!0); if (!e) for (; 1 == i.endContainer.nodeType && 0 < i.endOffset && (t = i.endContainer.childNodes[i.endOffset - 1]) && o(t);)i.setEnd(t, t.childNodes.length); return i }, getCommonAncestor: function (e, t) { var i = this.startContainer, n = this.endContainer; return i === n ? (!e || !ui(this) || 1 != (i = i.childNodes[this.startOffset]).nodeType) && t && 3 == i.nodeType ? i.parentNode : i : domUtils.getCommonAncestor(i, n) }, trimBoundary: function (e) { this.txtToElmBoundary(); var t = this.startContainer, i = this.startOffset, n = this.collapsed, o = this.endContainer; if (3 == t.nodeType) { if (0 == i) this.setStartBefore(t); else if (i >= t.nodeValue.length) this.setStartAfter(t); else { var r = domUtils.split(t, i); t === o ? this.setEnd(r, this.endOffset - i) : t.parentNode === o && (this.endOffset += 1), this.setStartBefore(r) } if (n) return this.collapse(!0) } return e || (i = this.endOffset, 3 == (o = this.endContainer).nodeType && (0 == i ? this.setEndBefore(o) : (i < o.nodeValue.length && domUtils.split(o, i), this.setEndAfter(o)))), this }, txtToElmBoundary: function (e) { function t (e, t) { var i = e[t + "Container"], n = e[t + "Offset"]; 3 == i.nodeType && (n ? n >= i.nodeValue.length && e["set" + t.replace(/(\w)/, function (e) { return e.toUpperCase() }) + "After"](i) : e["set" + t.replace(/(\w)/, function (e) { return e.toUpperCase() }) + "Before"](i)) } return !e && this.collapsed || (t(this, "start"), t(this, "end")), this }, insertNode: function (e) { var t = e, i = 1; 11 == e.nodeType && (t = e.firstChild, i = e.childNodes.length), this.trimBoundary(!0); var n = this.startContainer, o = this.startOffset, r = n.childNodes[o]; return r ? n.insertBefore(e, r) : n.appendChild(e), t.parentNode === this.endContainer && (this.endOffset = this.endOffset + i), this.setStartBefore(t) }, setCursor: function (e, t) { return this.collapse(!e).select(t) }, createBookmark: function (e, t) { var i, n = this.document.createElement("span"); return n.style.cssText = "display:none;line-height:0px;", n.appendChild(this.document.createTextNode("")), n.id = "_baidu_bookmark_start_" + (t ? "" : qi++), this.collapsed || ((i = n.cloneNode(!0)).id = "_baidu_bookmark_end_" + (t ? "" : qi++)), this.insertNode(n), i && this.collapse().insertNode(i).setEndBefore(i), this.setStartAfter(n), { start: e ? n.id : n, end: i ? e ? i.id : i : null, id: e } }, moveToBookmark: function (e) { var t = e.id ? this.document.getElementById(e.start) : e.start, i = e.end && e.id ? this.document.getElementById(e.end) : e.end; return this.setStartBefore(t), domUtils.remove(t), i ? (this.setEndBefore(i), domUtils.remove(i)) : this.collapse(!0), this }, enlarge: function (e, t) { var i, n, o = domUtils.isBody, r = this.document.createTextNode(""); if (e) { for (i = 1 == (n = this.startContainer).nodeType ? n = n.childNodes[this.startOffset] ? n.childNodes[this.startOffset] : (n.appendChild(r), r) : n; ;) { if (domUtils.isBlockElm(n)) { for (n = i; (i = n.previousSibling) && !domUtils.isBlockElm(i);)n = i; this.setStartBefore(n); break } n = (i = n).parentNode } for (i = 1 == (n = this.endContainer).nodeType ? ((i = n.childNodes[this.endOffset]) ? n.insertBefore(r, i) : n.appendChild(r), n = r) : n; ;) { if (domUtils.isBlockElm(n)) { for (n = i; (i = n.nextSibling) && !domUtils.isBlockElm(i);)n = i; this.setEndAfter(n); break } n = (i = n).parentNode } r.parentNode === this.endContainer && this.endOffset--, domUtils.remove(r) } if (!this.collapsed) { for (; !(0 != this.startOffset || t && t(this.startContainer) || o(this.startContainer));)this.setStartBefore(this.startContainer); for (; !(this.endOffset != (1 == this.endContainer.nodeType ? this.endContainer.childNodes.length : this.endContainer.nodeValue.length) || t && t(this.endContainer) || o(this.endContainer));)this.setEndAfter(this.endContainer) } return this }, enlargeToBlockElm: function (e) { for (; !domUtils.isBlockElm(this.startContainer);)this.setStartBefore(this.startContainer); if (!e) for (; !domUtils.isBlockElm(this.endContainer);)this.setEndAfter(this.endContainer); return this }, adjustmentBoundary: function () { if (!this.collapsed) { for (; !domUtils.isBody(this.startContainer) && this.startOffset == this.startContainer[3 == this.startContainer.nodeType ? "nodeValue" : "childNodes"].length && this.startContainer[3 == this.startContainer.nodeType ? "nodeValue" : "childNodes"].length;)this.setStartAfter(this.startContainer); for (; !domUtils.isBody(this.endContainer) && !this.endOffset && this.endContainer[3 == this.endContainer.nodeType ? "nodeValue" : "childNodes"].length;)this.setEndBefore(this.endContainer) } return this }, applyInlineStyle: function (t, e, i) { if (this.collapsed) return this; this.trimBoundary().enlarge(!1, function (e) { return 1 == e.nodeType && domUtils.isBlockElm(e) }).adjustmentBoundary(); function n (e) { return 1 == e.nodeType ? "br" != e.tagName.toLowerCase() : !domUtils.isWhitespace(e) } for (var o, r, a = this.createBookmark(), s = a.end, l = domUtils.getNextDomNode(a.start, !1, n), d = this.cloneRange(); l && domUtils.getPosition(l, s) & domUtils.POSITION_PRECEDING;)if (3 == l.nodeType || dtd[t][l.tagName]) { for (d.setStartBefore(l), o = l; o && (3 == o.nodeType || dtd[t][o.tagName]) && o !== s;)r = o, o = domUtils.getNextDomNode(o, 1 == o.nodeType, null, function (e) { return dtd[t][e.tagName] }); var c, u, m = d.setEndAfter(r).extractContents(); if (i && 0 < i.length) { var f, h; h = f = i[0].cloneNode(!1); for (var p, g = 1; p = i[g++];)f.appendChild(p.cloneNode(!1)), f = f.firstChild; c = f } else c = d.document.createElement(t); if (e && domUtils.setAttributes(c, e), c.appendChild(m), d.insertNode(i ? h : c), "span" == t && e.style && /text\-decoration/.test(e.style) && (u = domUtils.findParentByTagName(c, "a", !0)) ? (domUtils.setAttributes(u, e), domUtils.remove(c, !0), c = u) : (domUtils.mergeSibling(c), domUtils.clearEmptySibling(c)), domUtils.mergeChild(c, e), l = domUtils.getNextDomNode(c, !1, n), domUtils.mergeToParent(c), o === s) break } else l = domUtils.getNextDomNode(l, !0, n); return this.moveToBookmark(a) }, removeInlineStyle: function (e) { if (this.collapsed) return this; e = utils.isArray(e) ? e : [e], this.shrinkBoundary().adjustmentBoundary(); for (var t = this.startContainer, i = this.endContainer; ;) { if (1 == t.nodeType) { if (-1 < utils.indexOf(e, t.tagName.toLowerCase())) break; if ("body" == t.tagName.toLowerCase()) { t = null; break } } t = t.parentNode } for (; ;) { if (1 == i.nodeType) { if (-1 < utils.indexOf(e, i.tagName.toLowerCase())) break; if ("body" == i.tagName.toLowerCase()) { i = null; break } } i = i.parentNode } var n, o, r = this.createBookmark(); t && (n = (o = this.cloneRange().setEndBefore(r.start).setStartBefore(t)).extractContents(), o.insertNode(n), domUtils.clearEmptySibling(t, !0), t.parentNode.insertBefore(r.start, t)), i && (n = (o = this.cloneRange().setStartAfter(r.end).setEndAfter(i)).extractContents(), o.insertNode(n), domUtils.clearEmptySibling(i, !1, !0), i.parentNode.insertBefore(r.end, i.nextSibling)); for (var a, s = domUtils.getNextDomNode(r.start, !1, function (e) { return 1 == e.nodeType }); s && s !== r.end;)a = domUtils.getNextDomNode(s, !0, function (e) { return 1 == e.nodeType }), -1 < utils.indexOf(e, s.tagName.toLowerCase()) && domUtils.remove(s, !0), s = a; return this.moveToBookmark(r) }, getClosedNode: function () { var e; if (!this.collapsed) { var t = this.cloneRange().adjustmentBoundary().shrinkBoundary(); if (ui(t)) { var i = t.startContainer.childNodes[t.startOffset]; i && 1 == i.nodeType && (dtd.$empty[i.tagName] || dtd.$nonChild[i.tagName]) && (e = i) } } return e }, select: browser.ie ? function (e, t) { var i; this.collapsed || this.shrinkBoundary(); var n = this.getClosedNode(); if (n && !t) { try { (i = this.document.body.createControlRange()).addElement(n), i.select() } catch (e) { } return this } var o, r = this.createBookmark(), a = r.start; if ((i = this.document.body.createTextRange()).moveToElementText(a), i.moveStart("character", 1), this.collapsed) { if (!e && 3 != this.startContainer.nodeType) { var s = this.document.createTextNode(ri), l = this.document.createElement("span"); l.appendChild(this.document.createTextNode(ri)), a.parentNode.insertBefore(l, a), a.parentNode.insertBefore(s, a), yi(this.document, s), si = s, zi(l, "previousSibling"), zi(a, "nextSibling"), i.moveStart("character", -1), i.collapse(!0) } } else { var d = this.document.body.createTextRange(); o = r.end, d.moveToElementText(o), i.setEndPoint("EndToEnd", d) } this.moveToBookmark(r), l && domUtils.remove(l); try { i.select() } catch (e) { } return this } : function (e) { var t, n, i = domUtils.getWindow(this.document), o = i.getSelection(); if (browser.gecko ? this.document.body.focus() : i.focus(), o) { if (o.removeAllRanges(), this.collapsed && !e) { var r = this.startContainer, a = r; 1 == r.nodeType && (a = r.childNodes[this.startOffset]), 3 == r.nodeType && this.startOffset || (a ? a.previousSibling && 3 == a.previousSibling.nodeType : r.lastChild && 3 == r.lastChild.nodeType) || (t = this.document.createTextNode(ri), this.insertNode(t), yi(this.document, t), zi(t, "previousSibling"), zi(t, "nextSibling"), si = t, this.setStart(t, browser.webkit ? 1 : 0).collapse(!0)) } var s = this.document.createRange(); if (this.collapsed && browser.opera && 1 == this.startContainer.nodeType) if (a = this.startContainer.childNodes[this.startOffset]) { for (; a && domUtils.isBlockElm(a) && 1 == a.nodeType && a.childNodes[0];)a = a.childNodes[0]; a && this.setStartBefore(a).collapse(!0) } else (a = this.startContainer.lastChild) && domUtils.isBr(a) && this.setStartBefore(a).collapse(!0); l((n = this).startContainer, n.startOffset, "start"), l(n.endContainer, n.endOffset, "end"), s.setStart(this.startContainer, this.startOffset), s.setEnd(this.endContainer, this.endOffset), o.addRange(s) } function l (e, t, i) { 3 == e.nodeType && e.nodeValue.length < t && (n[i + "Offset"] = e.nodeValue.length) } return this }, scrollToView: function (e, t) { e = e ? window : domUtils.getWindow(this.document); var i = this.document.createElement("span"); return i.innerHTML = " ", this.cloneRange().insertNode(i), domUtils.scrollToView(i, e, t), domUtils.remove(i), this }, inFillChar: function () { var e = this.startContainer; return !(!this.collapsed || 3 != e.nodeType || e.nodeValue.replace(new RegExp("^" + domUtils.fillChar), "").length + 1 != e.nodeValue.length) }, createAddress: function (e, d) { var t = {}, c = this; function i (e) { for (var t, i = e ? c.startContainer : c.endContainer, n = domUtils.findParents(i, !0, function (e) { return !domUtils.isBody(e) }), o = [], r = 0; t = n[r++];)o.push(domUtils.getNodeIndex(t, d)); var a = 0; if (d) if (3 == i.nodeType) { for (var s = i.previousSibling; s && 3 == s.nodeType;)a += s.nodeValue.replace(fillCharReg, "").length, s = s.previousSibling; a += e ? c.startOffset : c.endOffset } else if (i = i.childNodes[e ? c.startOffset : c.endOffset]) a = domUtils.getNodeIndex(i, d); else for (var l = (i = e ? c.startContainer : c.endContainer).firstChild; l;)if (domUtils.isFillChar(l)) l = l.nextSibling; else if (a++, 3 == l.nodeType) for (; l && 3 == l.nodeType;)l = l.nextSibling; else l = l.nextSibling; else a = e ? domUtils.isFillChar(i) ? 0 : c.startOffset : c.endOffset; return a < 0 && (a = 0), o.push(a), o } return t.startAddress = i(!0), e || (t.endAddress = c.collapsed ? [].concat(t.startAddress) : i()), t }, moveToAddress: function (e, t) { var l = this; function i (e, t) { for (var i, n, o, r = l.document.body, a = 0, s = e.length; a < s; a++)if (o = e[a], !(r = (i = r).childNodes[o])) { n = o; break } t ? r ? l.setStartBefore(r) : l.setStart(i, n) : r ? l.setEndBefore(r) : l.setEnd(i, n) } return i(e.startAddress, !0), !t && e.endAddress && i(e.endAddress), l }, equals: function (e) { for (var t in this) if (this.hasOwnProperty(t) && this[t] !== e[t]) return !1; return !0 }, traversal: function (e, t) { if (this.collapsed) return this; for (var i = this.createBookmark(), n = i.end, o = domUtils.getNextDomNode(i.start, !1, t); o && o !== n && domUtils.getPosition(o, n) & domUtils.POSITION_PRECEDING;) { var r = domUtils.getNextDomNode(o, !1, t); e(o), o = r } return this.moveToBookmark(i) } }, (dom.Selection = function (e) { var t, i = this; i.document = e, browser.ie9below && (t = domUtils.getWindow(e).frameElement, domUtils.on(t, "beforedeactivate", function () { i._bakIERange = i.getIERange() }), domUtils.on(t, "activate", function () { try { !km(i) && i._bakIERange && i._bakIERange.select() } catch (e) { } i._bakIERange = null })), t = e = null }).prototype = { rangeInBody: function (e, t) { var i = browser.ie9below || t ? e.item ? e.item() : e.parentElement() : e.startContainer; return i === this.document.body || domUtils.inDoc(i, this.document) }, getNative: function () { var e = this.document; try { return e ? browser.ie9below ? e.selection : domUtils.getWindow(e).getSelection() : null } catch (e) { return null } }, getIERange: function () { var e = km(this); return !e && this._bakIERange ? this._bakIERange : e }, cache: function () { this.clear(), this._cachedRange = this.getRange(), this._cachedStartElement = this.getStart(), this._cachedStartElementPath = this.getStartElementPath() }, getStartElementPath: function () { if (this._cachedStartElementPath) return this._cachedStartElementPath; var e = this.getStart(); return e ? domUtils.findParents(e, !0, null, !0) : [] }, clear: function () { this._cachedStartElementPath = this._cachedRange = this._cachedStartElement = null }, isFocus: function () { try { if (browser.ie9below) { var e = km(this); return !(!e || !this.rangeInBody(e)) } return !!this.getNative().rangeCount } catch (e) { return !1 } }, getRange: function () { var n = this; function t (e) { for (var t = n.document.body.firstChild, i = e.collapsed; t && t.firstChild;)e.setStart(t, 0), t = t.firstChild; e.startContainer || e.setStart(n.document.body, 0), i && e.collapse(!0) } if (null != n._cachedRange) return this._cachedRange; var i = new baidu.editor.dom.Range(n.document); if (browser.ie9below) { var e = n.getIERange(); if (e) try { !function (e, t) { if (e.item) t.selectNode(e.item(0)); else { var i = im(e, !0); t.setStart(i.container, i.offset), 0 != e.compareEndPoints("StartToEnd", e) && (i = im(e, !1), t.setEnd(i.container, i.offset)) } }(e, i) } catch (e) { t(i) } else t(i) } else { var o = n.getNative(); if (o && o.rangeCount) { var r = o.getRangeAt(0), a = o.getRangeAt(o.rangeCount - 1); i.setStart(r.startContainer, r.startOffset).setEnd(a.endContainer, a.endOffset), i.collapsed && domUtils.isBody(i.startContainer) && !i.startOffset && t(i) } else { if (this._bakRange && domUtils.inDoc(this._bakRange.startContainer, this.document)) return this._bakRange; t(i) } } return this._bakRange = i }, getStart: function () { if (this._cachedStartElement) return this._cachedStartElement; var e, t, i, n, o = browser.ie9below ? this.getIERange() : this.getRange(); if (browser.ie9below) { if (!o) return this.document.body.firstChild; if (o.item) return o.item(0); for (0 < (e = o.duplicate()).text.length && e.moveStart("character", 1), e.collapse(1), t = e.parentElement(), n = i = o.parentElement(); i = i.parentNode;)if (i == t) { t = n; break } } else if (o.shrinkBoundary(), 1 == (t = o.startContainer).nodeType && t.hasChildNodes() && (t = t.childNodes[Math.min(t.childNodes.length - 1, o.startOffset)]), 3 == t.nodeType) return t.parentNode; return t }, getText: function () { var e, t; return this.isFocus() && (e = this.getNative()) ? (t = browser.ie9below ? e.createRange() : e.getRangeAt(0), browser.ie9below ? t.text : t.toString()) : "" }, clearRange: function () { this.getNative()[browser.ie9below ? "empty" : "removeAllRanges"]() } }, function () { var uid = 0, _selectionChangeTimer; function setValue (e, t) { var i; if (t.textarea) if (utils.isString(t.textarea)) { for (var n, o = 0, r = domUtils.getElementsByTagName(e, "textarea"); n = r[o++];)if (n.id == "ueditor_textarea_" + t.options.textarea) { i = n; break } } else i = t.textarea; i || (e.appendChild(i = domUtils.createElement(document, "textarea", { name: t.options.textarea, id: "ueditor_textarea_" + t.options.textarea, style: "display:none" })), t.textarea = i), i.getAttribute("name") || i.setAttribute("name", t.options.textarea), i.value = t.hasContents() ? t.options.allHtmlEnabled ? t.getAllHtml() : t.getContent(null, null, !0) : "" } function loadPlugins (e) { for (var t in UE.plugins) UE.plugins[t].call(e) } function checkCurLang (e) { for (var t in e) return t } function langReadied (e) { e.langIsReady = !0, e.fireEvent("langReady") } var Editor = UE.Editor = function (e) { var t = this; t.uid = uid++, EventBase.call(t), t.commands = {}, t.options = utils.extend(utils.clone(e || {}), UEDITOR_CONFIG, !0), t.shortcutkeys = {}, t.inputRules = [], t.outputRules = [], t.setOpt(Editor.defaultOptions(t)), t.loadServerConfig(), utils.isEmptyObject(UE.I18N) ? utils.loadFile(document, { src: t.options.langPath + t.options.lang + "/" + t.options.lang + ".js", tag: "script", type: "text/javascript", defer: "defer" }, function () { UE.plugin.load(t), langReadied(t) }) : (t.options.lang = checkCurLang(UE.I18N), UE.plugin.load(t), langReadied(t)), UE.instants["ueditorInstant" + t.uid] = t }; function Np () { var e = this; e.document.getElementById("initContent") && (e.body.innerHTML = '
' + (ie ? "" : "
") + "