text: webpackJsonphdjs([0],{505:function(e,t){!function(){function e(e,i){return n(e||self.document.URL||self.location.href,i||t())}function t(){var e=document.getElementsByTagName("script");return e[e.length-1].src}function n(e,t){var n=t;return/^(\/|\\\\)/.test(t)?n=/^.+?\w(\/|\\\\)/.exec(e)[0]+t.replace(/^(\/|\\\\)/,""):/^[a-z]+:/i.test(t)||(e=e.split("#")[0].split("?")[0].replace(/[^\\\/]+$/,""),n=e+""+t),i(n)}function i(e){var t=/^[a-z]+:\/\//.exec(e)[0],n=null,i=[];for(e=e.replace(t,"").split("?")[0].split("#")[0],e=e.replace(/\\/g,"/").split(/\//),e[e.length-1]="";e.length;)".."===(n=e.shift())?i.pop():"."!==n&&i.push(n);return t+i.join("/")}var o=window.UEDITOR_HOME_URL||e();window.UEDITOR_CONFIG={UEDITOR_HOME_URL:o,serverUrl:o+"php/controller.php",toolbars:[["fullscreen","source","|","undo","redo","|","bold","italic","underline","fontborder","strikethrough","superscript","subscript","removeformat","formatmatch","autotypeset","blockquote","pasteplain","|","forecolor","backcolor","insertorderedlist","insertunorderedlist","selectall","cleardoc","|","rowspacingtop","rowspacingbottom","lineheight","|","customstyle","paragraph","fontfamily","fontsize","|","directionalityltr","directionalityrtl","indent","|","justifyleft","justifycenter","justifyright","justifyjustify","|","touppercase","tolowercase","|","link","unlink","anchor","|","imagenone","imageleft","imageright","imagecenter","|","simpleupload","insertimage","hdimage","emotion","scrawl","insertvideo","music","attachment","map","gmap","insertframe","insertcode","webapp","pagebreak","template","background","|","horizontal","date","time","spechars","snapscreen","wordimage","|","inserttable","deletetable","insertparagraphbeforetable","insertrow","deleterow","insertcol","deletecol","mergecells","mergeright","mergedown","splittocells","splittorows","splittocols","charts","|","print","preview","searchreplace","help","drafts"]]},window.UE={getUEBasePath:e}}()},506:function(module,exports){var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};/*!
   * UEditor
   * version: ueditor
   * build: Wed Aug 10 2016 11:06:02 GMT+0800 (CST)
   */
  !function(){function getListener(e,t,n){var i;return t=t.toLowerCase(),(i=e.__allListeners||n&&(e.__allListeners={}))&&(i[t]||n&&(i[t]=[]))}function getDomNode(e,t,n,i,o,r){var a,s=i&&e[t];for(!s&&(s=e[n]);!s&&(a=(a||e).parentNode);){if("BODY"==a.tagName||r&&!r(a))return null;s=a[n]}return s&&o&&!o(s)?getDomNode(s,t,n,!1,o):s}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";var dom=UE.dom={},browser=UE.browser=function(){var e=navigator.userAgent.toLowerCase(),t=window.opera,n={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(e),opera:!!t&&t.version,webkit:e.indexOf(" applewebkit/")>-1,mac:e.indexOf("macintosh")>-1,quirks:"BackCompat"==document.compatMode};n.gecko="Gecko"==navigator.product&&!n.webkit&&!n.opera&&!n.ie;var i=0;if(n.ie){var o=e.match(/(?:msie\s([\w.]+))/),r=e.match(/(?:trident.*rv:([\w.]+))/);i=o&&r&&o[1]&&r[1]?Math.max(1*o[1],1*r[1]):o&&o[1]?1*o[1]:r&&r[1]?1*r[1]:0,n.ie11Compat=11==document.documentMode,n.ie9Compat=9==document.documentMode,n.ie8=!!document.documentMode,n.ie8Compat=8==document.documentMode,n.ie7Compat=7==i&&!document.documentMode||7==document.documentMode,n.ie6Compat=i<7||n.quirks,n.ie9above=i>8,n.ie9below=i<9,n.ie11above=i>10,n.ie11below=i<11}if(n.gecko){var a=e.match(/rv:([\d\.]+)/);a&&(a=a[1].split("."),i=1e4*a[0]+100*(a[1]||0)+1*(a[2]||0))}return/chrome\/(\d+\.\d)/i.test(e)&&(n.chrome=+RegExp.$1),/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(e)&&!/chrome/i.test(e)&&(n.safari=+(RegExp.$1||RegExp.$2)),n.opera&&(i=parseFloat(t.version())),n.webkit&&(i=parseFloat(e.match(/ applewebkit\/(\d+)/)[1])),n.version=i,n.isCompatible=!n.mobile&&(n.ie&&i>=6||n.gecko&&i>=10801||n.opera&&i>=9.5||n.air&&i>=1||n.webkit&&i>=522||!1),n}(),ie=browser.ie,webkit=browser.webkit,gecko=browser.gecko,opera=browser.opera,utils=UE.utils={each:function(e,t,n){if(null!=e)if(e.length===+e.length){for(var i=0,o=e.length;i<o;i++)if(!1===t.call(n,e[i],i,e))return!1}else for(var r in e)if(e.hasOwnProperty(r)&&!1===t.call(n,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,n){if(t)for(var i in t)n&&e.hasOwnProperty(i)||(e[i]=t[i]);return e},extend2:function(e){for(var t=arguments,n=1;n<t.length;n++){var i=t[n];for(var o in i)e.hasOwnProperty(o)||(e[o]=i[o])}return e},inherits:function(e,t){var n=e.prototype,i=utils.makeInstance(t.prototype);return utils.extend(i,n,!0),e.prototype=i,i.constructor=e},bind:function(e,t){return function(){return e.apply(t,arguments)}},defer:function(e,t,n){var i;return function(){n&&clearTimeout(i),i=setTimeout(e,t)}},indexOf:function(e,t,n){var i=-1;return n=this.isNumber(n)?n:0,this.each(e,function(e,o){if(o>=n&&e===t)return i=o,!1}),i},removeItem:function(e,t){for(var n=0,i=e.length;n<i;n++)e[n]===t&&(e.splice(n,1),n--)},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,n=0,i={};t=e[n++];)i[t.toUpperCase()]=i[t]=1;return i},unhtml:function(e,t){return e?e.replace(t||/[&<">'](?:(amp|lt|quot|gt|#39|nbsp|#\d+);)?/g,function(e,t){return t?e:{"<":"&lt;","&":"&amp;",'"':"&quot;",">":"&gt;","'":"&#39;"}[e]}):""},unhtmlForUrl:function(e,t){return e?e.replace(t||/[<">']/g,function(e){return{"<":"&lt;","&":"&amp;",'"':"&quot;",">":"&gt;","'":"&#39;"}[e]}):""},html:function(e){return e?e.replace(/&((g|l|quo)t|amp|#39|nbsp);/g,function(e){return{"&lt;":"<","&amp;":"&","&quot;":'"',"&gt;":">","&#39;":"'","&nbsp;":" "}[e]}):""},cssStyleToDomStyle:function(){var e=document.createElement("div").style,t={float:void 0!=e.cssFloat?"cssFloat":void 0!=e.styleFloat?"styleFloat":"float"};return function(e){return t[e]||(t[e]=e.toLowerCase().replace(/-./g,function(e){return e.charAt(1).toUpperCase()}))}}(),loadFile:function(){function e(e,n){try{for(var i,o=0;i=t[o++];)if(i.doc===e&&i.url==(n.src||n.href))return i}catch(e){return null}}var t=[];return function(n,i,o){var r=e(n,i);if(r)return void(r.ready?o&&o():r.funs.push(o));if(t.push({doc:n,url:i.src||i.href,funs:[o]}),!n.body){var a=[];for(var s in i)"tag"!=s&&a.push(s+'="'+i[s]+'"');return void n.write("<"+i.tag+" "+a.join(" ")+" ></"+i.tag+">")}if(!i.id||!n.getElementById(i.id)){var l=n.createElement(i.tag);delete i.tag;for(var s in i)l.setAttribute(s,i[s]);l.onload=l.onreadystatechange=function(){if(!this.readyState||/loaded|complete/.test(this.readyState)){if(r=e(n,i),r.funs.length>0){r.ready=1;for(var t;t=r.funs.pop();)t()}l.onload=l.onreadystatechange=null}},l.onerror=function(){throw Error("The load "+(i.href||i.src)+" fails,check the url settings of file ueditor.config.js ")},n.getElementsByTagName("head")[0].appendChild(l)}}}(),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 n=t.split(",");if(n.length>3)return"";t="#";for(var i,o=0;i=n[o++];)i=parseInt(i.replace(/[^\d]/gi,""),10).toString(16),t+=1==i.length?"0"+i:i;t=t.toUpperCase()}return t},optCss:function(e){function t(e,t){if(!e)return"";var n=e.top,i=e.bottom,o=e.left,r=e.right,a="";if(n&&o&&i&&r)a+=";"+t+":"+(n==i&&i==o&&o==r?n:n==i&&o==r?n+" "+o:o==r?n+" "+o+" "+i:n+" "+r+" "+i+" "+o)+";";else for(var s in e)a+=";"+t+"-"+s+":"+e[s]+";";return a}var n,i;return e=e.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,function(e,t,o,r){if(1==r.split(" ").length)switch(t){case"padding":return!n&&(n={}),n[o]=r,"";case"margin":return!i&&(i={}),i[o]=r,"";case"border":return"initial"==r?"":e}return e}),e+=t(n,"padding")+t(i,"margin"),e.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 n;t=t||{};for(var i in e)e.hasOwnProperty(i)&&(n=e[i],"object"==(void 0===n?"undefined":_typeof(n))?(t[i]=utils.isArray(n)?[]:{},utils.clone(e[i],t[i])):t[i]=n);return t},transUnitToPx:function(e){if(!/(pt|cm)/.test(e))return e;var t;switch(e.replace(/([\d.]+)(\w+)/,function(n,i,o){e=i,t=o}),t){case"cm":e=25*parseFloat(e);break;case"pt":e=Math.round(96*parseFloat(e)/72)}return e+(e?"px":"")},domReady:function(){function e(e){e.isReady=!0;for(var n;n=t.pop();n());}var t=[];return function(n,i){i=i||window;var o=i.document;n&&t.push(n),"complete"===o.readyState?e(o):(o.isReady&&e(o),browser.ie&&11!=browser.version?(!function(){if(!o.isReady){try{o.documentElement.doScroll("left")}catch(e){return void setTimeout(arguments.callee,0)}e(o)}}(),i.attachEvent("onload",function(){e(o)})):(o.addEventListener("DOMContentLoaded",function(){o.removeEventListener("DOMContentLoaded",arguments.callee,!1),e(o)},!1),i.addEventListener("load",function(){e(o)},!1)))}}(),cssRule:browser.ie&&11!=browser.version?function(e,t,n){var i,o;if(void 0===t||t&&t.nodeType&&9==t.nodeType){if(n=t&&t.nodeType&&9==t.nodeType?t:n||document,i=n.indexList||(n.indexList={}),void 0!==(o=i[e]))return n.styleSheets[o].cssText}else{if(n=n||document,i=n.indexList||(n.indexList={}),o=i[e],""===t)return void 0!==o&&(n.styleSheets[o].cssText="",delete i[e],!0);void 0!==o?sheetStyle=n.styleSheets[o]:(sheetStyle=n.createStyleSheet("",o=n.styleSheets.length),i[e]=o),sheetStyle.cssText=t}}:function(e,t,n){var i;return void 0===t||t&&t.nodeType&&9==t.nodeType?(n=t&&t.nodeType&&9==t.nodeType?t:n||document,i=n.getElementById(e),i?i.innerHTML:void 0):(n=n||document,i=n.getElementById(e),""===t?!!i&&(i.parentNode.removeChild(i),!0):void(i?i.innerHTML=t:(i=n.createElement("style"),i.id=e,i.innerHTML=t,n.getElementsByTagName("head")[0].appendChild(i))))},sort:function(e,t){t=t||function(e,t){return e.localeCompare(t)};for(var n=0,i=e.length;n<i;n++)for(var o=n,r=e.length;o<r;o++)if(t(e[n],e[o])>0){var a=e[n];e[n]=e[o],e[o]=a}return e},serializeParam:function(e){var t=[];for(var n in e)if("method"!=n&&"timeout"!=n&&"async"!=n)if("function"!=_typeof(e[n]).toLowerCase()&&"object"!=_typeof(e[n]).toLowerCase())t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));else if(utils.isArray(e[n]))for(var i=0;i<e[n].length;i++)t.push(encodeURIComponent(n)+"[]="+encodeURIComponent(e[n][i]));return t.join("&")},formatUrl:function(e){var t=e.replace(/&&/g,"&");return t=t.replace(/\?&/g,"?"),t=t.replace(/&$/g,""),t=t.replace(/&#/g,"#"),t=t.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 e=function(e){return/["\\\x00-\x1f]/.test(e)&&(e=e.replace(/["\\\x00-\x1f]/g,function(e){var t=o[e];return t||(t=e.charCodeAt(),"\\u00"+Math.floor(t/16).toString(16)+(t%16).toString(16))})),'"'+e+'"'},t=function(e){var t,n,i,o=["["],r=e.length;for(n=0;n<r;n++)switch(i=e[n],void 0===i?"undefined":_typeof(i)){case"undefined":case"function":case"unknown":break;default:t&&o.push(","),o.push(utils.json2str(i)),t=1}return o.push("]"),o.join("")},n=function(e){return e<10?"0"+e:e},i=function(e){return'"'+e.getFullYear()+"-"+n(e.getMonth()+1)+"-"+n(e.getDate())+"T"+n(e.getHours())+":"+n(e.getMinutes())+":"+n(e.getSeconds())+'"'},o={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return function(n){switch(void 0===n?"undefined":_typeof(n)){case"undefined":return"undefined";case"number":return isFinite(n)?String(n):"null";case"string":return e(n);case"boolean":return String(n);default:if(null===n)return"null";if(utils.isArray(n))return t(n);if(utils.isDate(n))return i(n);var o,r,a=["{"],s=utils.json2str;for(var l in n)if(Object.prototype.hasOwnProperty.call(n,l))switch(r=n[l],void 0===r?"undefined":_typeof(r)){case"undefined":case"unknown":case"function":break;default:o&&a.push(","),o=1,a.push(s(l)+":"+s(r))}return a.push("}"),a.join("")}}}()};utils.each(["String","Function","Array","Number","RegExp","Object","Date"],function(e){UE.utils["is"+e]=function(t){return Object.prototype.toString.apply(t)=="[object "+e+"]"}});var EventBase=UE.EventBase=function(){};EventBase.prototype={addListener:function(e,t){e=utils.trim(e).split(/\s+/);for(var n,i=0;n=e[i++];)getListener(this,n,!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 n,i=0;n=e[i++];)utils.removeItem(getListener(this,n)||[],t)},fireEvent:function(){var e=arguments[0];e=utils.trim(e).split(" ");for(var t,n=0;t=e[n++];){var i,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&&(i=o)}(o=this["on"+t.toLowerCase()])&&(i=o.apply(this,arguments))}return i}};var dtd=dom.dtd=function(){function e(e){for(var t in e)e[t.toUpperCase()]=e[t];return e}var t=utils.extend2,n=e({isindex:1,fieldset:1}),i=e({input:1,button:1,select:1,textarea:1,label:1}),o=t(e({a:1}),i),r=t({iframe:1},o),a=e({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}),s=e({ins:1,del:1,script:1,style:1}),l=t(e({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}),s),d=t(e({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),l),c=t(e({p:1}),d),u=t(e({iframe:1}),d,i),m=e({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}),f=t(e({a:0}),u),h=e({tr:1}),p=e({"#":1}),g=t(e({param:1}),m),v=t(e({form:1}),n,r,a,c),b=e({li:1,ol:1,ul:1}),y=e({style:1,script:1}),C=e({base:1,link:1,meta:1,title:1}),x=t(C,y),w=e({head:1,body:1}),N=e({html:1}),U=e({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}),E=e({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});return e({$nonBodyContent:t(N,w,C),$block:U,$inline:f,$inlineWithA:t(e({a:1}),f),$body:t(e({script:1,style:1}),U),$cdata:e({script:1,style:1}),$empty:E,$nonChild:e({iframe:1,textarea:1}),$listItem:e({dd:1,dt:1,li:1}),$list:e({ul:1,ol:1,dl:1}),$isNotEmpty:e({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:e({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:e({p:1,div:1}),$tableContent:e({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,th:1,thead:1,tr:1,table:1}),$notTransContent:e({pre:1,script:1,style:1,textarea:1}),html:w,head:x,style:p,script:p,body:v,base:{},link:{},meta:{},title:p,col:{},tr:e({td:1,th:1}),img:{},embed:{},colgroup:e({thead:1,col:1,tbody:1,tr:1,tfoot:1}),noscript:v,td:v,br:{},th:v,center:v,kbd:f,button:t(c,a),basefont:{},h5:f,h4:f,samp:f,h6:f,ol:b,h1:f,h3:f,option:p,h2:f,form:t(n,r,a,c),select:e({optgroup:1,option:1}),font:f,ins:f,menu:b,abbr:f,label:f,table:e({thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,tfoot:1}),code:f,tfoot:h,cite:f,li:v,input:{},iframe:v,strong:f,textarea:p,noframes:v,big:f,small:f,span:e({"#":1,br:1,b:1,strong:1,u:1,i:1,em:1,sub:1,sup:1,strike:1,span:1}),hr:f,dt:f,sub:f,optgroup:e({option:1}),param:{},bdo:f,var:f,div:v,object:g,sup:f,dd:v,strike:f,area:{},dir:b,map:t(e({area:1,form:1,p:1}),n,s,a),applet:g,dl:e({dt:1,dd:1}),del:f,isindex:{},fieldset:t(e({legend:1}),m),thead:h,ul:b,acronym:f,b:f,a:t(e({a:1}),u),blockquote:t(e({td:1,tr:1,tbody:1,li:1}),v),caption:f,i:f,u:f,tbody:h,s:f,address:t(r,c),tt:f,legend:f,q:f,pre:t(l,o),p:t(e({a:1}),f),em:f,dfn:f})}(),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 n,i=[e],o=[t];for(n=e;n=n.parentNode;){if(n===t)return 10;i.push(n)}for(n=t;n=n.parentNode;){if(n===e)return 20;o.push(n)}if(i.reverse(),o.reverse(),i[0]!==o[0])return 1;for(var r=-1;r++,i[r]===o[r];);for(e=i[r],t=o[r];e=e.nextSibling;)if(e===t)return 4;return 2},getNodeIndex:function(e,t){for(var n=e,i=0;n=n.previousSibling;)t&&3==n.nodeType?n.nodeType!=n.nextSibling.nodeType&&i++:i++;return i},inDoc:function(e,t){return 10==domUtils.getPosition(e,t)},findParent:function(e,t,n){if(e&&!domUtils.isBody(e))for(e=n?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,n,i){return t=utils.listToMap(utils.isArray(t)?t:[t]),domUtils.findParent(e,function(e){return t[e.tagName]&&!(i&&i(e))},n)},findParents:function(e,t,n,i){for(var o=t&&(n&&n(e)||!n)?[e]:[];e=domUtils.findParent(e,n);)o.push(e);return i?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 n,i=e.parentNode;if(i){if(t&&e.hasChildNodes())for(;n=e.firstChild;)i.insertBefore(n,e);i.removeChild(e)}return e},getNextDomNode:function(e,t,n,i){return getDomNode(e,"firstChild","nextSibling",t,n,i)},getPreDomNode:function(e,t,n,i){return getDomNode(e,"lastChild","previousSibling",t,n,i)},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 n=[e],i=[t],o=e,r=-1;o=o.parentNode;){if(o===t)return o;n.push(o)}for(o=t;o=o.parentNode;){if(o===e)return o;i.push(o)}for(n.reverse(),i.reverse();r++,n[r]===i[r];);return 0==r?null:n[r-1]},clearEmptySibling:function(e,t,n){function i(e,t){for(var n;e&&!domUtils.isBookmarkNode(e)&&(domUtils.isEmptyInlineElement(e)||!new RegExp("[^\t\n\r"+domUtils.fillChar+"]").test(e.nodeValue));)n=e[t],domUtils.remove(e),e=n}!t&&i(e.nextSibling,"nextSibling"),!n&&i(e.previousSibling,"previousSibling")},split:function(e,t){var n=e.ownerDocument;if(browser.ie&&t==e.nodeValue.length){var i=n.createTextNode("");return domUtils.insertAfter(e,i)}var o=e.splitText(t);if(browser.ie8){var r=n.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,n=0;e.offsetParent;)n+=e.offsetTop,t+=e.offsetLeft,e=e.offsetParent;return{x:t,y:n}},on:function(e,t,n){var i=utils.isArray(t)?t:utils.trim(t).split(/\s+/),o=i.length;if(o)for(;o--;)if(t=i[o],e.addEventListener)e.addEventListener(t,n,!1);else{n._d||(n._d={els:[]});var r=t+n.toString(),a=utils.indexOf(n._d.els,e);n._d[r]&&-1!=a||(-1==a&&n._d.els.push(e),n._d[r]||(n._d[r]=function(e){return n.call(e.srcElement,e||window.event)}),e.attachEvent("on"+t,n._d[r]))}e=null},un:function(e,t,n){var i=utils.isArray(t)?t:utils.trim(t).split(/\s+/),o=i.length;if(o)for(;o--;)if(t=i[o],e.removeEventListener)e.removeEventListener(t,n,!1);else{var r=t+n.toString();try{e.detachEvent("on"+t,n._d?n._d[r]:n)}catch(e){}if(n._d&&n._d[r]){var a=utils.indexOf(n._d.els,e);-1!=a&&n._d.els.splice(a,1),0==n._d.els.length&&delete n._d[r]}}},isSameElement:function(e,t){if(e.tagName!=t.tagName)return!1;var n=e.attributes,i=t.attributes;if(!ie&&n.length!=i.length)return!1;for(var o,r,a=0,s=0,l=0;o=n[l++];){if("style"==o.nodeName){if(o.specified&&a++,domUtils.isSameStyle(e,t))continue;return!1}if(ie){if(!o.specified)continue;a++,r=i.getNamedItem(o.nodeName)}else r=t.attributes[o.nodeName];if(!r.specified||o.nodeValue!=r.nodeValue)return!1}if(ie){for(l=0;r=i[l++];)r.specified&&s++;if(a!=s)return!1}return!0},isSameStyle:function(e,t){var n=e.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":"),i=t.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":");if(browser.opera){if(n=e.style,i=t.style,n.length!=i.length)return!1;for(var o in n)if(!/^(\d+|csstext)$/i.test(o)&&n[o]!=i[o])return!1;return!0}if(!n||!i)return n==i;if(n=n.split(";"),i=i.split(";"),n.length!=i.length)return!1;for(var r,a=0;r=n[a++];)if(-1==utils.indexOf(i,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 n,i,o,r=e,a=e;do{for(r=r.parentNode,i?(n=r.cloneNode(!1),n.appendChild(i),i=n,n=r.cloneNode(!1),n.appendChild(o),o=n):(i=r.cloneNode(!1),o=i.cloneNode(!1));n=a.previousSibling;)i.insertBefore(n,i.firstChild);for(;n=a.nextSibling;)o.appendChild(n);a=r}while(t!==r);return n=t.parentNode,n.insertBefore(i,t),n.insertBefore(o,t),n.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(e){function t(t){for(var n;(n=e[t])&&3==n.nodeType&&domUtils.isWhitespace(n);)e.removeChild(n)}t("firstChild"),t("lastChild")},mergeChild:function(e,t,n){for(var i,o=domUtils.getElementsByTagName(e,e.tagName.toLowerCase()),r=0;i=o[r++];)if(i.parentNode&&!domUtils.isBookmarkNode(i))if("span"!=i.tagName.toLowerCase())domUtils.isSameElement(e,i)&&domUtils.remove(i,!0);else{if(e===i.parentNode&&(domUtils.trimWhiteTextNode(e),1==e.childNodes.length)){e.style.cssText=i.style.cssText+";"+e.style.cssText,domUtils.remove(i,!0);continue}if(i.style.cssText=e.style.cssText+";"+i.style.cssText,n){var a=n.style;if(a){a=a.split(";");for(var s,l=0;s=a[l++];)i.style[utils.cssStyleToDomStyle(s.split(":")[0])]=s.split(":")[1]}}domUtils.isSameStyle(i,e)&&domUtils.remove(i,!0)}},getElementsByTagName:function(e,t,n){if(n&&utils.isString(n)){var i=n;n=function(e){return domUtils.hasClass(e,i)}}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++];)n&&!n(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(t.childNodes.length>1||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,n){function i(e,t,n){var i;if((i=n[e])&&!domUtils.isBookmarkNode(i)&&1==i.nodeType&&domUtils.isSameElement(n,i)){for(;i.firstChild;)"firstChild"==t?n.insertBefore(i.lastChild,n.firstChild):n.appendChild(i.firstChild);domUtils.remove(i)}}!t&&i("previousSibling","firstChild",e),!n&&i("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,n=0;t=e.all[n++];)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 n,i=0;n=t[i++];){switch(n=attrFix[n]||n){case"className":e[n]="";break;case"style":e.style.cssText="";var o=e.getAttributeNode("style");!browser.ie&&o&&e.removeAttributeNode(o)}e.removeAttribute(n)}},createElement:function(e,t,n){return domUtils.setAttributes(e.createElement(t),n)},setAttributes:function(e,t){for(var n in t)if(t.hasOwnProperty(n)){var i=t[n];switch(n){case"class":e.className=i;break;case"style":e.style.cssText=e.style.cssText+";"+i;break;case"innerHTML":e[n]=i;break;case"value":e.value=i;break;default:e.setAttribute(attrFix[n]||n,i)}}return e},getComputedStyle:function(e,t){if("width height top left".indexOf(t)>-1)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 n=e.ownerDocument.createElement("span");n.style.cssText="padding:0;border:0;font-family:simsun;",n.innerHTML=".",e.appendChild(n);var i=n.offsetHeight;return e.removeChild(n),n=null,i+"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 n,i=0,o=e.className;n=t[i++];)o=o.replace(new RegExp("\\b"+n+"\\b"),"");o=utils.trim(o).replace(/[ ]{2,}/g," "),o?e.className=o:domUtils.removeAttributes(e,["class"])},addClass:function(e,t){if(e){t=utils.trim(t).replace(/[ ]{2,}/g," ").split(" ");for(var n,i=0,o=e.className;n=t[i++];)new RegExp("\\b"+n+"\\b").test(o)||(o+=" "+n);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 n,i=0,o=e.className;n=t[i++];)if(!new RegExp("\\b"+n+"\\b","i").test(o))return!1;return i-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 n=e.style[utils.cssStyleToDomStyle(t)];return utils.fixColor(t,n)},setStyle:function(e,t,n){e.style[utils.cssStyleToDomStyle(t)]=n,utils.trim(e.style.cssText)||this.removeAttributes(e,"style")},setStyles:function(e,t){for(var n in t)t.hasOwnProperty(n)&&domUtils.setStyle(e,n,t[n])},removeDirtyAttr:function(e){for(var t,n=0,i=e.getElementsByTagName("*");t=i[n++];)t.removeAttribute("_moz_dirty");e.removeAttribute("_moz_dirty")},getChildCount:function(e,t){var n=0,i=e.firstChild;for(t=t||function(){return 1};i;)t(i)&&n++,i=i.nextSibling;return n},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,n){var i=function(){var e=t.document,n="CSS1Compat"==e.compatMode;return{width:(n?e.documentElement.clientWidth:e.body.clientWidth)||0,height:(n?e.documentElement.clientHeight:e.body.clientHeight)||0}}().height,o=-1*i+n;o+=e.offsetHeight||0,o+=domUtils.getXY(e).y;var r=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;(o>r||o<r-i)&&t.scrollTo(0,o+(o<0?-20:20))},isBr:function(e){return 1==e.nodeType&&"BR"==e.tagName},isFillChar:function(e,t){if(3!=e.nodeType)return!1;var n=e.nodeValue;return t?new RegExp("^"+domUtils.fillChar).test(n):!n.replace(new RegExp(domUtils.fillChar,"g"),"").length},isStartInblock:function(e){var t,n=e.cloneRange(),i=0,o=n.startContainer;if(1==o.nodeType&&o.childNodes[n.startOffset]){o=o.childNodes[n.startOffset];for(var r=o.previousSibling;r&&domUtils.isFillChar(r);)o=r,r=r.previousSibling}for(this.isFillChar(o,!0)&&1==n.startOffset&&(n.setStartBefore(o),o=n.startContainer);o&&domUtils.isFillChar(o);)t=o,o=o.previousSibling;for(t&&(n.setStartBefore(t),o=n.startContainer),1==o.nodeType&&domUtils.isEmptyNode(o)&&1==n.startOffset&&n.setStart(o,0).collapse(!0);!n.startOffset;){if(o=n.startContainer,domUtils.isBlockElm(o)||domUtils.isBody(o)){i=1;break}var a,r=n.startContainer.previousSibling;if(r){for(;r&&domUtils.isFillChar(r);)a=r,r=r.previousSibling;a?n.setStartBefore(a):n.setStartBefore(n.startContainer)}else n.setStartBefore(n.startContainer)}return i&&!domUtils.isBody(n.startContainer)?1:0},isEmptyBlock:function(e,t){if(1!=e.nodeType)return 0;if(t=t||new RegExp("[  \t\r\n"+domUtils.fillChar+"]","g"),e[browser.ie?"innerText":"textContent"].replace(t,"").length>0)return 0;for(var n in dtd.$isNotEmpty)if(e.getElementsByTagName(n).length)return 0;return 1},setViewportOffset:function(e,t){var n=0|parseInt(e.style.left),i=0|parseInt(e.style.top),o=e.getBoundingClientRect(),r=t.left-o.left,a=t.top-o.top;r&&(e.style.left=n+r+"px"),a&&(e.style.top=i+a+"px")},fillNode:function(e,t){var n=browser.ie?e.createTextNode(domUtils.fillChar):e.createElement("br");t.innerHTML="",t.appendChild(n)},moveChild:function(e,t,n){for(;e.firstChild;)n&&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,n){var i=[];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)&&i.push(e)}),0==i.length?null:1!=i.length&&n?i:i[0]},isInNodeEndBoundary:function(e,t){var n=e.startContainer;if(3==n.nodeType&&e.startOffset!=n.nodeValue.length)return 0;if(1==n.nodeType&&e.startOffset!=n.childNodes.length)return 0;for(;n!==t;){if(n.nextSibling)return 0;n=n.parentNode}return 1},isBoundaryNode:function(e,t){for(var n;!domUtils.isBody(e);)if(n=e,e=e.parentNode,n!==e[t])return!1;return!0},fillHtml:browser.ie11below?"&nbsp;":"<br/>"},fillCharReg=new RegExp(domUtils.fillChar,"g");!function(){function e(e){e.collapsed=e.startContainer&&e.endContainer&&e.startContainer===e.endContainer&&e.startOffset==e.endOffset}function t(e){return!e.collapsed&&1==e.startContainer.nodeType&&e.startContainer===e.endContainer&&e.endOffset-e.startOffset==1}function n(t,n,i,o){return 1==n.nodeType&&(dtd.$empty[n.tagName]||dtd.$nonChild[n.tagName])&&(i=domUtils.getNodeIndex(n)+(t?0:1),n=n.parentNode),t?(o.startContainer=n,o.startOffset=i,o.endContainer||o.collapse(!0)):(o.endContainer=n,o.endOffset=i,o.startContainer||o.collapse(!1)),e(o),o}function i(e,t){var n,i,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]||(n=o.appendChild(l.createTextNode("")))),1==r.nodeType&&(r=r.childNodes[s]||(i=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,v=p;g=f[v];v++){for(c=g.nextSibling,g==o?n||(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[v];)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);for(var b,v=p;b=h[v];v++){if(c=b.previousSibling,b==r?i||3!=e.endContainer.nodeType||(m.appendChild(l.createTextNode(r.substringData(0,s))),t&&r.deleteData(0,s)):(u=b.cloneNode(!1),m.appendChild(u)),v!=p||!f[p])for(;c&&c!==o;)b=c.previousSibling,m.insertBefore(t?c:c.cloneNode(!0),m.firstChild),c=b;m=u}return t&&e.setStartBefore(h[p]?f[p]?h[p]:f[p-1]:h[p-1]).collapse(!0),n&&domUtils.remove(n),i&&domUtils.remove(i),d}function o(e,t){try{if(a&&domUtils.inDoc(a,e))if(a.nodeValue.replace(fillCharReg,"").length)a.nodeValue=a.nodeValue.replace(fillCharReg,"");else{var n=a.parentNode;for(domUtils.remove(a);n&&domUtils.isEmptyInlineElement(n)&&(browser.safari?!(domUtils.getPosition(n,t)&domUtils.POSITION_CONTAINS):!n.contains(t));)a=n.parentNode,domUtils.remove(n),n=a}}catch(e){}}function r(e,t){var n;for(e=e[t];e&&domUtils.isFillChar(e);)n=e[t],domUtils.remove(e),e=n}var a,s=0,l=domUtils.fillChar,d=dom.Range=function(e){var t=this;t.startContainer=t.startOffset=t.endContainer=t.endOffset=null,t.document=e,t.collapsed=!0};d.prototype={cloneContents:function(){return this.collapsed?null:i(this,0)},deleteContents:function(){var e;return this.collapsed||i(this,1),browser.webkit&&(e=this.startContainer,3!=e.nodeType||e.nodeValue.length||(this.setStartBefore(e).collapse(!0),domUtils.remove(e))),this},extractContents:function(){return this.collapsed?null:i(this,2)},setStart:function(e,t){return n(!0,e,t,this)},setEnd:function(e,t){return n(!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 d(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){function t(e){return 1==e.nodeType&&!domUtils.isBookmarkNode(e)&&!dtd.$empty[e.tagName]&&!dtd.$nonChild[e.tagName]}for(var n,i=this,o=i.collapsed;1==i.startContainer.nodeType&&(n=i.startContainer.childNodes[i.startOffset])&&t(n);)i.setStart(n,0);if(o)return i.collapse(!0);if(!e)for(;1==i.endContainer.nodeType&&i.endOffset>0&&(n=i.endContainer.childNodes[i.endOffset-1])&&t(n);)i.setEnd(n,n.childNodes.length);return i},getCommonAncestor:function(e,n){var i=this,o=i.startContainer,r=i.endContainer;return o===r?e&&t(this)&&(o=o.childNodes[i.startOffset],1==o.nodeType)?o:n&&3==o.nodeType?o.parentNode:o:domUtils.getCommonAncestor(o,r)},trimBoundary:function(e){this.txtToElmBoundary();var t=this.startContainer,n=this.startOffset,i=this.collapsed,o=this.endContainer;if(3==t.nodeType){if(0==n)this.setStartBefore(t);else if(n>=t.nodeValue.length)this.setStartAfter(t);else{var r=domUtils.split(t,n);t===o?this.setEnd(r,this.endOffset-n):t.parentNode===o&&(this.endOffset+=1),this.setStartBefore(r)}if(i)return this.collapse(!0)}return e||(n=this.endOffset,o=this.endContainer,3==o.nodeType&&(0==n?this.setEndBefore(o):(n<o.nodeValue.length&&domUtils.split(o,n),this.setEndAfter(o)))),this},txtToElmBoundary:function(e){function t(e,t){var n=e[t+"Container"],i=e[t+"Offset"];3==n.nodeType&&(i?i>=n.nodeValue.length&&e["set"+t.replace(/(\w)/,function(e){return e.toUpperCase()})+"After"](n):e["set"+t.replace(/(\w)/,function(e){return e.toUpperCase()})+"Before"](n))}return!e&&this.collapsed||(t(this,"start"),t(this,"end")),this},insertNode:function(e){var t=e,n=1;11==e.nodeType&&(t=e.firstChild,n=e.childNodes.length),this.trimBoundary(!0);var i=this.startContainer,o=this.startOffset,r=i.childNodes[o];return r?i.insertBefore(e,r):i.appendChild(e),t.parentNode===this.endContainer&&(this.endOffset=this.endOffset+n),this.setStartBefore(t)},setCursor:function(e,t){return this.collapse(!e).select(t)},createBookmark:function(e,t){var n,i=this.document.createElement("span");return i.style.cssText="display:none;line-height:0px;",i.appendChild(this.document.createTextNode("‍")),i.id="_baidu_bookmark_start_"+(t?"":s++),this.collapsed||(n=i.cloneNode(!0),n.id="_baidu_bookmark_end_"+(t?"":s++)),this.insertNode(i),n&&this.collapse().insertNode(n).setEndBefore(n),this.setStartAfter(i),{start:e?i.id:i,end:n?e?n.id:n:null,id:e}},moveToBookmark:function(e){var t=e.id?this.document.getElementById(e.start):e.start,n=e.end&&e.id?this.document.getElementById(e.end):e.end;return this.setStartBefore(t),domUtils.remove(t),n?(this.setEndBefore(n),domUtils.remove(n)):this.collapse(!0),this},enlarge:function(e,t){var n,i,o=domUtils.isBody,r=this.document.createTextNode("");if(e){for(i=this.startContainer,1==i.nodeType?i.childNodes[this.startOffset]?n=i=i.childNodes[this.startOffset]:(i.appendChild(r),n=i=r):n=i;;){if(domUtils.isBlockElm(i)){for(i=n;(n=i.previousSibling)&&!domUtils.isBlockElm(n);)i=n;this.setStartBefore(i);break}n=i,i=i.parentNode}for(i=this.endContainer,1==i.nodeType?((n=i.childNodes[this.endOffset])?i.insertBefore(r,n):i.appendChild(r),n=i=r):n=i;;){if(domUtils.isBlockElm(i)){for(i=n;(n=i.nextSibling)&&!domUtils.isBlockElm(n);)i=n;this.setEndAfter(i);break}n=i,i=i.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(e,t,n){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,function(e){return 1==e.nodeType&&domUtils.isBlockElm(e)}).adjustmentBoundary();for(var i,o,r=this.createBookmark(),a=r.end,s=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase():!domUtils.isWhitespace(e)},l=domUtils.getNextDomNode(r.start,!1,s),d=this.cloneRange();l&&domUtils.getPosition(l,a)&domUtils.POSITION_PRECEDING;)if(3==l.nodeType||dtd[e][l.tagName]){for(d.setStartBefore(l),i=l;i&&(3==i.nodeType||dtd[e][i.tagName])&&i!==a;)o=i,i=domUtils.getNextDomNode(i,1==i.nodeType,null,function(t){return dtd[e][t.tagName]});var c,u=d.setEndAfter(o).extractContents();if(n&&n.length>0){var m,f;f=m=n[0].cloneNode(!1);for(var h,p=1;h=n[p++];)m.appendChild(h.cloneNode(!1)),m=m.firstChild;c=m}else c=d.document.createElement(e);t&&domUtils.setAttributes(c,t),c.appendChild(u),d.insertNode(n?f:c);var g;if("span"==e&&t.style&&/text\-decoration/.test(t.style)&&(g=domUtils.findParentByTagName(c,"a",!0))?(domUtils.setAttributes(g,t),domUtils.remove(c,!0),c=g):(domUtils.mergeSibling(c),domUtils.clearEmptySibling(c)),domUtils.mergeChild(c,t),l=domUtils.getNextDomNode(c,!1,s),domUtils.mergeToParent(c),i===a)break}else l=domUtils.getNextDomNode(l,!0,s);return this.moveToBookmark(r)},removeInlineStyle:function(e){if(this.collapsed)return this;e=utils.isArray(e)?e:[e],this.shrinkBoundary().adjustmentBoundary();for(var t=this.startContainer,n=this.endContainer;;){if(1==t.nodeType){if(utils.indexOf(e,t.tagName.toLowerCase())>-1)break;if("body"==t.tagName.toLowerCase()){t=null;break}}t=t.parentNode}for(;;){if(1==n.nodeType){if(utils.indexOf(e,n.tagName.toLowerCase())>-1)break;if("body"==n.tagName.toLowerCase()){n=null;break}}n=n.parentNode}var i,o,r=this.createBookmark();t&&(o=this.cloneRange().setEndBefore(r.start).setStartBefore(t),i=o.extractContents(),o.insertNode(i),domUtils.clearEmptySibling(t,!0),t.parentNode.insertBefore(r.start,t)),n&&(o=this.cloneRange().setStartAfter(r.end).setEndAfter(n),i=o.extractContents(),o.insertNode(i),domUtils.clearEmptySibling(n,!1,!0),n.parentNode.insertBefore(r.end,n.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}),utils.indexOf(e,s.tagName.toLowerCase())>-1&&domUtils.remove(s,!0),s=a;return this.moveToBookmark(r)},getClosedNode:function(){var e;if(!this.collapsed){var n=this.cloneRange().adjustmentBoundary().shrinkBoundary();if(t(n)){var i=n.startContainer.childNodes[n.startOffset];i&&1==i.nodeType&&(dtd.$empty[i.tagName]||dtd.$nonChild[i.tagName])&&(e=i)}}return e},select:browser.ie?function(e,t){var n;this.collapsed||this.shrinkBoundary();var i=this.getClosedNode();if(i&&!t){try{n=this.document.body.createControlRange(),n.addElement(i),n.select()}catch(e){}return this}var s,d=this.createBookmark(),c=d.start;if(n=this.document.body.createTextRange(),n.moveToElementText(c),n.moveStart("character",1),this.collapsed){if(!e&&3!=this.startContainer.nodeType){var u=this.document.createTextNode(l),m=this.document.createElement("span");m.appendChild(this.document.createTextNode(l)),c.parentNode.insertBefore(m,c),c.parentNode.insertBefore(u,c),o(this.document,u),a=u,r(m,"previousSibling"),r(c,"nextSibling"),n.moveStart("character",-1),n.collapse(!0)}}else{var f=this.document.body.createTextRange();s=d.end,f.moveToElementText(s),n.setEndPoint("EndToEnd",f)}this.moveToBookmark(d),m&&domUtils.remove(m);try{n.select()}catch(e){}return this}:function(e){var t,n=domUtils.getWindow(this.document),i=n.getSelection();if(browser.gecko?this.document.body.focus():n.focus(),i){if(i.removeAllRanges(),this.collapsed&&!e){var s=this.startContainer,d=s;1==s.nodeType&&(d=s.childNodes[this.startOffset]),3==s.nodeType&&this.startOffset||(d?d.previousSibling&&3==d.previousSibling.nodeType:s.lastChild&&3==s.lastChild.nodeType)||(t=this.document.createTextNode(l),this.insertNode(t),o(this.document,t),r(t,"previousSibling"),r(t,"nextSibling"),a=t,this.setStart(t,browser.webkit?1:0).collapse(!0))}var c=this.document.createRange();if(this.collapsed&&browser.opera&&1==this.startContainer.nodeType){var d=this.startContainer.childNodes[this.startOffset];if(d){for(;d&&domUtils.isBlockElm(d)&&1==d.nodeType&&d.childNodes[0];)d=d.childNodes[0];d&&this.setStartBefore(d).collapse(!0)}else(d=this.startContainer.lastChild)&&domUtils.isBr(d)&&this.setStartBefore(d).collapse(!0)}!function(e){function t(t,n,i){3==t.nodeType&&t.nodeValue.length<n&&(e[i+"Offset"]=t.nodeValue.length)}t(e.startContainer,e.startOffset,"start"),t(e.endContainer,e.endOffset,"end")}(this),c.setStart(this.startContainer,this.startOffset),c.setEnd(this.endContainer,this.endOffset),i.addRange(c)}return this},scrollToView:function(e,t){e=e?window:domUtils.getWindow(this.document);var n=this,i=n.document.createElement("span");return i.innerHTML="&nbsp;",n.cloneRange().insertNode(i),domUtils.scrollToView(i,e,t),domUtils.remove(i),n},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,t){function n(e){for(var n,i=e?o.startContainer:o.endContainer,r=domUtils.findParents(i,!0,function(e){return!domUtils.isBody(e)}),a=[],s=0;n=r[s++];)a.push(domUtils.getNodeIndex(n,t));var l=0;if(t)if(3==i.nodeType){for(var d=i.previousSibling;d&&3==d.nodeType;)l+=d.nodeValue.replace(fillCharReg,"").length,d=d.previousSibling;l+=e?o.startOffset:o.endOffset}else if(i=i.childNodes[e?o.startOffset:o.endOffset])l=domUtils.getNodeIndex(i,t);else{i=e?o.startContainer:o.endContainer;for(var c=i.firstChild;c;)if(domUtils.isFillChar(c))c=c.nextSibling;else if(l++,3==c.nodeType)for(;c&&3==c.nodeType;)c=c.nextSibling;else c=c.nextSibling}else l=e?domUtils.isFillChar(i)?0:o.startOffset:o.endOffset;return l<0&&(l=0),a.push(l),a}var i={},o=this;return i.startAddress=n(!0),e||(i.endAddress=o.collapsed?[].concat(i.startAddress):n()),i},moveToAddress:function(e,t){function n(e,t){for(var n,o,r,a=i.document.body,s=0,l=e.length;s<l;s++)if(r=e[s],n=a,!(a=a.childNodes[r])){o=r;break}t?a?i.setStartBefore(a):i.setStart(n,o):a?i.setEndBefore(a):i.setEnd(n,o)}var i=this;return n(e.startAddress,!0),!t&&e.endAddress&&n(e.endAddress),i},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 n=this.createBookmark(),i=n.end,o=domUtils.getNextDomNode(n.start,!1,t);o&&o!==i&&domUtils.getPosition(o,i)&domUtils.POSITION_PRECEDING;){var r=domUtils.getNextDomNode(o,!1,t);e(o),o=r}return this.moveToBookmark(n)}}}(),function(){function e(e,t){var n=domUtils.getNodeIndex;e=e.duplicate(),e.collapse(t);var i=e.parentElement();if(!i.hasChildNodes())return{container:i,offset:0};for(var o,r,a=i.children,s=e.duplicate(),l=0,d=a.length-1,c=-1;l<=d;){c=Math.floor((l+d)/2),o=a[c],s.moveToElementText(o);var u=s.compareEndPoints("StartToStart",e);if(u>0)d=c-1;else{if(!(u<0))return{container:i,offset:n(o)};l=c+1}}if(-1==c){if(s.moveToElementText(i),s.setEndPoint("StartToStart",e),r=s.text.replace(/(\r\n|\r)/g,"\n").length,a=i.childNodes,!r)return o=a[a.length-1],{container:o,offset:o.nodeValue.length};for(var m=a.length;r>0;)r-=a[--m].nodeValue.length;return{container:a[m],offset:-r}}if(s.collapse(u>0),s.setEndPoint(u>0?"StartToStart":"EndToStart",e),!(r=s.text.replace(/(\r\n|\r)/g,"\n").length))return dtd.$empty[o.tagName]||dtd.$nonChild[o.tagName]?{container:i,offset:n(o)+(u>0?0:1)}:{container:o,offset:u>0?0:o.childNodes.length};for(;r>0;)try{var f=o;o=o[u>0?"previousSibling":"nextSibling"],r-=o.nodeValue.length}catch(e){return{container:i,offset:n(f)}}return{container:o,offset:u>0?-r:o.nodeValue.length+r}}function t(t,n){if(t.item)n.selectNode(t.item(0));else{var i=e(t,!0);n.setStart(i.container,i.offset),0!=t.compareEndPoints("StartToEnd",t)&&(i=e(t,!1),n.setEnd(i.container,i.offset))}return n}function n(e){var t;try{t=e.getNative().createRange()}catch(e){return null}var n=t.item?t.item(0):t.parentElement();return(n.ownerDocument||n)===e.document?t:null}(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{!n(i)&&i._bakIERange&&i._bakIERange.select()}catch(e){}i._bakIERange=null})),t=e=null}).prototype={rangeInBody:function(e,t){var n=browser.ie9below||t?e.item?e.item():e.parentElement():e.startContainer;return n===this.document.body||domUtils.inDoc(n,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=n(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=n(this);return!(!e||!this.rangeInBody(e))}return!!this.getNative().rangeCount}catch(e){return!1}},getRange:function(){function e(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)}var n=this;if(null!=n._cachedRange)return this._cachedRange;var i=new baidu.editor.dom.Range(n.document);if(browser.ie9below){var o=n.getIERange();if(o)try{t(o,i)}catch(t){e(i)}else e(i)}else{var r=n.getNative();if(r&&r.rangeCount){var a=r.getRangeAt(0),s=r.getRangeAt(r.rangeCount-1);i.setStart(a.startContainer,a.startOffset).setEnd(s.endContainer,s.endOffset),i.collapsed&&domUtils.isBody(i.startContainer)&&!i.startOffset&&e(i)}else{if(this._bakRange&&domUtils.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;e(i)}}return this._bakRange=i},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var e,t,n,i,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(e=o.duplicate(),e.text.length>0&&e.moveStart("character",1),e.collapse(1),t=e.parentElement(),i=n=o.parentElement();n=n.parentNode;)if(n==t){t=i;break}}else if(o.shrinkBoundary(),t=o.startContainer,1==t.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(){function e(e,t){var n;if(t.textarea)if(utils.isString(t.textarea)){for(var i,o=0,r=domUtils.getElementsByTagName(e,"textarea");i=r[o++];)if(i.id=="ueditor_textarea_"+t.options.textarea){n=i;break}}else n=t.textarea;n||(e.appendChild(n=domUtils.createElement(document,"textarea",{name:t.options.textarea,id:"ueditor_textarea_"+t.options.textarea,style:"display:none"})),t.textarea=n),!n.getAttribute("name")&&n.setAttribute("name",t.options.textarea),n.value=t.hasContents()?t.options.allHtmlEnabled?t.getAllHtml():t.getContent(null,null,!0):""}function t(e){for(var t in e)return t}function n(e){e.langIsReady=!0,e.fireEvent("langReady")}var i,o=0,r=UE.Editor=function(e){var i=this;i.uid=o++,EventBase.call(i),i.commands={},i.options=utils.extend(utils.clone(e||{}),UEDITOR_CONFIG,!0),i.shortcutkeys={},i.inputRules=[],i.outputRules=[],i.setOpt(r.defaultOptions(i)),i.loadServerConfig(),utils.isEmptyObject(UE.I18N)?utils.loadFile(document,{src:i.options.langPath+i.options.lang+"/"+i.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){UE.plugin.load(i),n(i)}):(i.options.lang=t(UE.I18N),UE.plugin.load(i),n(i)),UE.instants["ueditorInstant"+i.uid]=i};r.prototype={registerCommand:function(e,t){this.commands[e]=t},ready:function(e){var t=this;e&&(t.isReady?e.apply(t):t.addListener("ready",e))},setOpt:function(e,t){var n={};utils.isString(e)?n[e]=t:n=e,utils.extend(this.options,n,!0)},getOpt:function(e){return this.options[e]},destroy:function(){var e=this;e.fireEvent("destroy");var t=e.container.parentNode,n=e.textarea;n?n.style.display="":(n=document.createElement("textarea"),t.parentNode.insertBefore(n,t)),n.style.width=e.iframe.offsetWidth+"px",n.style.height=e.iframe.offsetHeight+"px",n.value=e.getContent(),n.id=e.key,t.innerHTML="",domUtils.remove(t);var i=e.key;for(var o in e)e.hasOwnProperty(o)&&delete this[o];UE.delEditor(i)},render:function(e){var t=this,n=t.options,i=function(t){return parseInt(domUtils.getComputedStyle(e,t))};if(utils.isString(e)&&(e=document.getElementById(e)),e){n.initialFrameWidth?n.minFrameWidth=n.initialFrameWidth:n.minFrameWidth=n.initialFrameWidth=e.offsetWidth,n.initialFrameHeight?n.minFrameHeight=n.initialFrameHeight:n.initialFrameHeight=n.minFrameHeight=e.offsetHeight,e.style.width=/%$/.test(n.initialFrameWidth)?"100%":n.initialFrameWidth-i("padding-left")-i("padding-right")+"px",e.style.height=/%$/.test(n.initialFrameHeight)?"100%":n.initialFrameHeight-i("padding-top")-i("padding-bottom")+"px",e.style.zIndex=n.zIndex;var o=(ie&&browser.version<9?"":"<!DOCTYPE html>")+"<html xmlns='http://www.w3.org/1999/xhtml' class='view' ><head><style type='text/css'>.view{padding:0;word-wrap:break-word;cursor:text;height:90%;}\nbody{margin:8px;font-family:sans-serif;font-size:16px;}p{margin:5px 0;}</style>"+(n.iframeCssUrl?"<link rel='stylesheet' type='text/css' href='"+utils.unhtml(n.iframeCssUrl)+"'/>":"")+(n.initialStyle?"<style>"+n.initialStyle+"</style>":"")+"</head><body class='view' ></body><script type='text/javascript' "+(ie?"defer='defer'":"")+" id='_initialScript'>setTimeout(function(){editor = window.parent.UE.instants['ueditorInstant"+t.uid+"'];editor._setup(document);},0);var _tmpScript = document.getElementById('_initialScript');_tmpScript.parentNode.removeChild(_tmpScript);<\/script></html>";e.appendChild(domUtils.createElement(document,"iframe",{id:"ueditor_"+t.uid,width:"100%",height:"100%",frameborder:"0",src:"javascript:void(function(){document.open();"+(n.customDomain&&document.domain!=location.hostname?'document.domain="'+document.domain+'";':"")+'document.write("'+o+'");document.close();}())'})),e.style.overflow="hidden",setTimeout(function(){/%$/.test(n.initialFrameWidth)&&(n.minFrameWidth=n.initialFrameWidth=e.offsetWidth),/%$/.test(n.initialFrameHeight)&&(n.minFrameHeight=n.initialFrameHeight=e.offsetHeight,e.style.height=n.initialFrameHeight+"px")})}},_setup:function(t){var n=this,i=n.options;ie?(t.body.disabled=!0,t.body.contentEditable=!0,t.body.disabled=!1):t.body.contentEditable=!0,t.body.spellcheck=!1,n.document=t,n.window=t.defaultView||t.parentWindow,n.iframe=n.window.frameElement,n.body=t.body,n.selection=new dom.Selection(t);var o;browser.gecko&&(o=this.selection.getNative())&&o.removeAllRanges(),this._initEvents();for(var r=this.iframe.parentNode;!domUtils.isBody(r);r=r.parentNode)if("FORM"==r.tagName){n.form=r,n.options.autoSyncData?domUtils.on(n.window,"blur",function(){e(r,n)}):domUtils.on(r,"submit",function(){e(this,n)});break}if(i.initialContent)if(i.autoClearinitialContent){var a=n.execCommand;n.execCommand=function(){return n.fireEvent("firstBeforeExecCommand"),a.apply(n,arguments)},this._setDefaultContent(i.initialContent)}else this.setContent(i.initialContent,!1,!0);domUtils.isEmptyNode(n.body)&&(n.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>"),i.focus&&setTimeout(function(){n.focus(n.options.focusInEnd),!n.options.autoClearinitialContent&&n._selectionChange()},0),n.container||(n.container=this.iframe.parentNode),i.fullscreen&&n.ui&&n.ui.setFullScreen(!0);try{n.document.execCommand("2D-position",!1,!1)}catch(e){}try{n.document.execCommand("enableInlineTableEditing",!1,!1)}catch(e){}try{n.document.execCommand("enableObjectResizing",!1,!1)}catch(e){}n._bindshortcutKeys(),n.isReady=1,n.fireEvent("ready"),i.onready&&i.onready.call(n),browser.ie9below||domUtils.on(n.window,["blur","focus"],function(e){if("blur"==e.type){n._bakRange=n.selection.getRange();try{n._bakNativeRange=n.selection.getNative().getRangeAt(0),n.selection.getNative().removeAllRanges()}catch(e){n._bakNativeRange=null}}else try{n._bakRange&&n._bakRange.select()}catch(e){}}),browser.gecko&&browser.version<=10902&&(n.body.contentEditable=!1,setTimeout(function(){n.body.contentEditable=!0},100),setInterval(function(){n.body.style.height=n.iframe.offsetHeight-20+"px"},100)),!i.isShow&&n.setHide(),i.readonly&&n.setDisabled()},sync:function(t){var n=this,i=t?document.getElementById(t):domUtils.findParent(n.iframe.parentNode,function(e){return"FORM"==e.tagName},!0);i&&e(i,n)},setHeight:function(e,t){e!==parseInt(this.iframe.parentNode.style.height)&&(this.iframe.parentNode.style.height=e+"px"),!t&&(this.options.minFrameHeight=this.options.initialFrameHeight=e),this.body.style.height=e+"px",!t&&this.trigger("setHeight")},addshortcutkey:function(e,t){var n={};t?n[e]=t:n=e,utils.extend(this.shortcutkeys,n)},_bindshortcutKeys:function(){var e=this,t=this.shortcutkeys;e.addListener("keydown",function(n,i){var o=i.keyCode||i.which;for(var r in t)for(var a,s=t[r].split(","),l=0;a=s[l++];){a=a.split(":");var d=a[0],c=a[1];(/^(ctrl)(\+shift)?\+(\d+)$/.test(d.toLowerCase())||/^(\d+)$/.test(d))&&(("ctrl"==RegExp.$1?i.ctrlKey||i.metaKey:0)&&(""!=RegExp.$2?i[RegExp.$2.slice(1)+"Key"]:1)&&o==RegExp.$3||o==RegExp.$1)&&(-1!=e.queryCommandState(r,c)&&e.execCommand(r,c),domUtils.preventDefault(i))}})},getContent:function(e,t,n,i,o){var r=this;if(e&&utils.isFunction(e)&&(t=e,e=""),t?!t():!this.hasContents())return"";r.fireEvent("beforegetcontent");var a=UE.htmlparser(r.body.innerHTML,i);return r.filterOutputRule(a),r.fireEvent("aftergetcontent",e,a),a.toHtml(o)},getAllHtml:function(){var e=this,t=[];if(e.fireEvent("getAllHtml",t),browser.ie&&browser.version>8){var n="";utils.each(e.document.styleSheets,function(e){n+=e.href?'<link rel="stylesheet" type="text/css" href="'+e.href+'" />':"<style>"+e.cssText+"</style>"}),utils.each(e.document.getElementsByTagName("script"),function(e){n+=e.outerHTML})}return"<html><head>"+(e.options.charset?'<meta http-equiv="Content-Type" content="text/html; charset='+e.options.charset+'"/>':"")+(n||e.document.getElementsByTagName("head")[0].innerHTML)+t.join("\n")+"</head><body "+(ie&&browser.version<9?'class="view"':"")+">"+e.getContent(null,null,!0)+"</body></html>"},getPlainTxt:function(){var e=new RegExp(domUtils.fillChar,"g"),t=this.body.innerHTML.replace(/[\n\r]/g,"");return t=t.replace(/<(p|div)[^>]*>(<br\/?>|&nbsp;)<\/\1>/gi,"\n").replace(/<br\/?>/gi,"\n").replace(/<[^>\/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(e,t,n){return dtd.$block[n]?"\n":t||""}),t.replace(e,"").replace(/\u00a0/g," ").replace(/&nbsp;/g," ")},getContentTxt:function(){var e=new RegExp(domUtils.fillChar,"g");return this.body[browser.ie?"innerText":"textContent"].replace(e,"").replace(/\u00a0/g," ")},setContent:function(t,n,i){var o=this;o.fireEvent("beforesetcontent",t);var r=UE.htmlparser(t);if(o.filterInputRule(r),t=r.toHtml(),o.body.innerHTML=(n?o.body.innerHTML:"")+t,"p"==o.options.enterTag){var a,s=this.body.firstChild;if(!s||1==s.nodeType&&(dtd.$cdata[s.tagName]||function(e){return"DIV"==e.tagName&&e.getAttribute("cdata_tag")}(s)||domUtils.isCustomeNode(s))&&s===this.body.lastChild)this.body.innerHTML="<p>"+(browser.ie?"&nbsp;":"<br/>")+"</p>"+this.body.innerHTML;else for(var l=o.document.createElement("p");s;){for(;s&&(3==s.nodeType||1==s.nodeType&&dtd.p[s.tagName]&&!dtd.$cdata[s.tagName]);)a=s.nextSibling,l.appendChild(s),s=a;if(l.firstChild){if(!s){o.body.appendChild(l);break}s.parentNode.insertBefore(l,s),l=o.document.createElement("p")}s=s.nextSibling}}o.fireEvent("aftersetcontent"),o.fireEvent("contentchange"),!i&&o._selectionChange(),o._bakRange=o._bakIERange=o._bakNativeRange=null;var d;browser.gecko&&(d=this.selection.getNative())&&d.removeAllRanges(),o.options.autoSyncData&&o.form&&e(o.form,o)},focus:function(e){try{var t=this,n=t.selection.getRange();if(e){var i=t.body.lastChild;i&&1==i.nodeType&&!dtd.$empty[i.tagName]&&(domUtils.isEmptyBlock(i)?n.setStartAtFirst(i):n.setStartAtLast(i),n.collapse(!0)),n.setCursor(!0)}else{if(!n.collapsed&&domUtils.isBody(n.startContainer)&&0==n.startOffset){var i=t.body.firstChild;i&&1==i.nodeType&&!dtd.$empty[i.tagName]&&n.setStartAtFirst(i).collapse(!0)}n.select(!0)}this.fireEvent("focus selectionchange")}catch(e){}},isFocus:function(){return this.selection.isFocus()},blur:function(){var e=this.selection.getNative();if(e.empty&&browser.ie){var t=document.body.createTextRange();t.moveToElementText(document.body),t.collapse(!0),t.select(),e.empty()}else e.removeAllRanges()},_initEvents:function(){var e=this,t=e.document,n=e.window;e._proxyDomEvent=utils.bind(e._proxyDomEvent,e),domUtils.on(t,["click","contextmenu","mousedown","keydown","keyup","keypress","mouseup","mouseover","mouseout","selectstart"],e._proxyDomEvent),domUtils.on(n,["focus","blur"],e._proxyDomEvent),domUtils.on(e.body,"drop",function(t){browser.gecko&&t.stopPropagation&&t.stopPropagation(),e.fireEvent("contentchange")}),domUtils.on(t,["mouseup","keydown"],function(t){"keydown"==t.type&&(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)||2!=t.button&&e._selectionChange(250,t)})},_proxyDomEvent:function(e){return!1!==this.fireEvent("before"+e.type.replace(/^on/,"").toLowerCase())&&(!1!==this.fireEvent(e.type.replace(/^on/,""),e)&&this.fireEvent("after"+e.type.replace(/^on/,"").toLowerCase()))},_selectionChange:function(e,t){var n,o,r=this,a=!1;if(browser.ie&&browser.version<9&&t&&"mouseup"==t.type){this.selection.getRange().collapsed||(a=!0,n=t.clientX,o=t.clientY)}clearTimeout(i),i=setTimeout(function(){if(r.selection&&r.selection.getNative()){var e;if(a&&"None"==r.selection.getNative().type){e=r.document.body.createTextRange();try{e.moveToPoint(n,o)}catch(t){e=null}}var i;e&&(i=r.selection.getIERange,r.selection.getIERange=function(){return e}),r.selection.cache(),i&&(r.selection.getIERange=i),r.selection._cachedRange&&r.selection._cachedStartElement&&(r.fireEvent("beforeselectionchange"),r.fireEvent("selectionchange",!!t),r.fireEvent("afterselectionchange"),r.selection.clear())}},e||50)},_callCmdFn:function(e,t){var n,i,o=t[0].toLowerCase();return n=this.commands[o]||UE.commands[o],i=n&&n[e],n&&i||"queryCommandState"!=e?i?i.apply(this,t):void 0:0},execCommand:function(e){e=e.toLowerCase();var t,n=this,i=n.commands[e]||UE.commands[e];return i&&i.execCommand?(i.notNeedUndo||n.__hasEnterExecCommand?(t=this._callCmdFn("execCommand",arguments),!n.__hasEnterExecCommand&&!i.ignoreContentChange&&!n._ignoreContentChange&&n.fireEvent("contentchange")):(n.__hasEnterExecCommand=!0,-1!=n.queryCommandState.apply(n,arguments)&&(n.fireEvent("saveScene"),n.fireEvent.apply(n,["beforeexeccommand",e].concat(arguments)),t=this._callCmdFn("execCommand",arguments),n.fireEvent.apply(n,["afterexeccommand",e].concat(arguments)),n.fireEvent("saveScene")),n.__hasEnterExecCommand=!1),!n.__hasEnterExecCommand&&!i.ignoreContentChange&&!n._ignoreContentChange&&n._selectionChange(),t):null},queryCommandState:function(e){return this._callCmdFn("queryCommandState",arguments)},queryCommandValue:function(e){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(e){if(e)for(var t,n=0;t=e[n++];)if(this.document.getElementsByTagName(t).length>0)return!0;if(!domUtils.isEmptyBlock(this.body))return!0;for(e=["div"],n=0;t=e[n++];)for(var i,o=domUtils.getElementsByTagName(this.document,t),r=0;i=o[r++];)if(domUtils.isCustomeNode(i))return!0;return!1},reset:function(){this.fireEvent("reset")},setEnabled:function(){var e,t=this;if("false"==t.body.contentEditable){t.body.contentEditable=!0,e=t.selection.getRange();try{e.moveToBookmark(t.lastBk),delete t.lastBk}catch(n){e.setStartAtFirst(t.body).collapse(!0)}e.select(!0),t.bkqueryCommandState&&(t.queryCommandState=t.bkqueryCommandState,delete t.bkqueryCommandState),t.bkqueryCommandValue&&(t.queryCommandValue=t.bkqueryCommandValue,delete t.bkqueryCommandValue),t.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},setDisabled:function(e){var t=this;e=e?utils.isArray(e)?e:[e]:[],"true"==t.body.contentEditable&&(t.lastBk||(t.lastBk=t.selection.getRange().createBookmark(!0)),t.body.contentEditable=!1,t.bkqueryCommandState=t.queryCommandState,t.bkqueryCommandValue=t.queryCommandValue,t.queryCommandState=function(n){return-1!=utils.indexOf(e,n)?t.bkqueryCommandState.apply(t,arguments):-1},t.queryCommandValue=function(n){return-1!=utils.indexOf(e,n)?t.bkqueryCommandValue.apply(t,arguments):null},t.fireEvent("selectionchange"))},disable:function(e){return this.setDisabled(e)},_setDefaultContent:function(){function e(){var t=this;t.document.getElementById("initContent")&&(t.body.innerHTML="<p>"+(ie?"":"<br/>")+"</p>",t.removeListener("firstBeforeExecCommand focus",e),setTimeout(function(){t.focus(),t._selectionChange()},0))}return function(t){var n=this;n.body.innerHTML='<p id="initContent">'+t+"</p>",n.addListener("firstBeforeExecCommand focus",e)}}(),setShow:function(){var e=this,t=e.selection.getRange();if("none"==e.container.style.display){try{t.moveToBookmark(e.lastBk),delete e.lastBk}catch(n){t.setStartAtFirst(e.body).collapse(!0)}setTimeout(function(){t.select(!0)},100),e.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){var e=this;e.lastBk||(e.lastBk=e.selection.getRange().createBookmark(!0)),e.container.style.display="none"},hide:function(){return this.setHide()},getLang:function(e){var t=UE.I18N[this.options.lang];if(!t)throw Error("not import language file");e=(e||"").split(".");for(var n,i=0;(n=e[i++])&&(t=t[n]););return t},getContentLength:function(e,t){var n=this.getContent(!1,!1,!0).length;if(e){t=(t||[]).concat(["hr","img","iframe"]),n=this.getContentTxt().replace(/[\t\r\n]+/g,"").length;for(var i,o=0;i=t[o++];)n+=this.document.getElementsByTagName(i).length}return n},addInputRule:function(e){this.inputRules.push(e)},filterInputRule:function(e){for(var t,n=0;t=this.inputRules[n++];)t.call(this,e)},addOutputRule:function(e){this.outputRules.push(e)},filterOutputRule:function(e){for(var t,n=0;t=this.outputRules[n++];)t.call(this,e)},getActionUrl:function(e){var t=this.getOpt(e)||e,n=this.getOpt("imageUrl"),i=this.getOpt("serverUrl");return!i&&n&&(i=n.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2")),i?(i=i+(-1==i.indexOf("?")?"?":"&")+"action="+(t||""),utils.formatUrl(i)):""}},utils.inherits(r,EventBase)}(),UE.Editor.defaultOptions=function(e){var t=e.options.UEDITOR_HOME_URL;return{isShow:!0,initialContent:"",initialStyle:"",autoClearinitialContent:!1,iframeCssUrl:t+"themes/iframe.css",textarea:"editorValue",focus:!1,focusInEnd:!0,autoClearEmptyNode:!0,fullscreen:!1,readonly:!1,zIndex:999,imagePopup:!0,enterTag:"p",customDomain:!1,lang:"zh-cn",langPath:t+"lang/",theme:"default",themePath:t+"themes/",allHtmlEnabled:!1,scaleEnabled:!1,tableNativeEditInFF:!1,autoSyncData:!0,fileNameFormat:"{time}{rand:6}"}},function(){UE.Editor.prototype.loadServerConfig=function(){function showErrorMsg(e){console&&console.error(e)}var me=this;setTimeout(function(){try{me.options.imageUrl&&me.setOpt("serverUrl",me.options.imageUrl.replace(/^(.*[\/]).+([\.].+)$/,"$1controller$2"));var configUrl=me.getActionUrl("config"),isJsonp=utils.isCrossDomainUrl(configUrl);me._serverConfigLoaded=!1,configUrl&&UE.ajax.request(configUrl,{method:"GET",dataType:isJsonp?"jsonp":"",onsuccess:function onsuccess(r){try{var config=isJsonp?r:eval("("+r.responseText+")");utils.extend(me.options,config),me.fireEvent("serverConfigLoaded"),me._serverConfigLoaded=!0}catch(e){showErrorMsg(me.getLang("loadconfigFormatError"))}},onerror:function(){showErrorMsg(me.getLang("loadconfigHttpError"))}})}catch(e){showErrorMsg(me.getLang("loadconfigError"))}})},UE.Editor.prototype.isServerConfigLoaded=function(){return this._serverConfigLoaded||!1},UE.Editor.prototype.afterConfigReady=function(e){if(e&&utils.isFunction(e)){var t=this,n=function n(){e.apply(t,arguments),t.removeListener("serverConfigLoaded",n)};t.isServerConfigLoaded()?e.call(t,"serverConfigLoaded"):t.addListener("serverConfigLoaded",n)}}}(),UE.ajax=function(){function e(e){var t=[];for(var n in e)if("method"!=n&&"timeout"!=n&&"async"!=n&&"dataType"!=n&&"callback"!=n&&void 0!=e[n]&&null!=e[n])if("function"!=_typeof(e[n]).toLowerCase()&&"object"!=_typeof(e[n]).toLowerCase())t.push(encodeURIComponent(n)+"="+encodeURIComponent(e[n]));else if(utils.isArray(e[n]))for(var i=0;i<e[n].length;i++)t.push(encodeURIComponent(n)+"[]="+encodeURIComponent(e[n][i]));return t.join("&")}function t(t,n){var i=o(),r=!1,a={method:"POST",timeout:5e3,async:!0,data:{},onsuccess:function(){},onerror:function(){}};if("object"===(void 0===t?"undefined":_typeof(t))&&(n=t,t=n.url),i&&t){var s=n?utils.extend(a,n):a,l=e(s);utils.isEmptyObject(s.data)||(l+=(l?"&":"")+e(s.data));var d=setTimeout(function(){4!=i.readyState&&(r=!0,i.abort(),clearTimeout(d))},s.timeout),c=s.method.toUpperCase(),u=t+(-1==t.indexOf("?")?"?":"&")+("POST"==c?"":l+"&noCache="+ +new Date);i.open(c,u,s.async),i.onreadystatechange=function(){4==i.readyState&&(r||200!=i.status?s.onerror(i):s.onsuccess(i))},"POST"==c?(i.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),i.send(l)):i.send(null)}}function n(t,n){function i(e){return function(){try{if(e)d.onerror&&d.onerror();else try{clearTimeout(r),s.apply(window,arguments)}catch(e){}}catch(e){d.onerror&&d.onerror.call(window,e)}finally{d.oncomplete&&d.oncomplete.apply(window,arguments),l.parentNode&&l.parentNode.removeChild(l),window[o]=null;try{delete window[o]}catch(e){}}}}var o,r,a,s=n.onsuccess||function(){},l=document.createElement("SCRIPT"),d=n||{},c=d.charset,u=d.jsonp||"callback",m=d.timeOut||0,f=new RegExp("(\\?|&)"+u+"=([^&]*)");utils.isFunction(s)?(o="bd__editor__"+Math.floor(2147483648*Math.random()).toString(36),window[o]=i(0)):utils.isString(s)?o=s:(a=f.exec(t))&&(o=a[2]),t=t.replace(f,"$1"+u+"="+o),t.search(f)<0&&(t+=(t.indexOf("?")<0?"?":"&")+u+"="+o);var h=e(n);utils.isEmptyObject(n.data)||(h+=(h?"&":"")+e(n.data)),h&&(t=t.replace(/\?/,"?"+h+"&")),l.onerror=i(1),m&&(r=setTimeout(i(1),m)),function(e,t,n){e.setAttribute("type","text/javascript"),e.setAttribute("defer","defer"),n&&e.setAttribute("charset",n),e.setAttribute("src",t),document.getElementsByTagName("head")[0].appendChild(e)}(l,t,c)}var i="XMLHttpRequest()";try{new ActiveXObject("Msxml2.XMLHTTP"),i="ActiveXObject('Msxml2.XMLHTTP')"}catch(e){try{new ActiveXObject("Microsoft.XMLHTTP"),i="ActiveXObject('Microsoft.XMLHTTP')"}catch(e){}}var o=new Function("return new "+i);return{request:function(e,i){i&&"jsonp"==i.dataType?n(e,i):t(e,i)},getJSONP:function(e,t,i){n(e,{data:t,oncomplete:i})}}}();var filterWord=UE.filterWord=function(){function e(e){return/(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<(v|o):|lang=)/gi.test(e)}function t(e){return e=e.replace(/[\d.]+\w+/g,function(e){return utils.transUnitToPx(e)})}function n(e){return e.replace(/[\t\r\n]+/g," ").replace(/<!--[\s\S]*?-->/gi,"").replace(/<v:shape [^>]*>[\s\S]*?.<\/v:shape>/gi,function(e){if(browser.opera)return"";try{if(/Bitmap/i.test(e))return"";var n=e.match(/width:([ \d.]*p[tx])/i)[1],i=e.match(/height:([ \d.]*p[tx])/i)[1],o=e.match(/src=\s*"([^"]*)"/i)[1];return'<img width="'+t(n)+'" height="'+t(i)+'" src="'+o+'" />'}catch(e){return""}}).replace(/<\/?div[^>]*>/g,"").replace(/v:\w+=(["']?)[^'"]+\1/g,"").replace(/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|xml|meta|link|style|\w+:\w+)(?=[\s\/>]))[^>]*>/gi,"").replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>").replace(/\s+(class|lang|align)\s*=\s*(['"]?)([\w-]+)\2/gi,function(e,t,n,i){return"class"==t&&"MsoListParagraph"==i?e:""}).replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi,function(e,t,n){return n.replace(/[\t\r\n ]+/g," ")}).replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,function(e,n,i,o){for(var r,a=[],s=o.replace(/^\s+|\s+$/,"").replace(/&#39;/g,"'").replace(/&quot;/gi,"'").replace(/[\d.]+(cm|pt)/g,function(e){return utils.transUnitToPx(e)}).split(/;\s*/g),l=0;r=s[l];l++){var d,c,u=r.split(":");if(2==u.length){if(d=u[0].toLowerCase(),c=u[1].toLowerCase(),/^(background)\w*/.test(d)&&0==c.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(d)&&/^0\w+$/.test(c))continue;switch(d){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":/<table/.test(n)||(a[l]=d.replace(/^mso-|-alt$/g,"")+":"+t(c));continue;case"horiz-align":a[l]="text-align:"+c;continue;case"vert-align":a[l]="vertical-align:"+c;continue;case"font-color":case"mso-foreground":a[l]="color:"+c;continue;case"mso-background":case"mso-highlight":a[l]="background:"+c;continue;case"mso-default-height":a[l]="min-height:"+t(c);continue;case"mso-default-width":a[l]="min-width:"+t(c);continue;case"mso-padding-between-alt":a[l]="border-collapse:separate;border-spacing:"+t(c);continue;case"text-line-through":"single"!=c&&"double"!=c||(a[l]="text-decoration:line-through");continue;case"mso-zero-height":"yes"==c&&(a[l]="display:none");continue;case"margin":if(!/[1-9]/.test(c))continue}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?:decor|trans)|top-bar|version|vnd|word-break)/.test(d)||/text\-indent|padding|margin/.test(d)&&/\-[\d.]+/.test(c))continue;a[l]=d+":"+u[1]}}return n+(a.length?' style="'+a.join(";").replace(/;{2,}/g,";")+'"':"")})}return function(t){return e(t)?n(t):t}}();!function(){function e(e,t,n){return e.push(f),t+(n?1:-1)}function t(e,t){for(var n=0;n<t;n++)e.push(m)}function n(a,s,l,d){switch(a.type){case"root":for(var c,u=0;c=a.children[u++];)l&&"element"==c.type&&!dtd.$inlineWithA[c.tagName]&&u>1&&(e(s,d,!0),t(s,d)),n(c,s,l,d);break;case"text":i(a,s);break;case"element":o(a,s,l,d);break;case"comment":r(a,s)}return s}function i(e,t){"pre"==e.parentNode.tagName?t.push(e.data):t.push(u[e.parentNode.tagName]?utils.html(e.data):e.data.replace(/[ ]{2}/g," &nbsp;"))}function o(i,o,r,a){var s="";if(i.attrs){s=[];var l=i.attrs;for(var d in l)s.push(d+(void 0!==l[d]?'="'+(c[d]?utils.html(l[d]).replace(/["]/g,function(e){return"&quot;"}):utils.unhtml(l[d]))+'"':""));s=s.join(" ")}if(o.push("<"+i.tagName+(s?" "+s:"")+(dtd.$empty[i.tagName]?"/":"")+">"),r&&!dtd.$inlineWithA[i.tagName]&&"pre"!=i.tagName&&i.children&&i.children.length&&(a=e(o,a,!0),t(o,a)),i.children&&i.children.length)for(var u,m=0;u=i.children[m++];)r&&"element"==u.type&&!dtd.$inlineWithA[u.tagName]&&m>1&&(e(o,a),t(o,a)),n(u,o,r,a);dtd.$empty[i.tagName]||(r&&!dtd.$inlineWithA[i.tagName]&&"pre"!=i.tagName&&i.children&&i.children.length&&(a=e(o,a),t(o,a)),o.push("</"+i.tagName+">"))}function r(e,t){t.push("\x3c!--"+e.data+"--\x3e")}function a(e,t){var n;if("element"==e.type&&e.getAttr("id")==t)return e;if(e.children&&e.children.length)for(var i,o=0;i=e.children[o++];)if(n=a(i,t))return n}function s(e,t,n){if("element"==e.type&&e.tagName==t&&n.push(e),e.children&&e.children.length)for(var i,o=0;i=e.children[o++];)s(i,t,n)}function l(e,t){if(e.children&&e.children.length)for(var n,i=0;n=e.children[i];)l(n,t),n.parentNode&&(n.children&&n.children.length&&t(n),n.parentNode&&i++);else t(e)}var d=UE.uNode=function(e){this.type=e.type,this.data=e.data,this.tagName=e.tagName,this.parentNode=e.parentNode,this.attrs=e.attrs||{},this.children=e.children},c={href:1,src:1,_src:1,_href:1,cdata_data:1},u={style:1,script:1},m="    ",f="\n";d.createElement=function(e){return/[<>]/.test(e)?UE.htmlparser(e).children[0]:new d({type:"element",children:[],tagName:e})},d.createText=function(e,t){return new UE.uNode({type:"text",data:t?e:utils.unhtml(e||"")})},d.prototype={toHtml:function(e){var t=[];return n(this,t,e,0),t.join("")},innerHTML:function(e){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(utils.isString(e)){if(this.children)for(var t,n=0;t=this.children[n++];)t.parentNode=null;this.children=[];for(var t,i=UE.htmlparser(e),n=0;t=i.children[n++];)this.children.push(t),t.parentNode=this;return this}var i=new UE.uNode({type:"root",children:this.children});return i.toHtml()},innerText:function(e,t){if("element"!=this.type||dtd.$empty[this.tagName])return this;if(e){if(this.children)for(var n,i=0;n=this.children[i++];)n.parentNode=null;return this.children=[],this.appendChild(d.createText(e,t)),this}return this.toHtml().replace(/<[^>]+>/g,"")},getData:function(){return"element"==this.type?"":this.data},firstChild:function(){return this.children?this.children[0]:null},lastChild:function(){return this.children?this.children[this.children.length-1]:null},previousSibling:function(){for(var e,t=this.parentNode,n=0;e=t.children[n];n++)if(e===this)return 0==n?null:t.children[n-1]},nextSibling:function(){for(var e,t=this.parentNode,n=0;e=t.children[n++];)if(e===this)return t.children[n]},replaceChild:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var n,i=0;n=this.children[i];i++)if(n===t)return this.children.splice(i,1,e),t.parentNode=null,e.parentNode=this,e}},appendChild:function(e){if("root"==this.type||"element"==this.type&&!dtd.$empty[this.tagName]){this.children||(this.children=[]),e.parentNode&&e.parentNode.removeChild(e);for(var t,n=0;t=this.children[n];n++)if(t===e){this.children.splice(n,1);break}return this.children.push(e),e.parentNode=this,e}},insertBefore:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var n,i=0;n=this.children[i];i++)if(n===t)return this.children.splice(i,0,e),e.parentNode=this,e}},insertAfter:function(e,t){if(this.children){e.parentNode&&e.parentNode.removeChild(e);for(var n,i=0;n=this.children[i];i++)if(n===t)return this.children.splice(i+1,0,e),e.parentNode=this,e}},removeChild:function(e,t){if(this.children)for(var n,i=0;n=this.children[i];i++)if(n===e){if(this.children.splice(i,1),n.parentNode=null,t&&n.children&&n.children.length)for(var o,r=0;o=n.children[r];r++)this.children.splice(i+r,0,o),o.parentNode=this;return n}},getAttr:function(e){return this.attrs&&this.attrs[e.toLowerCase()]},setAttr:function(e,t){if(!e)return void delete this.attrs;if(this.attrs||(this.attrs={}),utils.isObject(e))for(var n in e)e[n]?this.attrs[n.toLowerCase()]=e[n]:delete this.attrs[n];else t?this.attrs[e.toLowerCase()]=t:delete this.attrs[e]},getIndex:function(){for(var e,t=this.parentNode,n=0;e=t.children[n];n++)if(e===this)return n;return-1},getNodeById:function(e){var t;if(this.children&&this.children.length)for(var n,i=0;n=this.children[i++];)if(t=a(n,e))return t},getNodesByTagName:function(e){e=utils.trim(e).replace(/[ ]{2,}/g," ").split(" ");var t=[],n=this;return utils.each(e,function(e){if(n.children&&n.children.length)for(var i,o=0;i=n.children[o++];)s(i,e,t)}),t},getStyle:function(e){var t=this.getAttr("style");if(!t)return"";var n=new RegExp("(^|;)\\s*"+e+":([^;]+)","i"),i=t.match(n);return i&&i[0]?i[2]:""},setStyle:function(e,t){function n(e,t){var n=new RegExp("(^|;)\\s*"+e+":([^;]+;?)","gi");i=i.replace(n,"$1"),t&&(i=e+":"+utils.unhtml(t)+";"+i)}var i=this.getAttr("style");if(i||(i=""),utils.isObject(e))for(var o in e)n(o,e[o]);else n(e,t);this.setAttr("style",utils.trim(i))},traversal:function(e){return this.children&&this.children.length&&l(this,e),this}}}();var htmlparser=UE.htmlparser=function(e,t){function n(e,t){if(u[e.tagName]){var n=d.createElement(u[e.tagName]);e.appendChild(n),n.appendChild(d.createText(t)),e=n}else e.appendChild(d.createText(t))}function i(e,t,n){var o;if(o=c[t]){for(var a,s=e;"root"!=s.type;){if(utils.isArray(o)?-1!=utils.indexOf(o,s.tagName):o==s.tagName){e=s,a=!0;break}s=s.parentNode}a||(e=i(e,utils.isArray(o)?o[0]:o))}var u=new d({parentNode:e,type:"element",tagName:t.toLowerCase(),children:dtd.$empty[t]?null:[]});if(n){for(var m,f={};m=r.exec(n);)f[m[1].toLowerCase()]=l[m[1].toLowerCase()]?m[2]||m[3]||m[4]:utils.unhtml(m[2]||m[3]||m[4]);u.attrs=f}return e.children.push(u),dtd.$empty[t]?e:u}var o=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,r=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,a={b:1,code:1,i:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,span:1,sub:1,img:1,sup:1,font:1,big:1,small:1,iframe:1,a:1,br:1,pre:1};e=e.replace(new RegExp(domUtils.fillChar,"g"),""),t||(e=e.replace(new RegExp("[\\r\\t\\n"+(t?"":" ")+"]*</?(\\w+)\\s*(?:[^>]*)>[\\r\\t\\n"+(t?"":" ")+"]*","g"),function(e,n){return n&&a[n.toLowerCase()]?e.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):e.replace(new RegExp("^[\\r\\n"+(t?"":" ")+"]+"),"").replace(new RegExp("[\\r\\n"+(t?"":" ")+"]+$"),"")}));for(var s,l={href:1,src:1},d=UE.uNode,c={td:"tr",tr:["tbody","thead","tfoot"],tbody:"table",th:"tr",thead:"table",tfoot:"table",caption:"table",li:["ul","ol"],dt:"dl",dd:"dl",option:"select"},u={ol:"li",ul:"li"},m=0,f=0,h=new d({type:"root",children:[]}),p=h;s=o.exec(e);){m=s.index;try{if(m>f&&n(p,e.slice(f,m)),s[3])dtd.$cdata[p.tagName]?n(p,s[0]):p=i(p,s[3].toLowerCase(),s[4]);else if(s[1]){if("root"!=p.type)if(dtd.$cdata[p.tagName]&&!dtd.$cdata[s[1]])n(p,s[0]);else{for(var g=p;"element"==p.type&&p.tagName!=s[1].toLowerCase();)if(p=p.parentNode,"root"==p.type)throw p=g,"break";p=p.parentNode}}else s[2]&&function(e,t){e.children.push(new d({type:"comment",data:t,parentNode:e}))}(p,s[2])}catch(e){}f=o.lastIndex}return f<e.length&&n(p,e.slice(f)),h},filterNode=UE.filterNode=function(){function e(t,n){switch(t.type){case"text":break;case"element":var i;if(i=n[t.tagName])if("-"===i)t.parentNode.removeChild(t);else if(utils.isFunction(i)){var o=t.parentNode,r=t.getIndex();if(i(t),t.parentNode){if(t.children)for(var a,s=0;a=t.children[s];)e(a,n),a.parentNode&&s++}else for(var a,s=r;a=o.children[s];)e(a,n),a.parentNode&&s++}else{var l=i.$;if(l&&t.attrs){var d,c={};for(var u in l){if(d=t.getAttr(u),"style"==u&&utils.isArray(l[u])){var m=[];utils.each(l[u],function(e){var n;(n=t.getStyle(e))&&m.push(e+":"+n)}),d=m.join(";")}d&&(c[u]=d)}t.attrs=c}if(t.children)for(var a,s=0;a=t.children[s];)e(a,n),a.parentNode&&s++}else if(dtd.$cdata[t.tagName])t.parentNode.removeChild(t);else{var o=t.parentNode,r=t.getIndex();t.parentNode.removeChild(t,!0);for(var a,s=r;a=o.children[s];)e(a,n),a.parentNode&&s++}break;case"comment":t.parentNode.removeChild(t)}}return function(t,n){if(utils.isEmptyObject(n))return t;var i;(i=n["-"])&&utils.each(i.split(" "),function(e){n[e]="-"});for(var o,r=0;o=t.children[r];)e(o,n),o.parentNode&&r++;return t}}();UE.plugin=function(){var e={};return{register:function(t,n,i,o){i&&utils.isFunction(i)&&(o=i,i=null),e[t]={optionName:i||t,execFn:n,afterDisabled:o}},load:function(t){utils.each(e,function(e){var n=e.execFn.call(t);!1!==t.options[e.optionName]?n&&utils.each(n,function(e,n){switch(n.toLowerCase()){case"shortcutkey":t.addshortcutkey(e);break;case"bindevents":utils.each(e,function(e,n){t.addListener(n,e)});break;case"bindmultievents":utils.each(utils.isArray(e)?e:[e],function(e){var n=utils.trim(e.type).split(/\s+/);utils.each(n,function(n){t.addListener(n,e.handler)})});break;case"commands":utils.each(e,function(e,n){t.commands[n]=e});break;case"outputrule":t.addOutputRule(e);break;case"inputrule":t.addInputRule(e);break;case"defaultoptions":t.setOpt(e)}}):e.afterDisabled&&e.afterDisabled.call(t)}),utils.each(UE.plugins,function(e){e.call(t)})},run:function(t,n){var i=e[t];i&&i.exeFn.call(n)}}}();var keymap=UE.keymap={Backspace:8,Tab:9,Enter:13,Shift:16,Control:17,Alt:18,CapsLock:20,Esc:27,Spacebar:32,PageUp:33,PageDown:34,End:35,Home:36,Left:37,Up:38,Right:39,Down:40,Insert:45,Del:46,NumLock:144,Cmd:91,"=":187,"-":189,b:66,i:73,z:90,y:89,v:86,x:88,s:83,n:78},LocalStorage=UE.LocalStorage=function(){var e=window.localStorage||function(){var e=document.createElement("div");return e.style.display="none",e.addBehavior?(e.addBehavior("#default#userdata"),{getItem:function(n){var i=null;try{document.body.appendChild(e),e.load(t),i=e.getAttribute(n),document.body.removeChild(e)}catch(e){}return i},setItem:function(n,i){document.body.appendChild(e),e.setAttribute(n,i),e.save(t),document.body.removeChild(e)},removeItem:function(n){document.body.appendChild(e),e.removeAttribute(n),e.save(t),document.body.removeChild(e)}}):null}()||null,t="localStorage";return{saveLocalData:function(t,n){return!(!e||!n)&&(e.setItem(t,n),!0)},getLocalData:function(t){return e?e.getItem(t):null},removeItem:function(t){e&&e.removeItem(t)}}}();!function(){var e="ueditor_preference";UE.Editor.prototype.setPreferences=function(t,n){var i={};utils.isString(t)?i[t]=n:i=t;var o=LocalStorage.getLocalData(e);o&&(o=utils.str2json(o))?utils.extend(o,i):o=i,o&&LocalStorage.saveLocalData(e,utils.json2str(o))},UE.Editor.prototype.getPreferences=function(t){var n=LocalStorage.getLocalData(e);return n&&(n=utils.str2json(n))?t?n[t]:n:null},UE.Editor.prototype.removePreferences=function(t){var n=LocalStorage.getLocalData(e);n&&(n=utils.str2json(n))&&(n[t]=void 0,delete n[t]),n&&LocalStorage.saveLocalData(e,utils.json2str(n))}}(),UE.plugins.defaultfilter=function(){var e=this;e.setOpt({allowDivTransToP:!0,disabledTableInTable:!0}),e.addInputRule(function(t){function n(e){for(;e&&"element"==e.type;){if("td"==e.tagName)return!0;e=e.parentNode}return!1}var i,o=this.options.allowDivTransToP;t.traversal(function(t){if("element"==t.type){if(!dtd.$cdata[t.tagName]&&e.options.autoClearEmptyNode&&dtd.$inline[t.tagName]&&!dtd.$empty[t.tagName]&&(!t.attrs||utils.isEmptyObject(t.attrs)))return void(t.firstChild()?"span"!=t.tagName||t.attrs&&!utils.isEmptyObject(t.attrs)||t.parentNode.removeChild(t,!0):t.parentNode.removeChild(t));switch(t.tagName){case"style":case"script":t.setAttr({cdata_tag:t.tagName,cdata_data:t.innerHTML()||"",_ue_custom_node_:"true"}),t.tagName="div",t.innerHTML("");break;case"a":(i=t.getAttr("href"))&&t.setAttr("_href",i);break;case"img":if((i=t.getAttr("src"))&&/^data:/.test(i)){t.parentNode.removeChild(t);break}t.setAttr("_src",t.getAttr("src"));break;case"span":browser.webkit&&(i=t.getStyle("white-space"))&&/nowrap|normal/.test(i)&&(t.setStyle("white-space",""),e.options.autoClearEmptyNode&&utils.isEmptyObject(t.attrs)&&t.parentNode.removeChild(t,!0)),i=t.getAttr("id"),i&&/^_baidu_bookmark_/i.test(i)&&t.parentNode.removeChild(t);break;case"p":(i=t.getAttr("align"))&&(t.setAttr("align"),t.setStyle("text-align",i)),utils.each(t.children,function(e){if("element"==e.type&&"p"==e.tagName){var n=e.nextSibling();t.parentNode.insertAfter(e,t);for(var i=e;n;){var o=n.nextSibling();t.parentNode.insertAfter(n,i),i=n,n=o}return!1}}),t.firstChild()||t.innerHTML(browser.ie?"&nbsp;":"<br/>");break;case"div":if(t.getAttr("cdata_tag"))break;if((i=t.getAttr("class"))&&/^line number\d+/.test(i))break;if(!o)break;for(var r,a=UE.uNode.createElement("p");r=t.firstChild();)"text"!=r.type&&UE.dom.dtd.$block[r.tagName]?a.firstChild()?(t.parentNode.insertBefore(a,t),a=UE.uNode.createElement("p")):t.parentNode.insertBefore(r,t):a.appendChild(r);a.firstChild()&&t.parentNode.insertBefore(a,t),t.parentNode.removeChild(t);break;case"dl":t.tagName="ul";break;case"dt":case"dd":t.tagName="li";break;case"li":var s=t.getAttr("class");s&&/list\-/.test(s)||t.setAttr();var l=t.getNodesByTagName("ol ul");UE.utils.each(l,function(e){t.parentNode.insertAfter(e,t)});break;case"td":case"th":case"caption":t.children&&t.children.length||t.appendChild(browser.ie11below?UE.uNode.createText(" "):UE.uNode.createElement("br"));break;case"table":e.options.disabledTableInTable&&n(t)&&(t.parentNode.insertBefore(UE.uNode.createText(t.innerText()),t),t.parentNode.removeChild(t))}}})}),e.addOutputRule(function(t){var n;t.traversal(function(t){if("element"==t.type){if(e.options.autoClearEmptyNode&&dtd.$inline[t.tagName]&&!dtd.$empty[t.tagName]&&(!t.attrs||utils.isEmptyObject(t.attrs)))return void(t.firstChild()?"span"!=t.tagName||t.attrs&&!utils.isEmptyObject(t.attrs)||t.parentNode.removeChild(t,!0):t.parentNode.removeChild(t));switch(t.tagName){case"div":(n=t.getAttr("cdata_tag"))&&(t.tagName=n,t.appendChild(UE.uNode.createText(t.getAttr("cdata_data"))),t.setAttr({cdata_tag:"",cdata_data:"",_ue_custom_node_:""}));break;case"a":(n=t.getAttr("_href"))&&t.setAttr({href:utils.html(n),_href:""});break;case"span":n=t.getAttr("id"),n&&/^_baidu_bookmark_/i.test(n)&&t.parentNode.removeChild(t);break;case"img":(n=t.getAttr("_src"))&&t.setAttr({src:t.getAttr("_src"),_src:""})}}})})},UE.commands.inserthtml={execCommand:function(e,t,n){var i,o,r=this;if(t&&!0!==r.fireEvent("beforeinserthtml",t)){if(i=r.selection.getRange(),o=i.document.createElement("div"),o.style.display="inline",!n){var a=UE.htmlparser(t);r.options.filterRules&&UE.filterNode(a,r.options.filterRules),r.filterInputRule(a),t=a.toHtml()}if(o.innerHTML=utils.trim(t),!i.collapsed){var s=i.startContainer;if(domUtils.isFillChar(s)&&i.setStartBefore(s),s=i.endContainer,domUtils.isFillChar(s)&&i.setEndAfter(s),i.txtToElmBoundary(),i.endContainer&&1==i.endContainer.nodeType&&(s=i.endContainer.childNodes[i.endOffset])&&domUtils.isBr(s)&&i.setEndAfter(s),0==i.startOffset&&(s=i.startContainer,domUtils.isBoundaryNode(s,"firstChild")&&(s=i.endContainer,i.endOffset==(3==s.nodeType?s.nodeValue.length:s.childNodes.length)&&domUtils.isBoundaryNode(s,"lastChild")&&(r.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",i.setStart(r.body.firstChild,0).collapse(!0)))),!i.collapsed&&i.deleteContents(),1==i.startContainer.nodeType){var l,d=i.startContainer.childNodes[i.startOffset];if(d&&domUtils.isBlockElm(d)&&(l=d.previousSibling)&&domUtils.isBlockElm(l)){for(i.setEnd(l,l.childNodes.length).collapse();d.firstChild;)l.appendChild(d.firstChild);domUtils.remove(d)}}}var d,c,l,u,m,f=0;i.inFillChar()&&(d=i.startContainer,domUtils.isFillChar(d)?(i.setStartBefore(d).collapse(!0),domUtils.remove(d)):domUtils.isFillChar(d,!0)&&(d.nodeValue=d.nodeValue.replace(fillCharReg,""),i.startOffset--,i.collapsed&&i.collapse(!0)));var h=domUtils.findParentByTagName(i.startContainer,"li",!0);if(h){for(var p,g;d=o.firstChild;){for(;d&&(3==d.nodeType||!domUtils.isBlockElm(d)||"HR"==d.tagName);)p=d.nextSibling,i.insertNode(d).collapse(),g=d,d=p;if(d)if(/^(ol|ul)$/i.test(d.tagName)){for(;d.firstChild;)g=d.firstChild,domUtils.insertAfter(h,d.firstChild),h=h.nextSibling;domUtils.remove(d)}else{var v;p=d.nextSibling,v=r.document.createElement("li"),domUtils.insertAfter(h,v),v.appendChild(d),g=d,d=p,h=v}}h=domUtils.findParentByTagName(i.startContainer,"li",!0),domUtils.isEmptyBlock(h)&&domUtils.remove(h),g&&i.setStartAfter(g).collapse(!0).select(!0)}else{for(;d=o.firstChild;){if(f){for(var b=r.document.createElement("p");d&&(3==d.nodeType||!dtd.$block[d.tagName]);)m=d.nextSibling,b.appendChild(d),d=m;b.firstChild&&(d=b)}if(i.insertNode(d),m=d.nextSibling,!f&&d.nodeType==domUtils.NODE_ELEMENT&&domUtils.isBlockElm(d)&&(c=domUtils.findParent(d,function(e){return domUtils.isBlockElm(e)}))&&"body"!=c.tagName.toLowerCase()&&(!dtd[c.tagName][d.nodeName]||d.parentNode!==c)){if(dtd[c.tagName][d.nodeName])for(u=d.parentNode;u!==c;)l=u,u=u.parentNode;else l=c;domUtils.breakParent(d,l||u);var l=d.previousSibling;domUtils.trimWhiteTextNode(l),l.childNodes.length||domUtils.remove(l),!browser.ie&&(p=d.nextSibling)&&domUtils.isBlockElm(p)&&p.lastChild&&!domUtils.isBr(p.lastChild)&&p.appendChild(r.document.createElement("br")),f=1}var p=d.nextSibling;if(!o.firstChild&&p&&domUtils.isBlockElm(p)){i.setStart(p,0).collapse(!0);break}i.setEndAfter(d).collapse()}if(d=i.startContainer,m&&domUtils.isBr(m)&&domUtils.remove(m),domUtils.isBlockElm(d)&&domUtils.isEmptyNode(d))if(m=d.nextSibling)domUtils.remove(d),1==m.nodeType&&dtd.$block[m.tagName]&&i.setStart(m,0).collapse(!0).shrinkBoundary();else try{d.innerHTML=browser.ie?domUtils.fillChar:"<br/>"}catch(e){i.setStartBefore(d),domUtils.remove(d)}try{i.select(!0)}catch(e){}}setTimeout(function(){i=r.selection.getRange(),i.scrollToView(r.autoHeightEnabled,r.autoHeightEnabled?domUtils.getXY(r.iframe).y:0),r.fireEvent("afterinserthtml",t)},200)}}},UE.plugins.autotypeset=function(){function e(e,t){return e&&3!=e.nodeType?domUtils.isBr(e)?1:e&&e.parentNode&&c[e.tagName.toLowerCase()]?r&&r.contains(e)||e.getAttribute("pagebreak")?0:t?!domUtils.isEmptyBlock(e):domUtils.isEmptyBlock(e,new RegExp("[\\s"+domUtils.fillChar+"]","g")):void 0:0}function t(e){e.style.cssText||(domUtils.removeAttributes(e,["style"]),"span"==e.tagName.toLowerCase()&&domUtils.hasNoAttributes(e)&&domUtils.remove(e,!0))}function n(n,a){var c,u=this;if(a){if(!s.pasteFilter)return;c=u.document.createElement("div"),c.innerHTML=a.html}else c=u.document.body;for(var m,f=domUtils.getElementsByTagName(c,"*"),h=0;m=f[h++];)if(!0!==u.fireEvent("excludeNodeinautotype",m)){if(s.clearFontSize&&m.style.fontSize&&(domUtils.removeStyle(m,"font-size"),t(m)),s.clearFontFamily&&m.style.fontFamily&&(domUtils.removeStyle(m,"font-family"),t(m)),e(m)){if(s.mergeEmptyline)for(var p,g=m.nextSibling,v=domUtils.isBr(m);e(g)&&(p=g,g=p.nextSibling,!v||g&&(!g||domUtils.isBr(g)));)domUtils.remove(p);if(s.removeEmptyline&&domUtils.inDoc(m,c)&&!d[m.parentNode.tagName.toLowerCase()]){if(domUtils.isBr(m)&&(g=m.nextSibling)&&!domUtils.isBr(g))continue;domUtils.remove(m);continue}}if(e(m,!0)&&"SPAN"!=m.tagName&&(s.indent&&(m.style.textIndent=s.indentValue),s.textAlign&&(m.style.textAlign=s.textAlign)),s.removeClass&&m.className&&!l[m.className.toLowerCase()]){if(r&&r.contains(m))continue;domUtils.removeAttributes(m,["class"])}if(s.imageBlockLine&&"img"==m.tagName.toLowerCase()&&!m.getAttribute("emotion"))if(a){var b=m;switch(s.imageBlockLine){case"left":case"right":case"none":for(var p,y,g,C=b.parentNode;dtd.$inline[C.tagName]||"A"==C.tagName;)C=C.parentNode;if(p=C,"P"==p.tagName&&"center"==domUtils.getStyle(p,"text-align")&&!domUtils.isBody(p)&&1==domUtils.getChildCount(p,function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)}))if(y=p.previousSibling,g=p.nextSibling,y&&g&&1==y.nodeType&&1==g.nodeType&&y.tagName==g.tagName&&domUtils.isBlockElm(y)){for(y.appendChild(p.firstChild);g.firstChild;)y.appendChild(g.firstChild);domUtils.remove(p),domUtils.remove(g)}else domUtils.setStyle(p,"text-align","");domUtils.setStyle(b,"float",s.imageBlockLine);break;case"center":if("center"!=u.queryCommandValue("imagefloat")){for(C=b.parentNode,domUtils.setStyle(b,"float","none"),p=b;C&&1==domUtils.getChildCount(C,function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)})&&(dtd.$inline[C.tagName]||"A"==C.tagName);)p=C,C=C.parentNode;var x=u.document.createElement("p");domUtils.setAttributes(x,{style:"text-align:center"}),p.parentNode.insertBefore(x,p),x.appendChild(p),domUtils.setStyle(p,"float","")}}}else{var w=u.selection.getRange();w.selectNode(m).select(),u.execCommand("imagefloat",s.imageBlockLine)}s.removeEmptyNode&&s.removeTagNames[m.tagName.toLowerCase()]&&domUtils.hasNoAttributes(m)&&domUtils.isEmptyBlock(m)&&domUtils.remove(m)}if(s.tobdc){var N=UE.htmlparser(c.innerHTML);N.traversal(function(e){"text"==e.type&&(e.data=o(e.data))}),c.innerHTML=N.toHtml()}if(s.bdc2sb){var N=UE.htmlparser(c.innerHTML);N.traversal(function(e){"text"==e.type&&(e.data=i(e.data))}),c.innerHTML=N.toHtml()}a&&(a.html=c.innerHTML)}function i(e){for(var t="",n=0;n<e.length;n++){var i=e.charCodeAt(n);t+=i>=65281&&i<=65373?String.fromCharCode(e.charCodeAt(n)-65248):12288==i?String.fromCharCode(e.charCodeAt(n)-12288+32):e.charAt(n)}return t}function o(e){e=utils.html(e);for(var t="",n=0;n<e.length;n++)32==e.charCodeAt(n)?t+=String.fromCharCode(12288):e.charCodeAt(n)<127?t+=String.fromCharCode(e.charCodeAt(n)+65248):t+=e.charAt(n);return t}this.setOpt({autotypeset:{mergeEmptyline:!0,removeClass:!0,removeEmptyline:!1,textAlign:"left",imageBlockLine:"center",pasteFilter:!1,clearFontSize:!1,clearFontFamily:!1,removeEmptyNode:!1,removeTagNames:utils.extend({div:1},dtd.$removeEmpty),indent:!1,indentValue:"2em",bdc2sb:!1,tobdc:!1}});var r,a=this,s=a.options.autotypeset,l={selectTdClass:1,pagebreak:1,anchorclass:1},d={li:1},c={div:1,p:1,blockquote:1,center:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,span:1};s&&(!function(){var e=a.getPreferences("autotypeset");utils.extend(a.options.autotypeset,e)}(),s.pasteFilter&&a.addListener("beforepaste",n),a.commands.autotypeset={execCommand:function(){a.removeListener("beforepaste",n),s.pasteFilter&&a.addListener("beforepaste",n),n.call(a)}})},UE.plugin.register("autosubmit",function(){return{shortcutkey:{autosubmit:"ctrl+13"},commands:{autosubmit:{execCommand:function(){var e=this,t=domUtils.findParentByTagName(e.iframe,"form",!1);if(t){if(!1===e.fireEvent("beforesubmit"))return;e.sync(),t.submit()}}}}}}),UE.plugin.register("background",function(){function e(e){var t={},n=e.split(";");return utils.each(n,function(e){var n=e.indexOf(":"),i=utils.trim(e.substr(0,n)).toLowerCase();i&&(t[i]=utils.trim(e.substr(n+1)||""))}),t}function t(e){if(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n+":"+e[n]+"; ");utils.cssRule(o,t.length?"body{"+t.join("")+"}":"",i.document)}else utils.cssRule(o,"",i.document)}var n,i=this,o="editor_background",r=new RegExp("body[\\s]*\\{(.+)\\}","i"),a=i.hasContents;return i.hasContents=function(){return!!i.queryCommandValue("background")||a.apply(i,arguments)},{bindEvents:{getAllHtml:function(e,t){var n=this.body,o=domUtils.getComputedStyle(n,"background-image"),r="";r=o.indexOf(i.options.imagePath)>0?o.substring(o.indexOf(i.options.imagePath),o.length-1).replace(/"|\(|\)/gi,""):"none"!=o?o.replace(/url\("?|"?\)/gi,""):"";var a='<style type="text/css">body{',s={"background-color":domUtils.getComputedStyle(n,"background-color")||"#ffffff","background-image":r?"url("+r+")":"","background-repeat":domUtils.getComputedStyle(n,"background-repeat")||"","background-position":browser.ie?domUtils.getComputedStyle(n,"background-position-x")+" "+domUtils.getComputedStyle(n,"background-position-y"):domUtils.getComputedStyle(n,"background-position"),height:domUtils.getComputedStyle(n,"height")};for(var l in s)s.hasOwnProperty(l)&&(a+=l+":"+s[l]+"; ");a+="}</style> ",t.push(a)},aftersetcontent:function(){0==n&&t()}},inputRule:function(i){n=!1,utils.each(i.getNodesByTagName("p"),function(i){var o=i.getAttr("data-background");o&&(n=!0,t(e(o)),i.parentNode.removeChild(i))})},outputRule:function(e){var t=this,n=(utils.cssRule(o,t.document)||"").replace(/[\n\r]+/g,"").match(r);n&&e.appendChild(UE.uNode.createElement('<p style="display:none;" data-background="'+utils.trim(n[1].replace(/"/g,"").replace(/[\s]+/g," "))+'"><br/></p>'))},commands:{background:{execCommand:function(e,n){t(n)},queryCommandValue:function(){var t=this,n=(utils.cssRule(o,t.document)||"").replace(/[\n\r]+/g,"").match(r);return n?e(n[1]):null},notNeedUndo:!0}}}}),UE.commands.imagefloat={execCommand:function(e,t){var n=this,i=n.selection.getRange();if(!i.collapsed){var o=i.getClosedNode();if(o&&"IMG"==o.tagName)switch(t){case"left":case"right":case"none":for(var r,a,s,l=o.parentNode;dtd.$inline[l.tagName]||"A"==l.tagName;)l=l.parentNode;if(r=l,"P"==r.tagName&&"center"==domUtils.getStyle(r,"text-align")){if(!domUtils.isBody(r)&&1==domUtils.getChildCount(r,function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)}))if(a=r.previousSibling,s=r.nextSibling,a&&s&&1==a.nodeType&&1==s.nodeType&&a.tagName==s.tagName&&domUtils.isBlockElm(a)){for(a.appendChild(r.firstChild);s.firstChild;)a.appendChild(s.firstChild);domUtils.remove(r),domUtils.remove(s)}else domUtils.setStyle(r,"text-align","");i.selectNode(o).select()}domUtils.setStyle(o,"float","none"==t?"":t),"none"==t&&domUtils.removeAttributes(o,"align");break;case"center":if("center"!=n.queryCommandValue("imagefloat")){for(l=o.parentNode,domUtils.setStyle(o,"float",""),domUtils.removeAttributes(o,"align"),r=o;l&&1==domUtils.getChildCount(l,function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)})&&(dtd.$inline[l.tagName]||"A"==l.tagName);)r=l,l=l.parentNode;i.setStartBefore(r).setCursor(!1),l=n.document.createElement("div"),l.appendChild(r),domUtils.setStyle(r,"float",""),n.execCommand("insertHtml",'<p id="_img_parent_tmp" style="text-align:center">'+l.innerHTML+"</p>"),r=n.document.getElementById("_img_parent_tmp"),r.removeAttribute("id"),r=r.firstChild,i.selectNode(r).select(),s=r.parentNode.nextSibling,s&&domUtils.isEmptyNode(s)&&domUtils.remove(s)}}}},queryCommandValue:function(){var e,t,n=this.selection.getRange();return n.collapsed?"none":(e=n.getClosedNode(),e&&1==e.nodeType&&"IMG"==e.tagName?(t=domUtils.getComputedStyle(e,"float")||e.getAttribute("align"),"none"==t&&(t="center"==domUtils.getComputedStyle(e.parentNode,"text-align")?"center":t),{left:1,right:1,center:1}[t]?t:"none"):"none")},queryCommandState:function(){var e,t=this.selection.getRange();return t.collapsed?-1:(e=t.getClosedNode(),e&&1==e.nodeType&&"IMG"==e.tagName?0:-1)}},UE.commands.insertimage={execCommand:function(e,t){function n(e){utils.each("width,height,border,hspace,vspace".split(","),function(t){e[t]&&(e[t]=parseInt(e[t],10)||0)}),utils.each("src,_src".split(","),function(t){e[t]&&(e[t]=utils.unhtmlForUrl(e[t]))}),utils.each("title,alt".split(","),function(t){e[t]&&(e[t]=utils.unhtml(e[t]))})}if(t=utils.isArray(t)?t:[t],t.length){var i=this,o=i.selection.getRange(),r=o.getClosedNode();if(!0!==i.fireEvent("beforeinsertimage",t)){if(!r||!/img/i.test(r.tagName)||"edui-faked-video"==r.className&&-1==r.className.indexOf("edui-upload-video")||r.getAttribute("word_img")){var a,s=[],l="";if(a=t[0],1==t.length)n(a),l='<img src="'+a.src+'" '+(a._src?' _src="'+a._src+'" ':"")+(a.width?'width="'+a.width+'" ':"")+(a.height?' height="'+a.height+'" ':"")+("left"==a.floatStyle||"right"==a.floatStyle?' style="float:'+a.floatStyle+';"':"")+(a.title&&""!=a.title?' title="'+a.title+'"':"")+(a.border&&"0"!=a.border?' border="'+a.border+'"':"")+(a.alt&&""!=a.alt?' alt="'+a.alt+'"':"")+(a.hspace&&"0"!=a.hspace?' hspace = "'+a.hspace+'"':"")+(a.vspace&&"0"!=a.vspace?' vspace = "'+a.vspace+'"':"")+"/>","center"==a.floatStyle&&(l='<p style="text-align: center">'+l+"</p>"),s.push(l);else for(var d=0;a=t[d++];)n(a),l="<p "+("center"==a.floatStyle?'style="text-align: center" ':"")+'><img src="'+a.src+'" '+(a.width?'width="'+a.width+'" ':"")+(a._src?' _src="'+a._src+'" ':"")+(a.height?' height="'+a.height+'" ':"")+' style="'+(a.floatStyle&&"center"!=a.floatStyle?"float:"+a.floatStyle+";":"")+(a.border||"")+'" '+(a.title?' title="'+a.title+'"':"")+" /></p>",s.push(l);i.execCommand("insertHtml",s.join(""))}else{var c=t.shift(),u=c.floatStyle;delete c.floatStyle,domUtils.setAttributes(r,c),i.execCommand("imagefloat",u),t.length>0&&(o.setStartAfter(r).setCursor(!1,!0),i.execCommand("insertimage",t))}i.fireEvent("afterinsertimage",t)}}}},UE.plugins.justify=function(){var e=domUtils.isBlockElm,t={left:1,right:1,center:1,justify:1},n=function(t,n){var i=t.createBookmark(),o=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase()&&!domUtils.isBookmarkNode(e):!domUtils.isWhitespace(e)};t.enlarge(!0);for(var r,a=t.createBookmark(),s=domUtils.getNextDomNode(a.start,!1,o),l=t.cloneRange();s&&!(domUtils.getPosition(s,a.end)&domUtils.POSITION_FOLLOWING);)if(3!=s.nodeType&&e(s))s=domUtils.getNextDomNode(s,!0,o);else{for(l.setStartBefore(s);s&&s!==a.end&&!e(s);)r=s,s=domUtils.getNextDomNode(s,!1,null,function(t){return!e(t)});l.setEndAfter(r);var d=l.getCommonAncestor();if(!domUtils.isBody(d)&&e(d))domUtils.setStyles(d,utils.isString(n)?{"text-align":n}:n),s=d;else{var c=t.document.createElement("p");domUtils.setStyles(c,utils.isString(n)?{"text-align":n}:n);var u=l.extractContents();c.appendChild(u),l.insertNode(c),s=c}s=domUtils.getNextDomNode(s,!1,o)}return t.moveToBookmark(a).moveToBookmark(i)};UE.commands.justify={execCommand:function(e,t){var i,o=this.selection.getRange();return o.collapsed&&(i=this.document.createTextNode("p"),o.insertNode(i)),n(o,t),i&&(o.setStartBefore(i).collapse(!0),domUtils.remove(i)),o.select(),!0},queryCommandValue:function(){var e=this.selection.getStart(),n=domUtils.getComputedStyle(e,"text-align");return t[n]?n:"left"},queryCommandState:function(){var e=this.selection.getStart();return e&&domUtils.findParentByTagName(e,["td","th","caption"],!0)?-1:0}}},UE.plugins.font=function(){function e(e){for(var t;(t=e.parentNode)&&"SPAN"==t.tagName&&1==domUtils.getChildCount(t,function(e){return!domUtils.isBookmarkNode(e)&&!domUtils.isBr(e)});)t.style.cssText+=e.style.cssText,domUtils.remove(e,!0),e=t}function t(e,t,n){if(a[t]&&(e.adjustmentBoundary(),!e.collapsed&&1==e.startContainer.nodeType)){var i=e.startContainer.childNodes[e.startOffset];if(i&&domUtils.isTagNode(i,"span")){var o=e.createBookmark();utils.each(domUtils.getElementsByTagName(i,"span"),function(e){e.parentNode&&!domUtils.isBookmarkNode(e)&&("backcolor"==t&&domUtils.getComputedStyle(e,"background-color").toLowerCase()===n||(domUtils.removeStyle(e,a[t]),0==e.style.cssText.replace(/^\s+$/,"").length&&domUtils.remove(e,!0)))}),e.moveToBookmark(o)}}}function n(n,i,o){var r,a=n.collapsed,s=n.createBookmark();if(a)for(r=s.start.parentNode;dtd.$inline[r.tagName];)r=r.parentNode;else r=domUtils.getCommonAncestor(s.start,s.end);utils.each(domUtils.getElementsByTagName(r,"span"),function(t){if(t.parentNode&&!domUtils.isBookmarkNode(t)){if(/\s*border\s*:\s*none;?\s*/i.test(t.style.cssText))return void(/^\s*border\s*:\s*none;?\s*$/.test(t.style.cssText)?domUtils.remove(t,!0):domUtils.removeStyle(t,"border"));if(/border/i.test(t.style.cssText)&&"SPAN"==t.parentNode.tagName&&/border/i.test(t.parentNode.style.cssText)&&(t.style.cssText=t.style.cssText.replace(/border[^:]*:[^;]+;?/gi,"")),"fontborder"!=i||"none"!=o)for(var n=t.nextSibling;n&&1==n.nodeType&&"SPAN"==n.tagName;)if(domUtils.isBookmarkNode(n)&&"fontborder"==i)t.appendChild(n),n=t.nextSibling;else{if(n.style.cssText==t.style.cssText&&(domUtils.moveChild(n,t),domUtils.remove(n)),t.nextSibling===n)break;n=t.nextSibling}if(e(t),browser.ie&&browser.version>8){var r=domUtils.findParent(t,function(e){return"SPAN"==e.tagName&&/background-color/.test(e.style.cssText)});r&&!/background-color/.test(t.style.cssText)&&(t.style.backgroundColor=r.style.backgroundColor)}}}),n.moveToBookmark(s),t(n,i,o)}var i=this,o={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration",strikethrough:"text-decoration",fontborder:"border"},r={underline:1,strikethrough:1,fontborder:1},a={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family"};i.setOpt({fontfamily:[{name:"songti",val:"宋体,SimSun"},{name:"yahei",val:"微软雅黑,Microsoft YaHei"},{name:"kaiti",val:"楷体,楷体_GB2312, SimKai"},{name:"heiti",val:"黑体, SimHei"},{name:"lishu",val:"隶书, SimLi"},{name:"andaleMono",val:"andale mono"},{name:"arial",val:"arial, helvetica,sans-serif"},{name:"arialBlack",val:"arial black,avant garde"},{name:"comicSansMs",val:"comic sans ms"},{name:"impact",val:"impact,chicago"},{name:"timesNewRoman",val:"times new roman"}],fontsize:[10,11,12,14,16,18,20,24,36]}),i.addInputRule(function(e){utils.each(e.getNodesByTagName("u s del font strike"),function(e){if("font"==e.tagName){var t=[];for(var n in e.attrs)switch(n){case"size":t.push("font-size:"+({1:"10",2:"12",3:"16",4:"18",5:"24",6:"32",7:"48"}[e.attrs[n]]||e.attrs[n])+"px");break;case"color":t.push("color:"+e.attrs[n]);break;case"face":t.push("font-family:"+e.attrs[n]);break;case"style":t.push(e.attrs[n])}e.attrs={style:t.join(";")}}else{var i="u"==e.tagName?"underline":"line-through";e.attrs={style:(e.getAttr("style")||"")+"text-decoration:"+i+";"}}e.tagName="span"})});for(var s in o)!function(e,t){UE.commands[e]={execCommand:function(i,o){o=o||(this.queryCommandState(i)?"none":"underline"==i?"underline":"fontborder"==i?"1px solid #000":"line-through");var a,s=this,l=this.selection.getRange();if("default"==o)l.collapsed&&(a=s.document.createTextNode("font"),l.insertNode(a).select()),s.execCommand("removeFormat","span,a",t),a&&(l.setStartBefore(a).collapse(!0),domUtils.remove(a)),n(l,i,o),l.select();else if(l.collapsed){var d=domUtils.findParentByTagName(l.startContainer,"span",!0);if(a=s.document.createTextNode("font"),!d||d.children.length||d[browser.ie?"innerText":"textContent"].replace(fillCharReg,"").length){if(l.insertNode(a),l.selectNode(a).select(),d=l.document.createElement("span"),r[e]){if(domUtils.findParentByTagName(a,"a",!0))return l.setStartBefore(a).setCursor(),void domUtils.remove(a);s.execCommand("removeFormat","span,a",t)}if(d.style.cssText=t+":"+o,a.parentNode.insertBefore(d,a),!browser.ie||browser.ie&&9==browser.version)for(var c=d.parentNode;!domUtils.isBlockElm(c);)"SPAN"==c.tagName&&(d.style.cssText=c.style.cssText+";"+d.style.cssText),c=c.parentNode;opera?setTimeout(function(){l.setStart(d,0).collapse(!0),n(l,i,o),l.select()}):(l.setStart(d,0).collapse(!0),n(l,i,o),l.select())}else l.insertNode(a),r[e]&&(l.selectNode(a).select(),s.execCommand("removeFormat","span,a",t,null),d=domUtils.findParentByTagName(a,"span",!0),l.setStartBefore(a)),d&&(d.style.cssText+=";"+t+":"+o),l.collapse(!0).select();domUtils.remove(a)}else r[e]&&s.queryCommandValue(e)&&s.execCommand("removeFormat","span,a",t),l=s.selection.getRange(),l.applyInlineStyle("span",{style:t+":"+o}),n(l,i,o),l.select();return!0},queryCommandValue:function(e){var n=this.selection.getStart();if("underline"==e||"strikethrough"==e){for(var i,o=n;o&&!domUtils.isBlockElm(o)&&!domUtils.isBody(o);){if(1==o.nodeType&&"none"!=(i=domUtils.getComputedStyle(o,t)))return i;o=o.parentNode}return"none"}if("fontborder"==e){for(var r,a=n;a&&dtd.$inline[a.tagName];){if((r=domUtils.getComputedStyle(a,"border"))&&/1px/.test(r)&&/solid/.test(r))return r;a=a.parentNode}return""}if("FontSize"==e){var s=domUtils.getComputedStyle(n,t),a=/^([\d\.]+)(\w+)$/.exec(s);return a?Math.floor(a[1])+a[2]:s}return domUtils.getComputedStyle(n,t)},queryCommandState:function(e){if(!r[e])return 0;var t=this.queryCommandValue(e);return"fontborder"==e?/1px/.test(t)&&/solid/.test(t):"underline"==e?/underline/.test(t):/line\-through/.test(t)}}}(s,o[s])},UE.plugins.link=function(){function e(e){var t=e.startContainer,n=e.endContainer;(t=domUtils.findParentByTagName(t,"a",!0))&&e.setStartBefore(t),(n=domUtils.findParentByTagName(n,"a",!0))&&e.setEndAfter(n)}function t(t,n,i){var o=t.cloneRange(),r=i.queryCommandValue("link");e(t=t.adjustmentBoundary());var a=t.startContainer;if(1==a.nodeType&&r&&(a=a.childNodes[t.startOffset])&&1==a.nodeType&&"A"==a.tagName&&/^(?:https?|ftp|file)\s*:\s*\/\//.test(a[browser.ie?"innerText":"textContent"])&&(a[browser.ie?"innerText":"textContent"]=utils.html(n.textValue||n.href)),o.collapsed&&!r||(t.removeInlineStyle("a"),o=t.cloneRange()),o.collapsed){var s=t.document.createElement("a"),l="";n.textValue?(l=utils.html(n.textValue),delete n.textValue):l=utils.html(n.href),domUtils.setAttributes(s,n),a=domUtils.findParentByTagName(o.startContainer,"a",!0),a&&domUtils.isInNodeEndBoundary(o,a)&&t.setStartAfter(a).collapse(!0),s[browser.ie?"innerText":"textContent"]=l,t.insertNode(s).selectNode(s)}else t.applyInlineStyle("a",n)}UE.commands.unlink={execCommand:function(){var t,n=this.selection.getRange();n.collapsed&&!domUtils.findParentByTagName(n.startContainer,"a",!0)||(t=n.createBookmark(),e(n),n.removeInlineStyle("a").moveToBookmark(t).select())},queryCommandState:function(){return!this.highlight&&this.queryCommandValue("link")?0:-1}},UE.commands.link={execCommand:function(e,n){var i;n._href&&(n._href=utils.unhtml(n._href,/[<">]/g)),n.href&&(n.href=utils.unhtml(n.href,/[<">]/g)),n.textValue&&(n.textValue=utils.unhtml(n.textValue,/[<">]/g)),t(i=this.selection.getRange(),n,this),i.collapse().select(!0)},queryCommandValue:function(){var e,t=this.selection.getRange();if(!t.collapsed){t.shrinkBoundary();var n=3!=t.startContainer.nodeType&&t.startContainer.childNodes[t.startOffset]?t.startContainer.childNodes[t.startOffset]:t.startContainer,i=3==t.endContainer.nodeType||0==t.endOffset?t.endContainer:t.endContainer.childNodes[t.endOffset-1],o=t.getCommonAncestor();if(!(e=domUtils.findParentByTagName(o,"a",!0))&&1==o.nodeType)for(var r,a,s,l=o.getElementsByTagName("a"),d=0;s=l[d++];)if(r=domUtils.getPosition(s,n),a=domUtils.getPosition(s,i),(r&domUtils.POSITION_FOLLOWING||r&domUtils.POSITION_CONTAINS)&&(a&domUtils.POSITION_PRECEDING||a&domUtils.POSITION_CONTAINS)){e=s;break}return e}if(e=t.startContainer,(e=1==e.nodeType?e:e.parentNode)&&(e=domUtils.findParentByTagName(e,"a",!0))&&!domUtils.isInNodeEndBoundary(t,e))return e},queryCommandState:function(){var e=this.selection.getRange().getClosedNode();return!e||"edui-faked-video"!=e.className&&-1==e.className.indexOf("edui-upload-video")?0:-1}}},UE.plugins.insertframe=function(){function e(){t._iframe&&delete t._iframe}var t=this;t.addListener("selectionchange",function(){e()})},UE.commands.scrawl={queryCommandState:function(){return browser.ie&&browser.version<=8?-1:0}},UE.plugins.removeformat=function(){var e=this;e.setOpt({removeFormatTags:"b,big,code,del,dfn,em,font,i,ins,kbd,q,samp,small,span,strike,strong,sub,sup,tt,u,var",removeFormatAttributes:"class,style,lang,width,height,align,hspace,valign"}),e.commands.removeformat={execCommand:function(e,t,n,i,o){function r(e){if(3==e.nodeType||"span"!=e.tagName.toLowerCase())return 0;if(browser.ie){var t=e.attributes;if(t.length){for(var n=0,i=t.length;n<i;n++)if(t[n].specified)return 0;return 1}}return!e.attributes.length}var a,s,l=new RegExp("^(?:"+(t||this.options.removeFormatTags).replace(/,/g,"|")+")$","i"),d=n?[]:(i||this.options.removeFormatAttributes).split(","),c=new dom.Range(this.document),u=function(e){return 1==e.nodeType};c=this.selection.getRange(),function(e){var t=e.createBookmark();if(e.collapsed&&e.enlarge(!0),!o){var i=domUtils.findParentByTagName(e.startContainer,"a",!0);i&&e.setStartBefore(i),(i=domUtils.findParentByTagName(e.endContainer,"a",!0))&&e.setEndAfter(i)}for(a=e.createBookmark(),p=a.start;(s=p.parentNode)&&!domUtils.isBlockElm(s);)domUtils.breakParent(p,s),domUtils.clearEmptySibling(p);if(a.end){for(p=a.end;(s=p.parentNode)&&!domUtils.isBlockElm(s);)domUtils.breakParent(p,s),domUtils.clearEmptySibling(p);for(var c,m=domUtils.getNextDomNode(a.start,!1,u);m&&m!=a.end;)c=domUtils.getNextDomNode(m,!0,u),dtd.$empty[m.tagName.toLowerCase()]||domUtils.isBookmarkNode(m)||(l.test(m.tagName)?n?(domUtils.removeStyle(m,n),r(m)&&"text-decoration"!=n&&domUtils.remove(m,!0)):domUtils.remove(m,!0):dtd.$tableContent[m.tagName]||dtd.$list[m.tagName]||(domUtils.removeAttributes(m,d),r(m)&&domUtils.remove(m,!0))),m=c}var f=a.start.parentNode;!domUtils.isBlockElm(f)||dtd.$tableContent[f.tagName]||dtd.$list[f.tagName]||domUtils.removeAttributes(f,d),f=a.end.parentNode,a.end&&domUtils.isBlockElm(f)&&!dtd.$tableContent[f.tagName]&&!dtd.$list[f.tagName]&&domUtils.removeAttributes(f,d),e.moveToBookmark(a).moveToBookmark(t);for(var h,p=e.startContainer,g=e.collapsed;1==p.nodeType&&domUtils.isEmptyNode(p)&&dtd.$removeEmpty[p.tagName];)h=p.parentNode,e.setStartBefore(p),e.startContainer===e.endContainer&&e.endOffset--,domUtils.remove(p),p=h;if(!g)for(p=e.endContainer;1==p.nodeType&&domUtils.isEmptyNode(p)&&dtd.$removeEmpty[p.tagName];)h=p.parentNode,e.setEndBefore(p),domUtils.remove(p),p=h}(c),c.select()}}},UE.plugins.blockquote=function(){function e(e){return domUtils.filterNodeList(e.selection.getStartElementPath(),"blockquote")}this.commands.blockquote={execCommand:function(t,n){var i=this.selection.getRange(),o=e(this),r=dtd.blockquote,a=i.createBookmark();if(o){var s=i.startContainer,l=domUtils.isBlockElm(s)?s:domUtils.findParent(s,function(e){return domUtils.isBlockElm(e)}),d=i.endContainer,c=domUtils.isBlockElm(d)?d:domUtils.findParent(d,function(e){return domUtils.isBlockElm(e)});l=domUtils.findParentByTagName(l,"li",!0)||l,c=domUtils.findParentByTagName(c,"li",!0)||c,"LI"==l.tagName||"TD"==l.tagName||l===o||domUtils.isBody(l)?domUtils.remove(o,!0):domUtils.breakParent(l,o),l!==c&&(o=domUtils.findParentByTagName(c,"blockquote"))&&("LI"==c.tagName||"TD"==c.tagName||domUtils.isBody(c)?o.parentNode&&domUtils.remove(o,!0):domUtils.breakParent(c,o));for(var u,m=domUtils.getElementsByTagName(this.document,"blockquote"),f=0;u=m[f++];)u.childNodes.length?domUtils.getPosition(u,l)&domUtils.POSITION_FOLLOWING&&domUtils.getPosition(u,c)&domUtils.POSITION_PRECEDING&&domUtils.remove(u,!0):domUtils.remove(u)}else{for(var h=i.cloneRange(),p=1==h.startContainer.nodeType?h.startContainer:h.startContainer.parentNode,g=p,v=1;;){if(domUtils.isBody(p)){g!==p?i.collapsed?(h.selectNode(g),v=0):h.setStartBefore(g):h.setStart(p,0);break}if(!r[p.tagName]){i.collapsed?h.selectNode(g):h.setStartBefore(g);break}g=p,p=p.parentNode}if(v)for(g=p=p=1==h.endContainer.nodeType?h.endContainer:h.endContainer.parentNode;;){if(domUtils.isBody(p)){g!==p?h.setEndAfter(g):h.setEnd(p,p.childNodes.length);break}if(!r[p.tagName]){h.setEndAfter(g);break}g=p,p=p.parentNode}p=i.document.createElement("blockquote"),domUtils.setAttributes(p,n),p.appendChild(h.extractContents()),h.insertNode(p);for(var b,y=domUtils.getElementsByTagName(p,"blockquote"),f=0;b=y[f++];)b.parentNode&&domUtils.remove(b,!0)}i.moveToBookmark(a).select()},queryCommandState:function(){return e(this)?1:0}}},UE.commands.touppercase=UE.commands.tolowercase={execCommand:function(e){var t=this,n=t.selection.getRange();if(n.collapsed)return n;for(var i=n.createBookmark(),o=i.end,r=function(e){return!domUtils.isBr(e)&&!domUtils.isWhitespace(e)},a=domUtils.getNextDomNode(i.start,!1,r);a&&domUtils.getPosition(a,o)&domUtils.POSITION_PRECEDING&&(3==a.nodeType&&(a.nodeValue=a.nodeValue["touppercase"==e?"toUpperCase":"toLowerCase"]()),(a=domUtils.getNextDomNode(a,!0,r))!==o););n.moveToBookmark(i).select()}},UE.commands.indent={execCommand:function(){var e=this,t=e.queryCommandState("indent")?"0em":e.options.indentValue||"2em";e.execCommand("Paragraph","p",{style:"text-indent:"+t})},queryCommandState:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return e&&e.style.textIndent&&parseInt(e.style.textIndent)?1:0}},UE.commands.print={execCommand:function(){this.window.print()},notNeedUndo:1},UE.commands.preview={execCommand:function(){var e=window.open("","_blank",""),t=e.document;t.open(),t.write('<!DOCTYPE html><html><head><meta charset="utf-8"/><script src="'+this.options.UEDITOR_HOME_URL+"ueditor.parse.js\"><\/script><script>setTimeout(function(){uParse('div',{rootPath: '"+this.options.UEDITOR_HOME_URL+"'})},300)<\/script></head><body><div>"+this.getContent(null,null,!0)+"</div></body></html>"),t.close()},notNeedUndo:1},UE.plugins.selectall=function(){var e=this;e.commands.selectall={execCommand:function(){var e=this,t=e.body,n=e.selection.getRange();n.selectNodeContents(t),domUtils.isEmptyBlock(t)&&(browser.opera&&t.firstChild&&1==t.firstChild.nodeType&&n.setStartAtFirst(t.firstChild),n.collapse(!0)),n.select(!0)},notNeedUndo:1},e.addshortcutkey({selectAll:"ctrl+65"})},UE.plugins.paragraph=function(){var e=this,t=domUtils.isBlockElm,n=["TD","LI","PRE"],i=function(e,i,o,r){var a,s=e.createBookmark(),l=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase()&&!domUtils.isBookmarkNode(e):!domUtils.isWhitespace(e)};e.enlarge(!0);for(var d,c=e.createBookmark(),u=domUtils.getNextDomNode(c.start,!1,l),m=e.cloneRange();u&&!(domUtils.getPosition(u,c.end)&domUtils.POSITION_FOLLOWING);)if(3!=u.nodeType&&t(u))u=domUtils.getNextDomNode(u,!0,l);else{for(m.setStartBefore(u);u&&u!==c.end&&!t(u);)d=u,u=domUtils.getNextDomNode(u,!1,null,function(e){return!t(e)});m.setEndAfter(d),a=e.document.createElement(i),o&&(domUtils.setAttributes(a,o),r&&"customstyle"==r&&o.style&&(a.style.cssText=o.style)),a.appendChild(m.extractContents()),domUtils.isEmptyNode(a)&&domUtils.fillChar(e.document,a),m.insertNode(a);var f=a.parentNode;t(f)&&!domUtils.isBody(a.parentNode)&&-1==utils.indexOf(n,f.tagName)&&(r&&"customstyle"==r||(f.getAttribute("dir")&&a.setAttribute("dir",f.getAttribute("dir")),f.style.cssText&&(a.style.cssText=f.style.cssText+";"+a.style.cssText),f.style.textAlign&&!a.style.textAlign&&(a.style.textAlign=f.style.textAlign),f.style.textIndent&&!a.style.textIndent&&(a.style.textIndent=f.style.textIndent),f.style.padding&&!a.style.padding&&(a.style.padding=f.style.padding)),o&&/h\d/i.test(f.tagName)&&!/h\d/i.test(a.tagName)?(domUtils.setAttributes(f,o),r&&"customstyle"==r&&o.style&&(f.style.cssText=o.style),domUtils.remove(a,!0),a=f):domUtils.remove(a.parentNode,!0)),u=-1!=utils.indexOf(n,f.tagName)?f:a,u=domUtils.getNextDomNode(u,!1,l)}return e.moveToBookmark(c).moveToBookmark(s)};e.setOpt("paragraph",{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""}),e.commands.paragraph={execCommand:function(e,t,n,o){var r=this.selection.getRange();if(r.collapsed){var a=this.document.createTextNode("p");if(r.insertNode(a),browser.ie){var s=a.previousSibling;s&&domUtils.isWhitespace(s)&&domUtils.remove(s),s=a.nextSibling,s&&domUtils.isWhitespace(s)&&domUtils.remove(s)}}if(r=i(r,t,n,o),a&&(r.setStartBefore(a).collapse(!0),pN=a.parentNode,domUtils.remove(a),domUtils.isBlockElm(pN)&&domUtils.isEmptyNode(pN)&&domUtils.fillNode(this.document,pN)),browser.gecko&&r.collapsed&&1==r.startContainer.nodeType){var l=r.startContainer.childNodes[r.startOffset];l&&1==l.nodeType&&l.tagName.toLowerCase()==t&&r.setStart(l,0).collapse(!0)}return r.select(),!0},queryCommandValue:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return e?e.tagName.toLowerCase():""}}},function(){var e=domUtils.isBlockElm,t=function(e){return domUtils.filterNodeList(e.selection.getStartElementPath(),function(e){return e&&1==e.nodeType&&e.getAttribute("dir")})},n=function(n,i,o){var r,a=function(e){return 1==e.nodeType?!domUtils.isBookmarkNode(e):!domUtils.isWhitespace(e)},s=t(i);if(s&&n.collapsed)return s.setAttribute("dir",o),n;r=n.createBookmark(),n.enlarge(!0);for(var l,d=n.createBookmark(),c=domUtils.getNextDomNode(d.start,!1,a),u=n.cloneRange();c&&!(domUtils.getPosition(c,d.end)&domUtils.POSITION_FOLLOWING);)if(3!=c.nodeType&&e(c))c=domUtils.getNextDomNode(c,!0,a);else{for(u.setStartBefore(c);c&&c!==d.end&&!e(c);)l=c,c=domUtils.getNextDomNode(c,!1,null,function(t){return!e(t)});u.setEndAfter(l);var m=u.getCommonAncestor();if(!domUtils.isBody(m)&&e(m))m.setAttribute("dir",o),c=m;else{var f=n.document.createElement("p");f.setAttribute("dir",o);var h=u.extractContents();f.appendChild(h),u.insertNode(f),c=f}c=domUtils.getNextDomNode(c,!1,a)}return n.moveToBookmark(d).moveToBookmark(r)};UE.commands.directionality={execCommand:function(e,t){var i=this.selection.getRange();if(i.collapsed){var o=this.document.createTextNode("d");i.insertNode(o)}return n(i,this,t),o&&(i.setStartBefore(o).collapse(!0),domUtils.remove(o)),i.select(),!0},queryCommandValue:function(){var e=t(this);return e?e.getAttribute("dir"):"ltr"}}}(),UE.plugins.horizontal=function(){var e=this;e.commands.horizontal={execCommand:function(e){var t=this;if(-1!==t.queryCommandState(e)){t.execCommand("insertHtml","<hr>");var n=t.selection.getRange(),i=n.startContainer;if(1==i.nodeType&&!i.childNodes[n.startOffset]){var o;(o=i.childNodes[n.startOffset-1])&&1==o.nodeType&&"HR"==o.tagName&&("p"==t.options.enterTag?(o=t.document.createElement("p"),n.insertNode(o),n.setStart(o,0).setCursor()):(o=t.document.createElement("br"),n.insertNode(o),n.setStartBefore(o).setCursor()))}return!0}},queryCommandState:function(){return domUtils.filterNodeList(this.selection.getStartElementPath(),"table")?-1:0}},e.addListener("delkeydown",function(e,t){var n=this.selection.getRange();if(n.txtToElmBoundary(!0),domUtils.isStartInblock(n)){var i=n.startContainer,o=i.previousSibling;if(o&&domUtils.isTagNode(o,"hr"))return domUtils.remove(o),n.select(),domUtils.preventDefault(t),!0}})},UE.commands.time=UE.commands.date={execCommand:function(e,t){var n=new Date;this.execCommand("insertHtml","time"==e?function(e,t){var n=("0"+e.getHours()).slice(-2),i=("0"+e.getMinutes()).slice(-2),o=("0"+e.getSeconds()).slice(-2);return t=t||"hh:ii:ss",t.replace(/hh/gi,n).replace(/ii/gi,i).replace(/ss/gi,o)}(n,t):function(e,t){var n=("000"+e.getFullYear()).slice(-4),i=n.slice(-2),o=("0"+(e.getMonth()+1)).slice(-2),r=("0"+e.getDate()).slice(-2);return t=t||"yyyy-mm-dd",t.replace(/yyyy/gi,n).replace(/yy/gi,i).replace(/mm/gi,o).replace(/dd/gi,r)}(n,t))}},UE.plugins.rowspacing=function(){var e=this;e.setOpt({rowspacingtop:["5","10","15","20","25"],rowspacingbottom:["5","10","15","20","25"]}),e.commands.rowspacing={execCommand:function(e,t,n){return this.execCommand("paragraph","p",{style:"margin-"+n+":"+t+"px"}),!0},queryCommandValue:function(e,t){var n=domUtils.filterNodeList(this.selection.getStartElementPath(),function(e){return domUtils.isBlockElm(e)});return n?domUtils.getComputedStyle(n,"margin-"+t).replace(/[^\d]/g,"")||0:0}}},UE.plugins.lineheight=function(){var e=this;e.setOpt({lineheight:["1","1.5","1.75","2","3","4","5"]}),e.commands.lineheight={execCommand:function(e,t){return this.execCommand("paragraph","p",{style:"line-height:"+("1"==t?"normal":t+"em")}),!0},queryCommandValue:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),function(e){return domUtils.isBlockElm(e)});if(e){var t=domUtils.getComputedStyle(e,"line-height");return"normal"==t?1:t.replace(/[^\d.]*/gi,"")}}}},UE.plugins.insertcode=function(){var e=this;e.ready(function(){utils.cssRule("pre","pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}",e.document)}),e.setOpt("insertcode",{as3:"ActionScript3",bash:"Bash/Shell",cpp:"C/C++",css:"Css",cf:"CodeFunction","c#":"C#",delphi:"Delphi",diff:"Diff",erlang:"Erlang",groovy:"Groovy",html:"Html",java:"Java",jfx:"JavaFx",js:"Javascript",pl:"Perl",php:"Php",plain:"Plain Text",ps:"PowerShell",python:"Python",ruby:"Ruby",scala:"Scala",sql:"Sql",vb:"Vb",xml:"Xml"}),e.commands.insertcode={execCommand:function(e,t){var n=this,i=n.selection.getRange(),o=domUtils.findParentByTagName(i.startContainer,"pre",!0);if(o)o.className="brush:"+t+";toolbar:false;";else{var r="";if(i.collapsed)r=browser.ie&&browser.ie11below?browser.version<=8?"&nbsp;":"":"<br/>";else{var a=i.extractContents(),s=n.document.createElement("div");s.appendChild(a),utils.each(UE.filterNode(UE.htmlparser(s.innerHTML.replace(/[\r\t]/g,"")),n.options.filterTxtRules).children,function(e){if(browser.ie&&browser.ie11below&&browser.version>8)"element"==e.type?"br"==e.tagName?r+="\n":dtd.$empty[e.tagName]||(utils.each(e.children,function(t){"element"==t.type?"br"==t.tagName?r+="\n":dtd.$empty[e.tagName]||(r+=t.innerText()):r+=t.data}),/\n$/.test(r)||(r+="\n")):r+=e.data+"\n",!e.nextSibling()&&/\n$/.test(r)&&(r=r.replace(/\n$/,""));else if(browser.ie&&browser.ie11below)"element"==e.type?"br"==e.tagName?r+="<br>":dtd.$empty[e.tagName]||(utils.each(e.children,function(t){"element"==t.type?"br"==t.tagName?r+="<br>":dtd.$empty[e.tagName]||(r+=t.innerText()):r+=t.data}),/br>$/.test(r)||(r+="<br>")):r+=e.data+"<br>",!e.nextSibling()&&/<br>$/.test(r)&&(r=r.replace(/<br>$/,""));else if(r+="element"==e.type?dtd.$empty[e.tagName]?"":e.innerText():e.data,!/br\/?\s*>$/.test(r)){if(!e.nextSibling())return;r+="<br>"}})}n.execCommand("inserthtml",'<pre id="coder"class="brush:'+t+';toolbar:false">'+r+"</pre>",!0),o=n.document.getElementById("coder"),domUtils.removeAttributes(o,"id");var l=o.previousSibling;l&&(3==l.nodeType&&1==l.nodeValue.length&&browser.ie&&6==browser.version||domUtils.isEmptyBlock(l))&&domUtils.remove(l);var i=n.selection.getRange();domUtils.isEmptyBlock(o)?i.setStart(o,0).setCursor(!1,!0):i.selectNodeContents(o).select()}},queryCommandValue:function(){var e=this.selection.getStartElementPath(),t="";return utils.each(e,function(e){if("PRE"==e.nodeName){var n=e.className.match(/brush:([^;]+)/);return t=n&&n[1]?n[1]:"",!1}}),t}},e.addInputRule(function(e){utils.each(e.getNodesByTagName("pre"),function(e){var t=e.getNodesByTagName("br");if(t.length)return void(browser.ie&&browser.ie11below&&browser.version>8&&utils.each(t,function(e){var t=UE.uNode.createText("\n");e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e)}));if(!(browser.ie&&browser.ie11below&&browser.version>8)){var n=e.innerText().split(/\n/);e.innerHTML(""),utils.each(n,function(t){t.length&&e.appendChild(UE.uNode.createText(t)),e.appendChild(UE.uNode.createElement("br"))})}})}),e.addOutputRule(function(e){utils.each(e.getNodesByTagName("pre"),function(e){var t="";utils.each(e.children,function(e){"text"==e.type?t+=e.data.replace(/[ ]/g,"&nbsp;").replace(/\n$/,""):"br"==e.tagName?t+="\n":t+=dtd.$empty[e.tagName]?e.innerText():""}),e.innerText(t.replace(/(&nbsp;|\n)+$/,""))})}),e.notNeedCodeQuery={help:1,undo:1,redo:1,source:1,print:1,searchreplace:1,fullscreen:1,preview:1,insertparagraph:1,elementpath:1,insertcode:1,inserthtml:1,selectall:1};e.queryCommandState;e.queryCommandState=function(e){var t=this;return!t.notNeedCodeQuery[e.toLowerCase()]&&t.selection&&t.queryCommandValue("insertcode")?-1:UE.Editor.prototype.queryCommandState.apply(this,arguments)},e.addListener("beforeenterkeydown",function(){var t=e.selection.getRange(),n=domUtils.findParentByTagName(t.startContainer,"pre",!0);if(n){if(e.fireEvent("saveScene"),t.collapsed||t.deleteContents(),!browser.ie||browser.ie9above){var n,i=e.document.createElement("br");t.insertNode(i).setStartAfter(i).collapse(!0);i.nextSibling||browser.ie&&!(browser.version>10)?t.setStartAfter(i):t.insertNode(i.cloneNode(!1)),n=i.previousSibling;for(var o;n;)if(o=n,!(n=n.previousSibling)||"BR"==n.nodeName){n=o;break}if(n){for(var r="";n&&"BR"!=n.nodeName&&new RegExp("^[\\s"+domUtils.fillChar+"]*$").test(n.nodeValue);)r+=n.nodeValue,n=n.nextSibling;if("BR"!=n.nodeName){var a=n.nodeValue.match(new RegExp("^([\\s"+domUtils.fillChar+"]+)"));a&&a[1]&&(r+=a[1])}r&&(r=e.document.createTextNode(r),t.insertNode(r).setStartAfter(r))}t.collapse(!0).select(!0)}else if(browser.version>8){var s=e.document.createTextNode("\n"),l=t.startContainer;if(0==t.startOffset){var d=l.previousSibling;if(d){t.insertNode(s);var c=e.document.createTextNode(" ");t.setStartAfter(s).insertNode(c).setStart(c,0).collapse(!0).select(!0)}}else{t.insertNode(s).setStartAfter(s);var c=e.document.createTextNode(" ");l=t.startContainer.childNodes[t.startOffset],l&&!/^\n/.test(l.nodeValue)&&t.setStartBefore(s),t.insertNode(c).setStart(c,0).collapse(!0).select(!0)}}else{var i=e.document.createElement("br");t.insertNode(i),t.insertNode(e.document.createTextNode(domUtils.fillChar)),t.setStartAfter(i),n=i.previousSibling;for(var o;n;)if(o=n,!(n=n.previousSibling)||"BR"==n.nodeName){n=o;break}if(n){for(var r="";n&&"BR"!=n.nodeName&&new RegExp("^[ "+domUtils.fillChar+"]*$").test(n.nodeValue);)r+=n.nodeValue,n=n.nextSibling;if("BR"!=n.nodeName){var a=n.nodeValue.match(new RegExp("^([ "+domUtils.fillChar+"]+)"));a&&a[1]&&(r+=a[1])}r=e.document.createTextNode(r),t.insertNode(r).setStartAfter(r)}t.collapse(!0).select()}return e.fireEvent("saveScene"),!0}}),e.addListener("tabkeydown",function(t,n){var i=e.selection.getRange(),o=domUtils.findParentByTagName(i.startContainer,"pre",!0);if(o){if(e.fireEvent("saveScene"),n.shiftKey);else if(i.collapsed){var r=e.document.createTextNode("    ");i.insertNode(r).setStartAfter(r).collapse(!0).select(!0)}else{for(var a=i.createBookmark(),s=a.start.previousSibling;s;){if(o.firstChild===s&&!domUtils.isBr(s)){o.insertBefore(e.document.createTextNode("    "),s);break}if(domUtils.isBr(s)){o.insertBefore(e.document.createTextNode("    "),s.nextSibling);break}s=s.previousSibling}var l=a.end;for(s=a.start.nextSibling,o.firstChild===a.start&&o.insertBefore(e.document.createTextNode("    "),s.nextSibling);s&&s!==l;){if(domUtils.isBr(s)&&s.nextSibling){if(s.nextSibling===l)break;o.insertBefore(e.document.createTextNode("    "),s.nextSibling)}s=s.nextSibling}i.moveToBookmark(a).select()}return e.fireEvent("saveScene"),!0}}),e.addListener("beforeinserthtml",function(e,t){var n=this,i=n.selection.getRange();if(domUtils.findParentByTagName(i.startContainer,"pre",!0)){i.collapsed||i.deleteContents();var o="";if(browser.ie&&browser.version>8){utils.each(UE.filterNode(UE.htmlparser(t),n.options.filterTxtRules).children,function(e){"element"==e.type?"br"==e.tagName?o+="\n":dtd.$empty[e.tagName]||(utils.each(e.children,function(t){"element"==t.type?"br"==t.tagName?o+="\n":dtd.$empty[e.tagName]||(o+=t.innerText()):o+=t.data}),/\n$/.test(o)||(o+="\n")):o+=e.data+"\n",!e.nextSibling()&&/\n$/.test(o)&&(o=o.replace(/\n$/,""))});var r=n.document.createTextNode(utils.html(o.replace(/&nbsp;/g," ")));i.insertNode(r).selectNode(r).select()}else{var a=n.document.createDocumentFragment();utils.each(UE.filterNode(UE.htmlparser(t),n.options.filterTxtRules).children,function(e){"element"==e.type?"br"==e.tagName?a.appendChild(n.document.createElement("br")):dtd.$empty[e.tagName]||(utils.each(e.children,function(t){"element"==t.type?"br"==t.tagName?a.appendChild(n.document.createElement("br")):dtd.$empty[e.tagName]||a.appendChild(n.document.createTextNode(utils.html(t.innerText().replace(/&nbsp;/g," ")))):a.appendChild(n.document.createTextNode(utils.html(t.data.replace(/&nbsp;/g," "))))}),"BR"!=a.lastChild.nodeName&&a.appendChild(n.document.createElement("br"))):a.appendChild(n.document.createTextNode(utils.html(e.data.replace(/&nbsp;/g," ")))),e.nextSibling()||"BR"!=a.lastChild.nodeName||a.removeChild(a.lastChild)}),i.insertNode(a).select()}return!0}}),e.addListener("keydown",function(e,t){var n=this;if(40==(t.keyCode||t.which)){var i,o=n.selection.getRange(),r=o.startContainer;if(o.collapsed&&(i=domUtils.findParentByTagName(o.startContainer,"pre",!0))&&!i.nextSibling){for(var a=i.lastChild;a&&"BR"==a.nodeName;)a=a.previousSibling;(a===r||o.startContainer===i&&o.startOffset==i.childNodes.length)&&(n.execCommand("insertparagraph"),domUtils.preventDefault(t))}}}),e.addListener("delkeydown",function(t,n){var i=this.selection.getRange();i.txtToElmBoundary(!0);var o=i.startContainer;if(domUtils.isTagNode(o,"pre")&&i.collapsed&&domUtils.isStartInblock(i)){var r=e.document.createElement("p");return domUtils.fillNode(e.document,r),o.parentNode.insertBefore(r,o),domUtils.remove(o),i.setStart(r,0).setCursor(!1,!0),domUtils.preventDefault(n),!0}})},UE.commands.cleardoc={execCommand:function(e){var t=this,n=t.options.enterTag,i=t.selection.getRange();"br"==n?(t.body.innerHTML="<br/>",i.setStart(t.body,0).setCursor()):(t.body.innerHTML="<p>"+(ie?"":"<br/>")+"</p>",i.setStart(t.body.firstChild,0).setCursor(!1,!0)),setTimeout(function(){t.fireEvent("clearDoc")},0)}},UE.plugin.register("anchor",function(){return{bindEvents:{ready:function(){utils.cssRule("anchor",".anchorclass{background: url('"+this.options.themePath+this.options.theme+"/images/anchor.gif') no-repeat scroll left center transparent;cursor: auto;display: inline-block;height: 16px;width: 15px;}",this.document)}},outputRule:function(e){utils.each(e.getNodesByTagName("img"),function(e){var t;(t=e.getAttr("anchorname"))&&(e.tagName="a",e.setAttr({anchorname:"",name:t,class:""}))})},inputRule:function(e){utils.each(e.getNodesByTagName("a"),function(e){e.getAttr("name")&&!e.getAttr("href")&&(e.tagName="img",e.setAttr({anchorname:e.getAttr("name"),class:"anchorclass"}),e.setAttr("name"))})},commands:{anchor:{execCommand:function(e,t){var n=this.selection.getRange(),i=n.getClosedNode();if(i&&i.getAttribute("anchorname"))t?i.setAttribute("anchorname",t):(n.setStartBefore(i).setCursor(),domUtils.remove(i));else if(t){var o=this.document.createElement("img");n.collapse(!0),domUtils.setAttributes(o,{anchorname:t,class:"anchorclass"}),n.insertNode(o).setStartAfter(o).setCursor(!1,!0)}}}}}}),UE.plugins.wordcount=function(){var e=this;e.setOpt("wordCount",!0),e.addListener("contentchange",function(){e.fireEvent("wordcount")});var t;e.addListener("ready",function(){var e=this;domUtils.on(e.body,"keyup",function(n){(n.keyCode||n.which)in{16:1,18:1,20:1,37:1,38:1,39:1,40:1}||(clearTimeout(t),t=setTimeout(function(){e.fireEvent("wordcount")},200))})})},UE.plugins.pagebreak=function(){function e(e){if(domUtils.isEmptyBlock(e)){for(var t,i=e.firstChild;i&&1==i.nodeType&&domUtils.isEmptyBlock(i);)t=i,i=i.firstChild;!t&&(t=e),domUtils.fillNode(n.document,t)}}function t(e){return e&&1==e.nodeType&&"HR"==e.tagName&&"pagebreak"==e.className}var n=this,i=["td"];n.setOpt("pageBreakTag","_ueditor_page_break_tag_"),n.ready(function(){utils.cssRule("pagebreak",".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}",n.document)}),n.addInputRule(function(e){e.traversal(function(e){if("text"==e.type&&e.data==n.options.pageBreakTag){var t=UE.uNode.createElement('<hr class="pagebreak" noshade="noshade" size="5" style="-webkit-user-select: none;">');e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e)}})}),n.addOutputRule(function(e){utils.each(e.getNodesByTagName("hr"),function(e){if("pagebreak"==e.getAttr("class")){var t=UE.uNode.createText(n.options.pageBreakTag);e.parentNode.insertBefore(t,e),e.parentNode.removeChild(e)}})}),n.commands.pagebreak={execCommand:function(){var o=n.selection.getRange(),r=n.document.createElement("hr");domUtils.setAttributes(r,{class:"pagebreak",noshade:"noshade",size:"5"}),domUtils.unSelectable(r);var a,s=domUtils.findParentByTagName(o.startContainer,i,!0),l=[];if(s)switch(s.tagName){case"TD":if(a=s.parentNode,a.previousSibling)a.parentNode.insertBefore(r,a),l=domUtils.findParents(r);else{var d=domUtils.findParentByTagName(a,"table");d.parentNode.insertBefore(r,d),l=domUtils.findParents(r,!0)}a=l[1],r!==a&&domUtils.breakParent(r,a),n.fireEvent("afteradjusttable",n.document)}else{if(!o.collapsed){o.deleteContents();for(var c=o.startContainer;!domUtils.isBody(c)&&domUtils.isBlockElm(c)&&domUtils.isEmptyNode(c);)o.setStartBefore(c).collapse(!0),domUtils.remove(c),c=o.startContainer}o.insertNode(r);for(var u,a=r.parentNode;!domUtils.isBody(a);)domUtils.breakParent(r,a),u=r.nextSibling,u&&domUtils.isEmptyBlock(u)&&domUtils.remove(u),a=r.parentNode;u=r.nextSibling;var m=r.previousSibling;if(t(m)?domUtils.remove(m):m&&e(m),u)t(u)?domUtils.remove(u):e(u),o.setEndAfter(r).collapse(!1);else{var f=n.document.createElement("p");r.parentNode.appendChild(f),domUtils.fillNode(n.document,f),o.setStart(f,0).collapse(!0)}o.select(!0)}}}},UE.plugin.register("wordimage",function(){var e=this,t=[];return{commands:{wordimage:{execCommand:function(){for(var t,n=domUtils.getElementsByTagName(e.body,"img"),i=[],o=0;t=n[o++];){var r=t.getAttribute("word_img");r&&i.push(r)}return i},queryCommandState:function(){t=domUtils.getElementsByTagName(e.body,"img");for(var n,i=0;n=t[i++];)if(n.getAttribute("word_img"))return 1;return-1},notNeedUndo:!0}},inputRule:function(t){utils.each(t.getNodesByTagName("img"),function(t){var n=t.attrs,i=parseInt(n.width)<128||parseInt(n.height)<43,o=e.options,r=o.UEDITOR_HOME_URL+"themes/default/images/spacer.gif";n.src&&/^(?:(file:\/+))/.test(n.src)&&t.setAttr({width:n.width,height:n.height,alt:n.alt,word_img:n.src,src:r,style:"background:url("+(i?o.themePath+o.theme+"/images/word.gif":o.langPath+o.lang+"/images/localimage.png")+") no-repeat center center;border:1px solid #ddd"})})}}}),UE.plugins.dragdrop=function(){var e=this;e.ready(function(){domUtils.on(this.body,"dragend",function(){var t=e.selection.getRange(),n=t.getClosedNode()||e.selection.getStart();if(n&&"IMG"==n.tagName){for(var i,o=n.previousSibling;(i=n.nextSibling)&&1==i.nodeType&&"SPAN"==i.tagName&&!i.firstChild;)domUtils.remove(i);(!o||1!=o.nodeType||domUtils.isEmptyBlock(o))&&o||i&&(!i||domUtils.isEmptyBlock(i))||(o&&"P"==o.tagName&&!domUtils.isEmptyBlock(o)?(o.appendChild(n),domUtils.moveChild(i,o),domUtils.remove(i)):i&&"P"==i.tagName&&!domUtils.isEmptyBlock(i)&&i.insertBefore(n,i.firstChild),o&&"P"==o.tagName&&domUtils.isEmptyBlock(o)&&domUtils.remove(o),i&&"P"==i.tagName&&domUtils.isEmptyBlock(i)&&domUtils.remove(i),t.selectNode(n).select(),e.fireEvent("saveScene"))}})}),e.addListener("keyup",function(t,n){if(13==(n.keyCode||n.which)){var i,o=e.selection.getRange();(i=domUtils.findParentByTagName(o.startContainer,"p",!0))&&"center"==domUtils.getComputedStyle(i,"text-align")&&domUtils.removeStyle(i,"text-align")}})},UE.plugins.undo=function(){function e(e,t){if(e.length!=t.length)return 0;for(var n=0,i=e.length;n<i;n++)if(e[n]!=t[n])return 0;return 1}function t(t,n){return t.collapsed!=n.collapsed?0:e(t.startAddress,n.startAddress)&&e(t.endAddress,n.endAddress)?1:0}function n(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.undo=function(){if(this.hasUndo){if(!this.list[this.index-1]&&1==this.list.length)return void this.reset();for(;this.list[this.index].content==this.list[this.index-1].content;)if(0==--this.index)return this.restore(0);this.restore(--this.index)}},this.redo=function(){if(this.hasRedo){for(;this.list[this.index].content==this.list[this.index+1].content;)if(++this.index==this.list.length-1)return this.restore(this.index);this.restore(++this.index)}},this.restore=function(){var e=this.editor,t=this.list[this.index],n=UE.htmlparser(t.content.replace(s,""));e.options.autoClearEmptyNode=!1,e.filterInputRule(n),e.options.autoClearEmptyNode=d,e.document.body.innerHTML=n.toHtml(),e.fireEvent("afterscencerestore"),browser.ie&&utils.each(domUtils.getElementsByTagName(e.document,"td th caption p"),function(t){domUtils.isEmptyNode(t)&&domUtils.fillNode(e.document,t)});try{var i=new dom.Range(e.document).moveToAddress(t.address);i.select(l[i.startContainer.nodeName.toLowerCase()])}catch(e){}this.update(),this.clearKey(),e.fireEvent("reset",!0)},this.getScene=function(){var e=this.editor,t=e.selection.getRange(),n=t.createAddress(!1,!0);e.fireEvent("beforegetscene");var i=UE.htmlparser(e.body.innerHTML);e.options.autoClearEmptyNode=!1,e.filterOutputRule(i),e.options.autoClearEmptyNode=d;var o=i.toHtml();return e.fireEvent("aftergetscene"),{address:n,content:o}},this.save=function(e,n){clearTimeout(i);var a=this.getScene(n),s=this.list[this.index];s&&s.content!=a.content&&o.trigger("contentchange"),s&&s.content==a.content&&(e?1:t(s.address,a.address))||(this.list=this.list.slice(0,this.index+1),this.list.push(a),this.list.length>r&&this.list.shift(),this.index=this.list.length-1,this.clearKey(),this.update())},this.update=function(){this.hasRedo=!!this.list[this.index+1],this.hasUndo=!!this.list[this.index-1]},this.reset=function(){this.list=[],this.index=0,this.hasUndo=!1,this.hasRedo=!1,this.clearKey()},this.clearKey=function(){m=0,c=null}}var i,o=this,r=o.options.maxUndoCount||20,a=o.options.maxInputCount||20,s=new RegExp(domUtils.fillChar+"|</hr>","gi"),l={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},d=o.options.autoClearEmptyNode;o.undoManger=new n,o.undoManger.editor=o,o.addListener("saveScene",function(){var e=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,e)}),o.addListener("reset",function(e,t){t||this.undoManger.reset()}),o.commands.redo=o.commands.undo={execCommand:function(e){this.undoManger[e]()},queryCommandState:function(e){return this.undoManger["has"+("undo"==e.toLowerCase()?"Undo":"Redo")]?0:-1},notNeedUndo:1};var c,u={16:1,17:1,18:1,37:1,38:1,39:1,40:1},m=0,f=!1;o.addListener("ready",function(){domUtils.on(this.body,"compositionstart",function(){f=!0}),domUtils.on(this.body,"compositionend",function(){f=!1})}),o.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89"});var h=!0;o.addListener("keydown",function(e,t){var n=this,o=t.keyCode||t.which;if(!(u[o]||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var r=function(e){e.undoManger.save(!1,!0),e.fireEvent("selectionchange")};if(f)return;if(!n.selection.getRange().collapsed)return n.undoManger.save(!1,!0),void(h=!1);0==n.undoManger.list.length&&n.undoManger.save(!0),clearTimeout(i),i=setTimeout(function(){if(f)var e=setInterval(function(){f||(r(n),clearInterval(e))},300);else r(n)},200),c=o,m++,m>=a&&r(n)}}),o.addListener("keyup",function(e,t){var n=t.keyCode||t.which;if(!(u[n]||t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){if(f)return;h||(this.undoManger.save(!1,!0),h=!0)}}),o.stopCmdUndo=function(){o.__hasEnterExecCommand=!0},o.startCmdUndo=function(){o.__hasEnterExecCommand=!1}},UE.plugin.register("copy",function(){function e(){ZeroClipboard.config({debug:!1,swfPath:t.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.swf"});var e=t.zeroclipboard=new ZeroClipboard;e.on("copy",function(e){var n=e.client,i=t.selection.getRange(),o=document.createElement("div");o.appendChild(i.cloneContents()),n.setText(o.innerText||o.textContent),n.setHtml(o.innerHTML),i.select()}),e.on("mouseover mouseout",function(e){var t=e.target;"mouseover"==e.type?domUtils.addClass(t,"edui-state-hover"):"mouseout"==e.type&&domUtils.removeClasses(t,"edui-state-hover")}),e.on("wrongflash noflash",function(){ZeroClipboard.destroy()})}var t=this;return{bindEvents:{ready:function(){browser.ie||(window.ZeroClipboard?e():utils.loadFile(document,{src:t.options.UEDITOR_HOME_URL+"third-party/zeroclipboard/ZeroClipboard.js",tag:"script",type:"text/javascript",defer:"defer"},function(){e()}))}},commands:{copy:{execCommand:function(e){t.document.execCommand("copy")||alert(t.getLang("copymsg"))}}}}}),UE.plugins.paste=function(){function e(e){var t=this.document;if(!t.getElementById("baidu_pastebin")){var n=this.selection.getRange(),i=n.createBookmark(),o=t.createElement("div");o.id="baidu_pastebin",browser.webkit&&o.appendChild(t.createTextNode(domUtils.fillChar+domUtils.fillChar)),t.body.appendChild(o),i.start.style.display="",o.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+domUtils.getXY(i.start).y+"px",n.selectNodeContents(o).select(!0),setTimeout(function(){if(browser.webkit)for(var r,a=0,s=t.querySelectorAll("#baidu_pastebin");r=s[a++];){if(!domUtils.isEmptyNode(r)){o=r;break}domUtils.remove(r)}try{o.parentNode.removeChild(o)}catch(e){}n.moveToBookmark(i).select(!0),e(o)},0)}}function t(e){return e.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,function(e,t,n,i){return n=n.toLowerCase(),{img:1}[n]?e:(i=i.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,function(e,t,n){return{src:1,href:1,name:1}[t.toLowerCase()]?t+"="+n+" ":""}),{span:1,div:1}[n]?"":"<"+t+n+" "+utils.trim(i)+">")})}function n(e){var n;if(e.firstChild){for(var s,l=domUtils.getElementsByTagName(e,"span"),d=0;s=l[d++];)"_baidu_cut_start"!=s.id&&"_baidu_cut_end"!=s.id||domUtils.remove(s);if(browser.webkit){for(var c,u=e.querySelectorAll("div br"),d=0;c=u[d++];){var m=c.parentNode;"DIV"==m.tagName&&1==m.childNodes.length&&(m.innerHTML="<p><br/></p>",domUtils.remove(m))}for(var f,h=e.querySelectorAll("#baidu_pastebin"),d=0;f=h[d++];){var p=i.document.createElement("p");for(f.parentNode.insertBefore(p,f);f.firstChild;)p.appendChild(f.firstChild);domUtils.remove(f)}for(var g,v=e.querySelectorAll("meta"),d=0;g=v[d++];)domUtils.remove(g);var u=e.querySelectorAll("br");for(d=0;g=u[d++];)/^apple-/i.test(g.className)&&domUtils.remove(g)}if(browser.gecko){var b=e.querySelectorAll("[_moz_dirty]");for(d=0;g=b[d++];)g.removeAttribute("_moz_dirty")}if(!browser.ie)for(var g,y=e.querySelectorAll("span.Apple-style-span"),d=0;g=y[d++];)domUtils.remove(g,!0);n=e.innerHTML,n=UE.filterWord(n);var C=UE.htmlparser(n);if(i.options.filterRules&&UE.filterNode(C,i.options.filterRules),i.filterInputRule(C),browser.webkit){var x=C.lastChild();x&&"element"==x.type&&"br"==x.tagName&&C.removeChild(x),utils.each(i.body.querySelectorAll("div"),function(e){domUtils.isEmptyBlock(e)&&domUtils.remove(e,!0)})}if(n={html:C.toHtml()},i.fireEvent("beforepaste",n,C),!n.html)return;C=UE.htmlparser(n.html,!0),1===i.queryCommandState("pasteplain")?i.execCommand("insertHtml",UE.filterNode(C,i.options.filterTxtRules).toHtml(),!0):(UE.filterNode(C,i.options.filterTxtRules),o=C.toHtml(),r=n.html,a=i.selection.getRange().createAddress(!0),i.execCommand("insertHtml",!0===i.getOpt("retainOnlyLabelPasted")?t(r):r,!0)),i.fireEvent("afterpaste",n)}}var i=this;i.setOpt({retainOnlyLabelPasted:!1});var o,r,a;i.addListener("pasteTransfer",function(e,n){if(a&&o&&r&&o!=r){var s=i.selection.getRange();if(s.moveToAddress(a,!0),!s.collapsed){for(;!domUtils.isBody(s.startContainer);){var l=s.startContainer;if(1==l.nodeType){if(!(l=l.childNodes[s.startOffset])){s.setStartBefore(s.startContainer);continue}var d=l.previousSibling;d&&3==d.nodeType&&new RegExp("^[\n\r\t "+domUtils.fillChar+"]*$").test(d.nodeValue)&&s.setStartBefore(d)}if(0!=s.startOffset)break;s.setStartBefore(s.startContainer)}for(;!domUtils.isBody(s.endContainer);){var c=s.endContainer;if(1==c.nodeType){if(!(c=c.childNodes[s.endOffset])){s.setEndAfter(s.endContainer);continue}var u=c.nextSibling;u&&3==u.nodeType&&new RegExp("^[\n\r\t"+domUtils.fillChar+"]*$").test(u.nodeValue)&&s.setEndAfter(u)}if(s.endOffset!=s.endContainer[3==s.endContainer.nodeType?"nodeValue":"childNodes"].length)break;s.setEndAfter(s.endContainer)}}s.deleteContents(),s.select(!0),i.__hasEnterExecCommand=!0;var m=r;2===n?m=t(m):n&&(m=o),i.execCommand("inserthtml",m,!0),i.__hasEnterExecCommand=!1;for(var f=i.selection.getRange();!domUtils.isBody(f.startContainer)&&!f.startOffset&&f.startContainer[3==f.startContainer.nodeType?"nodeValue":"childNodes"].length;)f.setStartBefore(f.startContainer);var h=f.createAddress(!0);a.endAddress=h.startAddress}}),i.addListener("ready",function(){domUtils.on(i.body,"cut",function(){!i.selection.getRange().collapsed&&i.undoManger&&i.undoManger.save()}),domUtils.on(i.body,browser.ie||browser.opera?"keydown":"paste",function(t){(!browser.ie&&!browser.opera||(t.ctrlKey||t.metaKey)&&"86"==t.keyCode)&&e.call(i,function(e){n(e)})})}),i.commands.paste={execCommand:function(t){browser.ie?(e.call(i,function(e){n(e)}),i.document.execCommand("paste")):alert(i.getLang("pastemsg"))}}},UE.plugins.pasteplain=function(){var e=this;e.setOpt({pasteplain:!1,filterTxtRules:function(){function e(e){e.tagName="p",e.setStyle()}function t(e){e.parentNode.removeChild(e,!0)}return{"-":"script style object iframe embed input select",p:{$:{}},br:{$:{}},div:function(e){for(var t,n=UE.uNode.createElement("p");t=e.firstChild();)"text"!=t.type&&UE.dom.dtd.$block[t.tagName]?n.firstChild()?(e.parentNode.insertBefore(n,e),n=UE.uNode.createElement("p")):e.parentNode.insertBefore(t,e):n.appendChild(t);n.firstChild()&&e.parentNode.insertBefore(n,e),e.parentNode.removeChild(e)},ol:t,ul:t,dl:t,dt:t,dd:t,li:t,caption:e,th:e,tr:e,h1:e,h2:e,h3:e,h4:e,h5:e,h6:e,td:function(e){!!e.innerText()&&e.parentNode.insertAfter(UE.uNode.createText(" &nbsp; &nbsp;"),e),e.parentNode.removeChild(e,e.innerText())}}}()});var t=e.options.pasteplain;e.commands.pasteplain={queryCommandState:function(){return t?1:0},execCommand:function(){t=0|!t},notNeedUndo:1}},UE.plugins.list=function(){function e(e){var t=[];for(var n in e)t.push(n);return t}function t(e){var t=e.className;return domUtils.hasClass(e,/custom_/)?t.match(/custom_(\w+)/)[1]:domUtils.getStyle(e,"list-style-type")}function n(e,n){utils.each(domUtils.getElementsByTagName(e,"ol ul"),function(r){if(domUtils.inDoc(r,e)){var a=r.parentNode;if(a.tagName==r.tagName){var s=t(r)||("OL"==r.tagName?"decimal":"disc");if(s==(t(a)||("OL"==a.tagName?"decimal":"disc"))){var l=utils.indexOf(c[r.tagName],s);l=l+1==c[r.tagName].length?0:l+1,o(r,c[r.tagName][l])}}var u=0,m=2;domUtils.hasClass(r,/custom_/)?/[ou]l/i.test(a.tagName)&&domUtils.hasClass(a,/custom_/)||(m=1):/[ou]l/i.test(a.tagName)&&domUtils.hasClass(a,/custom_/)&&(m=3);var f=domUtils.getStyle(r,"list-style-type");f&&(r.style.cssText="list-style-type:"+f),r.className=utils.trim(r.className.replace(/list-paddingleft-\w+/,""))+" list-paddingleft-"+m,utils.each(domUtils.getElementsByTagName(r,"li"),function(e){if(e.style.cssText&&(e.style.cssText=""),!e.firstChild)return void domUtils.remove(e);if(e.parentNode===r){if(u++,domUtils.hasClass(r,/custom_/)){var n=1,i=t(r);if("OL"==r.tagName){if(i)switch(i){case"cn":case"cn1":case"cn2":u>10&&(u%10==0||u>10&&u<20)?n=2:u>20&&(n=3);break;case"num2":u>9&&(n=2)}e.className="list-"+d[i]+u+" list-"+i+"-paddingleft-"+n}else e.className="list-"+d[i]+" list-"+i+"-paddingleft"}else e.className=e.className.replace(/list-[\w\-]+/gi,"");var o=e.getAttribute("class");null===o||o.replace(/\s/g,"")||domUtils.removeAttributes(e,"class")}}),!n&&i(r,r.tagName.toLowerCase(),t(r)||domUtils.getStyle(r,"list-style-type"),!0)}})}function i(e,i,o,r){var a=e.nextSibling;a&&1==a.nodeType&&a.tagName.toLowerCase()==i&&(t(a)||domUtils.getStyle(a,"list-style-type")||("ol"==i?"decimal":"disc"))==o&&(domUtils.moveChild(a,e),0==a.childNodes.length&&domUtils.remove(a)),a&&domUtils.isFillChar(a)&&domUtils.remove(a);var s=e.previousSibling;s&&1==s.nodeType&&s.tagName.toLowerCase()==i&&(t(s)||domUtils.getStyle(s,"list-style-type")||("ol"==i?"decimal":"disc"))==o&&domUtils.moveChild(e,s),s&&domUtils.isFillChar(s)&&domUtils.remove(s),!r&&domUtils.isEmptyBlock(e)&&domUtils.remove(e),t(e)&&n(e.ownerDocument,!0)}function o(e,t){d[t]&&(e.className="custom_"+t);try{domUtils.setStyle(e,"list-style-type",t)}catch(e){}}function r(e){var t=e.previousSibling;t&&domUtils.isEmptyBlock(t)&&domUtils.remove(t),(t=e.nextSibling)&&domUtils.isEmptyBlock(t)&&domUtils.remove(t)}function a(e){for(;e&&!domUtils.isBody(e);){if("TABLE"==e.nodeName)return null;if("LI"==e.nodeName)return e;e=e.parentNode}}var s=this,l={TD:1,PRE:1,BLOCKQUOTE:1},d={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};s.setOpt({autoTransWordToList:!1,insertorderedlist:{num:"",num1:"",num2:"",cn:"",cn1:"",cn2:"",decimal:"","lower-alpha":"","lower-roman":"","upper-alpha":"","upper-roman":""},insertunorderedlist:{circle:"",disc:"",square:"",dash:"",dot:""},listDefaultPaddingLeft:"30",listiconpath:"http://bs.baidu.com/listicon/",maxListLevel:-1,disablePInList:!1});var c={OL:e(s.options.insertorderedlist),UL:e(s.options.insertunorderedlist)},u=s.options.listiconpath;for(var m in d)s.options.insertorderedlist.hasOwnProperty(m)||s.options.insertunorderedlist.hasOwnProperty(m)||delete d[m];s.ready(function(){var e=[];for(var t in d){if("dash"==t||"dot"==t)e.push("li.list-"+d[t]+"{background-image:url("+u+d[t]+".gif)}"),e.push("ul.custom_"+t+"{list-style:none;}ul.custom_"+t+" li{background-position:0 3px;background-repeat:no-repeat}");else{for(var n=0;n<99;n++)e.push("li.list-"+d[t]+n+"{background-image:url("+u+"list-"+d[t]+n+".gif)}");e.push("ol.custom_"+t+"{list-style:none;}ol.custom_"+t+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(t){case"cn":e.push("li.list-"+t+"-paddingleft-1{padding-left:25px}"),e.push("li.list-"+t+"-paddingleft-2{padding-left:40px}"),e.push("li.list-"+t+"-paddingleft-3{padding-left:55px}");break;case"cn1":e.push("li.list-"+t+"-paddingleft-1{padding-left:30px}"),e.push("li.list-"+t+"-paddingleft-2{padding-left:40px}"),e.push("li.list-"+t+"-paddingleft-3{padding-left:55px}");break;case"cn2":e.push("li.list-"+t+"-paddingleft-1{padding-left:40px}"),e.push("li.list-"+t+"-paddingleft-2{padding-left:55px}"),e.push("li.list-"+t+"-paddingleft-3{padding-left:68px}");break;case"num":case"num1":e.push("li.list-"+t+"-paddingleft-1{padding-left:25px}");break;case"num2":e.push("li.list-"+t+"-paddingleft-1{padding-left:35px}"),e.push("li.list-"+t+"-paddingleft-2{padding-left:40px}");break;case"dash":e.push("li.list-"+t+"-paddingleft{padding-left:35px}");break;case"dot":e.push("li.list-"+t+"-paddingleft{padding-left:20px}")}}e.push(".list-paddingleft-1{padding-left:0}"),e.push(".list-paddingleft-2{padding-left:"+s.options.listDefaultPaddingLeft+"px}"),e.push(".list-paddingleft-3{padding-left:"+2*s.options.listDefaultPaddingLeft+"px}"),utils.cssRule("list","ol,ul{margin:0;pading:0;"+(browser.ie?"":"width:95%")+"}li{clear:both;}"+e.join("\n"),s.document)}),s.ready(function(){domUtils.on(s.body,"cut",function(){setTimeout(function(){var e,t=s.selection.getRange();if(!t.collapsed&&(e=domUtils.findParentByTagName(t.startContainer,"li",!0))&&!e.nextSibling&&domUtils.isEmptyBlock(e)){var n,i=e.parentNode;if(n=i.previousSibling)domUtils.remove(i),t.setStartAtLast(n).collapse(!0),t.select(!0);else if(n=i.nextSibling)domUtils.remove(i),t.setStartAtFirst(n).collapse(!0),t.select(!0);else{var o=s.document.createElement("p");domUtils.fillNode(s.document,o),i.parentNode.insertBefore(o,i),domUtils.remove(i),t.setStart(o,0).collapse(!0),t.select(!0)}}})})}),s.addListener("beforepaste",function(e,n){var i,o=this,r=o.selection.getRange(),a=UE.htmlparser(n.html,!0);if(i=domUtils.findParentByTagName(r.startContainer,"li",!0)){var s=i.parentNode,l="OL"==s.tagName?"ul":"ol";utils.each(a.getNodesByTagName(l),function(n){if(n.tagName=s.tagName,n.setAttr(),n.parentNode===a)e=t(s)||("OL"==s.tagName?"decimal":"disc");else{var i=n.parentNode.getAttr("class");e=i&&/custom_/.test(i)?i.match(/custom_(\w+)/)[1]:n.parentNode.getStyle("list-style-type"),e||(e="OL"==s.tagName?"decimal":"disc")}var o=utils.indexOf(c[s.tagName],e);n.parentNode!==a&&(o=o+1==c[s.tagName].length?0:o+1);var r=c[s.tagName][o];d[r]?n.setAttr("class","custom_"+r):n.setStyle("list-style-type",r)})}n.html=a.toHtml()}),!0===s.getOpt("disablePInList")&&s.addOutputRule(function(e){utils.each(e.getNodesByTagName("li"),function(e){var t=[],n=0;utils.each(e.children,function(i){if("p"==i.tagName){for(var o;o=i.children.pop();)t.splice(n,0,o),o.parentNode=e,lastNode=o;if(!(o=t[t.length-1])||"element"!=o.type||"br"!=o.tagName){var r=UE.uNode.createElement("br");r.parentNode=e,t.push(r)}n=t.length}}),t.length&&(e.children=t)})}),s.addInputRule(function(e){if(utils.each(e.getNodesByTagName("li"),function(e){for(var t,n=UE.uNode.createElement("p"),i=0;t=e.children[i];)"text"==t.type||dtd.p[t.tagName]?n.appendChild(t):n.firstChild()?(e.insertBefore(n,t),n=UE.uNode.createElement("p"),i+=2):i++;(n.firstChild()&&!n.parentNode||!e.firstChild())&&e.appendChild(n),n.firstChild()||n.innerHTML(browser.ie?"&nbsp;":"<br/>");var o=e.firstChild(),r=o.lastChild();r&&"text"==r.type&&/^\s*$/.test(r.data)&&o.removeChild(r)}),s.options.autoTransWordToList){var t=function(e,t){var o=t.firstChild();if(o&&"element"==o.type&&"span"==o.tagName&&/Wingdings|Symbol/.test(o.getStyle("font-family"))){for(var r in i)if(i[r]==o.data)return r;return"disc"}for(var r in n)if(n[r].test(e))return r},n={num1:/^\d+\)/,decimal:/^\d+\./,"lower-alpha":/^[a-z]+\)/,"upper-alpha":/^[A-Z]+\./,cn:/^[\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+[\u3001]/,cn2:/^\([\u4E00\u4E8C\u4E09\u56DB\u516d\u4e94\u4e03\u516b\u4e5d]+\)/},i={square:"n"};utils.each(e.getNodesByTagName("p"),function(e){if("MsoListParagraph"==e.getAttr("class")){e.setStyle("margin",""),e.setStyle("margin-left",""),e.setAttr("class","");var i,o=e,r=e;if("li"!=e.parentNode.tagName&&(i=t(e.innerText(),e))){var a=UE.uNode.createElement(s.options.insertorderedlist.hasOwnProperty(i)?"ol":"ul");for(d[i]?a.setAttr("class","custom_"+i):a.setStyle("list-style-type",i);e&&"li"!=e.parentNode.tagName&&t(e.innerText(),e);)o=e.nextSibling(),o||e.parentNode.insertBefore(a,e),function(e,t,i){if("ol"==e.tagName)if(browser.ie){var o=t.firstChild();"element"==o.type&&"span"==o.tagName&&n[i].test(o.innerText())&&t.removeChild(o)}else t.innerHTML(t.innerHTML().replace(n[i],""));else t.removeChild(t.firstChild());var r=UE.uNode.createElement("li");r.appendChild(t),e.appendChild(r)}(a,e,i),e=o;!a.parentNode&&e&&e.parentNode&&e.parentNode.insertBefore(a,e)}var l=r.firstChild();l&&"element"==l.type&&"span"==l.tagName&&/^\s*(&nbsp;)+\s*$/.test(l.innerText())&&l.parentNode.removeChild(l)}})}}),s.addListener("contentchange",function(){n(s.document)}),s.addListener("keydown",function(e,t){function n(){t.preventDefault?t.preventDefault():t.returnValue=!1,s.fireEvent("contentchange"),s.undoManger&&s.undoManger.save()}function i(e,t){for(;e&&!domUtils.isBody(e);){if(t(e))return null;if(1==e.nodeType&&/[ou]l/i.test(e.tagName))return e;e=e.parentNode}return null}var o=t.keyCode||t.which;if(13==o&&!t.shiftKey){var a=s.selection.getRange(),l=domUtils.findParent(a.startContainer,function(e){return domUtils.isBlockElm(e)},!0),d=domUtils.findParentByTagName(a.startContainer,"li",!0);if(l&&"PRE"!=l.tagName&&!d){var c=l.innerHTML.replace(new RegExp(domUtils.fillChar,"g"),"");/^\s*1\s*\.[^\d]/.test(c)&&(l.innerHTML=c.replace(/^\s*1\s*\./,""),a.setStartAtLast(l).collapse(!0).select(),s.__hasEnterExecCommand=!0,s.execCommand("insertorderedlist"),s.__hasEnterExecCommand=!1)}var u=s.selection.getRange(),m=i(u.startContainer,function(e){return"TABLE"==e.tagName}),f=u.collapsed?m:i(u.endContainer,function(e){return"TABLE"==e.tagName});if(m&&f&&m===f){if(!u.collapsed){if(m=domUtils.findParentByTagName(u.startContainer,"li",!0),f=domUtils.findParentByTagName(u.endContainer,"li",!0),!m||!f||m!==f){var h=u.cloneRange(),p=h.collapse(!1).createBookmark();u.deleteContents(),h.moveToBookmark(p);var d=domUtils.findParentByTagName(h.startContainer,"li",!0);return r(d),h.select(),void n()}if(u.deleteContents(),(d=domUtils.findParentByTagName(u.startContainer,"li",!0))&&domUtils.isEmptyBlock(d))return x=d.previousSibling,next=d.nextSibling,b=s.document.createElement("p"),domUtils.fillNode(s.document,b),g=d.parentNode,x&&next?(u.setStart(next,0).collapse(!0).select(!0),domUtils.remove(d)):((x||next)&&x?d.parentNode.parentNode.insertBefore(b,g.nextSibling):g.parentNode.insertBefore(b,g),domUtils.remove(d),g.firstChild||domUtils.remove(g),u.setStart(b,0).setCursor()),void n()}if(d=domUtils.findParentByTagName(u.startContainer,"li",!0)){if(domUtils.isEmptyBlock(d)){p=u.createBookmark();var g=d.parentNode;if(d!==g.lastChild?(domUtils.breakParent(d,g),r(d)):(g.parentNode.insertBefore(d,g.nextSibling),domUtils.isEmptyNode(g)&&domUtils.remove(g)),!dtd.$list[d.parentNode.tagName])if(domUtils.isBlockElm(d.firstChild))domUtils.remove(d,!0);else{for(b=s.document.createElement("p"),d.parentNode.insertBefore(b,d);d.firstChild;)b.appendChild(d.firstChild);domUtils.remove(d)}u.moveToBookmark(p).select()}else{var v=d.firstChild;if(!v||!domUtils.isBlockElm(v)){var b=s.document.createElement("p");for(!d.firstChild&&domUtils.fillNode(s.document,b);d.firstChild;)b.appendChild(d.firstChild);d.appendChild(b),v=b}var y=s.document.createElement("span");u.insertNode(y),domUtils.breakParent(y,d);var C=y.nextSibling;v=C.firstChild,v||(b=s.document.createElement("p"),domUtils.fillNode(s.document,b),C.appendChild(b),v=b),domUtils.isEmptyNode(v)&&(v.innerHTML="",domUtils.fillNode(s.document,v)),u.setStart(v,0).collapse(!0).shrinkBoundary().select(),domUtils.remove(y);var x=C.previousSibling;x&&domUtils.isEmptyBlock(x)&&(x.innerHTML="<p></p>",domUtils.fillNode(s.document,x.firstChild))}n()}}}if(8==o&&(u=s.selection.getRange(),u.collapsed&&domUtils.isStartInblock(u)&&(h=u.cloneRange().trimBoundary(),(d=domUtils.findParentByTagName(u.startContainer,"li",!0))&&domUtils.isStartInblock(h)))){if((m=domUtils.findParentByTagName(u.startContainer,"p",!0))&&m!==d.firstChild){var g=domUtils.findParentByTagName(m,["ol","ul"]);return domUtils.breakParent(m,g),r(m),s.fireEvent("contentchange"),u.setStart(m,0).setCursor(!1,!0),s.fireEvent("saveScene"),void domUtils.preventDefault(t)}if(d&&(x=d.previousSibling)){if(46==o&&d.childNodes.length)return;if(dtd.$list[x.tagName]&&(x=x.lastChild),s.undoManger&&s.undoManger.save(),v=d.firstChild,domUtils.isBlockElm(v))if(domUtils.isEmptyNode(v))for(x.appendChild(v),u.setStart(v,0).setCursor(!1,!0);d.firstChild;)x.appendChild(d.firstChild);else y=s.document.createElement("span"),u.insertNode(y),domUtils.isEmptyBlock(x)&&(x.innerHTML=""),domUtils.moveChild(d,x),u.setStartBefore(y).collapse(!0).select(!0),domUtils.remove(y);else if(domUtils.isEmptyNode(d)){var b=s.document.createElement("p");x.appendChild(b),u.setStart(b,0).setCursor()}else for(u.setEnd(x,x.childNodes.length).collapse().select(!0);d.firstChild;)x.appendChild(d.firstChild);return domUtils.remove(d),s.fireEvent("contentchange"),s.fireEvent("saveScene"),void domUtils.preventDefault(t)}if(d&&!d.previousSibling){var g=d.parentNode,p=u.createBookmark();if(domUtils.isTagNode(g.parentNode,"ol ul"))g.parentNode.insertBefore(d,g),domUtils.isEmptyNode(g)&&domUtils.remove(g);else{for(;d.firstChild;)g.parentNode.insertBefore(d.firstChild,g);domUtils.remove(d),domUtils.isEmptyNode(g)&&domUtils.remove(g)}return u.moveToBookmark(p).setCursor(!1,!0),s.fireEvent("contentchange"),s.fireEvent("saveScene"),void domUtils.preventDefault(t)}}}),s.addListener("keyup",function(e,n){if(8==(n.keyCode||n.which)){var o,r=s.selection.getRange();(o=domUtils.findParentByTagName(r.startContainer,["ol","ul"],!0))&&i(o,o.tagName.toLowerCase(),t(o)||domUtils.getComputedStyle(o,"list-style-type"),!0)}}),s.addListener("tabkeydown",function(){function e(e){if(-1!=s.options.maxListLevel){for(var t=e.parentNode,n=0;/[ou]l/i.test(t.tagName);)n++,t=t.parentNode;if(n>=s.options.maxListLevel)return!0}}var n=s.selection.getRange(),r=domUtils.findParentByTagName(n.startContainer,"li",!0);if(r){var a;if(!n.collapsed){s.fireEvent("saveScene"),a=n.createBookmark();for(var l,d,u=0,m=domUtils.findParents(r);d=m[u++];)if(domUtils.isTagNode(d,"ol ul")){l=d;break}var f=r;if(a.end)for(;f&&!(domUtils.getPosition(f,a.end)&domUtils.POSITION_FOLLOWING);)if(e(f))f=domUtils.getNextDomNode(f,!1,null,function(e){return e!==l});else{var h=f.parentNode,p=s.document.createElement(h.tagName),g=utils.indexOf(c[p.tagName],t(h)||domUtils.getComputedStyle(h,"list-style-type")),v=g+1==c[p.tagName].length?0:g+1,b=c[p.tagName][v];for(o(p,b),h.insertBefore(p,f);f&&!(domUtils.getPosition(f,a.end)&domUtils.POSITION_FOLLOWING);){if(r=f.nextSibling,p.appendChild(f),!r||domUtils.isTagNode(r,"ol ul")){if(r)for(;(r=r.firstChild)&&"LI"!=r.tagName;);else r=domUtils.getNextDomNode(f,!1,null,function(e){return e!==l});break}f=r}i(p,p.tagName.toLowerCase(),b),f=r}return s.fireEvent("contentchange"),n.moveToBookmark(a).select(),!0}if(e(r))return!0;var h=r.parentNode,p=s.document.createElement(h.tagName),g=utils.indexOf(c[p.tagName],t(h)||domUtils.getComputedStyle(h,"list-style-type"));g=g+1==c[p.tagName].length?0:g+1;var b=c[p.tagName][g];if(o(p,b),domUtils.isStartInblock(n))return s.fireEvent("saveScene"),a=n.createBookmark(),h.insertBefore(p,r),p.appendChild(r),i(p,p.tagName.toLowerCase(),b),s.fireEvent("contentchange"),n.moveToBookmark(a).select(!0),!0}}),s.commands.insertorderedlist=s.commands.insertunorderedlist={execCommand:function(e,n){n||(n="insertorderedlist"==e.toLowerCase()?"decimal":"disc");var r=this,s=this.selection.getRange(),d=function(e){return 1==e.nodeType?"br"!=e.tagName.toLowerCase():!domUtils.isWhitespace(e)},c="insertorderedlist"==e.toLowerCase()?"ol":"ul",u=r.document.createDocumentFragment();s.adjustmentBoundary().shrinkBoundary();var m,f,h,p,g=s.createBookmark(!0),v=a(r.document.getElementById(g.start)),b=0,y=a(r.document.getElementById(g.end)),C=0;if(v||y){if(v&&(m=v.parentNode),g.end||(y=v),y&&(f=y.parentNode),m===f){for(;v!==y;){if(p=v,v=v.nextSibling,!domUtils.isBlockElm(p.firstChild)){for(var x=r.document.createElement("p");p.firstChild;)x.appendChild(p.firstChild);p.appendChild(x)}u.appendChild(p)}if(p=r.document.createElement("span"),m.insertBefore(p,y),!domUtils.isBlockElm(y.firstChild)){for(x=r.document.createElement("p");y.firstChild;)x.appendChild(y.firstChild);y.appendChild(x)}u.appendChild(y),domUtils.breakParent(p,m),domUtils.isEmptyNode(p.previousSibling)&&domUtils.remove(p.previousSibling),domUtils.isEmptyNode(p.nextSibling)&&domUtils.remove(p.nextSibling);var w=t(m)||domUtils.getComputedStyle(m,"list-style-type")||("insertorderedlist"==e.toLowerCase()?"decimal":"disc");if(m.tagName.toLowerCase()==c&&w==n){for(var N,U=0,E=r.document.createDocumentFragment();N=u.firstChild;)if(domUtils.isTagNode(N,"ol ul"))E.appendChild(N);else for(;N.firstChild;)E.appendChild(N.firstChild),domUtils.remove(N);p.parentNode.insertBefore(E,p)}else h=r.document.createElement(c),o(h,n),h.appendChild(u),p.parentNode.insertBefore(h,p);return domUtils.remove(p),h&&i(h,c,n),void s.moveToBookmark(g).select()}if(v){for(;v;){if(p=v.nextSibling,domUtils.isTagNode(v,"ol ul"))u.appendChild(v);else{for(var T=r.document.createDocumentFragment(),S=0;v.firstChild;)domUtils.isBlockElm(v.firstChild)&&(S=1),T.appendChild(v.firstChild);if(S)u.appendChild(T);else{var k=r.document.createElement("p");k.appendChild(T),u.appendChild(k)}domUtils.remove(v)}v=p}m.parentNode.insertBefore(u,m.nextSibling),domUtils.isEmptyNode(m)?(s.setStartBefore(m),domUtils.remove(m)):s.setStartAfter(m),b=1}if(y&&domUtils.inDoc(f,r.document)){for(v=f.firstChild;v&&v!==y;){if(p=v.nextSibling,domUtils.isTagNode(v,"ol ul"))u.appendChild(v);else{for(T=r.document.createDocumentFragment(),S=0;v.firstChild;)domUtils.isBlockElm(v.firstChild)&&(S=1),T.appendChild(v.firstChild);S?u.appendChild(T):(k=r.document.createElement("p"),k.appendChild(T),u.appendChild(k)),domUtils.remove(v)}v=p}var B=domUtils.createElement(r.document,"div",{tmpDiv:1});domUtils.moveChild(y,B),u.appendChild(B),domUtils.remove(y),f.parentNode.insertBefore(u,f),s.setEndBefore(f),domUtils.isEmptyNode(f)&&domUtils.remove(f),C=1}}b||s.setStartBefore(r.document.getElementById(g.start)),g.end&&!C&&s.setEndAfter(r.document.getElementById(g.end)),s.enlarge(!0,function(e){return l[e.tagName]}),u=r.document.createDocumentFragment();for(var I,_=s.createBookmark(),A=domUtils.getNextDomNode(_.start,!1,d),L=s.cloneRange(),R=domUtils.isBlockElm;A&&A!==_.end&&domUtils.getPosition(A,_.end)&domUtils.POSITION_PRECEDING;)if(3==A.nodeType||dtd.li[A.tagName]){if(1==A.nodeType&&dtd.$list[A.tagName]){for(;A.firstChild;)u.appendChild(A.firstChild);I=domUtils.getNextDomNode(A,!1,d),domUtils.remove(A),A=I;continue}for(I=A,L.setStartBefore(A);A&&A!==_.end&&(!R(A)||domUtils.isBookmarkNode(A));)I=A,A=domUtils.getNextDomNode(A,!1,null,function(e){return!l[e.tagName]});A&&R(A)&&(p=domUtils.getNextDomNode(I,!1,d))&&domUtils.isBookmarkNode(p)&&(A=domUtils.getNextDomNode(p,!1,d),I=p),L.setEndAfter(I),A=domUtils.getNextDomNode(I,!1,d);var D=s.document.createElement("li");if(D.appendChild(L.extractContents()),domUtils.isEmptyNode(D)){for(var I=s.document.createElement("p");D.firstChild;)I.appendChild(D.firstChild);D.appendChild(I)}u.appendChild(D)}else A=domUtils.getNextDomNode(A,!0,d);s.moveToBookmark(_).collapse(!0),h=r.document.createElement(c),o(h,n),h.appendChild(u),s.insertNode(h),i(h,c,n);for(var N,U=0,O=domUtils.getElementsByTagName(h,"div");N=O[U++];)N.getAttribute("tmpDiv")&&domUtils.remove(N,!0);s.moveToBookmark(g).select()},queryCommandState:function(e){for(var t,n="insertorderedlist"==e.toLowerCase()?"ol":"ul",i=this.selection.getStartElementPath(),o=0;t=i[o++];){if("TABLE"==t.nodeName)return 0;if(n==t.nodeName.toLowerCase())return 1}return 0},queryCommandValue:function(e){for(var n,i,o="insertorderedlist"==e.toLowerCase()?"ol":"ul",r=this.selection.getStartElementPath(),a=0;i=r[a++];){if("TABLE"==i.nodeName){n=null;break}if(o==i.nodeName.toLowerCase()){n=i;break}}return n?t(n)||domUtils.getComputedStyle(n,"list-style-type"):null}}},function(){var e={textarea:function(e,t){var n=t.ownerDocument.createElement("textarea");return n.style.cssText="position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;",browser.ie&&browser.version<8&&(n.style.width=t.offsetWidth+"px",n.style.height=t.offsetHeight+"px",t.onresize=function(){n.style.width=t.offsetWidth+"px",n.style.height=t.offsetHeight+"px"}),t.appendChild(n),{setContent:function(e){n.value=e},getContent:function(){return n.value},select:function(){var e;browser.ie?(e=n.createTextRange(),e.collapse(!0),e.select()):(n.setSelectionRange(0,0),n.focus())},dispose:function(){t.removeChild(n),t.onresize=null,n=null,t=null}}},codemirror:function(e,t){var n=window.CodeMirror(t,{mode:"text/html",tabMode:"indent",lineNumbers:!0,lineWrapping:!0}),i=n.getWrapperElement();return i.style.cssText='position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;',n.getScrollerElement().style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;",n.refresh(),{getCodeMirror:function(){return n},setContent:function(e){n.setValue(e)},getContent:function(){return n.getValue()},select:function(){n.focus()},dispose:function(){t.removeChild(i),i=null,n=null}}}};UE.plugins.source=function(){function t(t){return e["codemirror"==r.sourceEditor&&window.CodeMirror?"codemirror":"textarea"](o,t)}var n,i,o=this,r=this.options,a=!1;r.sourceEditor=browser.ie?"textarea":r.sourceEditor||"codemirror",o.setOpt({sourceEditorFirst:!1});var s,l,d;o.commands.source={execCommand:function(){if(a=!a){d=o.selection.getRange().createAddress(!1,!0),o.undoManger&&o.undoManger.save(!0),browser.gecko&&(o.body.contentEditable=!1),s=o.iframe.style.cssText,o.iframe.style.cssText+="position:absolute;left:-32768px;top:-32768px;",o.fireEvent("beforegetcontent");var e=UE.htmlparser(o.body.innerHTML);o.filterOutputRule(e),e.traversal(function(e){if("element"==e.type)switch(e.tagName){case"td":case"th":case"caption":e.children&&1==e.children.length&&"br"==e.firstChild().tagName&&e.removeChild(e.firstChild());break;case"pre":e.innerText(e.innerText().replace(/&nbsp;/g," "))}}),o.fireEvent("aftergetcontent");var r=e.toHtml(!0);n=t(o.iframe.parentNode),n.setContent(r),i=o.setContent,o.setContent=function(e){var t=UE.htmlparser(e);o.filterInputRule(t),e=t.toHtml(),n.setContent(e)},setTimeout(function(){n.select(),o.addListener("fullscreenchanged",function(){try{n.getCodeMirror().refresh()}catch(e){}})}),l=o.getContent,o.getContent=function(){return n.getContent()||"<p>"+(browser.ie?"":"<br/>")+"</p>"}}else{o.iframe.style.cssText=s;var c=n.getContent()||"<p>"+(browser.ie?"":"<br/>")+"</p>";c=c.replace(new RegExp("[\\r\\t\\n ]*</?(\\w+)\\s*(?:[^>]*)>","g"),function(e,t){return t&&!dtd.$inlineWithA[t.toLowerCase()]?e.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,""):e.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,"")}),o.setContent=i,o.setContent(c),n.dispose(),n=null,o.getContent=l;var u=o.body.firstChild;if(u||(o.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",u=o.body.firstChild),o.undoManger&&o.undoManger.save(!0),browser.gecko){var m=document.createElement("input");m.style.cssText="position:absolute;left:0;top:-32768px",document.body.appendChild(m),o.body.contentEditable=!1,setTimeout(function(){domUtils.setViewportOffset(m,{left:-32768,top:0}),m.focus(),setTimeout(function(){o.body.contentEditable=!0,o.selection.getRange().moveToAddress(d).select(!0),domUtils.remove(m)})})}else try{o.selection.getRange().moveToAddress(d).select(!0)}catch(e){}}this.fireEvent("sourcemodechanged",a)},queryCommandState:function(){return 0|a},notNeedUndo:1};var c=o.queryCommandState;o.queryCommandState=function(e){return e=e.toLowerCase(),a?e in{source:1,fullscreen:1}?1:-1:c.apply(this,arguments)},"codemirror"==r.sourceEditor&&o.addListener("ready",function(){utils.loadFile(document,{src:r.codeMirrorJsUrl||r.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.js",tag:"script",type:"text/javascript",defer:"defer"},function(){r.sourceEditorFirst&&setTimeout(function(){o.execCommand("source")},0)}),utils.loadFile(document,{tag:"link",rel:"stylesheet",type:"text/css",href:r.codeMirrorCssUrl||r.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.css"})})}}(),UE.plugins.enterkey=function(){var e,t=this,n=t.options.enterTag;t.addListener("keyup",function(n,i){if(13==(i.keyCode||i.which)){var o,r=t.selection.getRange(),a=r.startContainer;if(browser.ie)t.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(e)){if(browser.gecko)domUtils.findParentByTagName(a,["h1","h2","h3","h4","h5","h6","blockquote","caption","table"],!0)||(t.document.execCommand("formatBlock",!1,"<p>"),o=1);else if(1==a.nodeType){var s,l=t.document.createTextNode("");if(r.insertNode(l),s=domUtils.findParentByTagName(l,"div",!0)){for(var d=t.document.createElement("p");s.firstChild;)d.appendChild(s.firstChild);s.parentNode.insertBefore(d,s),domUtils.remove(s),r.setStartBefore(l).setCursor(),o=1}domUtils.remove(l)}t.undoManger&&o&&t.undoManger.save()}browser.opera&&r.select()}}}),t.addListener("keydown",function(i,o){if(13==(o.keyCode||o.which)){if(t.fireEvent("beforeenterkeydown"))return void domUtils.preventDefault(o);t.fireEvent("saveScene",!0,!0),e="";var r=t.selection.getRange();if(!r.collapsed){var a=r.startContainer,s=r.endContainer,l=domUtils.findParentByTagName(a,"td",!0),d=domUtils.findParentByTagName(s,"td",!0);if(l&&d&&l!==d||!l&&d||l&&!d)return void(o.preventDefault?o.preventDefault():o.returnValue=!1)}if("p"==n)browser.ie||(a=domUtils.findParentByTagName(r.startContainer,["ol","ul","p","h1","h2","h3","h4","h5","h6","blockquote","caption"],!0),a||browser.opera?(e=a.tagName,"p"==a.tagName.toLowerCase()&&browser.gecko&&domUtils.removeDirtyAttr(a)):(t.document.execCommand("formatBlock",!1,"<p>"),browser.gecko&&(r=t.selection.getRange(),(a=domUtils.findParentByTagName(r.startContainer,"p",!0))&&domUtils.removeDirtyAttr(a))));else if(o.preventDefault?o.preventDefault():o.returnValue=!1,r.collapsed){u=r.document.createElement("br"),r.insertNode(u);var c=u.parentNode;c.lastChild===u?(u.parentNode.insertBefore(u.cloneNode(!0),u),r.setStartBefore(u)):r.setStartAfter(u),r.setCursor()}else if(r.deleteContents(),a=r.startContainer,1==a.nodeType&&(a=a.childNodes[r.startOffset])){for(;1==a.nodeType;){if(dtd.$empty[a.tagName])return r.setStartBefore(a).setCursor(),t.undoManger&&t.undoManger.save(),!1;if(!a.firstChild){var u=r.document.createElement("br");return a.appendChild(u),r.setStart(a,0).setCursor(),t.undoManger&&t.undoManger.save(),!1}a=a.firstChild}a===r.startContainer.childNodes[r.startOffset]?(u=r.document.createElement("br"),r.insertNode(u).setCursor()):r.setStart(a,0).setCursor()}else u=r.document.createElement("br"),r.insertNode(u).setStartAfter(u).setCursor()}})},UE.plugins.keystrokes=function(){var e=this,t=!0;e.addListener("keydown",function(n,i){var o=i.keyCode||i.which,r=e.selection.getRange();if(!r.collapsed&&!(i.ctrlKey||i.shiftKey||i.altKey||i.metaKey)&&(o>=65&&o<=90||o>=48&&o<=57||o>=96&&o<=111||{13:1,8:1,46:1}[o])){var a=r.startContainer;if(domUtils.isFillChar(a)&&r.setStartBefore(a),a=r.endContainer,domUtils.isFillChar(a)&&r.setEndAfter(a),r.txtToElmBoundary(),r.endContainer&&1==r.endContainer.nodeType&&(a=r.endContainer.childNodes[r.endOffset])&&domUtils.isBr(a)&&r.setEndAfter(a),0==r.startOffset&&(a=r.startContainer,domUtils.isBoundaryNode(a,"firstChild")&&(a=r.endContainer,r.endOffset==(3==a.nodeType?a.nodeValue.length:a.childNodes.length)&&domUtils.isBoundaryNode(a,"lastChild"))))return e.fireEvent("saveScene"),e.body.innerHTML="<p>"+(browser.ie?"":"<br/>")+"</p>",r.setStart(e.body.firstChild,0).setCursor(!1,!0),void e._selectionChange()}if(o==keymap.Backspace){if(r=e.selection.getRange(),t=r.collapsed,e.fireEvent("delkeydown",i))return;var s,l;if(r.collapsed&&r.inFillChar()&&(s=r.startContainer,domUtils.isFillChar(s)?(r.setStartBefore(s).shrinkBoundary(!0).collapse(!0),domUtils.remove(s)):(s.nodeValue=s.nodeValue.replace(new RegExp("^"+domUtils.fillChar),""),r.startOffset--,r.collapse(!0).select(!0))),s=r.getClosedNode())return e.fireEvent("saveScene"),r.setStartBefore(s),domUtils.remove(s),r.setCursor(),e.fireEvent("saveScene"),void domUtils.preventDefault(i);if(!browser.ie&&(s=domUtils.findParentByTagName(r.startContainer,"table",!0),l=domUtils.findParentByTagName(r.endContainer,"table",!0),s&&!l||!s&&l||s!==l))return void i.preventDefault()}if(o==keymap.Tab){var d={ol:1,ul:1,table:1};if(e.fireEvent("tabkeydown",i))return void domUtils.preventDefault(i);var c=e.selection.getRange();e.fireEvent("saveScene");for(var u=0,m="",f=e.options.tabSize||4,h=e.options.tabNode||"&nbsp;";u<f;u++)m+=h;var p=e.document.createElement("span");if(p.innerHTML=m+domUtils.fillChar,c.collapsed)c.insertNode(p.cloneNode(!0).firstChild).setCursor(!0);else{var g=function(e){return domUtils.isBlockElm(e)&&!d[e.tagName.toLowerCase()]};if(s=domUtils.findParent(c.startContainer,g,!0),l=domUtils.findParent(c.endContainer,g,!0),s&&l&&s===l)c.deleteContents(),c.insertNode(p.cloneNode(!0).firstChild).setCursor(!0);else{var v=c.createBookmark();c.enlarge(!0);for(var b=c.createBookmark(),y=domUtils.getNextDomNode(b.start,!1,g);y&&!(domUtils.getPosition(y,b.end)&domUtils.POSITION_FOLLOWING);)y.insertBefore(p.cloneNode(!0).firstChild,y.firstChild),y=domUtils.getNextDomNode(y,!1,g);c.moveToBookmark(b).moveToBookmark(v).select()}}domUtils.preventDefault(i)}if(browser.gecko&&46==o&&(c=e.selection.getRange(),c.collapsed&&(s=c.startContainer,domUtils.isEmptyBlock(s)))){for(var C=s.parentNode;1==domUtils.getChildCount(C)&&!domUtils.isBody(C);)s=C,C=C.parentNode;return void(s===C.lastChild&&i.preventDefault())}}),e.addListener("keyup",function(e,n){var i,o=n.keyCode||n.which,r=this;if(o==keymap.Backspace){if(r.fireEvent("delkeyup"))return;if(i=r.selection.getRange(),i.collapsed){var a,s=["h1","h2","h3","h4","h5","h6"];if((a=domUtils.findParentByTagName(i.startContainer,s,!0))&&domUtils.isEmptyBlock(a)){var l=a.previousSibling;if(l&&"TABLE"!=l.nodeName)return domUtils.remove(a),void i.setStartAtLast(l).setCursor(!1,!0);var d=a.nextSibling;if(d&&"TABLE"!=d.nodeName)return domUtils.remove(a),void i.setStartAtFirst(d).setCursor(!1,!0)}if(domUtils.isBody(i.startContainer)){var a=domUtils.createElement(r.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"<br/>"});i.insertNode(a).setStart(a,0).setCursor(!1,!0)}}if(!t&&(3==i.startContainer.nodeType||1==i.startContainer.nodeType&&domUtils.isEmptyBlock(i.startContainer)))if(browser.ie){var c=i.document.createElement("span");i.insertNode(c).setStartBefore(c).collapse(!0),i.select(),domUtils.remove(c)}else i.select()}})},UE.plugins.fiximgclick=function(){function e(){this.editor=null,this.resizer=null,this.cover=null,this.doc=document,this.prePos={x:0,y:0},this.startPos={x:0,y:0}}var t=!1;return function(){var n=[[0,0,-1,-1],[0,0,0,-1],[0,0,1,-1],[0,0,-1,0],[0,0,1,0],[0,0,-1,1],[0,0,0,1],[0,0,1,1]];e.prototype={init:function(e){var t=this;t.editor=e,t.startPos=this.prePos={x:0,y:0},t.dragId=-1;var n=[],o=t.cover=document.createElement("div"),r=t.resizer=document.createElement("div");for(o.id=t.editor.ui.id+"_imagescale_cover",o.style.cssText="position:absolute;display:none;z-index:"+t.editor.options.zIndex+";filter:alpha(opacity=0); opacity:0;background:#CCC;",domUtils.on(o,"mousedown click",function(){t.hide()}),i=0;i<8;i++)n.push('<span class="edui-editor-imagescale-hand'+i+'"></span>');r.id=t.editor.ui.id+"_imagescale",r.className="edui-editor-imagescale",r.innerHTML=n.join(""),r.style.cssText+=";display:none;border:1px solid #3b77ff;z-index:"+t.editor.options.zIndex+";",t.editor.ui.getDom().appendChild(o),t.editor.ui.getDom().appendChild(r),t.initStyle(),t.initEvents()},initStyle:function(){utils.cssRule("imagescale",".edui-editor-imagescale{display:none;position:absolute;border:1px solid #38B2CE;cursor:hand;-webkit-box-sizing: content-box;-moz-box-sizing: content-box;box-sizing: content-box;}.edui-editor-imagescale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}.edui-editor-imagescale .edui-editor-imagescale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-imagescale .edui-editor-imagescale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}.edui-editor-imagescale .edui-editor-imagescale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}")},initEvents:function(){var e=this;e.startPos.x=e.startPos.y=0,e.isDraging=!1},_eventHandler:function(e){var n=this;switch(e.type){case"mousedown":var i,i=e.target||e.srcElement;-1!=i.className.indexOf("edui-editor-imagescale-hand")&&-1==n.dragId&&(n.dragId=i.className.slice(-1),n.startPos.x=n.prePos.x=e.clientX,n.startPos.y=n.prePos.y=e.clientY,domUtils.on(n.doc,"mousemove",n.proxy(n._eventHandler,n)));break;case"mousemove":-1!=n.dragId&&(n.updateContainerStyle(n.dragId,{x:e.clientX-n.prePos.x,y:e.clientY-n.prePos.y}),n.prePos.x=e.clientX,n.prePos.y=e.clientY,t=!0,n.updateTargetElement());break;case"mouseup":-1!=n.dragId&&(n.updateContainerStyle(n.dragId,{x:e.clientX-n.prePos.x,y:e.clientY-n.prePos.y}),n.updateTargetElement(),n.target.parentNode&&n.attachTo(n.target),n.dragId=-1),domUtils.un(n.doc,"mousemove",n.proxy(n._eventHandler,n)),t&&(t=!1,n.editor.fireEvent("contentchange"))}},updateTargetElement:function(){var e=this;domUtils.setStyles(e.target,{width:e.resizer.style.width,height:e.resizer.style.height}),e.target.width=parseInt(e.resizer.style.width),e.target.height=parseInt(e.resizer.style.height),e.attachTo(e.target)},updateContainerStyle:function(e,t){var i,o=this,r=o.resizer;0!=n[e][0]&&(i=parseInt(r.style.left)+t.x,r.style.left=o._validScaledProp("left",i)+"px"),0!=n[e][1]&&(i=parseInt(r.style.top)+t.y,r.style.top=o._validScaledProp("top",i)+"px"),0!=n[e][2]&&(i=r.clientWidth+n[e][2]*t.x,r.style.width=o._validScaledProp("width",i)+"px"),0!=n[e][3]&&(i=r.clientHeight+n[e][3]*t.y,r.style.height=o._validScaledProp("height",i)+"px")},_validScaledProp:function(e,t){var n=this.resizer,i=document;switch(t=isNaN(t)?0:t,e){case"left":return t<0?0:t+n.clientWidth>i.clientWidth?i.clientWidth-n.clientWidth:t;case"top":return t<0?0:t+n.clientHeight>i.clientHeight?i.clientHeight-n.clientHeight:t;case"width":return t<=0?1:t+n.offsetLeft>i.clientWidth?i.clientWidth-n.offsetLeft:t;case"height":return t<=0?1:t+n.offsetTop>i.clientHeight?i.clientHeight-n.offsetTop:t}},hideCover:function(){this.cover.style.display="none"},showCover:function(){var e=this,t=domUtils.getXY(e.editor.ui.getDom()),n=domUtils.getXY(e.editor.iframe);domUtils.setStyles(e.cover,{width:e.editor.iframe.offsetWidth+"px",height:e.editor.iframe.offsetHeight+"px",top:n.y-t.y+"px",left:n.x-t.x+"px",position:"absolute",display:""})},show:function(e){var t=this;t.resizer.style.display="block",e&&t.attachTo(e),domUtils.on(this.resizer,"mousedown",t.proxy(t._eventHandler,t)),domUtils.on(t.doc,"mouseup",t.proxy(t._eventHandler,t)),t.showCover(),t.editor.fireEvent("afterscaleshow",t),t.editor.fireEvent("saveScene")},hide:function(){var e=this;e.hideCover(),e.resizer.style.display="none",domUtils.un(e.resizer,"mousedown",e.proxy(e._eventHandler,e)),domUtils.un(e.doc,"mouseup",e.proxy(e._eventHandler,e)),e.editor.fireEvent("afterscalehide",e)},proxy:function(e,t){return function(n){return e.apply(t||this,arguments)}},attachTo:function(e){var t=this,n=t.target=e,i=this.resizer,o=domUtils.getXY(n),r=domUtils.getXY(t.editor.iframe),a=domUtils.getXY(i.parentNode);domUtils.setStyles(i,{width:n.width+"px",height:n.height+"px",left:r.x+o.x-t.editor.document.body.scrollLeft-a.x-parseInt(i.style.borderLeftWidth)+"px",top:r.y+o.y-t.editor.document.body.scrollTop-a.y-parseInt(i.style.borderTopWidth)+"px"})}}}(),function(){var t,n=this;n.setOpt("imageScaleEnabled",!0),!browser.ie&&n.options.imageScaleEnabled&&n.addListener("click",function(i,o){var r=n.selection.getRange(),a=r.getClosedNode();if(a&&"IMG"==a.tagName&&"false"!=n.body.contentEditable){if(-1!=a.className.indexOf("edui-faked-music")||a.getAttribute("anchorname")||domUtils.hasClass(a,"loadingclass")||domUtils.hasClass(a,"loaderrorclass"))return;if(!t){t=new e,t.init(n),n.ui.getDom().appendChild(t.resizer);var s,l=function(e){t.hide(),t.target&&n.selection.getRange().selectNode(t.target).select()},d=function(e){var t=e.target||e.srcElement;!t||void 0!==t.className&&-1!=t.className.indexOf("edui-editor-imagescale")||l()};n.addListener("afterscaleshow",function(e){n.addListener("beforekeydown",l),n.addListener("beforemousedown",d),domUtils.on(document,"keydown",l),domUtils.on(document,"mousedown",d),n.selection.getNative().removeAllRanges()}),n.addListener("afterscalehide",function(e){n.removeListener("beforekeydown",l),n.removeListener("beforemousedown",d),domUtils.un(document,"keydown",l),domUtils.un(document,"mousedown",d);var i=t.target;i.parentNode&&n.selection.getRange().selectNode(i).select()}),domUtils.on(t.resizer,"mousedown",function(e){n.selection.getNative().removeAllRanges();var i=e.target||e.srcElement;i&&-1==i.className.indexOf("edui-editor-imagescale-hand")&&(s=setTimeout(function(){t.hide(),t.target&&n.selection.getRange().selectNode(i).select()},200))}),domUtils.on(t.resizer,"mouseup",function(e){var t=e.target||e.srcElement;t&&-1==t.className.indexOf("edui-editor-imagescale-hand")&&clearTimeout(s)})}t.show(a)}else t&&"none"!=t.resizer.style.display&&t.hide()}),browser.webkit&&n.addListener("click",function(e,t){if("IMG"==t.target.tagName&&"false"!=n.body.contentEditable){new dom.Range(n.document).selectNode(t.target).select()}})}}(),UE.plugin.register("autolink",function(){var e=0;return browser.ie?{}:{bindEvents:{reset:function(){e=0},keydown:function(e,t){var n=this,i=t.keyCode||t.which;if(32==i||13==i){for(var o,r,a=n.selection.getNative(),s=a.getRangeAt(0).cloneRange(),l=s.startContainer;1==l.nodeType&&s.startOffset>0&&(l=s.startContainer.childNodes[s.startOffset-1]);)s.setStart(l,1==l.nodeType?l.childNodes.length:l.nodeValue.length),s.collapse(!0),l=s.startContainer;do{if(0==s.startOffset){for(l=s.startContainer.previousSibling;l&&1==l.nodeType;)l=l.lastChild;if(!l||domUtils.isFillChar(l))break;o=l.nodeValue.length}else l=s.startContainer,o=s.startOffset;s.setStart(l,o-1),r=s.toString().charCodeAt(0)}while(160!=r&&32!=r);if(s.toString().replace(new RegExp(domUtils.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){for(;s.toString().length&&!/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(s.toString());)try{s.setStart(s.startContainer,s.startOffset+1)}catch(e){for(var l=s.startContainer;!(next=l.nextSibling);){if(domUtils.isBody(l))return;l=l.parentNode}s.setStart(next,0)}if(domUtils.findParentByTagName(s.startContainer,"a",!0))return;var d,c=n.document.createElement("a"),u=n.document.createTextNode(" ");n.undoManger&&n.undoManger.save(),c.appendChild(s.extractContents()),c.href=c.innerHTML=c.innerHTML.replace(/<[^>]+>/g,""),d=c.getAttribute("href").replace(new RegExp(domUtils.fillChar,"g"),""),d=/^(?:https?:\/\/)/gi.test(d)?d:"http://"+d,c.setAttribute("_src",utils.html(d)),c.href=utils.html(d),s.insertNode(c),c.parentNode.insertBefore(u,c.nextSibling),s.setStart(u,0),s.collapse(!0),a.removeAllRanges(),a.addRange(s),n.undoManger&&n.undoManger.save()}}}}}},function(){function e(e){if(3==e.nodeType)return null;if("A"==e.nodeName)return e;for(var t=e.lastChild;t;){if("A"==t.nodeName)return t;if(3==t.nodeType){if(domUtils.isWhitespace(t)){t=t.previousSibling;continue}return null}t=t.lastChild}}var t={37:1,38:1,39:1,40:1,13:1,32:1};browser.ie&&this.addListener("keyup",function(n,i){var o=this,r=i.keyCode;if(t[r]){var a=o.selection.getRange(),s=a.startContainer;if(13==r){for(;s&&!domUtils.isBody(s)&&!domUtils.isBlockElm(s);)s=s.parentNode;if(s&&!domUtils.isBody(s)&&"P"==s.nodeName){var l=s.previousSibling;if(l&&1==l.nodeType){var l=e(l);l&&!l.getAttribute("_href")&&domUtils.remove(l,!0)}}}else if(32==r)3==s.nodeType&&/^\s$/.test(s.nodeValue)&&(s=s.previousSibling)&&"A"==s.nodeName&&!s.getAttribute("_href")&&domUtils.remove(s,!0);else if((s=domUtils.findParentByTagName(s,"a",!0))&&!s.getAttribute("_href")){var d=a.createBookmark();domUtils.remove(s,!0),a.moveToBookmark(d).select(!0)}}})}),UE.plugins.autoheight=function(){function e(){var e=this;clearTimeout(o),r||(!e.queryCommandState||e.queryCommandState&&1!=e.queryCommandState("source"))&&(o=setTimeout(function(){for(var t=e.body.lastChild;t&&1!=t.nodeType;)t=t.previousSibling;t&&1==t.nodeType&&(t.style.clear="both",i=Math.max(domUtils.getXY(t).y+t.offsetHeight+25,Math.max(s.minFrameHeight,s.initialFrameHeight)),i!=a&&(i!==parseInt(e.iframe.parentNode.style.height)&&(e.iframe.parentNode.style.height=i+"px"),e.body.style.height=i+"px",a=i),domUtils.removeStyle(t,"clear"))},50))}var t=this;if(t.autoHeightEnabled=!1!==t.options.autoHeightEnabled,t.autoHeightEnabled){var n,i,o,r,a=0,s=t.options;t.addListener("fullscreenchanged",function(e,t){r=t}),t.addListener("destroy",function(){t.removeListener("contentchange afterinserthtml keyup mouseup",e)}),t.enableAutoHeight=function(){var t=this;if(t.autoHeightEnabled){var i=t.document;t.autoHeightEnabled=!0,n=i.body.style.overflowY,i.body.style.overflowY="hidden",t.addListener("contentchange afterinserthtml keyup mouseup",e),setTimeout(function(){e.call(t)},browser.gecko?100:0),t.fireEvent("autoheightchanged",t.autoHeightEnabled)}},t.disableAutoHeight=function(){t.body.style.overflowY=n||"",t.removeListener("contentchange",e),t.removeListener("keyup",e),t.removeListener("mouseup",e),t.autoHeightEnabled=!1,t.fireEvent("autoheightchanged",t.autoHeightEnabled)},t.on("setHeight",function(){t.disableAutoHeight()}),t.addListener("ready",function(){t.enableAutoHeight();var n;domUtils.on(browser.ie?t.body:t.document,browser.webkit?"dragover":"drop",function(){clearTimeout(n),n=setTimeout(function(){e.call(t)},100)});var i;window.onscroll=function(){null===i?i=this.scrollY:0==this.scrollY&&0!=i&&(t.window.scrollTo(0,0),i=null)}})}},UE.plugins.autofloat=function(){function e(){return UE.ui?1:(alert(a.autofloatMsg),0)}function t(){var e=document.body.style;e.backgroundImage='url("about:blank")',e.backgroundAttachment="fixed"}function n(){var e=domUtils.getXY(c),t=domUtils.getComputedStyle(c,"position"),n=domUtils.getComputedStyle(c,"left");c.style.width=c.offsetWidth+"px",c.style.zIndex=1*r.options.zIndex+1,c.parentNode.insertBefore(g,c),h||p&&browser.ie?("absolute"!=c.style.position&&(c.style.position="absolute"),c.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-u+l+"px"):(browser.ie7Compat&&v&&(v=!1,c.style.left=domUtils.getXY(c).x-document.documentElement.getBoundingClientRect().left+2+"px"),"fixed"!=c.style.position&&(c.style.position="fixed",c.style.top=l+"px",("absolute"==t||"relative"==t)&&parseFloat(n)&&(c.style.left=e.x+"px")))}function i(){v=!0,g.parentNode&&g.parentNode.removeChild(g),c.style.cssText=d}function o(){var e=m(r.container),t=r.options.toolbarTopOffset||0;e.top<0&&e.bottom-c.offsetHeight>t?n():i()}var r=this,a=r.getLang();r.setOpt({topOffset:0});var s=!1!==r.options.autoFloatEnabled,l=r.options.topOffset;if(s){var d,c,u,m,f=UE.ui.uiUtils,h=browser.ie&&browser.version<=6,p=browser.quirks,g=document.createElement("div"),v=!0,b=utils.defer(function(){o()},browser.ie?200:100,!0);r.addListener("destroy",function(){domUtils.un(window,["scroll","resize"],o),r.removeListener("keydown",b)}),r.addListener("ready",function(){if(e()){if(!r.ui)return;m=f.getClientRect,c=r.ui.getDom("toolbarbox"),u=m(c).top,d=c.style.cssText,g.style.height=c.offsetHeight+"px",h&&t(),domUtils.on(window,["scroll","resize"],o),r.addListener("keydown",b),r.addListener("beforefullscreenchange",function(e,t){t&&i()}),r.addListener("fullscreenchanged",function(e,t){t||o()}),r.addListener("sourcemodechanged",function(e,t){setTimeout(function(){o()},0)}),r.addListener("clearDoc",function(){setTimeout(function(){o()},0)})}})}},UE.plugins.video=function(){function e(e,t,i,o,r,a,s){e=utils.unhtmlForUrl(e),r=utils.unhtml(r),a=utils.unhtml(a),t=parseInt(t,10)||0,i=parseInt(i,10)||0;var l;switch(s){case"image":l="<img "+(o?'id="'+o+'"':"")+' width="'+t+'" height="'+i+'" _url="'+e+'" class="'+a.replace(/\bvideo-js\b/,"")+'" src="'+n.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+n.options.UEDITOR_HOME_URL+"themes/default/images/videologo.gif) no-repeat center center; border:1px solid gray;"+(r?"float:"+r+";":"")+'" />';break;case"embed":l='<embed type="application/x-shockwave-flash" class="'+a+'" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+utils.html(e)+'" width="'+t+'" height="'+i+'"'+(r?' style="float:'+r+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >';break;case"video":var d=e.substr(e.lastIndexOf(".")+1);"ogv"==d&&(d="ogg"),l="<video"+(o?' id="'+o+'"':"")+' class="'+a+' video-js" '+(r?' style="float:'+r+'"':"")+' controls preload="none" width="'+t+'" height="'+i+'" src="'+e+'" data-setup="{}"><source src="'+e+'" type="video/'+d+'" /></video>'}return l}function t(t,n){utils.each(t.getNodesByTagName(n?"img":"embed video"),function(t){var i=t.getAttr("class");if(i&&-1!=i.indexOf("edui-faked-video")){var o=e(n?t.getAttr("_url"):t.getAttr("src"),t.getAttr("width"),t.getAttr("height"),null,t.getStyle("float")||"",i,n?"embed":"image");t.parentNode.replaceChild(UE.uNode.createElement(o),t)}if(i&&-1!=i.indexOf("edui-upload-video")){var o=e(n?t.getAttr("_url"):t.getAttr("src"),t.getAttr("width"),t.getAttr("height"),null,t.getStyle("float")||"",i,n?"video":"image");t.parentNode.replaceChild(UE.uNode.createElement(o),t)}})}var n=this;n.addOutputRule(function(e){t(e,!0)}),n.addInputRule(function(e){t(e)}),n.commands.insertvideo={execCommand:function(t,i,o){i=utils.isArray(i)?i:[i];for(var r,a,s=[],l=0,d=i.length;l<d;l++)a=i[l],r="upload"==o?"edui-upload-video video-js vjs-default-skin":"edui-faked-video",s.push(e(a.url,a.width||420,a.height||280,"tmpVedio"+l,null,r,"image"));n.execCommand("inserthtml",s.join(""),!0);for(var c=this.selection.getRange(),l=0,d=i.length;l<d;l++){var u=this.document.getElementById("tmpVedio"+l);domUtils.removeAttributes(u,"id"),c.selectNode(u).select(),n.execCommand("imagefloat",i[l].align)}},queryCommandState:function(){var e=n.selection.getRange().getClosedNode();return!e||"edui-faked-video"!=e.className&&-1==e.className.indexOf("edui-upload-video")?0:1}}},function(){var e=UE.UETable=function(e){this.table=e,this.indexTable=[],this.selectedTds=[],this.cellsRange={},this.update(e)};e.removeSelectedClass=function(e){utils.each(e,function(e){domUtils.removeClasses(e,"selectTdClass")})},e.addSelectedClass=function(e){utils.each(e,function(e){domUtils.addClass(e,"selectTdClass")})},e.isEmptyBlock=function(e){var t=new RegExp(domUtils.fillChar,"g");if(e[browser.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(t,"").length>0)return 0;for(var n in dtd.$isNotEmpty)if(dtd.$isNotEmpty.hasOwnProperty(n)&&e.getElementsByTagName(n).length)return 0;return 1},e.getWidth=function(e){return e?parseInt(domUtils.getComputedStyle(e,"width"),10):0},e.getTableCellAlignState=function(e){!utils.isArray(e)&&(e=[e]);var t={},n=["align","valign"],i=null,o=!0;return utils.each(e,function(e){return utils.each(n,function(n){if(i=e.getAttribute(n),!t[n]&&i)t[n]=i;else if(!t[n]||i!==t[n])return o=!1,!1}),o}),o?t:null},e.getTableItemsByRange=function(e){var t=e.selection.getStart();t&&t.id&&0===t.id.indexOf("_baidu_bookmark_start_")&&t.nextSibling&&(t=t.nextSibling);var n=t&&domUtils.findParentByTagName(t,["td","th"],!0),i=n&&n.parentNode,o=t&&domUtils.findParentByTagName(t,"caption",!0);return{cell:n,tr:i,table:o?o.parentNode:i&&i.parentNode.parentNode,caption:o}},e.getUETableBySelected=function(t){var n=e.getTableItemsByRange(t).table;return n&&n.ueTable&&n.ueTable.selectedTds.length?n.ueTable:null},e.getDefaultValue=function(e,t){var n,i,o,r,a={thin:"0px",medium:"1px",thick:"2px"};if(t)return s=t.getElementsByTagName("td")[0],r=domUtils.getComputedStyle(t,"border-left-width"),n=parseInt(a[r]||r,10),r=domUtils.getComputedStyle(s,"padding-left"),i=parseInt(a[r]||r,10),r=domUtils.getComputedStyle(s,"border-left-width"),o=parseInt(a[r]||r,10),{tableBorder:n,tdPadding:i,tdBorder:o};t=e.document.createElement("table"),t.insertRow(0).insertCell(0).innerHTML="xxx",e.body.appendChild(t);var s=t.getElementsByTagName("td")[0];return r=domUtils.getComputedStyle(t,"border-left-width"),n=parseInt(a[r]||r,10),r=domUtils.getComputedStyle(s,"padding-left"),i=parseInt(a[r]||r,10),r=domUtils.getComputedStyle(s,"border-left-width"),o=parseInt(a[r]||r,10),domUtils.remove(t),{tableBorder:n,tdPadding:i,tdBorder:o}},e.getUETable=function(t){var n=t.tagName.toLowerCase();return t="td"==n||"th"==n||"caption"==n?domUtils.findParentByTagName(t,"table",!0):t,t.ueTable||(t.ueTable=new e(t)),t.ueTable},e.cloneCell=function(e,t,n){if(!e||utils.isString(e))return this.table.ownerDocument.createElement(e||"td");var i=domUtils.hasClass(e,"selectTdClass");i&&domUtils.removeClasses(e,"selectTdClass");var o=e.cloneNode(!0);return t&&(o.rowSpan=o.colSpan=1),!n&&domUtils.removeAttributes(o,"width height"),!n&&domUtils.removeAttributes(o,"style"),o.style.borderLeftStyle="",o.style.borderTopStyle="",o.style.borderLeftColor=e.style.borderRightColor,o.style.borderLeftWidth=e.style.borderRightWidth,o.style.borderTopColor=e.style.borderBottomColor,o.style.borderTopWidth=e.style.borderBottomWidth,i&&domUtils.addClass(e,"selectTdClass"),o},e.prototype={getMaxRows:function(){for(var e,t=this.table.rows,n=1,i=0;e=t[i];i++){for(var o,r=1,a=0;o=e.cells[a++];)r=Math.max(o.rowSpan||1,r);n=Math.max(r+i,n)}return n},getMaxCols:function(){for(var e,t=this.table.rows,n=0,i={},o=0;e=t[o];o++){for(var r,a=0,s=0;r=e.cells[s++];)if(a+=r.colSpan||1,r.rowSpan&&r.rowSpan>1)for(var l=1;l<r.rowSpan;l++)i["row_"+(o+l)]?i["row_"+(o+l)]++:i["row_"+(o+l)]=r.colSpan||1;a+=i["row_"+o]||0,n=Math.max(a,n)}return n},getCellColIndex:function(e){},getHSideCell:function(e,t){try{var n,i,o=this.getCellInfo(e),r=this.selectedTds.length,a=this.cellsRange;return!t&&(r?!a.beginColIndex:!o.colIndex)||t&&(r?a.endColIndex==this.colsNum-1:o.colIndex==this.colsNum-1)?null:(n=r?a.beginRowIndex:o.rowIndex,i=t?r?a.endColIndex+1:o.colIndex+1:r?a.beginColIndex-1:o.colIndex<1?0:o.colIndex-1,this.getCell(this.indexTable[n][i].rowIndex,this.indexTable[n][i].cellIndex))}catch(e){}},getTabNextCell:function(e,t){var n,i=this.getCellInfo(e),o=t||i.rowIndex,r=i.colIndex+1+(i.colSpan-1);try{n=this.getCell(this.indexTable[o][r].rowIndex,this.indexTable[o][r].cellIndex)}catch(e){try{o=1*o+1,r=0,n=this.getCell(this.indexTable[o][r].rowIndex,this.indexTable[o][r].cellIndex)}catch(e){}}return n},getVSideCell:function(e,t,n){try{var i,o,r=this.getCellInfo(e),a=this.selectedTds.length&&!n,s=this.cellsRange;return!t&&0==r.rowIndex||t&&(a?s.endRowIndex==this.rowsNum-1:r.rowIndex+r.rowSpan>this.rowsNum-1)?null:(i=t?a?s.endRowIndex+1:r.rowIndex+r.rowSpan:a?s.beginRowIndex-1:r.rowIndex-1,o=a?s.beginColIndex:r.colIndex,this.getCell(this.indexTable[i][o].rowIndex,this.indexTable[i][o].cellIndex))}catch(e){}},getSameEndPosCells:function(e,t){try{for(var n="x"===t.toLowerCase(),i=domUtils.getXY(e)[n?"x":"y"]+e["offset"+(n?"Width":"Height")],o=this.table.rows,r=null,a=[],s=0;s<this.rowsNum;s++){r=o[s].cells;for(var l,d=0;l=r[d++];){var c=domUtils.getXY(l)[n?"x":"y"]+l["offset"+(n?"Width":"Height")];if(c>i&&n)break;if((e==l||i==c)&&(1==l[n?"colSpan":"rowSpan"]&&a.push(l),n))break}}return a}catch(e){}},setCellContent:function(e,t){e.innerHTML=t||(browser.ie?domUtils.fillChar:"<br />")},cloneCell:e.cloneCell,getSameStartPosXCells:function(e){try{for(var t,n=domUtils.getXY(e).x+e.offsetWidth,i=this.table.rows,o=[],r=0;r<this.rowsNum;r++){t=i[r].cells;for(var a,s=0;a=t[s++];){var l=domUtils.getXY(a).x;if(l>n)break;if(l==n&&1==a.colSpan){o.push(a);break}}}return o}catch(e){}},update:function(e){this.table=e||this.table,this.selectedTds=[],this.cellsRange={},this.indexTable=[];for(var t=this.table.rows,n=this.getMaxRows(),i=n-t.length,o=this.getMaxCols();i--;)this.table.insertRow(t.length);this.rowsNum=n,this.colsNum=o;for(var r=0,a=t.length;r<a;r++)this.indexTable[r]=new Array(o);for(var s,l=0;s=t[l];l++)for(var d,c=0,u=s.cells;d=u[c];c++){d.rowSpan>n&&(d.rowSpan=n);for(var m=c,f=d.rowSpan||1,h=d.colSpan||1;this.indexTable[l][m];)m++;for(var p=0;p<f;p++)for(var g=0;g<h;g++)this.indexTable[l+p][m+g]={rowIndex:l,cellIndex:c,colIndex:m,rowSpan:f,colSpan:h}}for(p=0;p<n;p++)for(g=0;g<o;g++)void 0===this.indexTable[p][g]&&(s=t[p],d=s.cells[s.cells.length-1],d=d?d.cloneNode(!0):this.table.ownerDocument.createElement("td"),this.setCellContent(d),1!==d.colSpan&&(d.colSpan=1),1!==d.rowSpan&&(d.rowSpan=1),s.appendChild(d),this.indexTable[p][g]={rowIndex:p,cellIndex:d.cellIndex,colIndex:g,rowSpan:1,colSpan:1});var v=domUtils.getElementsByTagName(this.table,"td"),b=[];if(utils.each(v,function(e){domUtils.hasClass(e,"selectTdClass")&&b.push(e)}),b.length){var y=b[0],C=b[b.length-1],x=this.getCellInfo(y),w=this.getCellInfo(C);this.selectedTds=b,this.cellsRange={beginRowIndex:x.rowIndex,beginColIndex:x.colIndex,endRowIndex:w.rowIndex+w.rowSpan-1,endColIndex:w.colIndex+w.colSpan-1}}if(!domUtils.hasClass(this.table.rows[0],"firstRow")){domUtils.addClass(this.table.rows[0],"firstRow");for(var r=1;r<this.table.rows.length;r++)domUtils.removeClasses(this.table.rows[r],"firstRow")}},getCellInfo:function(e){if(e)for(var t=e.cellIndex,n=e.parentNode.rowIndex,i=this.indexTable[n],o=this.colsNum,r=t;r<o;r++){var a=i[r];if(a.rowIndex===n&&a.cellIndex===t)return a}},getCell:function(e,t){return e<this.rowsNum&&this.table.rows[e].cells[t]||null},deleteCell:function(e,t){t="number"==typeof t?t:e.parentNode.rowIndex,this.table.rows[t].deleteCell(e.cellIndex)},getCellsRange:function(e,t){function n(e,t,o,r){var a,s,l,d=e,c=t,u=o,m=r;if(e>0)for(s=t;s<r;s++)a=i.indexTable[e][s],(l=a.rowIndex)<e&&(d=Math.min(l,d));if(r<i.colsNum)for(l=e;l<o;l++)a=i.indexTable[l][r],(s=a.colIndex+a.colSpan-1)>r&&(m=Math.max(s,m));if(o<i.rowsNum)for(s=t;s<r;s++)a=i.indexTable[o][s],(l=a.rowIndex+a.rowSpan-1)>o&&(u=Math.max(l,u));if(t>0)for(l=e;l<o;l++)a=i.indexTable[l][t],(s=a.colIndex)<t&&(c=Math.min(a.colIndex,c));return d!=e||c!=t||u!=o||m!=r?n(d,c,u,m):{beginRowIndex:e,beginColIndex:t,endRowIndex:o,endColIndex:r}}try{var i=this,o=i.getCellInfo(e);if(e===t)return{beginRowIndex:o.rowIndex,beginColIndex:o.colIndex,endRowIndex:o.rowIndex+o.rowSpan-1,endColIndex:o.colIndex+o.colSpan-1};var r=i.getCellInfo(t);return n(Math.min(o.rowIndex,r.rowIndex),Math.min(o.colIndex,r.colIndex),Math.max(o.rowIndex+o.rowSpan-1,r.rowIndex+r.rowSpan-1),Math.max(o.colIndex+o.colSpan-1,r.colIndex+r.colSpan-1))}catch(e){}},getCells:function(e){this.clearSelected();for(var t,n,i,o=e.beginRowIndex,r=e.beginColIndex,a=e.endRowIndex,s=e.endColIndex,l={},d=[],c=o;c<=a;c++)for(var u=r;u<=s;u++){t=this.indexTable[c][u],n=t.rowIndex,i=t.colIndex;var m=n+"|"+i;if(!l[m]){if(l[m]=1,n<c||i<u||n+t.rowSpan-1>a||i+t.colSpan-1>s)return null;d.push(this.getCell(n,t.cellIndex))}}return d},clearSelected:function(){e.removeSelectedClass(this.selectedTds),this.selectedTds=[],this.cellsRange={}},setSelected:function(t){var n=this.getCells(t);e.addSelectedClass(n),this.selectedTds=n,this.cellsRange=t},isFullRow:function(){var e=this.cellsRange;return e.endColIndex-e.beginColIndex+1==this.colsNum},isFullCol:function(){var e=this.cellsRange,t=this.table,n=t.getElementsByTagName("th"),i=e.endRowIndex-e.beginRowIndex+1;return n.length?i==this.rowsNum||i==this.rowsNum-1:i==this.rowsNum},getNextCell:function(e,t,n){try{var i,o,r=this.getCellInfo(e),a=this.selectedTds.length&&!n,s=this.cellsRange;return!t&&0==r.rowIndex||t&&(a?s.endRowIndex==this.rowsNum-1:r.rowIndex+r.rowSpan>this.rowsNum-1)?null:(i=t?a?s.endRowIndex+1:r.rowIndex+r.rowSpan:a?s.beginRowIndex-1:r.rowIndex-1,o=a?s.beginColIndex:r.colIndex,this.getCell(this.indexTable[i][o].rowIndex,this.indexTable[i][o].cellIndex))}catch(e){}},getPreviewCell:function(e,t){try{var n,i,o=this.getCellInfo(e),r=this.selectedTds.length,a=this.cellsRange;return!t&&(r?!a.beginColIndex:!o.colIndex)||t&&(r?a.endColIndex==this.colsNum-1:o.rowIndex>this.colsNum-1)?null:(n=t?r?a.beginRowIndex:o.rowIndex<1?0:o.rowIndex-1:r?a.beginRowIndex:o.rowIndex,i=t?r?a.endColIndex+1:o.colIndex:r?a.beginColIndex-1:o.colIndex<1?0:o.colIndex-1,this.getCell(this.indexTable[n][i].rowIndex,this.indexTable[n][i].cellIndex))}catch(e){}},moveContent:function(t,n){if(!e.isEmptyBlock(n)){if(e.isEmptyBlock(t))return void(t.innerHTML=n.innerHTML);var i=t.lastChild;for(3!=i.nodeType&&dtd.$block[i.tagName]||t.appendChild(t.ownerDocument.createElement("br"));i=n.firstChild;)t.appendChild(i)}},mergeRight:function(e){var t=this.getCellInfo(e),n=t.colIndex+t.colSpan,i=this.indexTable[t.rowIndex][n],o=this.getCell(i.rowIndex,i.cellIndex);e.colSpan=t.colSpan+i.colSpan,e.removeAttribute("width"),this.moveContent(e,o),this.deleteCell(o,i.rowIndex),this.update()},mergeDown:function(e){var t=this.getCellInfo(e),n=t.rowIndex+t.rowSpan,i=this.indexTable[n][t.colIndex],o=this.getCell(i.rowIndex,i.cellIndex);e.rowSpan=t.rowSpan+i.rowSpan,e.removeAttribute("height"),this.moveContent(e,o),this.deleteCell(o,i.rowIndex),this.update()},mergeRange:function(){var e=this.cellsRange,t=this.getCell(e.beginRowIndex,this.indexTable[e.beginRowIndex][e.beginColIndex].cellIndex);if("TH"==t.tagName&&e.endRowIndex!==e.beginRowIndex){var n=this.indexTable,i=this.getCellInfo(t);t=this.getCell(1,n[1][i.colIndex].cellIndex),e=this.getCellsRange(t,this.getCell(n[this.rowsNum-1][i.colIndex].rowIndex,n[this.rowsNum-1][i.colIndex].cellIndex))}for(var o,r=this.getCells(e),a=0;o=r[a++];)o!==t&&(this.moveContent(t,o),this.deleteCell(o));if(t.rowSpan=e.endRowIndex-e.beginRowIndex+1,t.rowSpan>1&&t.removeAttribute("height"),t.colSpan=e.endColIndex-e.beginColIndex+1,t.colSpan>1&&t.removeAttribute("width"),t.rowSpan==this.rowsNum&&1!=t.colSpan&&(t.colSpan=1),t.colSpan==this.colsNum&&1!=t.rowSpan){var s=t.parentNode.rowIndex;if(this.table.deleteRow)for(var a=s+1,l=s+1,d=t.rowSpan;a<d;a++)this.table.deleteRow(l);else for(var a=0,d=t.rowSpan-1;a<d;a++){var c=this.table.rows[s+1];c.parentNode.removeChild(c)}t.rowSpan=1}this.update()},insertRow:function(e,t){function n(e,t,n){if(0==e){var i=n.nextSibling||n.previousSibling,o=i.cells[e];"TH"==o.tagName&&(o=t.ownerDocument.createElement("th"),o.appendChild(t.firstChild),n.insertBefore(o,t),domUtils.remove(t))}else if("TH"==t.tagName){var r=t.ownerDocument.createElement("td");r.appendChild(t.firstChild),n.insertBefore(r,t),domUtils.remove(t)}}var i,o=this.colsNum,r=this.table,a=r.insertRow(e),s="string"==typeof t&&"TH"==t.toUpperCase();if(0==e||e==this.rowsNum)for(var l=0;l<o;l++)i=this.cloneCell(t,!0),this.setCellContent(i),i.getAttribute("vAlign")&&i.setAttribute("vAlign",i.getAttribute("vAlign")),a.appendChild(i),s||n(l,i,a);else{var d=this.indexTable[e];for(l=0;l<o;l++){var c=d[l];c.rowIndex<e?(i=this.getCell(c.rowIndex,c.cellIndex),i.rowSpan=c.rowSpan+1):(i=this.cloneCell(t,!0),this.setCellContent(i),a.appendChild(i)),s||n(l,i,a)}}return this.update(),a},deleteRow:function(e){for(var t=this.table.rows[e],n=this.indexTable[e],i=this.colsNum,o=0,r=0;r<i;){var a=n[r],s=this.getCell(a.rowIndex,a.cellIndex);if(s.rowSpan>1&&a.rowIndex==e){var l=s.cloneNode(!0);l.rowSpan=s.rowSpan-1,l.innerHTML="",s.rowSpan=1;var d,c=e+1,u=this.table.rows[c],m=this.getPreviewMergedCellsNum(c,r)-o;m<r?(d=r-m-1,domUtils.insertAfter(u.cells[d],l)):u.cells.length&&u.insertBefore(l,u.cells[0]),o+=1}r+=s.colSpan||1}var f=[],h={};for(r=0;r<i;r++){var p=n[r].rowIndex,g=n[r].cellIndex,v=p+"_"+g;h[v]||(h[v]=1,s=this.getCell(p,g),f.push(s))}var b=[];utils.each(f,function(e){1==e.rowSpan?e.parentNode.removeChild(e):b.push(e)}),utils.each(b,function(e){e.rowSpan--}),t.parentNode.removeChild(t),this.update()},insertCol:function(e,t,n){function i(e,t,n){if(0==e){var i=t.nextSibling||t.previousSibling;"TH"==i.tagName&&(i=t.ownerDocument.createElement("th"),i.appendChild(t.firstChild),n.insertBefore(i,t),domUtils.remove(t))}else if("TH"==t.tagName){var o=t.ownerDocument.createElement("td");o.appendChild(t.firstChild),n.insertBefore(o,t),domUtils.remove(t)}}var o,r,a,s=this.rowsNum,l=0,d=parseInt((this.table.offsetWidth-20*(this.colsNum+1)-(this.colsNum+1))/(this.colsNum+1),10),c="string"==typeof t&&"TH"==t.toUpperCase();if(0==e||e==this.colsNum)for(;l<s;l++)o=this.table.rows[l],a=o.cells[0==e?e:o.cells.length],r=this.cloneCell(t,!0),this.setCellContent(r),r.setAttribute("vAlign",r.getAttribute("vAlign")),a&&r.setAttribute("width",a.getAttribute("width")),e?domUtils.insertAfter(o.cells[o.cells.length-1],r):o.insertBefore(r,o.cells[0]),c||i(l,r,o);else for(;l<s;l++){var u=this.indexTable[l][e];u.colIndex<e?(r=this.getCell(u.rowIndex,u.cellIndex),r.colSpan=u.colSpan+1):(o=this.table.rows[l],a=o.cells[u.cellIndex],r=this.cloneCell(t,!0),this.setCellContent(r),r.setAttribute("vAlign",r.getAttribute("vAlign")),a&&r.setAttribute("width",a.getAttribute("width")),a?o.insertBefore(r,a):o.appendChild(r)),c||i(l,r,o)}this.update(),this.updateWidth(d,n||{tdPadding:10,tdBorder:1})},updateWidth:function(t,n){var i=this.table,o=e.getWidth(i)-2*n.tdPadding-n.tdBorder+t;if(o<i.ownerDocument.body.offsetWidth)return void i.setAttribute("width",o);var r=domUtils.getElementsByTagName(this.table,"td th");utils.each(r,function(e){e.setAttribute("width",t)})},deleteCol:function(e){for(var t=this.indexTable,n=this.table.rows,i=this.table.getAttribute("width"),o=0,r=this.rowsNum,a={},s=0;s<r;){var l=t[s],d=l[e],c=d.rowIndex+"_"+d.colIndex;if(!a[c]){a[c]=1;var u=this.getCell(d.rowIndex,d.cellIndex);o||(o=u&&parseInt(u.offsetWidth/u.colSpan,10).toFixed(0)),u.colSpan>1?u.colSpan--:n[s].deleteCell(d.cellIndex),s+=d.rowSpan||1}}this.table.setAttribute("width",i-o),this.update()},splitToCells:function(e){var t=this,n=this.splitToRows(e);utils.each(n,function(e){t.splitToCols(e)})},splitToRows:function(e){var t=this.getCellInfo(e),n=t.rowIndex,i=t.colIndex,o=[];e.rowSpan=1,o.push(e);for(var r=n,a=n+t.rowSpan;r<a;r++)if(r!=n){var s=this.table.rows[r],l=s.insertCell(i-this.getPreviewMergedCellsNum(r,i));l.colSpan=t.colSpan,this.setCellContent(l),l.setAttribute("vAlign",e.getAttribute("vAlign")),l.setAttribute("align",e.getAttribute("align")),e.style.cssText&&(l.style.cssText=e.style.cssText),o.push(l)}return this.update(),o},getPreviewMergedCellsNum:function(e,t){for(var n=this.indexTable[e],i=0,o=0;o<t;){var r=n[o].colSpan;i+=r-(n[o].rowIndex==e?1:0),o+=r}return i},splitToCols:function(e){var t=(e.offsetWidth/e.colSpan-22).toFixed(0),n=this.getCellInfo(e),i=n.rowIndex,o=n.colIndex,r=[];e.colSpan=1,e.setAttribute("width",t),r.push(e);for(var a=o,s=o+n.colSpan;a<s;a++)if(a!=o){var l=this.table.rows[i],d=l.insertCell(this.indexTable[i][a].cellIndex+1);if(d.rowSpan=n.rowSpan,this.setCellContent(d),d.setAttribute("vAlign",e.getAttribute("vAlign")),d.setAttribute("align",e.getAttribute("align")),d.setAttribute("width",t),e.style.cssText&&(d.style.cssText=e.style.cssText),"TH"==e.tagName){var c=e.ownerDocument.createElement("th");c.appendChild(d.firstChild),c.setAttribute("vAlign",e.getAttribute("vAlign")),c.rowSpan=d.rowSpan,l.insertBefore(c,d),domUtils.remove(d)}r.push(d)}return this.update(),r},isLastCell:function(e,t,n){t=t||this.rowsNum,n=n||this.colsNum;var i=this.getCellInfo(e);return i.rowIndex+i.rowSpan==t&&i.colIndex+i.colSpan==n},getLastCell:function(e){e=e||this.table.getElementsByTagName("td");var t,n=(this.getCellInfo(e[0]),this),i=e[0],o=i.parentNode,r=0,a=0;return utils.each(e,function(e){e.parentNode==o&&(a+=e.colSpan||1),r+=e.rowSpan*e.colSpan||1}),t=r/a,utils.each(e,function(e){if(n.isLastCell(e,t,a))return i=e,!1}),i},selectRow:function(e){var t=this.indexTable[e],n=this.getCell(t[0].rowIndex,t[0].cellIndex),i=this.getCell(t[this.colsNum-1].rowIndex,t[this.colsNum-1].cellIndex),o=this.getCellsRange(n,i);this.setSelected(o)},selectTable:function(){var e=this.table.getElementsByTagName("td"),t=this.getCellsRange(e[0],e[e.length-1]);this.setSelected(t)},setBackground:function(e,t){if("string"==typeof t)utils.each(e,function(e){e.style.backgroundColor=t});else if("object"===(void 0===t?"undefined":_typeof(t))){t=utils.extend({repeat:!0,colorList:["#ddd","#fff"]},t);for(var n,i=this.getCellInfo(e[0]).rowIndex,o=0,r=t.colorList,a=0;n=e[a++];){var s=this.getCellInfo(n);n.style.backgroundColor=function(e,t,n){return e[t]?e[t]:n?e[t%e.length]:""}(r,i+o==s.rowIndex?o:++o,t.repeat)}}},removeBackground:function(e){utils.each(e,function(e){e.style.backgroundColor=""})}}}(),function(){function e(e,n){var i=domUtils.getElementsByTagName(e,"td th");utils.each(i,function(e){e.removeAttribute("width")}),e.setAttribute("width",t(n,!0,a(n,e)));var o=[];setTimeout(function(){utils.each(i,function(e){1==e.colSpan&&o.push(e.offsetWidth)}),utils.each(i,function(e,t){1==e.colSpan&&e.setAttribute("width",o[t]+"")})},0)}function t(e,t,n){var i=e.body;return i.offsetWidth-(t?2*parseInt(domUtils.getComputedStyle(i,"margin-left"),10):0)-2*n.tableBorder-(e.options.offsetWidth||0)}function n(e){var t=o(e).cell;if(t){var n=s(t);return n.selectedTds.length?n.selectedTds:[t]}return[]}var i=UE.UETable,o=function(e){return i.getTableItemsByRange(e)},r=function(e){return i.getUETableBySelected(e)},a=function(e,t){return i.getDefaultValue(e,t)},s=function(e){return i.getUETable(e)};UE.commands.inserttable={queryCommandState:function(){return o(this).table?-1:0},execCommand:function(e,t){t||(t=utils.extend({},{numCols:this.options.defaultCols,numRows:this.options.defaultRows,tdvalign:this.options.tdvalign}));var n=this,i=this.selection.getRange(),o=i.startContainer,r=domUtils.findParent(o,function(e){return domUtils.isBlockElm(e)},!0)||n.body,s=a(n),l=r.offsetWidth,d=Math.floor(l/t.numCols-2*s.tdPadding-s.tdBorder);!t.tdvalign&&(t.tdvalign=n.options.tdvalign),n.execCommand("inserthtml",function(e,t){for(var n=[],i=e.numRows,o=e.numCols,r=0;r<i;r++){n.push("<tr"+(0==r?' class="firstRow"':"")+">");for(var a=0;a<o;a++)n.push('<td width="'+t+'"  vAlign="'+e.tdvalign+'" >'+(browser.ie&&browser.version<11?domUtils.fillChar:"<br/>")+"</td>");n.push("</tr>")}return"<table><tbody>"+n.join("")+"</tbody></table>"}(t,d))}},UE.commands.insertparagraphbeforetable={queryCommandState:function(){return o(this).cell?0:-1},execCommand:function(){var e=o(this).table;if(e){var t=this.document.createElement("p");t.innerHTML=browser.ie?"&nbsp;":"<br />",e.parentNode.insertBefore(t,e),this.selection.getRange().setStart(t,0).setCursor()}}},UE.commands.deletetable={queryCommandState:function(){var e=this.selection.getRange();return domUtils.findParentByTagName(e.startContainer,"table",!0)?0:-1},execCommand:function(e,t){var n=this.selection.getRange();if(t=t||domUtils.findParentByTagName(n.startContainer,"table",!0)){var i=t.nextSibling;i||(i=domUtils.createElement(this.document,"p",{innerHTML:browser.ie?domUtils.fillChar:"<br/>"}),t.parentNode.insertBefore(i,t)),domUtils.remove(t),n=this.selection.getRange(),3==i.nodeType?n.setStartBefore(i):n.setStart(i,0),n.setCursor(!1,!0),this.fireEvent("tablehasdeleted")}}},UE.commands.cellalign={queryCommandState:function(){return n(this).length?0:-1},execCommand:function(e,t){var i=n(this);if(i.length)for(var o,r=0;o=i[r++];)o.setAttribute("align",t)}},UE.commands.cellvalign={queryCommandState:function(){return n(this).length?0:-1},execCommand:function(e,t){var i=n(this);if(i.length)for(var o,r=0;o=i[r++];)o.setAttribute("vAlign",t)}},UE.commands.insertcaption={queryCommandState:function(){var e=o(this).table;return e&&0==e.getElementsByTagName("caption").length?1:-1},execCommand:function(){var e=o(this).table;if(e){var t=this.document.createElement("caption");t.innerHTML=browser.ie?domUtils.fillChar:"<br/>",e.insertBefore(t,e.firstChild);this.selection.getRange().setStart(t,0).setCursor()}}},UE.commands.deletecaption={queryCommandState:function(){var e=this.selection.getRange(),t=domUtils.findParentByTagName(e.startContainer,"table");return t?0==t.getElementsByTagName("caption").length?-1:1:-1},execCommand:function(){var e=this.selection.getRange(),t=domUtils.findParentByTagName(e.startContainer,"table");if(t){domUtils.remove(t.getElementsByTagName("caption")[0]);this.selection.getRange().setStart(t.rows[0].cells[0],0).setCursor()}}},UE.commands.inserttitle={queryCommandState:function(){var e=o(this).table;if(e){var t=e.rows[0];return"th"!=t.cells[t.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var e=o(this).table;e&&s(e).insertRow(0,"th");var t=e.getElementsByTagName("th")[0];this.selection.getRange().setStart(t,0).setCursor(!1,!0)}},UE.commands.deletetitle={queryCommandState:function(){var e=o(this).table;if(e){var t=e.rows[0];return"th"==t.cells[t.cells.length-1].tagName.toLowerCase()?0:-1}return-1},execCommand:function(){var e=o(this).table;e&&domUtils.remove(e.rows[0]);var t=e.getElementsByTagName("td")[0];this.selection.getRange().setStart(t,0).setCursor(!1,!0)}},UE.commands.inserttitlecol={queryCommandState:function(){var e=o(this).table;if(e){return e.rows[e.rows.length-1].getElementsByTagName("th").length?-1:0}return-1},execCommand:function(t){var n=o(this).table;n&&s(n).insertCol(0,"th"),e(n,this);var i=n.getElementsByTagName("th")[0];this.selection.getRange().setStart(i,0).setCursor(!1,!0)}},UE.commands.deletetitlecol={queryCommandState:function(){var e=o(this).table;if(e){return e.rows[e.rows.length-1].getElementsByTagName("th").length?0:-1}return-1},execCommand:function(){var t=o(this).table;if(t)for(var n=0;n<t.rows.length;n++)domUtils.remove(t.rows[n].children[0]);e(t,this);var i=t.getElementsByTagName("td")[0];this.selection.getRange().setStart(i,0).setCursor(!1,!0)}},UE.commands.mergeright={queryCommandState:function(e){var t=o(this),n=t.table,i=t.cell;if(!n||!i)return-1;var r=s(n);if(r.selectedTds.length)return-1;var a=r.getCellInfo(i),l=a.colIndex+a.colSpan;if(l>=r.colsNum)return-1;var d=r.indexTable[a.rowIndex][l],c=n.rows[d.rowIndex].cells[d.cellIndex];return c&&i.tagName==c.tagName&&d.rowIndex==a.rowIndex&&d.rowSpan==a.rowSpan?0:-1},execCommand:function(e){var t=this.selection.getRange(),n=t.createBookmark(!0),i=o(this).cell;s(i).mergeRight(i),t.moveToBookmark(n).select()}},UE.commands.mergedown={queryCommandState:function(e){var t=o(this),n=t.table,i=t.cell;if(!n||!i)return-1;var r=s(n);if(r.selectedTds.length)return-1;var a=r.getCellInfo(i),l=a.rowIndex+a.rowSpan;if(l>=r.rowsNum)return-1;var d=r.indexTable[l][a.colIndex],c=n.rows[d.rowIndex].cells[d.cellIndex];return c&&i.tagName==c.tagName&&d.colIndex==a.colIndex&&d.colSpan==a.colSpan?0:-1},execCommand:function(){var e=this.selection.getRange(),t=e.createBookmark(!0),n=o(this).cell;s(n).mergeDown(n),e.moveToBookmark(t).select()}},UE.commands.mergecells={queryCommandState:function(){return r(this)?0:-1},execCommand:function(){var e=r(this);if(e&&e.selectedTds.length){var t=e.selectedTds[0];e.mergeRange();var n=this.selection.getRange();domUtils.isEmptyBlock(t)?n.setStart(t,0).collapse(!0):n.selectNodeContents(t),n.select()}}},UE.commands.insertrow={queryCommandState:function(){var e=o(this),t=e.cell;return t&&("TD"==t.tagName||"TH"==t.tagName&&e.tr!==e.table.rows[0])&&s(e.table).rowsNum<this.options.maxRowNum?0:-1},execCommand:function(){var e=this.selection.getRange(),t=e.createBookmark(!0),n=o(this),i=n.cell,r=n.table,a=s(r),l=a.getCellInfo(i);if(a.selectedTds.length)for(var d=a.cellsRange,c=0,u=d.endRowIndex-d.beginRowIndex+1;c<u;c++)a.insertRow(d.beginRowIndex,i);else a.insertRow(l.rowIndex,i);e.moveToBookmark(t).select(),"enabled"===r.getAttribute("interlaced")&&this.fireEvent("interlacetable",r)}},UE.commands.insertrownext={queryCommandState:function(){var e=o(this),t=e.cell;return t&&"TD"==t.tagName&&s(e.table).rowsNum<this.options.maxRowNum?0:-1},execCommand:function(){var e=this.selection.getRange(),t=e.createBookmark(!0),n=o(this),i=n.cell,r=n.table,a=s(r),l=a.getCellInfo(i);if(a.selectedTds.length)for(var d=a.cellsRange,c=0,u=d.endRowIndex-d.beginRowIndex+1;c<u;c++)a.insertRow(d.endRowIndex+1,i);else a.insertRow(l.rowIndex+l.rowSpan,i);e.moveToBookmark(t).select(),"enabled"===r.getAttribute("interlaced")&&this.fireEvent("interlacetable",r)}},UE.commands.deleterow={queryCommandState:function(){return o(this).cell?0:-1},execCommand:function(){var e=o(this).cell,t=s(e),n=t.cellsRange,i=t.getCellInfo(e),r=t.getVSideCell(e),a=t.getVSideCell(e,!0),l=this.selection.getRange();if(utils.isEmptyObject(n))t.deleteRow(i.rowIndex);else for(var d=n.beginRowIndex;d<n.endRowIndex+1;d++)t.deleteRow(n.beginRowIndex);var c=t.table;if(c.getElementsByTagName("td").length)if(1==i.rowSpan||i.rowSpan==n.endRowIndex-n.beginRowIndex+1)(a||r)&&l.selectNodeContents(a||r).setCursor(!1,!0);else{var u=t.getCell(i.rowIndex,t.indexTable[i.rowIndex][i.colIndex].cellIndex);u&&l.selectNodeContents(u).setCursor(!1,!0)}else{var m=c.nextSibling;domUtils.remove(c),m&&l.setStart(m,0).setCursor(!1,!0)}"enabled"===c.getAttribute("interlaced")&&this.fireEvent("interlacetable",c)}},UE.commands.insertcol={queryCommandState:function(e){var t=o(this),n=t.cell;return n&&("TD"==n.tagName||"TH"==n.tagName&&n!==t.tr.cells[0])&&s(t.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(e){var t=this.selection.getRange(),n=t.createBookmark(!0);if(-1!=this.queryCommandState(e)){var i=o(this).cell,r=s(i),a=r.getCellInfo(i);if(r.selectedTds.length)for(var l=r.cellsRange,d=0,c=l.endColIndex-l.beginColIndex+1;d<c;d++)r.insertCol(l.beginColIndex,i);else r.insertCol(a.colIndex,i);t.moveToBookmark(n).select(!0)}}},UE.commands.insertcolnext={queryCommandState:function(){var e=o(this);return e.cell&&s(e.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(){var e=this.selection.getRange(),t=e.createBookmark(!0),n=o(this).cell,i=s(n),r=i.getCellInfo(n);if(i.selectedTds.length)for(var a=i.cellsRange,l=0,d=a.endColIndex-a.beginColIndex+1;l<d;l++)i.insertCol(a.endColIndex+1,n);else i.insertCol(r.colIndex+r.colSpan,n);e.moveToBookmark(t).select()}},UE.commands.deletecol={queryCommandState:function(){return o(this).cell?0:-1},execCommand:function(){var e=o(this).cell,t=s(e),n=t.cellsRange,i=t.getCellInfo(e),r=t.getHSideCell(e),a=t.getHSideCell(e,!0);if(utils.isEmptyObject(n))t.deleteCol(i.colIndex);else for(var l=n.beginColIndex;l<n.endColIndex+1;l++)t.deleteCol(n.beginColIndex);var d=t.table,c=this.selection.getRange();if(d.getElementsByTagName("td").length)domUtils.inDoc(e,this.document)?c.setStart(e,0).setCursor(!1,!0):a&&domUtils.inDoc(a,this.document)?c.selectNodeContents(a).setCursor(!1,!0):r&&domUtils.inDoc(r,this.document)&&c.selectNodeContents(r).setCursor(!0,!0);else{var u=d.nextSibling;domUtils.remove(d),u&&c.setStart(u,0).setCursor(!1,!0)}}},UE.commands.splittocells={queryCommandState:function(){var e=o(this),t=e.cell;return t?s(e.table).selectedTds.length>0?-1:t&&(t.colSpan>1||t.rowSpan>1)?0:-1:-1},execCommand:function(){var e=this.selection.getRange(),t=e.createBookmark(!0),n=o(this).cell;s(n).splitToCells(n),e.moveToBookmark(t).select()}},UE.commands.splittorows={queryCommandState:function(){var e=o(this),t=e.cell;return t?s(e.table).selectedTds.length>0?-1:t&&t.rowSpan>1?0:-1:-1},execCommand:function(){var e=this.selection.getRange(),t=e.createBookmark(!0),n=o(this).cell;s(n).splitToRows(n),e.moveToBookmark(t).select()}},UE.commands.splittocols={queryCommandState:function(){var e=o(this),t=e.cell;return t?s(e.table).selectedTds.length>0?-1:t&&t.colSpan>1?0:-1:-1},execCommand:function(){var e=this.selection.getRange(),t=e.createBookmark(!0),n=o(this).cell;s(n).splitToCols(n),e.moveToBookmark(t).select()}},UE.commands.adaptbytext=UE.commands.adaptbywindow={queryCommandState:function(){return o(this).table?0:-1},execCommand:function(t){var n=o(this),i=n.table;if(i)if("adaptbywindow"==t)e(i,this);else{var r=domUtils.getElementsByTagName(i,"td th");utils.each(r,function(e){e.removeAttribute("width")}),i.removeAttribute("width")}}},UE.commands.averagedistributecol={queryCommandState:function(){var e=r(this);return e&&(e.isFullRow()||e.isFullCol())?0:-1},execCommand:function(e){var t=this,n=r(t);n&&n.selectedTds.length&&function(e){utils.each(domUtils.getElementsByTagName(n.table,"th"),function(e){e.setAttribute("width","")});var t=n.isFullRow()?domUtils.getElementsByTagName(n.table,"td"):n.selectedTds;utils.each(t,function(t){1==t.colSpan&&t.setAttribute("width",e)})}(function(){var e=n.table,i=0,o=0,r=a(t,e);if(n.isFullRow())i=e.offsetWidth,o=n.colsNum;else for(var s,l=n.cellsRange.beginColIndex,d=n.cellsRange.endColIndex,c=l;c<=d;)s=n.selectedTds[c],i+=s.offsetWidth,c+=s.colSpan,o+=1;return Math.ceil(i/o)-2*r.tdBorder-2*r.tdPadding}())}},UE.commands.averagedistributerow={queryCommandState:function(){var e=r(this);return e?e.selectedTds&&/th/gi.test(e.selectedTds[0].tagName)?-1:e.isFullRow()||e.isFullCol()?0:-1:-1},execCommand:function(e){var t=this,n=r(t);n&&n.selectedTds.length&&function(e){var t=n.isFullCol()?domUtils.getElementsByTagName(n.table,"td"):n.selectedTds;utils.each(t,function(t){1==t.rowSpan&&t.setAttribute("height",e)})}(function(){var e,i=0,o=n.table,r=a(t,o),s=parseInt(domUtils.getComputedStyle(o.getElementsByTagName("td")[0],"padding-top"));if(n.isFullCol()){var l,d,c=domUtils.getElementsByTagName(o,"caption"),u=domUtils.getElementsByTagName(o,"th");c.length>0&&(l=c[0].offsetHeight),u.length>0&&(d=u[0].offsetHeight),i=o.offsetHeight-(l||0)-(d||0),e=0==u.length?n.rowsNum:n.rowsNum-1}else{for(var m=n.cellsRange.beginRowIndex,f=n.cellsRange.endRowIndex,h=0,p=domUtils.getElementsByTagName(o,"tr"),g=m;g<=f;g++)i+=p[g].offsetHeight,h+=1;e=h}return browser.ie&&browser.version<9?Math.ceil(i/e):Math.ceil(i/e)-2*r.tdBorder-2*s}())}},UE.commands.cellalignment={queryCommandState:function(){return o(this).table?0:-1},execCommand:function(e,t){var n=this,i=r(n);if(i)utils.each(i.selectedTds,function(e){domUtils.setAttributes(e,t)});else{var o=n.selection.getStart(),a=o&&domUtils.findParentByTagName(o,["td","th","caption"],!0);/caption/gi.test(a.tagName)?(a.style.textAlign=t.align,a.style.verticalAlign=t.vAlign):domUtils.setAttributes(a,t),n.selection.getRange().setCursor(!0)}},queryCommandValue:function(e){var t=o(this).cell;if(t||(t=n(this)[0]),t){var i=UE.UETable.getUETable(t).selectedTds;return!i.length&&(i=t),UE.UETable.getTableCellAlignState(i)}return null}},UE.commands.tablealignment={queryCommandState:function(){return browser.ie&&browser.version<8?-1:o(this).table?0:-1},execCommand:function(e,t){var n=this,i=n.selection.getStart(),o=i&&domUtils.findParentByTagName(i,["table"],!0);o&&o.setAttribute("align",t)}},UE.commands.edittable={queryCommandState:function(){return o(this).table?0:-1},execCommand:function(e,t){var n=this.selection.getRange(),i=domUtils.findParentByTagName(n.startContainer,"table");if(i){var o=domUtils.getElementsByTagName(i,"td").concat(domUtils.getElementsByTagName(i,"th"),domUtils.getElementsByTagName(i,"caption"));utils.each(o,function(e){e.style.borderColor=t})}}},UE.commands.edittd={queryCommandState:function(){return o(this).table?0:-1},execCommand:function(e,t){var n=this,i=r(n);if(i)utils.each(i.selectedTds,function(e){e.style.backgroundColor=t});else{var o=n.selection.getStart(),a=o&&domUtils.findParentByTagName(o,["td","th","caption"],!0);a&&(a.style.backgroundColor=t)}}},UE.commands.settablebackground={queryCommandState:function(){return n(this).length>1?0:-1},execCommand:function(e,t){var i,o;i=n(this),o=s(i[0]),o.setBackground(i,t)}},UE.commands.cleartablebackground={queryCommandState:function(){var e=n(this);if(!e.length)return-1;for(var t,i=0;t=e[i++];)if(""!==t.style.backgroundColor)return 0;return-1},execCommand:function(){var e=n(this);s(e[0]).removeBackground(e)}},UE.commands.interlacetable=UE.commands.uninterlacetable={queryCommandState:function(e){var t=o(this).table;if(!t)return-1;var n=t.getAttribute("interlaced");return"interlacetable"==e?"enabled"===n?-1:0:n&&"disabled"!==n?0:-1},execCommand:function(e,t){var n=o(this).table;"interlacetable"==e?(n.setAttribute("interlaced","enabled"),this.fireEvent("interlacetable",n,t)):(n.setAttribute("interlaced","disabled"),this.fireEvent("uninterlacetable",n))}},UE.commands.setbordervisible={queryCommandState:function(e){return o(this).table?0:-1},execCommand:function(){var e=o(this).table;utils.each(domUtils.getElementsByTagName(e,"td"),function(e){e.style.borderWidth="1px",e.style.borderStyle="solid"})}}}(),UE.plugins.table=function(){function e(e){}function t(e,t){n(e,"width",!0),n(e,"height",!0)}function n(e,t,n){e.style[t]&&(n&&e.setAttribute(t,parseInt(e.style[t],10)),e.style[t]="")}function i(e){if("TD"==e.tagName||"TH"==e.tagName)return e;var t;return(t=domUtils.findParentByTagName(e,"td",!0)||domUtils.findParentByTagName(e,"th",!0))?t:null}function o(e){var t=new RegExp(domUtils.fillChar,"g");if(e[browser.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(t,"").length>0)return 0;for(var n in dtd.$isNotEmpty)if(e.getElementsByTagName(n).length)return 0;return 1}function r(e){return e.pageX||e.pageY?{x:e.pageX,y:e.pageY}:{x:e.clientX+H.document.body.scrollLeft-H.document.body.clientLeft,y:e.clientY+H.document.body.scrollTop-H.document.body.clientTop}}function a(t){if(!T())try{var n,o=i(t.target||t.srcElement);if(V&&(H.body.style.webkitUserSelect="none",(Math.abs(X.x-t.clientX)>z||Math.abs(X.y-t.clientY)>z)&&(y(),V=!1,W=0,x(t))),ne&&se)return W=0,H.body.style.webkitUserSelect="none",H.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),n=r(t),m(H,!0,ne,n,o),void("h"==ne?ae.style.left=c(se,t)+"px":"v"==ne&&(ae.style.top=u(se,t)+"px"));if(o){if(!0===H.fireEvent("excludetable",o))return;n=r(t);var a=f(o,n),l=domUtils.findParentByTagName(o,"table",!0);if(d(l,o,t,!0)){if(!0===H.fireEvent("excludetable",l))return;H.body.style.cursor="url("+H.options.cursorpath+"h.png),pointer"}else if(d(l,o,t)){if(!0===H.fireEvent("excludetable",l))return;H.body.style.cursor="url("+H.options.cursorpath+"v.png),pointer"}else{H.body.style.cursor="text";/\d/.test(a)&&(a=a.replace(/\d/,""),o=G(o).getPreviewCell(o,"v"==a)),m(H,!!o&&!!a,o?a:"",n,o)}}else s(!1,l,H)}catch(t){e(t)}}function s(e,t,n){if(e)l(t,n);else{if(re)return;ce=setTimeout(function(){!re&&oe&&oe.parentNode&&oe.parentNode.removeChild(oe)},2e3)}}function l(e,t){function n(n,i){clearTimeout(a),a=setTimeout(function(){t.fireEvent("tableClicked",e,i)},300)}function i(n){clearTimeout(a);var i=G(e),o=e.rows[0].cells[0],r=i.getLastCell(),s=i.getCellsRange(o,r);t.selection.getRange().setStart(o,0).setCursor(!1,!0),i.setSelected(s)}var o=domUtils.getXY(e),r=e.ownerDocument;if(oe&&oe.parentNode)return oe;oe=r.createElement("div"),oe.contentEditable=!1,oe.innerHTML="",oe.style.cssText="width:15px;height:15px;background-image:url("+t.options.UEDITOR_HOME_URL+"dialogs/table/dragicon.png);position: absolute;cursor:move;top:"+(o.y-15)+"px;left:"+o.x+"px;",domUtils.unSelectable(oe),oe.onmouseover=function(e){re=!0},oe.onmouseout=function(e){re=!1},domUtils.on(oe,"click",function(e,t){n(t,this)}),domUtils.on(oe,"dblclick",function(e,t){i(t)}),domUtils.on(oe,"dragstart",function(e,t){domUtils.preventDefault(t)});var a;r.body.appendChild(oe)}function d(e,t,n,i){var o=r(n),a=f(t,o);if(i){var s=e.getElementsByTagName("caption")[0],l=s?s.offsetHeight:0;return"v1"==a&&o.y-domUtils.getXY(e).y-l<8}return"h1"==a&&o.x-domUtils.getXY(e).x<8}function c(e,t){var n=G(e);if(n){var i=n.getSameEndPosCells(e,"x")[0],o=n.getSameStartPosXCells(e)[0],a=r(t).x,s=(i?domUtils.getXY(i).x:domUtils.getXY(n.table).x)+20,l=o?domUtils.getXY(o).x+o.offsetWidth-20:H.body.offsetWidth+5||parseInt(domUtils.getComputedStyle(H.body,"width"),10);return s+=q,l-=q,a<s?s:a>l?l:a}}function u(t,n){try{var i=domUtils.getXY(t).y,o=r(n).y;return o<i?i:o}catch(t){e(t)}}function m(t,n,i,o,r){try{t.body.style.cursor="h"==i?"col-resize":"v"==i?"row-resize":"text",browser.ie&&(!i||le||Z(t)?R(t):(L(t,t.document),D(i,r))),ie=n}catch(t){e(t)}}function f(e,t){var n=domUtils.getXY(e);return n?n.x+e.offsetWidth-t.x<j?"h":t.x-n.x<j?"h1":n.y+e.offsetHeight-t.y<j?"v":t.y-n.y<j?"v1":"":""}function h(e,t){if(!T())if(X={x:t.clientX,y:t.clientY},2==t.button){var n=Z(H),i=!1;if(n){var o=M(H,t);utils.each(n.selectedTds,function(e){e===o&&(i=!0)}),i?(o=n.selectedTds[0],setTimeout(function(){H.selection.getRange().setStart(o,0).setCursor(!1,!0)},0)):(Q(domUtils.getElementsByTagName(H.body,"th td")),n.clearSelected())}}else g(t)}function p(e){W=0,e=e||H.window.event;var t=i(e.target||e.srcElement);if(t){var n;if(n=f(t,r(e))){if(R(H),"h1"==n)if(n="h",d(domUtils.findParentByTagName(t,"table"),t,e))H.execCommand("adaptbywindow");else if(t=G(t).getPreviewCell(t)){var o=H.selection.getRange();o.selectNodeContents(t).setCursor(!0,!0)}if("h"==n){var a=G(t),s=a.table,l=k(t,s,!0);l=b(l,"left"),a.width=a.offsetWidth;var c=[],u=[];utils.each(l,function(e){c.push(e.offsetWidth)}),utils.each(l,function(e){e.removeAttribute("width")}),window.setTimeout(function(){var e=!0;utils.each(l,function(t,n){var i=t.offsetWidth;if(i>c[n])return e=!1,!1;u.push(i)});var t=e?u:c;utils.each(l,function(e,n){e.width=t[n]-A()})},0)}}}}function g(e){if(Q(domUtils.getElementsByTagName(H.body,"td th")),utils.each(H.document.getElementsByTagName("table"),function(e){e.ueTable=null}),ee=M(H,e)){var t=domUtils.findParentByTagName(ee,"table",!0);ut=G(t),ut&&ut.clearSelected(),ie?v(e):(H.document.body.style.webkitUserSelect="",le=!0,H.addListener("mouseover",N))}}function v(e){browser.ie&&(e=C(e)),y(),V=!0,F=setTimeout(function(){x(e)},Y)}function b(e,t){for(var n=[],i=null,o=0,r=e.length;o<r;o++)(i=e[o][t])&&n.push(i);return n}function y(){F&&clearTimeout(F),F=null}function C(e){var t=["pageX","pageY","clientX","clientY","srcElement","target"],n={};if(e)for(var i,o,r=0;i=t[r];r++)(o=e[i])&&(n[i]=o);return n}function x(e){if(V=!1,ee=e.target||e.srcElement){var t=f(ee,r(e));/\d/.test(t)&&(t=t.replace(/\d/,""),ee=G(ee).getPreviewCell(ee,"v"==t)),R(H),L(H,H.document),H.fireEvent("saveScene"),D(t,ee),le=!0,ne=t,se=ee}}function w(e,t){if(!T()){if(y(),V=!1,ie&&(W=++W%3,X={x:t.clientX,y:t.clientY},$=setTimeout(function(){W>0&&W--},Y),2===W))return W=0,void p(t);if(2!=t.button){var n=this,i=n.selection.getRange(),o=domUtils.findParentByTagName(i.startContainer,"table",!0),r=domUtils.findParentByTagName(i.endContainer,"table",!0);if((o||r)&&(o===r?(o=domUtils.findParentByTagName(i.startContainer,["td","th","caption"],!0),r=domUtils.findParentByTagName(i.endContainer,["td","th","caption"],!0),o!==r&&n.selection.clearRange()):n.selection.clearRange()),le=!1,n.document.body.style.webkitUserSelect="",ne&&se&&(n.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"](),W=0,ae=n.document.getElementById("ue_tableDragLine"))){var a=domUtils.getXY(se),s=domUtils.getXY(ae);switch(ne){case"h":E(se,s.x-a.x);break;case"v":S(se,s.y-a.y-se.offsetHeight)}return ne="",se=null,R(n),void n.fireEvent("saveScene")}if(ee){var l=G(ee),d=l?l.selectedTds[0]:null;if(d)i=new dom.Range(n.document),domUtils.isEmptyBlock(d)?i.setStart(d,0).setCursor(!1,!0):i.selectNodeContents(d).shrinkBoundary().setCursor(!1,!0);else if(i=n.selection.getRange().shrinkBoundary(),!i.collapsed){var o=domUtils.findParentByTagName(i.startContainer,["td","th"],!0),r=domUtils.findParentByTagName(i.endContainer,["td","th"],!0);(o&&!r||!o&&r||o&&r&&o!==r)&&i.setCursor(!1,!0)}ee=null,n.removeListener("mouseover",N)}else{var c=domUtils.findParentByTagName(t.target||t.srcElement,"td",!0);if(c||(c=domUtils.findParentByTagName(t.target||t.srcElement,"th",!0)),c&&("TD"==c.tagName||"TH"==c.tagName)){if(!0===n.fireEvent("excludetable",c))return;i=new dom.Range(n.document),i.setStart(c,0).setCursor(!1,!0)}}n._selectionChange(250,t)}}}function N(e,t){if(!T()){var n=this,i=t.target||t.srcElement;if(te=domUtils.findParentByTagName(i,"td",!0)||domUtils.findParentByTagName(i,"th",!0),ee&&te&&("TD"==ee.tagName&&"TD"==te.tagName||"TH"==ee.tagName&&"TH"==te.tagName)&&domUtils.findParentByTagName(ee,"table")==domUtils.findParentByTagName(te,"table")){var o=G(te);if(ee!=te){n.document.body.style.webkitUserSelect="none",n.selection.getNative()[browser.ie9below?"empty":"removeAllRanges"]();var r=o.getCellsRange(ee,te);o.setSelected(r)}else n.document.body.style.webkitUserSelect="",o.clearSelected()}t.preventDefault?t.preventDefault():t.returnValue=!1}}function U(e,t,n){var i=parseInt(domUtils.getComputedStyle(e,"line-height"),10),o=n+t;t=o<i?i:o,e.style.height&&(e.style.height=""),1==e.rowSpan?e.setAttribute("height",t):e.removeAttribute&&e.removeAttribute("height")}function E(e,t){var n=G(e);if(n){var i=n.table,o=k(e,i);if(i.style.width="",i.removeAttribute("width"),t=B(t,e,o),e.nextSibling){utils.each(o,function(e){e.left.width=+e.left.width+t,e.right&&(e.right.width=+e.right.width-t)})}else utils.each(o,function(e){e.left.width-=-t})}}function T(){return"false"===H.body.contentEditable}function S(e,t){if(!(Math.abs(t)<10)){var n=G(e);if(n)for(var i,o=n.getSameEndPosCells(e,"y"),r=o[0]?o[0].offsetHeight:0,a=0;i=o[a++];)U(i,t,r)}}function k(e,t,n){if(t||(t=domUtils.findParentByTagName(e,"table")),!t)return null;for(var i=(domUtils.getNodeIndex(e),e),o=t.rows,r=0;i;)1===i.nodeType&&(r+=i.colSpan||1),i=i.previousSibling;i=null;var a=[];return utils.each(o,function(e){var t=e.cells,i=0;utils.each(t,function(e){return i+=e.colSpan||1,i===r?(a.push({left:e,right:e.nextSibling||null}),!1):i>r?(n&&a.push({left:e}),!1):void 0})}),a}function B(e,t,n){if((e-=A())<0)return 0;e-=I(t);var i=e<0?"left":"right";return e=Math.abs(e),utils.each(n,function(t){var n=t[i];n&&(e=Math.min(e,I(n)-q))}),e=e<0?0:e,"left"===i?-e:e}function I(e){var t=0,t=e.offsetWidth-A();e.nextSibling||(t-=_(e)),t=t<0?0:t;try{e.width=t}catch(e){}return t}function _(e){if(tab=domUtils.findParentByTagName(e,"table",!1),void 0===tab.offsetVal){var t=e.previousSibling;tab.offsetVal=t&&e.offsetWidth-t.offsetWidth===K.borderWidth?K.borderWidth:0}return tab.offsetVal}function A(){if(void 0===K.tabcellSpace){var e=H.document.createElement("table"),t=H.document.createElement("tbody"),n=H.document.createElement("tr"),i=H.document.createElement("td"),o=null;i.style.cssText="border: 0;",i.width=1,n.appendChild(i),n.appendChild(o=i.cloneNode(!1)),t.appendChild(n),e.appendChild(t),e.style.cssText="visibility: hidden;",H.body.appendChild(e),K.paddingSpace=i.offsetWidth-1;var r=e.offsetWidth;i.style.cssText="",o.style.cssText="",K.borderWidth=(e.offsetWidth-r)/3,K.tabcellSpace=K.paddingSpace+K.borderWidth,H.body.removeChild(e)}return A=function(){return K.tabcellSpace},K.tabcellSpace}function L(e,t){le||(ae=e.document.createElement("div"),domUtils.setAttributes(ae,{id:"ue_tableDragLine",unselectable:"on",contenteditable:!1,onresizestart:"return false",ondragstart:"return false",onselectstart:"return false",style:"background-color:blue;position:absolute;padding:0;margin:0;background-image:none;border:0px none;opacity:0;filter:alpha(opacity=0)"}),e.body.appendChild(ae))}function R(e){if(!le)for(var t;t=e.document.getElementById("ue_tableDragLine");)domUtils.remove(t)}function D(e,t){if(t){var n,i=domUtils.findParentByTagName(t,"table"),o=i.getElementsByTagName("caption"),r=i.offsetWidth,a=i.offsetHeight-(o.length>0?o[0].offsetHeight:0),s=domUtils.getXY(i),l=domUtils.getXY(t);switch(e){case"h":n="height:"+a+"px;top:"+(s.y+(o.length>0?o[0].offsetHeight:0))+"px;left:"+(l.x+t.offsetWidth),ae.style.cssText=n+"px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)";break;case"v":n="width:"+r+"px;left:"+s.x+"px;top:"+(l.y+t.offsetHeight),ae.style.cssText=n+"px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)"}}}function O(e,t){for(var n,i,o=domUtils.getElementsByTagName(e.body,"table"),r=0;i=o[r++];){var a=domUtils.getElementsByTagName(i,"td");a[0]&&(t?(n=a[0].style.borderColor.replace(/\s/g,""),/(#ffffff)|(rgb\(255,255,255\))/gi.test(n)&&domUtils.addClass(i,"noBorderTable")):domUtils.removeClasses(i,"noBorderTable"))}}function P(e,t,n){var i=e.body;return i.offsetWidth-(t?2*parseInt(domUtils.getComputedStyle(i,"margin-left"),10):0)-2*n.tableBorder-(e.options.offsetWidth||0)}function M(e,t){var n=domUtils.findParentByTagName(t.target||t.srcElement,["td","th"],!0),i=null;if(!n)return null;if(i=f(n,r(t)),!n)return null;if("h1"===i&&n.previousSibling){var o=domUtils.getXY(n),a=n.offsetWidth;Math.abs(o.x+a-t.clientX)>a/3&&(n=n.previousSibling)}else if("v1"===i&&n.parentNode.previousSibling){var o=domUtils.getXY(n),s=n.offsetHeight;Math.abs(o.y+s-t.clientY)>s/3&&(n=n.parentNode.previousSibling.firstChild)}return n&&!0!==e.fireEvent("excludetable",n)?n:null}var H=this,F=null,$=null,q=5,V=!1,j=5,z=10,W=0,X=null,Y=360,K=UE.UETable,G=function(e){return K.getUETable(e)},Z=function(e){return K.getUETableBySelected(e)},J=function(e,t){return K.getDefaultValue(e,t)},Q=function(e){return K.removeSelectedClass(e)};H.ready(function(){var e=this,t=e.selection.getText;e.selection.getText=function(){var n=Z(e);if(n){var i="";return utils.each(n.selectedTds,function(e){i+=e[browser.ie?"innerText":"textContent"]}),i}return t.call(e.selection)}});var ee=null,te=null,ne="",ie=!1,oe=null,re=!1,ae=null,se=null,le=!1;H.setOpt({maxColNum:20,maxRowNum:100,defaultCols:5,defaultRows:5,tdvalign:"top",cursorpath:H.options.UEDITOR_HOME_URL+"themes/default/images/cursor_",tableDragable:!1,classList:["ue-table-interlace-color-single","ue-table-interlace-color-double"]}),H.getUETable=G;var de={deletetable:1,inserttable:1,cellvalign:1,insertcaption:1,deletecaption:1,inserttitle:1,deletetitle:1,mergeright:1,mergedown:1,mergecells:1,insertrow:1,insertrownext:1,deleterow:1,insertcol:1,insertcolnext:1,deletecol:1,splittocells:1,splittorows:1,splittocols:1,adaptbytext:1,adaptbywindow:1,adaptbycustomer:1,insertparagraph:1,insertparagraphbeforetable:1,averagedistributecol:1,averagedistributerow:1};H.ready(function(){utils.cssRule("table",".selectTdClass{background-color:#edf5fa !important}table.noBorderTable td,table.noBorderTable th,table.noBorderTable caption{border:1px dashed #ddd !important}table{margin-bottom:10px;border-collapse:collapse;display:table;}td,th{padding: 5px 10px;border: 1px solid #DDD;}caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}th{border-top:1px solid #BBB;background-color:#F7F7F7;}table tr.firstRow th{border-top-width:2px;}.ue-table-interlace-color-single{ background-color: #fcfcfc; } .ue-table-interlace-color-double{ background-color: #f7faff; }td p{margin:0;padding:0;}",H.document);var e,n,r;H.addListener("keydown",function(t,i){var a=this,s=i.keyCode||i.which;if(8==s){var l=Z(a);l&&l.selectedTds.length&&(l.isFullCol()?a.execCommand("deletecol"):l.isFullRow()?a.execCommand("deleterow"):a.fireEvent("delcells"),domUtils.preventDefault(i));var d=domUtils.findParentByTagName(a.selection.getStart(),"caption",!0),c=a.selection.getRange();if(c.collapsed&&d&&o(d)){a.fireEvent("saveScene");var u=d.parentNode;domUtils.remove(d),u&&c.setStart(u.rows[0].cells[0],0).setCursor(!1,!0),a.fireEvent("saveScene")}}if(46==s&&(l=Z(a))){a.fireEvent("saveScene");for(var m,f=0;m=l.selectedTds[f++];)domUtils.fillNode(a.document,m);a.fireEvent("saveScene"),domUtils.preventDefault(i)}if(13==s){var h=a.selection.getRange(),d=domUtils.findParentByTagName(h.startContainer,"caption",!0);if(d){var u=domUtils.findParentByTagName(d,"table");return h.collapsed?d&&h.setStart(u.rows[0].cells[0],0).setCursor(!1,!0):(h.deleteContents(),a.fireEvent("saveScene")),void domUtils.preventDefault(i)}if(h.collapsed){var u=domUtils.findParentByTagName(h.startContainer,"table");if(u){var p=u.rows[0].cells[0],g=domUtils.findParentByTagName(a.selection.getStart(),["td","th"],!0),v=u.previousSibling;if(p===g&&(!v||1==v.nodeType&&"TABLE"==v.tagName)&&domUtils.isStartInblock(h)){var b=domUtils.findParent(a.selection.getStart(),function(e){return domUtils.isBlockElm(e)},!0);b&&(/t(h|d)/i.test(b.tagName)||b===g.firstChild)&&(a.execCommand("insertparagraphbeforetable"),domUtils.preventDefault(i))}}}}if((i.ctrlKey||i.metaKey)&&"67"==i.keyCode){e=null;var l=Z(a);if(l){var y=l.selectedTds;n=l.isFullCol(),r=l.isFullRow(),e=[[l.cloneCell(y[0],null,!0)]];for(var m,f=1;m=y[f];f++)m.parentNode!==y[f-1].parentNode?e.push([l.cloneCell(m,null,!0)]):e[e.length-1].push(l.cloneCell(m,null,!0))}}}),H.addListener("tablehasdeleted",function(){m(this,!1,"",null),oe&&domUtils.remove(oe)}),H.addListener("beforepaste",function(i,a){var s=this,l=s.selection.getRange();if(domUtils.findParentByTagName(l.startContainer,"caption",!0)){var d=s.document.createElement("div");return d.innerHTML=a.html,void(a.html=d[browser.ie9below?"innerText":"textContent"])}var c=Z(s);if(e){s.fireEvent("saveScene");var u,m,l=s.selection.getRange(),f=domUtils.findParentByTagName(l.startContainer,["td","th"],!0);if(f){var h=G(f);if(r){var p=h.getCellInfo(f).rowIndex;"TH"==f.tagName&&p++;for(var g,v=0;g=e[v++];){for(var b,y=h.insertRow(p++,"td"),C=0;b=g[C];C++){var x=y.cells[C];x||(x=y.insertCell(C)),x.innerHTML=b.innerHTML,b.getAttribute("width")&&x.setAttribute("width",b.getAttribute("width")),b.getAttribute("vAlign")&&x.setAttribute("vAlign",b.getAttribute("vAlign")),b.getAttribute("align")&&x.setAttribute("align",b.getAttribute("align")),b.style.cssText&&(x.style.cssText=b.style.cssText)}for(var b,C=0;(b=y.cells[C])&&g[C];C++)b.innerHTML=g[C].innerHTML,g[C].getAttribute("width")&&b.setAttribute("width",g[C].getAttribute("width")),g[C].getAttribute("vAlign")&&b.setAttribute("vAlign",g[C].getAttribute("vAlign")),g[C].getAttribute("align")&&b.setAttribute("align",g[C].getAttribute("align")),g[C].style.cssText&&(b.style.cssText=g[C].style.cssText)}}else{if(n){U=h.getCellInfo(f);for(var b,w=0,C=0,g=e[0];b=g[C++];)w+=b.colSpan||1;for(s.__hasEnterExecCommand=!0,v=0;v<w;v++)s.execCommand("insertcol");s.__hasEnterExecCommand=!1,f=h.table.rows[0].cells[U.cellIndex],"TH"==f.tagName&&(f=h.table.rows[1].cells[U.cellIndex])}for(var g,v=0;g=e[v++];){u=f;for(var b,C=0;b=g[C++];)if(f)f.innerHTML=b.innerHTML,b.getAttribute("width")&&f.setAttribute("width",b.getAttribute("width")),b.getAttribute("vAlign")&&f.setAttribute("vAlign",b.getAttribute("vAlign")),b.getAttribute("align")&&f.setAttribute("align",b.getAttribute("align")),b.style.cssText&&(f.style.cssText=b.style.cssText),m=f,f=f.nextSibling;else{var N=b.cloneNode(!0);domUtils.removeAttributes(N,["class","rowSpan","colSpan"]),m.parentNode.appendChild(N)}if(f=h.getNextCell(u,!0,!0),!e[v])break;if(!f){var U=h.getCellInfo(u);h.table.insertRow(h.table.rows.length),h.update(),f=h.getVSideCell(u,!0)}}}h.update()}else{c=s.document.createElement("table");for(var g,v=0;g=e[v++];){for(var b,y=c.insertRow(c.rows.length),C=0;b=g[C++];)N=K.cloneCell(b,null,!0),domUtils.removeAttributes(N,["class"]),y.appendChild(N);2==C&&N.rowSpan>1&&(N.rowSpan=1)}var E=J(s),T=s.body.offsetWidth-2*parseInt(domUtils.getComputedStyle(s.body,"margin-left"),10)-2*E.tableBorder-(s.options.offsetWidth||0);s.execCommand("insertHTML","<table  "+(n&&r?'width="'+T+'"':"")+">"+c.innerHTML.replace(/>\s*</g,"><").replace(/\bth\b/gi,"td")+"</table>")}return s.fireEvent("contentchange"),s.fireEvent("saveScene"),a.html="",!0}var S,d=s.document.createElement("div");d.innerHTML=a.html,S=d.getElementsByTagName("table"),domUtils.findParentByTagName(s.selection.getStart(),"table")?(utils.each(S,function(e){domUtils.remove(e)}),domUtils.findParentByTagName(s.selection.getStart(),"caption",!0)&&(d.innerHTML=d[browser.ie?"innerText":"textContent"])):utils.each(S,function(e){t(e,!0),domUtils.removeAttributes(e,["style","border"]),utils.each(domUtils.getElementsByTagName(e,"td"),function(e){o(e)&&domUtils.fillNode(s.document,e),t(e,!0)})}),a.html=d.innerHTML}),H.addListener("afterpaste",function(){utils.each(domUtils.getElementsByTagName(H.body,"table"),function(e){if(e.offsetWidth>H.body.offsetWidth){var t=J(H,e);e.style.width=H.body.offsetWidth-2*parseInt(domUtils.getComputedStyle(H.body,"margin-left"),10)-2*t.tableBorder-(H.options.offsetWidth||0)+"px"}})}),H.addListener("blur",function(){e=null});var l;H.addListener("keydown",function(){clearTimeout(l),l=setTimeout(function(){var e=H.selection.getRange(),t=domUtils.findParentByTagName(e.startContainer,["th","td"],!0);if(t){var n=t.parentNode.parentNode.parentNode;n.offsetWidth>n.getAttribute("width")&&(t.style.wordBreak="break-all")}},100)}),H.addListener("selectionchange",function(){m(H,!1,"",null)}),H.addListener("contentchange",function(){var e=this;if(R(e),!Z(e)){var t=e.selection.getRange(),n=t.startContainer;n=domUtils.findParentByTagName(n,["td","th"],!0),utils.each(domUtils.getElementsByTagName(e.document,"table"),function(t){!0!==e.fireEvent("excludetable",t)&&(t.ueTable=new K(t),t.onmouseover=function(){e.fireEvent("tablemouseover",t)},t.onmousemove=function(){e.fireEvent("tablemousemove",t),e.options.tableDragable&&s(!0,this,e),utils.defer(function(){e.fireEvent("contentchange",50)},!0)},t.onmouseout=function(){e.fireEvent("tablemouseout",t),m(e,!1,"",null),R(e)},t.onclick=function(t){t=e.window.event||t;var n=i(t.target||t.srcElement);if(n){var o,r=G(n),a=r.table,s=r.getCellInfo(n),l=e.selection.getRange();if(d(a,n,t,!0)){var c=r.getCell(r.indexTable[r.rowsNum-1][s.colIndex].rowIndex,r.indexTable[r.rowsNum-1][s.colIndex].cellIndex);return void(t.shiftKey&&r.selectedTds.length?r.selectedTds[0]!==c?(o=r.getCellsRange(r.selectedTds[0],c),r.setSelected(o)):l&&l.selectNodeContents(c).select():n!==c?(o=r.getCellsRange(n,c),r.setSelected(o)):l&&l.selectNodeContents(c).select())}if(d(a,n,t)){var u=r.getCell(r.indexTable[s.rowIndex][r.colsNum-1].rowIndex,r.indexTable[s.rowIndex][r.colsNum-1].cellIndex);t.shiftKey&&r.selectedTds.length?r.selectedTds[0]!==u?(o=r.getCellsRange(r.selectedTds[0],u),r.setSelected(o)):l&&l.selectNodeContents(u).select():n!==u?(o=r.getCellsRange(n,u),r.setSelected(o)):l&&l.selectNodeContents(u).select()}}})}),O(e,!0)}}),domUtils.on(H.document,"mousemove",a),domUtils.on(H.document,"mouseout",function(e){"TABLE"==(e.target||e.srcElement).tagName&&m(H,!1,"",null)}),H.addListener("interlacetable",function(e,t,n){if(t)for(var i=this,o=t.rows,r=o.length,a=0;a<r;a++)o[a].className=function(e,t,n){return e[t]?e[t]:n?e[t%e.length]:""}(n||i.options.classList,a,!0)}),H.addListener("uninterlacetable",function(e,t){if(t)for(var n=this,i=t.rows,o=n.options.classList,r=i.length,a=0;a<r;a++)domUtils.removeClasses(i[a],o)}),H.addListener("mousedown",h),H.addListener("mouseup",w),domUtils.on(H.body,"dragstart",function(e){w.call(H,"dragstart",e)}),H.addOutputRule(function(e){utils.each(e.getNodesByTagName("div"),function(e){"ue_tableDragLine"==e.getAttr("id")&&e.parentNode.removeChild(e)})});var c=0;H.addListener("mousedown",function(){c=0}),H.addListener("tabkeydown",function(){var e=this.selection.getRange(),t=e.getCommonAncestor(!0,!0),n=domUtils.findParentByTagName(t,"table");if(n){if(domUtils.findParentByTagName(t,"caption",!0)){var i=domUtils.getElementsByTagName(n,"th td");i&&i.length&&e.setStart(i[0],0).setCursor(!1,!0)}else{var i=domUtils.findParentByTagName(t,["td","th"],!0),r=G(i);c=i.rowSpan>1?c:r.getCellInfo(i).rowIndex;var a=r.getTabNextCell(i,c);a?o(a)?e.setStart(a,0).setCursor(!1,!0):e.selectNodeContents(a).select():(H.fireEvent("saveScene"),H.__hasEnterExecCommand=!0,this.execCommand("insertrownext"),H.__hasEnterExecCommand=!1,e=this.selection.getRange(),e.setStart(n.rows[n.rows.length-1].cells[0],0).setCursor(),H.fireEvent("saveScene"))}return!0}}),browser.ie&&H.addListener("selectionchange",function(){m(this,!1,"",null)}),H.addListener("keydown",function(e,t){var n=this,i=t.keyCode||t.which;if(8!=i&&46!=i){var o=!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey);o&&Q(domUtils.getElementsByTagName(n.body,"td"));var r=Z(n);r&&o&&r.clearSelected()}}),H.addListener("beforegetcontent",function(){O(this,!1),browser.ie&&utils.each(this.document.getElementsByTagName("caption"),function(e){domUtils.isEmptyNode(e)&&(e.innerHTML="&nbsp;")})}),H.addListener("aftergetcontent",function(){O(this,!0)}),H.addListener("getAllHtml",function(){Q(H.document.getElementsByTagName("td"))}),H.addListener("fullscreenchanged",function(e,t){if(!t){var n=this.body.offsetWidth/document.body.offsetWidth,i=domUtils.getElementsByTagName(this.body,"table");utils.each(i,function(e){if(e.offsetWidth<H.body.offsetWidth)return!1;var t=domUtils.getElementsByTagName(e,"td"),i=[];utils.each(t,function(e){i.push(e.offsetWidth)});for(var o,r=0;o=t[r];r++)o.setAttribute("width",Math.floor(i[r]*n));e.setAttribute("width",Math.floor(P(H,!0,J(H))))})}});var u=H.execCommand;H.execCommand=function(e,t){var n=this;e=e.toLowerCase();var i,r,a=Z(n),s=new dom.Range(n.document),l=n.commands[e]||UE.commands[e];if(l){if(!a||de[e]||l.notNeedUndo||n.__hasEnterExecCommand)r=u.apply(n,arguments);else{n.__hasEnterExecCommand=!0,n.fireEvent("beforeexeccommand",e),i=a.selectedTds;for(var d,c,m,f=-2,h=-2,p=0;m=i[p];p++)o(m)?s.setStart(m,0).setCursor(!1,!0):s.selectNode(m).select(!0),c=n.queryCommandState(e),d=n.queryCommandValue(e),-1!=c&&(f===c&&h===d||(n._ignoreContentChange=!0,r=u.apply(n,arguments),n._ignoreContentChange=!1),f=n.queryCommandState(e),h=n.queryCommandValue(e),domUtils.isEmptyBlock(m)&&domUtils.fillNode(n.document,m));s.setStart(i[0],0).shrinkBoundary(!0).setCursor(!1,!0),n.fireEvent("contentchange"),n.fireEvent("afterexeccommand",e),n.__hasEnterExecCommand=!1,n._selectionChange()}return r}}});var ce},UE.UETable.prototype.sortTable=function(e,t){var n=this.table,i=n.rows,o=[],r="TH"===i[0].cells[0].tagName,a=0;if(this.selectedTds.length){for(var s=this.cellsRange,l=s.endRowIndex+1,d=s.beginRowIndex;d<l;d++)o[d]=i[d];o.splice(0,s.beginRowIndex),a=s.endRowIndex+1===this.rowsNum?0:s.endRowIndex+1}else for(var d=0,l=i.length;d<l;d++)o[d]=i[d];var c={reversecurrent:function(e,t){return 1},orderbyasc:function(e,t){var n=e.innerText||e.textContent,i=t.innerText||t.textContent;return n.localeCompare(i)},reversebyasc:function(e,t){var n=e.innerHTML;return t.innerHTML.localeCompare(n)},orderbynum:function(e,t){var n=e[browser.ie?"innerText":"textContent"].match(/\d+/),i=t[browser.ie?"innerText":"textContent"].match(/\d+/);return n&&(n=+n[0]),i&&(i=+i[0]),(n||0)-(i||0)},reversebynum:function(e,t){var n=e[browser.ie?"innerText":"textContent"].match(/\d+/),i=t[browser.ie?"innerText":"textContent"].match(/\d+/);return n&&(n=+n[0]),i&&(i=+i[0]),(i||0)-(n||0)}};n.setAttribute("data-sort-type",t&&"string"==typeof t&&c[t]?t:""),r&&o.splice(0,1),o=utils.sort(o,function(n,i){return t&&"function"==typeof t?t.call(this,n.cells[e],i.cells[e]):t&&"number"==typeof t?1:t&&"string"==typeof t&&c[t]?c[t].call(this,n.cells[e],i.cells[e]):c.orderbyasc.call(this,n.cells[e],i.cells[e])});for(var u=n.ownerDocument.createDocumentFragment(),m=0,l=o.length;m<l;m++)u.appendChild(o[m]);var f=n.getElementsByTagName("tbody")[0];a?f.insertBefore(u,i[a-s.endRowIndex+s.beginRowIndex-1]):f.appendChild(u)},UE.plugins.tablesort=function(){var e=this,t=UE.UETable,n=function(e){return t.getUETable(e)},i=function(e){return t.getTableItemsByRange(e)};e.ready(function(){utils.cssRule("tablesort","table.sortEnabled tr.firstRow th,table.sortEnabled tr.firstRow td{padding-right:20px;background-repeat: no-repeat;background-position: center right;   background-image:url("+e.options.themePath+e.options.theme+"/images/sortable.png);}",e.document),e.addListener("afterexeccommand",function(e,t){"mergeright"!=t&&"mergedown"!=t&&"mergecells"!=t||this.execCommand("disablesort")})}),UE.commands.sorttable={queryCommandState:function(){var e=this,t=i(e);if(!t.cell)return-1;for(var n,o=t.table,r=o.getElementsByTagName("td"),a=0;n=r[a++];)if(1!=n.rowSpan||1!=n.colSpan)return-1;return 0},execCommand:function(e,t){var o=this,r=o.selection.getRange(),a=r.createBookmark(!0),s=i(o),l=s.cell,d=n(s.table),c=d.getCellInfo(l);d.sortTable(c.cellIndex,t),r.moveToBookmark(a);try{r.select()}catch(e){}}},UE.commands.enablesort=UE.commands.disablesort={queryCommandState:function(e){var t=i(this).table;if(t&&"enablesort"==e)for(var n=domUtils.getElementsByTagName(t,"th td"),o=0;o<n.length;o++)if(n[o].getAttribute("colspan")>1||n[o].getAttribute("rowspan")>1)return-1;return t?"enablesort"==e^"sortEnabled"!=t.getAttribute("data-sort")?-1:0:-1},execCommand:function(e){var t=i(this).table;t.setAttribute("data-sort","enablesort"==e?"sortEnabled":"sortDisabled"),"enablesort"==e?domUtils.addClass(t,"sortEnabled"):domUtils.removeClasses(t,"sortEnabled")}}},UE.plugins.contextmenu=function(){var e=this;if(e.setOpt("enableContextMenu",!0),!1!==e.getOpt("enableContextMenu")){var t,n=e.getLang("contextMenu"),i=e.options.contextMenu||[{label:n.selectall,cmdName:"selectall"},{label:n.cleardoc,cmdName:"cleardoc",exec:function(){confirm(n.confirmclear)&&this.execCommand("cleardoc")}},"-",{label:n.unlink,cmdName:"unlink"},"-",{group:n.paragraph,icon:"justifyjustify",subMenu:[{label:n.justifyleft,cmdName:"justify",value:"left"},{label:n.justifyright,cmdName:"justify",value:"right"},{label:n.justifycenter,cmdName:"justify",value:"center"},{label:n.justifyjustify,cmdName:"justify",value:"justify"}]},"-",{group:n.table,icon:"table",subMenu:[{label:n.inserttable,cmdName:"inserttable"},{label:n.deletetable,cmdName:"deletetable"},"-",{label:n.deleterow,cmdName:"deleterow"},{label:n.deletecol,cmdName:"deletecol"},{label:n.insertcol,cmdName:"insertcol"},{label:n.insertcolnext,cmdName:"insertcolnext"},{label:n.insertrow,cmdName:"insertrow"},{label:n.insertrownext,cmdName:"insertrownext"},"-",{label:n.insertcaption,cmdName:"insertcaption"},{label:n.deletecaption,cmdName:"deletecaption"},{label:n.inserttitle,cmdName:"inserttitle"},{label:n.deletetitle,cmdName:"deletetitle"},{label:n.inserttitlecol,cmdName:"inserttitlecol"},{label:n.deletetitlecol,cmdName:"deletetitlecol"},"-",{label:n.mergecells,cmdName:"mergecells"},{label:n.mergeright,cmdName:"mergeright"},{label:n.mergedown,cmdName:"mergedown"},"-",{label:n.splittorows,cmdName:"splittorows"},{label:n.splittocols,cmdName:"splittocols"},{label:n.splittocells,cmdName:"splittocells"},"-",{label:n.averageDiseRow,cmdName:"averagedistributerow"},{label:n.averageDisCol,cmdName:"averagedistributecol"},"-",{label:n.edittd,cmdName:"edittd",exec:function(){UE.ui.edittd&&new UE.ui.edittd(this),this.getDialog("edittd").open()}},{label:n.edittable,cmdName:"edittable",exec:function(){UE.ui.edittable&&new UE.ui.edittable(this),this.getDialog("edittable").open()}},{label:n.setbordervisible,cmdName:"setbordervisible"}]},{group:n.tablesort,icon:"tablesort",subMenu:[{label:n.enablesort,cmdName:"enablesort"},{label:n.disablesort,cmdName:"disablesort"},"-",{label:n.reversecurrent,cmdName:"sorttable",value:"reversecurrent"},{label:n.orderbyasc,cmdName:"sorttable",value:"orderbyasc"},{label:n.reversebyasc,cmdName:"sorttable",value:"reversebyasc"},{label:n.orderbynum,cmdName:"sorttable",value:"orderbynum"},{label:n.reversebynum,cmdName:"sorttable",value:"reversebynum"}]},{group:n.borderbk,icon:"borderBack",subMenu:[{label:n.setcolor,cmdName:"interlacetable",exec:function(){this.execCommand("interlacetable")}},{label:n.unsetcolor,cmdName:"uninterlacetable",exec:function(){this.execCommand("uninterlacetable")}},{label:n.setbackground,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#bbb","#ccc"]})}},{label:n.unsetbackground,cmdName:"cleartablebackground",exec:function(){this.execCommand("cleartablebackground")}},{label:n.redandblue,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["red","blue"]})}},{label:n.threecolorgradient,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#aaa","#bbb","#ccc"]})}}]},{group:n.aligntd,icon:"aligntd",subMenu:[{cmdName:"cellalignment",value:{align:"left",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"top"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"middle"}},{cmdName:"cellalignment",value:{align:"left",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"center",vAlign:"bottom"}},{cmdName:"cellalignment",value:{align:"right",vAlign:"bottom"}}]},{group:n.aligntable,icon:"aligntable",subMenu:[{cmdName:"tablealignment",className:"left",label:n.tableleft,value:"left"},{cmdName:"tablealignment",className:"center",label:n.tablecenter,value:"center"},{cmdName:"tablealignment",className:"right",label:n.tableright,value:"right"}]},"-",{label:n.insertparagraphbefore,cmdName:"insertparagraph",value:!0},{label:n.insertparagraphafter,cmdName:"insertparagraph"},{label:n.copy,cmdName:"copy"},{label:n.paste,cmdName:"paste"}];if(i.length){var o=UE.ui.uiUtils;e.addListener("contextmenu",function(r,a){var s=o.getViewportOffsetByEvent(a);e.fireEvent("beforeselectionchange"),t&&t.destroy();for(var l,d=0,c=[];l=i[d];d++){var u;!function(t){if("-"==t)(u=c[c.length-1])&&"-"!==u&&c.push("-");else if(t.hasOwnProperty("group")){for(var i,o=0,r=[];i=t.subMenu[o];o++)!function(t){"-"==t?(u=r[r.length-1])&&"-"!==u?r.push("-"):r.splice(r.length-1):(e.commands[t.cmdName]||UE.commands[t.cmdName]||t.query)&&(t.query?t.query():e.queryCommandState(t.cmdName))>-1&&r.push({label:t.label||e.getLang("contextMenu."+t.cmdName+(t.value||""))||"",className:"edui-for-"+t.cmdName+(t.className?" edui-for-"+t.cmdName+"-"+t.className:""),onclick:t.exec?function(){t.exec.call(e)}:function(){e.execCommand(t.cmdName,t.value)}})}(i);if(r.length){c.push({label:function(){switch(t.icon){case"table":return e.getLang("contextMenu.table");case"justifyjustify":return e.getLang("contextMenu.paragraph");case"aligntd":return e.getLang("contextMenu.aligntd");case"aligntable":return e.getLang("contextMenu.aligntable");case"tablesort":return n.tablesort;case"borderBack":return n.borderbk;default:return""}}(),className:"edui-for-"+t.icon,subMenu:{items:r,editor:e}})}}else(e.commands[t.cmdName]||UE.commands[t.cmdName]||t.query)&&(t.query?t.query.call(e):e.queryCommandState(t.cmdName))>-1&&c.push({label:t.label||e.getLang("contextMenu."+t.cmdName),className:"edui-for-"+(t.icon?t.icon:t.cmdName+(t.value||"")),onclick:t.exec?function(){t.exec.call(e)}:function(){e.execCommand(t.cmdName,t.value)}})}(l)}if("-"==c[c.length-1]&&c.pop(),t=new UE.ui.Menu({items:c,className:"edui-contextmenu",editor:e}),t.render(),t.showAt(s),e.fireEvent("aftershowcontextmenu",t),domUtils.preventDefault(a),browser.ie){var m;try{m=e.selection.getNative().createRange()}catch(e){return}if(m.item){new dom.Range(e.document).selectNode(m.item(0)).select(!0,!0)}}}),e.addListener("aftershowcontextmenu",function(t,n){if(e.zeroclipboard){var i=n.items;for(var o in i)"edui-for-copy"==i[o].className&&e.zeroclipboard.clip(i[o].getDom())}})}}},UE.plugins.shortcutmenu=function(){var e,t=this,n=t.options.shortcutMenu||[];n.length&&(t.addListener("contextmenu mouseup",function(t,i){var o=this,r={type:t,target:i.target||i.srcElement,screenX:i.screenX,screenY:i.screenY,clientX:i.clientX,clientY:i.clientY};if(setTimeout(function(){!1!==o.selection.getRange().collapsed&&"contextmenu"!=t||(e||(e=new baidu.editor.ui.ShortCutMenu({editor:o,items:n,theme:o.options.theme,className:"edui-shortcutmenu"}),e.render(),o.fireEvent("afterrendershortcutmenu",e)),e.show(r,!!UE.plugins.contextmenu))}),"contextmenu"==t&&(domUtils.preventDefault(i),browser.ie9below)){var a;try{a=o.selection.getNative().createRange()}catch(i){return}if(a.item){new dom.Range(o.document).selectNode(a.item(0)).select(!0,!0)}}}),t.addListener("keydown",function(t){"keydown"==t&&e&&!e.isHidden&&e.hide()}))},UE.plugins.basestyle=function(){var e={bold:["strong","b"],italic:["em","i"],subscript:["sub"],superscript:["sup"]},t=function(e,t){return domUtils.filterNodeList(e.selection.getStartElementPath(),t)},n=this;n.addshortcutkey({Bold:"ctrl+66",Italic:"ctrl+73",Underline:"ctrl+85"}),n.addInputRule(function(e){utils.each(e.getNodesByTagName("b i"),function(e){switch(e.tagName){case"b":e.tagName="strong";break;case"i":e.tagName="em"}})});for(var i in e)!function(e,i){n.commands[e]={execCommand:function(e){var o=n.selection.getRange(),r=t(this,i);if(o.collapsed){if(r){var a=n.document.createTextNode("");o.insertNode(a).removeInlineStyle(i),o.setStartBefore(a),domUtils.remove(a)}else{var s=o.document.createElement(i[0]);"superscript"!=e&&"subscript"!=e||(a=n.document.createTextNode(""),o.insertNode(a).removeInlineStyle(["sub","sup"]).setStartBefore(a).collapse(!0)),o.insertNode(s).setStart(s,0)}o.collapse(!0)}else"superscript"!=e&&"subscript"!=e||r&&r.tagName.toLowerCase()==e||o.removeInlineStyle(["sub","sup"]),r?o.removeInlineStyle(i):o.applyInlineStyle(i[0]);o.select()},queryCommandState:function(){return t(this,i)?1:0}}}(i,e[i])},UE.plugins.elementpath=function(){var e,t,n=this;n.setOpt("elementPathEnabled",!0),n.options.elementPathEnabled&&(n.commands.elementpath={execCommand:function(i,o){var r=t[o],a=n.selection.getRange();e=1*o,a.selectNode(r).select()},queryCommandValue:function(){var n=[].concat(this.selection.getStartElementPath()).reverse(),i=[];t=n;for(var o,r=0;o=n[r];r++)if(3!=o.nodeType){var a=o.tagName.toLowerCase();if("img"==a&&o.getAttribute("anchorname")&&(a="anchor"),i[r]=a,e==r){e=-1;break}}return i}})},UE.plugins.formatmatch=function(){function e(r,a){if(browser.webkit)var s="IMG"==a.target.tagName?a.target:null;n.undoManger&&n.undoManger.save();var l=n.selection.getRange(),d=s||l.getClosedNode();if(t&&d&&"IMG"==d.tagName)d.style.cssText+=";float:"+(t.style.cssFloat||t.style.styleFloat||"none")+";display:"+(t.style.display||"inline"),t=null;else if(!t){var c=l.collapsed;if(c){var u=n.document.createTextNode("match");l.insertNode(u).select()}n.__hasEnterExecCommand=!0;var m=n.options.removeFormatAttributes;n.options.removeFormatAttributes="",n.execCommand("removeformat"),n.options.removeFormatAttributes=m,n.__hasEnterExecCommand=!1,l=n.selection.getRange(),i.length&&function(e){u&&e.selectNode(u),e.applyInlineStyle(i[i.length-1].tagName,null,i)}(l),u&&l.setStartBefore(u).collapse(!0),l.select(),u&&domUtils.remove(u)}n.undoManger&&n.undoManger.save(),n.removeListener("mouseup",e),o=0}var t,n=this,i=[],o=0;n.addListener("reset",function(){i=[],o=0}),n.commands.formatmatch={execCommand:function(r){if(o)return o=0,i=[],void n.removeListener("mouseup",e);var a=n.selection.getRange();if(!(t=a.getClosedNode())||"IMG"!=t.tagName){a.collapse(!0).shrinkBoundary();var s=a.startContainer;i=domUtils.findParents(s,!0,function(e){return!domUtils.isBlockElm(e)&&1==e.nodeType});for(var l,d=0;l=i[d];d++)if("A"==l.tagName){i.splice(d,1);break}}n.addListener("mouseup",e),o=1},queryCommandState:function(){return o},notNeedUndo:1}},UE.plugin.register("searchreplace",function(){function e(e,t,n){var i=t.searchStr;-1==t.dir&&(e=e.split("").reverse().join(""),i=i.split("").reverse().join(""),n=e.length-n);for(var o,r=new RegExp(i,"g"+(t.casesensitive?"":"i"));o=r.exec(e);)if(o.index>=n)return-1==t.dir?e.length-o.index-t.searchStr.length:o.index;return-1}function t(t,n,i){var o,r,s=i.all||1==i.dir?"getNextDomNode":"getPreDomNode";domUtils.isBody(t)&&(t=t.firstChild);for(;t;){if(o=3==t.nodeType?t.nodeValue:t[browser.ie?"innerText":"textContent"],r=e(o,i,n),0,-1!=r)return{node:t,index:r};for(t=domUtils[s](t);t&&a[t.nodeName.toLowerCase()];)t=domUtils[s](t,!0);t&&(n=-1==i.dir?(3==t.nodeType?t.nodeValue:t[browser.ie?"innerText":"textContent"]).length:0)}}function n(e,t,i){for(var o,r=0,a=e.firstChild,s=0;a;){if(3==a.nodeType){if(s=a.nodeValue.replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,(r+=s)>=t)return{node:a,index:s-(r-t)}}else if(!dtd.$empty[a.tagName]&&(s=a[browser.ie?"innerText":"textContent"].replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,(r+=s)>=t&&(o=n(a,s-(r-t),i))))return o;a=domUtils.getNextDomNode(a)}}function i(e,i){var r,a=e.selection.getRange(),s=i.searchStr,l=e.document.createElement("span");if(l.innerHTML="$$ueditor_searchreplace_key$$",a.shrinkBoundary(!0),!a.collapsed){a.select();var d=e.selection.getText();if(new RegExp("^"+i.searchStr+"$",i.casesensitive?"":"i").test(d)){if(void 0!=i.replaceStr)return o(a,i.replaceStr),a.select(),!0;a.collapse(-1==i.dir)}}a.insertNode(l),a.enlargeToBlockElm(!0),r=a.startContainer;var c=r[browser.ie?"innerText":"textContent"].indexOf("$$ueditor_searchreplace_key$$");a.setStartBefore(l),domUtils.remove(l);var u=t(r,c,i);if(u){var m=n(u.node,u.index,s),f=n(u.node,u.index+s.length,s);return a.setStart(m.node,m.index).setEnd(f.node,f.index),void 0!==i.replaceStr&&o(a,i.replaceStr),a.select(),!0}a.setCursor()}function o(e,t){t=r.document.createTextNode(t),e.deleteContents().insertNode(t)}var r=this,a={table:1,tbody:1,tr:1,ol:1,ul:1};return{commands:{searchreplace:{execCommand:function(e,t){utils.extend(t,{all:!1,casesensitive:!1,dir:1},!0);var n=0;if(t.all){var o=r.selection.getRange(),a=r.body.firstChild;for(a&&1==a.nodeType?(o.setStart(a,0),o.shrinkBoundary(!0)):3==a.nodeType&&o.setStartBefore(a),o.collapse(!0).select(!0),void 0!==t.replaceStr&&r.fireEvent("saveScene");i(this,t);)n++;n&&r.fireEvent("saveScene")}else void 0!==t.replaceStr&&r.fireEvent("saveScene"),i(this,t)&&n++,n&&r.fireEvent("saveScene");return n},notNeedUndo:1}}}}),UE.plugins.customstyle=function(){var e=this;e.setOpt({customstyle:[{tag:"h1",name:"tc",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:center;margin:0 0 20px 0;"},{tag:"h1",name:"tl",style:"font-size:32px;font-weight:bold;border-bottom:#ccc 2px solid;padding:0 4px 0 0;text-align:left;margin:0 0 10px 0;"},{tag:"span",name:"im",style:"font-size:16px;font-style:italic;font-weight:bold;line-height:18px;"},{tag:"span",name:"hi",style:"font-size:16px;font-style:italic;font-weight:bold;color:rgb(51, 153, 204);line-height:18px;"}]}),e.commands.customstyle={execCommand:function(e,t){var n,i,o=this,r=t.tag,a=domUtils.findParent(o.selection.getStart(),function(e){return e.getAttribute("label")},!0),s={};for(var l in t)void 0!==t[l]&&(s[l]=t[l]);if(delete s.tag,a&&a.getAttribute("label")==t.label){if(n=this.selection.getRange(),i=n.createBookmark(),n.collapsed)if(dtd.$block[a.tagName]){var d=o.document.createElement("p");domUtils.moveChild(a,d),a.parentNode.insertBefore(d,a),domUtils.remove(a)}else domUtils.remove(a,!0);else{var c=domUtils.getCommonAncestor(i.start,i.end),u=domUtils.getElementsByTagName(c,r);new RegExp(r,"i").test(c.tagName)&&u.push(c);for(var m,f=0;m=u[f++];)if(m.getAttribute("label")==t.label){var h=domUtils.getPosition(m,i.start),p=domUtils.getPosition(m,i.end);if((h&domUtils.POSITION_FOLLOWING||h&domUtils.POSITION_CONTAINS)&&(p&domUtils.POSITION_PRECEDING||p&domUtils.POSITION_CONTAINS)&&dtd.$block[r]){var d=o.document.createElement("p");domUtils.moveChild(m,d),m.parentNode.insertBefore(d,m)}domUtils.remove(m,!0)}a=domUtils.findParent(c,function(e){return e.getAttribute("label")==t.label},!0),a&&domUtils.remove(a,!0)}n.moveToBookmark(i).select()}else if(dtd.$block[r]){if(this.execCommand("paragraph",r,s,"customstyle"),n=o.selection.getRange(),!n.collapsed){n.collapse(),a=domUtils.findParent(o.selection.getStart(),function(e){return e.getAttribute("label")==t.label},!0);var g=o.document.createElement("p");domUtils.insertAfter(a,g),domUtils.fillNode(o.document,g),n.setStart(g,0).setCursor()}}else{if(n=o.selection.getRange(),n.collapsed)return a=o.document.createElement(r),domUtils.setAttributes(a,s),void n.insertNode(a).setStart(a,0).setCursor();i=n.createBookmark(),n.applyInlineStyle(r,s).moveToBookmark(i).select()}},queryCommandValue:function(){var e=domUtils.filterNodeList(this.selection.getStartElementPath(),function(e){return e.getAttribute("label")});return e?e.getAttribute("label"):""}},e.addListener("keyup",function(t,n){var i=n.keyCode||n.which;if(32==i||13==i){var o=e.selection.getRange();if(o.collapsed){var r=domUtils.findParent(e.selection.getStart(),function(e){return e.getAttribute("label")},!0);if(r&&dtd.$block[r.tagName]&&domUtils.isEmptyNode(r)){var a=e.document.createElement("p");domUtils.insertAfter(r,a),domUtils.fillNode(e.document,a),domUtils.remove(r),o.setStart(a,0).setCursor()}}}})},UE.plugins.catchremoteimage=function(){var me=this,ajax=UE.ajax;!1!==me.options.catchRemoteImageEnable&&(me.setOpt({catchRemoteImageEnable:!1}),me.addListener("afterpaste",function(){me.fireEvent("catchRemoteImage")}),me.addListener("catchRemoteImage",function(){function catchremoteimage(e,t){var n=utils.serializeParam(me.queryCommandValue("serverparam"))||"",i=utils.formatUrl(catcherActionUrl+(-1==catcherActionUrl.indexOf("?")?"?":"&")+n),o=utils.isCrossDomainUrl(i),r={method:"POST",dataType:o?"jsonp":"",timeout:6e4,onsuccess:t.success,onerror:t.error};r[catcherFieldName]=e,ajax.request(i,r)}for(var catcherLocalDomain=me.getOpt("catcherLocalDomain"),catcherActionUrl=me.getActionUrl(me.getOpt("catcherActionName")),catcherUrlPrefix=me.getOpt("catcherUrlPrefix"),catcherFieldName=me.getOpt("catcherFieldName"),remoteImages=[],imgs=domUtils.getElementsByTagName(me.document,"img"),test=function(e,t){if(-1!=e.indexOf(location.host)||/(^\.)|(^\/)/.test(e))return!0;if(t)for(var n,i=0;n=t[i++];)if(-1!==e.indexOf(n))return!0;return!1},i=0,ci;ci=imgs[i++];)if(!ci.getAttribute("word_img")){var src=ci.getAttribute("_src")||ci.src||"";/^(https?|ftp):/i.test(src)&&!test(src,catcherLocalDomain)&&remoteImages.push(src)}remoteImages.length&&catchremoteimage(remoteImages,{success:function success(r){try{var info=void 0!==r.state?r:eval("("+r.responseText+")")}catch(e){return}var i,j,ci,cj,oldSrc,newSrc,list=info.list;for(i=0;ci=imgs[i++];)for(oldSrc=ci.getAttribute("_src")||ci.src||"",j=0;cj=list[j++];)if(oldSrc==cj.source&&"SUCCESS"==cj.state){newSrc=catcherUrlPrefix+cj.url,domUtils.setAttributes(ci,{src:newSrc,_src:newSrc});break}me.fireEvent("catchremotesuccess")},error:function(){me.fireEvent("catchremoteerror")}})}))},UE.plugin.register("snapscreen",function(){function getLocation(e){var t,n=document.createElement("a"),i=utils.serializeParam(me.queryCommandValue("serverparam"))||"";return n.href=e,browser.ie&&(n.href=n.href),t=n.search,i&&(t=t+(-1==t.indexOf("?")?"?":"&")+i,t=t.replace(/[&]+/gi,"&")),{port:n.port,hostname:n.hostname,path:n.pathname+t||+n.hash}}var me=this,snapplugin;return{commands:{snapscreen:{execCommand:function execCommand(cmd){function onSuccess(rs){try{if(rs=eval("("+rs+")"),"SUCCESS"==rs.state){var opt=me.options;me.execCommand("insertimage",{src:opt.snapscreenUrlPrefix+rs.url,_src:opt.snapscreenUrlPrefix+rs.url,alt:rs.title||"",floatStyle:opt.snapscreenImgAlign})}else alert(rs.state)}catch(e){alert(lang.callBackErrorMsg)}}var url,local,res,lang=me.getLang("snapScreen_plugin");if(!snapplugin){var container=me.container,doc=me.container.ownerDocument||me.container.document;snapplugin=doc.createElement("object");try{snapplugin.type="application/x-pluginbaidusnap"}catch(e){return}snapplugin.style.cssText="position:absolute;left:-9999px;width:0;height:0;",snapplugin.setAttribute("width","0"),snapplugin.setAttribute("height","0"),container.appendChild(snapplugin)}url=me.getActionUrl(me.getOpt("snapscreenActionName")),local=getLocation(url),setTimeout(function(){try{res=snapplugin.saveSnapshot(local.hostname,local.path,local.port)}catch(e){return void me.ui._dialogs.snapscreenDialog.open()}onSuccess(res)},50)},queryCommandState:function(){return-1!=navigator.userAgent.indexOf("Windows",0)?0:-1}}}}}),UE.commands.insertparagraph={execCommand:function(e,t){for(var n,i=this,o=i.selection.getRange(),r=o.startContainer;r&&!domUtils.isBody(r);)n=r,r=r.parentNode;if(n){var a=i.document.createElement("p");t?n.parentNode.insertBefore(a,n):n.parentNode.insertBefore(a,n.nextSibling),domUtils.fillNode(i.document,a),o.setStart(a,0).setCursor(!1,!0)}}},UE.plugin.register("webapp",function(){function e(e,n){return n?'<iframe class="edui-faked-webapp" title="'+e.title+'" '+(e.align&&!e.cssfloat?'align="'+e.align+'"':"")+(e.cssfloat?'style="float:'+e.cssfloat+'"':"")+'width="'+e.width+'" height="'+e.height+'"  scrolling="no" frameborder="0" src="'+e.url+'" logo_url = "'+e.logo+'"></iframe>':'<img title="'+e.title+'" width="'+e.width+'" height="'+e.height+'" src="'+t.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" _logo_url="'+e.logo+'" style="background:url('+e.logo+') no-repeat center center; border:1px solid gray;" class="edui-faked-webapp" _url="'+e.url+'" '+(e.align&&!e.cssfloat?'align="'+e.align+'"':"")+(e.cssfloat?'style="float:'+e.cssfloat+'"':"")+"/>"}var t=this;return{outputRule:function(t){utils.each(t.getNodesByTagName("img"),function(t){var n;if("edui-faked-webapp"==t.getAttr("class")){n=e({title:t.getAttr("title"),width:t.getAttr("width"),height:t.getAttr("height"),align:t.getAttr("align"),cssfloat:t.getStyle("float"),url:t.getAttr("_url"),logo:t.getAttr("_logo_url")},!0);var i=UE.uNode.createElement(n);t.parentNode.replaceChild(i,t)}})},inputRule:function(t){utils.each(t.getNodesByTagName("iframe"),function(t){if("edui-faked-webapp"==t.getAttr("class")){var n=UE.uNode.createElement(e({title:t.getAttr("title"),width:t.getAttr("width"),height:t.getAttr("height"),align:t.getAttr("align"),cssfloat:t.getStyle("float"),url:t.getAttr("src"),logo:t.getAttr("logo_url")}));t.parentNode.replaceChild(n,t)}})},commands:{webapp:{execCommand:function(t,n){var i=this,o=e(utils.extend(n,{align:"none"}),!1);i.execCommand("inserthtml",o)},queryCommandState:function(){var e=this,t=e.selection.getRange().getClosedNode();return t&&"edui-faked-webapp"==t.className?1:0}}}}}),UE.plugins.template=function(){UE.commands.template={execCommand:function(e,t){t.html&&this.execCommand("inserthtml",t.html)}},this.addListener("click",function(e,t){var n=t.target||t.srcElement,i=this.selection.getRange(),o=domUtils.findParent(n,function(e){if(e.className&&domUtils.hasClass(e,"ue_t"))return e},!0);o&&i.selectNode(o).shrinkBoundary().select()}),this.addListener("keydown",function(e,t){var n=this.selection.getRange();if(!n.collapsed&&!(t.ctrlKey||t.metaKey||t.shiftKey||t.altKey)){var i=domUtils.findParent(n.startContainer,function(e){if(e.className&&domUtils.hasClass(e,"ue_t"))return e},!0);i&&domUtils.removeClasses(i,["ue_t"])}})},UE.plugin.register("music",function(){function e(e,n,i,o,r,a){return a?'<embed type="application/x-shockwave-flash" class="edui-faked-music" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+e+'" width="'+n+'" height="'+i+'" '+(o&&!r?'align="'+o+'"':"")+(r?'style="float:'+r+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >':"<img "+(o&&!r?'align="'+o+'"':"")+(r?'style="float:'+r+'"':"")+' width="'+n+'" height="'+i+'" _url="'+e+'" class="edui-faked-music" src="'+t.options.langPath+t.options.lang+'/images/music.png" />'}var t=this;return{outputRule:function(t){utils.each(t.getNodesByTagName("img"),function(t){var n;if("edui-faked-music"==t.getAttr("class")){var i=t.getStyle("float"),o=t.getAttr("align");n=e(t.getAttr("_url"),t.getAttr("width"),t.getAttr("height"),o,i,!0);var r=UE.uNode.createElement(n);t.parentNode.replaceChild(r,t)}})},inputRule:function(t){utils.each(t.getNodesByTagName("embed"),function(t){if("edui-faked-music"==t.getAttr("class")){var n=t.getStyle("float"),i=t.getAttr("align");html=e(t.getAttr("src"),t.getAttr("width"),t.getAttr("height"),i,n,!1);var o=UE.uNode.createElement(html);t.parentNode.replaceChild(o,t)}})},commands:{music:{execCommand:function(t,n){var i=this,o=e(n.url,n.width||400,n.height||95,"none",!1);i.execCommand("inserthtml",o)},queryCommandState:function(){var e=this,t=e.selection.getRange().getClosedNode();return t&&"edui-faked-music"==t.className?1:0}}}}}),UE.plugin.register("autoupload",function(){function e(e,t){var n,i,o,r,a,s,l,d,c=t,u=/image\/\w+/i.test(e.type)?"image":"file",m="loading_"+(+new Date).toString(36);if(n=c.getOpt(u+"FieldName"),i=c.getOpt(u+"UrlPrefix"),o=c.getOpt(u+"MaxSize"),r=c.getOpt(u+"AllowFiles"),a=c.getActionUrl(c.getOpt(u+"ActionName")),l=function(e){var t=c.document.getElementById(m);t&&domUtils.remove(t),c.fireEvent("showmessage",{id:m,content:e,type:"error",timeout:4e3})},"image"==u?(s='<img class="loadingclass" id="'+m+'" src="'+c.options.themePath+c.options.theme+'/images/spacer.gif" title="'+(c.getLang("autoupload.loading")||"")+'" >',d=function(e){var t=i+e.url,n=c.document.getElementById(m);n&&(n.setAttribute("src",t),n.setAttribute("_src",t),n.setAttribute("title",e.title||""),n.setAttribute("alt",e.original||""),n.removeAttribute("id"),domUtils.removeClasses(n,"loadingclass"))}):(s='<p><img class="loadingclass" id="'+m+'" src="'+c.options.themePath+c.options.theme+'/images/spacer.gif" title="'+(c.getLang("autoupload.loading")||"")+'" ></p>',d=function(e){var t=i+e.url,n=c.document.getElementById(m),o=c.selection.getRange(),r=o.createBookmark();o.selectNode(n).select(),c.execCommand("insertfile",{url:t}),o.moveToBookmark(r).select()}),c.execCommand("inserthtml",s),!c.getOpt(u+"ActionName"))return void l(c.getLang("autoupload.errorLoadConfig"));if(e.size>o)return void l(c.getLang("autoupload.exceedSizeError"));var f=e.name?e.name.substr(e.name.lastIndexOf(".")):"";if(f&&"image"!=u||r&&-1==(r.join("")+".").indexOf(f.toLowerCase()+"."))return void l(c.getLang("autoupload.exceedTypeError"));var h=new XMLHttpRequest,p=new FormData,g=utils.serializeParam(c.queryCommandValue("serverparam"))||"",v=utils.formatUrl(a+(-1==a.indexOf("?")?"?":"&")+g);p.append(n,e,e.name||"blob."+e.type.substr("image/".length)),p.append("type","ajax"),h.open("post",v,!0),h.setRequestHeader("X-Requested-With","XMLHttpRequest"),h.addEventListener("load",function(e){try{var t=new Function("return "+utils.trim(e.target.response))();"SUCCESS"==t.state&&t.url?d(t):l(t.state)}catch(e){l(c.getLang("autoupload.loadError"))}}),h.send(p)}function t(e){return e.clipboardData&&e.clipboardData.items&&1==e.clipboardData.items.length&&/^image\//.test(e.clipboardData.items[0].type)?e.clipboardData.items:null}function n(e){return e.dataTransfer&&e.dataTransfer.files?e.dataTransfer.files:null}return{outputRule:function(e){utils.each(e.getNodesByTagName("img"),function(e){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(e.getAttr("class"))&&e.parentNode.removeChild(e)}),utils.each(e.getNodesByTagName("p"),function(e){/\bloadpara\b/.test(e.getAttr("class"))&&e.parentNode.removeChild(e)})},bindEvents:{ready:function(i){var o=this;window.FormData&&window.FileReader&&(domUtils.on(o.body,"paste drop",function(i){var r,a=!1;if(r="paste"==i.type?t(i):n(i)){for(var s,l=r.length;l--;)s=r[l],s.getAsFile&&(s=s.getAsFile()),s&&s.size>0&&(e(s,o),a=!0);a&&i.preventDefault()}}),domUtils.on(o.body,"dragover",function(e){"Files"==e.dataTransfer.types[0]&&e.preventDefault()}),utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-left:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document))}}}}),UE.plugin.register("autosave",function(){function e(e){var r;if(!(new Date-n<i)){if(!e.hasContents())return void(o&&t.removePreferences(o));n=new Date,e._saveFlag=null,r=t.body.innerHTML,!1!==e.fireEvent("beforeautosave",{content:r})&&(t.setPreferences(o,r),e.fireEvent("afterautosave",{content:r}))}}var t=this,n=new Date,i=20,o=null;return{defaultOptions:{saveInterval:500},bindEvents:{ready:function(){var e=null;e=t.key?t.key+"-drafts-data":(t.container.parentNode.id||"ue-common")+"-drafts-data",o=(location.protocol+location.host+location.pathname).replace(/[.:\/]/g,"_")+e},contentchange:function(){o&&(t._saveFlag&&window.clearTimeout(t._saveFlag),t.options.saveInterval>0?t._saveFlag=window.setTimeout(function(){e(t)},t.options.saveInterval):e(t))}},commands:{clearlocaldata:{execCommand:function(e,n){o&&t.getPreferences(o)&&t.removePreferences(o)},notNeedUndo:!0,ignoreContentChange:!0},getlocaldata:{execCommand:function(e,n){return o?t.getPreferences(o)||"":""},notNeedUndo:!0,ignoreContentChange:!0},drafts:{execCommand:function(e,n){o&&(t.body.innerHTML=t.getPreferences(o)||"<p>"+domUtils.fillHtml+"</p>",t.focus(!0))},queryCommandState:function(){return o?null===t.getPreferences(o)?-1:0:-1},notNeedUndo:!0,ignoreContentChange:!0}}}}),UE.plugin.register("charts",function(){function e(e){var t=null,n=0;if(e.rows.length<2)return!1;if(e.rows[0].cells.length<2)return!1;t=e.rows[0].cells,n=t.length;for(var i,o=0;i=t[o];o++)if("th"!==i.tagName.toLowerCase())return!1;for(var r,o=1;r=e.rows[o];o++){if(r.cells.length!=n)return!1;if("th"!==r.cells[0].tagName.toLowerCase())return!1;for(var i,a=1;i=r.cells[a];a++){var s=utils.trim(i.innerText||i.textContent||"");if(s=s.replace(new RegExp(UE.dom.domUtils.fillChar,"g"),"").replace(/^\s+|\s+$/g,""),!/^\d*\.?\d+$/.test(s))return!1}}return!0}var t=this;return{bindEvents:{chartserror:function(){}},commands:{charts:{execCommand:function(n,i){var o=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0),r=[],a={};if(!o)return!1;if(!e(o))return t.fireEvent("chartserror"),!1;a.title=i.title||"",a.subTitle=i.subTitle||"",a.xTitle=i.xTitle||"",a.yTitle=i.yTitle||"",a.suffix=i.suffix||"",a.tip=i.tip||"",a.dataFormat=i.tableDataFormat||"",a.chartType=i.chartType||0;for(var s in a)a.hasOwnProperty(s)&&r.push(s+":"+a[s]);o.setAttribute("data-chart",r.join(";")),domUtils.addClass(o,"edui-charts-table")},queryCommandState:function(t,n){var i=domUtils.findParentByTagName(this.selection.getRange().startContainer,"table",!0);return i&&e(i)?0:-1}}},inputRule:function(e){utils.each(e.getNodesByTagName("table"),function(e){void 0!==e.getAttr("data-chart")&&e.setAttr("style")})},outputRule:function(e){utils.each(e.getNodesByTagName("table"),function(e){void 0!==e.getAttr("data-chart")&&e.setAttr("style","display: none;")})}}}),UE.plugin.register("section",function(){function e(e){this.tag="",this.level=-1,this.dom=null,this.nextSection=null,this.previousSection=null,this.parentSection=null,this.startAddress=[],this.endAddress=[],this.children=[]}function t(t){var n=new e;return utils.extend(n,t)}function n(e,t){for(var n=t,i=0;i<e.length;i++){if(!n.childNodes)return null;n=n.childNodes[e[i]]}return n}var i=this;return{bindMultiEvents:{type:"aftersetcontent afterscencerestore",handler:function(){i.fireEvent("updateSections")}},bindEvents:{ready:function(){i.fireEvent("updateSections"),domUtils.on(i.body,"drop paste",function(){i.fireEvent("updateSections")})},afterexeccommand:function(e,t){"paragraph"==t&&i.fireEvent("updateSections")},keyup:function(e,t){var n=this;if(1!=n.selection.getRange().collapsed)n.fireEvent("updateSections");else{var i=t.keyCode||t.which;13!=i&&8!=i&&46!=i||n.fireEvent("updateSections")}}},commands:{getsections:{execCommand:function(e,n){function i(e){for(var t=0;t<r.length;t++)if(r[t](e))return t;return-1}function o(e,n){for(var r,a,l,c=null,u=e.childNodes,m=0,f=u.length;m<f;m++)if(l=u[m],(r=i(l))>=0){var h=s.selection.getRange().selectNode(l).createAddress(!0).startAddress,p=t({tag:l.tagName,title:l.innerText||l.textContent||"",level:r,dom:l,startAddress:utils.clone(h,[]),endAddress:utils.clone(h,[]),children:[]});for(d.nextSection=p,p.previousSection=d,a=d;r<=a.level;)a=a.parentSection;p.parentSection=a,a.children.push(p),c=d=p}else 1===l.nodeType&&o(l,n),c&&c.endAddress[c.endAddress.length-1]++}for(var r=n||["h1","h2","h3","h4","h5","h6"],a=0;a<r.length;a++)"string"==typeof r[a]?r[a]=function(e){return function(t){return t.tagName==e.toUpperCase()}}(r[a]):"function"!=typeof r[a]&&(r[a]=function(e){return null});var s=this,l=t({level:-1,title:"root"}),d=l;return o(s.body,l),l},notNeedUndo:!0},movesection:{execCommand:function(e,t,i,o){var r,a,s=this;if(t&&i&&-1!=i.level&&(r=o?i.endAddress:i.startAddress,a=n(r,s.body),r&&a&&!function(e,t,n){for(var i=!1,o=!1,r=0;r<e.length&&!(r>=n.length);r++){if(n[r]>e[r]){i=!0;break}if(n[r]<e[r])break}for(var r=0;r<t.length&&!(r>=n.length);r++){if(n[r]<e[r]){o=!0;break}if(n[r]>e[r])break}return i&&o}(t.startAddress,t.endAddress,r))){var l,d,c=n(t.startAddress,s.body),u=n(t.endAddress,s.body);if(o)for(l=u;l&&!(domUtils.getPosition(c,l)&domUtils.POSITION_FOLLOWING)&&(d=l.previousSibling,domUtils.insertAfter(a,l),l!=c);)l=d;else for(l=c;l&&!(domUtils.getPosition(l,u)&domUtils.POSITION_FOLLOWING)&&(d=l.nextSibling,a.parentNode.insertBefore(l,a),l!=u);)l=d;s.fireEvent("updateSections")}}},deletesection:{execCommand:function(e,t,n){function i(e){for(var t=o.body,n=0;n<e.length;n++){if(!t.childNodes)return null;t=t.childNodes[e[n]]}return t}var o=this;if(t){var r,a=i(t.startAddress),s=i(t.endAddress),l=a;if(n)domUtils.remove(l);else for(;l&&domUtils.inDoc(s,o.document)&&!(domUtils.getPosition(l,s)&domUtils.POSITION_FOLLOWING);)r=l.nextSibling,domUtils.remove(l),l=r;o.fireEvent("updateSections")}}},selectsection:{execCommand:function(e,t){if(!t&&!t.dom)return!1;var n=this,i=n.selection.getRange(),o={startAddress:utils.clone(t.startAddress,[]),endAddress:utils.clone(t.endAddress,[])};return o.endAddress[o.endAddress.length-1]++,i.moveToAddress(o).select().scrollToView(),!0},notNeedUndo:!0},scrolltosection:{execCommand:function(e,t){if(!t&&!t.dom)return!1;var n=this,i=n.selection.getRange(),o={startAddress:t.startAddress,endAddress:t.endAddress};return o.endAddress[o.endAddress.length-1]++,i.moveToAddress(o).scrollToView(),!0},notNeedUndo:!0}}}}),UE.plugin.register("simpleupload",function(){function e(){var e=t.offsetWidth||20,o=t.offsetHeight||20,r=document.createElement("iframe"),a="display:block;width:"+e+"px;height:"+o+"px;overflow:hidden;border:0;margin:0;padding:0;position:absolute;top:0;left:0;filter:alpha(opacity=0);-moz-opacity:0;-khtml-opacity: 0;opacity: 0;cursor:pointer;";domUtils.on(r,"load",function(){var t,s,l,d=(+new Date).toString(36);s=r.contentDocument||r.contentWindow.document,l=s.body,t=s.createElement("div"),t.innerHTML='<form id="edui_form_'+d+'" target="edui_iframe_'+d+'" method="POST" enctype="multipart/form-data" action="'+n.getOpt("serverUrl")+'" style="'+a+'"><input id="edui_input_'+d+'" type="file" accept="image/*" name="'+n.options.imageFieldName+'" style="'+a+'"></form><iframe id="edui_iframe_'+d+'" name="edui_iframe_'+d+'" style="display:none;width:0;height:0;border:0;margin:0;padding:0;position:absolute;"></iframe>',t.className="edui-"+n.options.theme,t.id=n.ui.id+"_iframeupload",l.style.cssText=a,l.style.width=e+"px",l.style.height=o+"px",l.appendChild(t),l.parentNode&&(l.parentNode.style.width=e+"px",l.parentNode.style.height=e+"px");var c=s.getElementById("edui_form_"+d),u=s.getElementById("edui_input_"+d),m=s.getElementById("edui_iframe_"+d);domUtils.on(u,"change",function(){function e(){try{var o,r,a,s=(m.contentDocument||m.contentWindow.document).body,l=s.innerText||s.textContent||"";r=new Function("return "+l)(),o=n.options.imageUrlPrefix+r.url,"SUCCESS"==r.state&&r.url?(a=n.document.getElementById(i),a.setAttribute("src",o),a.setAttribute("_src",o),a.setAttribute("title",r.title||""),a.setAttribute("alt",r.original||""),a.removeAttribute("id"),domUtils.removeClasses(a,"loadingclass")):t&&t(r.state)}catch(e){t&&t(n.getLang("simpleupload.loadError"))}c.reset(),domUtils.un(m,"load",e)}function t(e){if(i){var t=n.document.getElementById(i);t&&domUtils.remove(t),n.fireEvent("showmessage",{id:i,content:e,type:"error",timeout:4e3})}}if(u.value){var i="loading_"+(+new Date).toString(36),o=utils.serializeParam(n.queryCommandValue("serverparam"))||"",r=n.getActionUrl(n.getOpt("imageActionName")),a=n.getOpt("imageAllowFiles");if(n.focus(),n.execCommand("inserthtml",'<img class="loadingclass" id="'+i+'" src="'+n.options.themePath+n.options.theme+'/images/spacer.gif" title="'+(n.getLang("simpleupload.loading")||"")+'" >'),!n.getOpt("imageActionName"))return void errorHandler(n.getLang("autoupload.errorLoadConfig"));var s=u.value,l=s?s.substr(s.lastIndexOf(".")):"";if(!l||a&&-1==(a.join("")+".").indexOf(l.toLowerCase()+"."))return void t(n.getLang("simpleupload.exceedTypeError"));domUtils.on(m,"load",e),c.action=utils.formatUrl(r+(-1==r.indexOf("?")?"?":"&")+o),c.submit()}});var f;n.addListener("selectionchange",function(){clearTimeout(f),f=setTimeout(function(){var e=n.queryCommandState("simpleupload");u.disabled=-1==e&&"disabled"},400)}),i=!0}),r.style.cssText=a,t.appendChild(r)}var t,n=this,i=!1;return{bindEvents:{ready:function(){utils.cssRule("loading",".loadingclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loading.gif') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}\n.loaderrorclass{display:inline-block;cursor:default;background: url('"+this.options.themePath+this.options.theme+"/images/loaderror.png') no-repeat center center transparent;border:1px solid #cccccc;margin-right:1px;height: 22px;width: 22px;}",this.document)},simpleuploadbtnready:function(i,o){t=o,n.afterConfigReady(e)}},outputRule:function(e){utils.each(e.getNodesByTagName("img"),function(e){/\b(loaderrorclass)|(bloaderrorclass)\b/.test(e.getAttr("class"))&&e.parentNode.removeChild(e)})},commands:{simpleupload:{queryCommandState:function(){return i?0:-1}}}}}),UE.plugin.register("serverparam",function(){var e={};return{commands:{serverparam:{execCommand:function(t,n,i){void 0===n||null===n?e={}:utils.isString(n)?void 0===i||null===i?delete e[n]:e[n]=i:utils.isObject(n)?utils.extend(e,n,!0):utils.isFunction(n)&&utils.extend(e,n(),!0)},queryCommandValue:function(){return e||{}}}}}}),UE.plugin.register("insertfile",function(){function e(e){var t=e.substr(e.lastIndexOf(".")+1).toLowerCase(),n={rar:"icon_rar.gif",zip:"icon_rar.gif",tar:"icon_rar.gif",gz:"icon_rar.gif",bz2:"icon_rar.gif",doc:"icon_doc.gif",docx:"icon_doc.gif",pdf:"icon_pdf.gif",mp3:"icon_mp3.gif",xls:"icon_xls.gif",chm:"icon_chm.gif",ppt:"icon_ppt.gif",pptx:"icon_ppt.gif",avi:"icon_mv.gif",rmvb:"icon_mv.gif",wmv:"icon_mv.gif",flv:"icon_mv.gif",swf:"icon_mv.gif",rm:"icon_mv.gif",exe:"icon_exe.gif",psd:"icon_psd.gif",txt:"icon_txt.gif",jpg:"icon_jpg.gif",png:"icon_jpg.gif",jpeg:"icon_jpg.gif",gif:"icon_jpg.gif",ico:"icon_jpg.gif",bmp:"icon_jpg.gif"};return n[t]?n[t]:n.txt}var t=this;return{commands:{insertfile:{execCommand:function(n,i){i=utils.isArray(i)?i:[i];var o,r,a,s,l="",d=t.getOpt("UEDITOR_HOME_URL"),c=d+("/"==d.substr(d.length-1)?"":"/")+"dialogs/attachment/fileTypeImages/";for(o=0;o<i.length;o++)r=i[o],a=c+e(r.url),s=r.title||r.url.substr(r.url.lastIndexOf("/")+1),l+='<p style="line-height: 16px;"><img style="vertical-align: middle; margin-right: 2px;" src="'+a+'" _src="'+a+'" /><a style="font-size:12px; color:#0066cc;" href="'+r.url+'" title="'+s+'">'+s+"</a></p>";t.execCommand("insertHtml",l)}}}}}),UE.plugins.xssFilter=function(){function e(e){var t=e.tagName,i=e.attrs;if(!n.hasOwnProperty(t))return e.parentNode.removeChild(e),!1;UE.utils.each(i,function(i,o){-1===n[t].indexOf(o)&&e.setAttr(o)})}var t=UEDITOR_CONFIG,n=t.whitList;n&&t.xssFilterRules&&(this.options.filterRules=function(){var t={};return UE.utils.each(n,function(n,i){t[i]=function(t){return e(t)}}),t}());var i=[];UE.utils.each(n,function(e,t){i.push(t)}),n&&t.inputXssFilter&&this.addInputRule(function(t){t.traversal(function(t){if("element"!==t.type)return!1;e(t)})}),n&&t.outputXssFilter&&this.addOutputRule(function(t){t.traversal(function(t){if("element"!==t.type)return!1;e(t)})})};var baidu=baidu||{};baidu.editor=baidu.editor||{},UE.ui=baidu.editor.ui={},function(){function e(){var e=document.getElementById("edui_fixedlayer");a.setViewportOffset(e,{left:0,top:0})}function t(t){i.on(window,"scroll",e),i.on(window,"resize",baidu.editor.utils.defer(e,0,!0))}var n=baidu.editor.browser,i=baidu.editor.dom.domUtils,o=window.$EDITORUI={},r=0,a=baidu.editor.ui.uiUtils={uid:function(e){return e?e.ID$EDITORUI||(e.ID$EDITORUI=++r):++r},hook:function(e,t){var n;return e&&e._callbacks?n=e:(n=function(){var t;e&&(t=e.apply(this,arguments));for(var i=n._callbacks,o=i.length;o--;){var r=i[o].apply(this,arguments);void 0===t&&(t=r)}return t},n._callbacks=[]),n._callbacks.push(t),n},createElementByHtml:function(e){var t=document.createElement("div");return t.innerHTML=e,t=t.firstChild,t.parentNode.removeChild(t),t},getViewportElement:function(){return n.ie&&n.quirks?document.body:document.documentElement},getClientRect:function(e){var t;try{t=e.getBoundingClientRect()}catch(e){t={left:0,top:0,height:0,width:0}}for(var n,o={left:Math.round(t.left),top:Math.round(t.top),height:Math.round(t.bottom-t.top),width:Math.round(t.right-t.left)};(n=e.ownerDocument)!==document&&(e=i.getWindow(n).frameElement);)t=e.getBoundingClientRect(),o.left+=t.left,o.top+=t.top;return o.bottom=o.top+o.height,o.right=o.left+o.width,o},getViewportRect:function(){var e=a.getViewportElement(),t=0|(window.innerWidth||e.clientWidth),n=0|(window.innerHeight||e.clientHeight);return{left:0,top:0,height:n,width:t,bottom:n,right:t}},setViewportOffset:function(e,t){var n=a.getFixedLayer();e.parentNode===n?(e.style.left=t.left+"px",e.style.top=t.top+"px"):i.setViewportOffset(e,t)},getEventOffset:function(e){var t=e.target||e.srcElement,n=a.getClientRect(t),i=a.getViewportOffsetByEvent(e);return{left:i.left-n.left,top:i.top-n.top}},getViewportOffsetByEvent:function(e){var t=e.target||e.srcElement,n=i.getWindow(t).frameElement,o={left:e.clientX,top:e.clientY};if(n&&t.ownerDocument!==document){var r=a.getClientRect(n);o.left+=r.left,o.top+=r.top}return o},setGlobal:function(e,t){return o[e]=t,'$EDITORUI["'+e+'"]'},unsetGlobal:function(e){delete o[e]},copyAttributes:function(e,t){for(var o=t.attributes,r=o.length;r--;){var a=o[r];"style"==a.nodeName||"class"==a.nodeName||n.ie&&!a.specified||e.setAttribute(a.nodeName,a.nodeValue)}t.className&&i.addClass(e,t.className),t.style.cssText&&(e.style.cssText+=";"+t.style.cssText)},removeStyle:function(e,t){if(e.style.removeProperty)e.style.removeProperty(t);else{if(!e.style.removeAttribute)throw"";e.style.removeAttribute(t)}},contains:function(e,t){return e&&t&&e!==t&&(e.contains?e.contains(t):16&e.compareDocumentPosition(t))},startDrag:function(e,t,n){function i(e){var n=e.clientX-o,i=e.clientY-r;t.ondragmove(n,i,e),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}var n=n||document,o=e.clientX,r=e.clientY;if(n.addEventListener){var a=function e(o){n.removeEventListener("mousemove",i,!0),n.removeEventListener("mouseup",e,!0),window.removeEventListener("mouseup",e,!0),t.ondragstop()};n.addEventListener("mousemove",i,!0),n.addEventListener("mouseup",a,!0),window.addEventListener("mouseup",a,!0),e.preventDefault()}else{var s=function e(){l.releaseCapture(),l.detachEvent("onmousemove",i),l.detachEvent("onmouseup",e),l.detachEvent("onlosecaptrue",e),t.ondragstop()},l=e.srcElement;l.setCapture(),l.attachEvent("onmousemove",i),l.attachEvent("onmouseup",s),l.attachEvent("onlosecaptrue",s),e.returnValue=!1}t.ondragstart()},getFixedLayer:function(){var i=document.getElementById("edui_fixedlayer");return null==i&&(i=document.createElement("div"),i.id="edui_fixedlayer",document.body.appendChild(i),n.ie&&n.version<=8?(i.style.position="absolute",t(),setTimeout(e)):i.style.position="fixed",i.style.left="0",i.style.top="0",i.style.width="0",i.style.height="0"),i},makeUnselectable:function(e){if(n.opera||n.ie&&n.version<9){if(e.unselectable="on",e.hasChildNodes())for(var t=0;t<e.childNodes.length;t++)1==e.childNodes[t].nodeType&&a.makeUnselectable(e.childNodes[t])}else void 0!==e.style.MozUserSelect?e.style.MozUserSelect="none":void 0!==e.style.WebkitUserSelect?e.style.WebkitUserSelect="none":void 0!==e.style.KhtmlUserSelect&&(e.style.KhtmlUserSelect="none")}}}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.EventBase,i=baidu.editor.ui.UIBase=function(){};i.prototype={className:"",uiName:"",initOptions:function(e){var n=this;for(var i in e)n[i]=e[i];this.id=this.id||"edui"+t.uid()},initUIBase:function(){this._globalKey=e.unhtml(t.setGlobal(this.id,this))},render:function(e){for(var n,i=this.renderHtml(),o=t.createElementByHtml(i),r=domUtils.getElementsByTagName(o,"*"),a="edui-"+(this.theme||this.editor.options.theme),s=document.getElementById("edui_fixedlayer"),l=0;n=r[l++];)domUtils.addClass(n,a);domUtils.addClass(o,a),s&&(s.className="",domUtils.addClass(s,a));var d=this.getDom();null!=d?(d.parentNode.replaceChild(o,d),t.copyAttributes(o,d)):("string"==typeof e&&(e=document.getElementById(e)),e=e||t.getFixedLayer(),domUtils.addClass(e,a),e.appendChild(o)),this.postRender()},getDom:function(e){return e?document.getElementById(this.id+"_"+e):document.getElementById(this.id)},postRender:function(){this.fireEvent("postrender")},getHtmlTpl:function(){return""},formatHtml:function(e){var t="edui-"+this.uiName;return e.replace(/##/g,this.id).replace(/%%-/g,this.uiName?t+"-":"").replace(/%%/g,(this.uiName?t:"")+" "+this.className).replace(/\$\$/g,this._globalKey)},renderHtml:function(){return this.formatHtml(this.getHtmlTpl())},dispose:function(){var e=this.getDom();e&&baidu.editor.dom.domUtils.remove(e),t.unsetGlobal(this.id)}},e.inherits(i,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,n=baidu.editor.ui.Separator=function(e){this.initOptions(e),this.initSeparator()};n.prototype={uiName:"separator",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"></div>'}},e.inherits(n,t)}(),function(){var e=baidu.editor.utils,t=baidu.editor.dom.domUtils,n=baidu.editor.ui.UIBase,i=baidu.editor.ui.uiUtils,o=baidu.editor.ui.Mask=function(e){this.initOptions(e),this.initUIBase()};o.prototype={getHtmlTpl:function(){return'<div id="##" class="edui-mask %%" onclick="return $$._onClick(event, this);" onmousedown="return $$._onMouseDown(event, this);"></div>'},postRender:function(){var e=this;t.on(window,"resize",function(){setTimeout(function(){e.isHidden()||e._fill()})})},show:function(e){this._fill(),this.getDom().style.display="",this.getDom().style.zIndex=e},hide:function(){this.getDom().style.display="none",this.getDom().style.zIndex=""},isHidden:function(){return"none"==this.getDom().style.display},_onMouseDown:function(){return!1},_onClick:function(e,t){this.fireEvent("click",e,t)},_fill:function(){var e=this.getDom(),t=i.getViewportRect();e.style.width=t.width+"px",e.style.height=t.height+"px"}},e.inherits(o,n)}(),function(){function e(e,t){for(var n=0;n<a.length;n++){var i=a[n];if(!i.isHidden()&&!1!==i.queryAutoHide(t)){if(e&&/scroll/gi.test(e.type)&&"edui-wordpastepop"==i.className)return;i.hide()}}a.length&&i.editor.fireEvent("afterhidepop")}var t=baidu.editor.utils,n=baidu.editor.ui.uiUtils,i=baidu.editor.dom.domUtils,o=baidu.editor.ui.UIBase,r=baidu.editor.ui.Popup=function(e){this.initOptions(e),this.initPopup()},a=[];r.postHide=e;var s=["edui-anchor-topleft","edui-anchor-topright","edui-anchor-bottomleft","edui-anchor-bottomright"];r.prototype={SHADOW_RADIUS:5,content:null,_hidden:!1,autoRender:!0,canSideLeft:!0,canSideUp:!0,initPopup:function(){this.initUIBase(),a.push(this)},getHtmlTpl:function(){return'<div id="##" class="edui-popup %%" onmousedown="return false;"> <div id="##_body" class="edui-popup-body"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="about:blank"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-popup-content">'+this.getContentHtmlTpl()+"  </div> </div></div>"},getContentHtmlTpl:function(){return this.content?"string"==typeof this.content?this.content:this.content.renderHtml():""},_UIBase_postRender:o.prototype.postRender,postRender:function(){if(this.content instanceof o&&this.content.postRender(),this.captureWheel&&!this.captured){this.captured=!0;var e=(document.documentElement.clientHeight||document.body.clientHeight)-80,t=this.getDom().offsetHeight,r=n.getClientRect(this.combox.getDom()).top,a=this.getDom("content"),s=this.getDom("body").getElementsByTagName("iframe"),l=this;for(s.length&&(s=s[0]);r+t>e;)t-=30;a.style.height=t+"px",s&&(s.style.height=t+"px"),window.XMLHttpRequest?i.on(a,"onmousewheel"in document.body?"mousewheel":"DOMMouseScroll",function(e){e.preventDefault?e.preventDefault():e.returnValue=!1,e.wheelDelta?a.scrollTop-=e.wheelDelta/120*60:a.scrollTop-=e.detail/-3*60}):i.on(this.getDom(),"mousewheel",function(e){e.returnValue=!1,l.getDom("content").scrollTop-=e.wheelDelta/120*60})}this.fireEvent("postRenderAfter"),this.hide(!0),this._UIBase_postRender()},_doAutoRender:function(){!this.getDom()&&this.autoRender&&this.render()},mesureSize:function(){var e=this.getDom("content");return n.getClientRect(e)},fitSize:function(){if(this.captureWheel&&this.sized)return this.__size;this.sized=!0;var e=this.getDom("body");e.style.width="",e.style.height="";var t=this.mesureSize();if(this.captureWheel){e.style.width=-(-20-t.width)+"px";var n=parseInt(this.getDom("content").style.height,10);!window.isNaN(n)&&(t.height=n)}else e.style.width=t.width+"px";return e.style.height=t.height+"px",this.__size=t,this.captureWheel&&(this.getDom("content").style.overflow="auto"),t},showAnchor:function(e,t){this.showAnchorRect(n.getClientRect(e),t)},showAnchorRect:function(e,t,o){this._doAutoRender();var r=n.getViewportRect();this.getDom().style.visibility="hidden",this._show();var a,l,d,c,u=this.fitSize();t?(a=this.canSideLeft&&e.right+u.width>r.right&&e.left>u.width,l=this.canSideUp&&e.top+u.height>r.bottom&&e.bottom>u.height,d=a?e.left-u.width:e.right,c=l?e.bottom-u.height:e.top):(a=this.canSideLeft&&e.right+u.width>r.right&&e.left>u.width,l=this.canSideUp&&e.top+u.height>r.bottom&&e.bottom>u.height,d=a?e.right-u.width:e.left,c=l?e.top-u.height:e.bottom);var m=this.getDom();n.setViewportOffset(m,{left:d,top:c}),i.removeClasses(m,s),m.className+=" "+s[2*(l?1:0)+(a?1:0)],this.editor&&(m.style.zIndex=1*this.editor.container.style.zIndex+10,baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=m.style.zIndex-1),this.getDom().style.visibility="visible"},showAt:function(e){var t=e.left,n=e.top,i={left:t,top:n,right:t,bottom:n,height:0,width:0};this.showAnchorRect(i,!1,!0)},_show:function(){if(this._hidden){this.getDom().style.display="",this._hidden=!1,this.fireEvent("show")}},isHidden:function(){return this._hidden},show:function(){this._doAutoRender(),this._show()},hide:function(e){!this._hidden&&this.getDom()&&(this.getDom().style.display="none",this._hidden=!0,e||this.fireEvent("hide"))},queryAutoHide:function(e){return!e||!n.contains(this.getDom(),e)}},t.inherits(r,o),i.on(document,"mousedown",function(t){e(t,t.target||t.srcElement)}),i.on(window,"scroll",function(t,n){e(t,n)})}(),function(){function e(e,t){for(var n='<div id="##" class="edui-colorpicker %%"><div class="edui-colorpicker-topbar edui-clearfix"><div unselectable="on" id="##_preview" class="edui-colorpicker-preview"></div><div unselectable="on" class="edui-colorpicker-nocolor" onclick="$$._onPickNoColor(event, this);">'+e+'</div></div><table  class="edui-box" style="border-collapse: collapse;" onmouseover="$$._onTableOver(event, this);" onmouseout="$$._onTableOut(event, this);" onclick="return $$._onTableClick(event, this);" cellspacing="0" cellpadding="0"><tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;padding-top: 2px"><td colspan="10">'+t.getLang("themeColor")+'</td> </tr><tr class="edui-colorpicker-tablefirstrow" >',i=0;i<o.length;i++)i&&i%10==0&&(n+="</tr>"+(60==i?'<tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;"><td colspan="10">'+t.getLang("standardColor")+"</td></tr>":"")+"<tr"+(60==i?' class="edui-colorpicker-tablefirstrow"':"")+">"),n+=i<70?'<td style="padding: 0 2px;"><a hidefocus title="'+o[i]+'" onclick="return false;" href="javascript:" unselectable="on" class="edui-box edui-colorpicker-colorcell" data-color="#'+o[i]+'" style="background-color:#'+o[i]+";border:solid #ccc;"+(i<10||i>=60?"border-width:1px;":i>=10&&i<20?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'"></a></td>':"";return n+="</tr></table></div>"}var t=baidu.editor.utils,n=baidu.editor.ui.UIBase,i=baidu.editor.ui.ColorPicker=function(e){this.initOptions(e),this.noColorText=this.noColorText||this.editor.getLang("clearColor"),this.initUIBase()};i.prototype={getHtmlTpl:function(){return e(this.noColorText,this.editor)},_onTableClick:function(e){var t=e.target||e.srcElement,n=t.getAttribute("data-color");n&&this.fireEvent("pickcolor",n)},_onTableOver:function(e){var t=e.target||e.srcElement,n=t.getAttribute("data-color");n&&(this.getDom("preview").style.backgroundColor=n)},_onTableOut:function(){this.getDom("preview").style.backgroundColor=""},_onPickNoColor:function(){this.fireEvent("picknocolor")}},t.inherits(i,n);var o="ffffff,000000,eeece1,1f497d,4f81bd,c0504d,9bbb59,8064a2,4bacc6,f79646,f2f2f2,7f7f7f,ddd9c3,c6d9f0,dbe5f1,f2dcdb,ebf1dd,e5e0ec,dbeef3,fdeada,d8d8d8,595959,c4bd97,8db3e2,b8cce4,e5b9b7,d7e3bc,ccc1d9,b7dde8,fbd5b5,bfbfbf,3f3f3f,938953,548dd4,95b3d7,d99694,c3d69b,b2a2c7,92cddc,fac08f,a5a5a5,262626,494429,17365d,366092,953734,76923c,5f497a,31859b,e36c09,7f7f7f,0c0c0c,1d1b10,0f243e,244061,632423,4f6128,3f3151,205867,974806,c00000,ff0000,ffc000,ffff00,92d050,00b050,00b0f0,0070c0,002060,7030a0,".split(",")}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.ui.UIBase,i=baidu.editor.ui.TablePicker=function(e){this.initOptions(e),this.initTablePicker()};i.prototype={defaultNumRows:10,defaultNumCols:10,maxNumRows:20,maxNumCols:20,numRows:10,numCols:10,lengthOfCellSide:22,initTablePicker:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-tablepicker %%"><div class="edui-tablepicker-body"><div class="edui-infoarea"><span id="##_label" class="edui-label"></span></div><div class="edui-pickarea" onmousemove="$$._onMouseMove(event, this);" onmouseover="$$._onMouseOver(event, this);" onmouseout="$$._onMouseOut(event, this);" onclick="$$._onClick(event, this);"><div id="##_overlay" class="edui-overlay"></div></div></div></div>'},_UIBase_render:n.prototype.render,render:function(e){this._UIBase_render(e),this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(e,t){var n=this.getDom("overlay").style,i=this.lengthOfCellSide;n.width=e*i+"px",n.height=t*i+"px",this.getDom("label").innerHTML=e+this.editor.getLang("t_col")+" x "+t+this.editor.getLang("t_row"),this.numCols=e,this.numRows=t},_onMouseOver:function(e,n){var i=e.relatedTarget||e.fromElement;t.contains(n,i)||n===i||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="")},_onMouseOut:function(e,n){var i=e.relatedTarget||e.toElement;t.contains(n,i)||n===i||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="hidden")},_onMouseMove:function(e,n){var i=(this.getDom("overlay").style,t.getEventOffset(e)),o=this.lengthOfCellSide,r=Math.ceil(i.left/o),a=Math.ceil(i.top/o);this._track(r,a)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)}},e.inherits(i,n)}(),function(){var e=baidu.editor.browser,t=baidu.editor.dom.domUtils,n=baidu.editor.ui.uiUtils,i='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(e.ie?' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"':' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"');baidu.editor.ui.Stateful={alwalysHoverable:!1,target:null,Stateful_init:function(){this._Stateful_dGetHtmlTpl=this.getHtmlTpl,this.getHtmlTpl=this.Stateful_getHtmlTpl},Stateful_getHtmlTpl:function(){return this._Stateful_dGetHtmlTpl().replace(/stateful/g,function(){return i})},Stateful_onMouseEnter:function(e,t){this.target=t,this.isDisabled()&&!this.alwalysHoverable||(this.addState("hover"),this.fireEvent("over"))},Stateful_onMouseLeave:function(e,t){this.isDisabled()&&!this.alwalysHoverable||(this.removeState("hover"),this.removeState("active"),this.fireEvent("out"))},Stateful_onMouseOver:function(e,t){var i=e.relatedTarget;n.contains(t,i)||t===i||this.Stateful_onMouseEnter(e,t)},Stateful_onMouseOut:function(e,t){var i=e.relatedTarget;n.contains(t,i)||t===i||this.Stateful_onMouseLeave(e,t)},Stateful_onMouseDown:function(e,t){this.isDisabled()||this.addState("active")},Stateful_onMouseUp:function(e,t){this.isDisabled()||this.removeState("active")},Stateful_postRender:function(){this.disabled&&!this.hasState("disabled")&&this.addState("disabled")},hasState:function(e){return t.hasClass(this.getStateDom(),"edui-state-"+e)},addState:function(e){this.hasState(e)||(this.getStateDom().className+=" edui-state-"+e)},removeState:function(e){this.hasState(e)&&t.removeClasses(this.getStateDom(),["edui-state-"+e])},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(e){!this.isDisabled()&&e?this.addState("checked"):this.removeState("checked")},isDisabled:function(){return this.hasState("disabled")},setDisabled:function(e){e?(this.removeState("hover"),this.removeState("checked"),this.removeState("active"),this.addState("disabled")):this.removeState("disabled")}}}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,n=baidu.editor.ui.Stateful,i=baidu.editor.ui.Button=function(e){if(e.name){var t=e.name,n=e.cssRules;e.className||(e.className="edui-for-"+t),e.cssRules=".edui-default  .edui-for-"+t+" .edui-icon {"+n+"}"}this.initOptions(e),this.initButton()};i.prototype={uiName:"button",label:"",title:"",showIcon:!0,showText:!0,cssRules:"",initButton:function(){this.initUIBase(),this.Stateful_init(),this.cssRules&&e.cssRule("edui-customize-"+this.name+"-style",this.cssRules)},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div id="##_state" stateful><div class="%%-wrap"><div id="##_body" unselectable="on" '+(this.title?'title="'+this.title+'"':"")+' class="%%-body" onmousedown="return $$._onMouseDown(event, this);" onclick="return $$._onClick(event, this);">'+(this.showIcon?'<div class="edui-box edui-icon"></div>':"")+(this.showText?'<div class="edui-box edui-label">'+this.label+"</div>":"")+"</div></div></div></div>"},postRender:function(){this.Stateful_postRender(),this.setDisabled(this.disabled)},_onMouseDown:function(e){var t=e.target||e.srcElement,n=t&&t.tagName&&t.tagName.toLowerCase();if("input"==n||"object"==n||"object"==n)return!1},_onClick:function(){this.isDisabled()||this.fireEvent("click")},setTitle:function(e){this.getDom("label").innerHTML=e}},e.inherits(i,t),e.extend(i.prototype,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=(baidu.editor.dom.domUtils,baidu.editor.ui.UIBase),i=baidu.editor.ui.Stateful,o=baidu.editor.ui.SplitButton=function(e){this.initOptions(e),this.initSplitButton()};o.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase(),this.Stateful_init();if(null!=this.popup){var e=this.popup;this.popup=null,this.setPopup(e)}},_UIBase_postRender:n.prototype.postRender,postRender:function(){this.Stateful_postRender(),this._UIBase_postRender()},setPopup:function(n){this.popup!==n&&(null!=this.popup&&this.popup.dispose(),n.addListener("show",e.bind(this._onPopupShow,this)),n.addListener("hide",e.bind(this._onPopupHide,this)),n.addListener("postrender",e.bind(function(){n.getDom("body").appendChild(t.createElementByHtml('<div id="'+this.popup.id+'_bordereraser" class="edui-bordereraser edui-background" style="width:'+(t.getClientRect(this.getDom()).width+20)+'px"></div>')),n.getDom().className+=" "+this.className},this)),this.popup=n)},_onPopupShow:function(){this.addState("opened")},_onPopupHide:function(){this.removeState("opened")},getHtmlTpl:function(){return'<div id="##" class="edui-box %%"><div '+(this.title?'title="'+this.title+'"':"")+' id="##_state" stateful><div class="%%-body"><div id="##_button_body" class="edui-box edui-button-body" onclick="$$._onButtonClick(event, this);"><div class="edui-box edui-icon"></div></div><div class="edui-box edui-splitborder"></div><div class="edui-box edui-arrow" onclick="$$._onArrowClick();"></div></div></div></div>'},showPopup:function(){var e=t.getClientRect(this.getDom());e.top-=this.popup.SHADOW_RADIUS,e.height+=this.popup.SHADOW_RADIUS,this.popup.showAnchorRect(e)},_onArrowClick:function(e,t){this.isDisabled()||this.showPopup()},_onButtonClick:function(){this.isDisabled()||this.fireEvent("buttonclick")}},e.inherits(o,n),e.extend(o.prototype,i,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.ui.ColorPicker,i=baidu.editor.ui.Popup,o=baidu.editor.ui.SplitButton,r=baidu.editor.ui.ColorButton=function(e){this.initOptions(e),this.initColorButton()};r.prototype={initColorButton:function(){var e=this;this.popup=new i({content:new n({noColorText:e.editor.getLang("clearColor"),editor:e.editor,onpickcolor:function(t,n){e._onPickColor(n)},onpicknocolor:function(t,n){e._onPickNoColor(n)}}),editor:e.editor}),this.initSplitButton()},_SplitButton_postRender:o.prototype.postRender,postRender:function(){this._SplitButton_postRender(),this.getDom("button_body").appendChild(t.createElementByHtml('<div id="'+this.id+'_colorlump" class="edui-colorlump"></div>')),this.getDom().className+=" edui-colorbutton"},setColor:function(e){this.getDom("colorlump").style.backgroundColor=e,this.color=e},_onPickColor:function(e){!1!==this.fireEvent("pickcolor",e)&&(this.setColor(e),this.popup.hide())},_onPickNoColor:function(e){!1!==this.fireEvent("picknocolor")&&this.popup.hide()}},e.inherits(r,o)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,n=baidu.editor.ui.TablePicker,i=baidu.editor.ui.SplitButton,o=baidu.editor.ui.TableButton=function(e){this.initOptions(e),this.initTableButton()};o.prototype={initTableButton:function(){var e=this;this.popup=new t({content:new n({editor:e.editor,onpicktable:function(t,n,i){e._onPickTable(n,i)}}),editor:e.editor}),this.initSplitButton()},_onPickTable:function(e,t){!1!==this.fireEvent("picktable",e,t)&&this.popup.hide()}},e.inherits(o,i)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,n=baidu.editor.ui.AutoTypeSetPicker=function(e){this.initOptions(e),this.initAutoTypeSetPicker()};n.prototype={initAutoTypeSetPicker:function(){this.initUIBase()},getHtmlTpl:function(){var e=this.editor,t=e.options.autotypeset,n=e.getLang("autoTypeSet"),i="textAlignValue"+e.uid,o="imageBlockLineValue"+e.uid,r="symbolConverValue"+e.uid;return'<div id="##" class="edui-autotypesetpicker %%"><div class="edui-autotypesetpicker-body"><table ><tr><td nowrap><input type="checkbox" name="mergeEmptyline" '+(t.mergeEmptyline?"checked":"")+">"+n.mergeLine+'</td><td colspan="2"><input type="checkbox" name="removeEmptyline" '+(t.removeEmptyline?"checked":"")+">"+n.delLine+'</td></tr><tr><td nowrap><input type="checkbox" name="removeClass" '+(t.removeClass?"checked":"")+">"+n.removeFormat+'</td><td colspan="2"><input type="checkbox" name="indent" '+(t.indent?"checked":"")+">"+n.indent+'</td></tr><tr><td nowrap><input type="checkbox" name="textAlign" '+(t.textAlign?"checked":"")+">"+n.alignment+'</td><td colspan="2" id="'+i+'"><input type="radio" name="'+i+'" value="left" '+(t.textAlign&&"left"==t.textAlign?"checked":"")+">"+e.getLang("justifyleft")+'<input type="radio" name="'+i+'" value="center" '+(t.textAlign&&"center"==t.textAlign?"checked":"")+">"+e.getLang("justifycenter")+'<input type="radio" name="'+i+'" value="right" '+(t.textAlign&&"right"==t.textAlign?"checked":"")+">"+e.getLang("justifyright")+'</td></tr><tr><td nowrap><input type="checkbox" name="imageBlockLine" '+(t.imageBlockLine?"checked":"")+">"+n.imageFloat+'</td><td nowrap id="'+o+'"><input type="radio" name="'+o+'" value="none" '+(t.imageBlockLine&&"none"==t.imageBlockLine?"checked":"")+">"+e.getLang("default")+'<input type="radio" name="'+o+'" value="left" '+(t.imageBlockLine&&"left"==t.imageBlockLine?"checked":"")+">"+e.getLang("justifyleft")+'<input type="radio" name="'+o+'" value="center" '+(t.imageBlockLine&&"center"==t.imageBlockLine?"checked":"")+">"+e.getLang("justifycenter")+'<input type="radio" name="'+o+'" value="right" '+(t.imageBlockLine&&"right"==t.imageBlockLine?"checked":"")+">"+e.getLang("justifyright")+'</td></tr><tr><td nowrap><input type="checkbox" name="clearFontSize" '+(t.clearFontSize?"checked":"")+">"+n.removeFontsize+'</td><td colspan="2"><input type="checkbox" name="clearFontFamily" '+(t.clearFontFamily?"checked":"")+">"+n.removeFontFamily+'</td></tr><tr><td nowrap colspan="3"><input type="checkbox" name="removeEmptyNode" '+(t.removeEmptyNode?"checked":"")+">"+n.removeHtml+'</td></tr><tr><td nowrap colspan="3"><input type="checkbox" name="pasteFilter" '+(t.pasteFilter?"checked":"")+">"+n.pasteFilter+'</td></tr><tr><td nowrap><input type="checkbox" name="symbolConver" '+(t.bdc2sb||t.tobdc?"checked":"")+">"+n.symbol+'</td><td id="'+r+'"><input type="radio" name="bdc" value="bdc2sb" '+(t.bdc2sb?"checked":"")+">"+n.bdc2sb+'<input type="radio" name="bdc" value="tobdc" '+(t.tobdc?"checked":"")+">"+n.tobdc+'</td><td nowrap align="right"><button >'+n.run+"</button></td></tr></table></div></div>"},_UIBase_render:t.prototype.render},e.inherits(n,t)}(),function(){function e(e){for(var n,i={},o=e.getDom(),r=e.editor.uid,a=null,s=domUtils.getElementsByTagName(o,"input"),l=s.length-1;n=s[l--];)if("checkbox"==n.getAttribute("type"))if(a=n.getAttribute("name"),i[a]&&delete i[a],n.checked){var d=document.getElementById(a+"Value"+r);if(d){if(/input/gi.test(d.tagName))i[a]=d.value;else for(var c,u=d.getElementsByTagName("input"),m=u.length-1;c=u[m--];)if(c.checked){i[a]=c.value;break}}else i[a]=!0}else i[a]=!1;else i[n.getAttribute("value")]=n.checked;for(var f,h=domUtils.getElementsByTagName(o,"select"),l=0;f=h[l++];){var p=f.getAttribute("name");i[p]=i[p]?f.value:""}t.extend(e.editor.options.autotypeset,i),e.editor.setPreferences("autotypeset",i)}var t=baidu.editor.utils,n=baidu.editor.ui.Popup,i=baidu.editor.ui.AutoTypeSetPicker,o=baidu.editor.ui.SplitButton,r=baidu.editor.ui.AutoTypeSetButton=function(e){this.initOptions(e),this.initAutoTypeSetButton()};r.prototype={initAutoTypeSetButton:function(){var t=this;this.popup=new n({content:new i({editor:t.editor}),editor:t.editor,hide:function(){!this._hidden&&this.getDom()&&(e(this),this.getDom().style.display="none",this._hidden=!0,this.fireEvent("hide"))}});var o=0;this.popup.addListener("postRenderAfter",function(){var n=this;if(!o){var i=this.getDom();i.getElementsByTagName("button")[0].onclick=function(){e(n),t.editor.execCommand("autotypeset"),n.hide()},domUtils.on(i,"click",function(i){var o=i.target||i.srcElement,r=t.editor.uid;if(o&&"INPUT"==o.tagName){if("imageBlockLine"==o.name||"textAlign"==o.name||"symbolConver"==o.name)for(var a=o.checked,s=document.getElementById(o.name+"Value"+r),l=s.getElementsByTagName("input"),d={imageBlockLine:"none",textAlign:"left",symbolConver:"tobdc"},c=0;c<l.length;c++)a?l[c].value==d[o.name]&&(l[c].checked="checked"):l[c].checked=!1;if(o.name=="imageBlockLineValue"+r||o.name=="textAlignValue"+r||"bdc"==o.name){var u=o.parentNode.previousSibling.getElementsByTagName("input");u&&(u[0].checked=!0)}e(n)}}),o=1}}),this.initSplitButton()}},t.inherits(r,o)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,n=baidu.editor.ui.Stateful,i=baidu.editor.ui.UIBase,o=baidu.editor.ui.CellAlignPicker=function(e){this.initOptions(e),this.initSelected(),this.initCellAlignPicker()};o.prototype={initSelected:function(){var e={valign:{top:0,middle:1,bottom:2},align:{left:0,center:1,right:2},count:3};this.selected&&(this.selectedIndex=e.valign[this.selected.valign]*e.count+e.align[this.selected.align])},initCellAlignPicker:function(){this.initUIBase(),this.Stateful_init()},getHtmlTpl:function(){for(var e=["left","center","right"],t=null,n=-1,i=[],o=0;o<9;o++)t=this.selectedIndex===o?' class="edui-cellalign-selected" ':"",n=o%3,0===n&&i.push("<tr>"),i.push('<td index="'+o+'" '+t+' stateful><div class="edui-icon edui-'+e[n]+'"></div></td>'),2===n&&i.push("</tr>");return'<div id="##" class="edui-cellalignpicker %%"><div class="edui-cellalignpicker-body"><table onclick="$$._onClick(event);">'+i.join("")+"</table></div></div>"},getStateDom:function(){return this.target},_onClick:function(e){var n=e.target||e.srcElement;/icon/.test(n.className)&&(this.items[n.parentNode.getAttribute("index")].onclick(),t.postHide(e))},_UIBase_render:i.prototype.render},e.inherits(o,i),e.extend(o.prototype,n,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Stateful,n=baidu.editor.ui.uiUtils,i=baidu.editor.ui.UIBase,o=baidu.editor.ui.PastePicker=function(e){this.initOptions(e),this.initPastePicker()};o.prototype={initPastePicker:function(){this.initUIBase(),this.Stateful_init()},getHtmlTpl:function(){return'<div class="edui-pasteicon" onclick="$$._onClick(this)"></div><div class="edui-pastecontainer"><div class="edui-title">'+this.editor.getLang("pasteOpt")+'</div><div class="edui-button"><div title="'+this.editor.getLang("pasteSourceFormat")+'" onclick="$$.format(false)" stateful><div class="edui-richtxticon"></div></div><div title="'+this.editor.getLang("tagFormat")+'" onclick="$$.format(2)" stateful><div class="edui-tagicon"></div></div><div title="'+this.editor.getLang("pasteTextFormat")+'" onclick="$$.format(true)" stateful><div class="edui-plaintxticon"></div></div></div></div></div>'},getStateDom:function(){return this.target},format:function(e){this.editor.ui._isTransfer=!0,this.editor.fireEvent("pasteTransfer",e)},_onClick:function(e){var t=domUtils.getNextDomNode(e),i=n.getViewportRect().height,o=n.getClientRect(t);o.top+o.height>i?t.style.top=-o.height-e.offsetHeight+"px":t.style.top="",/hidden/gi.test(domUtils.getComputedStyle(t,"visibility"))?(t.style.visibility="visible",domUtils.addClass(e,"edui-state-opened")):(t.style.visibility="hidden",domUtils.removeClasses(e,"edui-state-opened"))},_UIBase_render:i.prototype.render},e.inherits(o,i),e.extend(o.prototype,t,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.ui.UIBase,i=baidu.editor.ui.Toolbar=function(e){this.initOptions(e),this.initToolbar()};i.prototype={items:null,initToolbar:function(){this.items=this.items||[],this.initUIBase()},add:function(e,t){void 0===t?this.items.push(e):this.items.splice(t,0,e)},getHtmlTpl:function(){for(var e=[],t=0;t<this.items.length;t++)e[t]=this.items[t].renderHtml();return'<div id="##" class="edui-toolbar %%" onselectstart="return false;" onmousedown="return $$._onMouseDown(event, this);">'+e.join("")+"</div>"},postRender:function(){for(var e=this.getDom(),n=0;n<this.items.length;n++)this.items[n].postRender();t.makeUnselectable(e)},_onMouseDown:function(e){var t=e.target||e.srcElement,n=t&&t.tagName&&t.tagName.toLowerCase();if("input"==n||"object"==n||"object"==n)return!1}},e.inherits(i,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.dom.domUtils,n=baidu.editor.ui.uiUtils,i=baidu.editor.ui.UIBase,o=baidu.editor.ui.Popup,r=baidu.editor.ui.Stateful,a=baidu.editor.ui.CellAlignPicker,s=baidu.editor.ui.Menu=function(e){this.initOptions(e),this.initMenu()},l={renderHtml:function(){return'<div class="edui-menuitem edui-menuseparator"><div class="edui-menuseparator-inner"></div></div>'},postRender:function(){},queryAutoHide:function(){return!0}};s.prototype={items:null,uiName:"menu",initMenu:function(){this.items=this.items||[],this.initPopup(),this.initItems()},initItems:function(){for(var e=0;e<this.items.length;e++){var t=this.items[e];"-"==t?this.items[e]=this.getSeparator():t instanceof d||(t.editor=this.editor,t.theme=this.editor.options.theme,this.items[e]=this.createItem(t))}},getSeparator:function(){return l},createItem:function(e){return e.menu=this,new d(e)},_Popup_getContentHtmlTpl:o.prototype.getContentHtmlTpl,getContentHtmlTpl:function(){if(0==this.items.length)return this._Popup_getContentHtmlTpl();for(var e=[],t=0;t<this.items.length;t++){var n=this.items[t];e[t]=n.renderHtml()}return'<div class="%%-body">'+e.join("")+"</div>"},_Popup_postRender:o.prototype.postRender,postRender:function(){for(var e=this,i=0;i<this.items.length;i++){var o=this.items[i];o.ownerMenu=this,o.postRender()}t.on(this.getDom(),"mouseover",function(t){t=t||event;var i=t.relatedTarget||t.fromElement,o=e.getDom();n.contains(o,i)||o===i||e.fireEvent("over")}),this._Popup_postRender()},queryAutoHide:function(e){if(e){if(n.contains(this.getDom(),e))return!1;for(var t=0;t<this.items.length;t++){if(!1===this.items[t].queryAutoHide(e))return!1}}},clearItems:function(){for(var e=0;e<this.items.length;e++){var t=this.items[e];clearTimeout(t._showingTimer),clearTimeout(t._closingTimer),t.subMenu&&t.subMenu.destroy()}this.items=[]},destroy:function(){this.getDom()&&t.remove(this.getDom()),this.clearItems()},dispose:function(){this.destroy()}},e.inherits(s,o);var d=baidu.editor.ui.MenuItem=function(e){if(this.initOptions(e),this.initUIBase(),this.Stateful_init(),this.subMenu&&!(this.subMenu instanceof s))if(e.className&&-1!=e.className.indexOf("aligntd")){var n=this;this.subMenu.selected=this.editor.queryCommandValue("cellalignment"),this.subMenu=new o({content:new a(this.subMenu),parentMenu:n,editor:n.editor,destroy:function(){this.getDom()&&t.remove(this.getDom())}}),this.subMenu.addListener("postRenderAfter",function(){t.on(this.getDom(),"mouseover",function(){n.addState("opened")})})}else this.subMenu=new s(this.subMenu)};d.prototype={label:"",subMenu:null,ownerMenu:null,uiName:"menuitem",alwalysHoverable:!0,getHtmlTpl:function(){return'<div id="##" class="%%" stateful onclick="$$._onClick(event, this);"><div class="%%-body">'+this.renderLabelHtml()+"</div></div>"},postRender:function(){var e=this;this.addListener("over",function(){e.ownerMenu.fireEvent("submenuover",e),e.subMenu&&e.delayShowSubMenu()}),this.subMenu&&(this.getDom().className+=" edui-hassubmenu",this.subMenu.render(),this.addListener("out",function(){e.delayHideSubMenu()}),this.subMenu.addListener("over",function(){clearTimeout(e._closingTimer),e._closingTimer=null,e.addState("opened")}),this.ownerMenu.addListener("hide",function(){e.hideSubMenu()}),this.ownerMenu.addListener("submenuover",function(t,n){n!==e&&e.delayHideSubMenu()}),this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide,this.subMenu.queryAutoHide=function(t){return(!t||!n.contains(e.getDom(),t))&&this._bakQueryAutoHide(t)}),this.getDom().style.tabIndex="-1",n.makeUnselectable(this.getDom()),this.Stateful_postRender()},delayShowSubMenu:function(){var e=this;e.isDisabled()||(e.addState("opened"),clearTimeout(e._showingTimer),clearTimeout(e._closingTimer),e._closingTimer=null,e._showingTimer=setTimeout(function(){e.showSubMenu()},250))},delayHideSubMenu:function(){var e=this;e.isDisabled()||(e.removeState("opened"),clearTimeout(e._showingTimer),e._closingTimer||(e._closingTimer=setTimeout(function(){e.hasState("opened")||e.hideSubMenu(),e._closingTimer=null},400)))},renderLabelHtml:function(){return'<div class="edui-arrow"></div><div class="edui-box edui-icon"></div><div class="edui-box edui-label %%-label">'+(this.label||"")+"</div>"},getStateDom:function(){return this.getDom()},queryAutoHide:function(e){if(this.subMenu&&this.hasState("opened"))return this.subMenu.queryAutoHide(e)},_onClick:function(e,t){this.hasState("disabled")||!1!==this.fireEvent("click",e,t)&&(this.subMenu?this.showSubMenu():o.postHide(e))},showSubMenu:function(){var e=n.getClientRect(this.getDom());e.right-=5,e.left+=2,e.width-=7,e.top-=4,e.bottom+=4,e.height+=8,this.subMenu.showAnchorRect(e,!0,!0)},hideSubMenu:function(){this.subMenu.hide()}},e.inherits(d,i),e.extend(d.prototype,r,!0)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.uiUtils,n=baidu.editor.ui.Menu,i=baidu.editor.ui.SplitButton,o=baidu.editor.ui.Combox=function(e){this.initOptions(e),this.initCombox()};o.prototype={uiName:"combox",onbuttonclick:function(){this.showPopup()},initCombox:function(){var e=this;this.items=this.items||[];for(var t=0;t<this.items.length;t++){var i=this.items[t];i.uiName="listitem",i.index=t,i.onclick=function(){e.selectByIndex(this.index)}}this.popup=new n({items:this.items,uiName:"list",editor:this.editor,captureWheel:!0,combox:this}),this.initSplitButton()},_SplitButton_postRender:i.prototype.postRender,postRender:function(){this._SplitButton_postRender(),this.setLabel(this.label||""),this.setValue(this.initValue||"")},showPopup:function(){var e=t.getClientRect(this.getDom());e.top+=1,e.bottom-=1,e.height-=2,this.popup.showAnchorRect(e)},getValue:function(){return this.value},setValue:function(e){var t=this.indexByValue(e);-1!=t?(this.selectedIndex=t,this.setLabel(this.items[t].label),this.value=this.items[t].value):(this.selectedIndex=-1,this.setLabel(this.getLabelForUnknowValue(e)),this.value=e)},setLabel:function(e){this.getDom("button_body").innerHTML=e,this.label=e},getLabelForUnknowValue:function(e){return e},indexByValue:function(e){for(var t=0;t<this.items.length;t++)if(e==this.items[t].value)return t;return-1},getItem:function(e){return this.items[e]},selectByIndex:function(e){e<this.items.length&&!1!==this.fireEvent("select",e)&&(this.selectedIndex=e,this.value=this.items[e].value,this.setLabel(this.items[e].label))}},e.inherits(o,i)}(),function(){var e,t,n,i=baidu.editor.utils,o=baidu.editor.dom.domUtils,r=baidu.editor.ui.uiUtils,a=baidu.editor.ui.Mask,s=baidu.editor.ui.UIBase,l=baidu.editor.ui.Button,d=baidu.editor.ui.Dialog=function(e){if(e.name){var t=e.name,n=e.cssRules;e.className||(e.className="edui-for-"+t),n&&(e.cssRules=".edui-default .edui-for-"+t+" .edui-dialog-content  {"+n+"}")}this.initOptions(i.extend({autoReset:!0,draggable:!0,onok:function(){},oncancel:function(){},onclose:function(e,t){return t?this.onok():this.oncancel()},holdScroll:!1},e)),this.initDialog()};d.prototype={draggable:!1,uiName:"dialog",initDialog:function(){var o=this,r=this.editor.options.theme;if(this.cssRules&&i.cssRule("edui-customize-"+this.name+"-style",this.cssRules),this.initUIBase(),this.modalMask=e||(e=new a({className:"edui-dialog-modalmask",theme:r,onclick:function(){n&&n.close(!1)}})),this.dragMask=t||(t=new a({className:"edui-dialog-dragmask",theme:r})),this.closeButton=new l({className:"edui-dialog-closebutton",title:o.closeDialog,theme:r,onclick:function(){o.close(!1)}}),this.fullscreen&&this.initResizeEvent(),this.buttons)for(var s=0;s<this.buttons.length;s++)this.buttons[s]instanceof l||(this.buttons[s]=new l(i.extend(this.buttons[s],{editor:this.editor},!0)))},initResizeEvent:function(){var e=this;o.on(window,"resize",function(){e._hidden||void 0===e._hidden||(e.__resizeTimer&&window.clearTimeout(e.__resizeTimer),e.__resizeTimer=window.setTimeout(function(){e.__resizeTimer=null;var t=e.getDom(),n=e.getDom("content"),i=UE.ui.uiUtils.getClientRect(t),o=UE.ui.uiUtils.getClientRect(n),a=r.getViewportRect();n.style.width=a.width-i.width+o.width+"px",n.style.height=a.height-i.height+o.height+"px",t.style.width=a.width+"px",t.style.height=a.height+"px",e.fireEvent("resize")},100))})},fitSize:function(){var e=this.getDom("body"),t=this.mesureSize();return e.style.width=t.width+"px",e.style.height=t.height+"px",t},safeSetOffset:function(e){var t=this,n=t.getDom(),i=r.getViewportRect(),o=r.getClientRect(n),a=e.left;a+o.width>i.right&&(a=i.right-o.width);var s=e.top;s+o.height>i.bottom&&(s=i.bottom-o.height),n.style.left=Math.max(a,0)+"px",n.style.top=Math.max(s,0)+"px"},showAtCenter:function(){var e=r.getViewportRect();if(this.fullscreen){var t=this.getDom(),n=this.getDom("content");t.style.display="block";var i=UE.ui.uiUtils.getClientRect(t),a=UE.ui.uiUtils.getClientRect(n);t.style.left="-100000px",n.style.width=e.width-i.width+a.width+"px",n.style.height=e.height-i.height+a.height+"px",t.style.width=e.width+"px",t.style.height=e.height+"px",t.style.left=0,this._originalContext={html:{overflowX:document.documentElement.style.overflowX,overflowY:document.documentElement.style.overflowY},body:{overflowX:document.body.style.overflowX,overflowY:document.body.style.overflowY}},document.documentElement.style.overflowX="hidden",document.documentElement.style.overflowY="hidden",document.body.style.overflowX="hidden",document.body.style.overflowY="hidden"}else{this.getDom().style.display="";var s=this.fitSize(),l=0|this.getDom("titlebar").offsetHeight,d=e.width/2-s.width/2,c=e.height/2-(s.height-l)/2-l,u=this.getDom();this.safeSetOffset({left:Math.max(0|d,0),top:Math.max(0|c,0)}),o.hasClass(u,"edui-state-centered")||(u.className+=" edui-state-centered")}this._show()},getContentHtml:function(){var e="";return"string"==typeof this.content?e=this.content:this.iframeUrl&&(e='<span id="'+this.id+'_contmask" class="dialogcontmask"></span><iframe id="'+this.id+'_iframe" class="%%-iframe" height="100%" width="100%" frameborder="0" src="'+this.iframeUrl+'"></iframe>'),e},getHtmlTpl:function(){var e="";if(this.buttons){for(var t=[],n=0;n<this.buttons.length;n++)t[n]=this.buttons[n].renderHtml();e='<div class="%%-foot"><div id="##_buttons" class="%%-buttons">'+t.join("")+"</div></div>"}return'<div id="##" class="%%"><div '+(this.fullscreen?'class="%%-wrap edui-dialog-fullscreen-flag"':'class="%%"')+'><div id="##_body" class="%%-body"><div class="%%-shadow"></div><div id="##_titlebar" class="%%-titlebar"><div class="%%-draghandle" onmousedown="$$._onTitlebarMouseDown(event, this);"><span class="%%-caption">'+(this.title||"")+"</span></div>"+this.closeButton.renderHtml()+'</div><div id="##_content" class="%%-content">'+(this.autoReset?"":this.getContentHtml())+"</div>"+e+"</div></div></div>"},postRender:function(){this.modalMask.getDom()||(this.modalMask.render(),this.modalMask.hide()),this.dragMask.getDom()||(this.dragMask.render(),this.dragMask.hide());var e=this;if(this.addListener("show",function(){e.modalMask.show(this.getDom().style.zIndex-2)}),this.addListener("hide",function(){e.modalMask.hide()}),this.buttons)for(var t=0;t<this.buttons.length;t++)this.buttons[t].postRender();o.on(window,"resize",function(){setTimeout(function(){e.isHidden()||e.safeSetOffset(r.getClientRect(e.getDom()))})}),this._hide()},mesureSize:function(){var e=this.getDom("body"),t=r.getClientRect(this.getDom("content")).width;return e.style.width=t,r.getClientRect(e)},_onTitlebarMouseDown:function(e,t){if(this.draggable){var n,i=(r.getViewportRect(),this);r.startDrag(e,{ondragstart:function(){n=r.getClientRect(i.getDom()),i.getDom("contmask").style.visibility="visible",i.dragMask.show(i.getDom().style.zIndex-1)},ondragmove:function(e,t){var o=n.left+e,r=n.top+t;i.safeSetOffset({left:o,top:r})},ondragstop:function(){i.getDom("contmask").style.visibility="hidden",o.removeClasses(i.getDom(),["edui-state-centered"]),i.dragMask.hide()}})}},reset:function(){this.getDom("content").innerHTML=this.getContentHtml(),this.fireEvent("dialogafterreset")},_show:function(){this._hidden&&(this.getDom().style.display="",this.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*this.editor.container.style.zIndex+10),this._hidden=!1,this.fireEvent("show"),baidu.editor.ui.uiUtils.getFixedLayer().style.zIndex=this.getDom().style.zIndex-4)},isHidden:function(){return this._hidden},_hide:function(){if(!this._hidden){var e=this.getDom();e.style.display="none",e.style.zIndex="",e.style.width="",e.style.height="",this._hidden=!0,this.fireEvent("hide")}},open:function(){if(this.autoReset)try{this.reset()}catch(e){this.render(),this.open()}if(this.showAtCenter(),this.iframeUrl)try{this.getDom("iframe").focus()}catch(e){}n=this},_onCloseButtonClick:function(e,t){this.close(!1)},close:function(e){if(!1!==this.fireEvent("close",e)){this.fullscreen&&(document.documentElement.style.overflowX=this._originalContext.html.overflowX,document.documentElement.style.overflowY=this._originalContext.html.overflowY,document.body.style.overflowX=this._originalContext.body.overflowX,document.body.style.overflowY=this._originalContext.body.overflowY,delete this._originalContext),this._hide();var t=this.getDom("content"),n=this.getDom("iframe");if(t&&n){var i=n.contentDocument||n.contentWindow.document;i&&(i.body.innerHTML=""),o.remove(t)}}}},i.inherits(d,s)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Menu,n=baidu.editor.ui.SplitButton,i=baidu.editor.ui.MenuButton=function(e){this.initOptions(e),this.initMenuButton()};i.prototype={initMenuButton:function(){var e=this;this.uiName="menubutton",this.popup=new t({items:e.items,className:e.className,editor:e.editor}),this.popup.addListener("show",function(){for(var t=this,n=0;n<t.items.length;n++)t.items[n].removeState("checked"),t.items[n].value==e._value&&(t.items[n].addState("checked"),this.value=e._value)}),this.initSplitButton()},setValue:function(e){this._value=e}},e.inherits(i,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.Popup,n=baidu.editor.ui.SplitButton,i=baidu.editor.ui.MultiMenuPop=function(e){this.initOptions(e),this.initMultiMenu()};i.prototype={initMultiMenu:function(){var e=this;this.popup=new t({content:"",editor:e.editor,iframe_rendered:!1,onshow:function(){this.iframe_rendered||(this.iframe_rendered=!0,this.getDom("content").innerHTML='<iframe id="'+e.id+'_iframe" src="'+e.iframeUrl+'" frameborder="0"></iframe>',e.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*e.editor.container.style.zIndex+1))}}),this.onbuttonclick=function(){this.showPopup()},this.initSplitButton()}},e.inherits(i,n)}(),function(){function e(e){var t=e.target||e.srcElement;if(!a.findParent(t,function(e){return a.hasClass(e,"edui-shortcutmenu")||a.hasClass(e,"edui-popup")},!0))for(var n,i=0;n=s[i++];)n.hide()}var t,n=baidu.editor.ui,i=n.UIBase,o=n.uiUtils,r=baidu.editor.utils,a=baidu.editor.dom.domUtils,s=[],l=!1,d=n.ShortCutMenu=function(e){this.initOptions(e),this.initShortCutMenu()};d.postHide=e,d.prototype={isHidden:!0,SPACE:5,initShortCutMenu:function(){this.items=this.items||[],this.initUIBase(),this.initItems(),this.initEvent(),s.push(this)},initEvent:function(){var e=this,n=e.editor.document;a.on(n,"mousemove",function(n){if(!1===e.isHidden){if(e.getSubMenuMark()||"contextmenu"==e.eventType)return;var i=!0,o=e.getDom(),r=o.offsetWidth,a=o.offsetHeight,s=r/2+e.SPACE,l=a/2,d=Math.abs(n.screenX-e.left),c=Math.abs(n.screenY-e.top);clearTimeout(t),t=setTimeout(function(){c>0&&c<l?e.setOpacity(o,"1"):c>l&&c<l+70?(e.setOpacity(o,"0.5"),i=!1):c>l+70&&c<l+140&&e.hide(),i&&d>0&&d<s?e.setOpacity(o,"1"):d>s&&d<s+70?e.setOpacity(o,"0.5"):d>s+70&&d<s+140&&e.hide()})}}),browser.chrome&&a.on(n,"mouseout",function(t){var n=t.relatedTarget||t.toElement;null!=n&&"HTML"!=n.tagName||e.hide()}),e.editor.addListener("afterhidepop",function(){e.isHidden||(l=!0)})},initItems:function(){if(r.isArray(this.items))for(var e=0,t=this.items.length;e<t;e++){var i=this.items[e].toLowerCase();n[i]&&(this.items[e]=new n[i](this.editor),this.items[e].className+=" edui-shortcutsubmenu ")}},setOpacity:function(e,t){browser.ie&&browser.version<9?e.style.filter="alpha(opacity = "+100*parseFloat(t)+");":e.style.opacity=t},getSubMenuMark:function(){l=!1;for(var e,t=o.getFixedLayer(),n=a.getElementsByTagName(t,"div",function(e){return a.hasClass(e,"edui-shortcutsubmenu edui-popup")}),i=0;e=n[i++];)"none"!=e.style.display&&(l=!0);return l},show:function(e,t){function n(e){e.left<0&&(e.left=0),e.top<0&&(e.top=0),l.style.cssText="position:absolute;left:"+e.left+"px;top:"+e.top+"px;"}function i(e){e.tagName||(e=e.getDom()),s.left=parseInt(e.style.left),s.top=parseInt(e.style.top),s.top-=l.offsetHeight+15,n(s)}var r=this,s={},l=this.getDom(),d=o.getFixedLayer();if(r.eventType=e.type,l.style.cssText="display:block;left:-9999px","contextmenu"==e.type&&t){var c=a.getElementsByTagName(d,"div","edui-contextmenu")[0];c?i(c):r.editor.addListener("aftershowcontextmenu",function(e,t){i(t)})}else s=o.getViewportOffsetByEvent(e),s.top-=l.offsetHeight+r.SPACE,s.left+=r.SPACE+20,n(s),r.setOpacity(l,.2);r.isHidden=!1,r.left=e.screenX+l.offsetWidth/2-r.SPACE,r.top=e.screenY-l.offsetHeight/2-r.SPACE,r.editor&&(l.style.zIndex=1*r.editor.container.style.zIndex+10,d.style.zIndex=l.style.zIndex-1)},hide:function(){this.getDom()&&(this.getDom().style.display="none"),this.isHidden=!0},postRender:function(){if(r.isArray(this.items))for(var e,t=0;e=this.items[t++];)e.postRender()},getHtmlTpl:function(){var e;if(r.isArray(this.items)){e=[];for(var t=0;t<this.items.length;t++)e[t]=this.items[t].renderHtml();e=e.join("")}else e=this.items;return'<div id="##" class="%% edui-toolbar" data-src="shortcutmenu" onmousedown="return false;" onselectstart="return false;" >'+e+"</div>"}},r.inherits(d,i),a.on(document,"mousedown",function(t){e(t)}),a.on(window,"scroll",function(t){e(t)})}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui.UIBase,n=baidu.editor.ui.Breakline=function(e){this.initOptions(e),this.initSeparator()};n.prototype={uiName:"Breakline",initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return"<br/>"}},e.inherits(n,t)}(),function(){var e=baidu.editor.utils,t=baidu.editor.dom.domUtils,n=baidu.editor.ui.UIBase,i=baidu.editor.ui.Message=function(e){this.initOptions(e),this.initMessage()};i.prototype={initMessage:function(){this.initUIBase()},getHtmlTpl:function(){return'<div id="##" class="edui-message %%"> <div id="##_closer" class="edui-message-closer">×</div> <div id="##_body" class="edui-message-body edui-message-type-info"> <iframe style="position:absolute;z-index:-1;left:0;top:0;background-color: transparent;" frameborder="0" width="100%" height="100%" src="about:blank"></iframe> <div class="edui-shadow"></div> <div id="##_content" class="edui-message-content">  </div> </div></div>'},reset:function(e){var t=this;e.keepshow||(clearTimeout(this.timer),t.timer=setTimeout(function(){t.hide()},e.timeout||4e3)),void 0!==e.content&&t.setContent(e.content),void 0!==e.type&&t.setType(e.type),t.show()},postRender:function(){var e=this,n=this.getDom("closer");n&&t.on(n,"click",function(){e.hide()})},setContent:function(e){this.getDom("content").innerHTML=e},setType:function(e){e=e||"info";var t=this.getDom("body");t.className=t.className.replace(/edui-message-type-[\w-]+/,"edui-message-type-"+e)},getContent:function(){return this.getDom("content").innerHTML},getType:function(){var e=this.getDom("body").match(/edui-message-type-([\w-]+)/);return e?e[1]:""},show:function(){this.getDom().style.display="block"},hide:function(){var e=this.getDom();e&&(e.style.display="none",e.parentNode&&e.parentNode.removeChild(e))}},e.inherits(i,n)}(),function(){var e=baidu.editor.utils,t=baidu.editor.ui,n=t.Dialog;t.buttons={},t.Dialog=function(e){var t=new n(e);return t.addListener("hide",function(){if(t.editor){var e=t.editor;try{if(browser.gecko){var n=e.window.scrollY,i=e.window.scrollX;e.body.focus(),e.window.scrollTo(i,n)}else e.focus()}catch(e){}}}),t};for(var i,o={anchor:"~/dialogs/anchor/anchor.html",insertimage:"~/dialogs/image/image.html",link:"~/dialogs/link/link.html",spechars:"~/dialogs/spechars/spechars.html",searchreplace:"~/dialogs/searchreplace/searchreplace.html",map:"~/dialogs/map/map.html",gmap:"~/dialogs/gmap/gmap.html",insertvideo:"~/dialogs/video/video.html",help:"~/dialogs/help/help.html",preview:"~/dialogs/preview/preview.html",emotion:"~/dialogs/emotion/emotion.html",wordimage:"~/dialogs/wordimage/wordimage.html",attachment:"~/dialogs/attachment/attachment.html",insertframe:"~/dialogs/insertframe/insertframe.html",edittip:"~/dialogs/table/edittip.html",edittable:"~/dialogs/table/edittable.html",edittd:"~/dialogs/table/edittd.html",webapp:"~/dialogs/webapp/webapp.html",snapscreen:"~/dialogs/snapscreen/snapscreen.html",scrawl:"~/dialogs/scrawl/scrawl.html",music:"~/dialogs/music/music.html",template:"~/dialogs/template/template.html",background:"~/dialogs/background/background.html",charts:"~/dialogs/charts/charts.html"},r=["undo","redo","formatmatch","bold","italic","underline","fontborder","touppercase","tolowercase","strikethrough","subscript","superscript","source","indent","outdent","blockquote","pasteplain","pagebreak","selectall","print","horizontal","removeformat","time","date","unlink","insertparagraphbeforetable","insertrow","insertcol","mergeright","mergedown","deleterow","deletecol","splittorows","splittocols","splittocells","mergecells","deletetable","drafts","hdimage"],a=0;i=r[a++];)i=i.toLowerCase(),t[i]=function(e){return function(n){var i=new t.Button({className:"edui-for-"+e,title:n.options.labelMap[e]||n.getLang("labelMap."+e)||"",onclick:function(){n.execCommand(e)},theme:n.options.theme,showText:!1});return t.buttons[e]=i,n.addListener("selectionchange",function(t,o,r){var a=n.queryCommandState(e);-1==a?(i.setDisabled(!0),i.setChecked(!1)):r||(i.setDisabled(!1),i.setChecked(a))}),i}}(i);t.cleardoc=function(e){var n=new t.Button({className:"edui-for-cleardoc",title:e.options.labelMap.cleardoc||e.getLang("labelMap.cleardoc")||"",theme:e.options.theme,onclick:function(){confirm(e.getLang("confirmClear"))&&e.execCommand("cleardoc")}});return t.buttons.cleardoc=n,e.addListener("selectionchange",function(){n.setDisabled(-1==e.queryCommandState("cleardoc"))}),n};var s={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]};for(var l in s)!function(e,n){for(var i,o=0;i=n[o++];)!function(n){t[e.replace("float","")+n]=function(i){var o=new t.Button({className:"edui-for-"+e.replace("float","")+n,title:i.options.labelMap[e.replace("float","")+n]||i.getLang("labelMap."+e.replace("float","")+n)||"",theme:i.options.theme,onclick:function(){i.execCommand(e,n)}});return t.buttons[e]=o,i.addListener("selectionchange",function(t,r,a){o.setDisabled(-1==i.queryCommandState(e)),o.setChecked(i.queryCommandValue(e)==n&&!a)}),o}}(i)}(l,s[l]);for(var i,a=0;i=["backcolor","forecolor"][a++];)t[i]=function(e){return function(n){var i=new t.ColorButton({className:"edui-for-"+e,color:"default",title:n.options.labelMap[e]||n.getLang("labelMap."+e)||"",editor:n,onpickcolor:function(t,i){n.execCommand(e,i)},onpicknocolor:function(){n.execCommand(e,"default"),this.setColor("transparent"),this.color="default"},onbuttonclick:function(){n.execCommand(e,this.color)}});return t.buttons[e]=i,n.addListener("selectionchange",function(){i.setDisabled(-1==n.queryCommandState(e))}),i}}(i);var d={noOk:["searchreplace","help","spechars","webapp","preview"],ok:["attachment","anchor","link","insertimage","map","gmap","insertframe","wordimage","insertvideo","insertframe","edittip","edittable","edittd","scrawl","template","music","background","charts"]};for(var l in d)!function(n,i){for(var r,a=0;r=i[a++];)browser.opera&&"searchreplace"===r||function(i){t[i]=function(r,a,s){a=a||(r.options.iframeUrlMap||{})[i]||o[i],s=r.options.labelMap[i]||r.getLang("labelMap."+i)||"";var l;a&&(l=new t.Dialog(e.extend({iframeUrl:r.ui.mapUrl(a),editor:r,className:"edui-for-"+i,title:s,holdScroll:"insertimage"===i,fullscreen:/charts|preview/.test(i),closeDialog:r.getLang("closeDialog")},"ok"==n?{buttons:[{className:"edui-okbutton",label:r.getLang("ok"),editor:r,onclick:function(){l.close(!0)}},{className:"edui-cancelbutton",label:r.getLang("cancel"),editor:r,onclick:function(){l.close(!1)}}]}:{})),r.ui._dialogs[i+"Dialog"]=l);var d=new t.Button({className:"edui-for-"+i,title:s,onclick:function(){if(l)switch(i){case"wordimage":var e=r.execCommand("wordimage");e&&e.length&&(l.render(),l.open());break;case"scrawl":-1!=r.queryCommandState("scrawl")&&(l.render(),l.open());break;default:l.render(),l.open()}},theme:r.options.theme,disabled:"scrawl"==i&&-1==r.queryCommandState("scrawl")||"charts"==i});return t.buttons[i]=d,r.addListener("selectionchange",function(){if(!(i in{edittable:1})){var e=r.queryCommandState(i);d.getDom()&&(d.setDisabled(-1==e),d.setChecked(e))}}),d}}(r.toLowerCase())}(l,d[l]);t.snapscreen=function(e,n,i){i=e.options.labelMap.snapscreen||e.getLang("labelMap.snapscreen")||"";var r=new t.Button({className:"edui-for-snapscreen",title:i,onclick:function(){e.execCommand("snapscreen")},theme:e.options.theme});if(t.buttons.snapscreen=r,n=n||(e.options.iframeUrlMap||{}).snapscreen||o.snapscreen){var a=new t.Dialog({iframeUrl:e.ui.mapUrl(n),editor:e,className:"edui-for-snapscreen",title:i,buttons:[{className:"edui-okbutton",label:e.getLang("ok"),editor:e,onclick:function(){a.close(!0)}},{className:"edui-cancelbutton",label:e.getLang("cancel"),editor:e,onclick:function(){a.close(!1)}}]});a.render(),e.ui._dialogs.snapscreenDialog=a}return e.addListener("selectionchange",function(){r.setDisabled(-1==e.queryCommandState("snapscreen"))}),r},t.insertcode=function(n,i,o){i=n.options.insertcode||[],o=n.options.labelMap.insertcode||n.getLang("labelMap.insertcode")||"";var r=[];e.each(i,function(e,t){r.push({label:e,value:t,theme:n.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" >'+(this.label||"")+"</div>"}})});var a=new t.Combox({editor:n,items:r,onselect:function(e,t){n.execCommand("insertcode",this.items[t].value)},onbuttonclick:function(){this.showPopup()},title:o,initValue:o,className:"edui-for-insertcode",indexByValue:function(e){if(e)for(var t,n=0;t=this.items[n];n++)if(-1!=t.value.indexOf(e))return n;return-1}});return t.buttons.insertcode=a,n.addListener("selectionchange",function(e,t,i){if(!i){if(-1==n.queryCommandState("insertcode"))a.setDisabled(!0);else{a.setDisabled(!1);var r=n.queryCommandValue("insertcode");if(!r)return void a.setValue(o);r&&(r=r.replace(/['"]/g,"").split(",")[0]),a.setValue(r)}}}),a},t.fontfamily=function(n,i,o){if(i=n.options.fontfamily||[],o=n.options.labelMap.fontfamily||n.getLang("labelMap.fontfamily")||"",i.length){for(var r,a=0,s=[];r=i[a];a++){var l=n.getLang("fontfamily")[r.name]||"";!function(t,i){s.push({label:t,value:i,theme:n.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="font-family:'+e.unhtml(this.value)+'">'+(this.label||"")+"</div>"}})}(r.label||l,r.val)}var d=new t.Combox({editor:n,items:s,onselect:function(e,t){n.execCommand("FontFamily",this.items[t].value)},onbuttonclick:function(){this.showPopup()},title:o,initValue:o,className:"edui-for-fontfamily",indexByValue:function(e){if(e)for(var t,n=0;t=this.items[n];n++)if(-1!=t.value.indexOf(e))return n;return-1}});return t.buttons.fontfamily=d,n.addListener("selectionchange",function(e,t,i){if(!i){if(-1==n.queryCommandState("FontFamily"))d.setDisabled(!0);else{d.setDisabled(!1);var o=n.queryCommandValue("FontFamily");o&&(o=o.replace(/['"]/g,"").split(",")[0]),d.setValue(o)}}}),d}},t.fontsize=function(e,n,i){if(i=e.options.labelMap.fontsize||e.getLang("labelMap.fontsize")||"",n=n||e.options.fontsize||[],n.length){for(var o=[],r=0;r<n.length;r++){var a=n[r]+"px";o.push({label:a,value:a,theme:e.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="line-height:1;font-size:'+this.value+'">'+(this.label||"")+"</div>"}})}var s=new t.Combox({editor:e,items:o,title:i,initValue:i,onselect:function(t,n){e.execCommand("FontSize",this.items[n].value)},onbuttonclick:function(){this.showPopup()},className:"edui-for-fontsize"});return t.buttons.fontsize=s,e.addListener("selectionchange",function(t,n,i){if(!i){-1==e.queryCommandState("FontSize")?s.setDisabled(!0):(s.setDisabled(!1),s.setValue(e.queryCommandValue("FontSize")))}}),s}},t.paragraph=function(n,i,o){if(o=n.options.labelMap.paragraph||n.getLang("labelMap.paragraph")||"",i=n.options.paragraph||[],!e.isEmptyObject(i)){var r=[];for(var a in i)r.push({value:a,label:i[a]||n.getLang("paragraph")[a],theme:n.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><span class="edui-for-'+this.value+'">'+(this.label||"")+"</span></div>"}});var s=new t.Combox({editor:n,items:r,title:o,initValue:o,className:"edui-for-paragraph",onselect:function(e,t){n.execCommand("Paragraph",this.items[t].value)},onbuttonclick:function(){this.showPopup()}});return t.buttons.paragraph=s,n.addListener("selectionchange",function(e,t,i){if(!i){if(-1==n.queryCommandState("Paragraph"))s.setDisabled(!0);else{s.setDisabled(!1);var o=n.queryCommandValue("Paragraph");-1!=s.indexByValue(o)?s.setValue(o):s.setValue(s.initValue)}}}),s}},t.customstyle=function(e){var n=e.options.customstyle||[],i=e.options.labelMap.customstyle||e.getLang("labelMap.customstyle")||"";if(n.length){for(var o,r=e.getLang("customstyle"),a=0,s=[];o=n[a++];)!function(t){var n={};n.label=t.label?t.label:r[t.name],n.style=t.style,n.className=t.className,n.tag=t.tag,s.push({label:n.label,value:n,theme:e.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><'+n.tag+" "+(n.className?' class="'+n.className+'"':"")+(n.style?' style="'+n.style+'"':"")+">"+n.label+"</"+n.tag+"></div>"}})}(o);var l=new t.Combox({editor:e,items:s,title:i,initValue:i,className:"edui-for-customstyle",onselect:function(t,n){e.execCommand("customstyle",this.items[n].value)},onbuttonclick:function(){this.showPopup()},indexByValue:function(e){for(var t,n=0;t=this.items[n++];)if(t.label==e)return n-1;return-1}});return t.buttons.customstyle=l,e.addListener("selectionchange",function(t,n,i){if(!i){if(-1==e.queryCommandState("customstyle"))l.setDisabled(!0);else{l.setDisabled(!1);var o=e.queryCommandValue("customstyle");-1!=l.indexByValue(o)?l.setValue(o):l.setValue(l.initValue)}}}),l}},t.inserttable=function(e,n,i){i=e.options.labelMap.inserttable||e.getLang("labelMap.inserttable")||"";var o=new t.TableButton({editor:e,title:i,className:"edui-for-inserttable",onpicktable:function(t,n,i){e.execCommand("InsertTable",{numRows:i,numCols:n,border:1})},onbuttonclick:function(){this.showPopup()}});return t.buttons.inserttable=o,e.addListener("selectionchange",function(){o.setDisabled(-1==e.queryCommandState("inserttable"))}),o},t.lineheight=function(e){var n=e.options.lineheight||[];if(n.length){for(var i,o=0,r=[];i=n[o++];)r.push({label:i,value:i,theme:e.options.theme,onclick:function(){e.execCommand("lineheight",this.value)}});var a=new t.MenuButton({editor:e,className:"edui-for-lineheight",title:e.options.labelMap.lineheight||e.getLang("labelMap.lineheight")||"",items:r,onbuttonclick:function(){var t=e.queryCommandValue("LineHeight")||this.value;e.execCommand("LineHeight",t)}});return t.buttons.lineheight=a,e.addListener("selectionchange",function(){var t=e.queryCommandState("LineHeight");if(-1==t)a.setDisabled(!0);else{a.setDisabled(!1);var n=e.queryCommandValue("LineHeight");n&&a.setValue((n+"").replace(/cm/,"")),a.setChecked(t)}}),a}};for(var c,u=["top","bottom"],m=0;c=u[m++];)!function(e){t["rowspacing"+e]=function(n){var i=n.options["rowspacing"+e]||[];if(!i.length)return null;for(var o,r=0,a=[];o=i[r++];)a.push({label:o,value:o,theme:n.options.theme,onclick:function(){n.execCommand("rowspacing",this.value,e)}});var s=new t.MenuButton({editor:n,className:"edui-for-rowspacing"+e,title:n.options.labelMap["rowspacing"+e]||n.getLang("labelMap.rowspacing"+e)||"",items:a,onbuttonclick:function(){var t=n.queryCommandValue("rowspacing",e)||this.value;n.execCommand("rowspacing",t,e)}});return t.buttons[e]=s,n.addListener("selectionchange",function(){var t=n.queryCommandState("rowspacing",e);if(-1==t)s.setDisabled(!0);else{s.setDisabled(!1);var i=n.queryCommandValue("rowspacing",e);i&&s.setValue((i+"").replace(/%/,"")),s.setChecked(t)}}),s}}(c);for(var f,h=["insertorderedlist","insertunorderedlist"],p=0;f=h[p++];)!function(e){t[e]=function(n){var i=n.options[e],o=function(){n.execCommand(e,this.value)},r=[];for(var a in i)r.push({label:i[a]||n.getLang()[e][a]||"",value:a,theme:n.options.theme,onclick:o});var s=new t.MenuButton({editor:n,className:"edui-for-"+e,title:n.getLang("labelMap."+e)||"",items:r,onbuttonclick:function(){var t=n.queryCommandValue(e)||this.value;n.execCommand(e,t)}});return t.buttons[e]=s,n.addListener("selectionchange",function(){var t=n.queryCommandState(e);if(-1==t)s.setDisabled(!0);else{s.setDisabled(!1);var i=n.queryCommandValue(e);s.setValue(i),s.setChecked(t)}}),s}}(f);t.fullscreen=function(e,n){n=e.options.labelMap.fullscreen||e.getLang("labelMap.fullscreen")||"";var i=new t.Button({className:"edui-for-fullscreen",title:n,theme:e.options.theme,onclick:function(){e.ui&&e.ui.setFullScreen(!e.ui.isFullScreen()),this.setChecked(e.ui.isFullScreen())}});return t.buttons.fullscreen=i,e.addListener("selectionchange",function(){var t=e.queryCommandState("fullscreen");i.setDisabled(-1==t),i.setChecked(e.ui.isFullScreen())}),i},t.emotion=function(e,n){var i="emotion",r=new t.MultiMenuPop({title:e.options.labelMap[i]||e.getLang("labelMap."+i)||"",editor:e,className:"edui-for-"+i,iframeUrl:e.ui.mapUrl(n||(e.options.iframeUrlMap||{})[i]||o[i])});return t.buttons[i]=r,e.addListener("selectionchange",function(){r.setDisabled(-1==e.queryCommandState(i))}),r},t.autotypeset=function(e){var n=new t.AutoTypeSetButton({editor:e,title:e.options.labelMap.autotypeset||e.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){e.execCommand("autotypeset")}});return t.buttons.autotypeset=n,e.addListener("selectionchange",function(){n.setDisabled(-1==e.queryCommandState("autotypeset"))}),n},t.simpleupload=function(e){var n="simpleupload",i=new t.Button({className:"edui-for-"+n,title:e.options.labelMap[n]||e.getLang("labelMap."+n)||"",onclick:function(){},theme:e.options.theme,showText:!1});return t.buttons[n]=i,e.addListener("ready",function(){var t=i.getDom("body"),n=t.children[0];e.fireEvent("simpleuploadbtnready",n)}),e.addListener("selectionchange",function(t,o,r){var a=e.queryCommandState(n);-1==a?(i.setDisabled(!0),i.setChecked(!1)):r||(i.setDisabled(!1),i.setChecked(a))}),i}}(),function(){function e(e){this.initOptions(e),this.initEditorUI()}var t=baidu.editor.utils,n=baidu.editor.ui.uiUtils,i=baidu.editor.ui.UIBase,o=baidu.editor.dom.domUtils,r=[];e.prototype={uiName:"editor",initEditorUI:function(){function e(e,t){e.setOpt({wordCount:!0,maximumWords:1e4,wordCountMsg:e.options.wordCountMsg||e.getLang("wordCountMsg"),wordOverFlowMsg:e.options.wordOverFlowMsg||e.getLang("wordOverFlowMsg")});var n=e.options,i=n.maximumWords,o=n.wordCountMsg,r=n.wordOverFlowMsg,a=t.getDom("wordcount");if(n.wordCount){var s=e.getContentLength(!0);s>i?(a.innerHTML=r,e.fireEvent("wordcountoverflow")):a.innerHTML=o.replace("{#leave}",i-s).replace("{#count}",s)}}this.editor.ui=this,this._dialogs={},this.initUIBase(),this._initToolbars();var t=this.editor,n=this;t.addListener("ready",function(){if(t.getDialog=function(e){return t.ui._dialogs[e+"Dialog"]},o.on(t.window,"scroll",function(e){baidu.editor.ui.Popup.postHide(e)}),t.ui._actualFrameWidth=t.options.initialFrameWidth,UE.browser.ie&&6===UE.browser.version&&t.container.ownerDocument.execCommand("BackgroundImageCache",!1,!0),t.options.elementPathEnabled&&(t.ui.getDom("elementpath").innerHTML='<div class="edui-editor-breadcrumb">'+t.getLang("elementPathTip")+":</div>"),t.options.wordCount){var i=function(){e(t,n),o.un(t.document,"click",arguments.callee)};o.on(t.document,"click",i),t.ui.getDom("wordcount").innerHTML=t.getLang("wordCountTip")}t.ui._scale(),t.options.scaleEnabled?(t.autoHeightEnabled&&t.disableAutoHeight(),n.enableScale()):n.disableScale(),t.options.elementPathEnabled||t.options.wordCount||t.options.scaleEnabled||(t.ui.getDom("elementpath").style.display="none",t.ui.getDom("wordcount").style.display="none",t.ui.getDom("scale").style.display="none"),t.selection.isFocus()&&t.fireEvent("selectionchange",!1,!0)}),t.addListener("mousedown",function(e,t){var n=t.target||t.srcElement;baidu.editor.ui.Popup.postHide(t,n),baidu.editor.ui.ShortCutMenu.postHide(t)}),t.addListener("delcells",function(){UE.ui.edittip&&new UE.ui.edittip(t),t.getDialog("edittip").open()});var i,r,a=!1;t.addListener("afterpaste",function(){t.queryCommandState("pasteplain")||(baidu.editor.ui.PastePicker&&(i=new baidu.editor.ui.Popup({content:new baidu.editor.ui.PastePicker({editor:t}),editor:t,className:"edui-wordpastepop"}),i.render()),a=!0)}),t.addListener("afterinserthtml",function(){clearTimeout(r),r=setTimeout(function(){if(i&&(a||t.ui._isTransfer)){if(i.isHidden()){var e=o.createElement(t.document,"span",{style:"line-height:0px;",innerHTML:"\ufeff"});t.selection.getRange().insertNode(e);var n=getDomNode(e,"firstChild","previousSibling");n&&i.showAnchor(3==n.nodeType?n.parentNode:n),o.remove(e)}else i.show();delete t.ui._isTransfer,a=!1}},200)}),t.addListener("contextmenu",function(e,t){baidu.editor.ui.Popup.postHide(t)}),t.addListener("keydown",function(e,t){i&&i.dispose(t);var n=t.keyCode||t.which;t.altKey&&90==n&&UE.ui.buttons.fullscreen.onclick()}),t.addListener("wordcount",function(t){e(this,n)}),t.addListener("selectionchange",function(){t.options.elementPathEnabled&&n[(-1==t.queryCommandState("elementpath")?"dis":"en")+"ableElementPath"](),t.options.scaleEnabled&&n[(-1==t.queryCommandState("scale")?"dis":"en")+"ableScale"]()});var s=new baidu.editor.ui.Popup({editor:t,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide(),t.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(e){this.hide(),t.ui._dialogs[e]&&t.ui._dialogs[e].open()},_onImgSetFloat:function(e){this.hide(),t.execCommand("imagefloat",e)},_setIframeAlign:function(e){var t=s.anchorEl,n=t.cloneNode(!0);switch(e){case-2:n.setAttribute("align","");break;case-1:n.setAttribute("align","left");break;case 1:n.setAttribute("align","right")}t.parentNode.insertBefore(n,t),o.remove(t),s.anchorEl=n,s.showAnchor(s.anchorEl)},_updateIframe:function(){var e=t._iframe=s.anchorEl;o.hasClass(e,"ueditor_baidumap")?(t.selection.getRange().selectNode(e).select(),t.ui._dialogs.mapDialog.open(),s.hide()):(t.ui._dialogs.insertframeDialog.open(),s.hide())},_onRemoveButtonClick:function(e){t.execCommand(e),this.hide()},queryAutoHide:function(e){return e&&e.ownerDocument==t.document&&("img"==e.tagName.toLowerCase()||o.findParentByTagName(e,"a",!0))?e!==s.anchorEl:baidu.editor.ui.Popup.prototype.queryAutoHide.call(this,e)}});s.render(),t.options.imagePopup&&(t.addListener("mouseover",function(e,n){n=n||window.event;var i=n.target||n.srcElement;if(t.ui._dialogs.insertframeDialog&&/iframe/gi.test(i.tagName)){var o=s.formatHtml("<nobr>"+t.getLang("property")+': <span onclick=$$._setIframeAlign(-2) class="edui-clickable">'+t.getLang("default")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(-1) class="edui-clickable">'+t.getLang("justifyleft")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(1) class="edui-clickable">'+t.getLang("justifyright")+'</span>&nbsp;&nbsp; <span onclick="$$._updateIframe( this);" class="edui-clickable">'+t.getLang("modify")+"</span></nobr>");o?(s.getDom("content").innerHTML=o,s.anchorEl=i,s.showAnchor(s.anchorEl)):s.hide()}}),t.addListener("selectionchange",function(e,n){if(n){var i="",r="",a=t.selection.getRange().getClosedNode(),l=t.ui._dialogs;if(a&&"IMG"==a.tagName){var d="insertimageDialog";if(-1==a.className.indexOf("edui-faked-video")&&-1==a.className.indexOf("edui-upload-video")||(d="insertvideoDialog"),-1!=a.className.indexOf("edui-faked-webapp")&&(d="webappDialog"),-1!=a.src.indexOf("http://api.map.baidu.com")&&(d="mapDialog"),-1!=a.className.indexOf("edui-faked-music")&&(d="musicDialog"),-1!=a.src.indexOf("http://maps.google.com/maps/api/staticmap")&&(d="gmapDialog"),a.getAttribute("anchorname")&&(d="anchorDialog",i=s.formatHtml("<nobr>"+t.getLang("property")+': <span onclick=$$._onImgEditButtonClick("anchorDialog") class="edui-clickable">'+t.getLang("modify")+"</span>&nbsp;&nbsp;<span onclick=$$._onRemoveButtonClick('anchor') class=\"edui-clickable\">"+t.getLang("delete")+"</span></nobr>")),a.getAttribute("word_img")&&(t.word_img=[a.getAttribute("word_img")],d="wordimageDialog"),(o.hasClass(a,"loadingclass")||o.hasClass(a,"loaderrorclass"))&&(d=""),!l[d])return;r="<nobr>"+t.getLang("property")+': <span onclick=$$._onImgSetFloat("none") class="edui-clickable">'+t.getLang("default")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("left") class="edui-clickable">'+t.getLang("justifyleft")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("right") class="edui-clickable">'+t.getLang("justifyright")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("center") class="edui-clickable">'+t.getLang("justifycenter")+"</span>&nbsp;&nbsp;<span onclick=\"$$._onImgEditButtonClick('"+d+'\');" class="edui-clickable">'+t.getLang("modify")+"</span></nobr>",!i&&(i=s.formatHtml(r))}if(t.ui._dialogs.linkDialog){var c,u=t.queryCommandValue("link");if(u&&(c=u.getAttribute("_href")||u.getAttribute("href",2))){var m=c;c.length>30&&(m=c.substring(0,20)+"..."),i&&(i+='<div style="height:5px;"></div>'),i+=s.formatHtml("<nobr>"+t.getLang("anthorMsg")+': <a target="_blank" href="'+c+'" title="'+c+'" >'+m+'</a> <span class="edui-clickable" onclick="$$._onEditButtonClick();">'+t.getLang("modify")+'</span> <span class="edui-clickable" onclick="$$._onRemoveButtonClick(\'unlink\');"> '+t.getLang("clear")+"</span></nobr>"),s.showAnchor(u)}}i?(s.getDom("content").innerHTML=i,s.anchorEl=a||u,s.showAnchor(s.anchorEl)):s.hide()}}))},_initToolbars:function(){for(var e=this.editor,n=this.toolbars||[],i=[],o=0;o<n.length;o++){for(var r=n[o],a=new baidu.editor.ui.Toolbar({theme:e.options.theme}),s=0;s<r.length;s++){var l=r[s],d=null;if("string"==typeof l){if(l=l.toLowerCase(),"|"==l&&(l="Separator"),"||"==l&&(l="Breakline"),baidu.editor.ui[l]&&(d=new baidu.editor.ui[l](e)),"fullscreen"==l){i&&i[0]?i[0].items.splice(0,0,d):d&&a.items.splice(0,0,d);continue}}else d=l;d&&d.id&&a.add(d)}i[o]=a}t.each(UE._customizeUI,function(t,n){var i,o;if(t.id&&t.id!=e.key)return!1;(i=t.execFn.call(e,e,n))&&(o=t.index,void 0===o&&(o=a.items.length),a.add(i,o))}),this.toolbars=i},getHtmlTpl:function(){return'<div id="##" class="%%"><div id="##_toolbarbox" class="%%-toolbarbox">'+(this.toolbars.length?'<div id="##_toolbarboxouter" class="%%-toolbarboxouter"><div class="%%-toolbarboxinner">'+this.renderToolbarBoxHtml()+"</div></div>":"")+'<div id="##_toolbarmsg" class="%%-toolbarmsg" style="display:none;"><div id = "##_upload_dialog" class="%%-toolbarmsg-upload" onclick="$$.showWordImageDialog();">'+this.editor.getLang("clickToUpload")+'</div><div class="%%-toolbarmsg-close" onclick="$$.hideToolbarMsg();">x</div><div id="##_toolbarmsg_label" class="%%-toolbarmsg-label"></div><div style="height:0;overflow:hidden;clear:both;"></div></div><div id="##_message_holder" class="%%-messageholder"></div></div><div id="##_iframeholder" class="%%-iframeholder"></div><div id="##_bottombar" class="%%-bottomContainer"><table><tr><td id="##_elementpath" class="%%-bottombar"></td><td id="##_wordcount" class="%%-wordcount"></td><td id="##_scale" class="%%-scale"><div class="%%-icon"></div></td></tr></table></div><div id="##_scalelayer"></div></div>'},showWordImageDialog:function(){this._dialogs.wordimageDialog.open()},renderToolbarBoxHtml:function(){for(var e=[],t=0;t<this.toolbars.length;t++)e.push(this.toolbars[t].renderHtml());return e.join("")},setFullScreen:function(e){var t=this.editor,n=t.container.parentNode.parentNode;if(this._fullscreen!=e){if(this._fullscreen=e,this.editor.fireEvent("beforefullscreenchange",e),baidu.editor.browser.gecko)var i=t.selection.getRange().createBookmark();if(e){for(;"BODY"!=n.tagName;){var o=baidu.editor.dom.domUtils.getComputedStyle(n,"position");r.push(o),n.style.position="static",n=n.parentNode}this._bakHtmlOverflow=document.documentElement.style.overflow,this._bakBodyOverflow=document.body.style.overflow,this._bakAutoHeight=this.editor.autoHeightEnabled,this._bakScrollTop=Math.max(document.documentElement.scrollTop,document.body.scrollTop),this._bakEditorContaninerWidth=t.iframe.parentNode.offsetWidth,this._bakAutoHeight&&(t.autoHeightEnabled=!1,this.editor.disableAutoHeight()),document.documentElement.style.overflow="hidden",window.scrollTo(0,window.scrollY),this._bakCssText=this.getDom().style.cssText,this._bakCssText1=this.getDom("iframeholder").style.cssText,t.iframe.parentNode.style.width="",this._updateFullScreen()}else{for(;"BODY"!=n.tagName;)n.style.position=r.shift(),n=n.parentNode;this.getDom().style.cssText=this._bakCssText,this.getDom("iframeholder").style.cssText=this._bakCssText1,this._bakAutoHeight&&(t.autoHeightEnabled=!0,this.editor.enableAutoHeight()),document.documentElement.style.overflow=this._bakHtmlOverflow,document.body.style.overflow=this._bakBodyOverflow,t.iframe.parentNode.style.width=this._bakEditorContaninerWidth+"px",window.scrollTo(0,this._bakScrollTop)}if(browser.gecko&&"true"===t.body.contentEditable){var a=document.createElement("input");document.body.appendChild(a),t.body.contentEditable=!1,setTimeout(function(){a.focus(),setTimeout(function(){t.body.contentEditable=!0,t.fireEvent("fullscreenchanged",e),t.selection.getRange().moveToBookmark(i).select(!0),baidu.editor.dom.domUtils.remove(a),e&&window.scroll(0,0)},0)},0)}"true"===t.body.contentEditable&&(this.editor.fireEvent("fullscreenchanged",e),this.triggerLayout())}},_updateFullScreen:function(){if(this._fullscreen){var e=n.getViewportRect();if(this.getDom().style.cssText="border:0;position:absolute;left:0;top:"+(this.editor.options.topOffset||0)+"px;width:"+e.width+"px;height:"+e.height+"px;z-index:"+(1*this.getDom().style.zIndex+100),n.setViewportOffset(this.getDom(),{left:0,top:this.editor.options.topOffset||0}),this.editor.setHeight(e.height-this.getDom("toolbarbox").offsetHeight-this.getDom("bottombar").offsetHeight-(this.editor.options.topOffset||0),!0),browser.gecko)try{window.onresize()}catch(e){}}},_updateElementPath:function(){var e,t=this.getDom("elementpath");if(this.elementPathEnabled&&(e=this.editor.queryCommandValue("elementpath"))){for(var n,i=[],o=0;n=e[o];o++)i[o]=this.formatHtml('<span unselectable="on" onclick="$$.editor.execCommand(&quot;elementpath&quot;, &quot;'+o+'&quot;);">'+n+"</span>");t.innerHTML='<div class="edui-editor-breadcrumb" onmousedown="return false;">'+this.editor.getLang("elementPathTip")+": "+i.join(" &gt; ")+"</div>"}else t.style.display="none"},disableElementPath:function(){var e=this.getDom("elementpath");e.innerHTML="",e.style.display="none",this.elementPathEnabled=!1},enableElementPath:function(){this.getDom("elementpath").style.display="",this.elementPathEnabled=!0,this._updateElementPath()},_scale:function(){function e(){h=o.getXY(s),p||(p=a.options.minFrameHeight+d.offsetHeight+c.offsetHeight),m.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+s.offsetWidth+"px;height:"+s.offsetHeight+"px;z-index:"+(a.options.zIndex+1),o.on(r,"mousemove",t),o.on(l,"mouseup",n),o.on(r,"mouseup",n)}function t(e){i();var t=e||window.event;v=t.pageX||r.documentElement.scrollLeft+t.clientX,b=t.pageY||r.documentElement.scrollTop+t.clientY,y=v-h.x,C=b-h.y,y>=g&&(f=!0,m.style.width=y+"px"),C>=p&&(f=!0,m.style.height=C+"px")}function n(){f&&(f=!1,a.ui._actualFrameWidth=m.offsetWidth-2,s.style.width=a.ui._actualFrameWidth+"px",a.setHeight(m.offsetHeight-c.offsetHeight-d.offsetHeight-2,!0)),m&&(m.style.display="none"),i(),o.un(r,"mousemove",t),o.un(l,"mouseup",n),o.un(r,"mouseup",n)}function i(){browser.ie?r.selection.clear():window.getSelection().removeAllRanges()}var r=document,a=this.editor,s=a.container,l=a.document,d=this.getDom("toolbarbox"),c=this.getDom("bottombar"),u=this.getDom("scale"),m=this.getDom("scalelayer"),f=!1,h=null,p=0,g=a.options.minFrameWidth,v=0,b=0,y=0,C=0,x=this;this.editor.addListener("fullscreenchanged",function(e,t){if(t)x.disableScale();else if(x.editor.options.scaleEnabled){x.enableScale();var n=x.editor.document.createElement("span");x.editor.body.appendChild(n),x.editor.body.style.height=Math.max(o.getXY(n).y,x.editor.iframe.offsetHeight-20)+"px",o.remove(n)}}),this.enableScale=function(){1!=a.queryCommandState("source")&&(u.style.display="",this.scaleEnabled=!0,o.on(u,"mousedown",e))},this.disableScale=function(){u.style.display="none",this.scaleEnabled=!1,o.un(u,"mousedown",e)}},isFullScreen:function(){return this._fullscreen},postRender:function(){i.prototype.postRender.call(this);for(var e=0;e<this.toolbars.length;e++)this.toolbars[e].postRender();var t,n=this,o=baidu.editor.dom.domUtils,r=function(){clearTimeout(t),t=setTimeout(function(){n._updateFullScreen()})};o.on(window,"resize",r),n.addListener("destroy",function(){o.un(window,"resize",r),clearTimeout(t)})},showToolbarMsg:function(e,t){if(this.getDom("toolbarmsg_label").innerHTML=e,this.getDom("toolbarmsg").style.display="",!t){this.getDom("upload_dialog").style.display="none"}},hideToolbarMsg:function(){this.getDom("toolbarmsg").style.display="none"},mapUrl:function(e){return e?e.replace("~/",this.editor.options.UEDITOR_HOME_URL||""):""},triggerLayout:function(){var e=this.getDom();"1"==e.style.zoom?e.style.zoom="100%":e.style.zoom="1"}},t.inherits(e,baidu.editor.ui.UIBase);var a={};UE.ui.Editor=function(n){var i=new UE.Editor(n);i.options.editor=i,t.loadFile(document,{href:i.options.themePath+i.options.theme+"/css/ueditor.css",tag:"link",type:"text/css",rel:"stylesheet"});var r=i.render;return i.render=function(n){n.constructor===String&&(i.key=n,a[n]=i),t.domReady(function(){function t(){if(i.setOpt({labelMap:i.options.labelMap||i.getLang("labelMap")}),new e(i.options),n&&(n.constructor===String&&(n=document.getElementById(n)),n&&n.getAttribute("name")&&(i.options.textarea=n.getAttribute("name")),n&&/script|textarea/gi.test(n.tagName))){var t=document.createElement("div");n.parentNode.insertBefore(t,n);var a=n.value||n.innerHTML;i.options.initialContent=/^[\t\r\n ]*$/.test(a)?i.options.initialContent:a.replace(/>[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+</g,"<").replace(/>[\n\r\t]+</g,"><"),n.className&&(t.className=n.className),n.style.cssText&&(t.style.cssText=n.style.cssText),/textarea/i.test(n.tagName)?(i.textarea=n,i.textarea.style.display="none"):n.parentNode.removeChild(n),n.id&&(t.id=n.id,o.removeAttributes(n,"id")),n=t,n.innerHTML=""}o.addClass(n,"edui-"+i.options.theme),i.ui.render(n);var s=i.options;i.container=i.ui.getDom();for(var l,d=o.findParents(n,!0),c=[],u=0;l=d[u];u++)c[u]=l.style.display,l.style.display="block";if(s.initialFrameWidth)s.minFrameWidth=s.initialFrameWidth;else{s.minFrameWidth=s.initialFrameWidth=n.offsetWidth;var m=n.style.width;/%$/.test(m)&&(s.initialFrameWidth=m)}s.initialFrameHeight?s.minFrameHeight=s.initialFrameHeight:s.initialFrameHeight=s.minFrameHeight=n.offsetHeight;for(var l,u=0;l=d[u];u++)l.style.display=c[u];n.style.height&&(n.style.height=""),i.container.style.width=s.initialFrameWidth+(/%$/.test(s.initialFrameWidth)?"":"px"),i.container.style.zIndex=s.zIndex,r.call(i,i.ui.getDom("iframeholder")),i.fireEvent("afteruiready")}i.langIsReady?t():i.addListener("langReady",t)})},i},UE.getEditor=function(e,t){var n=a[e];return n||(n=a[e]=new UE.ui.Editor(t),n.render(e)),n},UE.delEditor=function(e){var t;(t=a[e])&&(t.key&&t.destroy(),delete a[e])},UE.registerUI=function(e,n,i,o){t.each(e.split(/\s+/),function(e){UE._customizeUI[e]={id:o,execFn:n,index:i}})}}(),UE.registerUI("message",function(e){function t(){var e=a.ui.getDom("toolbarbox");e&&(n.style.top=e.offsetHeight+3+"px"),n.style.zIndex=Math.max(a.options.zIndex,a.iframe.style.zIndex)+1}var n,i=baidu.editor.ui,o=i.Message,r=[],a=e;a.addListener("ready",function(){n=document.getElementById(a.ui.id+"_message_holder"),t(),setTimeout(function(){t()},500)}),a.addListener("showmessage",function(e,i){i=utils.isString(i)?{content:i}:i;var s=new o({timeout:i.timeout,type:i.type,content:i.content,keepshow:i.keepshow,editor:a}),l=i.id||"msg_"+(+new Date).toString(36);return s.render(n),r[l]=s,s.reset(i),t(),l}),a.addListener("updatemessage",function(e,t,i){i=utils.isString(i)?{content:i}:i;var o=r[t];o.render(n),o&&o.reset(i)}),a.addListener("hidemessage",function(e,t){var n=r[t];n&&n.hide()})}),UE.registerUI("autosave",function(e){var t=null,n=null;e.on("afterautosave",function(){clearTimeout(t),t=setTimeout(function(){n&&e.trigger("hidemessage",n),n=e.trigger("showmessage",{content:e.getLang("autosave.success"),timeout:2e3})},2e3)})})}()},507:function(e,t,n){var i;/*!
   * ZeroClipboard
   * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface
   * Copyright (c) 2009-2016 Jon Rohan, James M. Greene
   * Licensed MIT
   * http://zeroclipboard.org/
   * v2.3.0
   */
  !function(o,r){"use strict";var a,s,l,d=o,c=d.document,u=d.navigator,m=d.setTimeout,f=d.clearTimeout,h=d.setInterval,p=d.clearInterval,g=d.getComputedStyle,v=d.encodeURIComponent,b=d.ActiveXObject,y=d.Error,C=d.Number.parseInt||d.parseInt,x=d.Number.parseFloat||d.parseFloat,w=d.Number.isNaN||d.isNaN,N=d.Date.now,U=d.Object.keys,E=d.Object.prototype.hasOwnProperty,T=d.Array.prototype.slice,S=function(){var e=function(e){return e};if("function"==typeof d.wrap&&"function"==typeof d.unwrap)try{var t=c.createElement("div"),n=d.unwrap(t);1===t.nodeType&&n&&1===n.nodeType&&(e=d.unwrap)}catch(e){}return e}(),k=function(e){return T.call(e,0)},B=function(){var e,t,n,i,o,r=k(arguments),a=r[0]||{};for(e=1,t=r.length;e<t;e++)if(null!=(n=r[e]))for(i in n)E.call(n,i)&&(a[i],o=n[i],a!==o&&void 0!==o&&(a[i]=o));return a},I=function(e){var t,n,i,o;if("object"!=typeof e||null==e||"number"==typeof e.nodeType)t=e;else if("number"==typeof e.length)for(t=[],n=0,i=e.length;n<i;n++)E.call(e,n)&&(t[n]=I(e[n]));else{t={};for(o in e)E.call(e,o)&&(t[o]=I(e[o]))}return t},_=function(e,t){for(var n={},i=0,o=t.length;i<o;i++)t[i]in e&&(n[t[i]]=e[t[i]]);return n},A=function(e,t){var n={};for(var i in e)-1===t.indexOf(i)&&(n[i]=e[i]);return n},L=function(e){if(e)for(var t in e)E.call(e,t)&&delete e[t];return e},R=function(e,t){if(e&&1===e.nodeType&&e.ownerDocument&&t&&(1===t.nodeType&&t.ownerDocument&&t.ownerDocument===e.ownerDocument||9===t.nodeType&&!t.ownerDocument&&t===e.ownerDocument))do{if(e===t)return!0;e=e.parentNode}while(e);return!1},D=function(e){var t;return"string"==typeof e&&e&&(t=e.split("#")[0].split("?")[0],t=e.slice(0,e.lastIndexOf("/")+1)),t},O=function(e){var t,n;return"string"==typeof e&&e&&(n=e.match(/^(?:|[^:@]*@|.+\)@(?=http[s]?|file)|.+?\s+(?: at |@)(?:[^:\(]+ )*[\(]?)((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/),n&&n[1]?t=n[1]:(n=e.match(/\)@((?:http[s]?|file):\/\/[\/]?.+?\/[^:\)]*?)(?::\d+)(?::\d+)?/))&&n[1]&&(t=n[1])),t},P=function(){var e,t;try{throw new y}catch(e){t=e}return t&&(e=t.sourceURL||t.fileName||O(t.stack)),e},M=function(){var e,t,n;if(c.currentScript&&(e=c.currentScript.src))return e;if(t=c.getElementsByTagName("script"),1===t.length)/*!
   * ZeroClipboard
   * The ZeroClipboard library provides an easy way to copy text to the clipboard using an invisible Adobe Flash movie and a JavaScript interface
   * Copyright (c) 2009-2016 Jon Rohan, James M. Greene
   * Licensed MIT
   * http://zeroclipboard.org/
   * v2.3.0
   */
  return t[0].src||void 0;if("readyState"in(t[0]||document.createElement("script")))for(n=t.length;n--;)if("interactive"===t[n].readyState&&(e=t[n].src))return e;return"loading"===c.readyState&&(e=t[t.length-1].src)?e:(e=P())?e:void 0},H=function(){var e,t,n,i=c.getElementsByTagName("script");for(e=i.length;e--;){if(!(n=i[e].src)){t=null;break}if(n=D(n),null==t)t=n;else if(t!==n){t=null;break}}return t||void 0},F=function(){var e=/win(dows|[\s]?(nt|me|ce|xp|vista|[\d]+))/i;return!!u&&(e.test(u.appVersion||"")||e.test(u.platform||"")||-1!==(u.userAgent||"").indexOf("Windows"))},$=function(){return null==d.opener&&(!!d.top&&d!=d.top||!!d.parent&&d!=d.parent)}(),q="html"===c.documentElement.nodeName,V={bridge:null,version:"0.0.0",pluginType:"unknown",sandboxed:null,disabled:null,outdated:null,insecure:null,unavailable:null,degraded:null,deactivated:null,overdue:null,ready:null},j={},z={},W=null,X=0,Y=0,K={ready:"Flash communication is established",error:{"flash-sandboxed":"Attempting to run Flash in a sandboxed iframe, which is impossible","flash-disabled":"Flash is disabled or not installed. May also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-outdated":"Flash is too outdated to support ZeroClipboard","flash-insecure":"Flash will be unable to communicate due to a protocol mismatch between your `swfPath` configuration and the page","flash-unavailable":"Flash is unable to communicate bidirectionally with JavaScript","flash-degraded":"Flash is unable to preserve data fidelity when communicating with JavaScript","flash-deactivated":"Flash is too outdated for your browser and/or is configured as click-to-activate.\nThis may also mean that the ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity.\nMay also be attempting to run Flash in a sandboxed iframe, which is impossible.","flash-overdue":"Flash communication was established but NOT within the acceptable time limit","version-mismatch":"ZeroClipboard JS version number does not match ZeroClipboard SWF version number","clipboard-error":"At least one error was thrown while ZeroClipboard was attempting to inject your data into the clipboard","config-mismatch":"ZeroClipboard configuration does not match Flash's reality","swf-not-found":"The ZeroClipboard SWF object could not be loaded, so please check your `swfPath` configuration and/or network connectivity","browser-unsupported":"The browser does not support the required HTML DOM and JavaScript features"}},G=["flash-unavailable","flash-degraded","flash-overdue","version-mismatch","config-mismatch","clipboard-error"],Z=["flash-sandboxed","flash-disabled","flash-outdated","flash-insecure","flash-unavailable","flash-degraded","flash-deactivated","flash-overdue"],J=new RegExp("^flash-("+Z.map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),Q=new RegExp("^flash-("+Z.filter(function(e){return"flash-disabled"!==e}).map(function(e){return e.replace(/^flash-/,"")}).join("|")+")$"),ee={swfPath:function(){return(D(M())||H()||"")+"ZeroClipboard.swf"}(),trustedDomains:d.location.host?[d.location.host]:[],cacheBust:!0,forceEnhancedClipboard:!1,flashLoadTimeout:3e4,autoActivate:!0,bubbleEvents:!0,fixLineEndings:!0,containerId:"global-zeroclipboard-html-bridge",containerClass:"global-zeroclipboard-container",swfObjectId:"global-zeroclipboard-flash-bridge",hoverClass:"zeroclipboard-is-hover",activeClass:"zeroclipboard-is-active",forceHandCursor:!1,title:null,zIndex:999999999},te=function(e){"object"!=typeof e||!e||"length"in e||U(e).forEach(function(t){if(/^(?:forceHandCursor|title|zIndex|bubbleEvents|fixLineEndings)$/.test(t))ee[t]=e[t];else if(null==V.bridge)if("containerId"===t||"swfObjectId"===t){if(!be(e[t]))throw new Error("The specified `"+t+"` value is not valid as an HTML4 Element ID");ee[t]=e[t]}else ee[t]=e[t]});{if("string"!=typeof e||!e)return I(ee);if(E.call(ee,e))return ee[e]}},ne=function(){return Je(),{browser:B(_(u,["userAgent","platform","appName","appVersion"]),{isSupported:ie()}),flash:A(V,["bridge"]),zeroclipboard:{version:et.version,config:et.config()}}},ie=function(){return!!(c.addEventListener&&d.Object.keys&&d.Array.prototype.map)},oe=function(){return!!(V.sandboxed||V.disabled||V.outdated||V.unavailable||V.degraded||V.deactivated)},re=function(e,t){var n,i,o,r={};if("string"==typeof e&&e?o=e.toLowerCase().split(/\s+/):"object"!=typeof e||!e||"length"in e||void 0!==t||U(e).forEach(function(t){var n=e[t];"function"==typeof n&&et.on(t,n)}),o&&o.length&&t){for(n=0,i=o.length;n<i;n++)e=o[n].replace(/^on/,""),r[e]=!0,j[e]||(j[e]=[]),j[e].push(t);if(r.ready&&V.ready&&et.emit({type:"ready"}),r.error){for(ie()||et.emit({type:"error",name:"browser-unsupported"}),n=0,i=Z.length;n<i;n++)if(!0===V[Z[n].replace(/^flash-/,"")]){et.emit({type:"error",name:Z[n]});break}void 0!==a&&et.version!==a&&et.emit({type:"error",name:"version-mismatch",jsVersion:et.version,swfVersion:a})}}return et},ae=function(e,t){var n,i,o,r,a;if(0===arguments.length?r=U(j):"string"==typeof e&&e?r=e.toLowerCase().split(/\s+/):"object"!=typeof e||!e||"length"in e||void 0!==t||U(e).forEach(function(t){var n=e[t];"function"==typeof n&&et.off(t,n)}),r&&r.length)for(n=0,i=r.length;n<i;n++)if(e=r[n].replace(/^on/,""),(a=j[e])&&a.length)if(t)for(o=a.indexOf(t);-1!==o;)a.splice(o,1),o=a.indexOf(t,o);else a.length=0;return et},se=function(e){return"string"==typeof e&&e?I(j[e])||null:I(j)},le=function(e){var t,n,i;if((e=ye(e))&&!Te(e))return"ready"===e.type&&!0===V.overdue?et.emit({type:"error",name:"flash-overdue"}):(t=B({},e),Ue.call(this,t),"copy"===e.type&&(i=De(z),n=i.data,W=i.formatMap),n)},de=function(){var e=ee.swfPath||"",t=e.slice(0,2),n=e.slice(0,e.indexOf("://")+1);return"\\\\"===t?"file:":"//"===t||""===n?d.location.protocol:n},ce=function(){var e,t,n=V.sandboxed;if(!ie())return V.ready=!1,void et.emit({type:"error",name:"browser-unsupported"});Je(),"boolean"!=typeof V.ready&&(V.ready=!1),V.sandboxed!==n&&!0===V.sandboxed?(V.ready=!1,et.emit({type:"error",name:"flash-sandboxed"})):et.isFlashUnusable()||null!==V.bridge||(t=de(),t&&t!==d.location.protocol?et.emit({type:"error",name:"flash-insecure"}):(e=ee.flashLoadTimeout,"number"==typeof e&&e>=0&&(X=m(function(){"boolean"!=typeof V.deactivated&&(V.deactivated=!0),!0===V.deactivated&&et.emit({type:"error",name:"flash-deactivated"})},e)),V.overdue=!1,Le()))},ue=function(){et.clearData(),et.blur(),et.emit("destroy"),Re(),et.off()},me=function(e,t){var n;if("object"==typeof e&&e&&void 0===t)n=e,et.clearData();else{if("string"!=typeof e||!e)return;n={},n[e]=t}for(var i in n)"string"==typeof i&&i&&E.call(n,i)&&"string"==typeof n[i]&&n[i]&&(z[i]=Ze(n[i]))},fe=function(e){void 0===e?(L(z),W=null):"string"==typeof e&&E.call(z,e)&&delete z[e]},he=function(e){return void 0===e?I(z):"string"==typeof e&&E.call(z,e)?z[e]:void 0},pe=function(e){if(e&&1===e.nodeType){s&&(Ve(s,ee.activeClass),s!==e&&Ve(s,ee.hoverClass)),s=e,qe(e,ee.hoverClass);var t=e.getAttribute("title")||ee.title;if("string"==typeof t&&t){var n=_e(V.bridge);n&&n.setAttribute("title",t)}var i=!0===ee.forceHandCursor||"pointer"===je(e,"cursor");Ke(i),Ye()}},ge=function(){var e=_e(V.bridge);e&&(e.removeAttribute("title"),e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px"),s&&(Ve(s,ee.hoverClass),Ve(s,ee.activeClass),s=null)},ve=function(){return s||null},be=function(e){return"string"==typeof e&&e&&/^[A-Za-z][A-Za-z0-9_:\-\.]*$/.test(e)},ye=function(e){var t;if("string"==typeof e&&e?(t=e,e={}):"object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(t=e.type),t){t=t.toLowerCase(),!e.target&&(/^(copy|aftercopy|_click)$/.test(t)||"error"===t&&"clipboard-error"===e.name)&&(e.target=l),B(e,{type:t,target:e.target||s||null,relatedTarget:e.relatedTarget||null,currentTarget:V&&V.bridge||null,timeStamp:e.timeStamp||N()||null});var n=K[e.type];return"error"===e.type&&e.name&&n&&(n=n[e.name]),n&&(e.message=n),"ready"===e.type&&B(e,{target:null,version:V.version}),"error"===e.type&&(J.test(e.name)&&B(e,{target:null,minimumVersion:"11.0.0"}),Q.test(e.name)&&B(e,{version:V.version}),"flash-insecure"===e.name&&B(e,{pageProtocol:d.location.protocol,swfProtocol:de()})),"copy"===e.type&&(e.clipboardData={setData:et.setData,clearData:et.clearData}),"aftercopy"===e.type&&(e=Oe(e,W)),e.target&&!e.relatedTarget&&(e.relatedTarget=Ce(e.target)),xe(e)}},Ce=function(e){var t=e&&e.getAttribute&&e.getAttribute("data-clipboard-target");return t?c.getElementById(t):null},xe=function(e){if(e&&/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type)){var t=e.target,n="_mouseover"===e.type&&e.relatedTarget?e.relatedTarget:void 0,i="_mouseout"===e.type&&e.relatedTarget?e.relatedTarget:void 0,o=ze(t),r=d.screenLeft||d.screenX||0,a=d.screenTop||d.screenY||0,s=c.body.scrollLeft+c.documentElement.scrollLeft,l=c.body.scrollTop+c.documentElement.scrollTop,u=o.left+("number"==typeof e._stageX?e._stageX:0),m=o.top+("number"==typeof e._stageY?e._stageY:0),f=u-s,h=m-l,p=r+f,g=a+h,v="number"==typeof e.movementX?e.movementX:0,b="number"==typeof e.movementY?e.movementY:0;delete e._stageX,delete e._stageY,B(e,{srcElement:t,fromElement:n,toElement:i,screenX:p,screenY:g,pageX:u,pageY:m,clientX:f,clientY:h,x:f,y:h,movementX:v,movementY:b,offsetX:0,offsetY:0,layerX:0,layerY:0})}return e},we=function(e){return!/^(?:(?:before)?copy|destroy)$/.test(e&&"string"==typeof e.type&&e.type||"")},Ne=function(e,t,n,i){i?m(function(){e.apply(t,n)},0):e.apply(t,n)},Ue=function(e){if("object"==typeof e&&e&&e.type){var t=we(e),n=j["*"]||[],i=j[e.type]||[],o=n.concat(i);if(o&&o.length){var r,a,s,l,c,u=this;for(r=0,a=o.length;r<a;r++)s=o[r],l=u,"string"==typeof s&&"function"==typeof d[s]&&(s=d[s]),"object"==typeof s&&s&&"function"==typeof s.handleEvent&&(l=s,s=s.handleEvent),"function"==typeof s&&(c=B({},e),Ne(s,l,[c],t))}return this}},Ee=function(e){var t=null;return(!1===$||e&&"error"===e.type&&e.name&&-1!==G.indexOf(e.name))&&(t=!1),t},Te=function(e){var t=e.target||s||null,n="swf"===e._source;switch(delete e._source,e.type){case"error":var i="flash-sandboxed"===e.name||Ee(e);"boolean"==typeof i&&(V.sandboxed=i),"browser-unsupported"===e.name?B(V,{disabled:!1,outdated:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1}):-1!==Z.indexOf(e.name)?B(V,{disabled:"flash-disabled"===e.name,outdated:"flash-outdated"===e.name,insecure:"flash-insecure"===e.name,unavailable:"flash-unavailable"===e.name,degraded:"flash-degraded"===e.name,deactivated:"flash-deactivated"===e.name,overdue:"flash-overdue"===e.name,ready:!1}):"version-mismatch"===e.name&&(a=e.swfVersion,B(V,{disabled:!1,outdated:!1,insecure:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:!1,ready:!1})),Xe();break;case"ready":a=e.swfVersion;var o=!0===V.deactivated;B(V,{sandboxed:!1,disabled:!1,outdated:!1,insecure:!1,unavailable:!1,degraded:!1,deactivated:!1,overdue:o,ready:!o}),Xe();break;case"beforecopy":l=t;break;case"copy":var r,d,c=e.relatedTarget;!z["text/html"]&&!z["text/plain"]&&c&&(d=c.value||c.outerHTML||c.innerHTML)&&(r=c.value||c.textContent||c.innerText)?(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",r),d!==r&&e.clipboardData.setData("text/html",d)):!z["text/plain"]&&e.target&&(r=e.target.getAttribute("data-clipboard-text"))&&(e.clipboardData.clearData(),e.clipboardData.setData("text/plain",r));break;case"aftercopy":Se(e),et.clearData(),t&&t!==$e()&&t.focus&&t.focus();break;case"_mouseover":et.focus(t),!0===ee.bubbleEvents&&n&&(t&&t!==e.relatedTarget&&!R(e.relatedTarget,t)&&ke(B({},e,{type:"mouseenter",bubbles:!1,cancelable:!1})),ke(B({},e,{type:"mouseover"})));break;case"_mouseout":et.blur(),!0===ee.bubbleEvents&&n&&(t&&t!==e.relatedTarget&&!R(e.relatedTarget,t)&&ke(B({},e,{type:"mouseleave",bubbles:!1,cancelable:!1})),ke(B({},e,{type:"mouseout"})));break;case"_mousedown":qe(t,ee.activeClass),!0===ee.bubbleEvents&&n&&ke(B({},e,{type:e.type.slice(1)}));break;case"_mouseup":Ve(t,ee.activeClass),!0===ee.bubbleEvents&&n&&ke(B({},e,{type:e.type.slice(1)}));break;case"_click":l=null,!0===ee.bubbleEvents&&n&&ke(B({},e,{type:e.type.slice(1)}));break;case"_mousemove":!0===ee.bubbleEvents&&n&&ke(B({},e,{type:e.type.slice(1)}))}if(/^_(?:click|mouse(?:over|out|down|up|move))$/.test(e.type))return!0},Se=function(e){if(e.errors&&e.errors.length>0){var t=I(e);B(t,{type:"error",name:"clipboard-error"}),delete t.success,m(function(){et.emit(t)},0)}},ke=function(e){if(e&&"string"==typeof e.type&&e){var t,n=e.target||null,i=n&&n.ownerDocument||c,o={view:i.defaultView||d,canBubble:!0,cancelable:!0,detail:"click"===e.type?1:0,button:"number"==typeof e.which?e.which-1:"number"==typeof e.button?e.button:i.createEvent?0:1},r=B(o,e);n&&i.createEvent&&n.dispatchEvent&&(r=[r.type,r.canBubble,r.cancelable,r.view,r.detail,r.screenX,r.screenY,r.clientX,r.clientY,r.ctrlKey,r.altKey,r.shiftKey,r.metaKey,r.button,r.relatedTarget],t=i.createEvent("MouseEvents"),t.initMouseEvent&&(t.initMouseEvent.apply(t,r),t._source="js",n.dispatchEvent(t)))}},Be=function(){var e=ee.flashLoadTimeout;if("number"==typeof e&&e>=0){var t=Math.min(1e3,e/10),n=ee.swfObjectId+"_fallbackContent";Y=h(function(){var e=c.getElementById(n);We(e)&&(Xe(),V.deactivated=null,et.emit({type:"error",name:"swf-not-found"}))},t)}},Ie=function(){var e=c.createElement("div");return e.id=ee.containerId,e.className=ee.containerClass,e.style.position="absolute",e.style.left="0px",e.style.top="-9999px",e.style.width="1px",e.style.height="1px",e.style.zIndex=""+Ge(ee.zIndex),e},_e=function(e){for(var t=e&&e.parentNode;t&&"OBJECT"===t.nodeName&&t.parentNode;)t=t.parentNode;return t||null},Ae=function(e){return"string"==typeof e&&e?e.replace(/["&'<>]/g,function(e){switch(e){case'"':return"&quot;";case"&":return"&amp;";case"'":return"&apos;";case"<":return"&lt;";case">":return"&gt;";default:return e}}):e},Le=function(){var e,t=V.bridge,n=_e(t);if(!t){var i=Fe(d.location.host,ee),o="never"===i?"none":"all",r=Me(B({jsVersion:et.version},ee)),a=ee.swfPath+Pe(ee.swfPath,ee);q&&(a=Ae(a)),n=Ie();var s=c.createElement("div");n.appendChild(s),c.body.appendChild(n);var l=c.createElement("div"),u="activex"===V.pluginType;l.innerHTML='<object id="'+ee.swfObjectId+'" name="'+ee.swfObjectId+'" width="100%" height="100%" '+(u?'classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"':'type="application/x-shockwave-flash" data="'+a+'"')+">"+(u?'<param name="movie" value="'+a+'"/>':"")+'<param name="allowScriptAccess" value="'+i+'"/><param name="allowNetworking" value="'+o+'"/><param name="menu" value="false"/><param name="wmode" value="transparent"/><param name="flashvars" value="'+r+'"/><div id="'+ee.swfObjectId+'_fallbackContent">&nbsp;</div></object>',t=l.firstChild,l=null,S(t).ZeroClipboard=et,n.replaceChild(t,s),Be()}return t||(t=c[ee.swfObjectId],t&&(e=t.length)&&(t=t[e-1]),!t&&n&&(t=n.firstChild)),V.bridge=t||null,t},Re=function(){var e=V.bridge;if(e){var t=_e(e);t&&("activex"===V.pluginType&&"readyState"in e?(e.style.display="none",function n(){if(4===e.readyState){for(var i in e)"function"==typeof e[i]&&(e[i]=null);e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t)}else m(n,10)}()):(e.parentNode&&e.parentNode.removeChild(e),t.parentNode&&t.parentNode.removeChild(t))),Xe(),V.ready=null,V.bridge=null,V.deactivated=null,V.insecure=null,a=void 0}},De=function(e){var t={},n={};if("object"==typeof e&&e){for(var i in e)if(i&&E.call(e,i)&&"string"==typeof e[i]&&e[i])switch(i.toLowerCase()){case"text/plain":case"text":case"air:text":case"flash:text":t.text=e[i],n.text=i;break;case"text/html":case"html":case"air:html":case"flash:html":t.html=e[i],n.html=i;break;case"application/rtf":case"text/rtf":case"rtf":case"richtext":case"air:rtf":case"flash:rtf":t.rtf=e[i],n.rtf=i}return{data:t,formatMap:n}}},Oe=function(e,t){if("object"!=typeof e||!e||"object"!=typeof t||!t)return e;var n={};for(var i in e)if(E.call(e,i))if("errors"===i){n[i]=e[i]?e[i].slice():[];for(var o=0,r=n[i].length;o<r;o++)n[i][o].format=t[n[i][o].format]}else if("success"!==i&&"data"!==i)n[i]=e[i];else{n[i]={};var a=e[i];for(var s in a)s&&E.call(a,s)&&E.call(t,s)&&(n[i][t[s]]=a[s])}return n},Pe=function(e,t){return null==t||t&&!0===t.cacheBust?(-1===e.indexOf("?")?"?":"&")+"noCache="+N():""},Me=function(e){var t,n,i,o,r="",a=[];if(e.trustedDomains&&("string"==typeof e.trustedDomains?o=[e.trustedDomains]:"object"==typeof e.trustedDomains&&"length"in e.trustedDomains&&(o=e.trustedDomains)),o&&o.length)for(t=0,n=o.length;t<n;t++)if(E.call(o,t)&&o[t]&&"string"==typeof o[t]){if(!(i=He(o[t])))continue;if("*"===i){a.length=0,a.push(i);break}a.push.apply(a,[i,"//"+i,d.location.protocol+"//"+i])}return a.length&&(r+="trustedOrigins="+v(a.join(","))),!0===e.forceEnhancedClipboard&&(r+=(r?"&":"")+"forceEnhancedClipboard=true"),"string"==typeof e.swfObjectId&&e.swfObjectId&&(r+=(r?"&":"")+"swfObjectId="+v(e.swfObjectId)),"string"==typeof e.jsVersion&&e.jsVersion&&(r+=(r?"&":"")+"jsVersion="+v(e.jsVersion)),r},He=function(e){if(null==e||""===e)return null;if(""===(e=e.replace(/^\s+|\s+$/g,"")))return null;var t=e.indexOf("//");e=-1===t?e:e.slice(t+2);var n=e.indexOf("/");return e=-1===n?e:-1===t||0===n?null:e.slice(0,n),e&&".swf"===e.slice(-4).toLowerCase()?null:e||null},Fe=function(){var e=function(e){var t,n,i,o=[];if("string"==typeof e&&(e=[e]),"object"!=typeof e||!e||"number"!=typeof e.length)return o;for(t=0,n=e.length;t<n;t++)if(E.call(e,t)&&(i=He(e[t]))){if("*"===i){o.length=0,o.push("*");break}-1===o.indexOf(i)&&o.push(i)}return o};return function(t,n){var i=He(n.swfPath);null===i&&(i=t);var o=e(n.trustedDomains),r=o.length;if(r>0){if(1===r&&"*"===o[0])return"always";if(-1!==o.indexOf(t))return 1===r&&t===i?"sameDomain":"always"}return"never"}}(),$e=function(){try{return c.activeElement}catch(e){return null}},qe=function(e,t){var n,i,o,r=[];if("string"==typeof t&&t&&(r=t.split(/\s+/)),e&&1===e.nodeType&&r.length>0){for(o=(" "+(e.className||"")+" ").replace(/[\t\r\n\f]/g," "),n=0,i=r.length;n<i;n++)-1===o.indexOf(" "+r[n]+" ")&&(o+=r[n]+" ");o=o.replace(/^\s+|\s+$/g,""),o!==e.className&&(e.className=o)}return e},Ve=function(e,t){var n,i,o,r=[];if("string"==typeof t&&t&&(r=t.split(/\s+/)),e&&1===e.nodeType&&r.length>0&&e.className){for(o=(" "+e.className+" ").replace(/[\t\r\n\f]/g," "),n=0,i=r.length;n<i;n++)o=o.replace(" "+r[n]+" "," ");o=o.replace(/^\s+|\s+$/g,""),o!==e.className&&(e.className=o)}return e},je=function(e,t){var n=g(e,null).getPropertyValue(t);return"cursor"!==t||n&&"auto"!==n||"A"!==e.nodeName?n:"pointer"},ze=function(e){var t={left:0,top:0,width:0,height:0};if(e.getBoundingClientRect){var n=e.getBoundingClientRect(),i=d.pageXOffset,o=d.pageYOffset,r=c.documentElement.clientLeft||0,a=c.documentElement.clientTop||0,s=0,l=0;if("relative"===je(c.body,"position")){var u=c.body.getBoundingClientRect(),m=c.documentElement.getBoundingClientRect();s=u.left-m.left||0,l=u.top-m.top||0}t.left=n.left+i-r-s,t.top=n.top+o-a-l,t.width="width"in n?n.width:n.right-n.left,t.height="height"in n?n.height:n.bottom-n.top}return t},We=function(e){if(!e)return!1;var t=g(e,null);if(!t)return!1;var n=x(t.height)>0,i=x(t.width)>0,o=x(t.top)>=0,r=x(t.left)>=0,a=n&&i&&o&&r,s=a?null:ze(e);return"none"!==t.display&&"collapse"!==t.visibility&&(a||!!s&&(n||s.height>0)&&(i||s.width>0)&&(o||s.top>=0)&&(r||s.left>=0))},Xe=function(){f(X),X=0,p(Y),Y=0},Ye=function(){var e;if(s&&(e=_e(V.bridge))){var t=ze(s);B(e.style,{width:t.width+"px",height:t.height+"px",top:t.top+"px",left:t.left+"px",zIndex:""+Ge(ee.zIndex)})}},Ke=function(e){!0===V.ready&&(V.bridge&&"function"==typeof V.bridge.setHandCursor?V.bridge.setHandCursor(e):V.ready=!1)},Ge=function(e){if(/^(?:auto|inherit)$/.test(e))return e;var t;return"number"!=typeof e||w(e)?"string"==typeof e&&(t=Ge(C(e,10))):t=e,"number"==typeof t?t:"auto"},Ze=function(e){var t=/(\r\n|\r|\n)/g;return"string"==typeof e&&!0===ee.fixLineEndings&&(F()?/((^|[^\r])\n|\r([^\n]|$))/.test(e)&&(e=e.replace(t,"\r\n")):/\r/.test(e)&&(e=e.replace(t,"\n"))),e},Je=function(e){var t,n,i,r=V.sandboxed,a=null;if(e=!0===e,!1===$)a=!1;else{try{n=o.frameElement||null}catch(e){i={name:e.name,message:e.message}}if(n&&1===n.nodeType&&"IFRAME"===n.nodeName)try{a=n.hasAttribute("sandbox")}catch(e){a=null}else{try{t=document.domain||null}catch(e){t=null}(null===t||i&&"SecurityError"===i.name&&/(^|[\s\(\[@])sandbox(es|ed|ing|[\s\.,!\)\]@]|$)/.test(i.message.toLowerCase()))&&(a=!0)}}return V.sandboxed=a,r===a||e||Qe(b),a},Qe=function(e){function t(e){var t=e.match(/[\d]+/g);return t.length=3,t.join(".")}function n(e){return!!e&&(e=e.toLowerCase())&&(/^(pepflashplayer\.dll|libpepflashplayer\.so|pepperflashplayer\.plugin)$/.test(e)||"chrome.plugin"===e.slice(-13))}function i(e){e&&(s=!0,e.version&&(c=t(e.version)),!c&&e.description&&(c=t(e.description)),e.filename&&(d=n(e.filename)))}var o,r,a,s=!1,l=!1,d=!1,c="";if(u.plugins&&u.plugins.length)o=u.plugins["Shockwave Flash"],i(o),u.plugins["Shockwave Flash 2.0"]&&(s=!0,c="2.0.0.11");else if(u.mimeTypes&&u.mimeTypes.length)a=u.mimeTypes["application/x-shockwave-flash"],o=a&&a.enabledPlugin,i(o);else if(void 0!==e){l=!0;try{r=new e("ShockwaveFlash.ShockwaveFlash.7"),s=!0,c=t(r.GetVariable("$version"))}catch(n){try{r=new e("ShockwaveFlash.ShockwaveFlash.6"),s=!0,c="6.0.21"}catch(n){try{r=new e("ShockwaveFlash.ShockwaveFlash"),s=!0,c=t(r.GetVariable("$version"))}catch(e){l=!1}}}}V.disabled=!0!==s,V.outdated=c&&x(c)<x("11.0.0"),V.version=c||"0.0.0",V.pluginType=d?"pepper":l?"activex":s?"netscape":"unknown"};Qe(b),Je(!0);var et=function(){if(!(this instanceof et))return new et;"function"==typeof et._createClient&&et._createClient.apply(this,k(arguments))};et.version="2.3.0",et.config=function(){return te.apply(this,k(arguments))},et.state=function(){return ne.apply(this,k(arguments))},et.isFlashUnusable=function(){return oe.apply(this,k(arguments))},et.on=function(){return re.apply(this,k(arguments))},et.off=function(){return ae.apply(this,k(arguments))},et.handlers=function(){return se.apply(this,k(arguments))},et.emit=function(){return le.apply(this,k(arguments))},et.create=function(){return ce.apply(this,k(arguments))},et.destroy=function(){return ue.apply(this,k(arguments))},et.setData=function(){return me.apply(this,k(arguments))},et.clearData=function(){return fe.apply(this,k(arguments))},et.getData=function(){return he.apply(this,k(arguments))},et.focus=et.activate=function(){return pe.apply(this,k(arguments))},et.blur=et.deactivate=function(){return ge.apply(this,k(arguments))},et.activeElement=function(){return ve.apply(this,k(arguments))};var tt=0,nt={},it=0,ot={},rt={};B(ee,{autoActivate:!0});var at=function(e){var t,n=this;n.id=""+tt++,t={instance:n,elements:[],handlers:{},coreWildcardHandler:function(e){return n.emit(e)}},nt[n.id]=t,e&&n.clip(e),et.on("*",t.coreWildcardHandler),et.on("destroy",function(){n.destroy()}),et.create()},st=function(e,t){var n,i,o,r={},s=this,l=nt[s.id],d=l&&l.handlers;if(!l)throw new Error("Attempted to add new listener(s) to a destroyed ZeroClipboard client instance");if("string"==typeof e&&e?o=e.toLowerCase().split(/\s+/):"object"!=typeof e||!e||"length"in e||void 0!==t||U(e).forEach(function(t){var n=e[t];"function"==typeof n&&s.on(t,n)}),o&&o.length&&t){for(n=0,i=o.length;n<i;n++)e=o[n].replace(/^on/,""),r[e]=!0,d[e]||(d[e]=[]),d[e].push(t);if(r.ready&&V.ready&&this.emit({type:"ready",client:this}),r.error){for(n=0,i=Z.length;n<i;n++)if(V[Z[n].replace(/^flash-/,"")]){this.emit({type:"error",name:Z[n],client:this});break}void 0!==a&&et.version!==a&&this.emit({type:"error",name:"version-mismatch",jsVersion:et.version,swfVersion:a})}}return s},lt=function(e,t){var n,i,o,r,a,s=this,l=nt[s.id],d=l&&l.handlers;if(!d)return s;if(0===arguments.length?r=U(d):"string"==typeof e&&e?r=e.split(/\s+/):"object"!=typeof e||!e||"length"in e||void 0!==t||U(e).forEach(function(t){var n=e[t];"function"==typeof n&&s.off(t,n)}),r&&r.length)for(n=0,i=r.length;n<i;n++)if(e=r[n].toLowerCase().replace(/^on/,""),(a=d[e])&&a.length)if(t)for(o=a.indexOf(t);-1!==o;)a.splice(o,1),o=a.indexOf(t,o);else a.length=0;return s},dt=function(e){var t=null,n=nt[this.id]&&nt[this.id].handlers;return n&&(t="string"==typeof e&&e?n[e]?n[e].slice(0):[]:I(n)),t},ct=function(e){var t,n=this;return pt.call(n,e)&&("object"==typeof e&&e&&"string"==typeof e.type&&e.type&&(e=B({},e)),t=B({},ye(e),{client:n}),gt.call(n,t)),n},ut=function(e){if(!nt[this.id])throw new Error("Attempted to clip element(s) to a destroyed ZeroClipboard client instance");e=vt(e);for(var t=0;t<e.length;t++)if(E.call(e,t)&&e[t]&&1===e[t].nodeType){e[t].zcClippingId?-1===ot[e[t].zcClippingId].indexOf(this.id)&&ot[e[t].zcClippingId].push(this.id):(e[t].zcClippingId="zcClippingId_"+it++,ot[e[t].zcClippingId]=[this.id],!0===ee.autoActivate&&bt(e[t]));var n=nt[this.id]&&nt[this.id].elements;-1===n.indexOf(e[t])&&n.push(e[t])}return this},mt=function(e){var t=nt[this.id];if(!t)return this;var n,i=t.elements;e=void 0===e?i.slice(0):vt(e);for(var o=e.length;o--;)if(E.call(e,o)&&e[o]&&1===e[o].nodeType){for(n=0;-1!==(n=i.indexOf(e[o],n));)i.splice(n,1);var r=ot[e[o].zcClippingId];if(r){for(n=0;-1!==(n=r.indexOf(this.id,n));)r.splice(n,1);0===r.length&&(!0===ee.autoActivate&&yt(e[o]),delete e[o].zcClippingId)}}return this},ft=function(){var e=nt[this.id];return e&&e.elements?e.elements.slice(0):[]},ht=function(){var e=nt[this.id];e&&(this.unclip(),this.off(),et.off("*",e.coreWildcardHandler),delete nt[this.id])},pt=function(e){if(!e||!e.type)return!1;if(e.client&&e.client!==this)return!1;var t=nt[this.id],n=t&&t.elements,i=!!n&&n.length>0,o=!e.target||i&&-1!==n.indexOf(e.target),r=e.relatedTarget&&i&&-1!==n.indexOf(e.relatedTarget),a=e.client&&e.client===this;return!(!t||!(o||r||a))},gt=function(e){var t=nt[this.id];if("object"==typeof e&&e&&e.type&&t){var n=we(e),i=t&&t.handlers["*"]||[],o=t&&t.handlers[e.type]||[],r=i.concat(o);if(r&&r.length){var a,s,l,c,u,m=this;for(a=0,s=r.length;a<s;a++)l=r[a],c=m,"string"==typeof l&&"function"==typeof d[l]&&(l=d[l]),"object"==typeof l&&l&&"function"==typeof l.handleEvent&&(c=l,l=l.handleEvent),"function"==typeof l&&(u=B({},e),Ne(l,c,[u],n))}}},vt=function(e){return"string"==typeof e&&(e=[]),"number"!=typeof e.length?[e]:e},bt=function(e){if(e&&1===e.nodeType){var t=function(e){(e||(e=d.event))&&("js"!==e._source&&(e.stopImmediatePropagation(),e.preventDefault()),delete e._source)},n=function(n){(n||(n=d.event))&&(t(n),et.focus(e))};e.addEventListener("mouseover",n,!1),e.addEventListener("mouseout",t,!1),e.addEventListener("mouseenter",t,!1),e.addEventListener("mouseleave",t,!1),e.addEventListener("mousemove",t,!1),rt[e.zcClippingId]={mouseover:n,mouseout:t,mouseenter:t,mouseleave:t,mousemove:t}}},yt=function(e){if(e&&1===e.nodeType){var t=rt[e.zcClippingId];if("object"==typeof t&&t){for(var n,i,o=["move","leave","enter","out","over"],r=0,a=o.length;r<a;r++)n="mouse"+o[r],"function"==typeof(i=t[n])&&e.removeEventListener(n,i,!1);delete rt[e.zcClippingId]}}};et._createClient=function(){at.apply(this,k(arguments))},et.prototype.on=function(){return st.apply(this,k(arguments))},et.prototype.off=function(){return lt.apply(this,k(arguments))},et.prototype.handlers=function(){return dt.apply(this,k(arguments))},et.prototype.emit=function(){return ct.apply(this,k(arguments))},et.prototype.clip=function(){return ut.apply(this,k(arguments))},et.prototype.unclip=function(){return mt.apply(this,k(arguments))},et.prototype.elements=function(){return ft.apply(this,k(arguments))},et.prototype.destroy=function(){return ht.apply(this,k(arguments))},et.prototype.setText=function(e){if(!nt[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return et.setData("text/plain",e),this},et.prototype.setHtml=function(e){if(!nt[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return et.setData("text/html",e),this},et.prototype.setRichText=function(e){if(!nt[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return et.setData("application/rtf",e),this},et.prototype.setData=function(){if(!nt[this.id])throw new Error("Attempted to set pending clipboard data from a destroyed ZeroClipboard client instance");return et.setData.apply(this,k(arguments)),this},et.prototype.clearData=function(){if(!nt[this.id])throw new Error("Attempted to clear pending clipboard data from a destroyed ZeroClipboard client instance");return et.clearData.apply(this,k(arguments)),this},et.prototype.getData=function(){if(!nt[this.id])throw new Error("Attempted to get pending clipboard data from a destroyed ZeroClipboard client instance");return et.getData.apply(this,k(arguments))},void 0!==(i=function(){return et}.call(t,n,t,e))&&(e.exports=i)}(function(){return this||window}())}});