天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

660 lines
334 KiB

(function(){function X(c,a,e){var d;a=a.toLowerCase();return(d=c.__allListeners||e&&(c.__allListeners={}))&&(d[a]||e&&(d[a]=[]))}function Y(c,a,e,d,b,g){d=d&&c[a];var f;for(!d&&(d=c[e]);!d&&(f=(f||c).parentNode);){if("BODY"==f.tagName||g&&!g(f))return null;d=f[e]}return d&&b&&!b(d)?Y(d,a,e,!1,b):d}UEDITOR_CONFIG=window.UEDITOR_CONFIG||{};var s=window.baidu||{};window.baidu=s;window.UE=s.editor=window.UE||{};UE.plugins={};UE.commands={};UE.instants={};UE.I18N={};UE.version="1.3.5";var L=UE.dom={},
q=UE.browser=function(){var c=navigator.userAgent.toLowerCase(),a=window.opera,e={ie:/(msie\s|trident.*rv:)([\w.]+)/.test(c),opera:!!a&&a.version,webkit:-1<c.indexOf(" applewebkit/"),mac:-1<c.indexOf("macintosh"),quirks:"BackCompat"==document.compatMode};e.gecko="Gecko"==navigator.product&&!e.webkit&&!e.opera&&!e.ie;var d=0;e.ie&&(d=1*(c.match(/(msie\s|trident.*rv:)([\w.]+)/)[2]||0),e.ie11Compat=11==document.documentMode,e.ie9Compat=9==document.documentMode,e.ie8=!!document.documentMode,e.ie8Compat=
8==document.documentMode,e.ie7Compat=7==d&&!document.documentMode||7==document.documentMode,e.ie6Compat=7>d||e.quirks,e.ie9above=8<d,e.ie9below=9>d);if(e.gecko){var b=c.match(/rv:([\d\.]+)/);b&&(b=b[1].split("."),d=1E4*b[0]+100*(b[1]||0)+1*(b[2]||0))}/chrome\/(\d+\.\d)/i.test(c)&&(e.chrome=+RegExp.$1);/(\d+\.\d)?(?:\.\d)?\s+safari\/?(\d+\.\d+)?/i.test(c)&&!/chrome/i.test(c)&&(e.safari=+(RegExp.$1||RegExp.$2));e.opera&&(d=parseFloat(a.version()));e.webkit&&(d=parseFloat(c.match(/ applewebkit\/(\d+)/)[1]));
e.version=d;e.isCompatible=!e.mobile&&(e.ie&&6<=d||e.gecko&&10801<=d||e.opera&&9.5<=d||e.air&&1<=d||e.webkit&&522<=d||!1);return e}(),H=q.ie,ka=q.opera,p=UE.utils={each:function(c,a,e){if(null!=c)if(c.length===+c.length)for(var d=0,b=c.length;d<b;d++){if(!1===a.call(e,c[d],d,c))return!1}else for(d in c)if(c.hasOwnProperty(d)&&!1===a.call(e,c[d],d,c))return!1},makeInstance:function(c){var a=new Function;a.prototype=c;c=new a;a.prototype=null;return c},extend:function(c,a,e){if(a)for(var d in a)e&&
c.hasOwnProperty(d)||(c[d]=a[d]);return c},extend2:function(c){for(var a=arguments,e=1;e<a.length;e++){var d=a[e],b;for(b in d)c.hasOwnProperty(b)||(c[b]=d[b])}return c},inherits:function(c,a){var e=c.prototype,d=p.makeInstance(a.prototype);p.extend(d,e,!0);c.prototype=d;return d.constructor=c},bind:function(c,a){return function(){return c.apply(a,arguments)}},defer:function(c,a,e){var d;return function(){e&&clearTimeout(d);d=setTimeout(c,a)}},indexOf:function(c,a,e){var d=-1;e=this.isNumber(e)?e:
0;this.each(c,function(b,g){if(g>=e&&b===a)return d=g,!1});return d},removeItem:function(c,a){for(var e=0,d=c.length;e<d;e++)c[e]===a&&(c.splice(e,1),e--)},trim:function(c){return c.replace(/(^[ \t\n\r]+)|([ \t\n\r]+$)/g,"")},listToMap:function(c){if(!c)return{};c=p.isArray(c)?c:c.split(",");for(var a=0,e,d={};e=c[a++];)d[e.toUpperCase()]=d[e]=1;return d},unhtml:function(c,a){return c?c.replace(a||/[&<">'](?:(amp|lt|quot|gt|#39|nbsp);)?/g,function(a,d){return d?a:{"<":"&lt;","&":"&amp;",'"':"&quot;",
">":"&gt;","'":"&#39;"}[a]}):""},html:function(c){return c?c.replace(/&((g|l|quo)t|amp|#39|nbsp);/g,function(a){return{"&lt;":"<","&amp;":"&","&quot;":'"',"&gt;":">","&#39;":"'","&nbsp;":" "}[a]}):""},cssStyleToDomStyle:function(){var c=document.createElement("div").style,a={"float":void 0!=c.cssFloat?"cssFloat":void 0!=c.styleFloat?"styleFloat":"float"};return function(e){return a[e]||(a[e]=e.toLowerCase().replace(/-./g,function(a){return a.charAt(1).toUpperCase()}))}}(),loadFile:function(){function c(e,
d){try{for(var b=0,g;g=a[b++];)if(g.doc===e&&g.url==(d.src||d.href))return g}catch(f){return null}}var a=[];return function(e,d,b){var g=c(e,d);if(g)g.ready?b&&b():g.funs.push(b);else if(a.push({doc:e,url:d.src||d.href,funs:[b]}),!e.body){b=[];for(var f in d)"tag"!=f&&b.push(f+'="'+d[f]+'"');e.write("<"+d.tag+" "+b.join(" ")+" ></"+d.tag+">")}else if(!d.id||!e.getElementById(d.id)){var k=e.createElement(d.tag);delete d.tag;for(f in d)k.setAttribute(f,d[f]);k.onload=k.onreadystatechange=function(){if(!this.readyState||
/loaded|complete/.test(this.readyState)){g=c(e,d);if(0<g.funs.length){g.ready=1;for(var a;a=g.funs.pop();)a()}k.onload=k.onreadystatechange=null}};k.onerror=function(){throw Error("The load "+(d.href||d.src)+" fails,check the url settings of file ueditor.config.js ");};e.getElementsByTagName("head")[0].appendChild(k)}}}(),isEmptyObject:function(c){if(null==c)return!0;if(this.isArray(c)||this.isString(c))return 0===c.length;for(var a in c)if(c.hasOwnProperty(a))return!1;return!0},fixColor:function(c,
a){if(/color/i.test(c)&&/rgba?/.test(a)){var e=a.split(",");if(3<e.length)return"";a="#";for(var d=0,b;b=e[d++];)b=parseInt(b.replace(/[^\d]/gi,""),10).toString(16),a+=1==b.length?"0"+b:b;a=a.toUpperCase()}return a},optCss:function(c){function a(a,d){if(!a)return"";var f=a.top,k=a.bottom,e=a.left,c=a.right,n="";if(f&&e&&k&&c)n+=";"+d+":"+(f==k&&k==e&&e==c?f:f==k&&e==c?f+" "+e:e==c?f+" "+e+" "+k:f+" "+c+" "+k+" "+e)+";";else for(var h in a)n+=";"+d+"-"+h+":"+a[h]+";";return n}var e,d;c=c.replace(/(padding|margin|border)\-([^:]+):([^;]+);?/gi,
function(a,g,f,k){if(1==k.split(" ").length)switch(g){case "padding":return!e&&(e={}),e[f]=k,"";case "margin":return!d&&(d={}),d[f]=k,"";case "border":return"initial"==k?"":a}return a});c+=a(e,"padding")+a(d,"margin");return c.replace(/^[ \n\r\t;]*|[ \n\r\t]*$/,"").replace(/;([ \n\r\t]+)|\1;/g,";").replace(/(&((l|g)t|quot|#39))?;{2,}/g,function(a,d){return d?d+";;":";"})},clone:function(c,a){var e;a=a||{};for(var d in c)c.hasOwnProperty(d)&&(e=c[d],"object"==typeof e?(a[d]=p.isArray(e)?[]:{},p.clone(c[d],
a[d])):a[d]=e);return a},transUnitToPx:function(c){if(!/(pt|cm)/.test(c))return c;var a;c.replace(/([\d.]+)(\w+)/,function(e,d,b){c=d;a=b});switch(a){case "cm":c=25*parseFloat(c);break;case "pt":c=Math.round(96*parseFloat(c)/72)}return c+(c?"px":"")},domReady:function(){function c(e){for(e.isReady=!0;e=a.pop();e());}var a=[];return function(e,d){d=d||window;var b=d.document;e&&a.push(e);"complete"===b.readyState?c(b):(b.isReady&&c(b),q.ie&&11!=q.version?(function(){if(!b.isReady){try{b.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,
0);return}c(b)}}(),d.attachEvent("onload",function(){c(b)})):(b.addEventListener("DOMContentLoaded",function(){b.removeEventListener("DOMContentLoaded",arguments.callee,!1);c(b)},!1),d.addEventListener("load",function(){c(b)},!1)))}}(),cssRule:q.ie&&11!=q.version?function(c,a,e){var d,b;if(void 0===a||a&&a.nodeType&&9==a.nodeType){if(e=a&&a.nodeType&&9==a.nodeType?a:e||document,d=e.indexList||(e.indexList={}),b=d[c],void 0!==b)return e.styleSheets[b].cssText}else{e=e||document;d=e.indexList||(e.indexList=
{});b=d[c];if(""===a)return void 0!==b?(e.styleSheets[b].cssText="",delete d[c],!0):!1;void 0!==b?sheetStyle=e.styleSheets[b]:(sheetStyle=e.createStyleSheet("",b=e.styleSheets.length),d[c]=b);sheetStyle.cssText=a}}:function(c,a,e){var d;if(void 0===a||a&&a.nodeType&&9==a.nodeType)return e=a&&a.nodeType&&9==a.nodeType?a:e||document,(d=e.getElementById(c))?d.innerHTML:void 0;e=e||document;d=e.getElementById(c);if(""===a)return d?(d.parentNode.removeChild(d),!0):!1;d?d.innerHTML=a:(d=e.createElement("style"),
d.id=c,d.innerHTML=a,e.getElementsByTagName("head")[0].appendChild(d))},sort:function(c,a){a=a||function(a,f){return a.localeCompare(f)};for(var e=0,d=c.length;e<d;e++)for(var b=e,g=c.length;b<g;b++)if(0<a(c[e],c[b])){var f=c[e];c[e]=c[b];c[b]=f}return c},clearEmptyAttrs:function(c){for(var a in c)""===c[a]&&delete c[a];return c}};p.each("String Function Array Number RegExp Object".split(" "),function(c){UE.utils["is"+c]=function(a){return Object.prototype.toString.apply(a)=="[object "+c+"]"}});var V=
UE.EventBase=function(){};V.prototype={addListener:function(c,a){c=p.trim(c).split(/\s+/);for(var e=0,d;d=c[e++];)X(this,d,!0).push(a)},on:function(c,a){return this.addListener(c,a)},off:function(c,a){return this.removeListener(c,a)},trigger:function(){return this.fireEvent.apply(this,arguments)},removeListener:function(c,a){c=p.trim(c).split(/\s+/);for(var e=0,d;d=c[e++];)p.removeItem(X(this,d)||[],a)},fireEvent:function(){for(var c=arguments[0],c=p.trim(c).split(" "),a=0,e;e=c[a++];){var d=X(this,
e),b,g,f;if(d)for(f=d.length;f--;)if(d[f]){g=d[f].apply(this,arguments);if(!0===g)return g;void 0!==g&&(b=g)}if(g=this["on"+e.toLowerCase()])b=g.apply(this,arguments)}return b}};var v=L.dtd=function(){function c(a){for(var f in a)a[f.toUpperCase()]=a[f];return a}var a=p.extend2,e=c({isindex:1,fieldset:1}),d=c({input:1,button:1,select:1,textarea:1,label:1}),b=a(c({a:1}),d),g=a({iframe:1},b),f=c({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}),k=c({ins:1,del:1,script:1,style:1}),l=a(c({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}),k),m=a(c({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}),l),n=a(c({p:1}),m),d=a(c({iframe:1}),m,d),m=c({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}),r=a(c({a:0}),d),t=c({tr:1}),x=c({"#":1}),w=a(c({param:1}),m),u=a(c({form:1}),e,g,f,n),P=c({li:1,ol:1,ul:1}),F=c({style:1,script:1}),C=c({base:1,link:1,meta:1,title:1}),F=a(C,F),K=c({head:1,body:1}),I=c({html:1}),
q=c({address:1,blockquote:1,center:1,dir:1,div:1,dl:1,fieldset:1,form:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,hr:1,isindex:1,menu:1,noframes:1,ol:1,p:1,pre:1,table:1,ul:1}),s=c({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 c({$nonBodyContent:a(I,K,C),$block:q,$inline:r,$inlineWithA:a(c({a:1}),r),$body:a(c({script:1,style:1}),q),$cdata:c({script:1,style:1}),$empty:s,$nonChild:c({iframe:1,textarea:1}),
$listItem:c({dd:1,dt:1,li:1}),$list:c({ul:1,ol:1,dl:1}),$isNotEmpty:c({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:c({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:c({p:1,div:1}),$tableContent:c({caption:1,col:1,colgroup:1,tbody:1,td:1,tfoot:1,
th:1,thead:1,tr:1,table:1}),$notTransContent:c({pre:1,script:1,style:1,textarea:1}),html:K,head:F,style:x,script:x,body:u,base:{},link:{},meta:{},title:x,col:{},tr:c({td:1,th:1}),img:{},embed:{},colgroup:c({thead:1,col:1,tbody:1,tr:1,tfoot:1}),noscript:u,td:u,br:{},th:u,center:u,kbd:r,button:a(n,f),basefont:{},h5:r,h4:r,samp:r,h6:r,ol:P,h1:r,h3:r,option:x,h2:r,form:a(e,g,f,n),select:c({optgroup:1,option:1}),font:r,ins:r,menu:P,abbr:r,label:r,table:c({thead:1,col:1,tbody:1,tr:1,colgroup:1,caption:1,
tfoot:1}),code:r,tfoot:t,cite:r,li:u,input:{},iframe:u,strong:r,textarea:x,noframes:u,big:r,small:r,span:c({"#":1,br:1,b:1,strong:1,u:1,i:1,em:1,sub:1,sup:1,strike:1,span:1}),hr:r,dt:r,sub:r,optgroup:c({option:1}),param:{},bdo:r,"var":r,div:u,object:w,sup:r,dd:u,strike:r,area:{},dir:P,map:a(c({area:1,form:1,p:1}),e,k,f),applet:w,dl:c({dt:1,dd:1}),del:r,isindex:{},fieldset:a(c({legend:1}),m),thead:t,ul:P,acronym:r,b:r,a:a(c({a:1}),d),blockquote:a(c({td:1,tr:1,tbody:1,li:1}),u),caption:r,i:r,u:r,tbody:t,
s:r,address:a(g,n),tt:r,legend:r,q:r,pre:a(l,b),p:a(c({a:1}),r),em:r,dfn:r})}(),da=H&&9>q.version?{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"},oa=p.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".split(" ")),
c=L.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:H&&"6"==q.version?"\ufeff":"\u200b",keys:{8:1,46:1,16:1,17:1,18:1,37:1,38:1,39:1,40:1,13:1},getPosition:function(c,a){if(c===a)return 0;var e,d=[c],b=[a];for(e=c;e=e.parentNode;){if(e===a)return 10;d.push(e)}for(e=a;e=e.parentNode;){if(e===c)return 20;b.push(e)}d.reverse();
b.reverse();if(d[0]!==b[0])return 1;for(e=-1;e++,d[e]===b[e];);c=d[e];for(a=b[e];c=c.nextSibling;)if(c===a)return 4;return 2},getNodeIndex:function(c,a){for(var e=c,d=0;e=e.previousSibling;)a&&3==e.nodeType?e.nodeType!=e.nextSibling.nodeType&&d++:d++;return d},inDoc:function(h,a){return 10==c.getPosition(h,a)},findParent:function(h,a,e){if(h&&!c.isBody(h))for(h=e?h:h.parentNode;h;){if(!a||a(h)||c.isBody(h))return a&&!a(h)&&c.isBody(h)?null:h;h=h.parentNode}return null},findParentByTagName:function(h,
a,e,d){a=p.listToMap(p.isArray(a)?a:[a]);return c.findParent(h,function(b){return a[b.tagName]&&!(d&&d(b))},e)},findParents:function(h,a,e,d){for(a=a&&(e&&e(h)||!e)?[h]:[];h=c.findParent(h,e);)a.push(h);return d?a:a.reverse()},insertAfter:function(c,a){return c.nextSibling?c.parentNode.insertBefore(a,c.nextSibling):c.parentNode.appendChild(a)},remove:function(c,a){var e=c.parentNode,d;if(e){if(a&&c.hasChildNodes())for(;d=c.firstChild;)e.insertBefore(d,c);e.removeChild(c)}return c},getNextDomNode:function(c,
a,e,d){return Y(c,"firstChild","nextSibling",a,e,d)},getPreDomNode:function(c,a,e,d){return Y(c,"lastChild","previousSibling",a,e,d)},isBookmarkNode:function(c){return 1==c.nodeType&&c.id&&/^_baidu_bookmark_/i.test(c.id)},getWindow:function(c){c=c.ownerDocument||c;return c.defaultView||c.parentWindow},getCommonAncestor:function(c,a){if(c===a)return c;for(var e=[c],d=[a],b=c,g=-1;b=b.parentNode;){if(b===a)return b;e.push(b)}for(b=a;b=b.parentNode;){if(b===c)return b;d.push(b)}e.reverse();for(d.reverse();g++,
e[g]===d[g];);return 0==g?null:e[g-1]},clearEmptySibling:function(h,a,e){function d(a,d){for(var f;a&&!c.isBookmarkNode(a)&&(c.isEmptyInlineElement(a)||!RegExp("[^\t\n\r"+c.fillChar+"]").test(a.nodeValue));)f=a[d],c.remove(a),a=f}!a&&d(h.nextSibling,"nextSibling");!e&&d(h.previousSibling,"previousSibling")},split:function(h,a){var e=h.ownerDocument;if(q.ie&&a==h.nodeValue.length){var d=e.createTextNode("");return c.insertAfter(h,d)}d=h.splitText(a);q.ie8&&(e=e.createTextNode(""),c.insertAfter(d,e),
c.remove(e));return d},isWhitespace:function(h){return!RegExp("[^ \t\n\r"+c.fillChar+"]").test(h.nodeValue)},getXY:function(c){for(var a=0,e=0;c.offsetParent;)e+=c.offsetTop,a+=c.offsetLeft,c=c.offsetParent;return{x:a,y:e}},on:function(c,a,e){var d=p.isArray(a)?a:p.trim(a).split(/\s+/),b=d.length;if(b)for(;b--;)if(a=d[b],c.addEventListener)c.addEventListener(a,e,!1);else{e._d||(e._d={els:[]});var g=a+e.toString(),f=p.indexOf(e._d.els,c);e._d[g]&&-1!=f||(-1==f&&e._d.els.push(c),e._d[g]||(e._d[g]=function(a){return e.call(a.srcElement,
a||window.event)}),c.attachEvent("on"+a,e._d[g]))}c=null},un:function(c,a,e){var d=p.isArray(a)?a:p.trim(a).split(/\s+/),b=d.length;if(b)for(;b--;)if(a=d[b],c.removeEventListener)c.removeEventListener(a,e,!1);else{var g=a+e.toString();try{c.detachEvent("on"+a,e._d?e._d[g]:e)}catch(f){}e._d&&e._d[g]&&(a=p.indexOf(e._d.els,c),-1!=a&&e._d.els.splice(a,1),0==e._d.els.length&&delete e._d[g])}},isSameElement:function(h,a){if(h.tagName!=a.tagName)return!1;var e=h.attributes,d=a.attributes;if(!H&&e.length!=
d.length)return!1;for(var b,g,f=0,k=0,l=0;b=e[l++];){if("style"==b.nodeName)if(b.specified&&f++,c.isSameStyle(h,a))continue;else return!1;if(H)if(b.specified)f++,g=d.getNamedItem(b.nodeName);else continue;else g=a.attributes[b.nodeName];if(!g.specified||b.nodeValue!=g.nodeValue)return!1}if(H){for(l=0;g=d[l++];)g.specified&&k++;if(f!=k)return!1}return!0},isSameStyle:function(c,a){var e=c.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,":"),d=a.style.cssText.replace(/( ?; ?)/g,";").replace(/( ?: ?)/g,
":");if(q.opera){e=c.style;d=a.style;if(e.length!=d.length)return!1;for(var b in e)if(!/^(\d+|csstext)$/i.test(b)&&e[b]!=d[b])return!1;return!0}if(!e||!d)return e==d;e=e.split(";");d=d.split(";");if(e.length!=d.length)return!1;b=0;for(var g;g=e[b++];)if(-1==p.indexOf(d,g))return!1;return!0},isBlockElm:function(h){return 1==h.nodeType&&(v.$block[h.tagName]||oa[c.getComputedStyle(h,"display")])&&!v.$nonChild[h.tagName]},isBody:function(c){return c&&1==c.nodeType&&"body"==c.tagName.toLowerCase()},breakParent:function(h,
a){var e,d=h,b=h,g,f;do{d=d.parentNode;g?(e=d.cloneNode(!1),e.appendChild(g),g=e,e=d.cloneNode(!1),e.appendChild(f),f=e):(g=d.cloneNode(!1),f=g.cloneNode(!1));for(;e=b.previousSibling;)g.insertBefore(e,g.firstChild);for(;e=b.nextSibling;)f.appendChild(e);b=d}while(a!==d);e=a.parentNode;e.insertBefore(g,a);e.insertBefore(f,a);e.insertBefore(h,f);c.remove(a);return h},isEmptyInlineElement:function(h){if(1!=h.nodeType||!v.$removeEmpty[h.tagName])return 0;for(h=h.firstChild;h;){if(c.isBookmarkNode(h)||
1==h.nodeType&&!c.isEmptyInlineElement(h)||3==h.nodeType&&!c.isWhitespace(h))return 0;h=h.nextSibling}return 1},trimWhiteTextNode:function(h){function a(a){for(var d;(d=h[a])&&3==d.nodeType&&c.isWhitespace(d);)h.removeChild(d)}a("firstChild");a("lastChild")},mergeChild:function(h,a,e){a=c.getElementsByTagName(h,h.tagName.toLowerCase());for(var d=0,b;b=a[d++];)if(b.parentNode&&!c.isBookmarkNode(b))if("span"==b.tagName.toLowerCase()){if(h===b.parentNode&&(c.trimWhiteTextNode(h),1==h.childNodes.length)){h.style.cssText=
b.style.cssText+";"+h.style.cssText;c.remove(b,!0);continue}b.style.cssText=h.style.cssText+";"+b.style.cssText;if(e){var g=e.style;if(g)for(var g=g.split(";"),f=0,k;k=g[f++];)b.style[p.cssStyleToDomStyle(k.split(":")[0])]=k.split(":")[1]}c.isSameStyle(b,h)&&c.remove(b,!0)}else c.isSameElement(h,b)&&c.remove(b,!0)},getElementsByTagName:function(h,a,e){if(e&&p.isString(e)){var d=e;e=function(a){return c.hasClass(a,d)}}a=p.trim(a).replace(/[ ]{2,}/g," ").split(" ");for(var b=[],g=0,f;f=a[g++];){f=h.getElementsByTagName(f);
for(var k=0,l;l=f[k++];)e&&!e(l)||b.push(l)}return b},mergeToParent:function(h){for(var a=h.parentNode;a&&v.$removeEmpty[a.tagName];){if(a.tagName==h.tagName||"A"==a.tagName){c.trimWhiteTextNode(a);if("SPAN"==a.tagName&&!c.isSameStyle(a,h)||"A"==a.tagName&&"SPAN"==h.tagName)if(1<a.childNodes.length||a!==h.parentNode){h.style.cssText=a.style.cssText+";"+h.style.cssText;a=a.parentNode;continue}else a.style.cssText+=";"+h.style.cssText,"A"==a.tagName&&(a.style.textDecoration="underline");if("A"!=a.tagName){a===
h.parentNode&&c.remove(h,!0);break}}a=a.parentNode}},mergeSibling:function(h,a,e){function d(a,d,f){var k;if((k=f[a])&&!c.isBookmarkNode(k)&&1==k.nodeType&&c.isSameElement(f,k)){for(;k.firstChild;)"firstChild"==d?f.insertBefore(k.lastChild,f.firstChild):f.appendChild(k.firstChild);c.remove(k)}}!a&&d("previousSibling","firstChild",h);!e&&d("nextSibling","lastChild",h)},unSelectable:H||q.opera?function(c){c.onselectstart=function(){return!1};c.onclick=c.onkeyup=c.onkeydown=function(){return!1};c.unselectable=
"on";c.setAttribute("unselectable","on");for(var a=0,e;e=c.all[a++];)switch(e.tagName.toLowerCase()){case "iframe":case "textarea":case "input":case "select":break;default:e.unselectable="on",c.setAttribute("unselectable","on")}}:function(c){c.style.MozUserSelect=c.style.webkitUserSelect=c.style.KhtmlUserSelect="none"},removeAttributes:function(c,a){a=p.isArray(a)?a:p.trim(a).replace(/[ ]{2,}/g," ").split(" ");for(var e=0,d;d=a[e++];){d=da[d]||d;switch(d){case "className":c[d]="";break;case "style":c.style.cssText=
"",!q.ie&&c.removeAttributeNode(c.getAttributeNode("style"))}c.removeAttribute(d)}},createElement:function(h,a,e){return c.setAttributes(h.createElement(a),e)},setAttributes:function(c,a){for(var e in a)if(a.hasOwnProperty(e)){var d=a[e];switch(e){case "class":c.className=d;break;case "style":c.style.cssText=c.style.cssText+";"+d;break;case "innerHTML":c[e]=d;break;case "value":c.value=d;break;default:c.setAttribute(da[e]||e,d)}}return c},getComputedStyle:function(h,a){if(-1<"width height top left".indexOf(a))return h["offset"+
a.replace(/^\w/,function(a){return a.toUpperCase()})]+"px";3==h.nodeType&&(h=h.parentNode);if(q.ie&&9>q.version&&"font-size"==a&&!h.style.fontSize&&!v.$empty[h.tagName]&&!v.$nonChild[h.tagName]){var e=h.ownerDocument.createElement("span");e.style.cssText="padding:0;border:0;font-family:simsun;";e.innerHTML=".";h.appendChild(e);var d=e.offsetHeight;h.removeChild(e);e=null;return d+"px"}try{e=c.getStyle(h,a)||(window.getComputedStyle?c.getWindow(h).getComputedStyle(h,"").getPropertyValue(a):(h.currentStyle||
h.style)[p.cssStyleToDomStyle(a)])}catch(b){return""}return p.transUnitToPx(p.fixColor(a,e))},removeClasses:function(h,a){a=p.isArray(a)?a:p.trim(a).replace(/[ ]{2,}/g," ").split(" ");for(var e=0,d,b=h.className;d=a[e++];)b=b.replace(RegExp("\\b"+d+"\\b"),"");(b=p.trim(b).replace(/[ ]{2,}/g," "))?h.className=b:c.removeAttributes(h,["class"])},addClass:function(c,a){if(c){a=p.trim(a).replace(/[ ]{2,}/g," ").split(" ");for(var e=0,d,b=c.className;d=a[e++];)RegExp("\\b"+d+"\\b").test(b)||(b+=" "+d);
c.className=p.trim(b)}},hasClass:function(c,a){if(p.isRegExp(a))return a.test(c.className);a=p.trim(a).replace(/[ ]{2,}/g," ").split(" ");for(var e=0,d,b=c.className;d=a[e++];)if(!RegExp("\\b"+d+"\\b","i").test(b))return!1;return e-1==a.length},preventDefault:function(c){c.preventDefault?c.preventDefault():c.returnValue=!1},removeStyle:function(h,a){q.ie?("color"==a&&(a="(^|;)"+a),h.style.cssText=h.style.cssText.replace(RegExp(a+"[^:]*:[^;]+;?","ig"),"")):h.style.removeProperty?h.style.removeProperty(a):
h.style.removeAttribute(p.cssStyleToDomStyle(a));h.style.cssText||c.removeAttributes(h,["style"])},getStyle:function(c,a){var e=c.style[p.cssStyleToDomStyle(a)];return p.fixColor(a,e)},setStyle:function(c,a,e){c.style[p.cssStyleToDomStyle(a)]=e;p.trim(c.style.cssText)||this.removeAttributes(c,"style")},setStyles:function(h,a){for(var e in a)a.hasOwnProperty(e)&&c.setStyle(h,e,a[e])},removeDirtyAttr:function(c){for(var a=0,e,d=c.getElementsByTagName("*");e=d[a++];)e.removeAttribute("_moz_dirty");c.removeAttribute("_moz_dirty")},
getChildCount:function(c,a){var e=0,d=c.firstChild;for(a=a||function(){return 1};d;)a(d)&&e++,d=d.nextSibling;return e},isEmptyNode:function(h){return!h.firstChild||0==c.getChildCount(h,function(a){return!c.isBr(a)&&!c.isBookmarkNode(a)&&!c.isWhitespace(a)})},clearSelectedArr:function(h){for(var a;a=h.pop();)c.removeAttributes(a,["class"])},scrollToView:function(h,a,e){var d=function(){var d=a.document,c="CSS1Compat"==d.compatMode;return{width:(c?d.documentElement.clientWidth:d.body.clientWidth)||
0,height:(c?d.documentElement.clientHeight:d.body.clientHeight)||0}}().height;e=-1*d+e+(h.offsetHeight||0);h=c.getXY(h);e+=h.y;h=function(a){if("pageXOffset"in a)return{x:a.pageXOffset||0,y:a.pageYOffset||0};a=a.document;return{x:a.documentElement.scrollLeft||a.body.scrollLeft||0,y:a.documentElement.scrollTop||a.body.scrollTop||0}}(a).y;(e>h||e<h-d)&&a.scrollTo(0,e+(0>e?-20:20))},isBr:function(c){return 1==c.nodeType&&"BR"==c.tagName},isFillChar:function(h,a){if(3!=h.nodeType)return!1;var e=h.nodeValue;
return a?RegExp("^"+c.fillChar).test(e):!e.replace(RegExp(c.fillChar,"g"),"").length},isStartInblock:function(h){h=h.cloneRange();var a=0,e=h.startContainer,d;if(1==e.nodeType&&e.childNodes[h.startOffset])for(var e=e.childNodes[h.startOffset],b=e.previousSibling;b&&c.isFillChar(b);)e=b,b=b.previousSibling;this.isFillChar(e,!0)&&1==h.startOffset&&(h.setStartBefore(e),e=h.startContainer);for(;e&&c.isFillChar(e);)d=e,e=e.previousSibling;d&&(h.setStartBefore(d),e=h.startContainer);for(1==e.nodeType&&
(c.isEmptyNode(e)&&1==h.startOffset)&&h.setStart(e,0).collapse(!0);!h.startOffset;){e=h.startContainer;if(c.isBlockElm(e)||c.isBody(e)){a=1;break}var b=h.startContainer.previousSibling,g;if(b){for(;b&&c.isFillChar(b);)g=b,b=b.previousSibling;g?h.setStartBefore(g):h.setStartBefore(h.startContainer)}else h.setStartBefore(h.startContainer)}return a&&!c.isBody(h.startContainer)?1:0},isEmptyBlock:function(h,a){if(1!=h.nodeType)return 0;a=a||RegExp("[ \t\r\n"+c.fillChar+"]","g");if(0<h[q.ie?"innerText":
"textContent"].replace(a,"").length)return 0;for(var e in v.$isNotEmpty)if(h.getElementsByTagName(e).length)return 0;return 1},setViewportOffset:function(c,a){var e=parseInt(c.style.left)|0,d=parseInt(c.style.top)|0,b=c.getBoundingClientRect(),g=a.left-b.left,b=a.top-b.top;g&&(c.style.left=e+g+"px");b&&(c.style.top=d+b+"px")},fillNode:function(h,a){var e=q.ie?h.createTextNode(c.fillChar):h.createElement("br");a.innerHTML="";a.appendChild(e)},moveChild:function(c,a,e){for(;c.firstChild;)e&&a.firstChild?
a.insertBefore(c.lastChild,a.firstChild):a.appendChild(c.firstChild)},hasNoAttributes:function(c){return q.ie?/^<\w+\s*?>/.test(c.outerHTML):0==c.attributes.length},isCustomeNode:function(c){return 1==c.nodeType&&c.getAttribute("_ue_custom_node_")},isTagNode:function(c,a){return 1==c.nodeType&&RegExp("\\b"+c.tagName+"\\b","i").test(a)},filterNodeList:function(c,a,e){var d=[];if(!p.isFunction(a)){var b=a;a=function(a){return-1!=p.indexOf(p.isArray(b)?b:b.split(" "),a.tagName.toLowerCase())}}p.each(c,
function(b){a(b)&&d.push(b)});return 0==d.length?null:1!=d.length&&e?d:d[0]},isInNodeEndBoundary:function(c,a){var e=c.startContainer;if(3==e.nodeType&&c.startOffset!=e.nodeValue.length||1==e.nodeType&&c.startOffset!=e.childNodes.length)return 0;for(;e!==a;){if(e.nextSibling)return 0;e=e.parentNode}return 1},isBoundaryNode:function(h,a){for(var e;!c.isBody(h);)if(e=h,h=h.parentNode,e!==h[a])return!1;return!0}},O=RegExp(c.fillChar,"g");(function(){function h(a){return!a.collapsed&&1==a.startContainer.nodeType&&
a.startContainer===a.endContainer&&1==a.endOffset-a.startOffset}function a(a,f,d,b){1==f.nodeType&&(v.$empty[f.tagName]||v.$nonChild[f.tagName])&&(d=c.getNodeIndex(f)+(a?0:1),f=f.parentNode);a?(b.startContainer=f,b.startOffset=d,b.endContainer||b.collapse(!0)):(b.endContainer=f,b.endOffset=d,b.startContainer||b.collapse(!1));b.collapsed=b.startContainer&&b.endContainer&&b.startContainer===b.endContainer&&b.startOffset==b.endOffset;return b}function e(a,f){var d=a.startContainer,b=a.endContainer,k=
a.startOffset,e=a.endOffset,l=a.document,g=l.createDocumentFragment(),h,C;1==d.nodeType&&(d=d.childNodes[k]||(h=d.appendChild(l.createTextNode(""))));1==b.nodeType&&(b=b.childNodes[e]||(C=b.appendChild(l.createTextNode(""))));if(d===b&&3==d.nodeType)return g.appendChild(l.createTextNode(d.substringData(k,e-k))),f&&(d.deleteData(k,e-k),a.collapse(!0)),g;for(var p,I,q=g,s=c.findParents(d,!0),v=c.findParents(b,!0),z=0;s[z]==v[z];)z++;for(var E=z,B;B=s[E];E++){p=B.nextSibling;B==d?h||(3==a.startContainer.nodeType?
(q.appendChild(l.createTextNode(d.nodeValue.slice(k))),f&&d.deleteData(k,d.nodeValue.length-k)):q.appendChild(f?d:d.cloneNode(!0))):(I=B.cloneNode(!1),q.appendChild(I));for(;p&&p!==b&&p!==v[E];)B=p.nextSibling,q.appendChild(f?p:p.cloneNode(!0)),p=B;q=I}q=g;s[z]||(q.appendChild(s[z-1].cloneNode(!1)),q=q.firstChild);for(E=z;k=v[E];E++){p=k.previousSibling;k==b?C||3!=a.endContainer.nodeType||(q.appendChild(l.createTextNode(b.substringData(0,e))),f&&b.deleteData(0,e)):(I=k.cloneNode(!1),q.appendChild(I));
if(E!=z||!s[z])for(;p&&p!==d;)k=p.previousSibling,q.insertBefore(f?p:p.cloneNode(!0),q.firstChild),p=k;q=I}f&&a.setStartBefore(v[z]?s[z]?v[z]:s[z-1]:v[z-1]).collapse(!0);h&&c.remove(h);C&&c.remove(C);return g}function d(a,f){try{if(k&&c.inDoc(k,a))if(k.nodeValue.replace(O,"").length)k.nodeValue=k.nodeValue.replace(O,"");else{var d=k.parentNode;for(c.remove(k);d&&c.isEmptyInlineElement(d)&&(q.safari?!(c.getPosition(d,f)&c.POSITION_CONTAINS):!d.contains(f));)k=d.parentNode,c.remove(d),d=k}}catch(b){}}
function b(a,f){var d;for(a=a[f];a&&c.isFillChar(a);)d=a[f],c.remove(a),a=d}var g=0,f=c.fillChar,k,l=L.Range=function(a){this.startContainer=this.startOffset=this.endContainer=this.endOffset=null;this.document=a;this.collapsed=!0};l.prototype={cloneContents:function(){return this.collapsed?null:e(this,0)},deleteContents:function(){var a;this.collapsed||e(this,1);q.webkit&&(a=this.startContainer,3!=a.nodeType||a.nodeValue.length||(this.setStartBefore(a).collapse(!0),c.remove(a)));return this},extractContents:function(){return this.collapsed?
null:e(this,2)},setStart:function(f,d){return a(!0,f,d,this)},setEnd:function(f,d){return a(!1,f,d,this)},setStartAfter:function(a){return this.setStart(a.parentNode,c.getNodeIndex(a)+1)},setStartBefore:function(a){return this.setStart(a.parentNode,c.getNodeIndex(a))},setEndAfter:function(a){return this.setEnd(a.parentNode,c.getNodeIndex(a)+1)},setEndBefore:function(a){return this.setEnd(a.parentNode,c.getNodeIndex(a))},setStartAtFirst:function(a){return this.setStart(a,0)},setStartAtLast:function(a){return this.setStart(a,
3==a.nodeType?a.nodeValue.length:a.childNodes.length)},setEndAtFirst:function(a){return this.setEnd(a,0)},setEndAtLast:function(a){return this.setEnd(a,3==a.nodeType?a.nodeValue.length:a.childNodes.length)},selectNode:function(a){return this.setStartBefore(a).setEndAfter(a)},selectNodeContents:function(a){return this.setStart(a,0).setEndAtLast(a)},cloneRange:function(){return(new l(this.document)).setStart(this.startContainer,this.startOffset).setEnd(this.endContainer,this.endOffset)},collapse:function(a){a?
(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset=this.endOffset);this.collapsed=!0;return this},shrinkBoundary:function(a){function f(a){return 1==a.nodeType&&!c.isBookmarkNode(a)&&!v.$empty[a.tagName]&&!v.$nonChild[a.tagName]}for(var d,b=this.collapsed;1==this.startContainer.nodeType&&(d=this.startContainer.childNodes[this.startOffset])&&f(d);)this.setStart(d,0);if(b)return this.collapse(!0);if(!a)for(;1==this.endContainer.nodeType&&
0<this.endOffset&&(d=this.endContainer.childNodes[this.endOffset-1])&&f(d);)this.setEnd(d,d.childNodes.length);return this},getCommonAncestor:function(a,f){var d=this.startContainer,b=this.endContainer;return d===b?a&&h(this)&&(d=d.childNodes[this.startOffset],1==d.nodeType)?d:f&&3==d.nodeType?d.parentNode:d:c.getCommonAncestor(d,b)},trimBoundary:function(a){this.txtToElmBoundary();var f=this.startContainer,d=this.startOffset,b=this.collapsed,k=this.endContainer;if(3==f.nodeType){if(0==d)this.setStartBefore(f);
else if(d>=f.nodeValue.length)this.setStartAfter(f);else{var e=c.split(f,d);f===k?this.setEnd(e,this.endOffset-d):f.parentNode===k&&(this.endOffset+=1);this.setStartBefore(e)}if(b)return this.collapse(!0)}a||(d=this.endOffset,k=this.endContainer,3==k.nodeType&&(0==d?this.setEndBefore(k):(d<k.nodeValue.length&&c.split(k,d),this.setEndAfter(k))));return this},txtToElmBoundary:function(a){function f(a,d){var b=a[d+"Container"],c=a[d+"Offset"];if(3==b.nodeType)if(!c)a["set"+d.replace(/(\w)/,function(a){return a.toUpperCase()})+
"Before"](b);else if(c>=b.nodeValue.length)a["set"+d.replace(/(\w)/,function(a){return a.toUpperCase()})+"After"](b)}if(a||!this.collapsed)f(this,"start"),f(this,"end");return this},insertNode:function(a){var d=a,f=1;11==a.nodeType&&(d=a.firstChild,f=a.childNodes.length);this.trimBoundary(!0);var b=this.startContainer,c=b.childNodes[this.startOffset];c?b.insertBefore(a,c):b.appendChild(a);d.parentNode===this.endContainer&&(this.endOffset+=f);return this.setStartBefore(d)},setCursor:function(a,d){return this.collapse(!a).select(d)},
createBookmark:function(a,d){var f,b=this.document.createElement("span");b.style.cssText="display:none;line-height:0px;";b.appendChild(this.document.createTextNode("\u200d"));b.id="_baidu_bookmark_start_"+(d?"":g++);this.collapsed||(f=b.cloneNode(!0),f.id="_baidu_bookmark_end_"+(d?"":g++));this.insertNode(b);f&&this.collapse().insertNode(f).setEndBefore(f);this.setStartAfter(b);return{start:a?b.id:b,end:f?a?f.id:f:null,id:a}},moveToBookmark:function(a){var f=a.id?this.document.getElementById(a.start):
a.start;a=a.end&&a.id?this.document.getElementById(a.end):a.end;this.setStartBefore(f);c.remove(f);a?(this.setEndBefore(a),c.remove(a)):this.collapse(!0);return this},enlarge:function(a,f){var d=c.isBody,b,k,e=this.document.createTextNode("");if(a){k=this.startContainer;1==k.nodeType?k.childNodes[this.startOffset]?b=k=k.childNodes[this.startOffset]:(k.appendChild(e),b=k=e):b=k;for(;;){if(c.isBlockElm(k)){for(k=b;(b=k.previousSibling)&&!c.isBlockElm(b);)k=b;this.setStartBefore(k);break}b=k;k=k.parentNode}k=
this.endContainer;1==k.nodeType?((b=k.childNodes[this.endOffset])?k.insertBefore(e,b):k.appendChild(e),b=k=e):b=k;for(;;){if(c.isBlockElm(k)){for(k=b;(b=k.nextSibling)&&!c.isBlockElm(b);)k=b;this.setEndAfter(k);break}b=k;k=k.parentNode}e.parentNode===this.endContainer&&this.endOffset--;c.remove(e)}if(!this.collapsed){for(;!(0!=this.startOffset||f&&f(this.startContainer)||d(this.startContainer));)this.setStartBefore(this.startContainer);for(;!(this.endOffset!=(1==this.endContainer.nodeType?this.endContainer.childNodes.length:
this.endContainer.nodeValue.length)||f&&f(this.endContainer)||d(this.endContainer));)this.setEndAfter(this.endContainer)}return this},enlargeToBlockElm:function(a){for(;!c.isBlockElm(this.startContainer);)this.setStartBefore(this.startContainer);if(!a)for(;!c.isBlockElm(this.endContainer);)this.setEndAfter(this.endContainer);return this},adjustmentBoundary:function(){if(!this.collapsed){for(;!c.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(;!c.isBody(this.endContainer)&&!this.endOffset&&this.endContainer[3==this.endContainer.nodeType?"nodeValue":"childNodes"].length;)this.setEndBefore(this.endContainer)}return this},applyInlineStyle:function(a,f,d){if(this.collapsed)return this;this.trimBoundary().enlarge(!1,function(a){return 1==a.nodeType&&c.isBlockElm(a)}).adjustmentBoundary();for(var b=
this.createBookmark(),k=b.end,e=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!c.isWhitespace(a)},l=c.getNextDomNode(b.start,!1,e),g,h,p=this.cloneRange();l&&c.getPosition(l,k)&c.POSITION_PRECEDING;)if(3==l.nodeType||v[a][l.tagName]){p.setStartBefore(l);for(g=l;g&&(3==g.nodeType||v[a][g.tagName])&&g!==k;)h=g,g=c.getNextDomNode(g,1==g.nodeType,null,function(f){return v[a][f.tagName]});var l=p.setEndAfter(h).extractContents(),q;if(d&&0<d.length){var I;I=q=d[0].cloneNode(!1);for(var s=
1,W;W=d[s++];)q.appendChild(W.cloneNode(!1)),q=q.firstChild}else q=p.document.createElement(a);f&&c.setAttributes(q,f);q.appendChild(l);p.insertNode(d?I:q);var ca;"span"==a&&f.style&&/text\-decoration/.test(f.style)&&(ca=c.findParentByTagName(q,"a",!0))?(c.setAttributes(ca,f),c.remove(q,!0),q=ca):(c.mergeSibling(q),c.clearEmptySibling(q));c.mergeChild(q,f);l=c.getNextDomNode(q,!1,e);c.mergeToParent(q);if(g===k)break}else l=c.getNextDomNode(l,!0,e);return this.moveToBookmark(b)},removeInlineStyle:function(a){if(this.collapsed)return this;
a=p.isArray(a)?a:[a];this.shrinkBoundary().adjustmentBoundary();for(var f=this.startContainer,d=this.endContainer;;){if(1==f.nodeType){if(-1<p.indexOf(a,f.tagName.toLowerCase()))break;if("body"==f.tagName.toLowerCase()){f=null;break}}f=f.parentNode}for(;;){if(1==d.nodeType){if(-1<p.indexOf(a,d.tagName.toLowerCase()))break;if("body"==d.tagName.toLowerCase()){d=null;break}}d=d.parentNode}var b=this.createBookmark(),k,e;f&&(e=this.cloneRange().setEndBefore(b.start).setStartBefore(f),k=e.extractContents(),
e.insertNode(k),c.clearEmptySibling(f,!0),f.parentNode.insertBefore(b.start,f));d&&(e=this.cloneRange().setStartAfter(b.end).setEndAfter(d),k=e.extractContents(),e.insertNode(k),c.clearEmptySibling(d,!1,!0),d.parentNode.insertBefore(b.end,d.nextSibling));for(f=c.getNextDomNode(b.start,!1,function(a){return 1==a.nodeType});f&&f!==b.end;)d=c.getNextDomNode(f,!0,function(a){return 1==a.nodeType}),-1<p.indexOf(a,f.tagName.toLowerCase())&&c.remove(f,!0),f=d;return this.moveToBookmark(b)},getClosedNode:function(){var a;
if(!this.collapsed){var f=this.cloneRange().adjustmentBoundary().shrinkBoundary();h(f)&&(f=f.startContainer.childNodes[f.startOffset])&&(1==f.nodeType&&(v.$empty[f.tagName]||v.$nonChild[f.tagName]))&&(a=f)}return a},select:q.ie9below?function(a,e){var l;this.collapsed||this.shrinkBoundary();var g=this.getClosedNode();if(g&&!e){try{l=this.document.body.createControlRange(),l.addElement(g),l.select()}catch(h){}return this}var g=this.createBookmark(),w=g.start;l=this.document.body.createTextRange();
l.moveToElementText(w);l.moveStart("character",1);if(!this.collapsed){var u=this.document.body.createTextRange(),w=g.end;u.moveToElementText(w);l.setEndPoint("EndToEnd",u)}else if(!a&&3!=this.startContainer.nodeType){var u=this.document.createTextNode(f),P=this.document.createElement("span");P.appendChild(this.document.createTextNode(f));w.parentNode.insertBefore(P,w);w.parentNode.insertBefore(u,w);d(this.document,u);k=u;b(P,"previousSibling");b(w,"nextSibling");l.moveStart("character",-1);l.collapse(!0)}this.moveToBookmark(g);
P&&c.remove(P);try{l.select()}catch(F){}return this}:function(a){function e(a){function f(d,b,k){3==d.nodeType&&d.nodeValue.length<b&&(a[k+"Offset"]=d.nodeValue.length)}f(a.startContainer,a.startOffset,"start");f(a.endContainer,a.endOffset,"end")}var l=c.getWindow(this.document),g=l.getSelection();q.gecko?this.document.body.focus():l.focus();if(g){g.removeAllRanges();this.collapsed&&!a&&(a=l=this.startContainer,1==l.nodeType&&(a=l.childNodes[this.startOffset]),3==l.nodeType&&this.startOffset||(a?
a.previousSibling&&3==a.previousSibling.nodeType:l.lastChild&&3==l.lastChild.nodeType)||(a=this.document.createTextNode(f),this.insertNode(a),d(this.document,a),b(a,"previousSibling"),b(a,"nextSibling"),k=a,this.setStart(a,q.webkit?1:0).collapse(!0)));l=this.document.createRange();if(this.collapsed&&q.opera&&1==this.startContainer.nodeType)if(a=this.startContainer.childNodes[this.startOffset]){for(;a&&c.isBlockElm(a);)if(1==a.nodeType&&a.childNodes[0])a=a.childNodes[0];else break;a&&this.setStartBefore(a).collapse(!0)}else(a=
this.startContainer.lastChild)&&c.isBr(a)&&this.setStartBefore(a).collapse(!0);e(this);l.setStart(this.startContainer,this.startOffset);l.setEnd(this.endContainer,this.endOffset);g.addRange(l)}return this},scrollToView:function(a,f){a=a?window:c.getWindow(this.document);var d=this.document.createElement("span");d.innerHTML="&nbsp;";this.cloneRange().insertNode(d);c.scrollToView(d,a,f);c.remove(d);return this},inFillChar:function(){var a=this.startContainer;return this.collapsed&&3==a.nodeType&&a.nodeValue.replace(RegExp("^"+
c.fillChar),"").length+1==a.nodeValue.length?!0:!1},createAddress:function(a,f){function d(a){for(var b=a?k.startContainer:k.endContainer,e=c.findParents(b,!0,function(a){return!c.isBody(a)}),l=[],g=0,m;m=e[g++];)l.push(c.getNodeIndex(m,f));e=0;if(f)if(3==b.nodeType){for(b=b.previousSibling;b&&3==b.nodeType;)e+=b.nodeValue.replace(O,"").length,b=b.previousSibling;e+=a?k.startOffset:k.endOffset}else if(b=b.childNodes[a?k.startOffset:k.endOffset])e=c.getNodeIndex(b,f);else for(b=a?k.startContainer:
k.endContainer,a=b.firstChild;a;)if(c.isFillChar(a))a=a.nextSibling;else if(e++,3==a.nodeType)for(;a&&3==a.nodeType;)a=a.nextSibling;else a=a.nextSibling;else e=a?c.isFillChar(b)?0:k.startOffset:k.endOffset;0>e&&(e=0);l.push(e);return l}var b={},k=this;b.startAddress=d(!0);a||(b.endAddress=k.collapsed?[].concat(b.startAddress):d());return b},moveToAddress:function(a,f){function d(a,f){for(var k=b.document.body,c,e,l=0,g,m=a.length;l<m;l++)if(g=a[l],c=k,k=k.childNodes[g],!k){e=g;break}f?k?b.setStartBefore(k):
b.setStart(c,e):k?b.setEndBefore(k):b.setEnd(c,e)}var b=this;d(a.startAddress,!0);!f&&a.endAddress&&d(a.endAddress);return b},equals:function(a){for(var f in this)if(this.hasOwnProperty(f)&&this[f]!==a[f])return!1;return!0},traversal:function(a,f){if(this.collapsed)return this;for(var d=this.createBookmark(),b=d.end,k=c.getNextDomNode(d.start,!1,f);k&&k!==b&&c.getPosition(k,b)&c.POSITION_PRECEDING;){var e=c.getNextDomNode(k,!1,f);a(k);k=e}return this.moveToBookmark(d)}}})();(function(){function h(a,
b){var e=c.getNodeIndex;a=a.duplicate();a.collapse(b);var f=a.parentElement();if(!f.hasChildNodes())return{container:f,offset:0};for(var k=f.children,l,m=a.duplicate(),n=0,h=k.length-1,t=-1;n<=h;){t=Math.floor((n+h)/2);l=k[t];m.moveToElementText(l);var x=m.compareEndPoints("StartToStart",a);if(0<x)h=t-1;else if(0>x)n=t+1;else return{container:f,offset:e(l)}}if(-1==t){m.moveToElementText(f);m.setEndPoint("StartToStart",a);m=m.text.replace(/(\r\n|\r)/g,"\n").length;k=f.childNodes;if(!m)return l=k[k.length-
1],{container:l,offset:l.nodeValue.length};for(e=k.length;0<m;)m-=k[--e].nodeValue.length;return{container:k[e],offset:-m}}m.collapse(0<x);m.setEndPoint(0<x?"StartToStart":"EndToStart",a);m=m.text.replace(/(\r\n|\r)/g,"\n").length;if(!m)return v.$empty[l.tagName]||v.$nonChild[l.tagName]?{container:f,offset:e(l)+(0<x?0:1)}:{container:l,offset:0<x?0:l.childNodes.length};for(;0<m;)try{k=l,l=l[0<x?"previousSibling":"nextSibling"],m-=l.nodeValue.length}catch(w){return{container:f,offset:e(k)}}return{container:l,
offset:0<x?-m:l.nodeValue.length+m}}function a(a,b){if(a.item)b.selectNode(a.item(0));else{var c=h(a,!0);b.setStart(c.container,c.offset);0!=a.compareEndPoints("StartToEnd",a)&&(c=h(a,!1),b.setEnd(c.container,c.offset))}return b}function e(a){var b;try{b=a.getNative().createRange()}catch(c){return null}var f=b.item?b.item(0):b.parentElement();return(f.ownerDocument||f)===a.document?b:null}(L.Selection=function(a){var b=this;b.document=a;q.ie9below&&(a=c.getWindow(a).frameElement,c.on(a,"beforedeactivate",
function(){b._bakIERange=b.getIERange()}),c.on(a,"activate",function(){try{!e(b)&&b._bakIERange&&b._bakIERange.select()}catch(a){}b._bakIERange=null}));a=a=null}).prototype={rangeInBody:function(a,b){var e=q.ie9below||b?a.item?a.item():a.parentElement():a.startContainer;return e===this.document.body||c.inDoc(e,this.document)},getNative:function(){var a=this.document;try{return a?q.ie9below?a.selection:c.getWindow(a).getSelection():null}catch(b){return null}},getIERange:function(){var a=e(this);return!a&&
this._bakIERange?this._bakIERange:a},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 a=this.getStart();return a?c.findParents(a,!0,null,!0):[]},clear:function(){this._cachedStartElementPath=this._cachedRange=this._cachedStartElement=null},isFocus:function(){try{if(q.ie9below){var a=e(this);
return!(!a||!this.rangeInBody(a))}return!!this.getNative().rangeCount}catch(b){return!1}},getRange:function(){function d(a){for(var f=b.document.body.firstChild,d=a.collapsed;f&&f.firstChild;)a.setStart(f,0),f=f.firstChild;a.startContainer||a.setStart(b.document.body,0);d&&a.collapse(!0)}var b=this;if(null!=b._cachedRange)return this._cachedRange;var e=new s.editor.dom.Range(b.document);if(q.ie9below){var f=b.getIERange();if(f)try{a(f,e)}catch(k){d(e)}else d(e)}else{var l=b.getNative();if(l&&l.rangeCount)f=
l.getRangeAt(0),l=l.getRangeAt(l.rangeCount-1),e.setStart(f.startContainer,f.startOffset).setEnd(l.endContainer,l.endOffset),e.collapsed&&(c.isBody(e.startContainer)&&!e.startOffset)&&d(e);else{if(this._bakRange&&c.inDoc(this._bakRange.startContainer,this.document))return this._bakRange;d(e)}}return this._bakRange=e},getStart:function(){if(this._cachedStartElement)return this._cachedStartElement;var a=q.ie9below?this.getIERange():this.getRange(),b,c;if(q.ie9below){if(!a)return this.document.body.firstChild;
if(a.item)return a.item(0);b=a.duplicate();0<b.text.length&&b.moveStart("character",1);b.collapse(1);b=b.parentElement();for(c=a=a.parentElement();a=a.parentNode;)if(a==b){b=c;break}}else if(a.shrinkBoundary(),b=a.startContainer,1==b.nodeType&&b.hasChildNodes()&&(b=b.childNodes[Math.min(b.childNodes.length-1,a.startOffset)]),3==b.nodeType)return b.parentNode;return b},getText:function(){var a;return this.isFocus()&&(a=this.getNative())?(a=q.ie9below?a.createRange():a.getRangeAt(0),q.ie9below?a.text:
a.toString()):""},clearRange:function(){this.getNative()[q.ie9below?"empty":"removeAllRanges"]()}}})();(function(){function h(a,b){var d;if(b.textarea)if(p.isString(b.textarea))for(var e=0,g,h=c.getElementsByTagName(a,"textarea");g=h[e++];){if(g.id=="ueditor_textarea_"+b.options.textarea){d=g;break}}else d=b.textarea;d||(a.appendChild(d=c.createElement(document,"textarea",{name:b.options.textarea,id:"ueditor_textarea_"+b.options.textarea,style:"display:none"})),b.textarea=d);d.value=b.hasContents()?
b.options.allHtmlEnabled?b.getAllHtml():b.getContent(null,null,!0):""}function a(a){for(var b in a)return b}function e(a){a.langIsReady=!0;a.fireEvent("langReady")}var d=0,b,g=UE.Editor=function(f){var b=this;b.uid=d++;V.call(b);b.commands={};b.options=p.extend(p.clone(f||{}),UEDITOR_CONFIG,!0);b.shortcutkeys={};b.inputRules=[];b.outputRules=[];b.setOpt({isShow:!0,initialContent:"",initialStyle:"",autoClearinitialContent:!1,iframeCssUrl:b.options.UEDITOR_HOME_URL+"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:b.options.UEDITOR_HOME_URL+"lang/",theme:"default",themePath:b.options.UEDITOR_HOME_URL+"themes/",allHtmlEnabled:!1,scaleEnabled:!1,tableNativeEditInFF:!1,autoSyncData:!0});p.isEmptyObject(UE.I18N)?p.loadFile(document,{src:b.options.langPath+b.options.lang+"/"+b.options.lang+".js",tag:"script",type:"text/javascript",defer:"defer"},function(){UE.plugin.load(b);
e(b)}):(b.options.lang=a(UE.I18N),UE.plugin.load(b),e(b));UE.instants["ueditorInstant"+b.uid]=b};g.prototype={ready:function(a){a&&(this.isReady?a.apply(this):this.addListener("ready",a))},setOpt:function(a,b){var d={};p.isString(a)?d[a]=b:d=a;p.extend(this.options,d,!0)},destroy:function(){this.fireEvent("destroy");var a=this.container.parentNode,b=this.textarea;b?b.style.display="":(b=document.createElement("textarea"),a.parentNode.insertBefore(b,a));b.style.width=this.iframe.offsetWidth+"px";b.style.height=
this.iframe.offsetHeight+"px";b.value=this.getContent();b.id=this.key;a.innerHTML="";c.remove(a);var a=this.key,d;for(d in this)this.hasOwnProperty(d)&&delete this[d];UE.delEditor(a)},render:function(a){var b=this.options;p.isString(a)&&(a=document.getElementById(a));if(a){b.minFrameWidth=b.initialFrameWidth?b.initialFrameWidth:b.initialFrameWidth=a.offsetWidth;b.initialFrameHeight?b.minFrameHeight=b.initialFrameHeight:b.initialFrameHeight=b.minFrameHeight=a.offsetHeight;a.style.width=/%$/.test(b.initialFrameWidth)?
"100%":b.initialFrameWidth-parseInt(c.getComputedStyle(a,"padding-left"))-parseInt(c.getComputedStyle(a,"padding-right"))+"px";a.style.height=/%$/.test(b.initialFrameHeight)?"100%":b.initialFrameHeight-parseInt(c.getComputedStyle(a,"padding-top"))-parseInt(c.getComputedStyle(a,"padding-bottom"))+"px";a.style.zIndex=b.zIndex;var d=(H&&9>q.version?"":"<!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>"+
(b.iframeCssUrl?"<link rel='stylesheet' type='text/css' href='"+p.unhtml(b.iframeCssUrl)+"'/>":"")+(b.initialStyle?"<style>"+b.initialStyle+"</style>":"")+"</head><body class='view' ></body><script type='text/javascript' "+(H?"defer='defer'":"")+" id='_initialScript'>setTimeout(function(){editor = window.parent.UE.instants['ueditorInstant"+this.uid+"'];editor._setup(document);},0);var _tmpScript = document.getElementById('_initialScript');_tmpScript.parentNode.removeChild(_tmpScript);\x3c/script></html>";
a.appendChild(c.createElement(document,"iframe",{id:"ueditor_"+this.uid,width:"100%",height:"100%",frameborder:"0",src:"javascript:void(function(){document.open();"+(b.customDomain&&document.domain!=location.hostname?'document.domain="'+document.domain+'";':"")+'document.write("'+d+'");document.close();}())'}));a.style.overflow="hidden";setTimeout(function(){/%$/.test(b.initialFrameWidth)&&(b.minFrameWidth=b.initialFrameWidth=a.offsetWidth,a.style.width=b.initialFrameWidth+"px");/%$/.test(b.initialFrameHeight)&&
(b.minFrameHeight=b.initialFrameHeight=a.offsetHeight,a.style.height=b.initialFrameHeight+"px")})}},_setup:function(a){var b=this,d=b.options;H?(a.body.disabled=!0,a.body.contentEditable=!0,a.body.disabled=!1):a.body.contentEditable=!0;a.body.spellcheck=!1;b.document=a;b.window=a.defaultView||a.parentWindow;b.iframe=b.window.frameElement;b.body=a.body;b.selection=new L.Selection(a);var e;q.gecko&&(e=this.selection.getNative())&&e.removeAllRanges();this._initEvents();for(var g=this.iframe.parentNode;!c.isBody(g);g=
g.parentNode)if("FORM"==g.tagName){b.form=g;if(b.options.autoSyncData)c.on(b.window,"blur",function(){h(g,b)});else c.on(g,"submit",function(){h(this,b)});break}if(d.initialContent)if(d.autoClearinitialContent){var r=b.execCommand;b.execCommand=function(){b.fireEvent("firstBeforeExecCommand");return r.apply(b,arguments)};this._setDefaultContent(d.initialContent)}else this.setContent(d.initialContent,!1,!0);c.isEmptyNode(b.body)&&(b.body.innerHTML="<p>"+(q.ie?"":"<br/>")+"</p>");d.focus&&setTimeout(function(){b.focus(b.options.focusInEnd);
!b.options.autoClearinitialContent&&b._selectionChange()},0);b.container||(b.container=this.iframe.parentNode);d.fullscreen&&b.ui&&b.ui.setFullScreen(!0);try{b.document.execCommand("2D-position",!1,!1)}catch(t){}try{b.document.execCommand("enableInlineTableEditing",!1,!1)}catch(x){}try{b.document.execCommand("enableObjectResizing",!1,!1)}catch(w){}b._bindshortcutKeys();b.isReady=1;b.fireEvent("ready");d.onready&&d.onready.call(b);if(!q.ie9below)c.on(b.window,["blur","focus"],function(a){if("blur"==
a.type){b._bakRange=b.selection.getRange();try{b._bakNativeRange=b.selection.getNative().getRangeAt(0),b.selection.getNative().removeAllRanges()}catch(f){b._bakNativeRange=null}}else try{b._bakRange&&b._bakRange.select()}catch(d){}});q.gecko&&10902>=q.version&&(b.body.contentEditable=!1,setTimeout(function(){b.body.contentEditable=!0},100),setInterval(function(){b.body.style.height=b.iframe.offsetHeight-20+"px"},100));!d.isShow&&b.setHide();d.readonly&&b.setDisabled()},sync:function(a){(a=a?document.getElementById(a):
c.findParent(this.iframe.parentNode,function(a){return"FORM"==a.tagName},!0))&&h(a,this)},setHeight:function(a,b){a!==parseInt(this.iframe.parentNode.style.height)&&(this.iframe.parentNode.style.height=a+"px");!b&&(this.options.minFrameHeight=this.options.initialFrameHeight=a);this.body.style.height=a+"px"},addshortcutkey:function(a,b){var d={};b?d[a]=b:d=a;p.extend(this.shortcutkeys,d)},_bindshortcutKeys:function(){var a=this,b=this.shortcutkeys;a.addListener("keydown",function(d,e){var g=e.keyCode||
e.which,h;for(h in b)for(var t=b[h].split(","),x=0,w;w=t[x++];){w=w.split(":");var u=w[0];w=w[1];if(/^(ctrl)(\+shift)?\+(\d+)$/.test(u.toLowerCase())||/^(\d+)$/.test(u))if("ctrl"==RegExp.$1&&(e.ctrlKey||e.metaKey)&&(""!=RegExp.$2?e[RegExp.$2.slice(1)+"Key"]:1)&&g==RegExp.$3||g==RegExp.$1)-1!=a.queryCommandState(h,w)&&a.execCommand(h,w),c.preventDefault(e)}})},getContent:function(a,b,d,c,e){a&&p.isFunction(a)&&(b=a,a="");if(b?!b():!this.hasContents())return"";this.fireEvent("beforegetcontent");b=UE.htmlparser(this.body.innerHTML,
c);this.filterOutputRule(b);this.fireEvent("aftergetcontent",a,b);return b.toHtml(e)},getAllHtml:function(){var a=[];this.fireEvent("getAllHtml",a);if(q.ie&&8<q.version){var b="";p.each(this.document.styleSheets,function(a){b+=a.href?'<link rel="stylesheet" type="text/css" href="'+a.href+'" />':"<style>"+a.cssText+"</style>"});p.each(this.document.getElementsByTagName("script"),function(a){b+=a.outerHTML})}return"<html><head>"+(this.options.charset?'<meta http-equiv="Content-Type" content="text/html; charset='+
this.options.charset+'"/>':"")+(b||this.document.getElementsByTagName("head")[0].innerHTML)+a.join("\n")+"</head><body "+(H&&9>q.version?'class="view"':"")+">"+this.getContent(null,null,!0)+"</body></html>"},getPlainTxt:function(){var a=RegExp(c.fillChar,"g"),b=this.body.innerHTML.replace(/[\n\r]/g,""),b=b.replace(/<(p|div)[^>]*>(<br\/?>|&nbsp;)<\/\1>/gi,"\n").replace(/<br\/?>/gi,"\n").replace(/<[^>/]+>/g,"").replace(/(\n)?<\/([^>]+)>/g,function(a,b,d){return v.$block[d]?"\n":b?b:""});return b.replace(a,
"").replace(/\u00a0/g," ").replace(/&nbsp;/g," ")},getContentTxt:function(){return this.body[q.ie?"innerText":"textContent"].replace(RegExp(c.fillChar,"g"),"").replace(/\u00a0/g," ")},setContent:function(a,b,d){this.fireEvent("beforesetcontent",a);a=UE.htmlparser(a);this.filterInputRule(a);a=a.toHtml();this.body.innerHTML=(b?this.body.innerHTML:"")+a;if("p"==this.options.enterTag)if(b=this.body.firstChild,!b||1==b.nodeType&&(v.$cdata[b.tagName]||"DIV"==b.tagName&&b.getAttribute("cdata_tag")||c.isCustomeNode(b))&&
b===this.body.lastChild)this.body.innerHTML="<p>"+(q.ie?"&nbsp;":"<br/>")+"</p>"+this.body.innerHTML;else for(var e=this.document.createElement("p");b;){for(;b&&(3==b.nodeType||1==b.nodeType&&v.p[b.tagName]&&!v.$cdata[b.tagName]);)a=b.nextSibling,e.appendChild(b),b=a;if(e.firstChild)if(b)b.parentNode.insertBefore(e,b),e=this.document.createElement("p");else{this.body.appendChild(e);break}b=b.nextSibling}this.fireEvent("aftersetcontent");this.fireEvent("contentchange");!d&&this._selectionChange();
this._bakRange=this._bakIERange=this._bakNativeRange=null;var g;q.gecko&&(g=this.selection.getNative())&&g.removeAllRanges();this.options.autoSyncData&&this.form&&h(this.form,this)},focus:function(a){try{var b=this.selection.getRange();if(a){var d=this.body.lastChild;d&&(1==d.nodeType&&!v.$empty[d.tagName])&&(c.isEmptyBlock(d)?b.setStartAtFirst(d):b.setStartAtLast(d),b.collapse(!0));b.setCursor(!0)}else!b.collapsed&&c.isBody(b.startContainer)&&0==b.startOffset&&(d=this.body.firstChild)&&(1==d.nodeType&&
!v.$empty[d.tagName])&&b.setStartAtFirst(d).collapse(!0),b.select(!0);this.fireEvent("focus selectionchange")}catch(e){}},isFocus:function(){return this.selection.isFocus()},blur:function(){var a=this.selection.getNative();if(a.empty&&q.ie){var b=document.body.createTextRange();b.moveToElementText(document.body);b.collapse(!0);b.select();a.empty()}else a.removeAllRanges()},_initEvents:function(){var a=this,b=a.document,d=a.window;a._proxyDomEvent=p.bind(a._proxyDomEvent,a);c.on(b,"click contextmenu mousedown keydown keyup keypress mouseup mouseover mouseout selectstart".split(" "),
a._proxyDomEvent);c.on(d,["focus","blur"],a._proxyDomEvent);c.on(a.body,"drop",function(b){q.gecko&&b.stopPropagation&&b.stopPropagation();a.fireEvent("contentchange")});c.on(b,["mouseup","keydown"],function(b){"keydown"==b.type&&(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)||2!=b.button&&a._selectionChange(250,b)})},_proxyDomEvent:function(a){return this.fireEvent(a.type.replace(/^on/,""),a)},_selectionChange:function(a,d){var c=this,e=!1,g,h;q.ie&&(9>q.version&&d&&"mouseup"==d.type)&&!this.selection.getRange().collapsed&&
(e=!0,g=d.clientX,h=d.clientY);clearTimeout(b);b=setTimeout(function(){if(c.selection.getNative()){var a;if(e&&"None"==c.selection.getNative().type){a=c.document.body.createTextRange();try{a.moveToPoint(g,h)}catch(b){a=null}}var f;a&&(f=c.selection.getIERange,c.selection.getIERange=function(){return a});c.selection.cache();f&&(c.selection.getIERange=f);c.selection._cachedRange&&c.selection._cachedStartElement&&(c.fireEvent("beforeselectionchange"),c.fireEvent("selectionchange",!!d),c.fireEvent("afterselectionchange"),
c.selection.clear())}},a||50)},_callCmdFn:function(a,b){var d=b[0].toLowerCase(),c;c=(d=this.commands[d]||UE.commands[d])&&d[a];if(!(d&&c||"queryCommandState"!=a))return 0;if(c)return c.apply(this,b)},execCommand:function(a){a=a.toLowerCase();var b,d=this.commands[a]||UE.commands[a];if(!d||!d.execCommand)return null;d.notNeedUndo||this.__hasEnterExecCommand?(b=this._callCmdFn("execCommand",arguments),this.__hasEnterExecCommand||(d.ignoreContentChange||this._ignoreContentChange)||this.fireEvent("contentchange")):
(this.__hasEnterExecCommand=!0,-1!=this.queryCommandState.apply(this,arguments)&&(this.fireEvent("saveScene"),this.fireEvent("beforeexeccommand",a),b=this._callCmdFn("execCommand",arguments),d.ignoreContentChange||this._ignoreContentChange||this.fireEvent("contentchange"),this.fireEvent("afterexeccommand",a),this.fireEvent("saveScene")),this.__hasEnterExecCommand=!1);this.__hasEnterExecCommand||(d.ignoreContentChange||this._ignoreContentChange)||this._selectionChange();return b},queryCommandState:function(a){return this._callCmdFn("queryCommandState",
arguments)},queryCommandValue:function(a){return this._callCmdFn("queryCommandValue",arguments)},hasContents:function(a){if(a)for(var b=0,d;d=a[b++];)if(0<this.document.getElementsByTagName(d).length)return!0;if(!c.isEmptyBlock(this.body))return!0;a=["div"];for(b=0;d=a[b++];){d=c.getElementsByTagName(this.document,d);for(var e=0,g;g=d[e++];)if(c.isCustomeNode(g))return!0}return!1},reset:function(){this.fireEvent("reset")},setEnabled:function(){var a;if("false"==this.body.contentEditable){this.body.contentEditable=
!0;a=this.selection.getRange();try{a.moveToBookmark(this.lastBk),delete this.lastBk}catch(b){a.setStartAtFirst(this.body).collapse(!0)}a.select(!0);this.bkqueryCommandState&&(this.queryCommandState=this.bkqueryCommandState,delete this.bkqueryCommandState);this.fireEvent("selectionchange")}},enable:function(){return this.setEnabled()},setDisabled:function(a){var b=this;a=a?p.isArray(a)?a:[a]:[];"true"==b.body.contentEditable&&(b.lastBk||(b.lastBk=b.selection.getRange().createBookmark(!0)),b.body.contentEditable=
!1,b.bkqueryCommandState=b.queryCommandState,b.queryCommandState=function(d){return-1!=p.indexOf(a,d)?b.bkqueryCommandState.apply(b,arguments):-1},b.fireEvent("selectionchange"))},disable:function(a){return this.setDisabled(a)},_setDefaultContent:function(){function a(){var b=this;b.document.getElementById("initContent")&&(b.body.innerHTML="<p>"+(H?"":"<br/>")+"</p>",b.removeListener("firstBeforeExecCommand focus",a),setTimeout(function(){b.focus();b._selectionChange()},0))}return function(b){this.body.innerHTML=
'<p id="initContent">'+b+"</p>";this.addListener("firstBeforeExecCommand focus",a)}}(),setShow:function(){var a=this.selection.getRange();if("none"==this.container.style.display){try{a.moveToBookmark(this.lastBk),delete this.lastBk}catch(b){a.setStartAtFirst(this.body).collapse(!0)}setTimeout(function(){a.select(!0)},100);this.container.style.display=""}},show:function(){return this.setShow()},setHide:function(){this.lastBk||(this.lastBk=this.selection.getRange().createBookmark(!0));this.container.style.display=
"none"},hide:function(){return this.setHide()},getLang:function(a){var b=UE.I18N[this.options.lang];if(!b)throw Error("not import language file");a=(a||"").split(".");for(var d=0,c;(c=a[d++])&&(b=b[c],b););return b},getContentLength:function(a,b){var d=this.getContent(!1,!1,!0).length;if(a){b=(b||[]).concat(["hr","img","iframe"]);for(var d=this.getContentTxt().replace(/[\t\r\n]+/g,"").length,c=0,e;e=b[c++];)d+=this.document.getElementsByTagName(e).length}return d},addInputRule:function(a){this.inputRules.push(a)},
filterInputRule:function(a){for(var b=0,d;d=this.inputRules[b++];)d.call(this,a)},addOutputRule:function(a){this.outputRules.push(a)},filterOutputRule:function(a){for(var b=0,d;d=this.outputRules[b++];)d.call(this,a)}};p.inherits(g,V)})();UE.ajax=function(){function c(a){var b=[],d;for(d in a)"method"!=d&&"timeout"!=d&&"async"!=d&&"function"!=(typeof a[d]).toLowerCase()&&"object"!=(typeof a[d]).toLowerCase()&&b.push(encodeURIComponent(d)+"="+encodeURIComponent(a[d]));return b.join("&")}var a="XMLHttpRequest()";
try{new ActiveXObject("Msxml2.XMLHTTP"),a="ActiveXObject('Msxml2.XMLHTTP')"}catch(e){try{new ActiveXObject("Microsoft.XMLHTTP"),a="ActiveXObject('Microsoft.XMLHTTP')"}catch(d){}}var b=new Function("return new "+a);return{request:function(a,d){var e=b(),l=!1,m={method:"POST",timeout:5E3,async:!0,data:{},onsuccess:function(){},onerror:function(){}};"object"===typeof a&&(d=a,a=d.url);if(e&&a){var n=d?p.extend(m,d):m,m=c(n);p.isEmptyObject(n.data)||(m+=(m?"&":"")+c(n.data));var r=setTimeout(function(){4!=
e.readyState&&(l=!0,e.abort(),clearTimeout(r))},n.timeout),t=n.method.toUpperCase(),x=a+(-1==a.indexOf("?")?"?":"&")+("POST"==t?"":m+"&noCache="+ +new Date);e.open(t,x,n.async);e.onreadystatechange=function(){if(4==e.readyState)if(l||200!=e.status)n.onerror(e);else n.onsuccess(e)};"POST"==t?(e.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),e.send(m)):e.send(null)}}}}();UE.filterWord=function(){function c(a){return a=a.replace(/[\d.]+\w+/g,function(a){return p.transUnitToPx(a)})}
function a(a){return a.replace(/[\t\r\n]+/g," ").replace(/\x3c!--[\s\S]*?--\x3e/ig,"").replace(/<v:shape [^>]*>[\s\S]*?.<\/v:shape>/gi,function(a){if(q.opera)return"";try{var b=a.match(/width:([ \d.]*p[tx])/i)[1],e=a.match(/height:([ \d.]*p[tx])/i)[1],f=a.match(/src=\s*"([^"]*)"/i)[1];return'<img width="'+c(b)+'" height="'+c(e)+'" src="'+f+'" />'}catch(k){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/ig,function(a,b,c,f){return"class"==b&&"MsoListParagraph"==f?a:""}).replace(/<(font|span)[^>]*>(\s*)<\/\1>/gi,function(a,b,c){return c.replace(/[\t\r\n ]+/g," ")}).replace(/(<[a-z][^>]*)\sstyle=(["'])([^\2]*?)\2/gi,function(a,b,e,f){a=[];f=f.replace(/^\s+|\s+$/,"").replace(/&#39;/g,"'").replace(/&quot;/gi,"'").split(/;\s*/g);e=0;for(var k;k=f[e];e++){var l,
m=k.split(":");if(2==m.length&&(k=m[0].toLowerCase(),l=m[1].toLowerCase(),!(/^(background)\w*/.test(k)&&0==l.replace(/(initial|\s)/g,"").length||/^(margin)\w*/.test(k)&&/^0\w+$/.test(l)))){switch(k){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(b)||
(a[e]=k.replace(/^mso-|-alt$/g,"")+":"+c(l));continue;case "horiz-align":a[e]="text-align:"+l;continue;case "vert-align":a[e]="vertical-align:"+l;continue;case "font-color":case "mso-foreground":a[e]="color:"+l;continue;case "mso-background":case "mso-highlight":a[e]="background:"+l;continue;case "mso-default-height":a[e]="min-height:"+c(l);continue;case "mso-default-width":a[e]="min-width:"+c(l);continue;case "mso-padding-between-alt":a[e]="border-collapse:separate;border-spacing:"+c(l);continue;
case "text-line-through":if("single"==l||"double"==l)a[e]="text-decoration:line-through";continue;case "mso-zero-height":"yes"==l&&(a[e]="display:none");continue;case "margin":if(!/[1-9]/.test(l))continue}/^(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(k)||/text\-indent|padding|margin/.test(k)&&/\-[\d.]+/.test(l)||(a[e]=k+":"+m[1])}}return b+(a.length?' style="'+a.join(";").replace(/;{2,}/g,
";")+'"':"")}).replace(/[\d.]+(cm|pt)/g,function(a){return p.transUnitToPx(a)})}return function(c){return/(class="?Mso|style="[^"]*\bmso\-|w:WordDocument|<(v|o):|lang=)/ig.test(c)?a(c):c}}();(function(){function c(a,b,d){a.push(r);return b+(d?1:-1)}function a(a,b){for(var d=0;d<b;d++)a.push(n)}function e(b,f,l,k){switch(b.type){case "root":for(var g=0,n;n=b.children[g++];)l&&("element"==n.type&&!v.$inlineWithA[n.tagName]&&1<g)&&(c(f,k,!0),a(f,k)),e(n,f,l,k);break;case "text":f.push(m[b.parentNode.tagName]?
b.data:b.data.replace(/[ ]{2}/g," &nbsp;"));break;case "element":d(b,f,l,k);break;case "comment":f.push("\x3c!--"+b.data+"--\x3e")}return f}function d(b,d,f,k){var g="";if(b.attrs){var g=[],m=b.attrs,n;for(n in m)g.push(n+(void 0!==m[n]?'="'+(l[n]?p.html(m[n]).replace(/["]/g,function(a){return"&quot;"}):p.unhtml(m[n]))+'"':""));g=g.join(" ")}d.push("<"+b.tagName+(g?" "+g:"")+(v.$empty[b.tagName]?"/":"")+">");f&&(!v.$inlineWithA[b.tagName]&&"pre"!=b.tagName)&&(b.children&&b.children.length)&&(k=c(d,
k,!0),a(d,k));if(b.children&&b.children.length)for(g=0;m=b.children[g++];)f&&("element"==m.type&&!v.$inlineWithA[m.tagName]&&1<g)&&(c(d,k),a(d,k)),e(m,d,f,k);v.$empty[b.tagName]||(f&&(!v.$inlineWithA[b.tagName]&&"pre"!=b.tagName)&&(b.children&&b.children.length)&&(k=c(d,k),a(d,k)),d.push("</"+b.tagName+">"))}function b(a,d){var c;if("element"==a.type&&a.getAttr("id")==d)return a;if(a.children&&a.children.length)for(var f=0;c=a.children[f++];)if(c=b(c,d))return c}function g(a,b,d){"element"==a.type&&
a.tagName==b&&d.push(a);if(a.children&&a.children.length)for(var c=0,f;f=a.children[c++];)g(f,b,d)}function f(a,b){if(a.children&&a.children.length)for(var d=0,c;c=a.children[d];)f(c,b),c.parentNode&&(c.children&&c.children.length&&b(c),c.parentNode&&d++);else b(a)}var k=UE.uNode=function(a){this.type=a.type;this.data=a.data;this.tagName=a.tagName;this.parentNode=a.parentNode;this.attrs=a.attrs||{};this.children=a.children},l={href:1,src:1,_src:1,_href:1},m={pre:1,style:1,script:1},n=" ",r="\n";
k.createElement=function(a){return/[<>]/.test(a)?UE.htmlparser(a).children[0]:new k({type:"element",children:[],tagName:a})};k.createText=function(a,b){return new UE.uNode({type:"text",data:b?a:p.unhtml(a||"")})};k.prototype={toHtml:function(a){var b=[];e(this,b,a,0);return b.join("")},innerHTML:function(a){if("element"!=this.type||v.$empty[this.tagName])return this;if(p.isString(a)){if(this.children)for(var b=0,d;d=this.children[b++];)d.parentNode=null;this.children=[];a=UE.htmlparser(a);for(b=0;d=
a.children[b++];)this.children.push(d),d.parentNode=this;return this}a=new UE.uNode({type:"root",children:this.children});return a.toHtml()},innerText:function(a,b){if("element"!=this.type||v.$empty[this.tagName])return this;if(a){if(this.children)for(var d=0,c;c=this.children[d++];)c.parentNode=null;this.children=[];this.appendChild(k.createText(a,b));return 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 a=this.parentNode,b=0,d;d=a.children[b];b++)if(d===this)return 0==b?null:a.children[b-1]},nextSibling:function(){for(var a=this.parentNode,b=0,d;d=a.children[b++];)if(d===this)return a.children[b]},replaceChild:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var d=0,c;c=this.children[d];d++)if(c===b)return this.children.splice(d,
1,a),b.parentNode=null,a.parentNode=this,a}},appendChild:function(a){if("root"==this.type||"element"==this.type&&!v.$empty[this.tagName]){this.children||(this.children=[]);a.parentNode&&a.parentNode.removeChild(a);for(var b=0,d;d=this.children[b];b++)if(d===a){this.children.splice(b,1);break}this.children.push(a);a.parentNode=this;return a}},insertBefore:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var d=0,c;c=this.children[d];d++)if(c===b)return this.children.splice(d,
0,a),a.parentNode=this,a}},insertAfter:function(a,b){if(this.children){a.parentNode&&a.parentNode.removeChild(a);for(var d=0,c;c=this.children[d];d++)if(c===b)return this.children.splice(d+1,0,a),a.parentNode=this,a}},removeChild:function(a,b){if(this.children)for(var d=0,c;c=this.children[d];d++)if(c===a){this.children.splice(d,1);c.parentNode=null;if(b&&c.children&&c.children.length)for(var f=0,e;e=c.children[f];f++)this.children.splice(d+f,0,e),e.parentNode=this;return c}},getAttr:function(a){return this.attrs&&
this.attrs[a.toLowerCase()]},setAttr:function(a,b){if(a)if(this.attrs||(this.attrs={}),p.isObject(a))for(var d in a)a[d]?this.attrs[d.toLowerCase()]=a[d]:delete this.attrs[d];else b?this.attrs[a.toLowerCase()]=b:delete this.attrs[a];else delete this.attrs},getIndex:function(){for(var a=this.parentNode,b=0,d;d=a.children[b];b++)if(d===this)return b;return-1},getNodeById:function(a){var d;if(this.children&&this.children.length)for(var c=0;d=this.children[c++];)if(d=b(d,a))return d},getNodesByTagName:function(a){a=
p.trim(a).replace(/[ ]{2,}/g," ").split(" ");var b=[],d=this;p.each(a,function(a){if(d.children&&d.children.length)for(var c=0,f;f=d.children[c++];)g(f,a,b)});return b},getStyle:function(a){var b=this.getAttr("style");return b?(a=b.match(RegExp("(^|;)\\s*"+a+":([^;]+)","i")))&&a[0]?a[2]:"":""},setStyle:function(a,b){function d(a,b){c=c.replace(RegExp("(^|;)\\s*"+a+":([^;]+;?)","gi"),"$1");b&&(c=a+":"+p.unhtml(b)+";"+c)}var c=this.getAttr("style");c||(c="");if(p.isObject(a))for(var f in a)d(f,a[f]);
else d(a,b);this.setAttr("style",p.trim(c))},traversal:function(a){this.children&&this.children.length&&f(this,a);return this}}})();UE.htmlparser=function(h,a){function e(a,b){if(n[a.tagName]){var d=l.createElement(n[a.tagName]);a.appendChild(d);d.appendChild(l.createText(b))}else a.appendChild(l.createText(b))}function d(a,b,c){var f;if(f=m[b]){for(var e=a,n;"root"!=e.type;){if(p.isArray(f)?-1!=p.indexOf(f,e.tagName):f==e.tagName){a=e;n=!0;break}e=e.parentNode}n||(a=d(a,p.isArray(f)?f[0]:f))}f=new l({parentNode:a,
type:"element",tagName:b.toLowerCase(),children:v.$empty[b]?null:[]});if(c){for(e={};n=g.exec(c);)e[n[1].toLowerCase()]=k[n[1].toLowerCase()]?n[2]||n[3]||n[4]:p.unhtml(n[2]||n[3]||n[4]);f.attrs=e}a.children.push(f);return v.$empty[b]?a:f}var b=/<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)--\x3e)|(?:([^\s\/>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>\/])*)\/?>))/g,g=/([\w\-:.]+)(?:(?:\s*=\s*(?:(?:"([^"]*)")|(?:'([^']*)')|([^\s>]+)))|(?=\s|$))/g,f={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};h=h.replace(RegExp(c.fillChar,"g"),"");a||(h=h.replace(RegExp("[\\r\\t\\n"+(a?"":" ")+"]*</?(\\w+)\\s*(?:[^>]*)>[\\r\\t\\n"+(a?"":" ")+"]*","g"),function(b,d){return d&&f[d.toLowerCase()]?b.replace(/(^[\n\r]+)|([\n\r]+$)/g,""):b.replace(RegExp("^[\\r\\n"+(a?"":" ")+"]+"),"").replace(RegExp("[\\r\\n"+(a?"":" ")+"]+$"),"")}));for(var k={href:1,src:1},l=UE.uNode,m={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"},n={ol:"li",ul:"li"},r,t=0,x=0,w=new l({type:"root",children:[]}),u=w;r=b.exec(h);){t=r.index;try{if(t>x&&e(u,h.slice(x,t)),r[3])v.$cdata[u.tagName]?e(u,r[0]):u=d(u,r[3].toLowerCase(),r[4]);else if(r[1]){if("root"!=u.type)if(v.$cdata[u.tagName]&&!v.$cdata[r[1]])e(u,r[0]);else{for(t=u;"element"==u.type&&u.tagName!=r[1].toLowerCase();)if(u=u.parentNode,"root"==u.type)throw u=t,"break";u=u.parentNode}}else r[2]&&u.children.push(new l({type:"comment",
data:r[2],parentNode:u}))}catch(P){}x=b.lastIndex}x<h.length&&e(u,h.slice(x));return w};UE.filterNode=function(){function c(a,e){switch(a.type){case "element":var d;if(d=e[a.tagName])if("-"===d)a.parentNode.removeChild(a);else if(p.isFunction(d)){var b=a.parentNode,g=a.getIndex();d(a);if(a.parentNode){if(a.children)for(d=0;g=a.children[d];)c(g,e),g.parentNode&&d++}else for(d=g;g=b.children[d];)c(g,e),g.parentNode&&d++}else{if((d=d.$)&&a.attrs){var g={},f;for(b in d){f=a.getAttr(b);if("style"==b&&
p.isArray(d[b])){var k=[];p.each(d[b],function(b){var d;(d=a.getStyle(b))&&k.push(b+":"+d)});f=k.join(";")}f&&(g[b]=f)}a.attrs=g}if(a.children)for(d=0;g=a.children[d];)c(g,e),g.parentNode&&d++}else if(v.$cdata[a.tagName])a.parentNode.removeChild(a);else for(b=a.parentNode,g=a.getIndex(),a.parentNode.removeChild(a,!0),d=g;g=b.children[d];)c(g,e),g.parentNode&&d++;break;case "comment":a.parentNode.removeChild(a)}}return function(a,e){if(p.isEmptyObject(e))return a;var d;(d=e["-"])&&p.each(d.split(" "),
function(a){e[a]="-"});d=0;for(var b;b=a.children[d];)c(b,e),b.parentNode&&d++;return a}}();UE.plugin=function(){var c={};return{register:function(a,e,d,b){d&&p.isFunction(d)&&(b=d,d=null);c[a]={optionName:d||a,execFn:e,afterDisabled:b}},load:function(a){p.each(c,function(c){var d=c.execFn.call(a);!1!==a.options[c.optionName]?d&&p.each(d,function(b,d){switch(d.toLowerCase()){case "shortcutkey":a.addshortcutkey(b);break;case "bindevents":p.each(b,function(b,d){a.addListener(d,b)});break;case "bindmultievents":p.each(p.isArray(b)?
b:[b],function(b){var d=p.trim(b.type).split(/\s+/);p.each(d,function(d){a.addListener(d,b.handler)})});break;case "commands":p.each(b,function(b,d){a.commands[d]=b});break;case "outputrule":a.addOutputRule(b);break;case "inputrule":a.addInputRule(b);break;case "defaultoptions":a.setOpt(b)}}):c.afterDisabled&&c.afterDisabled.call(a)});p.each(UE.plugins,function(c){c.call(a)})},run:function(a,e){var d=c[pluginName];d&&d.exeFn.call(e)}}}();UE.plugins.defaultfilter=function(){var c=this;c.setOpt("allowDivTransToP",
!0);c.addInputRule(function(a){var e=this.options.allowDivTransToP,d;a.traversal(function(a){if("element"==a.type){if(!v.$cdata[a.tagName]&&c.options.autoClearEmptyNode&&v.$inline[a.tagName]&&!v.$empty[a.tagName]&&(!a.attrs||p.isEmptyObject(a.attrs))){a.firstChild()?"span"!=a.tagName||a.attrs&&!p.isEmptyObject(a.attrs)||a.parentNode.removeChild(a,!0):a.parentNode.removeChild(a);return}switch(a.tagName){case "style":case "script":a.setAttr({cdata_tag:a.tagName,style:"display:none"});a.tagName="div";
break;case "a":(d=a.getAttr("href"))&&a.setAttr("_href",d);break;case "img":if((d=a.getAttr("src"))&&/^data:/.test(d)){a.parentNode.removeChild(a);break}a.setAttr("_src",a.getAttr("src"));break;case "span":q.webkit&&(d=a.getStyle("white-space"))&&/nowrap|normal/.test(d)&&(a.setStyle("white-space",""),c.options.autoClearEmptyNode&&p.isEmptyObject(a.attrs)&&a.parentNode.removeChild(a,!0));break;case "p":if(d=a.getAttr("align"))a.setAttr("align"),a.setStyle("text-align",d);a.firstChild()||a.innerHTML(q.ie?
"&nbsp;":"<br/>");break;case "div":if(a.getAttr("cdata_tag"))break;if((d=a.getAttr("class"))&&/^line number\d+/.test(d))break;if(!e)break;for(var g,f=UE.uNode.createElement("p");g=a.firstChild();)"text"!=g.type&&UE.dom.dtd.$block[g.tagName]?f.firstChild()?(a.parentNode.insertBefore(f,a),f=UE.uNode.createElement("p")):a.parentNode.insertBefore(g,a):f.appendChild(g);f.firstChild()&&a.parentNode.insertBefore(f,a);a.parentNode.removeChild(a);break;case "dl":a.tagName="ul";break;case "dt":case "dd":a.tagName=
"li";break;case "li":(g=a.getAttr("class"))&&/list\-/.test(g)||a.setAttr();g=a.getNodesByTagName("ol ul");UE.utils.each(g,function(d){a.parentNode.insertAfter(d,a)});break;case "td":case "th":case "caption":a.children&&a.children.length||a.appendChild(q.ie?UE.uNode.createText(" "):UE.uNode.createElement("br"))}}"comment"==a.type&&a.parentNode.removeChild(a)})});c.addOutputRule(function(a){var e;a.traversal(function(a){if("element"==a.type)if(!c.options.autoClearEmptyNode||!v.$inline[a.tagName]||v.$empty[a.tagName]||
a.attrs&&!p.isEmptyObject(a.attrs))switch(a.tagName){case "div":if(e=a.getAttr("cdata_tag"))a.tagName=e,a.setAttr({cdata_tag:"",style:""}),a.innerText(p.html(a.innerText()),!0);break;case "a":(e=a.getAttr("_href"))&&a.setAttr({href:p.html(e),_href:""});break;case "img":(e=a.getAttr("_src"))&&a.setAttr({src:a.getAttr("_src"),_src:""})}else a.firstChild()?"span"!=a.tagName||a.attrs&&!p.isEmptyObject(a.attrs)||a.parentNode.removeChild(a,!0):a.parentNode.removeChild(a)})})};UE.commands.inserthtml={execCommand:function(h,
a,e){var d=this,b;if(a&&!0!==d.fireEvent("beforeinserthtml",a)){b=d.selection.getRange();h=b.document.createElement("div");h.style.display="inline";e||(a=UE.htmlparser(a),d.options.filterRules&&UE.filterNode(a,d.options.filterRules),d.filterInputRule(a),a=a.toHtml());h.innerHTML=p.trim(a);if(!b.collapsed&&(a=b.startContainer,c.isFillChar(a)&&b.setStartBefore(a),a=b.endContainer,c.isFillChar(a)&&b.setEndAfter(a),b.txtToElmBoundary(),b.endContainer&&1==b.endContainer.nodeType&&(a=b.endContainer.childNodes[b.endOffset])&&
c.isBr(a)&&b.setEndAfter(a),0==b.startOffset&&(a=b.startContainer,c.isBoundaryNode(a,"firstChild")&&(a=b.endContainer,b.endOffset==(3==a.nodeType?a.nodeValue.length:a.childNodes.length)&&c.isBoundaryNode(a,"lastChild")&&(d.body.innerHTML="<p>"+(q.ie?"":"<br/>")+"</p>",b.setStart(d.body.firstChild,0).collapse(!0)))),!b.collapsed&&b.deleteContents(),1==b.startContainer.nodeType)){a=b.startContainer.childNodes[b.startOffset];var g;if(a&&c.isBlockElm(a)&&(g=a.previousSibling)&&c.isBlockElm(g)){for(b.setEnd(g,
g.childNodes.length).collapse();a.firstChild;)g.appendChild(a.firstChild);c.remove(a)}}var f,k;e=0;var l;b.inFillChar()&&(a=b.startContainer,c.isFillChar(a)?(b.setStartBefore(a).collapse(!0),c.remove(a)):c.isFillChar(a,!0)&&(a.nodeValue=a.nodeValue.replace(O,""),b.startOffset--,b.collapsed&&b.collapse(!0)));var m=c.findParentByTagName(b.startContainer,"li",!0);if(m){for(var n;a=h.firstChild;){for(;a&&(3==a.nodeType||!c.isBlockElm(a)||"HR"==a.tagName);)n=a.nextSibling,b.insertNode(a).collapse(),f=
a,a=n;if(a)if(/^(ol|ul)$/i.test(a.tagName)){for(;a.firstChild;)f=a.firstChild,c.insertAfter(m,a.firstChild),m=m.nextSibling;c.remove(a)}else n=a.nextSibling,g=d.document.createElement("li"),c.insertAfter(m,g),g.appendChild(a),f=a,a=n,m=g}m=c.findParentByTagName(b.startContainer,"li",!0);c.isEmptyBlock(m)&&c.remove(m);f&&b.setStartAfter(f).collapse(!0).select(!0)}else{for(;a=h.firstChild;){if(e){for(f=d.document.createElement("p");a&&(3==a.nodeType||!v.$block[a.tagName]);)l=a.nextSibling,f.appendChild(a),
a=l;f.firstChild&&(a=f)}b.insertNode(a);l=a.nextSibling;if(!e&&a.nodeType==c.NODE_ELEMENT&&c.isBlockElm(a)&&(f=c.findParent(a,function(a){return c.isBlockElm(a)}))&&"body"!=f.tagName.toLowerCase()&&(!v[f.tagName][a.nodeName]||a.parentNode!==f)){if(v[f.tagName][a.nodeName])for(k=a.parentNode;k!==f;)g=k,k=k.parentNode;else g=f;c.breakParent(a,g||k);g=a.previousSibling;c.trimWhiteTextNode(g);g.childNodes.length||c.remove(g);!q.ie&&((n=a.nextSibling)&&c.isBlockElm(n)&&n.lastChild&&!c.isBr(n.lastChild))&&
n.appendChild(d.document.createElement("br"));e=1}n=a.nextSibling;if(!h.firstChild&&n&&c.isBlockElm(n)){b.setStart(n,0).collapse(!0);break}b.setEndAfter(a).collapse()}a=b.startContainer;l&&c.isBr(l)&&c.remove(l);if(c.isBlockElm(a)&&c.isEmptyNode(a))if(l=a.nextSibling)c.remove(a),1==l.nodeType&&v.$block[l.tagName]&&b.setStart(l,0).collapse(!0).shrinkBoundary();else try{a.innerHTML=q.ie?c.fillChar:"<br/>"}catch(r){b.setStartBefore(a),c.remove(a)}try{b.select(!0)}catch(t){}}setTimeout(function(){b=d.selection.getRange();
b.scrollToView(d.autoHeightEnabled,d.autoHeightEnabled?c.getXY(d.iframe).y:0);d.fireEvent("afterinserthtml")},200)}}};UE.plugins.autotypeset=function(){function h(a,b){if(!a||3==a.nodeType)return 0;if(c.isBr(a))return 1;if(a&&a.parentNode&&k[a.tagName.toLowerCase()])return l&&l.contains(a)||a.getAttribute("pagebreak")?0:b?!c.isEmptyBlock(a):c.isEmptyBlock(a,RegExp("[\\s"+c.fillChar+"]","g"))}function a(a){a.style.cssText||(c.removeAttributes(a,["style"]),"span"==a.tagName.toLowerCase()&&c.hasNoAttributes(a)&&
c.remove(a,!0))}function e(d,e){var k;if(e){if(!b.pasteFilter)return;k=this.document.createElement("div");k.innerHTML=e.html}else k=this.document.body;for(var t=c.getElementsByTagName(k,"*"),x=0,w;w=t[x++];)if(!0!==this.fireEvent("excludeNodeinautotype",w)){b.clearFontSize&&w.style.fontSize&&(c.removeStyle(w,"font-size"),a(w));b.clearFontFamily&&w.style.fontFamily&&(c.removeStyle(w,"font-family"),a(w));if(h(w)){if(b.mergeEmptyline)for(var u=w.nextSibling,p,F=c.isBr(w);h(u);){p=u;u=p.nextSibling;if(F&&
(!u||u&&!c.isBr(u)))break;c.remove(p)}if(b.removeEmptyline&&c.inDoc(w,k)&&!f[w.parentNode.tagName.toLowerCase()]){if(c.isBr(w)&&(u=w.nextSibling)&&!c.isBr(u))continue;c.remove(w);continue}}h(w,!0)&&"SPAN"!=w.tagName&&(b.indent&&(w.style.textIndent=b.indentValue),b.textAlign&&(w.style.textAlign=b.textAlign));if(b.removeClass&&w.className&&!g[w.className.toLowerCase()]){if(l&&l.contains(w))continue;c.removeAttributes(w,["class"])}if(b.imageBlockLine&&"img"==w.tagName.toLowerCase()&&!w.getAttribute("emotion"))if(e)switch(F=
w,b.imageBlockLine){case "left":case "right":case "none":for(var u=F.parentNode,C;v.$inline[u.tagName]||"A"==u.tagName;)u=u.parentNode;p=u;if("P"==p.tagName&&"center"==c.getStyle(p,"text-align")&&!c.isBody(p)&&1==c.getChildCount(p,function(a){return!c.isBr(a)&&!c.isWhitespace(a)}))if(C=p.previousSibling,u=p.nextSibling,C&&u&&1==C.nodeType&&1==u.nodeType&&C.tagName==u.tagName&&c.isBlockElm(C)){for(C.appendChild(p.firstChild);u.firstChild;)C.appendChild(u.firstChild);c.remove(p);c.remove(u)}else c.setStyle(p,
"text-align","");c.setStyle(F,"float",b.imageBlockLine);break;case "center":if("center"!=this.queryCommandValue("imagefloat")){u=F.parentNode;c.setStyle(F,"float","none");for(p=F;u&&1==c.getChildCount(u,function(a){return!c.isBr(a)&&!c.isWhitespace(a)})&&(v.$inline[u.tagName]||"A"==u.tagName);)p=u,u=u.parentNode;u=this.document.createElement("p");c.setAttributes(u,{style:"text-align:center"});p.parentNode.insertBefore(u,p);u.appendChild(p);c.setStyle(p,"float","")}}else this.selection.getRange().selectNode(w).select(),
this.execCommand("imagefloat",b.imageBlockLine);b.removeEmptyNode&&b.removeTagNames[w.tagName.toLowerCase()]&&(c.hasNoAttributes(w)&&c.isEmptyBlock(w))&&c.remove(w)}e&&(e.html=k.innerHTML)}this.setOpt({autotypeset:{mergeEmptyline:!0,removeClass:!0,removeEmptyline:!1,textAlign:"left",imageBlockLine:"center",pasteFilter:!1,clearFontSize:!1,clearFontFamily:!1,removeEmptyNode:!1,removeTagNames:p.extend({div:1},v.$removeEmpty),indent:!1,indentValue:"2em"}});var d=this,b=d.options.autotypeset,g={selectTdClass:1,
pagebreak:1,anchorclass:1},f={li:1},k={div:1,p:1,blockquote:1,center:1,h1:1,h2:1,h3:1,h4:1,h5:1,h6:1,span:1},l;b&&(b.pasteFilter&&d.addListener("beforepaste",e),d.commands.autotypeset={execCommand:function(){d.removeListener("beforepaste",e);b.pasteFilter&&d.addListener("beforepaste",e);e.call(d)}})};UE.plugin.register("autosubmit",function(){return{shortcutkey:{autosubmit:"ctrl+13"},commands:{autosubmit:{execCommand:function(){var h=c.findParentByTagName(this.iframe,"form",!1);h&&!1!==this.fireEvent("beforesubmit")&&
(this.sync(),h.submit())}}}}});UE.plugin.register("background",function(){function h(a){var b={};a=a.split(";");p.each(a,function(a){var d=a.indexOf(":"),c=p.trim(a.substr(0,d)).toLowerCase();c&&(b[c]=p.trim(a.substr(d+1)||""))});return b}function a(a){if(a){var b=[],c;for(c in a)a.hasOwnProperty(c)&&b.push(c+":"+a[c]+"; ");p.cssRule(d,b.length?"body{"+b.join("")+"}":"",e.document)}else p.cssRule(d,"",e.document)}var e=this,d="editor_background",b,g=/body[\s]*\{(.+)\}/i,f=e.hasContents;e.hasContents=
function(){return e.queryCommandValue("background")?!0:f.apply(e,arguments)};return{bindEvents:{getAllHtml:function(a,b){var d=this.body,f=c.getComputedStyle(d,"background-image"),g="",g=0<f.indexOf(e.options.imagePath)?f.substring(f.indexOf(e.options.imagePath),f.length-1).replace(/"|\(|\)/ig,""):"none"!=f?f.replace(/url\("?|"?\)/ig,""):"",f='<style type="text/css">body{',d={"background-color":c.getComputedStyle(d,"background-color")||"#ffffff","background-image":g?"url("+g+")":"","background-repeat":c.getComputedStyle(d,
"background-repeat")||"","background-position":q.ie?c.getComputedStyle(d,"background-position-x")+" "+c.getComputedStyle(d,"background-position-y"):c.getComputedStyle(d,"background-position"),height:c.getComputedStyle(d,"height")},h;for(h in d)d.hasOwnProperty(h)&&(f+=h+":"+d[h]+"; ");b.push(f+"}</style> ")},aftersetcontent:function(){!1==b&&a()}},inputRule:function(d){b=!1;p.each(d.getNodesByTagName("p"),function(d){var c=d.getAttr("data-background");c&&(b=!0,a(h(c)),d.parentNode.removeChild(d))})},
outputRule:function(a){var b=(p.cssRule(d,this.document)||"").replace(/[\n\r]+/g,"").match(g);b&&a.appendChild(UE.uNode.createElement('<p style="display:none;" data-background="'+p.trim(b[1].replace(/"/g,"").replace(/[\s]+/g," "))+'"><br/></p>'))},commands:{background:{execCommand:function(b,d){a(d)},queryCommandValue:function(){var a=(p.cssRule(d,this.document)||"").replace(/[\n\r]+/g,"").match(g);return a?h(a[1]):null},notNeedUndo:!0}}}});UE.commands.imagefloat={execCommand:function(h,a){var e=
this.selection.getRange();if(!e.collapsed){var d=e.getClosedNode();if(d&&"IMG"==d.tagName)switch(a){case "left":case "right":case "none":for(var b=d.parentNode,g,f;v.$inline[b.tagName]||"A"==b.tagName;)b=b.parentNode;g=b;if("P"==g.tagName&&"center"==c.getStyle(g,"text-align")){if(!c.isBody(g)&&1==c.getChildCount(g,function(a){return!c.isBr(a)&&!c.isWhitespace(a)}))if(b=g.previousSibling,f=g.nextSibling,b&&f&&1==b.nodeType&&1==f.nodeType&&b.tagName==f.tagName&&c.isBlockElm(b)){for(b.appendChild(g.firstChild);f.firstChild;)b.appendChild(f.firstChild);
c.remove(g);c.remove(f)}else c.setStyle(g,"text-align","");e.selectNode(d).select()}c.setStyle(d,"float","none"==a?"":a);"none"==a&&c.removeAttributes(d,"align");break;case "center":if("center"!=this.queryCommandValue("imagefloat")){b=d.parentNode;c.setStyle(d,"float","");c.removeAttributes(d,"align");for(g=d;b&&1==c.getChildCount(b,function(a){return!c.isBr(a)&&!c.isWhitespace(a)})&&(v.$inline[b.tagName]||"A"==b.tagName);)g=b,b=b.parentNode;e.setStartBefore(g).setCursor(!1);b=this.document.createElement("div");
b.appendChild(g);c.setStyle(g,"float","");this.execCommand("insertHtml",'<p id="_img_parent_tmp" style="text-align:center">'+b.innerHTML+"</p>");g=this.document.getElementById("_img_parent_tmp");g.removeAttribute("id");g=g.firstChild;e.selectNode(g).select();(f=g.parentNode.nextSibling)&&c.isEmptyNode(f)&&c.remove(f)}}}},queryCommandValue:function(){var h=this.selection.getRange(),a;return h.collapsed?"none":(h=h.getClosedNode())&&1==h.nodeType&&"IMG"==h.tagName?(a=c.getComputedStyle(h,"float")||
h.getAttribute("align"),"none"==a&&(a="center"==c.getComputedStyle(h.parentNode,"text-align")?"center":a),{left:1,right:1,center:1}[a]?a:"none"):"none"},queryCommandState:function(){var c=this.selection.getRange();return c.collapsed?-1:(c=c.getClosedNode())&&1==c.nodeType&&"IMG"==c.tagName?0:-1}};UE.commands.insertimage={execCommand:function(h,a){a=p.isArray(a)?a:[a];if(a.length){var e=this.selection.getRange(),d=e.getClosedNode();if(d&&/img/i.test(d.tagName)&&"edui-faked-video"!=d.className&&!d.getAttribute("word_img")){var b=
a.shift(),g=b.floatStyle;delete b.floatStyle;c.setAttributes(d,b);this.execCommand("imagefloat",g);0<a.length&&(e.setStartAfter(d).setCursor(!1,!0),this.execCommand("insertimage",a))}else{e=[];d="";b=a[0];if(1==a.length)d='<img src="'+b.src+'" '+(b._src?' _src="'+b._src+'" ':"")+(b.width?'width="'+b.width+'" ':"")+(b.height?' height="'+b.height+'" ':"")+("left"==b.floatStyle||"right"==b.floatStyle?' style="float:'+b.floatStyle+';"':"")+(b.title&&""!=b.title?' title="'+b.title+'"':"")+(b.border&&"0"!=
b.border?' border="'+b.border+'"':"")+(b.alt&&""!=b.alt?' alt="'+b.alt+'"':"")+(b.hspace&&"0"!=b.hspace?' hspace = "'+b.hspace+'"':"")+(b.vspace&&"0"!=b.vspace?' vspace = "'+b.vspace+'"':"")+"/>","center"==b.floatStyle&&(d='<p style="text-align: center">'+d+"</p>"),e.push(d);else for(g=0;b=a[g++];)d="<p "+("center"==b.floatStyle?'style="text-align: center" ':"")+'><img src="'+b.src+'" '+(b.width?'width="'+b.width+'" ':"")+(b._src?' _src="'+b._src+'" ':"")+(b.height?' height="'+b.height+'" ':"")+' style="'+
(b.floatStyle&&"center"!=b.floatStyle?"float:"+b.floatStyle+";":"")+(b.border||"")+'" '+(b.title?' title="'+b.title+'"':"")+" /></p>",e.push(d);this.execCommand("insertHtml",e.join(""))}}}};UE.plugins.justify=function(){var h=c.isBlockElm,a={left:1,right:1,center:1,justify:1},e=function(a,b){var e=a.createBookmark(),f=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!c.isBookmarkNode(a):!c.isWhitespace(a)};a.enlarge(!0);for(var k=a.createBookmark(),l=c.getNextDomNode(k.start,!1,f),
m=a.cloneRange(),n;l&&!(c.getPosition(l,k.end)&c.POSITION_FOLLOWING);)if(3!=l.nodeType&&h(l))l=c.getNextDomNode(l,!0,f);else{for(m.setStartBefore(l);l&&l!==k.end&&!h(l);)n=l,l=c.getNextDomNode(l,!1,null,function(a){return!h(a)});m.setEndAfter(n);l=m.getCommonAncestor();if(!c.isBody(l)&&h(l))c.setStyles(l,p.isString(b)?{"text-align":b}:b);else{l=a.document.createElement("p");c.setStyles(l,p.isString(b)?{"text-align":b}:b);var r=m.extractContents();l.appendChild(r);m.insertNode(l)}l=c.getNextDomNode(l,
!1,f)}return a.moveToBookmark(k).moveToBookmark(e)};UE.commands.justify={execCommand:function(a,b){var g=this.selection.getRange(),f;g.collapsed&&(f=this.document.createTextNode("p"),g.insertNode(f));e(g,b);f&&(g.setStartBefore(f).collapse(!0),c.remove(f));g.select();return!0},queryCommandValue:function(){var d=this.selection.getStart(),d=c.getComputedStyle(d,"text-align");return a[d]?d:"left"},queryCommandState:function(){var a=this.selection.getStart();return a&&c.findParentByTagName(a,["td","th",
"caption"],!0)?-1:0}}};UE.plugins.font=function(){function h(a){for(var b;b=a.parentNode;)if("SPAN"==b.tagName&&1==c.getChildCount(b,function(a){return!c.isBookmarkNode(a)&&!c.isBr(a)}))b.style.cssText+=a.style.cssText,c.remove(a,!0),a=b;else break}function a(a,b,d){if(g[b]&&(a.adjustmentBoundary(),!a.collapsed&&1==a.startContainer.nodeType)){var f=a.startContainer.childNodes[a.startOffset];if(f&&c.isTagNode(f,"span")){var e=a.createBookmark();p.each(c.getElementsByTagName(f,"span"),function(a){!a.parentNode||
c.isBookmarkNode(a)||"backcolor"==b&&c.getComputedStyle(a,"background-color").toLowerCase()===d||(c.removeStyle(a,g[b]),0==a.style.cssText.replace(/^\s+$/,"").length&&c.remove(a,!0))});a.moveToBookmark(e)}}}function e(b,d,f){var e=b.collapsed,g=b.createBookmark();if(e)for(e=g.start.parentNode;v.$inline[e.tagName];)e=e.parentNode;else e=c.getCommonAncestor(g.start,g.end);p.each(c.getElementsByTagName(e,"span"),function(a){if(a.parentNode&&!c.isBookmarkNode(a))if(/\s*border\s*:\s*none;?\s*/i.test(a.style.cssText))/^\s*border\s*:\s*none;?\s*$/.test(a.style.cssText)?
c.remove(a,!0):c.removeStyle(a,"border");else{/border/i.test(a.style.cssText)&&("SPAN"==a.parentNode.tagName&&/border/i.test(a.parentNode.style.cssText))&&(a.style.cssText=a.style.cssText.replace(/border[^:]*:[^;]+;?/gi,""));if("fontborder"!=d||"none"!=f)for(var b=a.nextSibling;b&&1==b.nodeType&&"SPAN"==b.tagName;){if(c.isBookmarkNode(b)&&"fontborder"==d)a.appendChild(b);else if(b.style.cssText==a.style.cssText&&(c.moveChild(b,a),c.remove(b)),a.nextSibling===b)break;b=a.nextSibling}h(a);q.ie&&8<q.version&&
(b=c.findParent(a,function(a){return"SPAN"==a.tagName&&/background-color/.test(a.style.cssText)}))&&!/background-color/.test(a.style.cssText)&&(a.style.backgroundColor=b.style.backgroundColor)}});b.moveToBookmark(g);a(b,d,f)}var d={forecolor:"color",backcolor:"background-color",fontsize:"font-size",fontfamily:"font-family",underline:"text-decoration",strikethrough:"text-decoration",fontborder:"border"},b={underline:1,strikethrough:1,fontborder:1},g={forecolor:"color",backcolor:"background-color",
fontsize:"font-size",fontfamily:"font-family"};this.setOpt({fontfamily:[{name:"songti",val:"\u5b8b\u4f53,SimSun"},{name:"yahei",val:"\u5fae\u8f6f\u96c5\u9ed1,Microsoft YaHei"},{name:"kaiti",val:"\u6977\u4f53,\u6977\u4f53_GB2312, SimKai"},{name:"heiti",val:"\u9ed1\u4f53, SimHei"},{name:"lishu",val:"\u96b6\u4e66, 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]});this.addInputRule(function(a){p.each(a.getNodesByTagName("u s del font strike"),function(a){if("font"==a.tagName){var b=[],d;for(d in a.attrs)switch(d){case "size":b.push("font-size:"+({1:"10",2:"12",3:"16",4:"18",5:"24",6:"32",7:"48"}[a.attrs[d]]||a.attrs[d])+"px");break;case "color":b.push("color:"+a.attrs[d]);break;case "face":b.push("font-family:"+a.attrs[d]);break;case "style":b.push(a.attrs[d])}a.attrs=
{style:b.join(";")}}else b="u"==a.tagName?"underline":"line-through",a.attrs={style:(a.getAttr("style")||"")+"text-decoration:"+b+";"};a.tagName="span"})});for(var f in d)(function(a,d){UE.commands[a]={execCommand:function(f,g){g=g||(this.queryCommandState(f)?"none":"underline"==f?"underline":"fontborder"==f?"1px solid #000":"line-through");var h=this.selection.getRange(),t;if("default"==g)h.collapsed&&(t=this.document.createTextNode("font"),h.insertNode(t).select()),this.execCommand("removeFormat",
"span,a",d),t&&(h.setStartBefore(t).collapse(!0),c.remove(t)),e(h,f,g),h.select();else if(h.collapsed){var x=c.findParentByTagName(h.startContainer,"span",!0);t=this.document.createTextNode("font");if(!x||x.children.length||x[q.ie?"innerText":"textContent"].replace(O,"").length){h.insertNode(t);h.selectNode(t).select();x=h.document.createElement("span");if(b[a]){if(c.findParentByTagName(t,"a",!0)){h.setStartBefore(t).setCursor();c.remove(t);return}this.execCommand("removeFormat","span,a",d)}x.style.cssText=
d+":"+g;t.parentNode.insertBefore(x,t);if(!q.ie||q.ie&&9==q.version)for(var w=x.parentNode;!c.isBlockElm(w);)"SPAN"==w.tagName&&(x.style.cssText=w.style.cssText+";"+x.style.cssText),w=w.parentNode;ka?setTimeout(function(){h.setStart(x,0).collapse(!0);e(h,f,g);h.select()}):(h.setStart(x,0).collapse(!0),e(h,f,g),h.select())}else h.insertNode(t),b[a]&&(h.selectNode(t).select(),this.execCommand("removeFormat","span,a",d,null),x=c.findParentByTagName(t,"span",!0),h.setStartBefore(t)),x&&(x.style.cssText+=
";"+d+":"+g),h.collapse(!0).select();c.remove(t)}else b[a]&&this.queryCommandValue(a)&&this.execCommand("removeFormat","span,a",d),h=this.selection.getRange(),h.applyInlineStyle("span",{style:d+":"+g}),e(h,f,g),h.select();return!0},queryCommandValue:function(a){var b=this.selection.getStart();if("underline"==a||"strikethrough"==a){for(var f=b;f&&!c.isBlockElm(f)&&!c.isBody(f);){if(1==f.nodeType&&(a=c.getComputedStyle(f,d),"none"!=a))return a;f=f.parentNode}return"none"}if("fontborder"==a){for(a=b;a&&
v.$inline[a.tagName];){if((f=c.getComputedStyle(a,"border"))&&/1px/.test(f)&&/solid/.test(f))return f;a=a.parentNode}return""}return"FontSize"==a?(f=c.getComputedStyle(b,d),(a=/^([\d\.]+)(\w+)$/.exec(f))?Math.floor(a[1])+a[2]:f):c.getComputedStyle(b,d)},queryCommandState:function(a){if(!b[a])return 0;var d=this.queryCommandValue(a);return"fontborder"==a?/1px/.test(d)&&/solid/.test(d):"underline"==a?/underline/.test(d):/line\-through/.test(d)}}})(f,d[f])};UE.plugins.link=function(){function h(a){var e=
a.startContainer,d=a.endContainer;(e=c.findParentByTagName(e,"a",!0))&&a.setStartBefore(e);(d=c.findParentByTagName(d,"a",!0))&&a.setEndAfter(d)}UE.commands.unlink={execCommand:function(){var a=this.selection.getRange(),e;if(!a.collapsed||c.findParentByTagName(a.startContainer,"a",!0))e=a.createBookmark(),h(a),a.removeInlineStyle("a").moveToBookmark(e).select()},queryCommandState:function(){return!this.highlight&&this.queryCommandValue("link")?0:-1}};UE.commands.link={execCommand:function(a,e){var d;
e._href&&(e._href=p.unhtml(e._href,/[<">]/g));e.href&&(e.href=p.unhtml(e.href,/[<">]/g));e.textValue&&(e.textValue=p.unhtml(e.textValue,/[<">]/g));var b=d=this.selection.getRange(),g=b.cloneRange(),f=this.queryCommandValue("link");h(b=b.adjustmentBoundary());var k=b.startContainer;1==k.nodeType&&f&&(k=k.childNodes[b.startOffset])&&(1==k.nodeType&&"A"==k.tagName&&/^(?:https?|ftp|file)\s*:\s*\/\//.test(k[q.ie?"innerText":"textContent"]))&&(k[q.ie?"innerText":"textContent"]=p.html(e.textValue||e.href));
if(!g.collapsed||f)b.removeInlineStyle("a"),g=b.cloneRange();if(g.collapsed){var f=b.document.createElement("a"),l="";e.textValue?(l=p.html(e.textValue),delete e.textValue):l=p.html(e.href);c.setAttributes(f,e);(k=c.findParentByTagName(g.startContainer,"a",!0))&&c.isInNodeEndBoundary(g,k)&&b.setStartAfter(k).collapse(!0);f[q.ie?"innerText":"textContent"]=l;b.insertNode(f).selectNode(f)}else b.applyInlineStyle("a",e);d.collapse().select(!0)},queryCommandValue:function(){var a=this.selection.getRange(),
e;if(a.collapsed){if(e=a.startContainer,(e=1==e.nodeType?e:e.parentNode)&&(e=c.findParentByTagName(e,"a",!0))&&!c.isInNodeEndBoundary(a,e))return e}else{a.shrinkBoundary();var d=3!=a.startContainer.nodeType&&a.startContainer.childNodes[a.startOffset]?a.startContainer.childNodes[a.startOffset]:a.startContainer,b=3==a.endContainer.nodeType||0==a.endOffset?a.endContainer:a.endContainer.childNodes[a.endOffset-1],a=a.getCommonAncestor();e=c.findParentByTagName(a,"a",!0);if(!e&&1==a.nodeType)for(var a=
a.getElementsByTagName("a"),g,f,k=0,l;l=a[k++];)if(g=c.getPosition(l,d),f=c.getPosition(l,b),(g&c.POSITION_FOLLOWING||g&c.POSITION_CONTAINS)&&(f&c.POSITION_PRECEDING||f&c.POSITION_CONTAINS)){e=l;break}return e}},queryCommandState:function(){var a=this.selection.getRange().getClosedNode();return a&&"edui-faked-video"==a.className?-1:0}}};UE.plugins.insertframe=function(){var c=this;c.addListener("selectionchange",function(){c._iframe&&delete c._iframe})};UE.commands.scrawl={queryCommandState:function(){return q.ie&&
8>=q.version?-1:0}};UE.plugins.removeformat=function(){this.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"});this.commands.removeformat={execCommand:function(h,a,e,d,b){function g(a){if(3==a.nodeType||"span"!=a.tagName.toLowerCase())return 0;if(q.ie){var b=a.attributes;if(b.length){a=0;for(var d=b.length;a<d;a++)if(b[a].specified)return 0;return 1}}return!a.attributes.length}
var f=RegExp("^(?:"+(a||this.options.removeFormatTags).replace(/,/g,"|")+")$","i"),k=e?[]:(d||this.options.removeFormatAttributes).split(",");h=new L.Range(this.document);var l,m,n=function(a){return 1==a.nodeType};h=this.selection.getRange();(function(a){var d=a.createBookmark();a.collapsed&&a.enlarge(!0);if(!b){var h=c.findParentByTagName(a.startContainer,"a",!0);h&&a.setStartBefore(h);(h=c.findParentByTagName(a.endContainer,"a",!0))&&a.setEndAfter(h)}l=a.createBookmark();for(h=l.start;(m=h.parentNode)&&
!c.isBlockElm(m);)c.breakParent(h,m),c.clearEmptySibling(h);if(l.end){for(h=l.end;(m=h.parentNode)&&!c.isBlockElm(m);)c.breakParent(h,m),c.clearEmptySibling(h);for(var h=c.getNextDomNode(l.start,!1,n),w;h&&h!=l.end;)w=c.getNextDomNode(h,!0,n),v.$empty[h.tagName.toLowerCase()]||c.isBookmarkNode(h)||(f.test(h.tagName)?e?(c.removeStyle(h,e),g(h)&&"text-decoration"!=e&&c.remove(h,!0)):c.remove(h,!0):v.$tableContent[h.tagName]||v.$list[h.tagName]||(c.removeAttributes(h,k),g(h)&&c.remove(h,!0))),h=w}h=
l.start.parentNode;!c.isBlockElm(h)||(v.$tableContent[h.tagName]||v.$list[h.tagName])||c.removeAttributes(h,k);h=l.end.parentNode;l.end&&(c.isBlockElm(h)&&!v.$tableContent[h.tagName]&&!v.$list[h.tagName])&&c.removeAttributes(h,k);a.moveToBookmark(l).moveToBookmark(d);h=a.startContainer;for(w=a.collapsed;1==h.nodeType&&c.isEmptyNode(h)&&v.$removeEmpty[h.tagName];)d=h.parentNode,a.setStartBefore(h),a.startContainer===a.endContainer&&a.endOffset--,c.remove(h),h=d;if(!w)for(h=a.endContainer;1==h.nodeType&&
c.isEmptyNode(h)&&v.$removeEmpty[h.tagName];)d=h.parentNode,a.setEndBefore(h),c.remove(h),h=d})(h);h.select()}}};UE.plugins.blockquote=function(){this.commands.blockquote={execCommand:function(h,a){var e=this.selection.getRange(),d=c.filterNodeList(this.selection.getStartElementPath(),"blockquote"),b=v.blockquote,g=e.createBookmark();if(d){var b=e.startContainer,b=c.isBlockElm(b)?b:c.findParent(b,function(a){return c.isBlockElm(a)}),f=e.endContainer,f=c.isBlockElm(f)?f:c.findParent(f,function(a){return c.isBlockElm(a)}),
b=c.findParentByTagName(b,"li",!0)||b,f=c.findParentByTagName(f,"li",!0)||f;"LI"==b.tagName||"TD"==b.tagName||b===d||c.isBody(b)?c.remove(d,!0):c.breakParent(b,d);b!==f&&(d=c.findParentByTagName(f,"blockquote"))&&("LI"==f.tagName||"TD"==f.tagName||c.isBody(f)?d.parentNode&&c.remove(d,!0):c.breakParent(f,d));for(var k=c.getElementsByTagName(this.document,"blockquote"),d=0,l;l=k[d++];)l.childNodes.length?c.getPosition(l,b)&c.POSITION_FOLLOWING&&c.getPosition(l,f)&c.POSITION_PRECEDING&&c.remove(l,!0):
c.remove(l)}else{d=e.cloneRange();k=f=1==d.startContainer.nodeType?d.startContainer:d.startContainer.parentNode;for(l=1;;){if(c.isBody(f)){k!==f?e.collapsed?(d.selectNode(k),l=0):d.setStartBefore(k):d.setStart(f,0);break}if(!b[f.tagName]){e.collapsed?d.selectNode(k):d.setStartBefore(k);break}k=f;f=f.parentNode}if(l)for(k=f=f=1==d.endContainer.nodeType?d.endContainer:d.endContainer.parentNode;;){if(c.isBody(f)){k!==f?d.setEndAfter(k):d.setEnd(f,f.childNodes.length);break}if(!b[f.tagName]){d.setEndAfter(k);
break}k=f;f=f.parentNode}f=e.document.createElement("blockquote");c.setAttributes(f,a);f.appendChild(d.extractContents());d.insertNode(f);b=c.getElementsByTagName(f,"blockquote");for(d=0;f=b[d++];)f.parentNode&&c.remove(f,!0)}e.moveToBookmark(g).select()},queryCommandState:function(){return c.filterNodeList(this.selection.getStartElementPath(),"blockquote")?1:0}}};UE.commands.touppercase=UE.commands.tolowercase={execCommand:function(h){var a=this.selection.getRange();if(a.collapsed)return a;for(var e=
a.createBookmark(),d=e.end,b=function(a){return!c.isBr(a)&&!c.isWhitespace(a)},g=c.getNextDomNode(e.start,!1,b);g&&c.getPosition(g,d)&c.POSITION_PRECEDING&&(3==g.nodeType&&(g.nodeValue=g.nodeValue["touppercase"==h?"toUpperCase":"toLowerCase"]()),g=c.getNextDomNode(g,!0,b),g!==d););a.moveToBookmark(e).select()}};UE.commands.indent={execCommand:function(){var c=this.queryCommandState("indent")?"0em":this.options.indentValue||"2em";this.execCommand("Paragraph","p",{style:"text-indent:"+c})},queryCommandState:function(){var h=
c.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return h&&h.style.textIndent&&parseInt(h.style.textIndent)?1:0}};UE.commands.print={execCommand:function(){this.window.print()},notNeedUndo:1};UE.plugins.selectall=function(){this.commands.selectall={execCommand:function(){var h=this.body,a=this.selection.getRange();a.selectNodeContents(h);c.isEmptyBlock(h)&&(q.opera&&(h.firstChild&&1==h.firstChild.nodeType)&&a.setStartAtFirst(h.firstChild),a.collapse(!0));a.select(!0)},
notNeedUndo:1};this.addshortcutkey({selectAll:"ctrl+65"})};UE.plugins.paragraph=function(){var h=c.isBlockElm,a=["TD","LI","PRE"],e=function(d,b,e,f){var k=d.createBookmark(),l=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase()&&!c.isBookmarkNode(a):!c.isWhitespace(a)},m;d.enlarge(!0);var n=d.createBookmark();m=c.getNextDomNode(n.start,!1,l);for(var r=d.cloneRange(),t;m&&!(c.getPosition(m,n.end)&c.POSITION_FOLLOWING);)if(3!=m.nodeType&&h(m))m=c.getNextDomNode(m,!0,l);else{for(r.setStartBefore(m);m&&
m!==n.end&&!h(m);)t=m,m=c.getNextDomNode(m,!1,null,function(a){return!h(a)});r.setEndAfter(t);m=d.document.createElement(b);e&&(c.setAttributes(m,e),f&&("customstyle"==f&&e.style)&&(m.style.cssText=e.style));m.appendChild(r.extractContents());c.isEmptyNode(m)&&c.fillChar(d.document,m);r.insertNode(m);var x=m.parentNode;h(x)&&(!c.isBody(m.parentNode)&&-1==p.indexOf(a,x.tagName))&&(f&&"customstyle"==f||(x.getAttribute("dir")&&m.setAttribute("dir",x.getAttribute("dir")),x.style.cssText&&(m.style.cssText=
x.style.cssText+";"+m.style.cssText),x.style.textAlign&&!m.style.textAlign&&(m.style.textAlign=x.style.textAlign),x.style.textIndent&&!m.style.textIndent&&(m.style.textIndent=x.style.textIndent),x.style.padding&&!m.style.padding&&(m.style.padding=x.style.padding)),e&&/h\d/i.test(x.tagName)&&!/h\d/i.test(m.tagName)?(c.setAttributes(x,e),f&&("customstyle"==f&&e.style)&&(x.style.cssText=e.style),c.remove(m,!0),m=x):c.remove(m.parentNode,!0));m=-1!=p.indexOf(a,x.tagName)?x:m;m=c.getNextDomNode(m,!1,l)}return d.moveToBookmark(n).moveToBookmark(k)};
this.setOpt("paragraph",{p:"",h1:"",h2:"",h3:"",h4:"",h5:"",h6:""});this.commands.paragraph={execCommand:function(a,b,g,f){a=this.selection.getRange();if(a.collapsed){var k=this.document.createTextNode("p");a.insertNode(k);if(q.ie){var l=k.previousSibling;l&&c.isWhitespace(l)&&c.remove(l);(l=k.nextSibling)&&c.isWhitespace(l)&&c.remove(l)}}a=e(a,b,g,f);k&&(a.setStartBefore(k).collapse(!0),pN=k.parentNode,c.remove(k),c.isBlockElm(pN)&&c.isEmptyNode(pN)&&c.fillNode(this.document,pN));q.gecko&&a.collapsed&&
1==a.startContainer.nodeType&&(g=a.startContainer.childNodes[a.startOffset])&&(1==g.nodeType&&g.tagName.toLowerCase()==b)&&a.setStart(g,0).collapse(!0);a.select();return!0},queryCommandValue:function(){var a=c.filterNodeList(this.selection.getStartElementPath(),"p h1 h2 h3 h4 h5 h6");return a?a.tagName.toLowerCase():""}}};(function(){var h=c.isBlockElm,a=function(a){return c.filterNodeList(a.selection.getStartElementPath(),function(a){return a.getAttribute("dir")})},e=function(d,b,e){var f=function(a){return 1==
a.nodeType?!c.isBookmarkNode(a):!c.isWhitespace(a)};if((b=a(b))&&d.collapsed)return b.setAttribute("dir",e),d;b=d.createBookmark();d.enlarge(!0);for(var k=d.createBookmark(),l=c.getNextDomNode(k.start,!1,f),m=d.cloneRange(),n;l&&!(c.getPosition(l,k.end)&c.POSITION_FOLLOWING);)if(3!=l.nodeType&&h(l))l=c.getNextDomNode(l,!0,f);else{for(m.setStartBefore(l);l&&l!==k.end&&!h(l);)n=l,l=c.getNextDomNode(l,!1,null,function(a){return!h(a)});m.setEndAfter(n);l=m.getCommonAncestor();if(!c.isBody(l)&&h(l))l.setAttribute("dir",
e);else{l=d.document.createElement("p");l.setAttribute("dir",e);var r=m.extractContents();l.appendChild(r);m.insertNode(l)}l=c.getNextDomNode(l,!1,f)}return d.moveToBookmark(k).moveToBookmark(b)};UE.commands.directionality={execCommand:function(a,b){var g=this.selection.getRange();if(g.collapsed){var f=this.document.createTextNode("d");g.insertNode(f)}e(g,this,b);f&&(g.setStartBefore(f).collapse(!0),c.remove(f));g.select();return!0},queryCommandValue:function(){var d=a(this);return d?d.getAttribute("dir"):
"ltr"}}})();UE.plugins.horizontal=function(){this.commands.horizontal={execCommand:function(c){if(-1!==this.queryCommandState(c)){this.execCommand("insertHtml","<hr>");c=this.selection.getRange();var a=c.startContainer;if(1==a.nodeType&&!a.childNodes[c.startOffset]){var e;(e=a.childNodes[c.startOffset-1])&&(1==e.nodeType&&"HR"==e.tagName)&&("p"==this.options.enterTag?(e=this.document.createElement("p"),c.insertNode(e),c.setStart(e,0).setCursor()):(e=this.document.createElement("br"),c.insertNode(e),
c.setStartBefore(e).setCursor()))}return!0}},queryCommandState:function(){return c.filterNodeList(this.selection.getStartElementPath(),"table")?-1:0}};this.addListener("delkeydown",function(h,a){var e=this.selection.getRange();e.txtToElmBoundary(!0);if(c.isStartInblock(e)){var d=e.startContainer.previousSibling;if(d&&c.isTagNode(d,"hr"))return c.remove(d),e.select(),c.preventDefault(a),!0}})};UE.commands.time=UE.commands.date={execCommand:function(c,a){function e(a,b){var d=("0"+a.getHours()).slice(-2),
c=("0"+a.getMinutes()).slice(-2),e=("0"+a.getSeconds()).slice(-2);return(b||"hh:ii:ss").replace(/hh/ig,d).replace(/ii/ig,c).replace(/ss/ig,e)}function d(a,b){var d=("000"+a.getFullYear()).slice(-4),c=d.slice(-2),e=("0"+(a.getMonth()+1)).slice(-2),n=("0"+a.getDate()).slice(-2);return(b||"yyyy-mm-dd").replace(/yyyy/ig,d).replace(/yy/ig,c).replace(/mm/ig,e).replace(/dd/ig,n)}var b=new Date;this.execCommand("insertHtml","time"==c?e(b,a):d(b,a))}};UE.plugins.rowspacing=function(){this.setOpt({rowspacingtop:["5",
"10","15","20","25"],rowspacingbottom:["5","10","15","20","25"]});this.commands.rowspacing={execCommand:function(c,a,e){this.execCommand("paragraph","p",{style:"margin-"+e+":"+a+"px"});return!0},queryCommandValue:function(h,a){var e=c.filterNodeList(this.selection.getStartElementPath(),function(a){return c.isBlockElm(a)});return e?(e=c.getComputedStyle(e,"margin-"+a).replace(/[^\d]/g,""))?e:0:0}}};UE.plugins.lineheight=function(){this.setOpt({lineheight:"1 1.5 1.75 2 3 4 5".split(" ")});this.commands.lineheight=
{execCommand:function(c,a){this.execCommand("paragraph","p",{style:"line-height:"+("1"==a?"normal":a+"em")});return!0},queryCommandValue:function(){var h=c.filterNodeList(this.selection.getStartElementPath(),function(a){return c.isBlockElm(a)});if(h)return h=c.getComputedStyle(h,"line-height"),"normal"==h?1:h.replace(/[^\d.]*/ig,"")}}};UE.plugins.insertcode=function(){var h=this;h.ready(function(){p.cssRule("pre","pre{margin:.5em 0;padding:.4em .6em;border-radius:8px;background:#f8f8f8;}",h.document)});
h.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"});h.commands.insertcode={execCommand:function(a,e){var d=this.selection.getRange(),b=c.findParentByTagName(d.startContainer,"pre",!0);if(b)b.className="brush:"+
e+";toolbar:false;";else{var g="";d.collapsed?g=q.ie?8<q.version?"":"&nbsp;":"<br/>":(b=d.extractContents(),d=this.document.createElement("div"),d.appendChild(b),p.each(UE.filterNode(UE.htmlparser(d.innerHTML.replace(/[\r\t]/g,"")),this.options.filterTxtRules).children,function(a){q.ie&&8<q.version?("element"==a.type?"br"==a.tagName?g+="\n":v.$empty[a.tagName]||(p.each(a.children,function(b){"element"==b.type?"br"==b.tagName?g+="\n":v.$empty[a.tagName]||(g+=b.innerText()):g+=b.data}),/\n$/.test(g)||
(g+="\n")):g+=a.data+"\n",!a.nextSibling()&&/\n$/.test(g)&&(g=g.replace(/\n$/,""))):q.ie?("element"==a.type?"br"==a.tagName?g+="<br>":v.$empty[a.tagName]||(p.each(a.children,function(b){"element"==b.type?"br"==b.tagName?g+="<br>":v.$empty[a.tagName]||(g+=b.innerText()):g+=b.data}),/br>$/.test(g)||(g+="<br>")):g+=a.data+"<br>",!a.nextSibling()&&/<br>$/.test(g)&&(g=g.replace(/<br>$/,""))):(g+="element"==a.type?v.$empty[a.tagName]?"":a.innerText():a.data,!/br\/?\s*>$/.test(g)&&a.nextSibling()&&(g+="<br>"))}));
this.execCommand("inserthtml",'<pre id="coder"class="brush:'+e+';toolbar:false">'+g+"</pre>",!0);b=this.document.getElementById("coder");c.removeAttributes(b,"id");(d=b.previousSibling)&&(3==d.nodeType&&1==d.nodeValue.length&&q.ie&&6==q.version||c.isEmptyBlock(d))&&c.remove(d);d=this.selection.getRange();c.isEmptyBlock(b)?d.setStart(b,0).setCursor(!1,!0):d.selectNodeContents(b).select()}},queryCommandValue:function(){var a=this.selection.getStartElementPath(),c="";p.each(a,function(a){if("PRE"==a.nodeName)return c=
(a=a.className.match(/brush:([^;]+)/))&&a[1]?a[1]:"",!1});return c}};h.addInputRule(function(a){p.each(a.getNodesByTagName("pre"),function(a){var d=a.getNodesByTagName("br");d.length?q.ie&&8<q.version&&p.each(d,function(a){var d=UE.uNode.createText("\n");a.parentNode.insertBefore(d,a);a.parentNode.removeChild(a)}):q.ie&&8<q.version||(d=a.innerText().split(/\n/),a.innerHTML(""),p.each(d,function(b){b.length&&a.appendChild(UE.uNode.createText(b));a.appendChild(UE.uNode.createElement("br"))}))})});h.addOutputRule(function(a){p.each(a.getNodesByTagName("pre"),
function(a){var d="";p.each(a.children,function(a){d="text"==a.type?d+a.data.replace(/[ ]/g,"&nbsp;").replace(/\n$/,""):"br"==a.tagName?d+"\n":d+(v.$empty[a.tagName]?a.innerText():"")});a.innerText(d.replace(/(&nbsp;|\n)+$/,""))})});h.notNeedCodeQuery={help:1,undo:1,redo:1,source:1,print:1,searchreplace:1,fullscreen:1,preview:1,insertparagraph:1,elementpath:1,highlightcode:1,insertcode:1,inserthtml:1,selectall:1};h.queryCommandState=function(a){return!this.notNeedCodeQuery[a.toLowerCase()]&&this.selection&&
this.queryCommandValue("insertcode")?-1:UE.Editor.prototype.queryCommandState.apply(this,arguments)};h.addListener("beforeenterkeydown",function(){var a=h.selection.getRange(),e=c.findParentByTagName(a.startContainer,"pre",!0);if(e){h.fireEvent("saveScene");a.collapsed||a.deleteContents();if(q.ie)if(8<q.version){var e=h.document.createTextNode("\n"),d=a.startContainer;if(0==a.startOffset){if(d.previousSibling){a.insertNode(e);var b=h.document.createTextNode(" ");a.setStartAfter(e).insertNode(b).setStart(b,
0).collapse(!0).select(!0)}}else a.insertNode(e).setStartAfter(e),b=h.document.createTextNode(" "),(d=a.startContainer.childNodes[a.startOffset])&&!/^\n/.test(d.nodeValue)&&a.setStartBefore(e),a.insertNode(b).setStart(b,0).collapse(!0).select(!0)}else{e=h.document.createElement("br");a.insertNode(e);a.insertNode(h.document.createTextNode(c.fillChar));a.setStartAfter(e);for(e=e.previousSibling;e;)if(d=e,e=e.previousSibling,!e||"BR"==e.nodeName){e=d;break}if(e){for(d="";e&&"BR"!=e.nodeName&&RegExp("^[ "+
c.fillChar+"]*$").test(e.nodeValue);)d+=e.nodeValue,e=e.nextSibling;"BR"!=e.nodeName&&(e=e.nodeValue.match(RegExp("^([ "+c.fillChar+"]+)")))&&e[1]&&(d+=e[1]);d=h.document.createTextNode(d);a.insertNode(d).setStartAfter(d)}a.collapse(!0).select()}else{e=h.document.createElement("br");a.insertNode(e).setStartAfter(e).collapse(!0);e.nextSibling?a.setStartAfter(e):a.insertNode(e.cloneNode(!1));for(e=e.previousSibling;e;)if(d=e,e=e.previousSibling,!e||"BR"==e.nodeName){e=d;break}if(e){for(d="";e&&"BR"!=
e.nodeName&&RegExp("^[\\s"+c.fillChar+"]*$").test(e.nodeValue);)d+=e.nodeValue,e=e.nextSibling;"BR"!=e.nodeName&&(e=e.nodeValue.match(RegExp("^([\\s"+c.fillChar+"]+)")))&&e[1]&&(d+=e[1]);d&&(d=h.document.createTextNode(d),a.insertNode(d).setStartAfter(d))}a.collapse(!0).select(!0)}h.fireEvent("saveScene");return!0}});h.addListener("tabkeydown",function(a,e){var d=h.selection.getRange(),b=c.findParentByTagName(d.startContainer,"pre",!0);if(b){h.fireEvent("saveScene");if(!e.shiftKey)if(d.collapsed)b=
h.document.createTextNode(" "),d.insertNode(b).setStartAfter(b).collapse(!0).select(!0);else{for(var g=d.createBookmark(),f=g.start.previousSibling;f;){if(b.firstChild===f&&!c.isBr(f)){b.insertBefore(h.document.createTextNode(" "),f);break}if(c.isBr(f)){b.insertBefore(h.document.createTextNode(" "),f.nextSibling);break}f=f.previousSibling}var k=g.end,f=g.start.nextSibling;for(b.firstChild===g.start&&b.insertBefore(h.document.createTextNode(" "),f.nextSibling);f&&f!==k;){if(c.isBr(f)&&
f.nextSibling){if(f.nextSibling===k)break;b.insertBefore(h.document.createTextNode(" "),f.nextSibling)}f=f.nextSibling}d.moveToBookmark(g).select()}h.fireEvent("saveScene");return!0}});h.addListener("beforeinserthtml",function(a,e){var d=this,b=d.selection.getRange();if(c.findParentByTagName(b.startContainer,"pre",!0)){b.collapsed||b.deleteContents();var g="";if(q.ie&&8<q.version){p.each(UE.filterNode(UE.htmlparser(e),d.options.filterTxtRules).children,function(a){"element"==a.type?"br"==a.tagName?
g+="\n":v.$empty[a.tagName]||(p.each(a.children,function(b){"element"==b.type?"br"==b.tagName?g+="\n":v.$empty[a.tagName]||(g+=b.innerText()):g+=b.data}),/\n$/.test(g)||(g+="\n")):g+=a.data+"\n";!a.nextSibling()&&/\n$/.test(g)&&(g=g.replace(/\n$/,""))});var f=d.document.createTextNode(p.html(g.replace(/&nbsp;/g," ")));b.insertNode(f).selectNode(f).select()}else{var k=d.document.createDocumentFragment();p.each(UE.filterNode(UE.htmlparser(e),d.options.filterTxtRules).children,function(a){"element"==
a.type?"br"==a.tagName?k.appendChild(d.document.createElement("br")):v.$empty[a.tagName]||(p.each(a.children,function(b){"element"==b.type?"br"==b.tagName?k.appendChild(d.document.createElement("br")):v.$empty[a.tagName]||k.appendChild(d.document.createTextNode(p.html(b.innerText().replace(/&nbsp;/g," ")))):k.appendChild(d.document.createTextNode(p.html(b.data.replace(/&nbsp;/g," "))))}),"BR"!=k.lastChild.nodeName&&k.appendChild(d.document.createElement("br"))):k.appendChild(d.document.createTextNode(p.html(a.data.replace(/&nbsp;/g,
" "))));a.nextSibling()||"BR"!=k.lastChild.nodeName||k.removeChild(k.lastChild)});b.insertNode(k).select()}return!0}});h.addListener("keydown",function(a,e){if(40==(e.keyCode||e.which)){var d=this.selection.getRange(),b,g=d.startContainer;if(d.collapsed&&(b=c.findParentByTagName(d.startContainer,"pre",!0))&&!b.nextSibling){for(var f=b.lastChild;f&&"BR"==f.nodeName;)f=f.previousSibling;if(f===g||d.startContainer===b&&d.startOffset==b.childNodes.length)this.execCommand("insertparagraph"),c.preventDefault(e)}}});
h.addListener("delkeydown",function(a,e){var d=this.selection.getRange();d.txtToElmBoundary(!0);var b=d.startContainer;if(c.isTagNode(b,"pre")&&d.collapsed&&c.isStartInblock(d)){var g=h.document.createElement("p");c.fillNode(h.document,g);b.parentNode.insertBefore(g,b);c.remove(b);d.setStart(g,0).setCursor(!1,!0);c.preventDefault(e);return!0}})};UE.commands.cleardoc={execCommand:function(c){var a=this;c=a.options.enterTag;var e=a.selection.getRange();"br"==c?(a.body.innerHTML="<br/>",e.setStart(a.body,
0).setCursor()):(a.body.innerHTML="<p>"+(H?"":"<br/>")+"</p>",e.setStart(a.body.firstChild,0).setCursor(!1,!0));setTimeout(function(){a.fireEvent("clearDoc")},0)}};UE.plugin.register("anchor",function(){return{bindEvents:{ready:function(){p.cssRule("anchor",".anchorclass{background: url('"+this.options.themePath+this.options.theme+"/images/anchor.gif') no-repeat scroll left center transparent;border: 1px dotted #0000FF;cursor: auto;display: inline-block;height: 16px;width: 15px;}",this.document)}},
outputRule:function(c){p.each(c.getNodesByTagName("img"),function(a){var c;if(c=a.getAttr("anchorname"))a.tagName="a",a.setAttr({anchorname:"",name:c,"class":""})})},inputRule:function(c){p.each(c.getNodesByTagName("a"),function(a){a.getAttr("name")&&!a.getAttr("href")&&(a.tagName="img",a.setAttr({anchorname:a.getAttr("name"),"class":"anchorclass"}),a.setAttr("name"))})},commands:{anchor:{execCommand:function(h,a){var e=this.selection.getRange(),d=e.getClosedNode();d&&d.getAttribute("anchorname")?
a?d.setAttribute("anchorname",a):(e.setStartBefore(d).setCursor(),c.remove(d)):a&&(d=this.document.createElement("img"),e.collapse(!0),c.setAttributes(d,{anchorname:a,"class":"anchorclass"}),e.insertNode(d).setStartAfter(d).setCursor(!1,!0))}}}}});UE.plugins.wordcount=function(){var h=this;h.addListener("contentchange",function(){h.fireEvent("wordcount")});var a;h.addListener("ready",function(){var e=this;c.on(e.body,"keyup",function(d){(d.keyCode||d.which)in{16:1,18:1,20:1,37:1,38:1,39:1,40:1}||
(clearTimeout(a),a=setTimeout(function(){e.fireEvent("wordcount")},200))})})};UE.plugins.pagebreak=function(){function h(a){if(c.isEmptyBlock(a)){for(var d=a.firstChild,f;d&&1==d.nodeType&&c.isEmptyBlock(d);)f=d,d=d.firstChild;!f&&(f=a);c.fillNode(e.document,f)}}function a(a){return a&&1==a.nodeType&&"HR"==a.tagName&&"pagebreak"==a.className}var e=this,d=["td"];e.setOpt("pageBreakTag","_ueditor_page_break_tag_");e.ready(function(){p.cssRule("pagebreak",".pagebreak{display:block;clear:both !important;cursor:default !important;width: 100% !important;margin:0;}",
e.document)});e.addInputRule(function(a){a.traversal(function(a){if("text"==a.type&&a.data==e.options.pageBreakTag){var b=UE.uNode.createElement('<hr class="pagebreak" noshade="noshade" size="5" style="-webkit-user-select: none;">');a.parentNode.insertBefore(b,a);a.parentNode.removeChild(a)}})});e.addOutputRule(function(a){p.each(a.getNodesByTagName("hr"),function(a){if("pagebreak"==a.getAttr("class")){var b=UE.uNode.createText(e.options.pageBreakTag);a.parentNode.insertBefore(b,a);a.parentNode.removeChild(a)}})});
e.commands.pagebreak={execCommand:function(){var b=e.selection.getRange(),g=e.document.createElement("hr");c.setAttributes(g,{"class":"pagebreak",noshade:"noshade",size:"5"});c.unSelectable(g);var f=c.findParentByTagName(b.startContainer,d,!0),k=[];if(f)switch(f.tagName){case "TD":f=f.parentNode,f.previousSibling?(f.parentNode.insertBefore(g,f),k=c.findParents(g)):(b=c.findParentByTagName(f,"table"),b.parentNode.insertBefore(g,b),k=c.findParents(g,!0)),f=k[1],g!==f&&c.breakParent(g,f),e.fireEvent("afteradjusttable",
e.document)}else{if(!b.collapsed)for(b.deleteContents(),f=b.startContainer;!c.isBody(f)&&c.isBlockElm(f)&&c.isEmptyNode(f);)b.setStartBefore(f).collapse(!0),c.remove(f),f=b.startContainer;b.insertNode(g);for(f=g.parentNode;!c.isBody(f);)c.breakParent(g,f),(f=g.nextSibling)&&c.isEmptyBlock(f)&&c.remove(f),f=g.parentNode;f=g.nextSibling;k=g.previousSibling;a(k)?c.remove(k):k&&h(k);f?(a(f)?c.remove(f):h(f),b.setEndAfter(g).collapse(!1)):(f=e.document.createElement("p"),g.parentNode.appendChild(f),c.fillNode(e.document,
f),b.setStart(f,0).collapse(!0));b.select(!0)}}}};UE.plugin.register("wordimage",function(){var h=this,a=[];return{commands:{wordimage:{execCommand:function(){for(var a=c.getElementsByTagName(h.body,"img"),d=[],b=0,g;g=a[b++];)(g=g.getAttribute("word_img"))&&d.push(g);return d},queryCommandState:function(){a=c.getElementsByTagName(h.body,"img");for(var e=0,d;d=a[e++];)if(d.getAttribute("word_img"))return 1;return-1},notNeedUndo:!0}},inputRule:function(a){p.each(a.getNodesByTagName("img"),function(a){var b=
a.attrs,c=128>parseInt(b.width)||43>parseInt(b.height),f=h.options,e=f.UEDITOR_HOME_URL+"themes/default/images/spacer.gif";b.src&&/^(?:(file:\/+))/.test(b.src)&&a.setAttr({width:b.width,height:b.height,alt:b.alt,word_img:b.src,src:e,style:"background:url("+(c?f.themePath+f.theme+"/images/word.gif":f.langPath+f.lang+"/images/localimage.png")+") no-repeat center center;border:1px solid #ddd"})})}}});UE.plugins.dragdrop=function(){var h=this;h.ready(function(){c.on(this.body,"dragend",function(){var a=
h.selection.getRange(),e=a.getClosedNode()||h.selection.getStart();if(e&&"IMG"==e.tagName){for(var d=e.previousSibling,b;(b=e.nextSibling)&&1==b.nodeType&&"SPAN"==b.tagName&&!b.firstChild;)c.remove(b);(!d||1!=d.nodeType||c.isEmptyBlock(d))&&d||b&&(!b||c.isEmptyBlock(b))||(d&&"P"==d.tagName&&!c.isEmptyBlock(d)?(d.appendChild(e),c.moveChild(b,d),c.remove(b)):b&&("P"==b.tagName&&!c.isEmptyBlock(b))&&b.insertBefore(e,b.firstChild),d&&("P"==d.tagName&&c.isEmptyBlock(d))&&c.remove(d),b&&("P"==b.tagName&&
c.isEmptyBlock(b))&&c.remove(b),a.selectNode(e).select(),h.fireEvent("saveScene"))}})});h.addListener("keyup",function(a,e){if(13==(e.keyCode||e.which)){var d=h.selection.getRange(),b;(b=c.findParentByTagName(d.startContainer,"p",!0))&&"center"==c.getComputedStyle(b,"text-align")&&c.removeStyle(b,"text-align")}})};UE.plugins.undo=function(){function h(a,b){if(a.length!=b.length)return 0;for(var d=0,c=a.length;d<c;d++)if(a[d]!=b[d])return 0;return 1}var a,e=this,d=e.options.maxUndoCount||20,b=e.options.maxInputCount||
20,g=RegExp(c.fillChar+"|</hr>","gi"),f={ol:1,ul:1,table:1,tbody:1,tr:1,body:1},k=e.options.autoClearEmptyNode;e.undoManger=new function(){this.list=[];this.index=0;this.hasRedo=this.hasUndo=!1;this.undo=function(){if(this.hasUndo)if(this.list[this.index-1]||1!=this.list.length){for(;this.list[this.index].content==this.list[this.index-1].content;)if(this.index--,0==this.index)return this.restore(0);this.restore(--this.index)}else this.reset()};this.redo=function(){if(this.hasRedo){for(;this.list[this.index].content==
this.list[this.index+1].content;)if(this.index++,this.index==this.list.length-1)return this.restore(this.index);this.restore(++this.index)}};this.restore=function(){var a=this.editor,b=this.list[this.index],d=UE.htmlparser(b.content.replace(g,""));a.options.autoClearEmptyNode=!1;a.filterInputRule(d);a.options.autoClearEmptyNode=k;a.document.body.innerHTML=d.toHtml();a.fireEvent("afterscencerestore");q.ie&&p.each(c.getElementsByTagName(a.document,"td th caption p"),function(b){c.isEmptyNode(b)&&c.fillNode(a.document,
b)});try{var e=(new L.Range(a.document)).moveToAddress(b.address);e.select(f[e.startContainer.nodeName.toLowerCase()])}catch(l){}this.update();this.clearKey();a.fireEvent("reset",!0)};this.getScene=function(){var a=this.editor,b=a.selection.getRange().createAddress(!1,!0);a.fireEvent("beforegetscene");var d=UE.htmlparser(a.body.innerHTML);a.options.autoClearEmptyNode=!1;a.filterOutputRule(d);a.options.autoClearEmptyNode=k;d=d.toHtml();a.fireEvent("aftergetscene");return{address:b,content:d}};this.save=
function(b,c){clearTimeout(a);var f=this.getScene(c),e=this.list[this.index],g;if(g=e)if(g=e.content==f.content)b?e=1:(e=e.address,g=f.address,e=e.collapsed!=g.collapsed?0:h(e.startAddress,g.startAddress)&&h(e.endAddress,g.endAddress)?1:0),g=e;g||(this.list=this.list.slice(0,this.index+1),this.list.push(f),this.list.length>d&&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.hasRedo=this.hasUndo=!1;this.clearKey()};this.clearKey=function(){m=0}};e.undoManger.editor=e;e.addListener("saveScene",function(){var a=Array.prototype.splice.call(arguments,1);this.undoManger.save.apply(this.undoManger,a)});e.addListener("reset",function(a,b){b||this.undoManger.reset()});e.commands.redo=e.commands.undo={execCommand:function(a){this.undoManger[a]()},queryCommandState:function(a){return this.undoManger["has"+("undo"==a.toLowerCase()?
"Undo":"Redo")]?0:-1},notNeedUndo:1};var l={16:1,17:1,18:1,37:1,38:1,39:1,40:1},m=0,n=!1;e.addListener("ready",function(){c.on(this.body,"compositionstart",function(){n=!0});c.on(this.body,"compositionend",function(){n=!1})});e.addshortcutkey({Undo:"ctrl+90",Redo:"ctrl+89"});var r=!0;e.addListener("keydown",function(d,c){var f=this;if(!(l[c.keyCode||c.which]||(c.ctrlKey||c.metaKey||c.shiftKey||c.altKey)||n))if(f.selection.getRange().collapsed){0==f.undoManger.list.length&&f.undoManger.save(!0);clearTimeout(a);
var e=function(a){a.selection.getRange().collapsed&&a.fireEvent("contentchange");a.undoManger.save(!1,!0);a.fireEvent("selectionchange")};a=setTimeout(function(){if(n)var a=setInterval(function(){n||(e(f),clearInterval(a))},300);else e(f)},200);m++;m>=b&&e(f)}else f.undoManger.save(!1,!0),r=!1});e.addListener("keyup",function(a,b){l[b.keyCode||b.which]||(b.ctrlKey||b.metaKey||b.shiftKey||b.altKey)||n||r||(this.undoManger.save(!1,!0),r=!0)});e.stopCmdUndo=function(){e.__hasEnterExecCommand=!0};e.startCmdUndo=
function(){e.__hasEnterExecCommand=!1}};UE.plugins.paste=function(){function h(a){var b=this.document;if(!b.getElementById("baidu_pastebin")){var d=this.selection.getRange(),e=d.createBookmark(),g=b.createElement("div");g.id="baidu_pastebin";q.webkit&&g.appendChild(b.createTextNode(c.fillChar+c.fillChar));b.body.appendChild(g);e.start.style.display="";g.style.cssText="position:absolute;width:1px;height:1px;overflow:hidden;left:-1000px;white-space:nowrap;top:"+c.getXY(e.start).y+"px";d.selectNodeContents(g).select(!0);
setTimeout(function(){if(q.webkit)for(var h=0,t=b.querySelectorAll("#baidu_pastebin"),x;x=t[h++];)if(c.isEmptyNode(x))c.remove(x);else{g=x;break}try{g.parentNode.removeChild(g)}catch(w){}d.moveToBookmark(e).select(!0);a(g)},0)}}function a(a){var k;if(a.firstChild){var l=c.getElementsByTagName(a,"span");k=0;for(var m;m=l[k++];)"_baidu_cut_start"!=m.id&&"_baidu_cut_end"!=m.id||c.remove(m);if(q.webkit){m=a.querySelectorAll("div br");for(k=0;l=m[k++];)l=l.parentNode,"DIV"==l.tagName&&1==l.childNodes.length&&
(l.innerHTML="<p><br/></p>",c.remove(l));l=a.querySelectorAll("#baidu_pastebin");for(k=0;m=l[k++];){var n=e.document.createElement("p");for(m.parentNode.insertBefore(n,m);m.firstChild;)n.appendChild(m.firstChild);c.remove(m)}m=a.querySelectorAll("meta");for(k=0;l=m[k++];)c.remove(l);m=a.querySelectorAll("br");for(k=0;l=m[k++];)/^apple-/i.test(l.className)&&c.remove(l)}if(q.gecko)for(m=a.querySelectorAll("[_moz_dirty]"),k=0;l=m[k++];)l.removeAttribute("_moz_dirty");if(!q.ie)for(m=a.querySelectorAll("span.Apple-style-span"),
k=0;l=m[k++];)c.remove(l,!0);k=a.innerHTML;k=UE.filterWord(k);a=UE.htmlparser(k);e.options.filterRules&&UE.filterNode(a,e.options.filterRules);e.filterInputRule(a);q.webkit&&((k=a.lastChild())&&("element"==k.type&&"br"==k.tagName)&&a.removeChild(k),p.each(e.body.querySelectorAll("div"),function(a){c.isEmptyBlock(a)&&c.remove(a,!0)}));k={html:a.toHtml()};e.fireEvent("beforepaste",k,a);k.html&&(a=UE.htmlparser(k.html,!0),1===e.queryCommandState("pasteplain")?e.execCommand("insertHtml",UE.filterNode(a,
e.options.filterTxtRules).toHtml(),!0):(UE.filterNode(a,e.options.filterTxtRules),d=a.toHtml(),b=k.html,g=e.selection.getRange().createAddress(!0),e.execCommand("insertHtml",b,!0)),e.fireEvent("afterpaste",k))}}var e=this,d,b,g;e.addListener("pasteTransfer",function(a,k){if(g&&d&&b&&d!=b){var l=e.selection.getRange();l.moveToAddress(g,!0);if(!l.collapsed){for(;!c.isBody(l.startContainer);){var m=l.startContainer;if(1==m.nodeType){m=m.childNodes[l.startOffset];if(!m){l.setStartBefore(l.startContainer);
continue}(m=m.previousSibling)&&(3==m.nodeType&&RegExp("^[\n\r\t "+c.fillChar+"]*$").test(m.nodeValue))&&l.setStartBefore(m)}if(0==l.startOffset)l.setStartBefore(l.startContainer);else break}for(;!c.isBody(l.endContainer);){m=l.endContainer;if(1==m.nodeType){m=m.childNodes[l.endOffset];if(!m){l.setEndAfter(l.endContainer);continue}(m=m.nextSibling)&&(3==m.nodeType&&RegExp("^[\n\r\t"+c.fillChar+"]*$").test(m.nodeValue))&&l.setEndAfter(m)}if(l.endOffset==l.endContainer[3==l.endContainer.nodeType?"nodeValue":
"childNodes"].length)l.setEndAfter(l.endContainer);else break}}l.deleteContents();l.select(!0);e.__hasEnterExecCommand=!0;l=b;2===k?l=l.replace(/<(\/?)([\w\-]+)([^>]*)>/gi,function(a,b,d,c){d=d.toLowerCase();if({img:1}[d])return a;c=c.replace(/([\w\-]*?)\s*=\s*(("([^"]*)")|('([^']*)')|([^\s>]+))/gi,function(a,b,d){return{src:1,href:1,name:1}[b.toLowerCase()]?b+"="+d+" ":""});return{span:1,div:1}[d]?"":"<"+b+d+" "+p.trim(c)+">"}):k&&(l=d);e.execCommand("inserthtml",l,!0);e.__hasEnterExecCommand=!1;
for(l=e.selection.getRange();!c.isBody(l.startContainer)&&!l.startOffset&&l.startContainer[3==l.startContainer.nodeType?"nodeValue":"childNodes"].length;)l.setStartBefore(l.startContainer);l=l.createAddress(!0);g.endAddress=l.startAddress}});e.addListener("ready",function(){c.on(e.body,"cut",function(){!e.selection.getRange().collapsed&&e.undoManger&&e.undoManger.save()});c.on(e.body,q.ie||q.opera?"keydown":"paste",function(b){(!q.ie&&!q.opera||(b.ctrlKey||b.metaKey)&&"86"==b.keyCode)&&h.call(e,function(b){a(b)})})})};
UE.plugins.list=function(){function h(a){var b=[],d;for(d in a)b.push(d);return b}function a(a){var b=a.className;return c.hasClass(a,/custom_/)?b.match(/custom_(\w+)/)[1]:c.getStyle(a,"list-style-type")}function e(e,f){p.each(c.getElementsByTagName(e,"ol ul"),function(g){if(c.inDoc(g,e)){var l=g.parentNode;if(l.tagName==g.tagName){var k=a(g)||("OL"==g.tagName?"decimal":"disc"),h=a(l)||("OL"==l.tagName?"decimal":"disc");k==h&&(k=p.indexOf(n[g.tagName],k),k=k+1==n[g.tagName].length?0:k+1,b(g,n[g.tagName][k]))}var r=
0,k=2;c.hasClass(g,/custom_/)?/[ou]l/i.test(l.tagName)&&c.hasClass(l,/custom_/)||(k=1):/[ou]l/i.test(l.tagName)&&c.hasClass(l,/custom_/)&&(k=3);(l=c.getStyle(g,"list-style-type"))&&(g.style.cssText="list-style-type:"+l);g.className=p.trim(g.className.replace(/list-paddingleft-\w+/,""))+" list-paddingleft-"+k;p.each(c.getElementsByTagName(g,"li"),function(b){b.style.cssText&&(b.style.cssText="");if(!b.firstChild)c.remove(b);else if(b.parentNode===g){r++;if(c.hasClass(g,/custom_/)){var d=1,e=a(g);if("OL"==
g.tagName){if(e)switch(e){case "cn":case "cn1":case "cn2":10<r&&(0==r%10||10<r&&20>r)?d=2:20<r&&(d=3);break;case "num2":9<r&&(d=2)}b.className="list-"+m[e]+r+" list-"+e+"-paddingleft-"+d}else b.className="list-"+m[e]+" list-"+e+"-paddingleft"}else b.className=b.className.replace(/list-[\w\-]+/gi,"");d=b.getAttribute("class");null===d||d.replace(/\s/g,"")||c.removeAttributes(b,"class")}});!f&&d(g,g.tagName.toLowerCase(),a(g)||c.getStyle(g,"list-style-type"),!0)}})}function d(b,d,f,g){var l=b.nextSibling;
l&&(1==l.nodeType&&l.tagName.toLowerCase()==d&&(a(l)||c.getStyle(l,"list-style-type")||("ol"==d?"decimal":"disc"))==f)&&(c.moveChild(l,b),0==l.childNodes.length&&c.remove(l));l&&c.isFillChar(l)&&c.remove(l);(l=b.previousSibling)&&(1==l.nodeType&&l.tagName.toLowerCase()==d&&(a(l)||c.getStyle(l,"list-style-type")||("ol"==d?"decimal":"disc"))==f)&&c.moveChild(b,l);l&&c.isFillChar(l)&&c.remove(l);!g&&c.isEmptyBlock(b)&&c.remove(b);a(b)&&e(b.ownerDocument,!0)}function b(a,b){m[b]&&(a.className="custom_"+
b);try{c.setStyle(a,"list-style-type",b)}catch(d){}}function g(a){var b=a.previousSibling;b&&c.isEmptyBlock(b)&&c.remove(b);(b=a.nextSibling)&&c.isEmptyBlock(b)&&c.remove(b)}function f(a){for(;a&&!c.isBody(a);){if("TABLE"==a.nodeName)return null;if("LI"==a.nodeName)return a;a=a.parentNode}}var k=this,l={TD:1,PRE:1,BLOCKQUOTE:1},m={cn:"cn-1-",cn1:"cn-2-",cn2:"cn-3-",num:"num-1-",num1:"num-2-",num2:"num-3-",dash:"dash",dot:"dot"};k.setOpt({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});var n={OL:h(k.options.insertorderedlist),UL:h(k.options.insertunorderedlist)},r=k.options.listiconpath,t;for(t in m)k.options.insertorderedlist.hasOwnProperty(t)||k.options.insertunorderedlist.hasOwnProperty(t)||delete m[t];k.ready(function(){var a=[],b;for(b in m){if("dash"==
b||"dot"==b)a.push("li.list-"+m[b]+"{background-image:url("+r+m[b]+".gif)}"),a.push("ul.custom_"+b+"{list-style:none;}ul.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}");else{for(var d=0;99>d;d++)a.push("li.list-"+m[b]+d+"{background-image:url("+r+"list-"+m[b]+d+".gif)}");a.push("ol.custom_"+b+"{list-style:none;}ol.custom_"+b+" li{background-position:0 3px;background-repeat:no-repeat}")}switch(b){case "cn":a.push("li.list-"+b+"-paddingleft-1{padding-left:25px}");a.push("li.list-"+
b+"-paddingleft-2{padding-left:40px}");a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case "cn1":a.push("li.list-"+b+"-paddingleft-1{padding-left:30px}");a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");a.push("li.list-"+b+"-paddingleft-3{padding-left:55px}");break;case "cn2":a.push("li.list-"+b+"-paddingleft-1{padding-left:40px}");a.push("li.list-"+b+"-paddingleft-2{padding-left:55px}");a.push("li.list-"+b+"-paddingleft-3{padding-left:68px}");break;case "num":case "num1":a.push("li.list-"+
b+"-paddingleft-1{padding-left:25px}");break;case "num2":a.push("li.list-"+b+"-paddingleft-1{padding-left:35px}");a.push("li.list-"+b+"-paddingleft-2{padding-left:40px}");break;case "dash":a.push("li.list-"+b+"-paddingleft{padding-left:35px}");break;case "dot":a.push("li.list-"+b+"-paddingleft{padding-left:20px}")}}a.push(".list-paddingleft-1{padding-left:0}");a.push(".list-paddingleft-2{padding-left:"+k.options.listDefaultPaddingLeft+"px}");a.push(".list-paddingleft-3{padding-left:"+2*k.options.listDefaultPaddingLeft+
"px}");p.cssRule("list","ol,ul{margin:0;pading:0;"+(q.ie?"":"width:95%")+"}li{clear:both;}"+a.join("\n"),k.document)});k.ready(function(){c.on(k.body,"cut",function(){setTimeout(function(){var a=k.selection.getRange(),b;if(!a.collapsed&&(b=c.findParentByTagName(a.startContainer,"li",!0))&&!b.nextSibling&&c.isEmptyBlock(b)){b=b.parentNode;var d;(d=b.previousSibling)?(c.remove(b),a.setStartAtLast(d).collapse(!0)):(d=b.nextSibling)?(c.remove(b),a.setStartAtFirst(d).collapse(!0)):(d=k.document.createElement("p"),
c.fillNode(k.document,d),b.parentNode.insertBefore(d,b),c.remove(b),a.setStart(d,0).collapse(!0));a.select(!0)}})})});k.addListener("beforepaste",function(b,d){var e=this.selection.getRange(),f=UE.htmlparser(d.html,!0);if(e=c.findParentByTagName(e.startContainer,"li",!0)){var g=e.parentNode;p.each(f.getNodesByTagName("OL"==g.tagName?"ul":"ol"),function(d){d.tagName=g.tagName;d.setAttr();if(d.parentNode===f)b=a(g)||("OL"==g.tagName?"decimal":"disc");else{var c=d.parentNode.getAttr("class");(b=c&&/custom_/.test(c)?
c.match(/custom_(\w+)/)[1]:d.parentNode.getStyle("list-style-type"))||(b="OL"==g.tagName?"decimal":"disc")}c=p.indexOf(n[g.tagName],b);d.parentNode!==f&&(c=c+1==n[g.tagName].length?0:c+1);c=n[g.tagName][c];m[c]?d.setAttr("class","custom_"+c):d.setStyle("list-style-type",c)})}d.html=f.toHtml()});k.addInputRule(function(a){function b(a,e){var f=e.firstChild();if(f&&"element"==f.type&&"span"==f.tagName&&/Wingdings|Symbol/.test(f.getStyle("font-family"))){for(var g in c)if(c[g]==f.data)return g;return"disc"}for(g in d)if(d[g].test(a))return g}
p.each(a.getNodesByTagName("li"),function(a){for(var b=UE.uNode.createElement("p"),d=0,c;c=a.children[d];)"text"==c.type||v.p[c.tagName]?b.appendChild(c):b.firstChild()?(a.insertBefore(b,c),b=UE.uNode.createElement("p"),d+=2):d++;(b.firstChild()&&!b.parentNode||!a.firstChild())&&a.appendChild(b);b.firstChild()||b.innerHTML(q.ie?"&nbsp;":"<br/>");a=a.firstChild();(b=a.lastChild())&&("text"==b.type&&/^\s*$/.test(b.data))&&a.removeChild(b)});var d={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]+\)/},c={square:"n"};p.each(a.getNodesByTagName("p"),function(a){if("MsoListParagraph"==a.getAttr("class")){a.setStyle("margin","");a.setStyle("margin-left","");a.setAttr("class","");var c=a,e,f=a;if("li"!=a.parentNode.tagName&&(e=b(a.innerText(),a))){var g=UE.uNode.createElement(k.options.insertorderedlist.hasOwnProperty(e)?"ol":"ul");for(m[e]?
g.setAttr("class","custom_"+e):g.setStyle("list-style-type",e);a&&"li"!=a.parentNode.tagName&&b(a.innerText(),a);){(c=a.nextSibling())||a.parentNode.insertBefore(g,a);var l=g,n=e;if("ol"==l.tagName)if(q.ie){var h=a.firstChild();"element"==h.type&&("span"==h.tagName&&d[n].test(h.innerText()))&&a.removeChild(h)}else a.innerHTML(a.innerHTML().replace(d[n],""));else a.removeChild(a.firstChild());n=UE.uNode.createElement("li");n.appendChild(a);l.appendChild(n);a=c}!g.parentNode&&(a&&a.parentNode)&&a.parentNode.insertBefore(g,
a)}(c=f.firstChild())&&("element"==c.type&&"span"==c.tagName&&/^\s*(&nbsp;)+\s*$/.test(c.innerText()))&&c.parentNode.removeChild(c)}})});k.addListener("contentchange",function(){e(k.document)});k.addListener("keydown",function(a,b){function d(){b.preventDefault?b.preventDefault():b.returnValue=!1;k.fireEvent("contentchange");k.undoManger&&k.undoManger.save()}function e(a,b){for(;a&&!c.isBody(a)&&!b(a);){if(1==a.nodeType&&/[ou]l/i.test(a.tagName))return a;a=a.parentNode}return null}var f=b.keyCode||
b.which;if(13==f&&!b.shiftKey){var l=k.selection.getRange(),n=c.findParent(l.startContainer,function(a){return c.isBlockElm(a)},!0),m=c.findParentByTagName(l.startContainer,"li",!0);n&&("PRE"!=n.tagName&&!m)&&(m=n.innerHTML.replace(RegExp(c.fillChar,"g"),""),/^\s*1\s*\.[^\d]/.test(m)&&(n.innerHTML=m.replace(/^\s*1\s*\./,""),l.setStartAtLast(n).collapse(!0).select(),k.__hasEnterExecCommand=!0,k.execCommand("insertorderedlist"),k.__hasEnterExecCommand=!1));l=k.selection.getRange();n=e(l.startContainer,
function(a){return"TABLE"==a.tagName});m=l.collapsed?n:e(l.endContainer,function(a){return"TABLE"==a.tagName});if(n&&m&&n===m){if(!l.collapsed)if(n=c.findParentByTagName(l.startContainer,"li",!0),m=c.findParentByTagName(l.endContainer,"li",!0),n&&m&&n===m){if(l.deleteContents(),(m=c.findParentByTagName(l.startContainer,"li",!0))&&c.isEmptyBlock(m)){t=m.previousSibling;next=m.nextSibling;n=k.document.createElement("p");c.fillNode(k.document,n);r=m.parentNode;t&&next?(l.setStart(next,0).collapse(!0).select(!0),
c.remove(m)):((t||next)&&t?m.parentNode.parentNode.insertBefore(n,r.nextSibling):r.parentNode.insertBefore(n,r),c.remove(m),r.firstChild||c.remove(r),l.setStart(n,0).setCursor());d();return}}else{var n=l.cloneRange(),h=n.collapse(!1).createBookmark();l.deleteContents();n.moveToBookmark(h);m=c.findParentByTagName(n.startContainer,"li",!0);g(m);n.select();d();return}if(m=c.findParentByTagName(l.startContainer,"li",!0)){if(c.isEmptyBlock(m)){var h=l.createBookmark(),r=m.parentNode;m!==r.lastChild?(c.breakParent(m,
r),g(m)):(r.parentNode.insertBefore(m,r.nextSibling),c.isEmptyNode(r)&&c.remove(r));if(!v.$list[m.parentNode.tagName])if(c.isBlockElm(m.firstChild))c.remove(m,!0);else{n=k.document.createElement("p");for(m.parentNode.insertBefore(n,m);m.firstChild;)n.appendChild(m.firstChild);c.remove(m)}l.moveToBookmark(h).select()}else{n=m.firstChild;if(!n||!c.isBlockElm(n)){n=k.document.createElement("p");for(!m.firstChild&&c.fillNode(k.document,n);m.firstChild;)n.appendChild(m.firstChild);m.appendChild(n)}h=k.document.createElement("span");
l.insertNode(h);c.breakParent(h,m);t=h.nextSibling;n=t.firstChild;n||(n=k.document.createElement("p"),c.fillNode(k.document,n),t.appendChild(n));c.isEmptyNode(n)&&(n.innerHTML="",c.fillNode(k.document,n));l.setStart(n,0).collapse(!0).shrinkBoundary().select();c.remove(h);var t=t.previousSibling;t&&c.isEmptyBlock(t)&&(t.innerHTML="<p></p>",c.fillNode(k.document,t.firstChild))}d()}}}if(8==f&&(l=k.selection.getRange(),l.collapsed&&c.isStartInblock(l)&&(n=l.cloneRange().trimBoundary(),(m=c.findParentByTagName(l.startContainer,
"li",!0))&&c.isStartInblock(n))))if((n=c.findParentByTagName(l.startContainer,"p",!0))&&n!==m.firstChild)r=c.findParentByTagName(n,["ol","ul"]),c.breakParent(n,r),g(n),k.fireEvent("contentchange"),l.setStart(n,0).setCursor(!1,!0),k.fireEvent("saveScene"),c.preventDefault(b);else if(m&&(t=m.previousSibling)){if(46!=f||!m.childNodes.length){v.$list[t.tagName]&&(t=t.lastChild);k.undoManger&&k.undoManger.save();n=m.firstChild;if(c.isBlockElm(n))if(c.isEmptyNode(n))for(t.appendChild(n),l.setStart(n,0).setCursor(!1,
!0);m.firstChild;)t.appendChild(m.firstChild);else h=k.document.createElement("span"),l.insertNode(h),c.isEmptyBlock(t)&&(t.innerHTML=""),c.moveChild(m,t),l.setStartBefore(h).collapse(!0).select(!0),c.remove(h);else if(c.isEmptyNode(m))n=k.document.createElement("p"),t.appendChild(n),l.setStart(n,0).setCursor();else for(l.setEnd(t,t.childNodes.length).collapse().select(!0);m.firstChild;)t.appendChild(m.firstChild);c.remove(m);k.fireEvent("contentchange");k.fireEvent("saveScene");c.preventDefault(b)}}else if(m&&
!m.previousSibling){r=m.parentNode;h=l.createBookmark();if(c.isTagNode(r.parentNode,"ol ul"))r.parentNode.insertBefore(m,r);else{for(;m.firstChild;)r.parentNode.insertBefore(m.firstChild,r);c.remove(m)}c.isEmptyNode(r)&&c.remove(r);l.moveToBookmark(h).setCursor(!1,!0);k.fireEvent("contentchange");k.fireEvent("saveScene");c.preventDefault(b)}});k.addListener("keyup",function(b,e){if(8==(e.keyCode||e.which)){var f=k.selection.getRange(),g;(g=c.findParentByTagName(f.startContainer,["ol","ul"],!0))&&
d(g,g.tagName.toLowerCase(),a(g)||c.getComputedStyle(g,"list-style-type"),!0)}});k.addListener("tabkeydown",function(){function e(a){if(-1!=k.options.maxListLevel){a=a.parentNode;for(var b=0;/[ou]l/i.test(a.tagName);)b++,a=a.parentNode;if(b>=k.options.maxListLevel)return!0}}var f=k.selection.getRange(),g=c.findParentByTagName(f.startContainer,"li",!0);if(g){var l;if(f.collapsed){if(e(g))return!0;var m=g.parentNode,h=k.document.createElement(m.tagName),r=p.indexOf(n[h.tagName],a(m)||c.getComputedStyle(m,
"list-style-type")),r=r+1==n[h.tagName].length?0:r+1,r=n[h.tagName][r];b(h,r);if(c.isStartInblock(f))return k.fireEvent("saveScene"),l=f.createBookmark(),m.insertBefore(h,g),h.appendChild(g),d(h,h.tagName.toLowerCase(),r),k.fireEvent("contentchange"),f.moveToBookmark(l).select(!0),!0}else{k.fireEvent("saveScene");l=f.createBookmark();for(var m=0,t,h=c.findParents(g),q;q=h[m++];)if(c.isTagNode(q,"ol ul")){t=q;break}q=g;if(l.end)for(;q&&!(c.getPosition(q,l.end)&c.POSITION_FOLLOWING);)if(e(q))q=c.getNextDomNode(q,
!1,null,function(a){return a!==t});else{m=q.parentNode;h=k.document.createElement(m.tagName);r=p.indexOf(n[h.tagName],a(m)||c.getComputedStyle(m,"list-style-type"));r=n[h.tagName][r+1==n[h.tagName].length?0:r+1];b(h,r);for(m.insertBefore(h,q);q&&!(c.getPosition(q,l.end)&c.POSITION_FOLLOWING);){g=q.nextSibling;h.appendChild(q);if(!g||c.isTagNode(g,"ol ul")){if(g)for(;(g=g.firstChild)&&"LI"!=g.tagName;);else g=c.getNextDomNode(q,!1,null,function(a){return a!==t});break}q=g}d(h,h.tagName.toLowerCase(),
r);q=g}k.fireEvent("contentchange");f.moveToBookmark(l).select();return!0}}});k.commands.insertorderedlist=k.commands.insertunorderedlist={execCommand:function(e,g){g||(g="insertorderedlist"==e.toLowerCase()?"decimal":"disc");var k=this.selection.getRange(),m=function(a){return 1==a.nodeType?"br"!=a.tagName.toLowerCase():!c.isWhitespace(a)},n="insertorderedlist"==e.toLowerCase()?"ol":"ul",h=this.document.createDocumentFragment();k.adjustmentBoundary().shrinkBoundary();var r=k.createBookmark(!0),t=
f(this.document.getElementById(r.start)),p=0,q=f(this.document.getElementById(r.end)),s=0,z,E,B,A;if(t||q){t&&(z=t.parentNode);r.end||(q=t);q&&(E=q.parentNode);if(z===E){for(;t!==q;){A=t;t=t.nextSibling;if(!c.isBlockElm(A.firstChild)){for(m=this.document.createElement("p");A.firstChild;)m.appendChild(A.firstChild);A.appendChild(m)}h.appendChild(A)}A=this.document.createElement("span");z.insertBefore(A,q);if(!c.isBlockElm(q.firstChild)){for(m=this.document.createElement("p");q.firstChild;)m.appendChild(q.firstChild);
q.appendChild(m)}h.appendChild(q);c.breakParent(A,z);c.isEmptyNode(A.previousSibling)&&c.remove(A.previousSibling);c.isEmptyNode(A.nextSibling)&&c.remove(A.nextSibling);m=a(z)||c.getComputedStyle(z,"list-style-type")||("insertorderedlist"==e.toLowerCase()?"decimal":"disc");if(z.tagName.toLowerCase()==n&&m==g){q=0;for(q=this.document.createDocumentFragment();m=h.firstChild;)if(c.isTagNode(m,"ol ul"))q.appendChild(m);else for(;m.firstChild;)q.appendChild(m.firstChild),c.remove(m);A.parentNode.insertBefore(q,
A)}else B=this.document.createElement(n),b(B,g),B.appendChild(h),A.parentNode.insertBefore(B,A);c.remove(A);B&&d(B,n,g);k.moveToBookmark(r).select();return}if(t){for(;t;){A=t.nextSibling;if(c.isTagNode(t,"ol ul"))h.appendChild(t);else{B=this.document.createDocumentFragment();for(var N=0;t.firstChild;)c.isBlockElm(t.firstChild)&&(N=1),B.appendChild(t.firstChild);N?h.appendChild(B):(N=this.document.createElement("p"),N.appendChild(B),h.appendChild(N));c.remove(t)}t=A}z.parentNode.insertBefore(h,z.nextSibling);
c.isEmptyNode(z)?(k.setStartBefore(z),c.remove(z)):k.setStartAfter(z);p=1}if(q&&c.inDoc(E,this.document)){for(t=E.firstChild;t&&t!==q;){A=t.nextSibling;if(c.isTagNode(t,"ol ul"))h.appendChild(t);else{B=this.document.createDocumentFragment();for(N=0;t.firstChild;)c.isBlockElm(t.firstChild)&&(N=1),B.appendChild(t.firstChild);N?h.appendChild(B):(N=this.document.createElement("p"),N.appendChild(B),h.appendChild(N));c.remove(t)}t=A}A=c.createElement(this.document,"div",{tmpDiv:1});c.moveChild(q,A);h.appendChild(A);
c.remove(q);E.parentNode.insertBefore(h,E);k.setEndBefore(E);c.isEmptyNode(E)&&c.remove(E);s=1}}p||k.setStartBefore(this.document.getElementById(r.start));r.end&&!s&&k.setEndAfter(this.document.getElementById(r.end));k.enlarge(!0,function(a){return l[a.tagName]});h=this.document.createDocumentFragment();q=k.createBookmark();z=c.getNextDomNode(q.start,!1,m);B=k.cloneRange();for(p=c.isBlockElm;z&&z!==q.end&&c.getPosition(z,q.end)&c.POSITION_PRECEDING;)if(3==z.nodeType||v.li[z.tagName])if(1==z.nodeType&&
v.$list[z.tagName]){for(;z.firstChild;)h.appendChild(z.firstChild);t=c.getNextDomNode(z,!1,m);c.remove(z);z=t}else{t=z;for(B.setStartBefore(z);z&&z!==q.end&&(!p(z)||c.isBookmarkNode(z));)t=z,z=c.getNextDomNode(z,!1,null,function(a){return!l[a.tagName]});z&&p(z)&&(A=c.getNextDomNode(t,!1,m))&&c.isBookmarkNode(A)&&(z=c.getNextDomNode(A,!1,m),t=A);B.setEndAfter(t);z=c.getNextDomNode(t,!1,m);A=k.document.createElement("li");A.appendChild(B.extractContents());if(c.isEmptyNode(A)){for(t=k.document.createElement("p");A.firstChild;)t.appendChild(A.firstChild);
A.appendChild(t)}h.appendChild(A)}else z=c.getNextDomNode(z,!0,m);k.moveToBookmark(q).collapse(!0);B=this.document.createElement(n);b(B,g);B.appendChild(h);k.insertNode(B);d(B,n,g);q=0;for(n=c.getElementsByTagName(B,"div");m=n[q++];)m.getAttribute("tmpDiv")&&c.remove(m,!0);k.moveToBookmark(r).select()},queryCommandState:function(a){a="insertorderedlist"==a.toLowerCase()?"ol":"ul";for(var b=this.selection.getStartElementPath(),d=0,c;(c=b[d++])&&"TABLE"!=c.nodeName;)if(a==c.nodeName.toLowerCase())return 1;
return 0},queryCommandValue:function(b){b="insertorderedlist"==b.toLowerCase()?"ol":"ul";for(var d=this.selection.getStartElementPath(),e,f=0,g;g=d[f++];){if("TABLE"==g.nodeName){e=null;break}if(b==g.nodeName.toLowerCase()){e=g;break}}return e?a(e)||c.getComputedStyle(e,"list-style-type"):null}}};(function(){var h={textarea:function(a,c){var d=c.ownerDocument.createElement("textarea");d.style.cssText="position:absolute;resize:none;width:100%;height:100%;border:0;padding:0;margin:0;overflow-y:auto;";
q.ie&&8>q.version&&(d.style.width=c.offsetWidth+"px",d.style.height=c.offsetHeight+"px",c.onresize=function(){d.style.width=c.offsetWidth+"px";d.style.height=c.offsetHeight+"px"});c.appendChild(d);return{setContent:function(a){d.value=a},getContent:function(){return d.value},select:function(){var a;q.ie?(a=d.createTextRange(),a.collapse(!0),a.select()):(d.setSelectionRange(0,0),d.focus())},dispose:function(){c.removeChild(d);c=d=c.onresize=null}}},codemirror:function(a,c){var d=window.CodeMirror(c,
{mode:"text/html",tabMode:"indent",lineNumbers:!0,lineWrapping:!0}),b=d.getWrapperElement();b.style.cssText='position:absolute;left:0;top:0;width:100%;height:100%;font-family:consolas,"Courier new",monospace;font-size:13px;';d.getScrollerElement().style.cssText="position:absolute;left:0;top:0;width:100%;height:100%;";d.refresh();return{getCodeMirror:function(){return d},setContent:function(a){d.setValue(a)},getContent:function(){return d.getValue()},select:function(){d.focus()},dispose:function(){c.removeChild(b);
d=b=null}}}};UE.plugins.source=function(){var a=this,e=this.options,d=!1,b;e.sourceEditor=q.ie?"textarea":e.sourceEditor||"codemirror";a.setOpt({sourceEditorFirst:!1});var g,f=a.getContent,k;a.commands.source={execCommand:function(){if(d=!d){k=a.selection.getRange().createAddress(!1,!0);a.undoManger&&a.undoManger.save(!0);q.gecko&&(a.body.contentEditable=!1);g=a.iframe.style.cssText;a.iframe.style.cssText+="position:absolute;left:-32768px;top:-32768px;";a.fireEvent("beforegetcontent");var l=UE.htmlparser(a.body.innerHTML);
a.filterOutputRule(l);l.traversal(function(a){if("element"==a.type)switch(a.tagName){case "td":case "th":case "caption":a.children&&1==a.children.length&&"br"==a.firstChild().tagName&&a.removeChild(a.firstChild());break;case "pre":a.innerText(a.innerText().replace(/&nbsp;/g," "))}});a.fireEvent("aftergetcontent");l=l.toHtml(!0);b=h["codemirror"==e.sourceEditor&&window.CodeMirror?"codemirror":"textarea"](a,a.iframe.parentNode);b.setContent(l);setTimeout(function(){b.select();a.addListener("fullscreenchanged",
function(){try{b.getCodeMirror().refresh()}catch(a){}})});a.getContent=function(){return b.getContent()||"<p>"+(q.ie?"":"<br/>")+"</p>"}}else if(a.iframe.style.cssText=g,l=b.getContent()||"<p>"+(q.ie?"":"<br/>")+"</p>",l=l.replace(RegExp("[\\r\\t\\n ]*</?(\\w+)\\s*(?:[^>]*)>","g"),function(a,b){return b&&!v.$inlineWithA[b.toLowerCase()]?a.replace(/(^[\n\r\t ]*)|([\n\r\t ]*$)/g,""):a.replace(/(^[\n\r\t]*)|([\n\r\t]*$)/g,"")}),a.setContent(l),b.dispose(),b=null,a.getContent=f,l=a.body.firstChild,l||
(a.body.innerHTML="<p>"+(q.ie?"":"<br/>")+"</p>",l=a.body.firstChild),a.undoManger&&a.undoManger.save(!0),q.gecko){var n=document.createElement("input");n.style.cssText="position:absolute;left:0;top:-32768px";document.body.appendChild(n);a.body.contentEditable=!1;setTimeout(function(){c.setViewportOffset(n,{left:-32768,top:0});n.focus();setTimeout(function(){a.body.contentEditable=!0;a.selection.getRange().moveToAddress(k).select(!0);c.remove(n)})})}else try{a.selection.getRange().moveToAddress(k).select(!0)}catch(r){}this.fireEvent("sourcemodechanged",
d)},queryCommandState:function(){return d|0},notNeedUndo:1};var l=a.queryCommandState;a.queryCommandState=function(a){a=a.toLowerCase();return d?a in{source:1,fullscreen:1}?1:-1:l.apply(this,arguments)};"codemirror"==e.sourceEditor&&a.addListener("ready",function(){p.loadFile(document,{src:e.codeMirrorJsUrl||e.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.js",tag:"script",type:"text/javascript",defer:"defer"},function(){e.sourceEditorFirst&&setTimeout(function(){a.execCommand("source")},0)});
p.loadFile(document,{tag:"link",rel:"stylesheet",type:"text/css",href:e.codeMirrorCssUrl||e.UEDITOR_HOME_URL+"third-party/codemirror/codemirror.css"})})}})();UE.plugins.enterkey=function(){var h,a=this,e=a.options.enterTag;a.addListener("keyup",function(d,b){if(13==(b.keyCode||b.which)){var e=a.selection.getRange(),f=e.startContainer,k;if(q.ie)a.fireEvent("saveScene",!0,!0);else{if(/h\d/i.test(h)){if(q.gecko)c.findParentByTagName(f,"h1 h2 h3 h4 h5 h6 blockquote caption table".split(" "),!0)||(a.document.execCommand("formatBlock",
!1,"<p>"),k=1);else if(1==f.nodeType){var f=a.document.createTextNode(""),l;e.insertNode(f);if(l=c.findParentByTagName(f,"div",!0)){for(k=a.document.createElement("p");l.firstChild;)k.appendChild(l.firstChild);l.parentNode.insertBefore(k,l);c.remove(l);e.setStartBefore(f).setCursor();k=1}c.remove(f)}a.undoManger&&k&&a.undoManger.save()}q.opera&&e.select()}}});a.addListener("keydown",function(d,b){if(13==(b.keyCode||b.which))if(a.fireEvent("beforeenterkeydown"))c.preventDefault(b);else{a.fireEvent("saveScene",
!0,!0);h="";var g=a.selection.getRange();if(!g.collapsed){var f=g.startContainer,k=g.endContainer,f=c.findParentByTagName(f,"td",!0),k=c.findParentByTagName(k,"td",!0);if(f&&k&&f!==k||!f&&k||f&&!k){b.preventDefault?b.preventDefault():b.returnValue=!1;return}}if("p"==e)q.ie||((f=c.findParentByTagName(g.startContainer,"ol ul p h1 h2 h3 h4 h5 h6 blockquote caption".split(" "),!0))||q.opera?(h=f.tagName,"p"==f.tagName.toLowerCase()&&q.gecko&&c.removeDirtyAttr(f)):(a.document.execCommand("formatBlock",
!1,"<p>"),q.gecko&&(g=a.selection.getRange(),(f=c.findParentByTagName(g.startContainer,"p",!0))&&c.removeDirtyAttr(f))));else if(b.preventDefault?b.preventDefault():b.returnValue=!1,g.collapsed)k=g.document.createElement("br"),g.insertNode(k),k.parentNode.lastChild===k?(k.parentNode.insertBefore(k.cloneNode(!0),k),g.setStartBefore(k)):g.setStartAfter(k),g.setCursor();else if(g.deleteContents(),f=g.startContainer,1==f.nodeType&&(f=f.childNodes[g.startOffset])){for(;1==f.nodeType;){if(v.$empty[f.tagName])return g.setStartBefore(f).setCursor(),
a.undoManger&&a.undoManger.save(),!1;if(!f.firstChild)return k=g.document.createElement("br"),f.appendChild(k),g.setStart(f,0).setCursor(),a.undoManger&&a.undoManger.save(),!1;f=f.firstChild}f===g.startContainer.childNodes[g.startOffset]?(k=g.document.createElement("br"),g.insertNode(k).setCursor()):g.setStart(f,0).setCursor()}else k=g.document.createElement("br"),g.insertNode(k).setStartAfter(k).setCursor()}})};UE.plugins.keystrokes=function(){var h=this,a=!0;h.addListener("keydown",function(e,d){var b=
d.keyCode||d.which,g=h.selection.getRange();if(!g.collapsed&&!(d.ctrlKey||d.shiftKey||d.altKey||d.metaKey)&&(65<=b&&90>=b||48<=b&&57>=b||96<=b&&111>=b||{13:1,8:1,46:1}[b])){var f=g.startContainer;c.isFillChar(f)&&g.setStartBefore(f);f=g.endContainer;c.isFillChar(f)&&g.setEndAfter(f);g.txtToElmBoundary();g.endContainer&&1==g.endContainer.nodeType&&(f=g.endContainer.childNodes[g.endOffset])&&c.isBr(f)&&g.setEndAfter(f);if(0==g.startOffset&&(f=g.startContainer,c.isBoundaryNode(f,"firstChild")&&(f=g.endContainer,
g.endOffset==(3==f.nodeType?f.nodeValue.length:f.childNodes.length)&&c.isBoundaryNode(f,"lastChild")))){h.fireEvent("saveScene");h.body.innerHTML="<p>"+(q.ie?"":"<br/>")+"</p>";g.setStart(h.body.firstChild,0).setCursor(!1,!0);h._selectionChange();return}}if(8==b){g=h.selection.getRange();a=g.collapsed;if(h.fireEvent("delkeydown",d))return;var k,l;g.collapsed&&g.inFillChar()&&(k=g.startContainer,c.isFillChar(k)?(g.setStartBefore(k).shrinkBoundary(!0).collapse(!0),c.remove(k)):(k.nodeValue=k.nodeValue.replace(RegExp("^"+
c.fillChar),""),g.startOffset--,g.collapse(!0).select(!0)));if(k=g.getClosedNode()){h.fireEvent("saveScene");g.setStartBefore(k);c.remove(k);g.setCursor();h.fireEvent("saveScene");c.preventDefault(d);return}if(!q.ie&&(k=c.findParentByTagName(g.startContainer,"table",!0),l=c.findParentByTagName(g.endContainer,"table",!0),k&&!l||!k&&l||k!==l)){d.preventDefault();return}}if(9==b){var m={ol:1,ul:1,table:1};if(h.fireEvent("tabkeydown",d)){c.preventDefault(d);return}g=h.selection.getRange();h.fireEvent("saveScene");
var f=0,n="";k=h.options.tabSize||4;for(l=h.options.tabNode||"&nbsp;";f<k;f++)n+=l;f=h.document.createElement("span");f.innerHTML=n+c.fillChar;if(g.collapsed)g.insertNode(f.cloneNode(!0).firstChild).setCursor(!0);else if(n=function(a){return c.isBlockElm(a)&&!m[a.tagName.toLowerCase()]},k=c.findParent(g.startContainer,n,!0),l=c.findParent(g.endContainer,n,!0),k&&l&&k===l)g.deleteContents(),g.insertNode(f.cloneNode(!0).firstChild).setCursor(!0);else{k=g.createBookmark();g.enlarge(!0);l=g.createBookmark();
for(var r=c.getNextDomNode(l.start,!1,n);r&&!(c.getPosition(r,l.end)&c.POSITION_FOLLOWING);)r.insertBefore(f.cloneNode(!0).firstChild,r.firstChild),r=c.getNextDomNode(r,!1,n);g.moveToBookmark(l).moveToBookmark(k).select()}c.preventDefault(d)}if(q.gecko&&46==b&&(g=h.selection.getRange(),g.collapsed&&(k=g.startContainer,c.isEmptyBlock(k)))){for(b=k.parentNode;1==c.getChildCount(b)&&!c.isBody(b);)k=b,b=b.parentNode;k===b.lastChild&&d.preventDefault()}});h.addListener("keyup",function(e,d){var b;if(8==
(d.keyCode||d.which)&&!this.fireEvent("delkeyup")){b=this.selection.getRange();if(b.collapsed){var g;if((g=c.findParentByTagName(b.startContainer,"h1 h2 h3 h4 h5 h6".split(" "),!0))&&c.isEmptyBlock(g)){var f=g.previousSibling;if(f&&"TABLE"!=f.nodeName){c.remove(g);b.setStartAtLast(f).setCursor(!1,!0);return}if((f=g.nextSibling)&&"TABLE"!=f.nodeName){c.remove(g);b.setStartAtFirst(f).setCursor(!1,!0);return}}c.isBody(b.startContainer)&&(g=c.createElement(this.document,"p",{innerHTML:q.ie?c.fillChar:
"<br/>"}),b.insertNode(g).setStart(g,0).setCursor(!1,!0))}!a&&(3==b.startContainer.nodeType||1==b.startContainer.nodeType&&c.isEmptyBlock(b.startContainer))&&(q.ie?(g=b.document.createElement("span"),b.insertNode(g).setStartBefore(g).collapse(!0),b.select(),c.remove(g)):b.select())}})};UE.plugins.fiximgclick=function(){function h(){this.cover=this.resizer=this.editor=null;this.doc=document;this.prePos={x:0,y:0};this.startPos={x:0,y:0}}(function(){var a=[[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]];h.prototype={init:function(a){var d=this;d.editor=a;d.startPos=this.prePos={x:0,y:0};d.dragId=-1;a=[];var b=d.cover=document.createElement("div"),g=d.resizer=document.createElement("div");b.id=d.editor.ui.id+"_imagescale_cover";b.style.cssText="position:absolute;display:none;z-index:"+d.editor.options.zIndex+";filter:alpha(opacity=0); opacity:0;background:#CCC;";c.on(b,"mousedown click",function(){d.hide()});for(i=0;8>i;i++)a.push('<span class="edui-editor-scale-hand'+
i+'"></span>');g.id=d.editor.ui.id+"_imagescale";g.className="edui-editor-scale";g.innerHTML=a.join("");g.style.cssText+=";display:none;border:1px solid #3b77ff;z-index:"+d.editor.options.zIndex+";";d.editor.ui.getDom().appendChild(b);d.editor.ui.getDom().appendChild(g);d.initStyle();d.initEvents()},initStyle:function(){p.cssRule("imagescale",".edui-editor-scale{position:absolute;border:1px solid #38B2CE;}.edui-editor-scale span{position:absolute;width:6px;height:6px;overflow:hidden;font-size:0px;display:block;background-color:#3C9DD0;}.edui-editor-scale .edui-editor-scale-hand0{cursor:nw-resize;top:0;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-scale .edui-editor-scale-hand1{cursor:n-resize;top:0;margin-top:-4px;left:50%;margin-left:-4px;}.edui-editor-scale .edui-editor-scale-hand2{cursor:ne-resize;top:0;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-scale .edui-editor-scale-hand3{cursor:w-resize;top:50%;margin-top:-4px;left:0;margin-left:-4px;}.edui-editor-scale .edui-editor-scale-hand4{cursor:e-resize;top:50%;margin-top:-4px;left:100%;margin-left:-3px;}.edui-editor-scale .edui-editor-scale-hand5{cursor:sw-resize;top:100%;margin-top:-3px;left:0;margin-left:-4px;}.edui-editor-scale .edui-editor-scale-hand6{cursor:s-resize;top:100%;margin-top:-3px;left:50%;margin-left:-4px;}.edui-editor-scale .edui-editor-scale-hand7{cursor:se-resize;top:100%;margin-top:-3px;left:100%;margin-left:-3px;}")},
initEvents:function(){this.startPos.x=this.startPos.y=0;this.isDraging=!1},_eventHandler:function(a){switch(a.type){case "mousedown":var d=a.target||a.srcElement;-1!=d.className.indexOf("edui-editor-scale-hand")&&-1==this.dragId&&(this.dragId=d.className.slice(-1),this.startPos.x=this.prePos.x=a.clientX,this.startPos.y=this.prePos.y=a.clientY,c.on(this.doc,"mousemove",this.proxy(this._eventHandler,this)));break;case "mousemove":-1!=this.dragId&&(this.updateContainerStyle(this.dragId,{x:a.clientX-
this.prePos.x,y:a.clientY-this.prePos.y}),this.prePos.x=a.clientX,this.prePos.y=a.clientY,this.updateTargetElement());break;case "mouseup":-1!=this.dragId&&(this.updateContainerStyle(this.dragId,{x:a.clientX-this.prePos.x,y:a.clientY-this.prePos.y}),this.updateTargetElement(),this.target.parentNode&&this.attachTo(this.target),this.dragId=-1),c.un(this.doc,"mousemove",this.proxy(this._eventHandler,this)),this.editor.fireEvent("contentchange")}},updateTargetElement:function(){c.setStyles(this.target,
{width:this.resizer.style.width,height:this.resizer.style.height});this.attachTo(this.target)},updateContainerStyle:function(c,d){var b=this.resizer,g;0!=a[c][0]&&(g=parseInt(b.style.left)+d.x,b.style.left=this._validScaledProp("left",g)+"px");0!=a[c][1]&&(g=parseInt(b.style.top)+d.y,b.style.top=this._validScaledProp("top",g)+"px");0!=a[c][2]&&(g=b.clientWidth+a[c][2]*d.x,b.style.width=this._validScaledProp("width",g)+"px");0!=a[c][3]&&(g=b.clientHeight+a[c][3]*d.y,b.style.height=this._validScaledProp("height",
g)+"px")},_validScaledProp:function(a,d){var b=this.resizer,c=document;d=isNaN(d)?0:d;switch(a){case "left":return 0>d?0:d+b.clientWidth>c.clientWidth?c.clientWidth-b.clientWidth:d;case "top":return 0>d?0:d+b.clientHeight>c.clientHeight?c.clientHeight-b.clientHeight:d;case "width":return 0>=d?1:d+b.offsetLeft>c.clientWidth?c.clientWidth-b.offsetLeft:d;case "height":return 0>=d?1:d+b.offsetTop>c.clientHeight?c.clientHeight-b.offsetTop:d}},hideCover:function(){this.cover.style.display="none"},showCover:function(){var a=
c.getXY(this.editor.ui.getDom()),d=c.getXY(this.editor.iframe);c.setStyles(this.cover,{width:this.editor.iframe.offsetWidth+"px",height:this.editor.iframe.offsetHeight+"px",top:d.y-a.y+"px",left:d.x-a.x+"px",position:"absolute",display:""})},show:function(a){this.resizer.style.display="block";a&&this.attachTo(a);c.on(this.resizer,"mousedown",this.proxy(this._eventHandler,this));c.on(this.doc,"mouseup",this.proxy(this._eventHandler,this));this.showCover();this.editor.fireEvent("afterscaleshow",this);
this.editor.fireEvent("saveScene")},hide:function(){this.hideCover();this.resizer.style.display="none";c.un(this.resizer,"mousedown",this.proxy(this._eventHandler,this));c.un(this.doc,"mouseup",this.proxy(this._eventHandler,this));this.editor.fireEvent("afterscalehide",this)},proxy:function(a,d){return function(b){return a.apply(d||this,arguments)}},attachTo:function(a){a=this.target=a;var d=this.resizer,b=c.getXY(a),g=c.getXY(this.editor.iframe),f=c.getXY(d.parentNode);c.setStyles(d,{width:a.width+
"px",height:a.height+"px",left:g.x+b.x-this.editor.document.body.scrollLeft-f.x-parseInt(d.style.borderLeftWidth)+"px",top:g.y+b.y-this.editor.document.body.scrollTop-f.y-parseInt(d.style.borderTopWidth)+"px"})}}})();return function(){var a=this,e;a.setOpt("imageScaleEnabled",!0);q.webkit&&a.options.imageScaleEnabled&&a.addListener("click",function(d,b){var g=a.selection.getRange().getClosedNode();if(g&&"IMG"==g.tagName&&"false"!=a.body.contentEditable){if(!e){e=new h;e.init(a);a.ui.getDom().appendChild(e.resizer);
var f=function(a){e.hide()},k=function(a){var b=a.target||a.srcElement;!b||void 0!==b.className&&-1!=b.className.indexOf("edui-editor-scale")||f(a)},l;a.addListener("afterscaleshow",function(b){c.on(document,"keydown",f);c.on(a.document,"keydown",f);c.on(document,"mousedown",k);c.on(a.document,"mousedown",k);a.selection.getNative().removeAllRanges()});a.addListener("afterscalehide",function(b){c.un(document,"keydown",f);c.un(a.document,"keydown",f);c.un(document,"mousedown",k);c.un(a.document,"mousedown",
k);b=e.target;b.parentNode&&a.selection.getRange().selectNode(b).select()});c.on(e.resizer,"mousedown",function(b){a.selection.getNative().removeAllRanges();(b=b.target||b.srcElement)&&-1==b.className.indexOf("edui-editor-scale-hand")&&(l=setTimeout(function(){e.hide()},200))});c.on(e.resizer,"mouseup",function(a){(a=a.target||a.srcElement)&&-1==a.className.indexOf("edui-editor-scale-hand")&&clearTimeout(l)})}e.show(g)}else e&&"none"!=e.resizer.style.display&&e.hide()});q.webkit&&a.addListener("click",
function(d,b){"IMG"==b.target.tagName&&"false"!=a.body.contentEditable&&(new L.Range(a.document)).selectNode(b.target).select()})}}();UE.plugin.register("autolink",function(){return q.ie?{}:{bindEvents:{reset:function(){},keydown:function(h,a){var e=a.keyCode||a.which;if(32==e||13==e){for(var e=this.selection.getNative(),d=e.getRangeAt(0).cloneRange(),b,g=d.startContainer;1==g.nodeType&&0<d.startOffset;){g=d.startContainer.childNodes[d.startOffset-1];if(!g)break;d.setStart(g,1==g.nodeType?g.childNodes.length:
g.nodeValue.length);d.collapse(!0);g=d.startContainer}do{if(0==d.startOffset){for(g=d.startContainer.previousSibling;g&&1==g.nodeType;)g=g.lastChild;if(!g||c.isFillChar(g))break;b=g.nodeValue.length}else g=d.startContainer,b=d.startOffset;d.setStart(g,b-1);b=d.toString().charCodeAt(0)}while(160!=b&&32!=b);if(d.toString().replace(RegExp(c.fillChar,"g"),"").match(/(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i)){for(;d.toString().length&&!/^(?:https?:\/\/|ssh:\/\/|ftp:\/\/|file:\/|www\.)/i.test(d.toString());)try{d.setStart(d.startContainer,
d.startOffset+1)}catch(f){for(g=d.startContainer;!(next=g.nextSibling);){if(c.isBody(g))return;g=g.parentNode}d.setStart(next,0)}if(!c.findParentByTagName(d.startContainer,"a",!0)){b=this.document.createElement("a");var g=this.document.createTextNode(" "),k;this.undoManger&&this.undoManger.save();b.appendChild(d.extractContents());b.href=b.innerHTML=b.innerHTML.replace(/<[^>]+>/g,"");k=b.getAttribute("href").replace(RegExp(c.fillChar,"g"),"");k=/^(?:https?:\/\/)/ig.test(k)?k:"http://"+k;b.setAttribute("_src",
p.html(k));b.href=p.html(k);d.insertNode(b);b.parentNode.insertBefore(g,b.nextSibling);d.setStart(g,0);d.collapse(!0);e.removeAllRanges();e.addRange(d);this.undoManger&&this.undoManger.save()}}}}}}},function(){function h(a){if(3==a.nodeType)return null;if("A"==a.nodeName)return a;for(a=a.lastChild;a;){if("A"==a.nodeName)return a;if(3==a.nodeType){if(c.isWhitespace(a)){a=a.previousSibling;continue}return null}a=a.lastChild}}var a={37:1,38:1,39:1,40:1,13:1,32:1};q.ie&&this.addListener("keyup",function(e,
d){var b=d.keyCode;if(a[b]){var g=this.selection.getRange(),f=g.startContainer;if(13==b){for(;f&&!c.isBody(f)&&!c.isBlockElm(f);)f=f.parentNode;f&&!c.isBody(f)&&"P"==f.nodeName&&(g=f.previousSibling)&&1==g.nodeType&&(g=h(g))&&!g.getAttribute("_href")&&c.remove(g,!0)}else 32==b?3==f.nodeType&&/^\s$/.test(f.nodeValue)&&(f=f.previousSibling)&&("A"==f.nodeName&&!f.getAttribute("_href"))&&c.remove(f,!0):(f=c.findParentByTagName(f,"a",!0))&&!f.getAttribute("_href")&&(b=g.createBookmark(),c.remove(f,!0),
g.moveToBookmark(b).select(!0))}})});UE.plugins.autoheight=function(){function h(){var a=this;clearTimeout(f);k||a.queryCommandState&&(!a.queryCommandState||1==a.queryCommandState("source"))||(f=setTimeout(function(){var f=a.body.lastChild;g=Math.max(c.getXY(f).y+f.offsetHeight+25,Math.max(b.minFrameHeight,b.initialFrameHeight));g!=d&&(a.setHeight(g,!0),d=g)},50))}var a=this;a.autoHeightEnabled=!1!==a.options.autoHeightEnabled;if(a.autoHeightEnabled){var e,d=0,b=a.options,g,f,k;a.addListener("fullscreenchanged",
function(a,b){k=b});a.addListener("destroy",function(){a.removeListener("contentchange afterinserthtml keyup mouseup",h)});a.enableAutoHeight=function(){var a=this;if(a.autoHeightEnabled){var b=a.document;a.autoHeightEnabled=!0;e=b.body.style.overflowY;b.body.style.overflowY="hidden";a.addListener("contentchange afterinserthtml keyup mouseup",h);setTimeout(function(){h.call(a)},q.gecko?100:0);a.fireEvent("autoheightchanged",a.autoHeightEnabled)}};a.disableAutoHeight=function(){a.body.style.overflowY=
e||"";a.removeListener("contentchange",h);a.removeListener("keyup",h);a.removeListener("mouseup",h);a.autoHeightEnabled=!1;a.fireEvent("autoheightchanged",a.autoHeightEnabled)};a.addListener("ready",function(){a.enableAutoHeight();var b;c.on(q.ie?a.body:a.document,q.webkit?"dragover":"drop",function(){clearTimeout(b);b=setTimeout(function(){h.call(a)},100)})})}};UE.plugins.autofloat=function(){function h(){var a=document.body.style;a.backgroundImage='url("about:blank")';a.backgroundAttachment="fixed"}
function a(){w=!0;n.parentNode&&n.parentNode.removeChild(n);r.style.cssText=m}function e(){var b=x(d.container),f=d.options.toolbarTopOffset||0;if(0>b.top&&b.bottom-r.offsetHeight>f){var b=c.getXY(r),f=c.getComputedStyle(r,"position"),e=c.getComputedStyle(r,"left");r.style.width=r.offsetWidth+"px";r.style.zIndex=1*d.options.zIndex+1;r.parentNode.insertBefore(n,r);k||l&&q.ie?("absolute"!=r.style.position&&(r.style.position="absolute"),r.style.top=(document.body.scrollTop||document.documentElement.scrollTop)-
t+g+"px"):(q.ie7Compat&&w&&(w=!1,r.style.left=c.getXY(r).x-document.documentElement.getBoundingClientRect().left+2+"px"),"fixed"!=r.style.position&&(r.style.position="fixed",r.style.top=g+"px",("absolute"==f||"relative"==f)&&parseFloat(e)&&(r.style.left=b.x+"px")))}else a()}var d=this,b=d.getLang();d.setOpt({topOffset:0});var g=d.options.topOffset;if(!1!==d.options.autoFloatEnabled){var f=UE.ui.uiUtils,k=q.ie&&6>=q.version,l=q.quirks,m,n=document.createElement("div"),r,t,x,w=!0,u=p.defer(function(){e()},
q.ie?200:100,!0);d.addListener("destroy",function(){c.un(window,["scroll","resize"],e);d.removeListener("keydown",u)});d.addListener("ready",function(){var g;UE.ui?g=1:(alert(b.autofloatMsg),g=0);g&&d.ui&&(x=f.getClientRect,r=d.ui.getDom("toolbarbox"),t=x(r).top,m=r.style.cssText,n.style.height=r.offsetHeight+"px",k&&h(),c.on(window,["scroll","resize"],e),d.addListener("keydown",u),d.addListener("beforefullscreenchange",function(b,d){d&&a()}),d.addListener("fullscreenchanged",function(a,b){b||e()}),
d.addListener("sourcemodechanged",function(a,b){setTimeout(function(){e()},0)}),d.addListener("clearDoc",function(){setTimeout(function(){e()},0)}))})}};UE.plugins.pasteplain=function(){this.setOpt({pasteplain:!1,filterTxtRules:function(){function a(a){a.tagName="p";a.setStyle()}function c(a){a.parentNode.removeChild(a,!0)}return{"-":"script style object iframe embed input select",p:{$:{}},br:{$:{}},div:function(a){for(var b,c=UE.uNode.createElement("p");b=a.firstChild();)"text"!=b.type&&UE.dom.dtd.$block[b.tagName]?
c.firstChild()?(a.parentNode.insertBefore(c,a),c=UE.uNode.createElement("p")):a.parentNode.insertBefore(b,a):c.appendChild(b);c.firstChild()&&a.parentNode.insertBefore(c,a);a.parentNode.removeChild(a)},ol:c,ul:c,dl:c,dt:c,dd:c,li:c,caption:a,th:a,tr:a,h1:a,h2:a,h3:a,h4:a,h5:a,h6:a,td:function(a){a.innerText()&&a.parentNode.insertAfter(UE.uNode.createText(" &nbsp; &nbsp;"),a);a.parentNode.removeChild(a,a.innerText())}}}()});var c=this.options.pasteplain;this.commands.pasteplain={queryCommandState:function(){return c?
1:0},execCommand:function(){c=!c|0},notNeedUndo:1}};UE.plugins.video=function(){function h(a,b,c,f,k,l){return l?'<embed type="application/x-shockwave-flash" class="edui-faked-video" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+p.html(a)+'" width="'+b+'" height="'+c+'"'+(k?' style="float:'+k+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >':"<img "+(f?'id="'+f+'"':"")+' width="'+b+'" height="'+c+'" _url="'+a+
'" class="edui-faked-video" src="'+e.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+e.options.UEDITOR_HOME_URL+"themes/default/images/videologo.gif) no-repeat center center; border:1px solid gray;"+(k?"float:"+k+";":"")+'" />'}function a(a,b){p.each(a.getNodesByTagName(b?"img":"embed"),function(a){if("edui-faked-video"==a.getAttr("class")){var d=h(b?a.getAttr("_url"):a.getAttr("src"),a.getAttr("width"),a.getAttr("height"),null,a.getStyle("float")||"",b);a.parentNode.replaceChild(UE.uNode.createElement(d),
a)}})}var e=this;e.addOutputRule(function(d){a(d,!0)});e.addInputRule(function(d){a(d)});e.commands.insertvideo={execCommand:function(a,b){b=p.isArray(b)?b:[b];for(var g=[],f=0,k,l=b.length;f<l;f++)k=b[f],g.push(h(k.url,k.width||420,k.height||280,"tmpVedio"+f,null,!1));e.execCommand("inserthtml",g.join(""),!0);g=this.selection.getRange();f=0;for(l=b.length;f<l;f++)k=this.document.getElementById("tmpVedio"+f),c.removeAttributes(k,"id"),g.selectNode(k).select(),e.execCommand("imagefloat",b[f].align)},
queryCommandState:function(){var a=e.selection.getRange().getClosedNode();return a&&"edui-faked-video"==a.className?1:0}}};(function(){var h=UE.UETable=function(a){this.table=a;this.indexTable=[];this.selectedTds=[];this.cellsRange={};this.update(a)};h.removeSelectedClass=function(a){p.each(a,function(a){c.removeClasses(a,"selectTdClass")})};h.addSelectedClass=function(a){p.each(a,function(a){c.addClass(a,"selectTdClass")})};h.isEmptyBlock=function(a){var e=RegExp(c.fillChar,"g");if(0<a[q.ie?"innerText":
"textContent"].replace(/^\s*$/,"").replace(e,"").length)return 0;for(var d in v.$isNotEmpty)if(v.$isNotEmpty.hasOwnProperty(d)&&a.getElementsByTagName(d).length)return 0;return 1};h.getWidth=function(a){return a?parseInt(c.getComputedStyle(a,"width"),10):0};h.getTableCellAlignState=function(a){!p.isArray(a)&&(a=[a]);var c={},d=["align","valign"],b=null,g=!0;p.each(a,function(a){p.each(d,function(d){b=a.getAttribute(d);if(!c[d]&&b)c[d]=b;else if(!c[d]||b!==c[d])return g=!1});return g});return g?c:
null};h.getTableItemsByRange=function(a){var e=a.selection.getStart();e&&(e.id&&0===e.id.indexOf("_baidu_bookmark_start_"))&&(e=e.nextSibling);var d=(a=e&&c.findParentByTagName(e,["td","th"],!0))&&a.parentNode,e=e&&c.findParentByTagName(e,"caption",!0);return{cell:a,tr:d,table:e?e.parentNode:d&&d.parentNode.parentNode,caption:e}};h.getUETableBySelected=function(a){return(a=h.getTableItemsByRange(a).table)&&a.ueTable&&a.ueTable.selectedTds.length?a.ueTable:null};h.getDefaultValue=function(a,e){var d=
{thin:"0px",medium:"1px",thick:"2px"},b,g,f;if(e)k=e.getElementsByTagName("td")[0],f=c.getComputedStyle(e,"border-left-width"),b=parseInt(d[f]||f,10),f=c.getComputedStyle(k,"padding-left"),g=parseInt(d[f]||f,10),f=c.getComputedStyle(k,"border-left-width"),d=parseInt(d[f]||f,10);else{e=a.document.createElement("table");e.insertRow(0).insertCell(0).innerHTML="xxx";a.body.appendChild(e);var k=e.getElementsByTagName("td")[0];f=c.getComputedStyle(e,"border-left-width");b=parseInt(d[f]||f,10);f=c.getComputedStyle(k,
"padding-left");g=parseInt(d[f]||f,10);f=c.getComputedStyle(k,"border-left-width");d=parseInt(d[f]||f,10);c.remove(e)}return{tableBorder:b,tdPadding:g,tdBorder:d}};h.getUETable=function(a){var e=a.tagName.toLowerCase();a="td"==e||"th"==e||"caption"==e?c.findParentByTagName(a,"table",!0):a;a.ueTable||(a.ueTable=new h(a));return a.ueTable};h.cloneCell=function(a,e,d){if(!a||p.isString(a))return this.table.ownerDocument.createElement(a||"td");var b=c.hasClass(a,"selectTdClass");b&&c.removeClasses(a,
"selectTdClass");var g=a.cloneNode(!0);e&&(g.rowSpan=g.colSpan=1);!d&&c.removeAttributes(g,"width height");!d&&c.removeAttributes(g,"style");g.style.borderLeftStyle="";g.style.borderTopStyle="";g.style.borderLeftColor=a.style.borderRightColor;g.style.borderLeftWidth=a.style.borderRightWidth;g.style.borderTopColor=a.style.borderBottomColor;g.style.borderTopWidth=a.style.borderBottomWidth;b&&c.addClass(a,"selectTdClass");return g};h.prototype={getMaxRows:function(){for(var a=this.table.rows,c=1,d=0,
b;b=a[d];d++){for(var g=1,f=0,k;k=b.cells[f++];)g=Math.max(k.rowSpan||1,g);c=Math.max(g+d,c)}return c},getMaxCols:function(){for(var a=this.table.rows,c=0,d={},b=0,g;g=a[b];b++){for(var f=0,k=0,l;l=g.cells[k++];)if(f+=l.colSpan||1,l.rowSpan&&1<l.rowSpan)for(var m=1;m<l.rowSpan;m++)d["row_"+(b+m)]?d["row_"+(b+m)]++:d["row_"+(b+m)]=l.colSpan||1;f+=d["row_"+b]||0;c=Math.max(f,c)}return c},getCellColIndex:function(a){},getHSideCell:function(a,c){try{var d=this.getCellInfo(a),b,g,f=this.selectedTds.length,
k=this.cellsRange;if(!c&&(f?!k.beginColIndex:!d.colIndex)||c&&(f?k.endColIndex==this.colsNum-1:d.colIndex==this.colsNum-1))return null;b=f?k.beginRowIndex:d.rowIndex;g=c?f?k.endColIndex+1:d.colIndex+1:f?k.beginColIndex-1:1>d.colIndex?0:d.colIndex-1;return this.getCell(this.indexTable[b][g].rowIndex,this.indexTable[b][g].cellIndex)}catch(l){}},getTabNextCell:function(a,c){var d=this.getCellInfo(a),b=c||d.rowIndex,d=d.colIndex+1+(d.colSpan-1),g;try{g=this.getCell(this.indexTable[b][d].rowIndex,this.indexTable[b][d].cellIndex)}catch(f){try{b=
1*b+1,d=0,g=this.getCell(this.indexTable[b][d].rowIndex,this.indexTable[b][d].cellIndex)}catch(k){}}return g},getVSideCell:function(a,c,d){try{var b=this.getCellInfo(a),g,f,k=this.selectedTds.length&&!d,l=this.cellsRange;if(!c&&0==b.rowIndex||c&&(k?l.endRowIndex==this.rowsNum-1:b.rowIndex+b.rowSpan>this.rowsNum-1))return null;g=c?k?l.endRowIndex+1:b.rowIndex+b.rowSpan:k?l.beginRowIndex-1:b.rowIndex-1;f=k?l.beginColIndex:b.colIndex;return this.getCell(this.indexTable[g][f].rowIndex,this.indexTable[g][f].cellIndex)}catch(m){}},
getSameEndPosCells:function(a,e){try{for(var d="x"===e.toLowerCase(),b=c.getXY(a)[d?"x":"y"]+a["offset"+(d?"Width":"Height")],g=this.table.rows,f=null,k=[],l=0;l<this.rowsNum;l++)for(var f=g[l].cells,m=0,n;n=f[m++];){var h=c.getXY(n)[d?"x":"y"]+n["offset"+(d?"Width":"Height")];if(h>b&&d)break;if(a==n||b==h)if(1==n[d?"colSpan":"rowSpan"]&&k.push(n),d)break}return k}catch(t){}},setCellContent:function(a,e){a.innerHTML=e||(q.ie?c.fillChar:"<br />")},cloneCell:h.cloneCell,getSameStartPosXCells:function(a){try{var e=
c.getXY(a).x+a.offsetWidth,d=this.table.rows,b;a=[];for(var g=0;g<this.rowsNum;g++){b=d[g].cells;for(var f=0,k;k=b[f++];){var l=c.getXY(k).x;if(l>e)break;if(l==e&&1==k.colSpan){a.push(k);break}}}return a}catch(m){}},update:function(a){this.table=a||this.table;this.selectedTds=[];this.cellsRange={};this.indexTable=[];a=this.table.rows;for(var e=this.getMaxRows(),d=e-a.length,b=this.getMaxCols();d--;)this.table.insertRow(a.length);this.rowsNum=e;this.colsNum=b;for(var d=0,g=a.length;d<g;d++)this.indexTable[d]=
Array(b);for(var d=0,f;f=a[d];d++){var g=0,k;for(f=f.cells;k=f[g];g++){k.rowSpan>e&&(k.rowSpan=e);var l=g,m=k.rowSpan||1;for(k=k.colSpan||1;this.indexTable[d][l];)l++;for(var n=0;n<m;n++)for(var h=0;h<k;h++)this.indexTable[d+n][l+h]={rowIndex:d,cellIndex:g,colIndex:l,rowSpan:m,colSpan:k}}}for(n=0;n<e;n++)for(h=0;h<b;h++)void 0===this.indexTable[n][h]&&(f=a[n],k=(k=f.cells[f.cells.length-1])?k.cloneNode(!0):this.table.ownerDocument.createElement("td"),this.setCellContent(k),1!==k.colSpan&&(k.colSpan=
1),1!==k.rowSpan&&(k.rowSpan=1),f.appendChild(k),this.indexTable[n][h]={rowIndex:n,cellIndex:k.cellIndex,colIndex:h,rowSpan:1,colSpan:1});a=c.getElementsByTagName(this.table,"td");var t=[];p.each(a,function(a){c.hasClass(a,"selectTdClass")&&t.push(a)});t.length&&(e=t[t.length-1],a=this.getCellInfo(t[0]),e=this.getCellInfo(e),this.selectedTds=t,this.cellsRange={beginRowIndex:a.rowIndex,beginColIndex:a.colIndex,endRowIndex:e.rowIndex+e.rowSpan-1,endColIndex:e.colIndex+e.colSpan-1});if(!c.hasClass(this.table.rows[0],
"firstRow"))for(c.addClass(this.table.rows[0],"firstRow"),d=1;d<this.table.rows.length;d++)c.removeClasses(this.table.rows[d],"firstRow")},getCellInfo:function(a){if(a){var c=a.cellIndex;a=a.parentNode.rowIndex;for(var d=this.indexTable[a],b=this.colsNum,g=c;g<b;g++){var f=d[g];if(f.rowIndex===a&&f.cellIndex===c)return f}}},getCell:function(a,c){return a<this.rowsNum&&this.table.rows[a].cells[c]||null},deleteCell:function(a,c){c="number"==typeof c?c:a.parentNode.rowIndex;this.table.rows[c].deleteCell(a.cellIndex)},
getCellsRange:function(a,c){function d(a,c,f,e){var g=a,l=c,k=f,n=e,m,h,r;if(0<a)for(h=c;h<e;h++)m=b.indexTable[a][h],r=m.rowIndex,r<a&&(g=Math.min(r,g));if(e<b.colsNum)for(r=a;r<f;r++)m=b.indexTable[r][e],h=m.colIndex+m.colSpan-1,h>e&&(n=Math.max(h,n));if(f<b.rowsNum)for(h=c;h<e;h++)m=b.indexTable[f][h],r=m.rowIndex+m.rowSpan-1,r>f&&(k=Math.max(r,k));if(0<c)for(r=a;r<f;r++)m=b.indexTable[r][c],h=m.colIndex,h<c&&(l=Math.min(m.colIndex,l));return g!=a||l!=c||k!=f||n!=e?d(g,l,k,n):{beginRowIndex:a,
beginColIndex:c,endRowIndex:f,endColIndex:e}}try{var b=this,g=b.getCellInfo(a);if(a===c)return{beginRowIndex:g.rowIndex,beginColIndex:g.colIndex,endRowIndex:g.rowIndex+g.rowSpan-1,endColIndex:g.colIndex+g.colSpan-1};var f=b.getCellInfo(c),k=Math.min(g.rowIndex,f.rowIndex),l=Math.min(g.colIndex,f.colIndex),m=Math.max(g.rowIndex+g.rowSpan-1,f.rowIndex+f.rowSpan-1),n=Math.max(g.colIndex+g.colSpan-1,f.colIndex+f.colSpan-1);return d(k,l,m,n)}catch(h){}},getCells:function(a){this.clearSelected();for(var c=
a.beginColIndex,d=a.endRowIndex,b=a.endColIndex,g,f,k={},l=[],m=a.beginRowIndex;m<=d;m++)for(var n=c;n<=b;n++){a=this.indexTable[m][n];g=a.rowIndex;f=a.colIndex;var h=g+"|"+f;if(!k[h]){k[h]=1;if(g<m||f<n||g+a.rowSpan-1>d||f+a.colSpan-1>b)return null;l.push(this.getCell(g,a.cellIndex))}}return l},clearSelected:function(){h.removeSelectedClass(this.selectedTds);this.selectedTds=[];this.cellsRange={}},setSelected:function(a){var c=this.getCells(a);h.addSelectedClass(c);this.selectedTds=c;this.cellsRange=
a},isFullRow:function(){var a=this.cellsRange;return a.endColIndex-a.beginColIndex+1==this.colsNum},isFullCol:function(){var a=this.cellsRange,c=this.table.getElementsByTagName("th"),a=a.endRowIndex-a.beginRowIndex+1;return c.length?a==this.rowsNum||a==this.rowsNum-1:a==this.rowsNum},getNextCell:function(a,c,d){try{var b=this.getCellInfo(a),g,f,k=this.selectedTds.length&&!d,l=this.cellsRange;if(!c&&0==b.rowIndex||c&&(k?l.endRowIndex==this.rowsNum-1:b.rowIndex+b.rowSpan>this.rowsNum-1))return null;
g=c?k?l.endRowIndex+1:b.rowIndex+b.rowSpan:k?l.beginRowIndex-1:b.rowIndex-1;f=k?l.beginColIndex:b.colIndex;return this.getCell(this.indexTable[g][f].rowIndex,this.indexTable[g][f].cellIndex)}catch(m){}},getPreviewCell:function(a,c){try{var d=this.getCellInfo(a),b,g,f=this.selectedTds.length,k=this.cellsRange;if(!c&&(f?!k.beginColIndex:!d.colIndex)||c&&(f?k.endColIndex==this.colsNum-1:d.rowIndex>this.colsNum-1))return null;b=c?f?k.beginRowIndex:1>d.rowIndex?0:d.rowIndex-1:f?k.beginRowIndex:d.rowIndex;
g=c?f?k.endColIndex+1:d.colIndex:f?k.beginColIndex-1:1>d.colIndex?0:d.colIndex-1;return this.getCell(this.indexTable[b][g].rowIndex,this.indexTable[b][g].cellIndex)}catch(l){}},moveContent:function(a,c){if(!h.isEmptyBlock(c))if(h.isEmptyBlock(a))a.innerHTML=c.innerHTML;else{var d=a.lastChild;for(3!=d.nodeType&&v.$block[d.tagName]||a.appendChild(a.ownerDocument.createElement("br"));d=c.firstChild;)a.appendChild(d)}},mergeRight:function(a){var c=this.getCellInfo(a),d=this.indexTable[c.rowIndex][c.colIndex+
c.colSpan],b=this.getCell(d.rowIndex,d.cellIndex);a.colSpan=c.colSpan+d.colSpan;a.removeAttribute("width");this.moveContent(a,b);this.deleteCell(b,d.rowIndex);this.update()},mergeDown:function(a){var c=this.getCellInfo(a),d=this.indexTable[c.rowIndex+c.rowSpan][c.colIndex],b=this.getCell(d.rowIndex,d.cellIndex);a.rowSpan=c.rowSpan+d.rowSpan;a.removeAttribute("height");this.moveContent(a,b);this.deleteCell(b,d.rowIndex);this.update()},mergeRange:function(){var a=this.cellsRange,c=this.getCell(a.beginRowIndex,
this.indexTable[a.beginRowIndex][a.beginColIndex].cellIndex);if("TH"==c.tagName&&a.endRowIndex!==a.beginRowIndex)var d=this.indexTable,a=this.getCellInfo(c),c=this.getCell(1,d[1][a.colIndex].cellIndex),a=this.getCellsRange(c,this.getCell(d[this.rowsNum-1][a.colIndex].rowIndex,d[this.rowsNum-1][a.colIndex].cellIndex));for(var b=this.getCells(a),d=0,g;g=b[d++];)g!==c&&(this.moveContent(c,g),this.deleteCell(g));c.rowSpan=a.endRowIndex-a.beginRowIndex+1;1<c.rowSpan&&c.removeAttribute("height");c.colSpan=
a.endColIndex-a.beginColIndex+1;1<c.colSpan&&c.removeAttribute("width");c.rowSpan==this.rowsNum&&1!=c.colSpan&&(c.colSpan=1);if(c.colSpan==this.colsNum&&1!=c.rowSpan){b=c.parentNode.rowIndex;if(this.table.deleteRow)for(d=b+1,b+=1,a=c.rowSpan;d<a;d++)this.table.deleteRow(b);else for(d=0,a=c.rowSpan-1;d<a;d++)g=this.table.rows[b+1],g.parentNode.removeChild(g);c.rowSpan=1}this.update()},insertRow:function(a,e){function d(a,b,d){0==a?(a=(d.nextSibling||d.previousSibling).cells[a],"TH"==a.tagName&&(a=
b.ownerDocument.createElement("th"),a.appendChild(b.firstChild),d.insertBefore(a,b),c.remove(b))):"TH"==b.tagName&&(a=b.ownerDocument.createElement("td"),a.appendChild(b.firstChild),d.insertBefore(a,b),c.remove(b))}var b=this.colsNum,g=this.table.insertRow(a),f,k="string"==typeof e&&"TH"==e.toUpperCase();if(0==a||a==this.rowsNum)for(var l=0;l<b;l++)f=this.cloneCell(e,!0),this.setCellContent(f),f.getAttribute("vAlign")&&f.setAttribute("vAlign",f.getAttribute("vAlign")),g.appendChild(f),k||d(l,f,g);
else for(var m=this.indexTable[a],l=0;l<b;l++){var n=m[l];n.rowIndex<a?(f=this.getCell(n.rowIndex,n.cellIndex),f.rowSpan=n.rowSpan+1):(f=this.cloneCell(e,!0),this.setCellContent(f),g.appendChild(f));k||d(l,f,g)}this.update();return g},deleteRow:function(a){for(var e=this.table.rows[a],d=this.indexTable[a],b=this.colsNum,g=0,f=0;f<b;){var k=d[f],l=this.getCell(k.rowIndex,k.cellIndex);if(1<l.rowSpan&&k.rowIndex==a){k=l.cloneNode(!0);k.rowSpan=l.rowSpan-1;k.innerHTML="";l.rowSpan=1;var m=a+1,n=this.table.rows[m],
m=this.getPreviewMergedCellsNum(m,f)-g;m<f?(m=f-m-1,c.insertAfter(n.cells[m],k)):n.cells.length&&n.insertBefore(k,n.cells[0]);g+=1}f+=l.colSpan||1}a=[];g={};for(f=0;f<b;f++)l=d[f].rowIndex,k=d[f].cellIndex,n=l+"_"+k,g[n]||(g[n]=1,l=this.getCell(l,k),a.push(l));var h=[];p.each(a,function(a){1==a.rowSpan?a.parentNode.removeChild(a):h.push(a)});p.each(h,function(a){a.rowSpan--});e.parentNode.removeChild(e);this.update()},insertCol:function(a,e,d){function b(a,b,d){0==a?(a=b.nextSibling||b.previousSibling,
"TH"==a.tagName&&(a=b.ownerDocument.createElement("th"),a.appendChild(b.firstChild),d.insertBefore(a,b),c.remove(b))):"TH"==b.tagName&&(a=b.ownerDocument.createElement("td"),a.appendChild(b.firstChild),d.insertBefore(a,b),c.remove(b))}var g=this.rowsNum,f=0,k,l,h=parseInt((this.table.offsetWidth-20*(this.colsNum+1)-(this.colsNum+1))/(this.colsNum+1),10),n="string"==typeof e&&"TH"==e.toUpperCase(),r;if(0==a||a==this.colsNum)for(;f<g;f++)k=this.table.rows[f],r=k.cells[0==a?a:k.cells.length],l=this.cloneCell(e,
!0),this.setCellContent(l),l.setAttribute("vAlign",l.getAttribute("vAlign")),r&&l.setAttribute("width",r.getAttribute("width")),a?c.insertAfter(k.cells[k.cells.length-1],l):k.insertBefore(l,k.cells[0]),n||b(f,l,k);else for(;f<g;f++)r=this.indexTable[f][a],r.colIndex<a?(l=this.getCell(r.rowIndex,r.cellIndex),l.colSpan=r.colSpan+1):(k=this.table.rows[f],r=k.cells[r.cellIndex],l=this.cloneCell(e,!0),this.setCellContent(l),l.setAttribute("vAlign",l.getAttribute("vAlign")),r&&l.setAttribute("width",r.getAttribute("width")),
r?k.insertBefore(l,r):k.appendChild(l)),n||b(f,l,k);this.update();this.updateWidth(h,d||{tdPadding:10,tdBorder:1})},updateWidth:function(a,e){var d=this.table,b=h.getWidth(d)-2*e.tdPadding-e.tdBorder+a;b<d.ownerDocument.body.offsetWidth?d.setAttribute("width",b):(d=c.getElementsByTagName(this.table,"td th"),p.each(d,function(b){b.setAttribute("width",a)}))},deleteCol:function(a){for(var c=this.indexTable,d=this.table.rows,b=this.table.getAttribute("width"),g=0,f=this.rowsNum,k={},l=0;l<f;){var h=
c[l][a],n=h.rowIndex+"_"+h.colIndex;k[n]||(k[n]=1,n=this.getCell(h.rowIndex,h.cellIndex),g||(g=n&&parseInt(n.offsetWidth/n.colSpan,10).toFixed(0)),1<n.colSpan?n.colSpan--:d[l].deleteCell(h.cellIndex),l+=h.rowSpan||1)}this.table.setAttribute("width",b-g);this.update()},splitToCells:function(a){var c=this;a=this.splitToRows(a);p.each(a,function(a){c.splitToCols(a)})},splitToRows:function(a){var c=this.getCellInfo(a),d=c.rowIndex,b=c.colIndex,g=[];a.rowSpan=1;g.push(a);for(var f=d,k=d+c.rowSpan;f<k;f++)if(f!=
d){var l=this.table.rows[f].insertCell(b-this.getPreviewMergedCellsNum(f,b));l.colSpan=c.colSpan;this.setCellContent(l);l.setAttribute("vAlign",a.getAttribute("vAlign"));l.setAttribute("align",a.getAttribute("align"));a.style.cssText&&(l.style.cssText=a.style.cssText);g.push(l)}this.update();return g},getPreviewMergedCellsNum:function(a,c){for(var d=this.indexTable[a],b=0,g=0;g<c;)var f=d[g].colSpan,b=b+(f-(d[g].rowIndex==a?1:0)),g=g+f;return b},splitToCols:function(a){var e=(a.offsetWidth/a.colSpan-
22).toFixed(0),d=this.getCellInfo(a),b=d.rowIndex,g=d.colIndex,f=[];a.colSpan=1;a.setAttribute("width",e);f.push(a);for(var k=g,l=g+d.colSpan;k<l;k++)if(k!=g){var h=this.table.rows[b],n=h.insertCell(this.indexTable[b][k].cellIndex+1);n.rowSpan=d.rowSpan;this.setCellContent(n);n.setAttribute("vAlign",a.getAttribute("vAlign"));n.setAttribute("align",a.getAttribute("align"));n.setAttribute("width",e);a.style.cssText&&(n.style.cssText=a.style.cssText);if("TH"==a.tagName){var r=a.ownerDocument.createElement("th");
r.appendChild(n.firstChild);r.setAttribute("vAlign",a.getAttribute("vAlign"));r.rowSpan=n.rowSpan;h.insertBefore(r,n);c.remove(n)}f.push(n)}this.update();return f},isLastCell:function(a,c,d){c=c||this.rowsNum;d=d||this.colsNum;a=this.getCellInfo(a);return a.rowIndex+a.rowSpan==c&&a.colIndex+a.colSpan==d},getLastCell:function(a){a=a||this.table.getElementsByTagName("td");this.getCellInfo(a[0]);var c=this,d=a[0],b=d.parentNode,g=0,f=0,k;p.each(a,function(a){a.parentNode==b&&(f+=a.colSpan||1);g+=a.rowSpan*
a.colSpan||1});k=g/f;p.each(a,function(a){if(c.isLastCell(a,k,f))return d=a,!1});return d},selectRow:function(a){var c=this.indexTable[a];a=this.getCell(c[0].rowIndex,c[0].cellIndex);c=this.getCell(c[this.colsNum-1].rowIndex,c[this.colsNum-1].cellIndex);a=this.getCellsRange(a,c);this.setSelected(a)},selectTable:function(){var a=this.table.getElementsByTagName("td"),a=this.getCellsRange(a[0],a[a.length-1]);this.setSelected(a)},setBackground:function(a,c){if("string"===typeof c)p.each(a,function(a){a.style.backgroundColor=
c});else if("object"===typeof c){c=p.extend({repeat:!0,colorList:["#ddd","#fff"]},c);for(var d=this.getCellInfo(a[0]).rowIndex,b=0,g=c.colorList,f=function(a,b,c){return a[b]?a[b]:c?a[b%a.length]:""},k=0,l;l=a[k++];){var h=this.getCellInfo(l);l.style.backgroundColor=f(g,d+b==h.rowIndex?b:++b,c.repeat)}}},removeBackground:function(a){p.each(a,function(a){a.style.backgroundColor=""})}}})();(function(){function h(b,e){var g=c.getElementsByTagName(b,"td th");p.each(g,function(a){a.removeAttribute("width")});
b.setAttribute("width",a(e,!0,d.getDefaultValue(e,b)));var h=[];setTimeout(function(){p.each(g,function(a){1==a.colSpan&&h.push(a.offsetWidth)});p.each(g,function(a,b){1==a.colSpan&&a.setAttribute("width",h[b]+"")})},0)}function a(a,b,d){var e=a.body;return e.offsetWidth-(b?2*parseInt(c.getComputedStyle(e,"margin-left"),10):0)-2*d.tableBorder-(a.options.offsetWidth||0)}function e(a){if(a=b(a).cell){var c=g(a);return c.selectedTds.length?c.selectedTds:[a]}return[]}var d=UE.UETable,b=function(a){return d.getTableItemsByRange(a)},
g=function(a){return d.getUETable(a)};UE.commands.inserttable={queryCommandState:function(){return b(this).table?-1:0},execCommand:function(a,b){b||(b=p.extend({},{numCols:this.options.defaultCols,numRows:this.options.defaultRows,tdvalign:this.options.tdvalign}));var e=this.selection.getRange().startContainer,e=c.findParent(e,function(a){return c.isBlockElm(a)},!0)||this.body,g=d.getDefaultValue(this,void 0),e=Math.floor(e.offsetWidth/b.numCols-2*g.tdPadding-g.tdBorder);!b.tdvalign&&(b.tdvalign=this.options.tdvalign);
this.execCommand("inserthtml",function(a,b){for(var d=[],f=a.numRows,e=a.numCols,g=0;g<f;g++){d.push("<tr>");for(var l=0;l<e;l++)d.push('<td width="'+b+'" vAlign="'+a.tdvalign+'" >'+(q.ie?c.fillChar:"<br/>")+"</td>");d.push("</tr>")}return"<table><tbody>"+d.join("")+"</tbody></table>"}(b,e))}};UE.commands.insertparagraphbeforetable={queryCommandState:function(){return b(this).cell?0:-1},execCommand:function(){var a=b(this).table;if(a){var c=this.document.createElement("p");c.innerHTML=q.ie?"&nbsp;":
"<br />";a.parentNode.insertBefore(c,a);this.selection.getRange().setStart(c,0).setCursor()}}};UE.commands.deletetable={queryCommandState:function(){var a=this.selection.getRange();return c.findParentByTagName(a.startContainer,"table",!0)?0:-1},execCommand:function(a,b){var d=this.selection.getRange();if(b=b||c.findParentByTagName(d.startContainer,"table",!0)){var e=b.nextSibling;e||(e=c.createElement(this.document,"p",{innerHTML:q.ie?c.fillChar:"<br/>"}),b.parentNode.insertBefore(e,b));c.remove(b);
d=this.selection.getRange();3==e.nodeType?d.setStartBefore(e):d.setStart(e,0);d.setCursor(!1,!0);this.fireEvent("tablehasdeleted")}}};UE.commands.cellalign={queryCommandState:function(){return e(this).length?0:-1},execCommand:function(a,b){var c=e(this);if(c.length)for(var d=0,g;g=c[d++];)g.setAttribute("align",b)}};UE.commands.cellvalign={queryCommandState:function(){return e(this).length?0:-1},execCommand:function(a,b){var c=e(this);if(c.length)for(var d=0,g;g=c[d++];)g.setAttribute("vAlign",b)}};
UE.commands.insertcaption={queryCommandState:function(){var a=b(this).table;return a?0==a.getElementsByTagName("caption").length?1:-1:-1},execCommand:function(){var a=b(this).table;if(a){var d=this.document.createElement("caption");d.innerHTML=q.ie?c.fillChar:"<br/>";a.insertBefore(d,a.firstChild);this.selection.getRange().setStart(d,0).setCursor()}}};UE.commands.deletecaption={queryCommandState:function(){var a=this.selection.getRange();return(a=c.findParentByTagName(a.startContainer,"table"))?0==
a.getElementsByTagName("caption").length?-1:1:-1},execCommand:function(){var a=this.selection.getRange();if(a=c.findParentByTagName(a.startContainer,"table"))c.remove(a.getElementsByTagName("caption")[0]),this.selection.getRange().setStart(a.rows[0].cells[0],0).setCursor()}};UE.commands.inserttitle={queryCommandState:function(){var a=b(this).table;return a?(a=a.rows[0],"th"!=a.cells[a.cells.length-1].tagName.toLowerCase()?0:-1):-1},execCommand:function(){var a=b(this).table;a&&g(a).insertRow(0,"th");
a=a.getElementsByTagName("th")[0];this.selection.getRange().setStart(a,0).setCursor(!1,!0)}};UE.commands.deletetitle={queryCommandState:function(){var a=b(this).table;return a?(a=a.rows[0],"th"==a.cells[a.cells.length-1].tagName.toLowerCase()?0:-1):-1},execCommand:function(){var a=b(this).table;a&&c.remove(a.rows[0]);a=a.getElementsByTagName("td")[0];this.selection.getRange().setStart(a,0).setCursor(!1,!0)}};UE.commands.inserttitlecol={queryCommandState:function(){var a=b(this).table;return a?a.rows[a.rows.length-
1].getElementsByTagName("th").length?-1:0:-1},execCommand:function(a){(a=b(this).table)&&g(a).insertCol(0,"th");h(a,this);a=a.getElementsByTagName("th")[0];this.selection.getRange().setStart(a,0).setCursor(!1,!0)}};UE.commands.deletetitlecol={queryCommandState:function(){var a=b(this).table;return a?a.rows[a.rows.length-1].getElementsByTagName("th").length?0:-1:-1},execCommand:function(){var a=b(this).table;if(a)for(var d=0;d<a.rows.length;d++)c.remove(a.rows[d].children[0]);h(a,this);a=a.getElementsByTagName("td")[0];
this.selection.getRange().setStart(a,0).setCursor(!1,!0)}};UE.commands.mergeright={queryCommandState:function(a){var c=b(this);if(!c.cell)return-1;a=g(c.table);if(a.selectedTds.length)return-1;var c=a.getCellInfo(c.cell),d=c.colIndex+c.colSpan;if(d>=a.colsNum)return-1;a=a.indexTable[c.rowIndex][d];return a.rowIndex==c.rowIndex&&a.rowSpan==c.rowSpan?0:-1},execCommand:function(a){a=this.selection.getRange();var c=a.createBookmark(!0),d=b(this).cell;g(d).mergeRight(d);a.moveToBookmark(c).select()}};
UE.commands.mergedown={queryCommandState:function(a){a=b(this);var c=a.cell;if(!c||"TH"==c.tagName)return-1;var d=g(a.table);if(d.selectedTds.length)return-1;var c=d.getCellInfo(a.cell),e=c.rowIndex+c.rowSpan;if(e>=d.rowsNum)return-1;d=d.indexTable[e][c.colIndex];return d.colIndex==c.colIndex&&d.colSpan==c.colSpan&&"TH"!==a.cell.tagName?0:-1},execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),d=b(this).cell;g(d).mergeDown(d);a.moveToBookmark(c).select()}};UE.commands.mergecells=
{queryCommandState:function(){return d.getUETableBySelected(this)?0:-1},execCommand:function(){var a=d.getUETableBySelected(this);if(a&&a.selectedTds.length){var b=a.selectedTds[0];a.mergeRange();a=this.selection.getRange();c.isEmptyBlock(b)?a.setStart(b,0).collapse(!0):a.selectNodeContents(b);a.select()}}};UE.commands.insertrow={queryCommandState:function(){var a=b(this),c=a.cell;return c&&("TD"==c.tagName||"TH"==c.tagName&&a.tr!==a.table.rows[0])&&g(a.table).rowsNum<this.options.maxRowNum?0:-1},
execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),d=b(this),e=d.cell,d=d.table,h=g(d),r=h.getCellInfo(e);if(h.selectedTds.length)for(var r=h.cellsRange,t=0,p=r.endRowIndex-r.beginRowIndex+1;t<p;t++)h.insertRow(r.beginRowIndex,e);else h.insertRow(r.rowIndex,e);a.moveToBookmark(c).select();"enabled"===d.getAttribute("interlaced")&&this.fireEvent("interlacetable",d)}};UE.commands.insertrownext={queryCommandState:function(){var a=b(this),c=a.cell;return c&&"TD"==c.tagName&&
g(a.table).rowsNum<this.options.maxRowNum?0:-1},execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),d=b(this),e=d.cell,d=d.table,h=g(d),r=h.getCellInfo(e);if(h.selectedTds.length)for(var r=h.cellsRange,t=0,p=r.endRowIndex-r.beginRowIndex+1;t<p;t++)h.insertRow(r.endRowIndex+1,e);else h.insertRow(r.rowIndex+r.rowSpan,e);a.moveToBookmark(c).select();"enabled"===d.getAttribute("interlaced")&&this.fireEvent("interlacetable",d)}};UE.commands.deleterow={queryCommandState:function(){if(!b(this).cell)return-1},
execCommand:function(){var a=b(this).cell,d=g(a),e=d.cellsRange,h=d.getCellInfo(a),n=d.getVSideCell(a),r=d.getVSideCell(a,!0),a=this.selection.getRange();if(p.isEmptyObject(e))d.deleteRow(h.rowIndex);else for(var t=e.beginRowIndex;t<e.endRowIndex+1;t++)d.deleteRow(e.beginRowIndex);t=d.table;t.getElementsByTagName("td").length?1==h.rowSpan||h.rowSpan==e.endRowIndex-e.beginRowIndex+1?(r||n)&&a.selectNodeContents(r||n).setCursor(!1,!0):(d=d.getCell(h.rowIndex,d.indexTable[h.rowIndex][h.colIndex].cellIndex))&&
a.selectNodeContents(d).setCursor(!1,!0):(d=t.nextSibling,c.remove(t),d&&a.setStart(d,0).setCursor(!1,!0));"enabled"===t.getAttribute("interlaced")&&this.fireEvent("interlacetable",t)}};UE.commands.insertcol={queryCommandState:function(a){a=b(this);var c=a.cell;return c&&("TD"==c.tagName||"TH"==c.tagName&&c!==a.tr.cells[0])&&g(a.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(a){var c=this.selection.getRange(),d=c.createBookmark(!0);if(-1!=this.queryCommandState(a)){a=b(this).cell;
var e=g(a),h=e.getCellInfo(a);if(e.selectedTds.length)for(var h=e.cellsRange,r=0,t=h.endColIndex-h.beginColIndex+1;r<t;r++)e.insertCol(h.beginColIndex,a);else e.insertCol(h.colIndex,a);c.moveToBookmark(d).select(!0)}}};UE.commands.insertcolnext={queryCommandState:function(){var a=b(this);return a.cell&&g(a.table).colsNum<this.options.maxColNum?0:-1},execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),d=b(this).cell,e=g(d),h=e.getCellInfo(d);if(e.selectedTds.length)for(var h=
e.cellsRange,r=0,t=h.endColIndex-h.beginColIndex+1;r<t;r++)e.insertCol(h.endColIndex+1,d);else e.insertCol(h.colIndex+h.colSpan,d);a.moveToBookmark(c).select()}};UE.commands.deletecol={queryCommandState:function(){if(!b(this).cell)return-1},execCommand:function(){var a=b(this).cell,d=g(a),e=d.cellsRange,h=d.getCellInfo(a),n=d.getHSideCell(a),r=d.getHSideCell(a,!0);if(p.isEmptyObject(e))d.deleteCol(h.colIndex);else for(h=e.beginColIndex;h<e.endColIndex+1;h++)d.deleteCol(e.beginColIndex);d=d.table;
e=this.selection.getRange();d.getElementsByTagName("td").length?c.inDoc(a,this.document)?e.setStart(a,0).setCursor(!1,!0):r&&c.inDoc(r,this.document)?e.selectNodeContents(r).setCursor(!1,!0):n&&c.inDoc(n,this.document)&&e.selectNodeContents(n).setCursor(!0,!0):(a=d.nextSibling,c.remove(d),a&&e.setStart(a,0).setCursor(!1,!0))}};UE.commands.splittocells={queryCommandState:function(){var a=b(this),c=a.cell;return!c||0<g(a.table).selectedTds.length?-1:c&&(1<c.colSpan||1<c.rowSpan)?0:-1},execCommand:function(){var a=
this.selection.getRange(),c=a.createBookmark(!0),d=b(this).cell;g(d).splitToCells(d);a.moveToBookmark(c).select()}};UE.commands.splittorows={queryCommandState:function(){var a=b(this),c=a.cell;return!c||0<g(a.table).selectedTds.length?-1:c&&1<c.rowSpan?0:-1},execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),d=b(this).cell;g(d).splitToRows(d);a.moveToBookmark(c).select()}};UE.commands.splittocols={queryCommandState:function(){var a=b(this),c=a.cell;return!c||0<g(a.table).selectedTds.length?
-1:c&&1<c.colSpan?0:-1},execCommand:function(){var a=this.selection.getRange(),c=a.createBookmark(!0),d=b(this).cell;g(d).splitToCols(d);a.moveToBookmark(c).select()}};UE.commands.adaptbytext=UE.commands.adaptbywindow={queryCommandState:function(){return b(this).table?0:-1},execCommand:function(a){var d=b(this).table;d&&("adaptbywindow"==a?h(d,this):(a=c.getElementsByTagName(d,"td th"),p.each(a,function(a){a.removeAttribute("width")}),d.removeAttribute("width")))}};UE.commands.averagedistributecol=
{queryCommandState:function(){var a=d.getUETableBySelected(this);return a?a.isFullRow()||a.isFullCol()?0:-1:-1},execCommand:function(a){function b(){var a=h.table,c=0,e=0,f=d.getDefaultValue(g,a);if(h.isFullRow())c=a.offsetWidth,e=h.colsNum;else for(var a=h.cellsRange.endColIndex,l,k=h.cellsRange.beginColIndex;k<=a;)l=h.selectedTds[k],c+=l.offsetWidth,k+=l.colSpan,e+=1;return Math.ceil(c/e)-2*f.tdBorder-2*f.tdPadding}function e(a){p.each(c.getElementsByTagName(h.table,"th"),function(a){a.setAttribute("width",
"")});var b=h.isFullRow()?c.getElementsByTagName(h.table,"td"):h.selectedTds;p.each(b,function(b){1==b.colSpan&&b.setAttribute("width",a)})}var g=this,h=d.getUETableBySelected(g);h&&h.selectedTds.length&&e(b())}};UE.commands.averagedistributerow={queryCommandState:function(){var a=d.getUETableBySelected(this);return!a||a.selectedTds&&/th/ig.test(a.selectedTds[0].tagName)?-1:a.isFullRow()||a.isFullCol()?0:-1},execCommand:function(a){function b(){var a,e=0;a=h.table;var f=d.getDefaultValue(g,a),l=parseInt(c.getComputedStyle(a.getElementsByTagName("td")[0],
"padding-top"));if(h.isFullCol()){var e=c.getElementsByTagName(a,"caption"),k=c.getElementsByTagName(a,"th"),p,s;0<e.length&&(p=e[0].offsetHeight);0<k.length&&(s=k[0].offsetHeight);e=a.offsetHeight-(p||0)-(s||0);a=0==k.length?h.rowsNum:h.rowsNum-1}else{s=h.cellsRange.beginRowIndex;k=h.cellsRange.endRowIndex;p=0;for(a=c.getElementsByTagName(a,"tr");s<=k;s++)e+=a[s].offsetHeight,p+=1;a=p}return q.ie&&9>q.version?Math.ceil(e/a):Math.ceil(e/a)-2*f.tdBorder-2*l}function e(a){var b=h.isFullCol()?c.getElementsByTagName(h.table,
"td"):h.selectedTds;p.each(b,function(b){1==b.rowSpan&&b.setAttribute("height",a)})}var g=this,h=d.getUETableBySelected(g);h&&h.selectedTds.length&&e(b())}};UE.commands.cellalignment={queryCommandState:function(){return b(this).table?0:-1},execCommand:function(a,b){var e=d.getUETableBySelected(this);e?p.each(e.selectedTds,function(a){c.setAttributes(a,b)}):(e=(e=this.selection.getStart())&&c.findParentByTagName(e,["td","th","caption"],!0),/caption/ig.test(e.tagName)?(e.style.textAlign=b.align,e.style.verticalAlign=
b.vAlign):c.setAttributes(e,b),this.selection.getRange().setCursor(!0))},queryCommandValue:function(a){(a=b(this).cell)||(a=e(this)[0]);if(a){var c=UE.UETable.getUETable(a).selectedTds;!c.length&&(c=a);return UE.UETable.getTableCellAlignState(c)}return null}};UE.commands.tablealignment={queryCommandState:function(){return q.ie&&8>q.version?-1:b(this).table?0:-1},execCommand:function(a,b){var d=this.selection.getStart();(d=d&&c.findParentByTagName(d,["table"],!0))&&d.setAttribute("align",b)}};UE.commands.edittable=
{queryCommandState:function(){return b(this).table?0:-1},execCommand:function(a,b){var d=this.selection.getRange();if(d=c.findParentByTagName(d.startContainer,"table"))d=c.getElementsByTagName(d,"td").concat(c.getElementsByTagName(d,"th"),c.getElementsByTagName(d,"caption")),p.each(d,function(a){a.style.borderColor=b})}};UE.commands.edittd={queryCommandState:function(){return b(this).table?0:-1},execCommand:function(a,b){var e=d.getUETableBySelected(this);if(e)p.each(e.selectedTds,function(a){a.style.backgroundColor=
b});else if(e=(e=this.selection.getStart())&&c.findParentByTagName(e,["td","th","caption"],!0))e.style.backgroundColor=b}};UE.commands.settablebackground={queryCommandState:function(){return 1<e(this).length?0:-1},execCommand:function(a,b){var c;c=e(this);g(c[0]).setBackground(c,b)}};UE.commands.cleartablebackground={queryCommandState:function(){var a=e(this);if(!a.length)return-1;for(var b=0,c;c=a[b++];)if(""!==c.style.backgroundColor)return 0;return-1},execCommand:function(){var a=e(this);g(a[0]).removeBackground(a)}};
UE.commands.interlacetable=UE.commands.uninterlacetable={queryCommandState:function(a){var c=b(this).table;if(!c)return-1;c=c.getAttribute("interlaced");return"interlacetable"==a?"enabled"===c?-1:0:c&&"disabled"!==c?0:-1},execCommand:function(a,c){var d=b(this).table;"interlacetable"==a?(d.setAttribute("interlaced","enabled"),this.fireEvent("interlacetable",d,c)):(d.setAttribute("interlaced","disabled"),this.fireEvent("uninterlacetable",d))}};UE.commands.setbordervisible={queryCommandState:function(a){return b(this).table?
0:-1},execCommand:function(){var a=b(this).table;p.each(c.getElementsByTagName(a,"td"),function(a){a.style.borderWidth="1px";a.style.borderStyle="solid"})}}})();UE.plugins.table=function(){function h(b,c){a(b,"width",!0);a(b,"height",!0)}function a(a,b,c){a.style[b]&&(c&&a.setAttribute(b,parseInt(a.style[b],10)),a.style[b]="")}function e(a){if("TD"==a.tagName||"TH"==a.tagName)return a;var b;return(b=c.findParentByTagName(a,"td",!0)||c.findParentByTagName(a,"th",!0))?b:null}function d(a){var b=RegExp(c.fillChar,
"g");if(0<a[q.ie?"innerText":"textContent"].replace(/^\s*$/,"").replace(b,"").length)return 0;for(var d in v.$isNotEmpty)if(a.getElementsByTagName(d).length)return 0;return 1}function b(a){return a.pageX||a.pageY?{x:a.pageX,y:a.pageY}:{x:a.clientX+y.document.body.scrollLeft-y.document.body.clientLeft,y:a.clientY+y.document.body.scrollTop-y.document.body.clientTop}}function g(a){if(!W())try{var d=e(a.target||a.srcElement),g;ea&&(y.body.style.webkitUserSelect="none",Math.abs($.x-a.clientX)>da||Math.abs($.y-
a.clientY)>da)&&(s(),ea=!1,Q=0,C(a));if(T&&R)if(Q=0,y.body.style.webkitUserSelect="none",y.selection.getNative()[q.ie9below?"empty":"removeAllRanges"](),g=b(a),m(y,!0,T,g,d),"h"==T){var k=S.style,h;var d=R,r=M(d);if(r){var t=r.getSameEndPosCells(d,"x")[0],p=r.getSameStartPosXCells(d)[0],w=b(a).x,x=(t?c.getXY(t).x:c.getXY(r.table).x)+20,u=p?c.getXY(p).x+p.offsetWidth-20:y.body.offsetWidth+5||parseInt(c.getComputedStyle(y.body,"width"),10),x=x+V,u=u-V;h=w<x?x:w>u?u:w}else h=void 0;k.left=h+"px"}else{if("v"==
T){var F=S.style,v;a:{try{var z=c.getXY(R).y,A=b(a).y;v=A<z?z:A;break a}catch(B){}v=void 0}F.top=v+"px"}}else if(d){if(!0!==y.fireEvent("excludetable",d)){g=b(a);var aa=n(d,g),fa=c.findParentByTagName(d,"table",!0);l(fa,d,a,!0)?!0!==y.fireEvent("excludetable",fa)&&(y.body.style.cursor="url("+y.options.cursorpath+"h.png),pointer"):l(fa,d,a)?!0!==y.fireEvent("excludetable",fa)&&(y.body.style.cursor="url("+y.options.cursorpath+"v.png),pointer"):(y.body.style.cursor="text",/\d/.test(aa)&&(aa=aa.replace(/\d/,
""),d=M(d).getPreviewCell(d,"v"==aa)),m(y,d?!!aa:!1,d?aa:"",g,d))}}else f(!1,fa,y)}catch(K){}}function f(a,b,c){a?k(b,c):ga||setTimeout(function(){!ga&&G&&G.parentNode&&G.parentNode.removeChild(G)},2E3)}function k(a,b){function d(c,e){clearTimeout(g);g=setTimeout(function(){b.fireEvent("tableClicked",a,e)},300)}var e=c.getXY(a),f=a.ownerDocument;if(G&&G.parentNode)return G;G=f.createElement("div");G.contentEditable=!1;G.innerHTML="";G.style.cssText="width:15px;height:15px;background-image:url("+b.options.UEDITOR_HOME_URL+
"dialogs/table/dragicon.png);position: absolute;cursor:move;top:"+(e.y-15)+"px;left:"+e.x+"px;";c.unSelectable(G);G.onmouseover=function(a){ga=!0};G.onmouseout=function(a){ga=!1};c.on(G,"click",function(a,b){d(b,this)});c.on(G,"dblclick",function(c,d){clearTimeout(g);var e=M(a),f=a.rows[0].cells[0],l=e.getLastCell(),l=e.getCellsRange(f,l);b.selection.getRange().setStart(f,0).setCursor(!1,!0);e.setSelected(l)});c.on(G,"dragstart",function(a,b){c.preventDefault(b)});var g;f.body.appendChild(G)}function l(a,
d,e,f){e=b(e);d=n(d,e);return f?(f=(f=a.getElementsByTagName("caption")[0])?f.offsetHeight:0,"v1"==d&&8>e.y-c.getXY(a).y-f):"h1"==d&&8>e.x-c.getXY(a).x}function m(a,b,c,d,e){try{a.body.style.cursor="h"==c?"col-resize":"v"==c?"row-resize":"text",q.ie&&(!c||ba||D.getUETableBySelected(a)?Z(a):(N(a,a.document),ma(c,e))),la=b}catch(f){}}function n(a,b){var d=c.getXY(a);return d?d.x+a.offsetWidth-b.x<ha?"h":b.x-d.x<ha?"h1":d.y+a.offsetHeight-b.y<ha?"v":b.y-d.y<ha?"v1":"":""}function r(a,b){if(!W())if($=
{x:b.clientX,y:b.clientY},2==b.button){var d=D.getUETableBySelected(y),e=!1;if(d){var f=X(y,b);p.each(d.selectedTds,function(a){a===f&&(e=!0)});e?(f=d.selectedTds[0],setTimeout(function(){y.selection.getRange().setStart(f,0).setCursor(!1,!0)},0)):(ia(c.getElementsByTagName(y.body,"th td")),d.clearSelected())}}else x(b)}function t(a){Q=0;a=a||y.window.event;var d=e(a.target||a.srcElement);if(d){var f;if(f=n(d,b(a)))if(Z(y),"h1"==f&&(f="h",l(c.findParentByTagName(d,"table"),d,a)?y.execCommand("adaptbywindow"):
(d=M(d).getPreviewCell(d))&&y.selection.getRange().selectNodeContents(d).setCursor(!0,!0)),"h"==f){a=M(d);var g=z(d,a.table,!0),g=u(g,"left");a.width=a.offsetWidth;var k=[],h=[];p.each(g,function(a){k.push(a.offsetWidth)});p.each(g,function(a){a.removeAttribute("width")});window.setTimeout(function(){var a=!0;p.each(g,function(b,c){var d=b.offsetWidth;if(d>k[c])return a=!1;h.push(d)});var b=a?h:k;p.each(g,function(a,c){a.width=b[c]-A()})},0)}}}function x(a){ia(c.getElementsByTagName(y.body,"td th"));
p.each(y.document.getElementsByTagName("table"),function(a){a.ueTable=null});if(J=X(y,a)){var b=c.findParentByTagName(J,"table",!0);(ut=M(b))&&ut.clearSelected();la?w(a):(y.document.body.style.webkitUserSelect="",ba=!0,y.addListener("mouseover",I))}}function w(a){q.ie&&(a=F(a));s();ea=!0;ja=setTimeout(function(){C(a)},na)}function u(a,b){for(var c=[],d=null,e=0,f=a.length;e<f;e++)(d=a[e][b])&&c.push(d);return c}function s(){ja&&clearTimeout(ja);ja=null}function F(a){var b="pageX pageY clientX clientY srcElement target".split(" "),
c={};if(a)for(var d=0,e,f;e=b[d];d++)(f=a[e])&&(c[e]=f);return c}function C(a){ea=!1;J&&(a=Math.abs($.x-a.clientX)>=Math.abs($.y-a.clientY)?"h":"v",/\d/.test(a)&&(a=a.replace(/\d/,""),J=M(J).getPreviewCell(J,"v"==a)),Z(y),N(y,y.document),y.fireEvent("saveScene"),ma(a,J),ba=!0,T=a,R=J)}function K(a,b){if(!W()){s();ea=!1;if(la&&(Q=++Q%3,$={x:b.clientX,y:b.clientY},setTimeout(function(){0<Q&&Q--},na),2===Q)){Q=0;t(b);return}if(2!=b.button){var d=this.selection.getRange(),e=c.findParentByTagName(d.startContainer,
"table",!0),f=c.findParentByTagName(d.endContainer,"table",!0);if(e||f)e===f?(e=c.findParentByTagName(d.startContainer,["td","th","caption"],!0),f=c.findParentByTagName(d.endContainer,["td","th","caption"],!0),e!==f&&this.selection.clearRange()):this.selection.clearRange();ba=!1;this.document.body.style.webkitUserSelect="";if(T&&R){this.selection.getNative()[q.ie9below?"empty":"removeAllRanges"]();Q=0;S=this.document.getElementById("ue_tableDragLine");d=c.getXY(R);e=c.getXY(S);switch(T){case "h":H(R,
e.x-d.x);break;case "v":ca(R,e.y-d.y-R.offsetHeight)}T="";R=null;Z(this);this.fireEvent("saveScene")}else{if(J)(e=(d=M(J))?d.selectedTds[0]:null)?(d=new L.Range(this.document),c.isEmptyBlock(e)?d.setStart(e,0).setCursor(!1,!0):d.selectNodeContents(e).shrinkBoundary().setCursor(!1,!0)):(d=this.selection.getRange().shrinkBoundary(),d.collapsed||(e=c.findParentByTagName(d.startContainer,["td","th"],!0),f=c.findParentByTagName(d.endContainer,["td","th"],!0),(e&&!f||!e&&f||e&&f&&e!==f)&&d.setCursor(!1,
!0))),J=null,this.removeListener("mouseover",I);else if((e=c.findParentByTagName(b.target||b.srcElement,"td",!0))||(e=c.findParentByTagName(b.target||b.srcElement,"th",!0)),e&&("TD"==e.tagName||"TH"==e.tagName)){if(!0===this.fireEvent("excludetable",e))return;d=new L.Range(this.document);d.setStart(e,0).setCursor(!1,!0)}this._selectionChange(250,b)}}}}function I(a,b){if(!W()){var d=b.target||b.srcElement;U=c.findParentByTagName(d,"td",!0)||c.findParentByTagName(d,"th",!0);if(J&&U&&("TD"==J.tagName&&
"TD"==U.tagName||"TH"==J.tagName&&"TH"==U.tagName)&&c.findParentByTagName(J,"table")==c.findParentByTagName(U,"table"))if(d=M(U),J!=U){this.document.body.style.webkitUserSelect="none";this.selection.getNative()[q.ie9below?"empty":"removeAllRanges"]();var e=d.getCellsRange(J,U);d.setSelected(e)}else this.document.body.style.webkitUserSelect="",d.clearSelected();b.preventDefault?b.preventDefault():b.returnValue=!1}}function H(a,b){var d=M(a);if(d){var d=d.table,c=z(a,d);d.style.width="";d.removeAttribute("width");
b=E(b,a,c);a.nextSibling?p.each(c,function(a){a.left.width=+a.left.width+b;a.right&&(a.right.width=+a.right.width-b)}):p.each(c,function(a){a.left.width-=-b})}}function W(){return"false"===y.body.contentEditable}function ca(a,b){if(!(10>Math.abs(b))){var d=M(a);if(d)for(var d=d.getSameEndPosCells(a,"y"),e=d[0]?d[0].offsetHeight:0,f=0,g;g=d[f++];){var l=b,k=e,h=parseInt(c.getComputedStyle(g,"line-height"),10),l=k+l,l=l<h?h:l;g.style.height&&(g.style.height="");1==g.rowSpan?g.setAttribute("height",
l):g.removeAttribute&&g.removeAttribute("height")}}}function z(a,b,d){b||(b=c.findParentByTagName(a,"table"));if(!b)return null;c.getNodeIndex(a);b=b.rows;for(var e=0;a;)1===a.nodeType&&(e+=a.colSpan||1),a=a.previousSibling;a=null;var f=[];p.each(b,function(a){var b=0;p.each(a.cells,function(a){b+=a.colSpan||1;if(b===e)return f.push({left:a,right:a.nextSibling||null}),!1;if(b>e)return d&&f.push({left:a}),!1})});return f}function E(a,b,d){a-=A();if(0>a)return 0;a-=B(b);var c=0>a?"left":"right";a=Math.abs(a);
p.each(d,function(b){(b=b[c])&&(a=Math.min(a,B(b)-V))});a=0>a?0:a;return"left"===c?-a:a}function B(a){var b=0,b=a.offsetWidth-A();if(!a.nextSibling){tab=c.findParentByTagName(a,"table",!1);if(void 0===tab.offsetVal){var d=a.previousSibling;tab.offsetVal=d?a.offsetWidth-d.offsetWidth===D.borderWidth?D.borderWidth:0:0}b-=tab.offsetVal}b=0>b?0:b;try{a.width=b}catch(e){}return b}function A(){if(void 0===D.tabcellSpace){var a=y.document.createElement("table"),b=y.document.createElement("tbody"),d=y.document.createElement("tr"),
c=y.document.createElement("td"),e=null;c.style.cssText="border: 0;";c.width=1;d.appendChild(c);d.appendChild(e=c.cloneNode(!1));b.appendChild(d);a.appendChild(b);a.style.cssText="visibility: hidden;";y.body.appendChild(a);D.paddingSpace=c.offsetWidth-1;b=a.offsetWidth;c.style.cssText="";e.style.cssText="";D.borderWidth=(a.offsetWidth-b)/3;D.tabcellSpace=D.paddingSpace+D.borderWidth;y.body.removeChild(a)}A=function(){return D.tabcellSpace};return D.tabcellSpace}function N(a,b){ba||(S=a.document.createElement("div"),
c.setAttributes(S,{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)"}),a.body.appendChild(S))}function Z(a){if(!ba)for(var b;b=a.document.getElementById("ue_tableDragLine");)c.remove(b)}function ma(a,b){if(b){var d=c.findParentByTagName(b,"table"),e=d.getElementsByTagName("caption"),
f=d.offsetWidth,g=d.offsetHeight-(0<e.length?e[0].offsetHeight:0),d=c.getXY(d),l=c.getXY(b);switch(a){case "h":e="height:"+g+"px;top:"+(d.y+(0<e.length?e[0].offsetHeight:0))+"px;left:"+(l.x+b.offsetWidth);S.style.cssText=e+"px;position: absolute;display:block;background-color:blue;width:1px;border:0; color:blue;opacity:.3;filter:alpha(opacity=30)";break;case "v":e="width:"+f+"px;left:"+d.x+"px;top:"+(l.y+b.offsetHeight),S.style.cssText=e+"px;overflow:hidden;position: absolute;display:block;background-color:blue;height:1px;border:0;color:blue;opacity:.2;filter:alpha(opacity=20)"}}}
function O(a,b){for(var d=c.getElementsByTagName(a.body,"table"),e,f=0,g;g=d[f++];)e=c.getElementsByTagName(g,"td"),e[0]&&(b?(e=e[0].style.borderColor.replace(/\s/g,""),/(#ffffff)|(rgb\(255,255,255\))/ig.test(e)&&c.addClass(g,"noBorderTable")):c.removeClasses(g,"noBorderTable"))}function Y(a,b,d){var e=a.body;return e.offsetWidth-(b?2*parseInt(c.getComputedStyle(e,"margin-left"),10):0)-2*d.tableBorder-(a.options.offsetWidth||0)}function X(a,d){var e=c.findParentByTagName(d.target||d.srcElement,["td",
"th"],!0),f=null;if(!e)return null;f=n(e,b(d));if(!e)return null;if("h1"===f&&e.previousSibling){var f=c.getXY(e),g=e.offsetWidth;Math.abs(f.x+g-d.clientX)>g/3&&(e=e.previousSibling)}else"v1"===f&&e.parentNode.previousSibling&&(f=c.getXY(e),g=e.offsetHeight,Math.abs(f.y+g-d.clientY)>g/3&&(e=e.parentNode.previousSibling.firstChild));return e&&!0!==a.fireEvent("excludetable",e)?e:null}var y=this,ja=null,V=5,ea=!1,ha=5,da=10,Q=0,$=null,na=360,D=UE.UETable,M=function(a){return D.getUETable(a)},ia=function(a){return D.removeSelectedClass(a)};
y.ready(function(){var a=this,b=a.selection.getText;a.selection.getText=function(){var d=D.getUETableBySelected(a);if(d){var c="";p.each(d.selectedTds,function(a){c+=a[q.ie?"innerText":"textContent"]});return c}return b.call(a.selection)}});var J=null,U=null,T="",la=!1,G=null,ga=!1,S=null,R=null,ba=!1;y.setOpt({maxColNum:20,maxRowNum:100,defaultCols:5,defaultRows:5,tdvalign:"top",cursorpath:y.options.UEDITOR_HOME_URL+"themes/default/images/cursor_",tableDragable:!1,classList:["ue-table-interlace-color-single",
"ue-table-interlace-color-double"]});y.getUETable=M;var ka={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};y.ready(function(){p.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;}",
y.document);var a,b,k;y.addListener("keydown",function(e,f){var g=f.keyCode||f.which;if(8==g){var l=D.getUETableBySelected(this);l&&l.selectedTds.length&&(l.isFullCol()?this.execCommand("deletecol"):l.isFullRow()?this.execCommand("deleterow"):this.fireEvent("delcells"),c.preventDefault(f));var h=c.findParentByTagName(this.selection.getStart(),"caption",!0),n=this.selection.getRange();n.collapsed&&(h&&d(h))&&(this.fireEvent("saveScene"),l=h.parentNode,c.remove(h),l&&n.setStart(l.rows[0].cells[0],0).setCursor(!1,
!0),this.fireEvent("saveScene"))}if(46==g&&(l=D.getUETableBySelected(this))){this.fireEvent("saveScene");for(h=0;n=l.selectedTds[h++];)c.fillNode(this.document,n);this.fireEvent("saveScene");c.preventDefault(f)}if(13==g){g=this.selection.getRange();if(h=c.findParentByTagName(g.startContainer,"caption",!0)){l=c.findParentByTagName(h,"table");g.collapsed?h&&g.setStart(l.rows[0].cells[0],0).setCursor(!1,!0):(g.deleteContents(),this.fireEvent("saveScene"));c.preventDefault(f);return}g.collapsed&&(l=c.findParentByTagName(g.startContainer,
"table"))&&(n=l.rows[0].cells[0],h=c.findParentByTagName(this.selection.getStart(),["td","th"],!0),l=l.previousSibling,n===h&&(!l||1==l.nodeType&&"TABLE"==l.tagName)&&c.isStartInblock(g)&&(g=c.findParent(this.selection.getStart(),function(a){return c.isBlockElm(a)},!0))&&(/t(h|d)/i.test(g.tagName)||g===h.firstChild)&&(this.execCommand("insertparagraphbeforetable"),c.preventDefault(f)))}if((f.ctrlKey||f.metaKey)&&"67"==f.keyCode&&(a=null,l=D.getUETableBySelected(this)))for(g=l.selectedTds,b=l.isFullCol(),
k=l.isFullRow(),a=[[l.cloneCell(g[0],null,!0)]],h=1;n=g[h];h++)n.parentNode!==g[h-1].parentNode?a.push([l.cloneCell(n,null,!0)]):a[a.length-1].push(l.cloneCell(n,null,!0))});y.addListener("tablehasdeleted",function(){m(this,!1,"",null);G&&c.remove(G)});y.addListener("beforepaste",function(e,f){var g=this,l=g.selection.getRange();if(c.findParentByTagName(l.startContainer,"caption",!0))l=g.document.createElement("div"),l.innerHTML=f.html,f.html=l[q.ie9below?"innerText":"textContent"];else{var n=D.getUETableBySelected(g);
if(a){g.fireEvent("saveScene");var l=g.selection.getRange(),m=c.findParentByTagName(l.startContainer,["td","th"],!0),r,t;if(m){n=M(m);if(k){var w=n.getCellInfo(m).rowIndex;"TH"==m.tagName&&w++;for(var l=0,x;x=a[l++];){t=n.insertRow(w++,"td");for(var u=0,s;s=x[u];u++)(m=t.cells[u])||(m=t.insertCell(u)),m.innerHTML=s.innerHTML,s.getAttribute("width")&&m.setAttribute("width",s.getAttribute("width")),s.getAttribute("vAlign")&&m.setAttribute("vAlign",s.getAttribute("vAlign")),s.getAttribute("align")&&
m.setAttribute("align",s.getAttribute("align")),s.style.cssText&&(m.style.cssText=s.style.cssText);for(u=0;(s=t.cells[u])&&x[u];u++)s.innerHTML=x[u].innerHTML,x[u].getAttribute("width")&&s.setAttribute("width",x[u].getAttribute("width")),x[u].getAttribute("vAlign")&&s.setAttribute("vAlign",x[u].getAttribute("vAlign")),x[u].getAttribute("align")&&s.setAttribute("align",x[u].getAttribute("align")),x[u].style.cssText&&(s.style.cssText=x[u].style.cssText)}}else{if(b){w=n.getCellInfo(m);u=m=0;for(x=a[0];s=
x[u++];)m+=s.colSpan||1;g.__hasEnterExecCommand=!0;for(l=0;l<m;l++)g.execCommand("insertcol");g.__hasEnterExecCommand=!1;m=n.table.rows[0].cells[w.cellIndex];"TH"==m.tagName&&(m=n.table.rows[1].cells[w.cellIndex])}for(l=0;x=a[l++];){r=m;for(u=0;s=x[u++];)m?(m.innerHTML=s.innerHTML,s.getAttribute("width")&&m.setAttribute("width",s.getAttribute("width")),s.getAttribute("vAlign")&&m.setAttribute("vAlign",s.getAttribute("vAlign")),s.getAttribute("align")&&m.setAttribute("align",s.getAttribute("align")),
s.style.cssText&&(m.style.cssText=s.style.cssText),t=m,m=m.nextSibling):(w=s.cloneNode(!0),c.removeAttributes(w,["class","rowSpan","colSpan"]),t.parentNode.appendChild(w));m=n.getNextCell(r,!0,!0);if(!a[l])break;m||(w=n.getCellInfo(r),n.table.insertRow(n.table.rows.length),n.update(),m=n.getVSideCell(r,!0))}}n.update()}else{n=g.document.createElement("table");for(l=0;x=a[l++];){t=n.insertRow(n.rows.length);for(u=0;s=x[u++];)w=D.cloneCell(s,null,!0),c.removeAttributes(w,["class"]),t.appendChild(w);
2==u&&1<w.rowSpan&&(w.rowSpan=1)}l=D.getDefaultValue(g,void 0);l=g.body.offsetWidth-2*parseInt(c.getComputedStyle(g.body,"margin-left"),10)-2*l.tableBorder-(g.options.offsetWidth||0);g.execCommand("insertHTML","<table "+(b&&k?'width="'+l+'"':"")+">"+n.innerHTML.replace(/>\s*</g,"><").replace(/\bth\b/gi,"td")+"</table>")}g.fireEvent("contentchange");g.fireEvent("saveScene");f.html="";return!0}l=g.document.createElement("div");l.innerHTML=f.html;x=l.getElementsByTagName("table");c.findParentByTagName(g.selection.getStart(),
"table")?(p.each(x,function(a){c.remove(a)}),c.findParentByTagName(g.selection.getStart(),"caption",!0)&&(l.innerHTML=l[q.ie?"innerText":"textContent"])):p.each(x,function(a){h(a,!0);c.removeAttributes(a,["style","border"]);p.each(c.getElementsByTagName(a,"td"),function(a){d(a)&&c.fillNode(g.document,a);h(a,!0)})});f.html=l.innerHTML}});y.addListener("afterpaste",function(){p.each(c.getElementsByTagName(y.body,"table"),function(a){if(a.offsetWidth>y.body.offsetWidth){var b=D.getDefaultValue(y,a);
a.style.width=y.body.offsetWidth-2*parseInt(c.getComputedStyle(y.body,"margin-left"),10)-2*b.tableBorder-(y.options.offsetWidth||0)+"px"}})});y.addListener("blur",function(){a=null});var n;y.addListener("keydown",function(){clearTimeout(n);n=setTimeout(function(){var a=y.selection.getRange();if(a=c.findParentByTagName(a.startContainer,["th","td"],!0)){var b=a.parentNode.parentNode.parentNode;b.offsetWidth>b.getAttribute("width")&&(a.style.wordBreak="break-all")}},100)});y.addListener("selectionchange",
function(){m(y,!1,"",null)});y.addListener("contentchange",function(){var a=this;Z(a);if(!D.getUETableBySelected(a)){var b=a.selection.getRange().startContainer,b=c.findParentByTagName(b,["td","th"],!0);p.each(c.getElementsByTagName(a.document,"table"),function(b){!0!==a.fireEvent("excludetable",b)&&(b.ueTable=new D(b),b.onmouseover=function(){a.fireEvent("tablemouseover",b)},b.onmousemove=function(){a.fireEvent("tablemousemove",b);a.options.tableDragable&&f(!0,this,a);p.defer(function(){a.fireEvent("contentchange",
50)},!0)},b.onmouseout=function(){a.fireEvent("tablemouseout",b);m(a,!1,"",null);Z(a)},b.onclick=function(b){b=a.window.event||b;var d=e(b.target||b.srcElement);if(d){var c=M(d),f=c.table,g=c.getCellInfo(d),k=a.selection.getRange();l(f,d,b,!0)?(f=c.getCell(c.indexTable[c.rowsNum-1][g.colIndex].rowIndex,c.indexTable[c.rowsNum-1][g.colIndex].cellIndex),b.shiftKey&&c.selectedTds.length?c.selectedTds[0]!==f?(b=c.getCellsRange(c.selectedTds[0],f),c.setSelected(b)):k&&k.selectNodeContents(f).select():d!==
f?(b=c.getCellsRange(d,f),c.setSelected(b)):k&&k.selectNodeContents(f).select()):l(f,d,b)&&(f=c.getCell(c.indexTable[g.rowIndex][c.colsNum-1].rowIndex,c.indexTable[g.rowIndex][c.colsNum-1].cellIndex),b.shiftKey&&c.selectedTds.length?c.selectedTds[0]!==f?(b=c.getCellsRange(c.selectedTds[0],f),c.setSelected(b)):k&&k.selectNodeContents(f).select():d!==f?(b=c.getCellsRange(d,f),c.setSelected(b)):k&&k.selectNodeContents(f).select())}})});O(a,!0)}});c.on(y.document,"mousemove",g);c.on(y.document,"mouseout",
function(a){"TABLE"==(a.target||a.srcElement).tagName&&m(y,!1,"",null)});y.addListener("interlacetable",function(a,b,d){if(b){a=b.rows;b=a.length;for(var c=0;c<b;c++)a[c].className=(d||this.options.classList)[c]?(d||this.options.classList)[c]:(d||this.options.classList)[c%(d||this.options.classList).length]}});y.addListener("uninterlacetable",function(a,b){if(b)for(var d=b.rows,e=this.options.classList,f=d.length,g=0;g<f;g++)c.removeClasses(d[g],e)});y.addListener("mousedown",r);y.addListener("mouseup",
K);c.on(y.body,"dragstart",function(a){K.call(y,"dragstart",a)});var t=0;y.addListener("mousedown",function(){t=0});y.addListener("tabkeydown",function(){var a=this.selection.getRange(),b=a.getCommonAncestor(!0,!0),e=c.findParentByTagName(b,"table");if(e){if(c.findParentByTagName(b,"caption",!0))(b=c.getElementsByTagName(e,"th td"))&&b.length&&a.setStart(b[0],0).setCursor(!1,!0);else{var b=c.findParentByTagName(b,["td","th"],!0),f=M(b);t=1<b.rowSpan?t:f.getCellInfo(b).rowIndex;(b=f.getTabNextCell(b,
t))?d(b)?a.setStart(b,0).setCursor(!1,!0):a.selectNodeContents(b).select():(y.fireEvent("saveScene"),y.__hasEnterExecCommand=!0,this.execCommand("insertrownext"),y.__hasEnterExecCommand=!1,a=this.selection.getRange(),a.setStart(e.rows[e.rows.length-1].cells[0],0).setCursor(),y.fireEvent("saveScene"))}return!0}});q.ie&&y.addListener("selectionchange",function(){m(this,!1,"",null)});y.addListener("keydown",function(a,b){var d=b.keyCode||b.which;if(8!=d&&46!=d){(d=!b.ctrlKey&&!b.metaKey&&!b.shiftKey&&
!b.altKey)&&ia(c.getElementsByTagName(this.body,"td"));var e=D.getUETableBySelected(this);e&&d&&e.clearSelected()}});y.addListener("beforegetcontent",function(){O(this,!1);q.ie&&p.each(this.document.getElementsByTagName("caption"),function(a){c.isEmptyNode(a)&&(a.innerHTML="&nbsp;")})});y.addListener("aftergetcontent",function(){O(this,!0)});y.addListener("getAllHtml",function(){ia(y.document.getElementsByTagName("td"))});y.addListener("fullscreenchanged",function(a,b){if(!b){var d=this.body.offsetWidth/
document.body.offsetWidth,e=c.getElementsByTagName(this.body,"table");p.each(e,function(a){if(a.offsetWidth<y.body.offsetWidth)return!1;var b=c.getElementsByTagName(a,"td"),e=[];p.each(b,function(a){e.push(a.offsetWidth)});for(var f=0,g;g=b[f];f++)g.setAttribute("width",Math.floor(e[f]*d));a.setAttribute("width",Math.floor(Y(y,!0,D.getDefaultValue(y,void 0))))})}});var w=y.execCommand;y.execCommand=function(a,b){a=a.toLowerCase();var e=D.getUETableBySelected(this),f=new L.Range(this.document),g=this.commands[a]||
UE.commands[a],l;if(g){if(!e||ka[a]||g.notNeedUndo||this.__hasEnterExecCommand)l=w.apply(this,arguments);else{this.__hasEnterExecCommand=!0;this.fireEvent("beforeexeccommand",a);for(var e=e.selectedTds,k=g=-2,h,n,m=0,r;r=e[m];m++)if(d(r)?f.setStart(r,0).setCursor(!1,!0):f.selectNode(r).select(!0),n=this.queryCommandState(a),h=this.queryCommandValue(a),-1!=n){if(g!==n||k!==h)this._ignoreContentChange=!0,l=w.apply(this,arguments),this._ignoreContentChange=!1;g=this.queryCommandState(a);k=this.queryCommandValue(a);
c.isEmptyBlock(r)&&c.fillNode(this.document,r)}f.setStart(e[0],0).shrinkBoundary(!0).setCursor(!1,!0);this.fireEvent("contentchange");this.fireEvent("afterexeccommand",a);this.__hasEnterExecCommand=!1;this._selectionChange()}return l}}})};UE.UETable.prototype.sortTable=function(c,a){var e=this.table,d=e.rows,b=[],g="TH"===d[0].cells[0].tagName,f=0;if(this.selectedTds.length){for(var k=this.cellsRange,l=k.endRowIndex+1,m=k.beginRowIndex;m<l;m++)b[m]=d[m];b.splice(0,k.beginRowIndex);f=k.endRowIndex+
1===this.rowsNum?0:k.endRowIndex+1}else for(m=0,l=d.length;m<l;m++)b[m]=d[m];var n={reversecurrent:function(a,b){return 1},orderbyasc:function(a,b){return(a.innerText||a.textContent).localeCompare(b.innerText||b.textContent)},reversebyasc:function(a,b){return b.innerHTML.localeCompare(a.innerHTML)},orderbynum:function(a,b){var d=a[q.ie?"innerText":"textContent"].match(/\d+/),c=b[q.ie?"innerText":"textContent"].match(/\d+/);d&&(d=+d[0]);c&&(c=+c[0]);return(d||0)-(c||0)},reversebynum:function(a,b){var d=
a[q.ie?"innerText":"textContent"].match(/\d+/),c=b[q.ie?"innerText":"textContent"].match(/\d+/);d&&(d=+d[0]);c&&(c=+c[0]);return(c||0)-(d||0)}};e.setAttribute("data-sort-type",a&&"string"===typeof a&&n[a]?a:"");g&&b.splice(0,1);b=p.sort(b,function(b,d){return a&&"function"===typeof a?a.call(this,b.cells[c],d.cells[c]):a&&"number"===typeof a?1:a&&"string"===typeof a&&n[a]?n[a].call(this,b.cells[c],d.cells[c]):n.orderbyasc.call(this,b.cells[c],d.cells[c])});g=e.ownerDocument.createDocumentFragment();
m=0;for(l=b.length;m<l;m++)g.appendChild(b[m]);e=e.getElementsByTagName("tbody")[0];f?e.insertBefore(g,d[f-k.endRowIndex+k.beginRowIndex-1]):e.appendChild(g)};UE.plugins.tablesort=function(){var h=this,a=UE.UETable;h.ready(function(){p.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("+h.options.themePath+h.options.theme+"/images/sortable.png);}",h.document);
h.addListener("afterexeccommand",function(a,d){"mergeright"!=d&&"mergedown"!=d&&"mergecells"!=d||this.execCommand("disablesort")})});UE.commands.sorttable={queryCommandState:function(){var c=a.getTableItemsByRange(this);if(!c.cell)return-1;for(var c=c.table.getElementsByTagName("td"),d=0,b;b=c[d++];)if(1!=b.rowSpan||1!=b.colSpan)return-1;return 0},execCommand:function(c,d){var b=this.selection.getRange(),g=b.createBookmark(!0),f=a.getTableItemsByRange(this),k=f.cell,f=a.getUETable(f.table),k=f.getCellInfo(k);
f.sortTable(k.cellIndex,d);b.moveToBookmark(g);try{b.select()}catch(l){}}};UE.commands.enablesort=UE.commands.disablesort={queryCommandState:function(e){var d=a.getTableItemsByRange(this).table;if(d&&"enablesort"==e)for(var b=c.getElementsByTagName(d,"th td"),g=0;g<b.length;g++)if(1<b[g].getAttribute("colspan")||1<b[g].getAttribute("rowspan"))return-1;return d?"enablesort"==e^"sortEnabled"!=d.getAttribute("data-sort")?-1:0:-1},execCommand:function(e){var d=a.getTableItemsByRange(this).table;d.setAttribute("data-sort",
"enablesort"==e?"sortEnabled":"sortDisabled");"enablesort"==e?c.addClass(d,"sortEnabled"):c.removeClasses(d,"sortEnabled")}}};UE.plugins.contextmenu=function(){var h=this,a=h.getLang("contextMenu"),e,d=h.options.contextMenu||[{label:a.selectall,cmdName:"selectall"},{label:a.cleardoc,cmdName:"cleardoc",exec:function(){confirm(a.confirmclear)&&this.execCommand("cleardoc")}},"-",{label:a.unlink,cmdName:"unlink"},"-",{group:a.paragraph,icon:"justifyjustify",subMenu:[{label:a.justifyleft,cmdName:"justify",
value:"left"},{label:a.justifyright,cmdName:"justify",value:"right"},{label:a.justifycenter,cmdName:"justify",value:"center"},{label:a.justifyjustify,cmdName:"justify",value:"justify"}]},"-",{group:a.table,icon:"table",subMenu:[{label:a.inserttable,cmdName:"inserttable"},{label:a.deletetable,cmdName:"deletetable"},"-",{label:a.deleterow,cmdName:"deleterow"},{label:a.deletecol,cmdName:"deletecol"},{label:a.insertcol,cmdName:"insertcol"},{label:a.insertcolnext,cmdName:"insertcolnext"},{label:a.insertrow,
cmdName:"insertrow"},{label:a.insertrownext,cmdName:"insertrownext"},"-",{label:a.insertcaption,cmdName:"insertcaption"},{label:a.deletecaption,cmdName:"deletecaption"},{label:a.inserttitle,cmdName:"inserttitle"},{label:a.deletetitle,cmdName:"deletetitle"},{label:a.inserttitlecol,cmdName:"inserttitlecol"},{label:a.deletetitlecol,cmdName:"deletetitlecol"},"-",{label:a.mergecells,cmdName:"mergecells"},{label:a.mergeright,cmdName:"mergeright"},{label:a.mergedown,cmdName:"mergedown"},"-",{label:a.splittorows,
cmdName:"splittorows"},{label:a.splittocols,cmdName:"splittocols"},{label:a.splittocells,cmdName:"splittocells"},"-",{label:a.averageDiseRow,cmdName:"averagedistributerow"},{label:a.averageDisCol,cmdName:"averagedistributecol"},"-",{label:a.edittd,cmdName:"edittd",exec:function(){UE.ui.edittd&&new UE.ui.edittd(this);this.getDialog("edittd").open()}},{label:a.edittable,cmdName:"edittable",exec:function(){UE.ui.edittable&&new UE.ui.edittable(this);this.getDialog("edittable").open()}},{label:a.setbordervisible,
cmdName:"setbordervisible"}]},{group:a.tablesort,icon:"tablesort",subMenu:[{label:a.enablesort,cmdName:"enablesort"},{label:a.disablesort,cmdName:"disablesort"},"-",{label:a.reversecurrent,cmdName:"sorttable",value:"reversecurrent"},{label:a.orderbyasc,cmdName:"sorttable",value:"orderbyasc"},{label:a.reversebyasc,cmdName:"sorttable",value:"reversebyasc"},{label:a.orderbynum,cmdName:"sorttable",value:"orderbynum"},{label:a.reversebynum,cmdName:"sorttable",value:"reversebynum"}]},{group:a.borderbk,
icon:"borderBack",subMenu:[{label:a.setcolor,cmdName:"interlacetable",exec:function(){this.execCommand("interlacetable")}},{label:a.unsetcolor,cmdName:"uninterlacetable",exec:function(){this.execCommand("uninterlacetable")}},{label:a.setbackground,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#bbb","#ccc"]})}},{label:a.unsetbackground,cmdName:"cleartablebackground",exec:function(){this.execCommand("cleartablebackground")}},{label:a.redandblue,
cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["red","blue"]})}},{label:a.threecolorgradient,cmdName:"settablebackground",exec:function(){this.execCommand("settablebackground",{repeat:!0,colorList:["#aaa","#bbb","#ccc"]})}}]},{group:a.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:a.aligntable,icon:"aligntable",subMenu:[{cmdName:"tablealignment",className:"left",label:a.tableleft,value:"left"},
{cmdName:"tablealignment",className:"center",label:a.tablecenter,value:"center"},{cmdName:"tablealignment",className:"right",label:a.tableright,value:"right"}]},"-",{label:a.insertparagraphbefore,cmdName:"insertparagraph",value:!0},{label:a.insertparagraphafter,cmdName:"insertparagraph"},{label:a.copy,cmdName:"copy",exec:function(){alert(a.copymsg)},query:function(){return 0}},{label:a.paste,cmdName:"paste",exec:function(){alert(a.pastemsg)},query:function(){return 0}},{label:a.highlightcode,cmdName:"highlightcode",
exec:function(){UE.ui.highlightcode&&new UE.ui.highlightcode(this);this.ui._dialogs.highlightcodeDialog.open()}}];if(d.length){var b=UE.ui.uiUtils;h.addListener("contextmenu",function(g,f){var k=b.getViewportOffsetByEvent(f);h.fireEvent("beforeselectionchange");e&&e.destroy();for(var l=0,m,n=[];m=d[l];l++){var r;(function(b){if("-"==b)(r=n[n.length-1])&&"-"!==r&&n.push("-");else if(b.hasOwnProperty("group")){for(var d=0,c,e=[];c=b.subMenu[d];d++)(function(a){"-"==a?(r=e[e.length-1])&&"-"!==r?e.push("-"):
e.splice(e.length-1):(h.commands[a.cmdName]||UE.commands[a.cmdName]||a.query)&&-1<(a.query?a.query():h.queryCommandState(a.cmdName))&&e.push({label:a.label||h.getLang("contextMenu."+a.cmdName+(a.value||""))||"",className:"edui-for-"+a.cmdName+(a.className?" edui-for-"+a.cmdName+"-"+a.className:""),onclick:a.exec?function(){a.exec.call(h)}:function(){h.execCommand(a.cmdName,a.value)}})})(c);e.length&&n.push({label:function(){switch(b.icon){case "table":return h.getLang("contextMenu.table");case "justifyjustify":return h.getLang("contextMenu.paragraph");
case "aligntd":return h.getLang("contextMenu.aligntd");case "aligntable":return h.getLang("contextMenu.aligntable");case "tablesort":return a.tablesort;case "borderBack":return a.borderbk;default:return""}}(),className:"edui-for-"+b.icon,subMenu:{items:e,editor:h}})}else(h.commands[b.cmdName]||UE.commands[b.cmdName]||b.query)&&-1<(b.query?b.query.call(h):h.queryCommandState(b.cmdName))&&("highlightcode"!=b.cmdName||!(1==h.queryCommandState(b.cmdName)&&"deletehighlightcode"!=b.icon||1!=h.queryCommandState(b.cmdName)&&
"deletehighlightcode"==b.icon))&&n.push({label:b.label||h.getLang("contextMenu."+b.cmdName),className:"edui-for-"+(b.icon?b.icon:b.cmdName+(b.value||"")),onclick:b.exec?function(){b.exec.call(h)}:function(){h.execCommand(b.cmdName,b.value)}})})(m)}"-"==n[n.length-1]&&n.pop();e=new UE.ui.Menu({items:n,className:"edui-contextmenu",editor:h});e.render();e.showAt(k);h.fireEvent("aftershowcontextmenu",e);c.preventDefault(f);if(q.ie){var t;try{t=h.selection.getNative().createRange()}catch(p){return}t.item&&
(new L.Range(h.document)).selectNode(t.item(0)).select(!0,!0)}})}};UE.plugins.shortcutmenu=function(){var h,a=this.options.shortcutMenu||[];a.length&&(this.addListener("contextmenu mouseup",function(e,d){var b=this,g={type:e,target:d.target||d.srcElement,screenX:d.screenX,screenY:d.screenY,clientX:d.clientX,clientY:d.clientY};setTimeout(function(){if(!1===b.selection.getRange().collapsed||"contextmenu"==e)h||(h=new s.editor.ui.ShortCutMenu({editor:b,items:a,theme:b.options.theme,className:"edui-shortcutmenu"}),
h.render(),b.fireEvent("afterrendershortcutmenu",h)),h.show(g,!!UE.plugins.contextmenu)});if("contextmenu"==e&&(c.preventDefault(d),q.ie9below)){var f;try{f=b.selection.getNative().createRange()}catch(k){return}f.item&&(new L.Range(b.document)).selectNode(f.item(0)).select(!0,!0)}}),this.addListener("keydown",function(a){"keydown"==a&&h&&!h.isHidden&&h.hide()}))};UE.plugins.basestyle=function(){var h={bold:["strong","b"],italic:["em","i"],subscript:["sub"],superscript:["sup"]},a=this;a.addshortcutkey({Bold:"ctrl+66",
Italic:"ctrl+73",Underline:"ctrl+85"});a.addInputRule(function(a){p.each(a.getNodesByTagName("b i"),function(a){switch(a.tagName){case "b":a.tagName="strong";break;case "i":a.tagName="em"}})});for(var e in h)(function(d,b){a.commands[d]={execCommand:function(d){var e=a.selection.getRange(),k=c.filterNodeList(this.selection.getStartElementPath(),b);if(e.collapsed){if(k)d=a.document.createTextNode(""),e.insertNode(d).removeInlineStyle(b),e.setStartBefore(d),c.remove(d);else{k=e.document.createElement(b[0]);
if("superscript"==d||"subscript"==d)d=a.document.createTextNode(""),e.insertNode(d).removeInlineStyle(["sub","sup"]).setStartBefore(d).collapse(!0);e.insertNode(k).setStart(k,0)}e.collapse(!0)}else{if("superscript"==d||"subscript"==d)k&&k.tagName.toLowerCase()==d||e.removeInlineStyle(["sub","sup"]);k?e.removeInlineStyle(b):e.applyInlineStyle(b[0])}e.select()},queryCommandState:function(){return c.filterNodeList(this.selection.getStartElementPath(),b)?1:0}}})(e,h[e])};UE.plugins.elementpath=function(){var c,
a,e=this;e.setOpt("elementPathEnabled",!0);e.options.elementPathEnabled&&(e.commands.elementpath={execCommand:function(d,b){var g=a[b],f=e.selection.getRange();c=1*b;f.selectNode(g).select()},queryCommandValue:function(){var d=[].concat(this.selection.getStartElementPath()).reverse(),b=[];a=d;for(var e=0,f;f=d[e];e++)if(3!=f.nodeType){var k=f.tagName.toLowerCase();"img"==k&&f.getAttribute("anchorname")&&(k="anchor");b[e]=k;if(c==e){c=-1;break}}return b}})};UE.plugins.formatmatch=function(){function h(g,
f){if(q.webkit)var k="IMG"==f.target.tagName?f.target:null;a.undoManger&&a.undoManger.save();var l=a.selection.getRange(),k=k||l.getClosedNode();if(d&&k&&"IMG"==k.tagName)k.style.cssText+=";float:"+(d.style.cssFloat||d.style.styleFloat||"none")+";display:"+(d.style.display||"inline"),d=null;else if(!d){if(l.collapsed){var m=a.document.createTextNode("match");l.insertNode(m).select()}a.__hasEnterExecCommand=!0;l=a.options.removeFormatAttributes;a.options.removeFormatAttributes="";a.execCommand("removeformat");
a.options.removeFormatAttributes=l;a.__hasEnterExecCommand=!1;l=a.selection.getRange();e.length&&(k=l,m&&k.selectNode(m),k.applyInlineStyle(e[e.length-1].tagName,null,e));m&&l.setStartBefore(m).collapse(!0);l.select();m&&c.remove(m)}a.undoManger&&a.undoManger.save();a.removeListener("mouseup",h);b=0}var a=this,e=[],d,b=0;a.addListener("reset",function(){e=[];b=0});a.commands.formatmatch={execCommand:function(g){if(b)b=0,e=[],a.removeListener("mouseup",h);else{g=a.selection.getRange();d=g.getClosedNode();
if(!d||"IMG"!=d.tagName){g.collapse(!0).shrinkBoundary();e=c.findParents(g.startContainer,!0,function(a){return!c.isBlockElm(a)&&1==a.nodeType});g=0;for(var f;f=e[g];g++)if("A"==f.tagName){e.splice(g,1);break}}a.addListener("mouseup",h);b=1}},queryCommandState:function(){return b},notNeedUndo:1}};UE.plugin.register("searchreplace",function(){function h(a,d,e){var k=0;a=a.firstChild;for(var l=0;a;){if(3==a.nodeType){if(l=a.nodeValue.replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,k+=l,k>=d)return{node:a,
index:l-(k-d)}}else if(!v.$empty[a.tagName]&&(l=a[q.ie?"innerText":"textContent"].replace(/(^[\t\r\n]+)|([\t\r\n]+$)/,"").length,k+=l,k>=d&&(l=h(a,l-(k-d),e))))return l;a=c.getNextDomNode(a)}}function a(a,d){var f=a.selection.getRange(),k,l=d.searchStr,m=a.document.createElement("span");m.innerHTML="$$ueditor_searchreplace_key$$";if(!f.collapsed){f.select();var n=a.selection.getText();if(RegExp("^"+d.searchStr+"$",d.casesensitive?"":"i").test(n)){if(void 0!=d.replaceStr)return e(f,d.replaceStr),f.select(),
!0;f.collapse(-1==d.dir)}}f.insertNode(m);f.enlargeToBlockElm(!0);k=f.startContainer;n=k[q.ie?"innerText":"textContent"].indexOf("$$ueditor_searchreplace_key$$");f.setStartBefore(m);c.remove(m);a:{var m=k,r;k=d.all||1==d.dir?"getNextDomNode":"getPreDomNode";c.isBody(m)&&(m=m.firstChild);for(;m;){r=3==m.nodeType?m.nodeValue:m[q.ie?"innerText":"textContent"];b:{var t=d,p=n,w=t.searchStr;-1==t.dir&&(r=r.split("").reverse().join(""),w=w.split("").reverse().join(""),p=r.length-p);for(var w=RegExp(w,"g"+
(t.casesensitive?"":"i")),u=void 0;u=w.exec(r);)if(u.index>=p){r=-1==t.dir?r.length-u.index-t.searchStr.length:u.index;break b}r=-1}if(-1!=r){n={node:m,index:r};break a}(m=c[k](m))&&(n=-1==d.dir?(3==m.nodeType?m.nodeValue:m[q.ie?"innerText":"textContent"]).length:0)}n=void 0}if(n)return m=h(n.node,n.index,l),l=h(n.node,n.index+l.length,l),f.setStart(m.node,m.index).setEnd(l.node,l.index),void 0!==d.replaceStr&&e(f,d.replaceStr),f.select(),!0;f.setCursor()}function e(a,c){d.fireEvent("saveScene");
c=d.document.createTextNode(c);a.deleteContents().insertNode(c);d.fireEvent("saveScene")}var d=this;return{commands:{searchreplace:{execCommand:function(b,c){p.extend(c,{all:!1,casesensitive:!1,dir:1},!0);var e=0;if(c.all){var k=d.selection.getRange(),l=d.body.firstChild;l&&1==l.nodeType?k.setStart(l,0):3==l.nodeType&&k.setStartBefore(l);for(k.collapse(!0).select(!0);a(this,c);)e++}else a(this,c)&&e++;return e},notNeedUndo:1}}}});UE.plugins.customstyle=function(){var h=this;h.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;"}]});
h.commands.customstyle={execCommand:function(a,e){var d=e.tag,b=c.findParent(this.selection.getStart(),function(a){return a.getAttribute("label")},!0),g,f,k={};for(g in e)void 0!==e[g]&&(k[g]=e[g]);delete k.tag;if(b&&b.getAttribute("label")==e.label){g=this.selection.getRange();f=g.createBookmark();if(g.collapsed)if(v.$block[b.tagName]){var l=this.document.createElement("p");c.moveChild(b,l);b.parentNode.insertBefore(l,b);c.remove(b)}else c.remove(b,!0);else{b=c.getCommonAncestor(f.start,f.end);k=
c.getElementsByTagName(b,d);RegExp(d,"i").test(b.tagName)&&k.push(b);for(var h=0,n;n=k[h++];)if(n.getAttribute("label")==e.label){var l=c.getPosition(n,f.start),r=c.getPosition(n,f.end);(l&c.POSITION_FOLLOWING||l&c.POSITION_CONTAINS)&&(r&c.POSITION_PRECEDING||r&c.POSITION_CONTAINS)&&v.$block[d]&&(l=this.document.createElement("p"),c.moveChild(n,l),n.parentNode.insertBefore(l,n));c.remove(n,!0)}(b=c.findParent(b,function(a){return a.getAttribute("label")==e.label},!0))&&c.remove(b,!0)}g.moveToBookmark(f).select()}else v.$block[d]?
(this.execCommand("paragraph",d,k,"customstyle"),g=this.selection.getRange(),g.collapsed||(g.collapse(),b=c.findParent(this.selection.getStart(),function(a){return a.getAttribute("label")==e.label},!0),d=this.document.createElement("p"),c.insertAfter(b,d),c.fillNode(this.document,d),g.setStart(d,0).setCursor())):(g=this.selection.getRange(),g.collapsed?(b=this.document.createElement(d),c.setAttributes(b,k),g.insertNode(b).setStart(b,0).setCursor()):(f=g.createBookmark(),g.applyInlineStyle(d,k).moveToBookmark(f).select()))},
queryCommandValue:function(){var a=c.filterNodeList(this.selection.getStartElementPath(),function(a){return a.getAttribute("label")});return a?a.getAttribute("label"):""}};h.addListener("keyup",function(a,e){var d=e.keyCode||e.which;if(32==d||13==d)if(d=h.selection.getRange(),d.collapsed){var b=c.findParent(h.selection.getStart(),function(a){return a.getAttribute("label")},!0);if(b&&v.$block[b.tagName]&&c.isEmptyNode(b)){var g=h.document.createElement("p");c.insertAfter(b,g);c.fillNode(h.document,
g);c.remove(b);d.setStart(g,0).setCursor()}}})};UE.plugins.catchremoteimage=function(){function h(d,c){var l=d.join(g),h={timeout:6E4,onsuccess:c.success,onerror:c.error};h[a.options.catchFieldName]=l;e.request(b,h)}if(!1!==this.options.catchRemoteImageEnable){var a=this;this.setOpt({localDomain:["127.0.0.1","localhost","img.baidu.com"],separater:"ue_separate_ue",catchFieldName:"upfile",catchRemoteImageEnable:!0});var e=UE.ajax,d=a.options.localDomain,b=a.options.catcherUrl,g=a.options.separater;
a.addListener("afterpaste",function(){a.fireEvent("catchRemoteImage")});a.addListener("catchRemoteImage",function(){for(var b=[],e=c.getElementsByTagName(a.document,"img"),l=function(a,b){for(var d=0,c;c=b[d++];)if(-1!==a.indexOf(c))return!0;return!1},m=0,n;n=e[m++];)n.getAttribute("word_img")||(n=n.getAttribute("_src")||n.src||"",/^(https?|ftp):/i.test(n)&&!l(n,d)&&b.push(n));b.length&&h(b,{success:function(b){try{var d=eval("("+b.responseText+")")}catch(f){return}b=d.srcUrl.split(g);for(var d=d.url.split(g),
l=0,h;h=e[l++];)for(var n=h.getAttribute("_src")||h.src||"",m=0,p;p=b[m++];){var q=d[m-1];if(n==p&&"error"!=q){n=a.options.catcherPath+q;c.setAttributes(h,{src:n,_src:n});break}}a.fireEvent("catchremotesuccess")},error:function(){a.fireEvent("catchremoteerror")}})})}};UE.plugins.snapscreen=function(){var c,a;this.setOpt({snapscreenServerPort:location.port,snapscreenImgAlign:"",snapscreenHost:location.hostname});this.commands.snapscreen={execCommand:function(){var e=this,d=e.getLang("snapScreen_plugin");
if(!a){var b=e.container;c=b.ownerDocument||b.document;a=c.createElement("object");try{a.type="application/x-pluginbaidusnap"}catch(g){return}a.style.cssText="position:absolute;left:-9999px;";a.setAttribute("width","0");a.setAttribute("height","0");b.appendChild(a)}var f=e.options,b=function(a){try{a=eval("("+a+")")}catch(b){alert(d.callBackErrorMsg);return}"SUCCESS"!=a.state?alert(a.state):e.execCommand("insertimage",{src:f.snapscreenPath+a.url,floatStyle:f.snapscreenImgAlign,_src:f.snapscreenPath+
a.url})};try{var k=f.snapscreenServerPort+"";f.snapscreenServerUrl=f.snapscreenServerUrl.split(f.snapscreenHost);f.snapscreenServerUrl=f.snapscreenServerUrl[1]||f.snapscreenServerUrl[0];0===f.snapscreenServerUrl.indexOf(":"+k)&&(f.snapscreenServerUrl=f.snapscreenServerUrl.substring(k.length+1));var l=a.saveSnapshot(f.snapscreenHost,f.snapscreenServerUrl,k);b(l)}catch(m){e.ui._dialogs.snapscreenDialog.open()}}}};UE.commands.insertparagraph={execCommand:function(h,a){for(var e=this.selection.getRange(),
d=e.startContainer,b;d&&!c.isBody(d);)b=d,d=d.parentNode;b&&(d=this.document.createElement("p"),a?b.parentNode.insertBefore(d,b):b.parentNode.insertBefore(d,b.nextSibling),c.fillNode(this.document,d),e.setStart(d,0).setCursor(!1,!0))}};UE.plugins.webapp=function(){function h(a,b,c){return b?'<iframe class="edui-faked-webapp" title="'+a.title+'" width="'+a.width+'" height="'+a.height+'" scrolling="no" frameborder="0" src="'+a.url+'" logo_url = '+a.logo+"></iframe>":(c?"<p>":"")+'<img title="'+a.title+
'" width="'+a.width+'" height="'+a.height+'" src="'+e.options.UEDITOR_HOME_URL+'themes/default/images/spacer.gif" style="background:url('+a.logo+') no-repeat center center; border:1px solid gray;" class="edui-faked-webapp" _url="'+a.url+'" />'+(c?"</p>":"")}function a(a){for(var b,g=c.getElementsByTagName(e.document,a?"img":"iframe"),f=0,k;k=g[f++];)"edui-faked-webapp"==k.className&&(b=e.document.createElement("div"),b.innerHTML=h(a?{url:k.getAttribute("_url"),width:k.width,height:k.height,title:k.title,
logo:k.style.backgroundImage.replace("url(","").replace(")","")}:{url:k.getAttribute("src",2),title:k.title,width:k.width,height:k.height,logo:k.getAttribute("logo_url")},a?!0:!1,!1),k.parentNode.replaceChild(b.firstChild,k))}var e=this;e.addListener("beforegetcontent",function(){a(!0)});e.addListener("aftersetcontent",function(){a(!1)});e.addListener("aftergetcontent",function(d){"aftergetcontent"==d&&e.queryCommandState("source")||a(!1)});e.commands.webapp={execCommand:function(a,b){e.execCommand("inserthtml",
h(b,!1,!0))}}};UE.plugins.template=function(){UE.commands.template={execCommand:function(c,a){a.html&&this.execCommand("inserthtml",a.html)}};this.addListener("click",function(h,a){var e=a.target||a.srcElement,d=this.selection.getRange();(e=c.findParent(e,function(a){if(a.className&&c.hasClass(a,"ue_t"))return a},!0))&&d.selectNode(e).shrinkBoundary().select()});this.addListener("keydown",function(h,a){var e=this.selection.getRange();e.collapsed||(a.ctrlKey||a.metaKey||a.shiftKey||a.altKey)||(e=c.findParent(e.startContainer,
function(a){if(a.className&&c.hasClass(a,"ue_t"))return a},!0))&&c.removeClasses(e,["ue_t"])})};UE.plugin.register("music",function(){function c(e,d,b,g,f,k){return k?'<embed type="application/x-shockwave-flash" class="edui-faked-music" pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+e+'" width="'+d+'" height="'+b+'" '+(g&&!f?'align="'+g+'"':"")+(f?'style="float:'+f+'"':"")+' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >':
"<img "+(g&&!f?'align="'+g+'"':"")+(f?'style="float:'+f+'"':"")+' width="'+d+'" height="'+b+'" _url="'+e+'" class="edui-faked-music" src="'+a.options.langPath+a.options.lang+'/images/music.png" />'}var a=this;return{outputRule:function(a){p.each(a.getNodesByTagName("img"),function(a){var b;if("edui-faked-music"==a.getAttr("class")){b=a.getStyle("float");var e=a.getAttr("align");b=c(a.getAttr("_url"),a.getAttr("width"),a.getAttr("height"),e,b,!0);b=UE.uNode.createElement(b);a.parentNode.replaceChild(b,
a)}})},inputRule:function(a){p.each(a.getNodesByTagName("embed"),function(a){if("edui-faked-music"==a.getAttr("class")){var b=a.getStyle("float"),e=a.getAttr("align");html=c(a.getAttr("src"),a.getAttr("width"),a.getAttr("height"),e,b,!1);b=UE.uNode.createElement(html);a.parentNode.replaceChild(b,a)}})},commands:{music:{execCommand:function(a,d){var b=c(d.url,d.width||400,d.height||95,"none",!1);this.execCommand("inserthtml",b)},queryCommandState:function(){var a=this.selection.getRange().getClosedNode();
return a&&"edui-faked-music"==a.className?1:0}}}}});UE.plugin.register("autoupload",function(){var h=this,a=function(a,c){var b=new FormData;b.append(c.options.imageFieldName||"upfile",a,a.name||"blob."+a.type.substr(6));b.append("type","ajax");var g=new XMLHttpRequest;g.open("post",h.options.imageUrl,!0);g.setRequestHeader("X-Requested-With","XMLHttpRequest");g.addEventListener("load",function(a){try{var b=(new Function("return "+a.target.response))(),e=h.options.imagePath+b.url;c.execCommand("insertimage",
{src:e,_src:e})}catch(g){}});g.send(b)};return{bindEvents:{ready:function(e){window.FormData&&window.FileReader&&(c.on(h.body,"paste drop",function(c){var b=!1,e;if(e="paste"==c.type?c.clipboardData&&c.clipboardData.items&&1==c.clipboardData.items.length&&/^image\//.test(c.clipboardData.items[0].type)?c.clipboardData.items:null:c.dataTransfer&&c.dataTransfer.files?c.dataTransfer.files:null){for(var f=e.length,k;f--;)k=e[f],k.getAsFile&&(k=k.getAsFile()),k&&(0<k.size&&/image\/\w+/i.test(k.type))&&
(a(k,h),b=!0);b&&c.preventDefault()}}),c.on(h.body,"dragover",function(a){"Files"==a.dataTransfer.types[0]&&a.preventDefault()}))}}}});UE.plugin.register("autosave",function(){function c(f){var k=null;new Date-e<d||(f.hasContents()?(e=new Date,f._saveFlag=null,k=a.body.innerHTML,!1!==f.fireEvent("beforeautosave",{content:k})&&(g.saveLocalData(b,k),f.fireEvent("afterautosave",{content:k}))):b&&g.removeItem(b))}var a=this,e=new Date,d=20,b=null,g=UE.LocalStorage=function(){function a(){var b=document.createElement("div");
b.style.display="none";if(!b.addBehavior)return null;b.addBehavior("#default#userdata");return{getItem:function(a){var d=null;try{document.body.appendChild(b),b.load(c),d=b.getAttribute(a),document.body.removeChild(b)}catch(e){}return d},setItem:function(a,d){document.body.appendChild(b);b.setAttribute(a,d);b.save(c);document.body.removeChild(b)},removeItem:function(a){document.body.appendChild(b);b.removeAttribute(a);b.save(c);document.body.removeChild(b)}}}var b=window.localStorage||a()||null,c=
"localStorage";return{saveLocalData:function(a,c){return b&&c?(b.setItem(a,c),!0):!1},getLocalData:function(a){return b?b.getItem(a):null},removeItem:function(a){b&&b.removeItem(a)}}}();return{defaultOptions:{saveInterval:500},bindEvents:{ready:function(){var c=null,c=a.key?a.key+"-drafts-data":(a.container.parentNode.id||"ue-common")+"-drafts-data";b=(location.protocol+location.host+location.pathname).replace(/[.:\/]/g,"_")+c},contentchange:function(){b&&(a._saveFlag&&window.clearTimeout(a._saveFlag),
0<a.options.saveInterval?a._saveFlag=window.setTimeout(function(){c(a)},a.options.saveInterval):c(a))}},commands:{clearlocaldata:{execCommand:function(a,c){b&&g.getLocalData(b)&&g.removeItem(b)},notNeedUndo:!0,ignoreContentChange:!0},getlocaldata:{execCommand:function(a,c){return b?g.getLocalData(b)||"":""},notNeedUndo:!0,ignoreContentChange:!0},drafts:{execCommand:function(c,d){b&&(a.body.innerHTML=g.getLocalData(b)||"<p>"+(q.ie?"&nbsp;":"<br/>")+"</p>",a.focus(!0))},queryCommandState:function(){return b?
null===g.getLocalData(b)?-1:0:-1},notNeedUndo:!0,ignoreContentChange:!0}}}});UE.plugin.register("charts",function(){function h(a){var c=null,b=0;if(2>a.rows.length||2>a.rows[0].cells.length)return!1;for(var c=a.rows[0].cells,b=c.length,g=0,f;f=c[g];g++)if("th"!==f.tagName.toLowerCase())return!1;for(g=1;c=a.rows[g];g++){if(c.cells.length!=b||"th"!==c.cells[0].tagName.toLowerCase())return!1;for(var k=1;f=c.cells[k];k++)if(f=p.trim(f.innerText||f.textContent||""),f=f.replace(RegExp(UE.dom.domUtils.fillChar,
"g"),"").replace(/^\s+|\s+$/g,""),!/^\d*\.?\d+$/.test(f))return!1}return!0}var a=this;return{bindEvents:{chartserror:function(){}},commands:{charts:{execCommand:function(e,d){var b=c.findParentByTagName(this.selection.getRange().startContainer,"table",!0),g=[],f={};if(!b)return!1;if(!h(b))return a.fireEvent("chartserror"),!1;f.title=d.title||"";f.subTitle=d.subTitle||"";f.xTitle=d.xTitle||"";f.yTitle=d.yTitle||"";f.suffix=d.suffix||"";f.tip=d.tip||"";f.dataFormat=d.tableDataFormat||"";f.chartType=
d.chartType||0;for(var k in f)f.hasOwnProperty(k)&&g.push(k+":"+f[k]);b.setAttribute("data-chart",g.join(";"));c.addClass(b,"edui-charts-table")},queryCommandState:function(a,d){var b=c.findParentByTagName(this.selection.getRange().startContainer,"table",!0);return b&&h(b)?0:-1}}},inputRule:function(a){p.each(a.getNodesByTagName("table"),function(a){void 0!==a.getAttr("data-chart")&&a.setAttr("style")})},outputRule:function(a){p.each(a.getNodesByTagName("table"),function(a){void 0!==a.getAttr("data-chart")&&
a.setAttr("style","display: none;")})}}});UE.plugin.register("section",function(){function h(a){this.tag="";this.level=-1;this.parentSection=this.previousSection=this.nextSection=this.dom=null;this.startAddress=[];this.endAddress=[];this.children=[]}function a(a){var c=new h;return p.extend(c,a)}function e(a,c){for(var d=c,e=0;e<a.length;e++){if(!d.childNodes)return null;d=d.childNodes[a[e]]}return d}var d=this;return{bindMultiEvents:{type:"aftersetcontent aftergetscene afterscencerestore",handler:function(){d.fireEvent("updateSections")}},
bindEvents:{ready:function(){d.fireEvent("updateSections");c.on(d.body,"drop paste",function(){d.fireEvent("updateSections")})},afterexeccommand:function(a,c){"paragraph"==c&&d.fireEvent("updateSections")},keyup:function(a,c){if(!0!=this.selection.getRange().collapsed)this.fireEvent("updateSections");else{var d=c.keyCode||c.which;13!=d&&8!=d&&46!=d||this.fireEvent("updateSections")}}},commands:{getsections:{execCommand:function(b,c){function d(b,c){for(var g,l=null,q,s=b.childNodes,v=0,C=s.length;v<
C;v++){q=s[v];a:{g=q;for(var K=0;K<e.length;K++)if(e[K](g)){g=K;break a}g=-1}if(0<=g){l=h.selection.getRange().selectNode(q).createAddress(!0).startAddress;l=a({tag:q.tagName,title:q.innerHTML,level:g,dom:q,startAddress:p.clone(l,[]),endAddress:p.clone(l,[]),children:[]});n.nextSection=l;for(q=l.previousSection=n;g<=q.level;)q=q.parentSection;l.parentSection=q;q.children.push(l);l=n=l}else 1===q.nodeType&&d(q,c),l&&l.endAddress[l.endAddress.length-1]++}}for(var e=c||"h1 h2 h3 h4 h5 h6".split(" "),
l=0;l<e.length;l++)"string"==typeof e[l]?e[l]=function(a){return function(b){return b.tagName==a.toUpperCase()}}(e[l]):"function"!=typeof e[l]&&(e[l]=function(a){return null});var h=this,n=l=a({level:-1,title:"root"});d(h.body,l);return l},notNeedUndo:!0},movesection:{execCommand:function(a,d,f,k){if(d&&f&&-1!=f.level){f=k?f.endAddress:f.startAddress;a=e(f,this.body);var l;if(!(l=!f)&&!(l=!a)){l=d.startAddress;for(var h=!1,n=!1,r=0;r<l.length&&!(r>=f.length);r++)if(f[r]>l[r]){h=!0;break}else if(f[r]<
l[r])break;for(r=0;r<d.endAddress.length&&!(r>=f.length);r++)if(f[r]<l[r]){n=!0;break}else if(f[r]>l[r])break;l=h&&n}if(!l){f=e(d.startAddress,this.body);d=e(d.endAddress,this.body);if(k)for(k=d;k&&!(c.getPosition(f,k)&c.POSITION_FOLLOWING);){l=k.previousSibling;c.insertAfter(a,k);if(k==f)break;k=l}else for(k=f;k&&!(c.getPosition(k,d)&c.POSITION_FOLLOWING);){l=k.nextSibling;a.parentNode.insertBefore(k,a);if(k==d)break;k=l}this.fireEvent("updateSections")}}}},deletesection:{execCommand:function(a,
d,e){function k(a){for(var b=l.body,c=0;c<a.length;c++){if(!b.childNodes)return null;b=b.childNodes[a[c]]}return b}var l=this;if(d){a=k(d.startAddress);d=k(d.endAddress);if(e)c.remove(a);else for(;a&&c.inDoc(d,l.document)&&!(c.getPosition(a,d)&c.POSITION_FOLLOWING);)e=a.nextSibling,c.remove(a),a=e;l.fireEvent("updateSections")}}},selectsection:{execCommand:function(a,c){if(!c&&!c.dom)return!1;var d=this.selection.getRange(),e={startAddress:p.clone(c.startAddress,[]),endAddress:p.clone(c.endAddress,
[])};e.endAddress[e.endAddress.length-1]++;d.moveToAddress(e).select().scrollToView();return!0},notNeedUndo:!0},scrolltosection:{execCommand:function(a,c){if(!c&&!c.dom)return!1;var d=this.selection.getRange(),e={startAddress:c.startAddress,endAddress:c.endAddress};e.endAddress[e.endAddress.length-1]++;d.moveToAddress(e).scrollToView();return!0},notNeedUndo:!0}}}});s=s||{};s.editor=s.editor||{};s.editor.ui={};(function(){function c(){var a=document.getElementById("edui_fixedlayer");g.setViewportOffset(a,
{left:0,top:0})}var a=s.editor.browser,e=s.editor.dom.domUtils,d=window.$EDITORUI={},b=0,g=s.editor.ui.uiUtils={uid:function(a){return a?a.ID$EDITORUI||(a.ID$EDITORUI=++b):++b},hook:function(a,b){var c;a&&a._callbacks?c=a:(c=function(){var b;a&&(b=a.apply(this,arguments));for(var d=c._callbacks,e=d.length;e--;){var g=d[e].apply(this,arguments);void 0===b&&(b=g)}return b},c._callbacks=[]);c._callbacks.push(b);return c},createElementByHtml:function(a){var b=document.createElement("div");b.innerHTML=
a;b=b.firstChild;b.parentNode.removeChild(b);return b},getViewportElement:function(){return a.ie&&a.quirks?document.body:document.documentElement},getClientRect:function(a){var b;try{b=a.getBoundingClientRect()}catch(c){b={left:0,top:0,height:0,width:0}}for(var d={left:Math.round(b.left),top:Math.round(b.top),height:Math.round(b.bottom-b.top),width:Math.round(b.right-b.left)},g;(g=a.ownerDocument)!==document&&(a=e.getWindow(g).frameElement);)b=a.getBoundingClientRect(),d.left+=b.left,d.top+=b.top;
d.bottom=d.top+d.height;d.right=d.left+d.width;return d},getViewportRect:function(){var a=g.getViewportElement(),b=(window.innerWidth||a.clientWidth)|0,a=(window.innerHeight||a.clientHeight)|0;return{left:0,top:0,height:a,width:b,bottom:a,right:b}},setViewportOffset:function(a,b){var c=g.getFixedLayer();a.parentNode===c?(a.style.left=b.left+"px",a.style.top=b.top+"px"):e.setViewportOffset(a,b)},getEventOffset:function(a){var b=g.getClientRect(a.target||a.srcElement);a=g.getViewportOffsetByEvent(a);
return{left:a.left-b.left,top:a.top-b.top}},getViewportOffsetByEvent:function(a){var b=a.target||a.srcElement,c=e.getWindow(b).frameElement;a={left:a.clientX,top:a.clientY};c&&b.ownerDocument!==document&&(b=g.getClientRect(c),a.left+=b.left,a.top+=b.top);return a},setGlobal:function(a,b){d[a]=b;return'$EDITORUI["'+a+'"]'},unsetGlobal:function(a){delete d[a]},copyAttributes:function(b,c){for(var d=c.attributes,g=d.length;g--;){var h=d[g];"style"==h.nodeName||("class"==h.nodeName||a.ie&&!h.specified)||
b.setAttribute(h.nodeName,h.nodeValue)}c.className&&e.addClass(b,c.className);c.style.cssText&&(b.style.cssText+=";"+c.style.cssText)},removeStyle:function(a,b){if(a.style.removeProperty)a.style.removeProperty(b);else if(a.style.removeAttribute)a.style.removeAttribute(b);else throw"";},contains:function(a,b){return a&&b&&(a===b?!1:a.contains?a.contains(b):a.compareDocumentPosition(b)&16)},startDrag:function(a,b,c){function d(a){b.ondragmove(a.clientX-e,a.clientY-g,a);a.stopPropagation?a.stopPropagation():
a.cancelBubble=!0}c=c||document;var e=a.clientX,g=a.clientY;if(c.addEventListener){var h=function(a){c.removeEventListener("mousemove",d,!0);c.removeEventListener("mouseup",h,!0);window.removeEventListener("mouseup",h,!0);b.ondragstop()};c.addEventListener("mousemove",d,!0);c.addEventListener("mouseup",h,!0);window.addEventListener("mouseup",h,!0);a.preventDefault()}else{var p=a.srcElement;p.setCapture();var q=function(){p.releaseCapture();p.detachEvent("onmousemove",d);p.detachEvent("onmouseup",
q);p.detachEvent("onlosecaptrue",q);b.ondragstop()};p.attachEvent("onmousemove",d);p.attachEvent("onmouseup",q);p.attachEvent("onlosecaptrue",q);a.returnValue=!1}b.ondragstart()},getFixedLayer:function(){var b=document.getElementById("edui_fixedlayer");null==b&&(b=document.createElement("div"),b.id="edui_fixedlayer",document.body.appendChild(b),a.ie&&8>=a.version?(b.style.position="absolute",e.on(window,"scroll",c),e.on(window,"resize",s.editor.utils.defer(c,0,!0)),setTimeout(c)):b.style.position=
"fixed",b.style.left="0",b.style.top="0",b.style.width="0",b.style.height="0");return b},makeUnselectable:function(b){if(a.opera||a.ie&&9>a.version){if(b.unselectable="on",b.hasChildNodes())for(var c=0;c<b.childNodes.length;c++)1==b.childNodes[c].nodeType&&g.makeUnselectable(b.childNodes[c])}else void 0!==b.style.MozUserSelect?b.style.MozUserSelect="none":void 0!==b.style.WebkitUserSelect?b.style.WebkitUserSelect="none":void 0!==b.style.KhtmlUserSelect&&(b.style.KhtmlUserSelect="none")}}})();(function(){var h=
s.editor.utils,a=s.editor.ui.uiUtils,e=s.editor.EventBase,d=s.editor.ui.UIBase=function(){};d.prototype={className:"",uiName:"",initOptions:function(b){for(var c in b)this[c]=b[c];this.id=this.id||"edui"+a.uid()},initUIBase:function(){this._globalKey=h.unhtml(a.setGlobal(this.id,this))},render:function(b){for(var d=this.renderHtml(),d=a.createElementByHtml(d),e=c.getElementsByTagName(d,"*"),k="edui-"+(this.theme||this.editor.options.theme),l=document.getElementById("edui_fixedlayer"),h=0,n;n=e[h++];)c.addClass(n,
k);c.addClass(d,k);l&&(l.className="",c.addClass(l,k));e=this.getDom();null!=e?(e.parentNode.replaceChild(d,e),a.copyAttributes(d,e)):("string"==typeof b&&(b=document.getElementById(b)),b=b||a.getFixedLayer(),c.addClass(b,k),b.appendChild(d));this.postRender()},getDom:function(a){return a?document.getElementById(this.id+"_"+a):document.getElementById(this.id)},postRender:function(){this.fireEvent("postrender")},getHtmlTpl:function(){return""},formatHtml:function(a){var c="edui-"+this.uiName;return a.replace(/##/g,
this.id).replace(/%%-/g,this.uiName?c+"-":"").replace(/%%/g,(this.uiName?c:"")+" "+this.className).replace(/\$\$/g,this._globalKey)},renderHtml:function(){return this.formatHtml(this.getHtmlTpl())},dispose:function(){var b=this.getDom();b&&s.editor.dom.domUtils.remove(b);a.unsetGlobal(this.id)}};h.inherits(d,e)})();(function(){var c=s.editor.utils,a=s.editor.ui.UIBase,e=s.editor.ui.Separator=function(a){this.initOptions(a);this.initSeparator()};e.prototype={uiName:"separator",initSeparator:function(){this.initUIBase()},
getHtmlTpl:function(){return'<div id="##" class="edui-box %%"></div>'}};c.inherits(e,a)})();(function(){var c=s.editor.utils,a=s.editor.dom.domUtils,e=s.editor.ui.UIBase,d=s.editor.ui.uiUtils,b=s.editor.ui.Mask=function(a){this.initOptions(a);this.initUIBase()};b.prototype={getHtmlTpl:function(){return'<div id="##" class="edui-mask %%" onmousedown="return $$._onMouseDown(event, this);"></div>'},postRender:function(){var b=this;a.on(window,"resize",function(){setTimeout(function(){b.isHidden()||b._fill()})})},
show:function(a){this._fill();this.getDom().style.display="";this.getDom().style.zIndex=a},hide:function(){this.getDom().style.display="none";this.getDom().style.zIndex=""},isHidden:function(){return"none"==this.getDom().style.display},_onMouseDown:function(){return!1},_fill:function(){var a=this.getDom(),b=d.getViewportRect();a.style.width=b.width+"px";a.style.height=b.height+"px"}};c.inherits(b,e)})();(function(){function c(a,b){for(var d=0;d<f.length;d++){var e=f[d];if(!e.isHidden()&&!1!==e.queryAutoHide(b)){if(a&&
/scroll/ig.test(a.type)&&"edui-wordpastepop"==e.className)return;e.hide()}}f.length&&e.editor.fireEvent("afterhidepop")}var a=s.editor.utils,e=s.editor.ui.uiUtils,d=s.editor.dom.domUtils,b=s.editor.ui.UIBase,g=s.editor.ui.Popup=function(a){this.initOptions(a);this.initPopup()},f=[];g.postHide=c;var k=["edui-anchor-topleft","edui-anchor-topright","edui-anchor-bottomleft","edui-anchor-bottomright"];g.prototype={SHADOW_RADIUS:5,content:null,_hidden:!1,autoRender:!0,canSideLeft:!0,canSideUp:!0,initPopup:function(){this.initUIBase();
f.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:b.prototype.postRender,postRender:function(){this.content instanceof b&&this.content.postRender();if(this.captureWheel&&!this.captured){this.captured=!0;var a=(document.documentElement.clientHeight||document.body.clientHeight)-80,c=this.getDom().offsetHeight,g=e.getClientRect(this.combox.getDom()).top,f=this.getDom("content"),k=this.getDom("body").getElementsByTagName("iframe"),h=this;for(k.length&&(k=k[0]);g+c>a;)c-=
30,f.style.height=c+"px",k&&(k.style.height=c+"px");if(window.XMLHttpRequest)d.on(f,"onmousewheel"in document.body?"mousewheel":"DOMMouseScroll",function(a){a.preventDefault?a.preventDefault():a.returnValue=!1;f.scrollTop=a.wheelDelta?f.scrollTop-60*(a.wheelDelta/120):f.scrollTop-60*(a.detail/-3)});else d.on(this.getDom(),"mousewheel",function(a){a.returnValue=!1;h.getDom("content").scrollTop-=60*(a.wheelDelta/120)})}this.fireEvent("postRenderAfter");this.hide(!0);this._UIBase_postRender()},_doAutoRender:function(){!this.getDom()&&
this.autoRender&&this.render()},mesureSize:function(){var a=this.getDom("content");return e.getClientRect(a)},fitSize:function(){if(this.captureWheel&&this.sized)return this.__size;this.sized=!0;var a=this.getDom("body");a.style.width="";a.style.height="";var b=this.mesureSize();if(this.captureWheel){a.style.width=-(-20-b.width)+"px";var c=parseInt(this.getDom("content").style.height,10);!window.isNaN(c)&&(b.height=c)}else a.style.width=b.width+"px";a.style.height=b.height+"px";this.__size=b;this.captureWheel&&
(this.getDom("content").style.overflow="auto");return b},showAnchor:function(a,b){this.showAnchorRect(e.getClientRect(a),b)},showAnchorRect:function(a,b,c){this._doAutoRender();var g=e.getViewportRect();this._show();c=this.fitSize();var f;b?(b=this.canSideLeft&&a.right+c.width>g.right&&a.left>c.width,g=this.canSideUp&&a.top+c.height>g.bottom&&a.bottom>c.height,f=b?a.left-c.width:a.right,a=g?a.bottom-c.height:a.top):(b=this.canSideLeft&&a.right+c.width>g.right&&a.left>c.width,g=this.canSideUp&&a.top+
c.height>g.bottom&&a.bottom>c.height,f=b?a.right-c.width:a.left,a=g?a.top-c.height:a.bottom);c=this.getDom();e.setViewportOffset(c,{left:f,top:a});d.removeClasses(c,k);c.className+=" "+k[2*(g?1:0)+(b?1:0)];this.editor&&(c.style.zIndex=1*this.editor.container.style.zIndex+10,s.editor.ui.uiUtils.getFixedLayer().style.zIndex=c.style.zIndex-1)},showAt:function(a){var b=a.left;a=a.top;this.showAnchorRect({left:b,top:a,right:b,bottom:a,height:0,width:0},!1,!0)},_show:function(){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(a){!this._hidden&&this.getDom()&&(this.getDom().style.display="none",this._hidden=!0,a||this.fireEvent("hide"))},queryAutoHide:function(a){return!a||!e.contains(this.getDom(),a)}};a.inherits(g,b);d.on(document,"mousedown",function(a){c(a,a.target||a.srcElement)});d.on(window,"scroll",function(a,b){c(a,b)})})();(function(){var c=s.editor.utils,a=s.editor.ui.UIBase,
e=s.editor.ui.ColorPicker=function(a){this.initOptions(a);this.noColorText=this.noColorText||this.editor.getLang("clearColor");this.initUIBase()};e.prototype={getHtmlTpl:function(){for(var a=this.editor,c='<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);">'+this.noColorText+'</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">'+
a.getLang("themeColor")+'</td> </tr><tr class="edui-colorpicker-tablefirstrow" >',e=0;e<d.length;e++)e&&0===e%10&&(c+="</tr>"+(60==e?'<tr style="border-bottom: 1px solid #ddd;font-size: 13px;line-height: 25px;color:#39C;"><td colspan="10">'+a.getLang("standardColor")+"</td></tr>":"")+"<tr"+(60==e?' class="edui-colorpicker-tablefirstrow"':"")+">"),c+=70>e?'<td style="padding: 0 2px;"><a hidefocus title="'+d[e]+'" onclick="return false;" href="javascript:" unselectable="on" class="edui-box edui-colorpicker-colorcell" data-color="#'+
d[e]+'" style="background-color:#'+d[e]+";border:solid #ccc;"+(10>e||60<=e?"border-width:1px;":10<=e&&20>e?"border-width:1px 1px 0 1px;":"border-width:0 1px 0 1px;")+'"></a></td>':"";return c+"</tr></table></div>"},_onTableClick:function(a){(a=(a.target||a.srcElement).getAttribute("data-color"))&&this.fireEvent("pickcolor",a)},_onTableOver:function(a){if(a=(a.target||a.srcElement).getAttribute("data-color"))this.getDom("preview").style.backgroundColor=a},_onTableOut:function(){this.getDom("preview").style.backgroundColor=
""},_onPickNoColor:function(){this.fireEvent("picknocolor")}};c.inherits(e,a);var d="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 c=s.editor.utils,a=s.editor.ui.uiUtils,e=s.editor.ui.UIBase,d=s.editor.ui.TablePicker=function(a){this.initOptions(a);this.initTablePicker()};d.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:e.prototype.render,render:function(a){this._UIBase_render(a);this.getDom("label").innerHTML="0"+this.editor.getLang("t_row")+" x 0"+this.editor.getLang("t_col")},_track:function(a,c){var d=this.getDom("overlay").style,e=this.lengthOfCellSide;d.width=a*e+"px";d.height=c*e+"px";this.getDom("label").innerHTML=a+this.editor.getLang("t_col")+" x "+c+this.editor.getLang("t_row");this.numCols=a;this.numRows=c},_onMouseOver:function(b,c){var d=b.relatedTarget||b.fromElement;a.contains(c,d)||
c===d||(this.getDom("label").innerHTML="0"+this.editor.getLang("t_col")+" x 0"+this.editor.getLang("t_row"),this.getDom("overlay").style.visibility="")},_onMouseOut:function(b,c){var d=b.relatedTarget||b.toElement;a.contains(c,d)||c===d||(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(b,c){this.getDom("overlay");var d=a.getEventOffset(b),e=this.lengthOfCellSide,l=Math.ceil(d.left/
e),d=Math.ceil(d.top/e);this._track(l,d)},_onClick:function(){this.fireEvent("picktable",this.numCols,this.numRows)}};c.inherits(d,e)})();(function(){var c=s.editor.dom.domUtils,a=s.editor.ui.uiUtils,e='onmousedown="$$.Stateful_onMouseDown(event, this);" onmouseup="$$.Stateful_onMouseUp(event, this);"'+(s.editor.browser.ie?' onmouseenter="$$.Stateful_onMouseEnter(event, this);" onmouseleave="$$.Stateful_onMouseLeave(event, this);"':' onmouseover="$$.Stateful_onMouseOver(event, this);" onmouseout="$$.Stateful_onMouseOut(event, this);"');
s.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 e})},Stateful_onMouseEnter:function(a,b){this.target=b;if(!this.isDisabled()||this.alwalysHoverable)this.addState("hover"),this.fireEvent("over")},Stateful_onMouseLeave:function(a,b){if(!this.isDisabled()||this.alwalysHoverable)this.removeState("hover"),
this.removeState("active"),this.fireEvent("out")},Stateful_onMouseOver:function(c,b){var e=c.relatedTarget;a.contains(b,e)||b===e||this.Stateful_onMouseEnter(c,b)},Stateful_onMouseOut:function(c,b){var e=c.relatedTarget;a.contains(b,e)||b===e||this.Stateful_onMouseLeave(c,b)},Stateful_onMouseDown:function(a,b){this.isDisabled()||this.addState("active")},Stateful_onMouseUp:function(a,b){this.isDisabled()||this.removeState("active")},Stateful_postRender:function(){this.disabled&&!this.hasState("disabled")&&
this.addState("disabled")},hasState:function(a){return c.hasClass(this.getStateDom(),"edui-state-"+a)},addState:function(a){this.hasState(a)||(this.getStateDom().className+=" edui-state-"+a)},removeState:function(a){this.hasState(a)&&c.removeClasses(this.getStateDom(),["edui-state-"+a])},getStateDom:function(){return this.getDom("state")},isChecked:function(){return this.hasState("checked")},setChecked:function(a){!this.isDisabled()&&a?this.addState("checked"):this.removeState("checked")},isDisabled:function(){return this.hasState("disabled")},
setDisabled:function(a){a?(this.removeState("hover"),this.removeState("checked"),this.removeState("active"),this.addState("disabled")):this.removeState("disabled")}}})();(function(){var c=s.editor.utils,a=s.editor.ui.UIBase,e=s.editor.ui.Stateful,d=s.editor.ui.Button=function(a){this.initOptions(a);this.initButton()};d.prototype={uiName:"button",label:"",title:"",showIcon:!0,showText:!0,initButton:function(){this.initUIBase();this.Stateful_init()},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 false;" onclick="return $$._onClick();">'+(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)},_onClick:function(){this.isDisabled()||this.fireEvent("click")}};c.inherits(d,a);c.extend(d.prototype,e)})();(function(){var c=s.editor.utils,
a=s.editor.ui.uiUtils,e=s.editor.ui.UIBase,d=s.editor.ui.Stateful,b=s.editor.ui.SplitButton=function(a){this.initOptions(a);this.initSplitButton()};b.prototype={popup:null,uiName:"splitbutton",title:"",initSplitButton:function(){this.initUIBase();this.Stateful_init();if(null!=this.popup){var a=this.popup;this.popup=null;this.setPopup(a)}},_UIBase_postRender:e.prototype.postRender,postRender:function(){this.Stateful_postRender();this._UIBase_postRender()},setPopup:function(b){this.popup!==b&&(null!=
this.popup&&this.popup.dispose(),b.addListener("show",c.bind(this._onPopupShow,this)),b.addListener("hide",c.bind(this._onPopupHide,this)),b.addListener("postrender",c.bind(function(){b.getDom("body").appendChild(a.createElementByHtml('<div id="'+this.popup.id+'_bordereraser" class="edui-bordereraser edui-background" style="width:'+(a.getClientRect(this.getDom()).width+20)+'px"></div>'));b.getDom().className+=" "+this.className},this)),this.popup=b)},_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 b=
a.getClientRect(this.getDom());b.top-=this.popup.SHADOW_RADIUS;b.height+=this.popup.SHADOW_RADIUS;this.popup.showAnchorRect(b)},_onArrowClick:function(a,b){this.isDisabled()||this.showPopup()},_onButtonClick:function(){this.isDisabled()||this.fireEvent("buttonclick")}};c.inherits(b,e);c.extend(b.prototype,d,!0)})();(function(){var c=s.editor.utils,a=s.editor.ui.uiUtils,e=s.editor.ui.ColorPicker,d=s.editor.ui.Popup,b=s.editor.ui.SplitButton,g=s.editor.ui.ColorButton=function(a){this.initOptions(a);
this.initColorButton()};g.prototype={initColorButton:function(){var a=this;this.popup=new d({content:new e({noColorText:a.editor.getLang("clearColor"),editor:a.editor,onpickcolor:function(b,c){a._onPickColor(c)},onpicknocolor:function(b,c){a._onPickNoColor(c)}}),editor:a.editor});this.initSplitButton()},_SplitButton_postRender:b.prototype.postRender,postRender:function(){this._SplitButton_postRender();this.getDom("button_body").appendChild(a.createElementByHtml('<div id="'+this.id+'_colorlump" class="edui-colorlump"></div>'));
this.getDom().className+=" edui-colorbutton"},setColor:function(a){this.color=this.getDom("colorlump").style.backgroundColor=a},_onPickColor:function(a){!1!==this.fireEvent("pickcolor",a)&&(this.setColor(a),this.popup.hide())},_onPickNoColor:function(a){!1!==this.fireEvent("picknocolor")&&this.popup.hide()}};c.inherits(g,b)})();(function(){var c=s.editor.utils,a=s.editor.ui.Popup,e=s.editor.ui.TablePicker,d=s.editor.ui.SplitButton,b=s.editor.ui.TableButton=function(a){this.initOptions(a);this.initTableButton()};
b.prototype={initTableButton:function(){var b=this;this.popup=new a({content:new e({editor:b.editor,onpicktable:function(a,c,d){b._onPickTable(c,d)}}),editor:b.editor});this.initSplitButton()},_onPickTable:function(a,b){!1!==this.fireEvent("picktable",a,b)&&this.popup.hide()}};c.inherits(b,d)})();(function(){var c=s.editor.utils,a=s.editor.ui.UIBase,e=s.editor.ui.AutoTypeSetPicker=function(a){this.initOptions(a);this.initAutoTypeSetPicker()};e.prototype={initAutoTypeSetPicker:function(){this.initUIBase()},
getHtmlTpl:function(){var a=this.editor,b=a.options.autotypeset,c=a.getLang("autoTypeSet"),e="textAlignValue"+a.uid,k="imageBlockLineValue"+a.uid;return'<div id="##" class="edui-autotypesetpicker %%"><div class="edui-autotypesetpicker-body"><table ><tr><td nowrap colspan="2"><input type="checkbox" name="mergeEmptyline" '+(b.mergeEmptyline?"checked":"")+">"+c.mergeLine+'</td><td colspan="2"><input type="checkbox" name="removeEmptyline" '+(b.removeEmptyline?"checked":"")+">"+c.delLine+'</td></tr><tr><td nowrap colspan="2"><input type="checkbox" name="removeClass" '+
(b.removeClass?"checked":"")+">"+c.removeFormat+'</td><td colspan="2"><input type="checkbox" name="indent" '+(b.indent?"checked":"")+">"+c.indent+'</td></tr><tr><td nowrap colspan="2"><input type="checkbox" name="textAlign" '+(b.textAlign?"checked":"")+">"+c.alignment+'</td><td colspan="2" id="'+e+'"><input type="radio" name="'+e+'" value="left" '+(b.textAlign&&"left"==b.textAlign?"checked":"")+">"+a.getLang("justifyleft")+'<input type="radio" name="'+e+'" value="center" '+(b.textAlign&&"center"==
b.textAlign?"checked":"")+">"+a.getLang("justifycenter")+'<input type="radio" name="'+e+'" value="right" '+(b.textAlign&&"right"==b.textAlign?"checked":"")+">"+a.getLang("justifyright")+' </tr><tr><td nowrap colspan="2"><input type="checkbox" name="imageBlockLine" '+(b.imageBlockLine?"checked":"")+">"+c.imageFloat+'</td><td nowrap colspan="2" id="'+k+'"><input type="radio" name="'+k+'" value="none" '+(b.imageBlockLine&&"none"==b.imageBlockLine?"checked":"")+">"+a.getLang("default")+'<input type="radio" name="'+
k+'" value="left" '+(b.imageBlockLine&&"left"==b.imageBlockLine?"checked":"")+">"+a.getLang("justifyleft")+'<input type="radio" name="'+k+'" value="center" '+(b.imageBlockLine&&"center"==b.imageBlockLine?"checked":"")+">"+a.getLang("justifycenter")+'<input type="radio" name="'+k+'" value="right" '+(b.imageBlockLine&&"right"==b.imageBlockLine?"checked":"")+">"+a.getLang("justifyright")+'</tr><tr><td nowrap colspan="2"><input type="checkbox" name="clearFontSize" '+(b.clearFontSize?"checked":"")+">"+
c.removeFontsize+'</td><td colspan="2"><input type="checkbox" name="clearFontFamily" '+(b.clearFontFamily?"checked":"")+">"+c.removeFontFamily+'</td></tr><tr><td nowrap colspan="4"><input type="checkbox" name="removeEmptyNode" '+(b.removeEmptyNode?"checked":"")+">"+c.removeHtml+'</td></tr><tr><td nowrap colspan="4"><input type="checkbox" name="pasteFilter" '+(b.pasteFilter?"checked":"")+">"+c.pasteFilter+'</td></tr><tr><td nowrap colspan="4" align="right"><button >'+c.run+"</button></td></tr></table></div></div>"},
_UIBase_render:a.prototype.render};c.inherits(e,a)})();(function(){function h(a){for(var b=a.editor.options.autotypeset,d=a.getDom(),e=a.editor.uid,g=null,g=null,h=c.getElementsByTagName(d,"input"),t=h.length-1,p;p=h[t--];)if(g=p.getAttribute("type"),"checkbox"==g&&(g=p.getAttribute("name"),b[g]&&delete b[g],p.checked))if(p=document.getElementById(g+"Value"+e))if(/input/ig.test(p.tagName))b[g]=p.value;else{p=p.getElementsByTagName("input");for(var q=p.length-1,u;u=p[q--];)if(u.checked){b[g]=u.value;
break}}else b[g]=!0;d=c.getElementsByTagName(d,"select");for(t=0;e=d[t++];)h=e.getAttribute("name"),b[h]=b[h]?e.value:"";a.editor.options.autotypeset=b}var a=s.editor.utils,e=s.editor.ui.Popup,d=s.editor.ui.AutoTypeSetPicker,b=s.editor.ui.SplitButton,g=s.editor.ui.AutoTypeSetButton=function(a){this.initOptions(a);this.initAutoTypeSetButton()};g.prototype={initAutoTypeSetButton:function(){var a=this;this.popup=new e({content:new d({editor:a.editor}),editor:a.editor,hide:function(){!this._hidden&&this.getDom()&&
(h(this),this.getDom().style.display="none",this._hidden=!0,this.fireEvent("hide"))}});var b=0;this.popup.addListener("postRenderAfter",function(){var c=this;b||(this.getDom().getElementsByTagName("button")[0].onclick=function(){h(c);a.editor.execCommand("autotypeset");c.hide()},b=1)});this.initSplitButton()}};a.inherits(g,b)})();(function(){var c=s.editor.utils,a=s.editor.ui.Popup,e=s.editor.ui.Stateful,d=s.editor.ui.UIBase,b=s.editor.ui.CellAlignPicker=function(a){this.initOptions(a);this.initSelected();
this.initCellAlignPicker()};b.prototype={initSelected:function(){var a={top:0,middle:1,bottom:2},b={left:0,center:1,right:2};this.selected&&(this.selectedIndex=3*a[this.selected.valign]+b[this.selected.align])},initCellAlignPicker:function(){this.initUIBase();this.Stateful_init()},getHtmlTpl:function(){for(var a=["left","center","right"],b=null,c=-1,d=[],e=0;9>e;e++)b=this.selectedIndex===e?' class="edui-cellalign-selected" ':"",c=e%3,0===c&&d.push("<tr>"),d.push('<td index="'+e+'" '+b+' stateful><div class="edui-icon edui-'+
a[c]+'"></div></td>'),2===c&&d.push("</tr>");return'<div id="##" class="edui-cellalignpicker %%"><div class="edui-cellalignpicker-body"><table onclick="$$._onClick(event);">'+d.join("")+"</table></div></div>"},getStateDom:function(){return this.target},_onClick:function(b){var c=b.target||b.srcElement;/icon/.test(c.className)&&(this.items[c.parentNode.getAttribute("index")].onclick(),a.postHide(b))},_UIBase_render:d.prototype.render};c.inherits(b,d);c.extend(b.prototype,e,!0)})();(function(){var h=
s.editor.utils,a=s.editor.ui.Stateful,e=s.editor.ui.uiUtils,d=s.editor.ui.UIBase,b=s.editor.ui.PastePicker=function(a){this.initOptions(a);this.initPastePicker()};b.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(a){this.editor.ui._isTransfer=!0;this.editor.fireEvent("pasteTransfer",a)},_onClick:function(a){var b=
c.getNextDomNode(a),d=e.getViewportRect().height,l=e.getClientRect(b);b.style.top=l.top+l.height>d?-l.height-a.offsetHeight+"px":"";/hidden/ig.test(c.getComputedStyle(b,"visibility"))?(b.style.visibility="visible",c.addClass(a,"edui-state-opened")):(b.style.visibility="hidden",c.removeClasses(a,"edui-state-opened"))},_UIBase_render:d.prototype.render};h.inherits(b,d);h.extend(b.prototype,a,!0)})();(function(){var c=s.editor.utils,a=s.editor.ui.uiUtils,e=s.editor.ui.UIBase,d=s.editor.ui.Toolbar=function(a){this.initOptions(a);
this.initToolbar()};d.prototype={items:null,initToolbar:function(){this.items=this.items||[];this.initUIBase()},add:function(a){this.items.push(a)},getHtmlTpl:function(){for(var a=[],c=0;c<this.items.length;c++)a[c]=this.items[c].renderHtml();return'<div id="##" class="edui-toolbar %%" onselectstart="return false;" onmousedown="return $$._onMouseDown(event, this);">'+a.join("")+"</div>"},postRender:function(){for(var b=this.getDom(),c=0;c<this.items.length;c++)this.items[c].postRender();a.makeUnselectable(b)},
_onMouseDown:function(){return!1}};c.inherits(d,e)})();(function(){var c=s.editor.utils,a=s.editor.dom.domUtils,e=s.editor.ui.uiUtils,d=s.editor.ui.UIBase,b=s.editor.ui.Popup,g=s.editor.ui.Stateful,f=s.editor.ui.CellAlignPicker,k=s.editor.ui.Menu=function(a){this.initOptions(a);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}};k.prototype={items:null,
uiName:"menu",initMenu:function(){this.items=this.items||[];this.initPopup();this.initItems()},initItems:function(){for(var a=0;a<this.items.length;a++){var b=this.items[a];"-"==b?this.items[a]=this.getSeparator():b instanceof m||(b.editor=this.editor,b.theme=this.editor.options.theme,this.items[a]=this.createItem(b))}},getSeparator:function(){return l},createItem:function(a){a.menu=this;return new m(a)},_Popup_getContentHtmlTpl:b.prototype.getContentHtmlTpl,getContentHtmlTpl:function(){if(0==this.items.length)return this._Popup_getContentHtmlTpl();
for(var a=[],b=0;b<this.items.length;b++)a[b]=this.items[b].renderHtml();return'<div class="%%-body">'+a.join("")+"</div>"},_Popup_postRender:b.prototype.postRender,postRender:function(){for(var b=this,c=0;c<this.items.length;c++){var d=this.items[c];d.ownerMenu=this;d.postRender()}a.on(this.getDom(),"mouseover",function(a){a=a||event;a=a.relatedTarget||a.fromElement;var c=b.getDom();e.contains(c,a)||c===a||b.fireEvent("over")});this._Popup_postRender()},queryAutoHide:function(a){if(a){if(e.contains(this.getDom(),
a))return!1;for(var b=0;b<this.items.length;b++)if(!1===this.items[b].queryAutoHide(a))return!1}},clearItems:function(){for(var a=0;a<this.items.length;a++){var b=this.items[a];clearTimeout(b._showingTimer);clearTimeout(b._closingTimer);b.subMenu&&b.subMenu.destroy()}this.items=[]},destroy:function(){this.getDom()&&a.remove(this.getDom());this.clearItems()},dispose:function(){this.destroy()}};c.inherits(k,b);var m=s.editor.ui.MenuItem=function(c){this.initOptions(c);this.initUIBase();this.Stateful_init();
if(this.subMenu&&!(this.subMenu instanceof k))if(c.className&&-1!=c.className.indexOf("aligntd")){var d=this;this.subMenu.selected=this.editor.queryCommandValue("cellalignment");this.subMenu=new b({content:new f(this.subMenu),parentMenu:d,editor:d.editor,destroy:function(){this.getDom()&&a.remove(this.getDom())}});this.subMenu.addListener("postRenderAfter",function(){a.on(this.getDom(),"mouseover",function(){d.addState("opened")})})}else this.subMenu=new k(this.subMenu)};m.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 a=this;this.addListener("over",function(){a.ownerMenu.fireEvent("submenuover",a);a.subMenu&&a.delayShowSubMenu()});this.subMenu&&(this.getDom().className+=" edui-hassubmenu",this.subMenu.render(),this.addListener("out",function(){a.delayHideSubMenu()}),this.subMenu.addListener("over",
function(){clearTimeout(a._closingTimer);a._closingTimer=null;a.addState("opened")}),this.ownerMenu.addListener("hide",function(){a.hideSubMenu()}),this.ownerMenu.addListener("submenuover",function(b,c){c!==a&&a.delayHideSubMenu()}),this.subMenu._bakQueryAutoHide=this.subMenu.queryAutoHide,this.subMenu.queryAutoHide=function(b){return b&&e.contains(a.getDom(),b)?!1:this._bakQueryAutoHide(b)});this.getDom().style.tabIndex="-1";e.makeUnselectable(this.getDom());this.Stateful_postRender()},delayShowSubMenu:function(){var a=
this;a.isDisabled()||(a.addState("opened"),clearTimeout(a._showingTimer),clearTimeout(a._closingTimer),a._closingTimer=null,a._showingTimer=setTimeout(function(){a.showSubMenu()},250))},delayHideSubMenu:function(){var a=this;a.isDisabled()||(a.removeState("opened"),clearTimeout(a._showingTimer),a._closingTimer||(a._closingTimer=setTimeout(function(){a.hasState("opened")||a.hideSubMenu();a._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(a){if(this.subMenu&&this.hasState("opened"))return this.subMenu.queryAutoHide(a)},_onClick:function(a,c){this.hasState("disabled")||!1!==this.fireEvent("click",a,c)&&(this.subMenu?this.showSubMenu():b.postHide(a))},showSubMenu:function(){var a=e.getClientRect(this.getDom());a.right-=5;a.left+=2;a.width-=7;a.top-=4;a.bottom+=4;a.height+=8;this.subMenu.showAnchorRect(a,!0,!0)},hideSubMenu:function(){this.subMenu.hide()}};
c.inherits(m,d);c.extend(m.prototype,g,!0)})();(function(){var c=s.editor.utils,a=s.editor.ui.uiUtils,e=s.editor.ui.Menu,d=s.editor.ui.SplitButton,b=s.editor.ui.Combox=function(a){this.initOptions(a);this.initCombox()};b.prototype={uiName:"combox",initCombox:function(){var a=this;this.items=this.items||[];for(var b=0;b<this.items.length;b++){var c=this.items[b];c.uiName="listitem";c.index=b;c.onclick=function(){a.selectByIndex(this.index)}}this.popup=new e({items:this.items,uiName:"list",editor:this.editor,
captureWheel:!0,combox:this});this.initSplitButton()},_SplitButton_postRender:d.prototype.postRender,postRender:function(){this._SplitButton_postRender();this.setLabel(this.label||"");this.setValue(this.initValue||"")},showPopup:function(){var b=a.getClientRect(this.getDom());b.top+=1;b.bottom-=1;b.height-=2;this.popup.showAnchorRect(b)},getValue:function(){return this.value},setValue:function(a){var b=this.indexByValue(a);-1!=b?(this.selectedIndex=b,this.setLabel(this.items[b].label),this.value=
this.items[b].value):(this.selectedIndex=-1,this.setLabel(this.getLabelForUnknowValue(a)),this.value=a)},setLabel:function(a){this.label=this.getDom("button_body").innerHTML=a},getLabelForUnknowValue:function(a){return a},indexByValue:function(a){for(var b=0;b<this.items.length;b++)if(a==this.items[b].value)return b;return-1},getItem:function(a){return this.items[a]},selectByIndex:function(a){a<this.items.length&&!1!==this.fireEvent("select",a)&&(this.selectedIndex=a,this.value=this.items[a].value,
this.setLabel(this.items[a].label))}};c.inherits(b,d)})();(function(){var c=s.editor.utils,a=s.editor.dom.domUtils,e=s.editor.ui.uiUtils,d=s.editor.ui.Mask,b=s.editor.ui.UIBase,g=s.editor.ui.Button,f=s.editor.ui.Dialog=function(a){this.initOptions(c.extend({autoReset:!0,draggable:!0,onok:function(){},oncancel:function(){},onclose:function(a,b){return b?this.onok():this.oncancel()},holdScroll:!1},a));this.initDialog()},k,l;f.prototype={draggable:!1,uiName:"dialog",initDialog:function(){var a=this,
b=this.editor.options.theme;this.initUIBase();this.modalMask=k||(k=new d({className:"edui-dialog-modalmask",theme:b}));this.dragMask=l||(l=new d({className:"edui-dialog-dragmask",theme:b}));this.closeButton=new g({className:"edui-dialog-closebutton",title:a.closeDialog,theme:b,onclick:function(){a.close(!1)}});this.fullscreen&&this.initResizeEvent();if(this.buttons)for(b=0;b<this.buttons.length;b++)this.buttons[b]instanceof g||(this.buttons[b]=new g(this.buttons[b]))},initResizeEvent:function(){var b=
this;a.on(window,"resize",function(){b._hidden||void 0===b._hidden||(b.__resizeTimer&&window.clearTimeout(b.__resizeTimer),b.__resizeTimer=window.setTimeout(function(){b.__resizeTimer=null;var a=b.getDom(),c=b.getDom("content"),d=UE.ui.uiUtils.getClientRect(a),g=UE.ui.uiUtils.getClientRect(c),f=e.getViewportRect();c.style.width=f.width-d.width+g.width+"px";c.style.height=f.height-d.height+g.height+"px";a.style.width=f.width+"px";a.style.height=f.height+"px";b.fireEvent("resize")},100))})},fitSize:function(){var a=
this.getDom("body"),b=this.mesureSize();a.style.width=b.width+"px";a.style.height=b.height+"px";return b},safeSetOffset:function(a){var b=this.getDom(),c=e.getViewportRect(),d=e.getClientRect(b),g=a.left;g+d.width>c.right&&(g=c.right-d.width);a=a.top;a+d.height>c.bottom&&(a=c.bottom-d.height);b.style.left=Math.max(g,0)+"px";b.style.top=Math.max(a,0)+"px"},showAtCenter:function(){var b=e.getViewportRect();if(this.fullscreen){var c=this.getDom(),d=this.getDom("content");c.style.display="block";var g=
UE.ui.uiUtils.getClientRect(c),f=UE.ui.uiUtils.getClientRect(d);c.style.left="-100000px";d.style.width=b.width-g.width+f.width+"px";d.style.height=b.height-g.height+f.height+"px";c.style.width=b.width+"px";c.style.height=b.height+"px";c.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="",d=this.fitSize(),g=this.getDom("titlebar").offsetHeight|0,c=b.width/2-d.width/2,b=b.height/2-(d.height-g)/2-g,d=this.getDom(),this.safeSetOffset({left:Math.max(c|0,0),top:Math.max(b|0,0)}),a.hasClass(d,"edui-state-centered")||(d.className+=" edui-state-centered");this._show()},getContentHtml:function(){var a="";"string"==typeof this.content?
a=this.content:this.iframeUrl&&(a='<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>');return a},getHtmlTpl:function(){var a="";if(this.buttons){for(var a=[],b=0;b<this.buttons.length;b++)a[b]=this.buttons[b].renderHtml();a='<div class="%%-foot"><div id="##_buttons" class="%%-buttons">'+a.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>"+a+"</div></div></div>"},postRender:function(){this.modalMask.getDom()||
(this.modalMask.render(),this.modalMask.hide());this.dragMask.getDom()||(this.dragMask.render(),this.dragMask.hide());var b=this;this.addListener("show",function(){b.modalMask.show(this.getDom().style.zIndex-2)});this.addListener("hide",function(){b.modalMask.hide()});if(this.buttons)for(var c=0;c<this.buttons.length;c++)this.buttons[c].postRender();a.on(window,"resize",function(){setTimeout(function(){b.isHidden()||b.safeSetOffset(e.getClientRect(b.getDom()))})});if(this.holdScroll)if(b.iframeUrl)b.addListener("dialogafterreset",
function(){window.setTimeout(function(){var c=document.getElementById(b.id+"_iframe").contentWindow;if(q.ie)var d=window.setInterval(function(){c.document&&c.document.body&&(window.clearInterval(d),d=null,a.on(c.document.body,q.gecko?"DOMMouseScroll":"mousewheel",function(b){a.preventDefault(b)}))},100);else a.on(c,q.gecko?"DOMMouseScroll":"mousewheel",function(b){a.preventDefault(b)})},1)});else a.on(document.getElementById(b.id+"_iframe"),q.gecko?"DOMMouseScroll":"mousewheel",function(b){a.preventDefault(b)});
this._hide()},mesureSize:function(){var a=this.getDom("body"),b=e.getClientRect(this.getDom("content")).width;a.style.width=b;return e.getClientRect(a)},_onTitlebarMouseDown:function(b,c){if(this.draggable){var d;e.getViewportRect();var g=this;e.startDrag(b,{ondragstart:function(){d=e.getClientRect(g.getDom());g.getDom("contmask").style.visibility="visible";g.dragMask.show(g.getDom().style.zIndex-1)},ondragmove:function(a,b){g.safeSetOffset({left:d.left+a,top:d.top+b})},ondragstop:function(){g.getDom("contmask").style.visibility=
"hidden";a.removeClasses(g.getDom(),["edui-state-centered"]);g.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"),s.editor.ui.uiUtils.getFixedLayer().style.zIndex=this.getDom().style.zIndex-4)},isHidden:function(){return this._hidden},
_hide:function(){if(!this._hidden){var a=this.getDom();a.style.display="none";a.style.zIndex="";a.style.width="";a.style.height="";this._hidden=!0;this.fireEvent("hide")}},open:function(){if(this.autoReset)try{this.reset()}catch(a){this.render(),this.open()}this.showAtCenter();if(this.iframeUrl)try{this.getDom("iframe").focus()}catch(b){}},_onCloseButtonClick:function(a,b){this.close(!1)},close:function(a){!1!==this.fireEvent("close",a)&&(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())}};c.inherits(f,b)})();(function(){var c=s.editor.utils,a=s.editor.ui.Menu,e=s.editor.ui.SplitButton,d=s.editor.ui.MenuButton=function(a){this.initOptions(a);this.initMenuButton()};d.prototype={initMenuButton:function(){var b=
this;this.uiName="menubutton";this.popup=new a({items:b.items,className:b.className,editor:b.editor});this.popup.addListener("show",function(){for(var a=0;a<this.items.length;a++)this.items[a].removeState("checked"),this.items[a].value==b._value&&(this.items[a].addState("checked"),this.value=b._value)});this.initSplitButton()},setValue:function(a){this._value=a}};c.inherits(d,e)})();(function(){var c=s.editor.utils,a=s.editor.ui,e=a.Dialog;a.buttons={};a.Dialog=function(a){var b=new e(a);b.addListener("hide",
function(){if(b.editor){var a=b.editor;try{if(q.gecko){var c=a.window.scrollY,d=a.window.scrollX;a.body.focus();a.window.scrollTo(d,c)}else a.focus()}catch(e){}}});return b};for(var d={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"},b="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".split(" "),
g=0,f;f=b[g++];)f=f.toLowerCase(),a[f]=function(b){return function(c){var d=new a.Button({className:"edui-for-"+b,title:c.options.labelMap[b]||c.getLang("labelMap."+b)||"",onclick:function(){c.execCommand(b)},theme:c.options.theme,showText:!1});a.buttons[b]=d;c.addListener("selectionchange",function(a,e,g){a=c.queryCommandState(b);-1==a?(d.setDisabled(!0),d.setChecked(!1)):g||(d.setDisabled(!1),d.setChecked(a))});return d}}(f);a.cleardoc=function(b){var c=new a.Button({className:"edui-for-cleardoc",
title:b.options.labelMap.cleardoc||b.getLang("labelMap.cleardoc")||"",theme:b.options.theme,onclick:function(){confirm(b.getLang("confirmClear"))&&b.execCommand("cleardoc")}});a.buttons.cleardoc=c;b.addListener("selectionchange",function(){c.setDisabled(-1==b.queryCommandState("cleardoc"))});return c};var b={justify:["left","right","center","justify"],imagefloat:["none","left","center","right"],directionality:["ltr","rtl"]},k;for(k in b)(function(b,c){for(var d=0,e;e=c[d++];)(function(c){a[b.replace("float",
"")+c]=function(d){var e=new a.Button({className:"edui-for-"+b.replace("float","")+c,title:d.options.labelMap[b.replace("float","")+c]||d.getLang("labelMap."+b.replace("float","")+c)||"",theme:d.options.theme,onclick:function(){d.execCommand(b,c)}});a.buttons[b]=e;d.addListener("selectionchange",function(a,g,f){e.setDisabled(-1==d.queryCommandState(b));e.setChecked(d.queryCommandValue(b)==c&&!f)});return e}})(e)})(k,b[k]);for(g=0;f=["backcolor","forecolor"][g++];)a[f]=function(b){return function(c){var d=
new a.ColorButton({className:"edui-for-"+b,color:"default",title:c.options.labelMap[b]||c.getLang("labelMap."+b)||"",editor:c,onpickcolor:function(a,d){c.execCommand(b,d)},onpicknocolor:function(){c.execCommand(b,"default");this.setColor("transparent");this.color="default"},onbuttonclick:function(){c.execCommand(b,this.color)}});a.buttons[b]=d;c.addListener("selectionchange",function(){d.setDisabled(-1==c.queryCommandState(b))});return d}}(f);b={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".split(" ")};for(k in b)(function(b,e){for(var g=0,f;f=e[g++];)q.opera&&"searchreplace"===f||function(e){a[e]=function(g,f,k){f=f||(g.options.iframeUrlMap||{})[e]||d[e];k=g.options.labelMap[e]||g.getLang("labelMap."+e)||"";var m;f&&(m=new a.Dialog(c.extend({iframeUrl:g.ui.mapUrl(f),editor:g,className:"edui-for-"+e,title:k,holdScroll:"insertimage"===
e,fullscreen:/charts|preview/.test(e),closeDialog:g.getLang("closeDialog")},"ok"==b?{buttons:[{className:"edui-okbutton",label:g.getLang("ok"),editor:g,onclick:function(){m.close(!0)}},{className:"edui-cancelbutton",label:g.getLang("cancel"),editor:g,onclick:function(){m.close(!1)}}]}:{})),g.ui._dialogs[e+"Dialog"]=m);var n=new a.Button({className:"edui-for-"+e,title:k,onclick:function(){if(m)switch(e){case "wordimage":var a=g.execCommand("wordimage");a&&a.length&&(m.render(),m.open());break;case "scrawl":-1!=
g.queryCommandState("scrawl")&&(m.render(),m.open());break;default:m.render(),m.open()}},theme:g.options.theme,disabled:"scrawl"==e&&-1==g.queryCommandState("scrawl")||"charts"==e});a.buttons[e]=n;g.addListener("selectionchange",function(){if(!(e in{edittable:1})){var a=g.queryCommandState(e);n.getDom()&&(n.setDisabled(-1==a),n.setChecked(a))}});return n}}(f.toLowerCase())})(k,b[k]);a.snapscreen=function(b,c,e){e=b.options.labelMap.snapscreen||b.getLang("labelMap.snapscreen")||"";var g=new a.Button({className:"edui-for-snapscreen",
title:e,onclick:function(){b.execCommand("snapscreen")},theme:b.options.theme});a.buttons.snapscreen=g;if(c=c||(b.options.iframeUrlMap||{}).snapscreen||d.snapscreen){var f=new a.Dialog({iframeUrl:b.ui.mapUrl(c),editor:b,className:"edui-for-snapscreen",title:e,buttons:[{className:"edui-okbutton",label:b.getLang("ok"),editor:b,onclick:function(){f.close(!0)}},{className:"edui-cancelbutton",label:b.getLang("cancel"),editor:b,onclick:function(){f.close(!1)}}]});f.render();b.ui._dialogs.snapscreenDialog=
f}b.addListener("selectionchange",function(){g.setDisabled(-1==b.queryCommandState("snapscreen"))});return g};a.insertcode=function(b,d,e){d=b.options.insertcode||[];e=b.options.labelMap.insertcode||b.getLang("labelMap.insertcode")||"";var g=[];c.each(d,function(a,c){g.push({label:a,value:c,theme:b.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" >'+(this.label||"")+"</div>"}})});var f=new a.Combox({editor:b,items:g,onselect:function(a,c){b.execCommand("insertcode",
this.items[c].value)},onbuttonclick:function(){this.showPopup()},title:e,initValue:e,className:"edui-for-insertcode",indexByValue:function(a){if(a)for(var b=0,c;c=this.items[b];b++)if(-1!=c.value.indexOf(a))return b;return-1}});a.buttons.insertcode=f;b.addListener("selectionchange",function(a,c,d){d||(-1==b.queryCommandState("insertcode")?f.setDisabled(!0):(f.setDisabled(!1),(a=b.queryCommandValue("insertcode"))?(a&&(a=a.replace(/['"]/g,"").split(",")[0]),f.setValue(a)):f.setValue(e)))});return f};
a.fontfamily=function(b,d,e){d=b.options.fontfamily||[];e=b.options.labelMap.fontfamily||b.getLang("labelMap.fontfamily")||"";if(d.length){for(var g=0,f,k=[];f=d[g];g++){var p=b.getLang("fontfamily")[f.name]||"";(function(a,d){k.push({label:a,value:d,theme:b.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="font-family:'+c.unhtml(this.value)+'">'+(this.label||"")+"</div>"}})})(f.label||p,f.val)}var q=new a.Combox({editor:b,items:k,onselect:function(a,c){b.execCommand("FontFamily",
this.items[c].value)},onbuttonclick:function(){this.showPopup()},title:e,initValue:e,className:"edui-for-fontfamily",indexByValue:function(a){if(a)for(var b=0,c;c=this.items[b];b++)if(-1!=c.value.indexOf(a))return b;return-1}});a.buttons.fontfamily=q;b.addListener("selectionchange",function(a,c,d){d||(-1==b.queryCommandState("FontFamily")?q.setDisabled(!0):(q.setDisabled(!1),(a=b.queryCommandValue("FontFamily"))&&(a=a.replace(/['"]/g,"").split(",")[0]),q.setValue(a)))});return q}};a.fontsize=function(b,
c,d){d=b.options.labelMap.fontsize||b.getLang("labelMap.fontsize")||"";c=c||b.options.fontsize||[];if(c.length){for(var e=[],g=0;g<c.length;g++){var f=c[g]+"px";e.push({label:f,value:f,theme:b.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label" style="line-height:1;font-size:'+this.value+'">'+(this.label||"")+"</div>"}})}var k=new a.Combox({editor:b,items:e,title:d,initValue:d,onselect:function(a,c){b.execCommand("FontSize",this.items[c].value)},onbuttonclick:function(){this.showPopup()},
className:"edui-for-fontsize"});a.buttons.fontsize=k;b.addListener("selectionchange",function(a,c,d){d||(-1==b.queryCommandState("FontSize")?k.setDisabled(!0):(k.setDisabled(!1),k.setValue(b.queryCommandValue("FontSize"))))});return k}};a.paragraph=function(b,d,e){e=b.options.labelMap.paragraph||b.getLang("labelMap.paragraph")||"";d=b.options.paragraph||[];if(!c.isEmptyObject(d)){var g=[],f;for(f in d)g.push({value:f,label:d[f]||b.getLang("paragraph")[f],theme:b.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><span class="edui-for-'+
this.value+'">'+(this.label||"")+"</span></div>"}});var k=new a.Combox({editor:b,items:g,title:e,initValue:e,className:"edui-for-paragraph",onselect:function(a,c){b.execCommand("Paragraph",this.items[c].value)},onbuttonclick:function(){this.showPopup()}});a.buttons.paragraph=k;b.addListener("selectionchange",function(a,c,d){d||(-1==b.queryCommandState("Paragraph")?k.setDisabled(!0):(k.setDisabled(!1),a=b.queryCommandValue("Paragraph"),-1!=k.indexByValue(a)?k.setValue(a):k.setValue(k.initValue)))});
return k}};a.customstyle=function(b){var c=b.options.customstyle||[],d=b.options.labelMap.customstyle||b.getLang("labelMap.customstyle")||"";if(c.length){for(var e=b.getLang("customstyle"),g=0,f=[],k;k=c[g++];)(function(a){var c={};c.label=a.label?a.label:e[a.name];c.style=a.style;c.className=a.className;c.tag=a.tag;f.push({label:c.label,value:c,theme:b.options.theme,renderLabelHtml:function(){return'<div class="edui-label %%-label"><'+c.tag+" "+(c.className?' class="'+c.className+'"':"")+(c.style?
' style="'+c.style+'"':"")+">"+c.label+"</"+c.tag+"></div>"}})})(k);var h=new a.Combox({editor:b,items:f,title:d,initValue:d,className:"edui-for-customstyle",onselect:function(a,c){b.execCommand("customstyle",this.items[c].value)},onbuttonclick:function(){this.showPopup()},indexByValue:function(a){for(var b=0,c;c=this.items[b++];)if(c.label==a)return b-1;return-1}});a.buttons.customstyle=h;b.addListener("selectionchange",function(a,c,d){d||(-1==b.queryCommandState("customstyle")?h.setDisabled(!0):
(h.setDisabled(!1),a=b.queryCommandValue("customstyle"),-1!=h.indexByValue(a)?h.setValue(a):h.setValue(h.initValue)))});return h}};a.inserttable=function(b,c,d){d=b.options.labelMap.inserttable||b.getLang("labelMap.inserttable")||"";var e=new a.TableButton({editor:b,title:d,className:"edui-for-inserttable",onpicktable:function(a,c,d){b.execCommand("InsertTable",{numRows:d,numCols:c,border:1})},onbuttonclick:function(){this.showPopup()}});a.buttons.inserttable=e;b.addListener("selectionchange",function(){e.setDisabled(-1==
b.queryCommandState("inserttable"))});return e};a.lineheight=function(b){var c=b.options.lineheight||[];if(c.length){for(var d=0,e,g=[];e=c[d++];)g.push({label:e,value:e,theme:b.options.theme,onclick:function(){b.execCommand("lineheight",this.value)}});var f=new a.MenuButton({editor:b,className:"edui-for-lineheight",title:b.options.labelMap.lineheight||b.getLang("labelMap.lineheight")||"",items:g,onbuttonclick:function(){var a=b.queryCommandValue("LineHeight")||this.value;b.execCommand("LineHeight",
a)}});a.buttons.lineheight=f;b.addListener("selectionchange",function(){var a=b.queryCommandState("LineHeight");if(-1==a)f.setDisabled(!0);else{f.setDisabled(!1);var c=b.queryCommandValue("LineHeight");c&&f.setValue((c+"").replace(/cm/,""));f.setChecked(a)}});return f}};k=["top","bottom"];for(b=0;g=k[b++];)(function(b){a["rowspacing"+b]=function(c){var d=c.options["rowspacing"+b]||[];if(!d.length)return null;for(var e=0,g,f=[];g=d[e++];)f.push({label:g,value:g,theme:c.options.theme,onclick:function(){c.execCommand("rowspacing",
this.value,b)}});var k=new a.MenuButton({editor:c,className:"edui-for-rowspacing"+b,title:c.options.labelMap["rowspacing"+b]||c.getLang("labelMap.rowspacing"+b)||"",items:f,onbuttonclick:function(){var a=c.queryCommandValue("rowspacing",b)||this.value;c.execCommand("rowspacing",a,b)}});a.buttons[b]=k;c.addListener("selectionchange",function(){var a=c.queryCommandState("rowspacing",b);if(-1==a)k.setDisabled(!0);else{k.setDisabled(!1);var d=c.queryCommandValue("rowspacing",b);d&&k.setValue((d+"").replace(/%/,
""));k.setChecked(a)}});return k}})(g);k=["insertorderedlist","insertunorderedlist"];for(b=0;g=k[b++];)(function(b){a[b]=function(c){var d=c.options[b],e=function(){c.execCommand(b,this.value)},g=[],f;for(f in d)g.push({label:d[f]||c.getLang()[b][f]||"",value:f,theme:c.options.theme,onclick:e});var k=new a.MenuButton({editor:c,className:"edui-for-"+b,title:c.getLang("labelMap."+b)||"",items:g,onbuttonclick:function(){var a=c.queryCommandValue(b)||this.value;c.execCommand(b,a)}});a.buttons[b]=k;c.addListener("selectionchange",
function(){var a=c.queryCommandState(b);if(-1==a)k.setDisabled(!0);else{k.setDisabled(!1);var d=c.queryCommandValue(b);k.setValue(d);k.setChecked(a)}});return k}})(g);a.fullscreen=function(b,c){c=b.options.labelMap.fullscreen||b.getLang("labelMap.fullscreen")||"";var d=new a.Button({className:"edui-for-fullscreen",title:c,theme:b.options.theme,onclick:function(){b.ui&&b.ui.setFullScreen(!b.ui.isFullScreen());this.setChecked(b.ui.isFullScreen())}});a.buttons.fullscreen=d;b.addListener("selectionchange",
function(){var a=b.queryCommandState("fullscreen");d.setDisabled(-1==a);d.setChecked(b.ui.isFullScreen())});return d};a.emotion=function(b,c){var e=new a.MultiMenuPop({title:b.options.labelMap.emotion||b.getLang("labelMap.emotion")||"",editor:b,className:"edui-for-emotion",iframeUrl:b.ui.mapUrl(c||(b.options.iframeUrlMap||{}).emotion||d.emotion)});a.buttons.emotion=e;b.addListener("selectionchange",function(){e.setDisabled(-1==b.queryCommandState("emotion"))});return e};a.autotypeset=function(b){var c=
new a.AutoTypeSetButton({editor:b,title:b.options.labelMap.autotypeset||b.getLang("labelMap.autotypeset")||"",className:"edui-for-autotypeset",onbuttonclick:function(){b.execCommand("autotypeset")}});a.buttons.autotypeset=c;b.addListener("selectionchange",function(){c.setDisabled(-1==b.queryCommandState("autotypeset"))});return c}})();(function(){function c(a){this.initOptions(a);this.initEditorUI()}var a=s.editor.utils,e=s.editor.ui.uiUtils,d=s.editor.ui.UIBase,b=s.editor.dom.domUtils,g=[];c.prototype=
{uiName:"editor",initEditorUI:function(){function a(b,c){b.setOpt({wordCount:!0,maximumWords:1E4,wordCountMsg:b.options.wordCountMsg||b.getLang("wordCountMsg"),wordOverFlowMsg:b.options.wordOverFlowMsg||b.getLang("wordOverFlowMsg")});var d=b.options,e=d.maximumWords,g=d.wordCountMsg,f=d.wordOverFlowMsg,k=c.getDom("wordcount");d.wordCount&&(d=b.getContentLength(!0),d>e?(k.innerHTML=f,b.fireEvent("wordcountoverflow")):k.innerHTML=g.replace("{#leave}",e-d).replace("{#count}",d))}this.editor.ui=this;
this._dialogs={};this.initUIBase();this._initToolbars();var c=this.editor,d=this;c.addListener("ready",function(){c.getDialog=function(a){return c.ui._dialogs[a+"Dialog"]};b.on(c.window,"scroll",function(a){s.editor.ui.Popup.postHide(a)});c.ui._actualFrameWidth=c.options.initialFrameWidth;UE.browser.ie&&6===UE.browser.version&&c.container.ownerDocument.execCommand("BackgroundImageCache",!1,!0);c.options.elementPathEnabled&&(c.ui.getDom("elementpath").innerHTML='<div class="edui-editor-breadcrumb">'+
c.getLang("elementPathTip")+":</div>");c.options.wordCount&&(b.on(c.document,"click",function(){a(c,d);b.un(c.document,"click",arguments.callee)}),c.ui.getDom("wordcount").innerHTML=c.getLang("wordCountTip"));c.ui._scale();c.options.scaleEnabled?(c.autoHeightEnabled&&c.disableAutoHeight(),d.enableScale()):d.disableScale();c.options.elementPathEnabled||(c.options.wordCount||c.options.scaleEnabled)||(c.ui.getDom("elementpath").style.display="none",c.ui.getDom("wordcount").style.display="none",c.ui.getDom("scale").style.display=
"none");c.selection.isFocus()&&c.fireEvent("selectionchange",!1,!0)});c.addListener("mousedown",function(a,b){s.editor.ui.Popup.postHide(b,b.target||b.srcElement);s.editor.ui.ShortCutMenu.postHide(b)});c.addListener("delcells",function(){UE.ui.edittip&&new UE.ui.edittip(c);c.getDialog("edittip").open()});var e,g=!1,f;c.addListener("afterpaste",function(){c.queryCommandState("pasteplain")||(s.editor.ui.PastePicker&&(e=new s.editor.ui.Popup({content:new s.editor.ui.PastePicker({editor:c}),editor:c,
className:"edui-wordpastepop"}),e.render()),g=!0)});c.addListener("afterinserthtml",function(){clearTimeout(f);f=setTimeout(function(){if(e&&(g||c.ui._isTransfer)){if(e.isHidden()){var a=b.createElement(c.document,"span",{style:"line-height:0px;",innerHTML:"\ufeff"});c.selection.getRange().insertNode(a);var d=Y(a,"firstChild","previousSibling");e.showAnchor(3==d.nodeType?d.parentNode:d);b.remove(a)}else e.show();delete c.ui._isTransfer;g=!1}},200)});c.addListener("contextmenu",function(a,b){s.editor.ui.Popup.postHide(b)});
c.addListener("keydown",function(a,b){e&&e.dispose(b);var c=b.keyCode||b.which;if(b.altKey&&90==c)UE.ui.buttons.fullscreen.onclick()});c.addListener("wordcount",function(b){a(this,d)});c.addListener("selectionchange",function(){if(c.options.elementPathEnabled)d[(-1==c.queryCommandState("elementpath")?"dis":"en")+"ableElementPath"]();if(c.options.scaleEnabled)d[(-1==c.queryCommandState("scale")?"dis":"en")+"ableScale"]()});var h=new s.editor.ui.Popup({editor:c,content:"",className:"edui-bubble",_onEditButtonClick:function(){this.hide();
c.ui._dialogs.linkDialog.open()},_onImgEditButtonClick:function(a){this.hide();c.ui._dialogs[a]&&c.ui._dialogs[a].open()},_onImgSetFloat:function(a){this.hide();c.execCommand("imagefloat",a)},_setIframeAlign:function(a){var c=h.anchorEl,d=c.cloneNode(!0);switch(a){case -2:d.setAttribute("align","");break;case -1:d.setAttribute("align","left");break;case 1:d.setAttribute("align","right")}c.parentNode.insertBefore(d,c);b.remove(c);h.anchorEl=d;h.showAnchor(h.anchorEl)},_updateIframe:function(){var a=
c._iframe=h.anchorEl;b.hasClass(a,"ueditor_baidumap")?(c.selection.getRange().selectNode(a).select(),c.ui._dialogs.mapDialog.open()):c.ui._dialogs.insertframeDialog.open();h.hide()},_onRemoveButtonClick:function(a){c.execCommand(a);this.hide()},queryAutoHide:function(a){return a&&a.ownerDocument==c.document&&("img"==a.tagName.toLowerCase()||b.findParentByTagName(a,"a",!0))?a!==h.anchorEl:s.editor.ui.Popup.prototype.queryAutoHide.call(this,a)}});h.render();c.options.imagePopup&&(c.addListener("mouseover",
function(a,b){b=b||window.event;var d=b.target||b.srcElement;if(c.ui._dialogs.insertframeDialog&&/iframe/ig.test(d.tagName)){var e=h.formatHtml("<nobr>"+c.getLang("property")+': <span onclick=$$._setIframeAlign(-2) class="edui-clickable">'+c.getLang("default")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(-1) class="edui-clickable">'+c.getLang("justifyleft")+'</span>&nbsp;&nbsp;<span onclick=$$._setIframeAlign(1) class="edui-clickable">'+c.getLang("justifyright")+'</span>&nbsp;&nbsp; <span onclick="$$._updateIframe( this);" class="edui-clickable">'+
c.getLang("modify")+"</span></nobr>");e?(h.getDom("content").innerHTML=e,h.anchorEl=d,h.showAnchor(h.anchorEl)):h.hide()}}),c.addListener("selectionchange",function(a,b){if(b){var d="",e="",g=c.selection.getRange().getClosedNode(),e=c.ui._dialogs;if(g&&"IMG"==g.tagName){var f="insertimageDialog";-1!=g.className.indexOf("edui-faked-video")&&(f="insertvideoDialog");-1!=g.className.indexOf("edui-faked-webapp")&&(f="webappDialog");-1!=g.src.indexOf("http://api.map.baidu.com")&&(f="mapDialog");-1!=g.className.indexOf("edui-faked-music")&&
(f="musicDialog");-1!=g.src.indexOf("http://maps.google.com/maps/api/staticmap")&&(f="gmapDialog");g.getAttribute("anchorname")&&(f="anchorDialog",d=h.formatHtml("<nobr>"+c.getLang("property")+': <span onclick=$$._onImgEditButtonClick("anchorDialog") class="edui-clickable">'+c.getLang("modify")+"</span>&nbsp;&nbsp;<span onclick=$$._onRemoveButtonClick('anchor') class=\"edui-clickable\">"+c.getLang("delete")+"</span></nobr>"));g.getAttribute("word_img")&&(c.word_img=[g.getAttribute("word_img")],f=
"wordimageDialog");if(!e[f])return;e="<nobr>"+c.getLang("property")+': <span onclick=$$._onImgSetFloat("none") class="edui-clickable">'+c.getLang("default")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("left") class="edui-clickable">'+c.getLang("justifyleft")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("right") class="edui-clickable">'+c.getLang("justifyright")+'</span>&nbsp;&nbsp;<span onclick=$$._onImgSetFloat("center") class="edui-clickable">'+c.getLang("justifycenter")+"</span>&nbsp;&nbsp;<span onclick=\"$$._onImgEditButtonClick('"+
f+'\');" class="edui-clickable">'+c.getLang("modify")+"</span></nobr>";!d&&(d=h.formatHtml(e))}if(c.ui._dialogs.linkDialog){var k=c.queryCommandValue("link"),n;k&&(n=k.getAttribute("_href")||k.getAttribute("href",2))&&(e=n,30<n.length&&(e=n.substring(0,20)+"..."),d&&(d+='<div style="height:5px;"></div>'),d+=h.formatHtml("<nobr>"+c.getLang("anthorMsg")+': <a target="_blank" href="'+n+'" title="'+n+'" >'+e+'</a> <span class="edui-clickable" onclick="$$._onEditButtonClick();">'+c.getLang("modify")+'</span> <span class="edui-clickable" onclick="$$._onRemoveButtonClick(\'unlink\');"> '+
c.getLang("clear")+"</span></nobr>"),h.showAnchor(k))}d?(h.getDom("content").innerHTML=d,h.anchorEl=g||k,h.showAnchor(h.anchorEl)):h.hide()}}))},_initToolbars:function(){for(var a=this.editor,b=this.toolbars||[],c=[],d=0;d<b.length;d++){for(var e=b[d],g=new s.editor.ui.Toolbar({theme:a.options.theme}),f=0;f<e.length;f++){var h=e[f],p=null;if("string"==typeof h){if(h=h.toLowerCase(),"|"==h&&(h="Separator"),"||"==h&&(h="Breakline"),s.editor.ui[h]&&(p=new s.editor.ui[h](a)),"fullscreen"==h){c&&c[0]?
c[0].items.splice(0,0,p):p&&g.items.splice(0,0,p);continue}}else p=h;p&&p.id&&g.add(p)}c[d]=g}this.toolbars=c},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><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 a=[],b=0;b<this.toolbars.length;b++)a.push(this.toolbars[b].renderHtml());return a.join("")},setFullScreen:function(a){var b=this.editor,c=b.container.parentNode.parentNode;if(this._fullscreen!=a){this._fullscreen=a;this.editor.fireEvent("beforefullscreenchange",a);if(s.editor.browser.gecko)var d=b.selection.getRange().createBookmark();if(a){for(;"BODY"!=c.tagName;){var e=s.editor.dom.domUtils.getComputedStyle(c,
"position");g.push(e);c.style.position="static";c=c.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=b.iframe.parentNode.offsetWidth;this._bakAutoHeight&&(b.autoHeightEnabled=!1,this.editor.disableAutoHeight());document.documentElement.style.overflow="hidden";
document.body.style.overflow="hidden";this._bakCssText=this.getDom().style.cssText;this._bakCssText1=this.getDom("iframeholder").style.cssText;b.iframe.parentNode.style.width="";this._updateFullScreen()}else{for(;"BODY"!=c.tagName;)c.style.position=g.shift(),c=c.parentNode;this.getDom().style.cssText=this._bakCssText;this.getDom("iframeholder").style.cssText=this._bakCssText1;this._bakAutoHeight&&(b.autoHeightEnabled=!0,this.editor.enableAutoHeight());document.documentElement.style.overflow=this._bakHtmlOverflow;
document.body.style.overflow=this._bakBodyOverflow;b.iframe.parentNode.style.width=this._bakEditorContaninerWidth+"px";window.scrollTo(0,this._bakScrollTop)}if(q.gecko&&"true"===b.body.contentEditable){var f=document.createElement("input");document.body.appendChild(f);b.body.contentEditable=!1;setTimeout(function(){f.focus();setTimeout(function(){b.body.contentEditable=!0;b.fireEvent("fullscreenchanged",a);b.selection.getRange().moveToBookmark(d).select(!0);s.editor.dom.domUtils.remove(f);a&&window.scroll(0,
0)},0)},0)}"true"===b.body.contentEditable&&(this.editor.fireEvent("fullscreenchanged",a),this.triggerLayout())}},_updateFullScreen:function(){if(this._fullscreen){var a=e.getViewportRect();this.getDom().style.cssText="border:0;position:absolute;left:0;top:"+(this.editor.options.topOffset||0)+"px;width:"+a.width+"px;height:"+a.height+"px;z-index:"+(1*this.getDom().style.zIndex+100);e.setViewportOffset(this.getDom(),{left:0,top:this.editor.options.topOffset||0});this.editor.setHeight(a.height-this.getDom("toolbarbox").offsetHeight-
this.getDom("bottombar").offsetHeight-(this.editor.options.topOffset||0));if(q.gecko)try{window.onresize()}catch(b){}}},_updateElementPath:function(){var a=this.getDom("elementpath"),b;if(this.elementPathEnabled&&(b=this.editor.queryCommandValue("elementpath"))){for(var c=[],d=0,e;e=b[d];d++)c[d]=this.formatHtml('<span unselectable="on" onclick="$$.editor.execCommand(&quot;elementpath&quot;, &quot;'+d+'&quot;);">'+e+"</span>");a.innerHTML='<div class="edui-editor-breadcrumb" onmousedown="return false;">'+
this.editor.getLang("elementPathTip")+": "+c.join(" &gt; ")+"</div>"}else a.style.display="none"},disableElementPath:function(){var a=this.getDom("elementpath");a.innerHTML="";a.style.display="none";this.elementPathEnabled=!1},enableElementPath:function(){this.getDom("elementpath").style.display="";this.elementPathEnabled=!0;this._updateElementPath()},_scale:function(){function a(){I=b.getXY(h);H||(H=f.options.minFrameHeight+s.offsetHeight+v.offsetHeight);C.style.cssText="position:absolute;left:0;display:;top:0;background-color:#41ABFF;opacity:0.4;filter: Alpha(opacity=40);width:"+
h.offsetWidth+"px;height:"+h.offsetHeight+"px;z-index:"+(f.options.zIndex+1);b.on(g,"mousemove",c);b.on(p,"mouseup",d);b.on(g,"mouseup",d)}function c(a){e();a=a||window.event;O=a.pageX||g.documentElement.scrollLeft+a.clientX;z=a.pageY||g.documentElement.scrollTop+a.clientY;E=O-I.x;B=z-I.y;E>=L&&(K=!0,C.style.width=E+"px");B>=H&&(K=!0,C.style.height=B+"px")}function d(){K&&(K=!1,f.ui._actualFrameWidth=C.offsetWidth-2,h.style.width=f.ui._actualFrameWidth+"px",f.setHeight(C.offsetHeight-v.offsetHeight-
s.offsetHeight-2));C&&(C.style.display="none");e();b.un(g,"mousemove",c);b.un(p,"mouseup",d);b.un(g,"mouseup",d)}function e(){q.ie?g.selection.clear():window.getSelection().removeAllRanges()}var g=document,f=this.editor,h=f.container,p=f.document,s=this.getDom("toolbarbox"),v=this.getDom("bottombar"),F=this.getDom("scale"),C=this.getDom("scalelayer"),K=!1,I=null,H=0,L=f.options.minFrameWidth,O=0,z=0,E=0,B=0,A=this;this.editor.addListener("fullscreenchanged",function(a,c){if(c)A.disableScale();else if(A.editor.options.scaleEnabled){A.enableScale();
var d=A.editor.document.createElement("span");A.editor.body.appendChild(d);A.editor.body.style.height=Math.max(b.getXY(d).y,A.editor.iframe.offsetHeight-20)+"px";b.remove(d)}});this.enableScale=function(){1!=f.queryCommandState("source")&&(F.style.display="",this.scaleEnabled=!0,b.on(F,"mousedown",a))};this.disableScale=function(){F.style.display="none";this.scaleEnabled=!1;b.un(F,"mousedown",a)}},isFullScreen:function(){return this._fullscreen},postRender:function(){d.prototype.postRender.call(this);
for(var a=0;a<this.toolbars.length;a++)this.toolbars[a].postRender();var b=this,c,e=s.editor.dom.domUtils,g=function(){clearTimeout(c);c=setTimeout(function(){b._updateFullScreen()})};e.on(window,"resize",g);b.addListener("destroy",function(){e.un(window,"resize",g);clearTimeout(c)})},showToolbarMsg:function(a,b){this.getDom("toolbarmsg_label").innerHTML=a;this.getDom("toolbarmsg").style.display="";b||(this.getDom("upload_dialog").style.display="none")},hideToolbarMsg:function(){this.getDom("toolbarmsg").style.display=
"none"},mapUrl:function(a){return a?a.replace("~/",this.editor.options.UEDITOR_HOME_URL||""):""},triggerLayout:function(){var a=this.getDom();a.style.zoom="1"==a.style.zoom?"100%":"1"}};a.inherits(c,s.editor.ui.UIBase);var f={};UE.ui.Editor=function(d){var e=new UE.Editor(d);e.options.editor=e;a.loadFile(document,{href:e.options.themePath+e.options.theme+"/css/ueditor.css",tag:"link",type:"text/css",rel:"stylesheet"});var g=e.render;e.render=function(d){d.constructor===String&&(e.key=d,f[d]=e);a.domReady(function(){function a(){e.setOpt({labelMap:e.options.labelMap||
e.getLang("labelMap")});new c(e.options);if(d&&(d.constructor===String&&(d=document.getElementById(d)),d&&d.getAttribute("name")&&(e.options.textarea=d.getAttribute("name")),d&&/script|textarea/ig.test(d.tagName))){var f=document.createElement("div");d.parentNode.insertBefore(f,d);var k=d.value||d.innerHTML;e.options.initialContent=/^[\t\r\n ]*$/.test(k)?e.options.initialContent:k.replace(/>[\n\r\t]+([ ]{4})+/g,">").replace(/[\n\r\t]+([ ]{4})+</g,"<").replace(/>[\n\r\t]+</g,"><");d.className&&(f.className=
d.className);d.style.cssText&&(f.style.cssText=d.style.cssText);/textarea/i.test(d.tagName)?(e.textarea=d,e.textarea.style.display="none"):(d.parentNode.removeChild(d),d.id&&(f.id=d.id));d=f;d.innerHTML=""}b.addClass(d,"edui-"+e.options.theme);e.ui.render(d);f=e.options;e.container=e.ui.getDom();for(var k=b.findParents(d,!0),p=[],r=0,q;q=k[r];r++)p[r]=q.style.display,q.style.display="block";f.minFrameWidth=f.initialFrameWidth?f.initialFrameWidth:f.initialFrameWidth=d.offsetWidth;f.initialFrameHeight?
f.minFrameHeight=f.initialFrameHeight:f.initialFrameHeight=f.minFrameHeight=d.offsetHeight;for(r=0;q=k[r];r++)q.style.display=p[r];d.style.height&&(d.style.height="");e.container.style.width=f.initialFrameWidth+(/%$/.test(f.initialFrameWidth)?"":"px");e.container.style.zIndex=f.zIndex;g.call(e,e.ui.getDom("iframeholder"));e.fireEvent("afteruiready")}e.langIsReady?a():e.addListener("langReady",a)})};return e};UE.getEditor=function(a,b){var c=f[a];c||(c=f[a]=new UE.ui.Editor(b),c.render(a));return c};
UE.delEditor=function(a){var b;if(b=f[a])b.key&&b.destroy(),delete f[a]}})();(function(){var c=s.editor.utils,a=s.editor.ui.Popup,e=s.editor.ui.SplitButton,d=s.editor.ui.MultiMenuPop=function(a){this.initOptions(a);this.initMultiMenu()};d.prototype={initMultiMenu:function(){var b=this;this.popup=new a({content:"",editor:b.editor,iframe_rendered:!1,onshow:function(){this.iframe_rendered||(this.iframe_rendered=!0,this.getDom("content").innerHTML='<iframe id="'+b.id+'_iframe" src="'+b.iframeUrl+'" frameborder="0"></iframe>',
b.editor.container.style.zIndex&&(this.getDom().style.zIndex=1*b.editor.container.style.zIndex+1))}});this.onbuttonclick=function(){this.showPopup()};this.initSplitButton()}};c.inherits(d,e)})();(function(){function c(a){if(!g.findParent(a.target||a.srcElement,function(a){return g.hasClass(a,"edui-shortcutmenu")||g.hasClass(a,"edui-popup")},!0)){a=0;for(var b;b=f[a++];)b.hide()}}var a=s.editor.ui,e=a.UIBase,d=a.uiUtils,b=s.editor.utils,g=s.editor.dom.domUtils,f=[],k,l=!1,m=a.ShortCutMenu=function(a){this.initOptions(a);
this.initShortCutMenu()};m.postHide=c;m.prototype={isHidden:!0,SPACE:5,initShortCutMenu:function(){this.items=this.items||[];this.initUIBase();this.initItems();this.initEvent();f.push(this)},initEvent:function(){var a=this,b=a.editor.document;g.on(b,"mousemove",function(b){if(!1===a.isHidden&&!a.getSubMenuMark()&&"contextmenu"!=a.eventType){var c=!0,d=a.getDom(),e=d.offsetWidth/2+a.SPACE,g=d.offsetHeight/2,f=Math.abs(b.screenX-a.left),h=Math.abs(b.screenY-a.top);clearTimeout(k);k=setTimeout(function(){0<
h&&h<g?a.setOpacity(d,"1"):h>g&&h<g+70?(a.setOpacity(d,"0.5"),c=!1):h>g+70&&h<g+140&&a.hide();c&&0<f&&f<e?a.setOpacity(d,"1"):f>e&&f<e+70?a.setOpacity(d,"0.5"):f>e+70&&f<e+140&&a.hide()})}});if(q.chrome)g.on(b,"mouseout",function(b){b=b.relatedTarget||b.toElement;null!=b&&"HTML"!=b.tagName||a.hide()});a.editor.addListener("afterhidepop",function(){a.isHidden||(l=!0)})},initItems:function(){if(b.isArray(this.items))for(var c=0,d=this.items.length;c<d;c++){var e=this.items[c].toLowerCase();a[e]&&(this.items[c]=
new a[e](this.editor),this.items[c].className+=" edui-shortcutsubmenu ")}},setOpacity:function(a,b){q.ie&&9>q.version?a.style.filter="alpha(opacity = "+100*parseFloat(b)+");":a.style.opacity=b},getSubMenuMark:function(){l=!1;for(var a=d.getFixedLayer(),a=g.getElementsByTagName(a,"div",function(a){return g.hasClass(a,"edui-shortcutsubmenu edui-popup")}),b=0,c;c=a[b++];)"none"!=c.style.display&&(l=!0);return l},show:function(a,b){function c(a){0>a.left&&(a.left=0);0>a.top&&(a.top=0);h.style.cssText=
"position:absolute;left:"+a.left+"px;top:"+a.top+"px;"}function e(a){a.tagName||(a=a.getDom());f.left=parseInt(a.style.left);f.top=parseInt(a.style.top);f.top-=h.offsetHeight+15;c(f)}var f={},h=this.getDom(),k=d.getFixedLayer();this.eventType=a.type;h.style.cssText="display:block;left:-9999px";if("contextmenu"==a.type&&b){var l=g.getElementsByTagName(k,"div","edui-contextmenu")[0];l?e(l):this.editor.addListener("aftershowcontextmenu",function(a,b){e(b)})}else f=d.getViewportOffsetByEvent(a),f.top-=
h.offsetHeight+this.SPACE,f.left+=this.SPACE+20,c(f),this.setOpacity(h,0.2);this.isHidden=!1;this.left=a.screenX+h.offsetWidth/2-this.SPACE;this.top=a.screenY-h.offsetHeight/2-this.SPACE;this.editor&&(h.style.zIndex=1*this.editor.container.style.zIndex+10,k.style.zIndex=h.style.zIndex-1)},hide:function(){this.getDom()&&(this.getDom().style.display="none");this.isHidden=!0},postRender:function(){if(b.isArray(this.items))for(var a=0,c;c=this.items[a++];)c.postRender()},getHtmlTpl:function(){var a;if(b.isArray(this.items)){a=
[];for(var c=0;c<this.items.length;c++)a[c]=this.items[c].renderHtml();a=a.join("")}else a=this.items;return'<div id="##" class="%% edui-toolbar" data-src="shortcutmenu" onmousedown="return false;" onselectstart="return false;" >'+a+"</div>"}};b.inherits(m,e);g.on(document,"mousedown",function(a){c(a)});g.on(window,"scroll",function(a){c(a)})})();(function(){var c=s.editor.utils,a=s.editor.ui.UIBase,e=s.editor.ui.Breakline=function(a){this.initOptions(a);this.initSeparator()};e.prototype={uiName:"Breakline",
initSeparator:function(){this.initUIBase()},getHtmlTpl:function(){return"<br/>"}};c.inherits(e,a)})()})();