(function(d,f){function m(a){if(!a)return false;return Object.prototype.toString.call(a)==="[object Array]"}function s(a){if(!a)return false;return Object.prototype.toString.call(a)==="[object Function]"}function k(a,b){for(var c=0,e=b.length;c<e;c++)if(a===b[c])return c;return-1}function n(a,b){if(m(a))for(var c=0,e=a.length;c<e;c++){if(b.call(a[c],c,a[c])===false)break}else for(c in a)if(a.hasOwnProperty(c))if(b.call(a[c],c,a[c])===false)break}function t(a){return a.replace(/(?:^[ \t\n\r]+)|(?:[ \t\n\r]+$)/g,
"")}function p(a,b,c){c=c===f?",":c;return(c+b+c).indexOf(c+a+c)>=0}function r(a,b){b=b||"px";return a&&/^-?\d+(?:\.\d+)?$/.test(a)?a+b:a}function q(a){var b;return a&&(b=/(\d+)/.exec(a))?parseInt(b[1],10):0}function u(a){return a.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;")}function B(a){return a.replace(/&lt;/g,"<").replace(/&gt;/g,">").replace(/&quot;/g,'"').replace(/&amp;/g,"&")}function C(a){var b=a.split("-");a="";n(b,function(c,e){a+=c>0?e.charAt(0).toUpperCase()+
e.substr(1):e});return a}function v(a){function b(c){c=parseInt(c,10).toString(16).toUpperCase();return c.length>1?c:"0"+c}return a.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,function(c,e,g,h){return"#"+b(e)+b(g)+b(h)})}function G(a,b){b=b===f?",":b;var c={};a=m(a)?a:a.split(b);var e;n(a,function(g,h){if(e=/^(\d+)\.\.(\d+)$/.exec(h))for(g=parseInt(e[1],10);g<=parseInt(e[2],10);g++)c[g.toString()]=true;else c[h]=true});return c}function N(a,b){return Array.prototype.slice.call(a,b||
0)}function D(a,b){return a===f?b:a}function O(a){return!a||/[<>"]/.test(a)}function E(a,b){return a.indexOf("?")>=0?a+"&"+b:a+"?"+b}function H(a,b,c){if(!c){c=b;b=null}var e;if(b){var g=function(){};g.prototype=b.prototype;e=new g;n(c,function(h,i){e[h]=i})}else e=c;e.constructor=a;a.prototype=e;a.parent=b?b.prototype:null}function ea(a){var b;if(b=/\{[\s\S]*\}|\[[\s\S]*\]/.exec(a))a=b[0];b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
b.lastIndex=0;if(b.test(a))a=a.replace(b,function(c){return"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+a+")");throw"JSON parse error";}function I(){for(var a=document.getElementsByTagName("script"),b,c=0,e=a.length;c<e;c++){b=a[c].src||"";if(/kindeditor[\w\-\.]*\.js/.test(b))return b.substring(0,
b.lastIndexOf("/")+1)}return""}function R(){for(var a=document.getElementsByTagName("base"),b=0,c=a.length;b<c;b++){var e=a[b].href;if(e)return e}return""}function L(a,b,c){if(a.addEventListener)a.addEventListener(b,c,Ib);else a.attachEvent&&a.attachEvent("on"+b,c)}function J(a,b,c){if(a.removeEventListener)a.removeEventListener(b,c,Ib);else a.detachEvent&&a.detachEvent("on"+b,c)}function M(a,b){this.init(a,b)}function T(a){return a[eb]||null}function Y(a){a[eb]=++Jb;return Jb}function Z(a){try{delete a[eb]}catch(b){a.removeAttribute&&
a.removeAttribute(eb)}}function U(a,b,c){if(b.indexOf(",")>=0)n(b.split(","),function(){U(a,this,c)});else{var e=T(a);e||(e=Y(a));if(oa[e]===f)oa[e]={};var g=oa[e][b];if(g&&g.length>0)J(a,b,g[0]);else{oa[e][b]=[];oa[e].el=a}g=oa[e][b];if(g.length===0)g[0]=function(h){var i=h?new M(a,h):f;n(g,function(l,o){l>0&&o&&o.call(a,i)})};k(c,g)<0&&g.push(c);L(a,b,g[0])}}function ba(a,b,c){if(b&&b.indexOf(",")>=0)n(b.split(","),function(){ba(a,this,c)});else{var e=T(a);if(e)if(b===f){if(e in oa){n(oa[e],function(i,
l){i!="el"&&l.length>0&&J(a,i,l[0])});delete oa[e];Z(a)}}else if(oa[e]){var g=oa[e][b];if(g&&g.length>0){if(c===f){J(a,b,g[0]);delete oa[e][b]}else{n(g,function(i,l){i>0&&l===c&&g.splice(i,1)});if(g.length==1){J(a,b,g[0]);delete oa[e][b]}}var h=0;n(oa[e],function(){h++});if(h<2){delete oa[e];Z(a)}}}}}function la(a,b){if(b.indexOf(",")>=0)n(b.split(","),function(){la(a,this)});else{var c=T(a);if(c){b=oa[c][b];oa[c]&&b&&b.length>0&&b[0]()}}}function ma(a,b,c){b=/^\d{2,}$/.test(b)?b:b.toUpperCase().charCodeAt(0);
U(a,"keydown",function(e){if(e.ctrlKey&&e.which==b&&!e.shiftKey&&!e.altKey){c.call(a);e.stop()}})}function ua(a){function b(){if(!g){g=true;a(KindEditor);Kb=true}}function c(){if(!g){try{document.documentElement.doScroll("left")}catch(l){setTimeout(c,100);return}b()}}function e(){document.readyState==="complete"&&b()}if(Kb)a(KindEditor);else{var g=false;if(document.addEventListener)U(document,"DOMContentLoaded",b);else if(document.attachEvent){U(document,"readystatechange",e);var h=false;try{h=d.frameElement==
null}catch(i){}document.documentElement.doScroll&&h&&c()}U(d,"load",b)}}function ra(a){for(var b={},c=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g,e;e=c.exec(a);){var g=t(e[1].toLowerCase());e=t(v(e[2]));b[g]=e}return b}function ka(a){for(var b={},c=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,e;e=c.exec(a);){var g=(e[1]||e[2]||e[4]||e[6]).toLowerCase();b[g]=(e[2]?e[3]:e[4]?e[5]:e[7])||""}return b}function fa(a,b){return a=/\s+class\s*=/.test(a)?
a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(c,e,g,h){return(" "+g+" ").indexOf(" "+b+" ")<0?g===""?e+b+h:e+g+" "+b+h:c}):a.substr(0,a.length-1)+' class="'+b+'">'}function ta(a){var b="";n(ra(a),function(c,e){b+=c+":"+e+";"});return b}function Fa(a,b,c,e){function g(o){o=o.split("/");for(var w=[],A=0,z=o.length;A<z;A++){var K=o[A];if(K=="..")w.length>0&&w.pop();else K!==""&&K!="."&&w.push(K)}return"/"+w.join("/")}function h(o,w){if(a.substr(0,o.length)===o){for(var A=[],z=0;z<w;z++)A.push("..");
w=".";if(A.length>0)w+="/"+A.join("/");if(e=="/")w+="/";return w+a.substr(o.length)}else if(l=/^(.*)\//.exec(o))return h(l[1],++w)}b=D(b,"").toLowerCase();if(a.substr(0,5)!="data:")a=a.replace(/([^:])\/\//g,"$1/");if(k(b,["absolute","relative","domain"])<0)return a;c=c||location.protocol+"//"+location.host;if(e===f){var i=location.pathname.match(/^(\/.*)\//);e=i?i[1]:""}var l;if(l=/^(\w+:\/\/[^\/]*)/.exec(a)){if(l[1]!==c)return a}else if(/^\w+:/.test(a))return a;if(/^\//.test(a))a=c+g(a.substr(1));
else/^\w+:\/\//.test(a)||(a=c+g(e+"/"+a));if(b==="relative")a=h(c+e,0).substr(2);else if(b==="absolute")if(a.substr(0,c.length)===c)a=a.substr(c.length);return a}function Aa(a,b,c,e,g){if(a==null)a="";c=c||"";e=D(e,false);g=D(g,"\t");var h="xx-small,x-small,small,medium,large,x-large,xx-large".split(",");a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(o,w,A,z){return w+A.replace(/<(?:br|br\s[^>]*)>/ig,"\n")+z});a=a.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig,"</p>");a=a.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig,
"$1<br />$2");a=a.replace(/\u200B/g,"");a=a.replace(/\u00A9/g,"&copy;");a=a.replace(/\u00AE/g,"&reg;");a=a.replace(/\u2003/g,"&emsp;");a=a.replace(/\u3000/g,"&emsp;");a=a.replace(/<[^>]+/g,function(o){return o.replace(/\s+/g," ")});var i={};if(b){n(b,function(o,w){o=o.split(",");for(var A=0,z=o.length;A<z;A++)i[o[A]]=G(w)});i.script||(a=a.replace(/(<(?:script|script\s[^>]*)>)([\s\S]*?)(<\/script>)/ig,""));i.style||(a=a.replace(/(<(?:style|style\s[^>]*)>)([\s\S]*?)(<\/style>)/ig,""))}var l=[];a=a.replace(/(\s*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>(\s*)/g,
function(o,w,A,z,K,Q,$){w=w||"";A=A||"";var W=z.toLowerCase(),pa=K||"";z=Q?" "+Q:"";$=$||"";if(b&&!i[W])return"";if(z===""&&Lb[W])z=" /";if(Mb[W]){if(w)w=" ";if($)$=" "}if(ob[W])if(A)$="\n";else w="\n";if(e&&W=="br")$="\n";if(Nb[W]&&!ob[W])if(e){A&&l.length>0&&l[l.length-1]===W?l.pop():l.push(W);$=w="\n";K=0;for(Q=A?l.length:l.length-1;K<Q;K++){w+=g;A||($+=g)}if(z)l.pop();else A||($+=g)}else w=$="";if(pa!==""){var F=ka(o);if(W==="font"){var ga={},ca="";n(F,function(V,da){if(V==="color"){ga.color=
da;delete F[V]}if(V==="size"){ga["font-size"]=h[parseInt(da,10)-1]||"";delete F[V]}if(V==="face"){ga["font-family"]=da;delete F[V]}if(V==="style")ca=da});if(ca&&!/;$/.test(ca))ca+=";";n(ga,function(V,da){if(da!==""){if(/\s/.test(da))da="'"+da+"'";ca+=V+":"+da+";"}});F.style=ca}n(F,function(V,da){if(qc[V])F[V]=V;if(k(V,["src","href"])>=0)F[V]=Fa(da,c);if(b&&V!=="style"&&!i[W]["*"]&&!i[W][V]||W==="body"&&V==="contenteditable"||/^kindeditor_\d+$/.test(V))delete F[V];if(V==="style"&&da!==""){var xa=ra(da);
n(xa,function(aa){b&&!i[W].style&&!i[W]["."+aa]&&delete xa[aa]});var S="";n(xa,function(aa,X){S+=aa+":"+X+";"});F.style=S}});pa="";n(F,function(V,da){if(!(V==="style"&&da==="")){da=da.replace(/"/g,"&quot;");pa+=" "+V+'="'+da+'"'}})}if(W==="font")W="span";return w+"<"+A+W+pa+z+">"+$});a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\S]*?)(<\/pre>)/ig,function(o,w,A,z){return w+A.replace(/\n/g,'<span id="__kindeditor_pre_newline__">\n')+z});a=a.replace(/\n\s*\n/g,"\n");a=a.replace(/<span id="__kindeditor_pre_newline__">\n/g,
"\n");return t(a)}function Sa(a,b){a=a.replace(/<meta[\s\S]*?>/ig,"").replace(/<![\s\S]*?>/ig,"").replace(/<style[^>]*>[\s\S]*?<\/style>/ig,"").replace(/<script[^>]*>[\s\S]*?<\/script>/ig,"").replace(/<w:[^>]+>[\s\S]*?<\/w:[^>]+>/ig,"").replace(/<o:[^>]+>[\s\S]*?<\/o:[^>]+>/ig,"").replace(/<xml>[\s\S]*?<\/xml>/ig,"").replace(/<(?:table|td)[^>]*>/ig,function(c){return c.replace(/border-bottom:([#\w\s]+)/ig,"border:$1")});return Aa(a,b)}function Ob(a){if(/\.(rm|rmvb)(\?|$)/i.test(a))return"audio/x-pn-realaudio-plugin";
if(/\.(swf|flv)(\?|$)/i.test(a))return"application/x-shockwave-flash";return"video/x-ms-asf-plugin"}function rc(a){if(/realaudio/i.test(a))return"ke-rm";if(/flash/i.test(a))return"ke-flash";return"ke-media"}function Pb(a){return ka(unescape(a))}function pb(a){var b="<embed ";n(a,function(c,e){b+=c+'="'+e+'" '});b+="/>";return b}function Qb(a,b){var c=b.width,e=b.height,g=b.type||Ob(b.src);b=pb(b);var h="";if(/\D/.test(c))h+="width:"+c+";";else if(c>0)h+="width:"+c+"px;";if(/\D/.test(e))h+="height:"+
e+";";else if(e>0)h+="height:"+e+"px;";a='<img class="'+rc(g)+'" src="'+a+'" ';if(h!=="")a+='style="'+h+'" ';a+='data-ke-tag="'+escape(b)+'" alt="" />';return a}function sc(a,b){a=new Function("obj","var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('"+a.replace(/[\r\t\n]/g," ").split("<%").join("\t").replace(/((^|%>)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');");return b?
a(b):a}function fb(a,b){if(a.nodeType==9&&b.nodeType!=9)return true;for(;b=b.parentNode;)if(b==a)return true;return false}function gb(a,b){b=b.toLowerCase();var c=null;if(!tc&&a.nodeName.toLowerCase()!="script"){var e=a.ownerDocument.createElement("div");e.appendChild(a.cloneNode(false));a=ka(B(e.innerHTML));if(b in a)c=a[b]}else try{c=a.getAttribute(b,2)}catch(g){c=a.getAttribute(b,1)}if(b==="style"&&c!==null)c=ta(c);return c}function hb(a,b){function c(S){if(typeof S!="string")return S;return S.replace(/([^\w\-])/g,
"\\$1")}function e(S){return S.replace(/\\/g,"")}function g(S,aa){return S==="*"||S.toLowerCase()===c(aa.toLowerCase())}function h(S,aa,X){var P=[];(S=(X.ownerDocument||X).getElementById(e(S)))&&g(aa,S.nodeName)&&fb(X,S)&&P.push(S);return P}function i(S,aa,X){var P=X.ownerDocument||X,ia=[],na,ya,za;if(X.getElementsByClassName){P=X.getElementsByClassName(e(S));na=0;for(ya=P.length;na<ya;na++){za=P[na];g(aa,za.nodeName)&&ia.push(za)}}else if(P.querySelectorAll){P=P.querySelectorAll((X.nodeName!=="#document"?
X.nodeName+" ":"")+aa+"."+S);na=0;for(ya=P.length;na<ya;na++){za=P[na];fb(X,za)&&ia.push(za)}}else{P=X.getElementsByTagName(aa);S=" "+S+" ";na=0;for(ya=P.length;na<ya;na++){za=P[na];if(za.nodeType==1)(aa=za.className)&&(" "+aa+" ").indexOf(S)>-1&&ia.push(za)}}return ia}function l(S,aa,X){var P=[];S=(X.ownerDocument||X).getElementsByName(e(S));for(var ia,na=0,ya=S.length;na<ya;na++){ia=S[na];g(aa,ia.nodeName)&&fb(X,ia)&&ia.getAttribute("name")!==null&&P.push(ia)}return P}function o(S,aa,X,P){var ia=
[];X=P.getElementsByTagName(X);for(var na=0,ya=X.length;na<ya;na++){P=X[na];if(P.nodeType==1)if(aa===null)gb(P,S)!==null&&ia.push(P);else aa===c(gb(P,S))&&ia.push(P)}return ia}function w(S,aa){var X=[],P,ia=(P=/^((?:\\.|[^.#\s\[<>])+)/.exec(S))?P[1]:"*";if(P=/#((?:[\w\-]|\\.)+)$/.exec(S))X=h(P[1],ia,aa);else if(P=/\.((?:[\w\-]|\\.)+)$/.exec(S))X=i(P[1],ia,aa);else if(P=/\[((?:[\w\-]|\\.)+)\]/.exec(S))X=o(P[1].toLowerCase(),null,ia,aa);else if(P=/\[((?:[\w\-]|\\.)+)\s*=\s*['"]?((?:\\.|[^'"]+)+)['"]?\]/.exec(S)){X=
P[1].toLowerCase();P=P[2];X=X==="id"?h(P,ia,aa):X==="class"?i(P,ia,aa):X==="name"?l(P,ia,aa):o(X,P,ia,aa)}else{aa=aa.getElementsByTagName(ia);P=0;for(S=aa.length;P<S;P++){ia=aa[P];ia.nodeType==1&&X.push(ia)}}return X}var A=a.split(",");if(A.length>1){var z=[];n(A,function(){n(hb(this,b),function(){k(this,z)<0&&z.push(this)})});return z}b=b||document;A=[];for(var K,Q=/((?:\\.|[^\s>])+|[\s>])/g;K=Q.exec(a);)K[1]!==" "&&A.push(K[1]);a=[];if(A.length==1)return w(A[0],b);K=false;var $,W,pa,F,ga,ca,V,da,
xa;ga=0;for(lenth=A.length;ga<lenth;ga++){Q=A[ga];if(Q===">")K=true;else{if(ga>0){$=[];ca=0;for(da=a.length;ca<da;ca++){pa=a[ca];W=w(Q,pa);V=0;for(xa=W.length;V<xa;V++){F=W[V];if(K)pa===F.parentNode&&$.push(F);else $.push(F)}}a=$}else a=w(Q,b);if(a.length===0)return[]}}return a}function uc(a,b){a=hb(a,b);return a.length>0?a[0]:null}function Ba(a){return j(a)[0]}function La(a){if(!a)return document;return a.ownerDocument||a.document||a}function Ma(a){if(!a)return d;a=La(a);return a.parentWindow||a.defaultView}
function vc(a,b){if(a.nodeType==1){var c=La(a);try{a.innerHTML='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+b;var e=c.getElementById("__kindeditor_temp_tag__");e.parentNode.removeChild(e)}catch(g){j(a).empty();j("@"+b,c).each(function(){a.appendChild(this)})}}}function qb(a,b){return p(b,a.className," ")}function rb(a,b,c){if(ha&&qa<8&&b.toLowerCase()=="class")b="className";a.setAttribute(b,""+c)}function wc(a,b){if(ha&&qa<8&&b.toLowerCase()=="class")b="className";
rb(a,b,"");a.removeAttribute(b)}function Rb(a){if(!a||!a.nodeName)return"";return a.nodeName.toLowerCase()}function xc(a,b){var c=Ma(a),e=C(b),g="";if(c.getComputedStyle){c=c.getComputedStyle(a,null);g=c[e]||c.getPropertyValue(b)||a.style[e]}else if(a.currentStyle)g=a.currentStyle[e]||a.style[e];return g}function Sb(a){return!!yc[Rb(a)]}function va(a){a=a||document;return Ga?a.body:a.documentElement}function Pa(a){a=a||document;var b;if(ha||zc||sb){b=va(a).scrollLeft;a=va(a).scrollTop}else{b=Ma(a).scrollX;
a=Ma(a).scrollY}return{x:b,y:a}}function sa(a){this.init(a)}function Tb(a){a.collapsed=a.startContainer===a.endContainer&&a.startOffset===a.endOffset;return a}function tb(a,b,c){function e(F,ga,ca){var V=F.nodeValue.length,da;if(b){da=F.cloneNode(true);da=ga>0?da.splitText(ga):da;ca<V&&da.splitText(ca-ga)}if(c){var xa=F;if(ga>0){xa=F.splitText(ga);a.setStart(F,ga)}if(ca<V){F=xa.splitText(ca-ga);a.setEnd(F,0)}l.push(xa)}return da}function g(){c&&a.up().collapse(true);for(var F=0,ga=l.length;F<ga;F++){var ca=
l[F];ca.parentNode&&ca.parentNode.removeChild(ca)}}function h(F,ga){F=F.firstChild;for(var ca;F;){ca=(new Ca(i)).selectNode(F);w=ca.compareBoundaryPoints(Ta,a);if(w>=0&&A<=0)A=ca.compareBoundaryPoints(Ua,a);if(A>=0&&z<=0)z=ca.compareBoundaryPoints(Qa,a);if(z>=0&&K<=0)K=ca.compareBoundaryPoints(Va,a);if(K>=0)return false;ca=F.nextSibling;if(w>0)if(F.nodeType==1)if(A>=0&&z<=0){b&&ga.appendChild(F.cloneNode(true));c&&l.push(F)}else{var V;if(b){V=F.cloneNode(false);ga.appendChild(V)}if(h(F,V)===false)return false}else if(F.nodeType==
3){F=F==o.startContainer?e(F,o.startOffset,F.nodeValue.length):F==o.endContainer?e(F,0,o.endOffset):e(F,0,F.nodeValue.length);if(b)try{ga.appendChild(F)}catch(da){}}F=ca}}var i=a.doc,l=[],o=a.cloneRange().down(),w=-1,A=-1,z=-1,K=-1,Q=a.commonAncestor(),$=i.createDocumentFragment();if(Q.nodeType==3){Q=e(Q,a.startOffset,a.endOffset);b&&$.appendChild(Q);g();return b?$:a}h(Q,$);c&&a.up().collapse(true);Q=0;for(var W=l.length;Q<W;Q++){var pa=l[Q];pa.parentNode&&pa.parentNode.removeChild(pa)}return b?$:
a}function Wa(a,b){for(var c=b;c;){var e=j(c);if(e.name=="marquee"||e.name=="select")return;c=c.parentNode}try{a.moveToElementText(b)}catch(g){}}function Ub(a,b){var c=a.parentElement().ownerDocument,e=a.duplicate();e.collapse(b);var g=e.parentElement(),h=g.childNodes;if(h.length===0)return{node:g.parentNode,offset:j(g).index()};b=c;var i=0,l=-1,o=a.duplicate();Wa(o,g);for(var w=0,A=h.length;w<A;w++){var z=h[w];l=o.compareEndPoints("StartToStart",e);if(l===0)return{node:z.parentNode,offset:w};if(z.nodeType==
1){var K=a.duplicate(),Q,$=j(z),W=z;if($.isControl()){Q=c.createElement("span");$.after(Q);W=Q;i+=$.text().replace(/\r\n|\n|\r/g,"").length}Wa(K,W);o.setEndPoint("StartToEnd",K);if(l>0)i+=K.text.replace(/\r\n|\n|\r/g,"").length;else i=0;Q&&j(Q).remove()}else if(z.nodeType==3){o.moveStart("character",z.nodeValue.length);i+=z.nodeValue.length}if(l<0)b=z}if(l<0&&b.nodeType==1)return{node:g,offset:j(g.lastChild).index()+1};if(l>0)for(;b.nextSibling&&b.nodeType==1;)b=b.nextSibling;o=a.duplicate();Wa(o,
g);o.setEndPoint("StartToEnd",e);i-=o.text.replace(/\r\n|\n|\r/g,"").length;if(l>0&&b.nodeType==3)for(a=b.previousSibling;a&&a.nodeType==3;){i-=a.nodeValue.length;a=a.previousSibling}return{node:b,offset:i}}function Vb(a,b){var c=a.ownerDocument||a,e=c.body.createTextRange();if(c==a){e.collapse(true);return e}if(a.nodeType==1&&a.childNodes.length>0){a=a.childNodes;var g,h;if(b===0){h=a[0];g=true}else{h=a[b-1];g=false}if(!h)return e;if(j(h).name==="head"){if(b===1)g=true;if(b===2)g=false;e.collapse(g);
return e}if(h.nodeType==1){b=j(h);var i;if(b.isControl()){i=c.createElement("span");g?b.before(i):b.after(i);h=i}Wa(e,h);e.collapse(g);i&&j(i).remove();return e}a=h;b=g?0:h.nodeValue.length}c=c.createElement("span");j(a).before(c);Wa(e,c);e.moveStart("character",b);j(c).remove();return e}function Wb(a){function b(g){if(j(g.node).name=="tr"){g.node=g.node.cells[g.offset];g.offset=0}}var c;if(wa){if(a.item){c=La(a.item(0));c=new Ca(c);c.selectNode(a.item(0));return c}c=a.parentElement().ownerDocument;
var e=Ub(a,true);a=Ub(a,false);b(e);b(a);c=new Ca(c);c.setStart(e.node,e.offset);c.setEnd(a.node,a.offset);return c}e=a.startContainer;c=e.ownerDocument||e;c=new Ca(c);c.setStart(e,a.startOffset);c.setEnd(a.endContainer,a.endOffset);return c}function Ca(a){this.init(a)}function ub(a){if(!a.nodeName)return a.constructor===Ca?a:Wb(a);return new Ca(a)}function Ha(a,b,c){try{a.execCommand(b,false,c)}catch(e){}}function Xb(a,b){var c="";try{c=a.queryCommandValue(b)}catch(e){}if(typeof c!=="string")c="";
return c}function vb(a){var b=Ma(a);return wa?a.selection:b.getSelection()}function Ac(a){var b=vb(a),c;try{c=b.rangeCount>0?b.getRangeAt(0):b.createRange()}catch(e){}if(wa&&(!c||!c.item&&c.parentElement().ownerDocument!==a))return null;return c}function Yb(a){var b={},c,e;n(a,function(g,h){c=g.split(",");g=0;for(var i=c.length;g<i;g++){e=c[g];b[e]=h}});return b}function wb(a,b){return Zb(a,b,"*")||Zb(a,b)}function Zb(a,b,c){c=c||a.name;if(a.type!==1)return false;b=Yb(b);if(!b[c])return false;c=b[c].split(",");
b=0;for(var e=c.length;b<e;b++){var g=c[b];if(g==="*")return true;var h=/^(\.?)([^=]+)(?:=([^=]*))?$/.exec(g),i=h[1]?"css":"attr";g=h[2];h=h[3]||"";if(h===""&&a[i](g)!=="")return true;if(h!==""&&a[i](g)===h)return true}return false}function xb(a,b){if(a.type==1){$b(a,b,"*");$b(a,b)}}function $b(a,b,c){c=c||a.name;if(a.type===1){b=Yb(b);if(b[c]){c=b[c].split(",");b=false;for(var e=0,g=c.length;e<g;e++){var h=c[e];if(h==="*"){b=true;break}var i=/^(\.?)([^=]+)(?:=([^=]*))?$/.exec(h);h=i[2];if(i[1]){h=
C(h);if(a[0].style[h])a[0].style[h]=""}else a.removeAttr(h)}b&&a.remove(true)}}}function yb(a){for(a=a;a.first();)a=a.first();return a}function Ra(a){if(a.type!=1||a.isSingle())return false;return a.html().replace(/<[^>]+>/g,"")===""}function Bc(a,b){a=a.clone(true);for(var c=yb(a),e=a,g=false;b;){for(;e;){if(e.name===b.name){Cc(e,b.attr(),b.css());g=true}e=e.first()}g||c.append(b.clone(false));g=false;b=b.first()}return a}function Dc(a,b){b=b.clone(true);if(a.type==3){yb(b).append(a.clone(false));
a.replaceWith(b);return b}for(var c=a,e;(e=a.first())&&e.children().length==1;)a=e;e=a.first();for(a=a.doc.createDocumentFragment();e;){a.appendChild(e[0]);e=e.next()}b=Bc(c,b);a.firstChild&&yb(b).append(a);c.replaceWith(b);return b}function Cc(a,b,c){n(b,function(e,g){e!=="style"&&a.attr(e,g)});n(c,function(e,g){a.css(e,g)})}function Ec(a){for(;a&&a.name!="body";){if(ob[a.name]||a.name=="div"&&a.hasClass("ke-script"))return true;a=a.parent()}return false}function Xa(a){this.init(a)}function ac(a){if(a.nodeName){a=
La(a);a=ub(a).selectNodeContents(a.body).collapse(false)}return new Xa(a)}function zb(a){var b=a.moveEl,c=a.moveFn,e=a.clickEl||b,g=a.beforeDrag,h=[document];(a.iframeFix===f?true:a.iframeFix)&&j("iframe").each(function(){if(!/^https?:\/\//.test(Fa(this.src||"","absolute"))){var i;try{i=Ab(this)}catch(l){}if(i){var o=j(this).pos();j(i).data("pos-x",o.x);j(i).data("pos-y",o.y);h.push(i)}}});e.mousedown(function(i){function l(F){F.preventDefault();var ga=j(La(F.target)),ca=Ia((ga.data("pos-x")||0)+
F.pageX-W);F=Ia((ga.data("pos-y")||0)+F.pageY-pa);c.call(e,z,K,Q,$,ca,F)}function o(F){F.preventDefault()}function w(F){F.preventDefault();j(h).unbind("mousemove",l).unbind("mouseup",w).unbind("selectstart",o);A.releaseCapture&&A.releaseCapture()}if(!(i.button!==0&&i.button!==1)){i.stopPropagation();var A=e.get(),z=q(b.css("left")),K=q(b.css("top")),Q=b.width(),$=b.height(),W=i.pageX,pa=i.pageY;g&&g();j(h).mousemove(l).mouseup(w).bind("selectstart",o);A.setCapture&&A.setCapture()}})}function Ja(a){this.init(a)}
function Bb(a){return new Ja(a)}function Ab(a){a=Ba(a);return a.contentDocument||a.contentWindow.document}function Fc(a,b,c,e){var g=[Cb===""?"<html>":'<html dir="'+Cb+'">','<head><meta charset="utf-8" /><title></title>',j.pageBasePath===""?"":'<base href="'+j.pageBasePath+'">',"<style>","html {margin:0;padding:0;}","body {margin:0;padding:5px;}",'body, td {font:12px/1.5 "sans serif",tahoma,verdana,helvetica;}',"body, p, div {word-wrap: break-word;}","p {margin:5px 0;}","table {border-collapse:collapse;}",
"img {border:0;}","noscript {display:none;}","table.ke-zeroborder td {border:1px dotted #AAA;}","img.ke-flash {","\tborder:1px solid #AAA;","\tbackground-image:url("+a+"common/flash.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}","img.ke-rm {","\tborder:1px solid #AAA;","\tbackground-image:url("+a+"common/rm.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}","img.ke-media {",
"\tborder:1px solid #AAA;","\tbackground-image:url("+a+"common/media.gif);","\tbackground-position:center center;","\tbackground-repeat:no-repeat;","\twidth:100px;","\theight:100px;","}","img.ke-anchor {","\tborder:1px dashed #666;","\twidth:16px;","\theight:16px;","}",".ke-script, .ke-noscript, .ke-display-none {","\tdisplay:none;","\tfont-size:0;","\twidth:0;","\theight:0;","}",".ke-pagebreak {","\tborder:1px dotted #AAA;","\tfont-size:0;","\theight:2px;","}","</style>"];m(c)||(c=[c]);n(c,function(h,
i){i&&g.push('<link href="'+i+'" rel="stylesheet" />')});e&&g.push("<style>"+e+"</style>");g.push("</head><body "+(b?'class="'+b+'"':"")+"></body></html>");return g.join("\n")}function Ya(a,b){if(a.hasVal()){if(b===f){a=a.val();return a=a.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig,"")}return a.val(b)}return a.html(b)}function Za(a){this.init(a)}function bc(a){return new Za(a)}function cc(a,b){if(a=this.get(a))a.hasClass("ke-disabled")||b(a)}function ib(a){this.init(a)}function dc(a){return new ib(a)}
function $a(a){this.init(a)}function Db(a){return new $a(a)}function ab(a){this.init(a)}function ec(a){return new ab(a)}function Eb(a){this.init(a)}function Gc(a){return new Eb(a)}function Hc(a){a=a||{};var b=a.name||"",c=j('<span class="ke-button-common ke-button-outer" title="'+b+'"></span>');b=j('<input class="ke-button-common ke-button" type="button" value="'+b+'" />');a.click&&b.click(a.click);c.append(b);return c}function bb(a){this.init(a)}function fc(a){return new bb(a)}function Ic(a){var b=
Bb(a),c=b.remove,e=a.afterSelect;a=b.div;var g=[];a.addClass("ke-tabs").bind("contextmenu,mousedown,mousemove",function(i){i.preventDefault()});var h=j('<ul class="ke-tabs-ul ke-clearfix"></ul>');a.append(h);b.add=function(i){var l=j('<li class="ke-tabs-li">'+i.title+"</li>");l.data("tab",i);g.push(l);h.append(l)};b.selectedIndex=0;b.select=function(i){b.selectedIndex=i;n(g,function(l,o){o.unbind();if(l===i){o.addClass("ke-tabs-li-selected");j(o.data("tab").panel).show("")}else{o.removeClass("ke-tabs-li-selected").removeClass("ke-tabs-li-on").mouseover(function(){j(this).addClass("ke-tabs-li-on")}).mouseout(function(){j(this).removeClass("ke-tabs-li-on")}).click(function(){b.select(l)});
j(o.data("tab").panel).hide()}});e&&e.call(b,i)};b.remove=function(){n(g,function(){this.remove()});h.remove();c.call(b)};return b}function Fb(a,b){var c=document.getElementsByTagName("head")[0]||(Ga?document.body:document.documentElement),e=document.createElement("script");c.appendChild(e);e.src=a;e.charset="utf-8";e.onload=e.onreadystatechange=function(){if(!this.readyState||this.readyState==="loaded"){b&&b();e.onload=e.onreadystatechange=null;c.removeChild(e)}}}function gc(a){var b=a.indexOf("?");
return b>0?a.substr(0,b):a}function Gb(a){for(var b=document.getElementsByTagName("head")[0]||(Ga?document.body:document.documentElement),c=document.createElement("link"),e=gc(Fa(a,"absolute")),g=j('link[rel="stylesheet"]',b),h=0,i=g.length;h<i;h++)if(gc(Fa(g[h].href,"absolute"))===e)return;b.appendChild(c);c.href=a;c.rel="stylesheet"}function Jc(a,b,c,e,g){c=c||"GET";g=g||"json";var h=d.XMLHttpRequest?new d.XMLHttpRequest:new ActiveXObject("Microsoft.XMLHTTP");h.open(c,a,true);h.onreadystatechange=
function(){if(h.readyState==4&&h.status==200)if(b){var o=t(h.responseText);if(g=="json")o=ea(o);b(o)}};if(c=="POST"){var i=[];n(e,function(o,w){i.push(encodeURIComponent(o)+"="+encodeURIComponent(w))});try{h.setRequestHeader("Content-Type","application/x-www-form-urlencoded")}catch(l){}h.send(i.join("&"))}else h.send(null)}function hc(a,b){if(a===f)return Da;if(!b)return Da[a];Da[a]=b}function ic(a){var b,c="core";if(b=/^(\w+)\.(\w+)$/.exec(a)){c=b[1];a=b[2]}return{ns:c,key:a}}function jc(a,b){b=
b===f?j.options.langType:b;if(typeof a==="string"){if(!Ea[b])return"no language";var c=a.length-1;if(a.substr(c)===".")return Ea[b][a.substr(0,c)];a=ic(a);return Ea[b][a.ns][a.key]}n(a,function(e,g){e=ic(e);Ea[b]||(Ea[b]={});Ea[b][e.ns]||(Ea[b][e.ns]={});Ea[b][e.ns][e.key]=g})}function jb(a,b){if(!a.collapsed){a=a.cloneRange().up();var c=a.startContainer,e=a.startOffset;if(Na||a.isControl()){a=j(c.childNodes[e]);if(!(!a||a.name!="img"))if(b(a))return a}}}function Kc(){var a=this;j(a.edit.doc).contextmenu(function(b){a.menu&&
a.hideMenu();if(a.useContextmenu){if(a._contextmenus.length!==0){var c=0,e=[];for(n(a._contextmenus,function(){if(this.title=="-")e.push(this);else if(this.cond&&this.cond()){e.push(this);if(this.width&&this.width>c)c=this.width}});e.length>0&&e[0].title=="-";)e.shift();for(;e.length>0&&e[e.length-1].title=="-";)e.pop();var g=null;n(e,function(o){this.title=="-"&&g.title=="-"&&delete e[o];g=this});if(e.length>0){b.preventDefault();var h=j(a.edit.iframe).pos(),i=Db({x:h.x+b.clientX,y:h.y+b.clientY,
width:c,css:{visibility:"hidden"},shadowMode:a.shadowMode});n(e,function(){this.title&&i.addItem(this)});h=va(i.doc);var l=i.div.height();b.clientY+l>=h.clientHeight-100&&i.pos(i.x,q(i.y)-l);i.div.css("visibility","visible");a.menu=i}}}else b.preventDefault()})}function Lc(){function a(i){for(i=j(i.commonAncestor());i;){if(i.type==1&&!i.isStyle())break;i=i.parent()}return i.name}var b=this,c=b.edit.doc,e=b.newlineTag;if(!(ha&&e!=="br"))if(!(Oa&&qa<3&&e!=="p"))if(!(sb&&qa<9)){var g=G("h1,h2,h3,h4,h5,h6,pre,li"),
h=G("p,h1,h2,h3,h4,h5,h6,pre,li,blockquote");j(c).keydown(function(i){if(!(i.which!=13||i.shiftKey||i.ctrlKey||i.altKey)){b.cmd.selection();var l=a(b.cmd.range);if(!(l=="marquee"||l=="select"))if(e==="br"&&!g[l]){i.preventDefault();b.insertHtml("<br />"+(ha&&qa<9?"":"\u200b"))}else h[l]||Ha(c,"formatblock","<p>")}});j(c).keyup(function(i){if(!(i.which!=13||i.shiftKey||i.ctrlKey||i.altKey))if(e!="br")if(Oa){i=b.cmd.commonAncestor("p");var l=b.cmd.commonAncestor("a");if(l&&l.text()==""){l.remove(true);b.cmd.range.selectNodeContents(i[0]).collapse(true);
b.cmd.select()}}else{b.cmd.selection();i=a(b.cmd.range);if(!(i=="marquee"||i=="select")){h[i]||Ha(c,"formatblock","<p>");if(i=b.cmd.commonAncestor("div")){l=j("<p></p>");for(var o=i[0].firstChild;o;){var w=o.nextSibling;l.append(o);o=w}i.before(l);i.remove();b.cmd.range.selectNodeContents(l[0]);b.cmd.select()}}}})}}function Mc(){var a=this,b=a.edit.doc;j(b).keydown(function(c){if(c.which==9){c.preventDefault();if(a.afterTab)a.afterTab.call(a,c);else{c=a.cmd;var e=c.range;e.shrink();if(e.collapsed&&
e.startContainer.nodeType==1){e.insertNode(j("@&nbsp;",b)[0]);c.select()}a.insertHtml("&nbsp;&nbsp;&nbsp;&nbsp;")}}})}function Nc(){var a=this;j(a.edit.textarea[0],a.edit.win).focus(function(b){a.afterFocus&&a.afterFocus.call(a,b)}).blur(function(b){a.afterBlur&&a.afterBlur.call(a,b)})}function Ka(a){return t(a.replace(/<span [^>]*id="?__kindeditor_bookmark_\w+_\d+__"?[^>]*><\/span>/ig,""))}function kb(a){return a.replace(/<div[^>]+class="?__kindeditor_paste__"?[^>]*>[\s\S]*?<\/div>/ig,"")}function kc(a,
b){if(a.length===0)a.push(b);else{var c=a[a.length-1];Ka(b.html)!==Ka(c.html)&&a.push(b)}}function lc(a,b){var c=this.edit,e=c.doc.body,g,h;if(a.length===0)return this;if(c.designMode){g=this.cmd.range;h=g.createBookmark(true);h.html=e.innerHTML}else h={html:e.innerHTML};kc(b,h);b=a.pop();if(Ka(h.html)===Ka(b.html)&&a.length>0)b=a.pop();if(c.designMode){c.html(b.html);if(b.start){g.moveToBookmark(b);this.select()}}else j(e).html(Ka(b.html));return this}function cb(a){function b(g,h){if(cb.prototype[g]===
f)c[g]=h;c.options[g]=h}var c=this;c.options={};n(a,function(g){b(g,a[g])});n(j.options,function(g,h){c[g]===f&&b(g,h)});var e=j(c.srcElement||"<textarea/>");if(!c.width)c.width=e[0].style.width||e.width();if(!c.height)c.height=e[0].style.height||e.height();b("width",D(c.width,c.minWidth));b("height",D(c.height,c.minHeight));b("width",r(c.width));b("height",r(c.height));if(Oc&&(!Pc||qa<534))c.designMode=false;c.srcElement=e;c.initContent="";c.plugin={};c.isCreated=false;c._handlers={};c._contextmenus=
[];c._undoStack=[];c._redoStack=[];c._firstAddBookmark=true;c.menu=c.contextmenu=null;c.dialogs=[]}function Qc(a){return new cb(a)}function mc(a,b){function c(h){n(Da,function(i,l){if(s(l)){l.call(h,KindEditor);if(!h._pluginStatus)h._pluginStatus={};h._pluginStatus[i]="inited"}});return h.create()}b=b||{};b.basePath=D(b.basePath,j.basePath);b.themesPath=D(b.themesPath,b.basePath+"themes/");b.langPath=D(b.langPath,b.basePath+"lang/");b.pluginsPath=D(b.pluginsPath,b.basePath+"plugins/");if(D(b.loadStyleMode,
j.options.loadStyleMode)){var e=D(b.themeType,j.options.themeType);Gb(b.themesPath+"default/default.css");Gb(b.themesPath+e+"/"+e+".css")}a=j(a);if(!(!a||a.length===0)){if(a.length>1){a.each(function(){mc(this,b)});return _instances[0]}b.srcElement=a[0];var g=new cb(b);_instances.push(g);if(Ea[g.langType])return c(g);Fb(g.langPath+g.langType+".js?ver="+encodeURIComponent(j.DEBUG?lb:mb),function(){c(g)});return g}}function db(a,b){j(a).each(function(c,e){j.each(_instances,function(g,h){if(h&&h.srcElement[0]==
e){b.call(h,g);return false}})})}if(!d.KindEditor){if(!d.console)d.console={};if(!console.log)console.log=function(){};var mb="4.1.11 (2016-03-31)",ja=navigator.userAgent.toLowerCase(),ha=ja.indexOf("msie")>-1&&ja.indexOf("opera")==-1,zc=ja.indexOf("msie")==-1&&ja.indexOf("trident")>-1,Oa=ja.indexOf("gecko")>-1&&ja.indexOf("khtml")==-1,Na=ja.indexOf("applewebkit")>-1,sb=ja.indexOf("opera")>-1,Oc=ja.indexOf("mobile")>-1,Pc=/ipad|iphone|ipod/.test(ja),Ga=document.compatMode!="CSS1Compat",wa=!d.getSelection,
qa=(ja=/(?:msie|firefox|webkit|opera)[\/:\s](\d+)/.exec(ja))?ja[1]:"0",lb=(new Date).getTime(),Ia=Math.round,j={DEBUG:false,VERSION:mb,IE:ha,GECKO:Oa,WEBKIT:Na,OPERA:sb,V:qa,TIME:lb,each:n,isArray:m,isFunction:s,inArray:k,inString:p,trim:t,addUnit:r,removeUnit:q,escape:u,unescape:B,toCamel:C,toHex:v,toMap:G,toArray:N,undef:D,invalidUrl:O,addParam:E,extend:H,json:ea},Mb=G("a,abbr,acronym,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,img,input,ins,kbd,label,map,q,s,samp,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"),
Nb=G("address,applet,blockquote,body,center,dd,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,head,hr,html,iframe,ins,isindex,li,map,menu,meta,noframes,noscript,object,ol,p,pre,script,style,table,tbody,td,tfoot,th,thead,title,tr,ul"),Lb=G("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),nc=G("b,basefont,big,del,em,font,i,s,small,span,strike,strong,sub,sup,u"),Rc=G("img,table,input,textarea,button"),ob=G("pre,style,script"),nb=G("html,head,body,td,tr,table,ol,ul,li");
G("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");var qc=G("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),yc=G("input,button,textarea,select");j.basePath=I();j.pageBasePath=R();j.options={designMode:true,fullscreenMode:false,filterMode:true,wellFormatMode:true,shadowMode:true,loadStyleMode:true,basePath:j.basePath,themesPath:j.basePath+"themes/",langPath:j.basePath+"lang/",pluginsPath:j.basePath+"plugins/",themeType:"default",langType:"zh-CN",
urlType:"",newlineTag:"p",resizeType:2,syncType:"form",pasteType:2,dialogAlignType:"page",useContextmenu:true,fullscreenShortcut:false,bodyClass:"ke-content",indentChar:"\t",cssPath:"",cssData:"",minWidth:650,minHeight:100,minChangeSize:50,zIndex:811213,items:["source","|","undo","redo","|","preview","print","template","code","cut","copy","paste","plainpaste","wordpaste","|","justifyleft","justifycenter","justifyright","justifyfull","insertorderedlist","insertunorderedlist","indent","outdent","subscript",
"superscript","clearhtml","quickformat","selectall","|","fullscreen","/","formatblock","fontname","fontsize","|","forecolor","hilitecolor","bold","italic","underline","strikethrough","lineheight","removeformat","|","image","multiimage","flash","media","insertfile","table","hr","emoticons","baidumap","pagebreak","anchor","link","unlink","|","about"],noDisableItems:["source","fullscreen"],colorTable:[["#E53333","#E56600","#FF9900","#64451D","#DFC5A4","#FFE500"],["#009900","#006600","#99BB00","#B8D100",
"#60D978","#00D5FF"],["#337FE5","#003399","#4C33E5","#9933E5","#CC33E5","#EE33EE"],["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000"]],fontSizeTable:["9px","10px","12px","14px","16px","18px","24px","32px"],htmlTags:{font:["id","class","color","size","face",".background-color"],span:["id","class",".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".line-height"],div:["id","class","align",".border",".margin",
".padding",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".background",".font-style",".text-decoration",".vertical-align",".margin-left"],table:["id","class","border","cellspacing","cellpadding","width","height","align","bordercolor",".padding",".margin",".border","bgcolor",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".background",".width",".height",".border-collapse"],"td,th":["id",
"class","align","valign","width","height","colspan","rowspan","bgcolor",".text-align",".color",".background-color",".font-size",".font-family",".font-weight",".font-style",".text-decoration",".vertical-align",".background",".border"],a:["id","class","href","target","name"],embed:["id","class","src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess","wmode"],img:["id","class","src","width","height","border","alt","title","align",".width",".height",".border"],
"p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":["id","class","align",".text-align",".color",".background-color",".font-size",".font-family",".background",".font-weight",".font-style",".text-decoration",".vertical-align",".text-indent",".margin-left"],pre:["id","class"],hr:["id","class",".page-break-after"],"br,tbody,tr,strong,b,sub,sup,em,i,u,strike,s,del":["id","class"],iframe:["id","class","src","frameborder","width","height",".width",".height"]},layout:'<div class="container"><div class="toolbar"></div><div class="edit"></div><div class="statusbar"></div></div>'};
var Ib=false,oc=G("8,9,13,32,46,48..57,59,61,65..90,106,109..111,188,190..192,219..222");ja=G("33..40");var Hb={};n(oc,function(a,b){Hb[a]=b});n(ja,function(a,b){Hb[a]=b});var Sc="altKey,attrChange,attrName,bubbles,button,cancelable,charCode,clientX,clientY,ctrlKey,currentTarget,data,detail,eventPhase,fromElement,handler,keyCode,metaKey,newValue,offsetX,offsetY,originalTarget,pageX,pageY,prevValue,relatedNode,relatedTarget,screenX,screenY,shiftKey,srcElement,target,toElement,view,wheelDelta,which".split(",");
H(M,{init:function(a,b){var c=this,e=a.ownerDocument||a.document||a;c.event=b;n(Sc,function(g,h){c[h]=b[h]});if(!c.target)c.target=c.srcElement||e;if(c.target.nodeType===3)c.target=c.target.parentNode;if(!c.relatedTarget&&c.fromElement)c.relatedTarget=c.fromElement===c.target?c.toElement:c.fromElement;if(c.pageX==null&&c.clientX!=null){a=e.documentElement;e=e.body;c.pageX=c.clientX+(a&&a.scrollLeft||e&&e.scrollLeft||0)-(a&&a.clientLeft||e&&e.clientLeft||0);c.pageY=c.clientY+(a&&a.scrollTop||e&&e.scrollTop||
0)-(a&&a.clientTop||e&&e.clientTop||0)}if(!c.which&&(c.charCode||c.charCode===0?c.charCode:c.keyCode))c.which=c.charCode||c.keyCode;if(!c.metaKey&&c.ctrlKey)c.metaKey=c.ctrlKey;if(!c.which&&c.button!==f)c.which=c.button&1?1:c.button&2?3:c.button&4?2:0;switch(c.which){case 186:c.which=59;break;case 187:case 107:case 43:c.which=61;break;case 189:case 45:c.which=109;break;case 42:c.which=106;break;case 47:c.which=111;break;case 78:c.which=110;break}if(c.which>=96&&c.which<=105)c.which-=48},preventDefault:function(){var a=
this.event;if(a.preventDefault)a.preventDefault();else a.returnValue=false},stopPropagation:function(){var a=this.event;if(a.stopPropagation)a.stopPropagation();else a.cancelBubble=true},stop:function(){this.preventDefault();this.stopPropagation()}});var eb="kindeditor_"+lb,Jb=0,oa={},Kb=false;d.attachEvent&&d.attachEvent("onunload",function(){n(oa,function(a,b){b.el&&ba(b.el)})});j.ctrl=ma;j.ready=ua;j.formatUrl=Fa;j.formatHtml=Aa;j.getCssList=ra;j.getAttrList=ka;j.mediaType=Ob;j.mediaAttrs=Pb;j.mediaEmbed=
pb;j.mediaImg=Qb;j.clearMsWord=Sa;j.tmpl=sc;ja=document.createElement("div");ja.setAttribute("className","t");var tc=ja.className!=="t";j.query=uc;j.queryAll=hb;H(sa,{init:function(a){a=m(a)?a:[a];for(var b=0,c=0,e=a.length;c<e;c++)if(a[c]){this[c]=a[c].constructor===sa?a[c][0]:a[c];b++}this.length=b;this.doc=La(this[0]);this.name=Rb(this[0]);this.type=this.length>0?this[0].nodeType:null;this.win=Ma(this[0])},each:function(a){for(var b=0;b<this.length;b++)if(a.call(this[b],b,this[b])===false)return this;
return this},bind:function(a,b){this.each(function(){U(this,a,b)});return this},unbind:function(a,b){this.each(function(){ba(this,a,b)});return this},fire:function(a){if(this.length<1)return this;la(this[0],a);return this},hasAttr:function(a){if(this.length<1)return false;return!!gb(this[0],a)},attr:function(a,b){var c=this;if(a===f)return ka(c.outer());if(typeof a==="object"){n(a,function(e,g){c.attr(e,g)});return c}if(b===f){b=c.length<1?null:gb(c[0],a);return b===null?"":b}c.each(function(){rb(this,
a,b)});return c},removeAttr:function(a){this.each(function(){wc(this,a)});return this},get:function(a){if(this.length<1)return null;return this[a||0]},eq:function(a){if(this.length<1)return null;return this[a]?new sa(this[a]):null},hasClass:function(a){if(this.length<1)return false;return qb(this[0],a)},addClass:function(a){this.each(function(){if(!qb(this,a))this.className=t(this.className+" "+a)});return this},removeClass:function(a){this.each(function(){if(qb(this,a))this.className=t(this.className.replace(new RegExp("(^|\\s)"+
a+"(\\s|$)")," "))});return this},html:function(a){if(a===f){if(this.length<1||this.type!=1)return"";return Aa(this[0].innerHTML)}this.each(function(){vc(this,a)});return this},text:function(){if(this.length<1)return"";return ha?this[0].innerText:this[0].textContent},hasVal:function(){if(this.length<1)return false;return Sb(this[0])},val:function(a){if(a===f){if(this.length<1)return"";return this.hasVal()?this[0].value:this.attr("value")}else{this.each(function(){if(Sb(this))this.value=a;else rb(this,
"value",a)});return this}},css:function(a,b){var c=this;if(a===f)return ra(c.attr("style"));if(typeof a==="object"){n(a,function(e,g){c.css(e,g)});return c}if(b===f){if(c.length<1)return"";return c[0].style[C(a)]||xc(c[0],a)||""}c.each(function(){this.style[C(a)]=b});return c},width:function(a){if(a===f){if(this.length<1)return 0;return this[0].offsetWidth}return this.css("width",r(a))},height:function(a){if(a===f){if(this.length<1)return 0;return this[0].offsetHeight}return this.css("height",r(a))},
opacity:function(a){this.each(function(){if(this.style.opacity===f)this.style.filter=a==1?"":"alpha(opacity="+a*100+")";else this.style.opacity=a==1?"":a});return this},data:function(a,b){a="kindeditor_data_"+a;if(b===f){if(this.length<1)return null;return this[0][a]}this.each(function(){this[a]=b});return this},pos:function(){var a=this[0],b=0,c=0;if(a)if(a.getBoundingClientRect){a=a.getBoundingClientRect();c=Pa(this.doc);b=a.left+c.x;c=a.top+c.y}else for(;a;){b+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}return{x:Ia(b),
y:Ia(c)}},clone:function(a){if(this.length<1)return new sa([]);return new sa(this[0].cloneNode(a))},append:function(a){this.each(function(){this.appendChild&&this.appendChild(Ba(a))});return this},appendTo:function(a){this.each(function(){Ba(a).appendChild(this)});return this},before:function(a){this.each(function(){this.parentNode.insertBefore(Ba(a),this)});return this},after:function(a){this.each(function(){this.nextSibling?this.parentNode.insertBefore(Ba(a),this.nextSibling):this.parentNode.appendChild(Ba(a))});
return this},replaceWith:function(a){var b=[];this.each(function(c,e){ba(e);c=Ba(a);e.parentNode.replaceChild(c,e);b.push(c)});return j(b)},empty:function(){this.each(function(a,b){for(a=b.firstChild;a;){if(!b.parentNode)return;var c=a.nextSibling;a.parentNode.removeChild(a);a=c}});return this},remove:function(a){var b=this;b.each(function(c,e){if(e.parentNode){ba(e);if(a)for(var g=e.firstChild;g;){var h=g.nextSibling;e.parentNode.insertBefore(g,e);g=h}e.parentNode.removeChild(e);delete b[c]}});b.length=
0;return b},show:function(a){if(a===f)a=this._originDisplay||"";if(this.css("display")!="none")return this;return this.css("display",a)},hide:function(){if(this.length<1)return this;this._originDisplay=this[0].style.display;return this.css("display","none")},outer:function(){if(this.length<1)return"";var a=this.doc.createElement("div");a.appendChild(this[0].cloneNode(true));return Aa(a.innerHTML)},isSingle:function(){return!!Lb[this.name]},isInline:function(){return!!Mb[this.name]},isBlock:function(){return!!Nb[this.name]},
isStyle:function(){return!!nc[this.name]},isControl:function(){return!!Rc[this.name]},contains:function(a){if(this.length<1)return false;return fb(this[0],Ba(a))},parent:function(){if(this.length<1)return null;var a=this[0].parentNode;return a?new sa(a):null},children:function(){if(this.length<1)return new sa([]);for(var a=[],b=this[0].firstChild;b;){if(b.nodeType!=3||t(b.nodeValue)!=="")a.push(b);b=b.nextSibling}return new sa(a)},first:function(){var a=this.children();return a.length>0?a.eq(0):null},
last:function(){var a=this.children();return a.length>0?a.eq(a.length-1):null},index:function(){if(this.length<1)return-1;for(var a=-1,b=this[0];b;){a++;b=b.previousSibling}return a},prev:function(){if(this.length<1)return null;var a=this[0].previousSibling;return a?new sa(a):null},next:function(){if(this.length<1)return null;var a=this[0].nextSibling;return a?new sa(a):null},scan:function(a,b){function c(e){for(e=b?e.firstChild:e.lastChild;e;){var g=b?e.nextSibling:e.previousSibling;if(a(e)===false)return false;
if(c(e)===false)return false;e=g}}if(!(this.length<1)){b=b===f?true:b;c(this[0]);return this}}});n("blur,focus,focusin,focusout,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error,contextmenu".split(","),function(a,b){sa.prototype[b]=function(c){return c?this.bind(b,c):this.fire(b)}});ja=j;j=function(a,b){function c(o){o[0]||(o=[]);return new sa(o)}if(!(a===f||a===null)){if(typeof a==="string"){if(b)b=
Ba(b);var e=a.length;if(a.charAt(0)==="@")a=a.substr(1);if(a.length!==e||/<.+>/.test(a)){e=(b?b.ownerDocument||b:document).createElement("div");var g=[];e.innerHTML='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+a;for(var h=0,i=e.childNodes.length;h<i;h++){var l=e.childNodes[h];l.id!="__kindeditor_temp_tag__"&&g.push(l)}return c(g)}return c(hb(a,b))}if(a&&a.constructor===sa)return a;if(a.toArray)a=a.toArray();if(m(a))return c(a);return c(N(arguments))}};n(ja,function(a,
b){j[a]=b});j.NodeClass=sa;d.KindEditor=j;var Ua=0,Ta=1,Qa=2,Va=3,pc=0;H(Ca,{init:function(a){this.startContainer=a;this.startOffset=0;this.endContainer=a;this.endOffset=0;this.collapsed=true;this.doc=a},commonAncestor:function(){function a(o){for(var w=[];o;){w.push(o);o=o.parentNode}return w}for(var b=a(this.startContainer),c=a(this.endContainer),e=0,g=b.length,h=c.length,i,l;++e;){i=b[g-e];l=c[h-e];if(!i||!l||i!==l)break}return b[g-e+1]},setStart:function(a,b){var c=this.doc;this.startContainer=
a;this.startOffset=b;if(this.endContainer===c){this.endContainer=a;this.endOffset=b}return Tb(this)},setEnd:function(a,b){var c=this.doc;this.endContainer=a;this.endOffset=b;if(this.startContainer===c){this.startContainer=a;this.startOffset=b}return Tb(this)},setStartBefore:function(a){return this.setStart(a.parentNode||this.doc,j(a).index())},setStartAfter:function(a){return this.setStart(a.parentNode||this.doc,j(a).index()+1)},setEndBefore:function(a){return this.setEnd(a.parentNode||this.doc,j(a).index())},
setEndAfter:function(a){return this.setEnd(a.parentNode||this.doc,j(a).index()+1)},selectNode:function(a){return this.setStartBefore(a).setEndAfter(a)},selectNodeContents:function(a){var b=j(a);if(b.type==3||b.isSingle())return this.selectNode(a);b=b.children();if(b.length>0)return this.setStartBefore(b[0]).setEndAfter(b[b.length-1]);return this.setStart(a,0).setEnd(a,0)},collapse:function(a){if(a)return this.setEnd(this.startContainer,this.startOffset);return this.setStart(this.endContainer,this.endOffset)},
compareBoundaryPoints:function(a,b){var c=this.get(),e=b.get();if(wa){var g={};g[Ua]="StartToStart";g[Ta]="EndToStart";g[Qa]="EndToEnd";g[Va]="StartToEnd";c=c.compareEndPoints(g[a],e);if(c!==0)return c;var h,i,l,o;if(a===Ua||a===Va){h=this.startContainer;l=this.startOffset}if(a===Ta||a===Qa){h=this.endContainer;l=this.endOffset}if(a===Ua||a===Ta){i=b.startContainer;o=b.startOffset}if(a===Qa||a===Va){i=b.endContainer;o=b.endOffset}if(h===i){h=l-o;return h>0?1:h<0?-1:0}for(a=i;a&&a.parentNode!==h;)a=
a.parentNode;if(a)return j(a).index()>=l?-1:1;for(a=h;a&&a.parentNode!==i;)a=a.parentNode;if(a)return j(a).index()>=o?1:-1;if((a=j(i).next())&&a.contains(h))return 1;if((a=j(h).next())&&a.contains(i))return-1}else return c.compareBoundaryPoints(a,e)},cloneRange:function(){return(new Ca(this.doc)).setStart(this.startContainer,this.startOffset).setEnd(this.endContainer,this.endOffset)},toString:function(){var a=this.get();return(wa?a.text:a.toString()).replace(/\r\n|\n|\r/g,"")},cloneContents:function(){return tb(this,
true,false)},deleteContents:function(){return tb(this,false,true)},extractContents:function(){return tb(this,true,true)},insertNode:function(a){var b=this.startContainer,c=this.startOffset,e=this.endContainer,g=this.endOffset,h,i,l,o=1;if(a.nodeName.toLowerCase()==="#document-fragment"){h=a.firstChild;i=a.lastChild;o=a.childNodes.length}if(b.nodeType==1)if(l=b.childNodes[c]){b.insertBefore(a,l);if(b===e)g+=o}else b.appendChild(a);else if(b.nodeType==3)if(c===0){b.parentNode.insertBefore(a,b);if(b.parentNode===
e)g+=o}else if(c>=b.nodeValue.length)b.nextSibling?b.parentNode.insertBefore(a,b.nextSibling):b.parentNode.appendChild(a);else{l=c>0?b.splitText(c):b;b.parentNode.insertBefore(a,l);if(b===e){e=l;g-=c}}h?this.setStartBefore(h).setEndAfter(i):this.selectNode(a);if(this.compareBoundaryPoints(Qa,this.cloneRange().setEnd(e,g))>=1)return this;return this.setEnd(e,g)},surroundContents:function(a){a.appendChild(this.extractContents());return this.insertNode(a).selectNode(a)},isControl:function(){var a=this.startContainer,
b=this.startOffset,c=this.endContainer,e=this.endOffset;return a.nodeType==1&&a===c&&b+1===e&&j(a.childNodes[b]).isControl()},get:function(a){var b=this.doc;if(!wa){b=b.createRange();try{b.setStart(this.startContainer,this.startOffset);b.setEnd(this.endContainer,this.endOffset)}catch(c){}return b}if(a&&this.isControl()){b=b.body.createControlRange();b.addElement(this.startContainer.childNodes[this.startOffset]);return b}a=this.cloneRange().down();b=b.body.createTextRange();b.setEndPoint("StartToStart",
Vb(a.startContainer,a.startOffset));b.setEndPoint("EndToStart",Vb(a.endContainer,a.endOffset));return b},html:function(){return j(this.cloneContents()).outer()},down:function(){function a(c,e,g){if(c.nodeType==1){c=j(c).children();if(c.length!==0){var h,i,l,o;if(e>0)h=c.eq(e-1);if(e<c.length)i=c.eq(e);if(h&&h.type==3){l=h[0];o=l.nodeValue.length}if(i&&i.type==3){l=i[0];o=0}if(l)g?b.setStart(l,o):b.setEnd(l,o)}}}var b=this;a(b.startContainer,b.startOffset,true);a(b.endContainer,b.endOffset,false);
return b},up:function(){function a(c,e,g){if(c.nodeType==3)if(e===0)g?b.setStartBefore(c):b.setEndBefore(c);else if(e==c.nodeValue.length)g?b.setStartAfter(c):b.setEndAfter(c)}var b=this;a(b.startContainer,b.startOffset,true);a(b.endContainer,b.endOffset,false);return b},enlarge:function(a){function b(e,g,h){e=j(e);if(!(e.type==3||nb[e.name]||!a&&e.isBlock()))if(g===0){for(;!e.prev();){g=e.parent();if(!g||nb[g.name]||!a&&g.isBlock())break;e=g}h?c.setStartBefore(e[0]):c.setEndBefore(e[0])}else if(g==
e.children().length){for(;!e.next();){g=e.parent();if(!g||nb[g.name]||!a&&g.isBlock())break;e=g}h?c.setStartAfter(e[0]):c.setEndAfter(e[0])}}var c=this;c.up();b(c.startContainer,c.startOffset,true);b(c.endContainer,c.endOffset,false);return c},shrink:function(){for(var a,b=this.collapsed;this.startContainer.nodeType==1&&(a=this.startContainer.childNodes[this.startOffset])&&a.nodeType==1&&!j(a).isSingle();)this.setStart(a,0);if(b)return this.collapse(b);for(;this.endContainer.nodeType==1&&this.endOffset>
0&&(a=this.endContainer.childNodes[this.endOffset-1])&&a.nodeType==1&&!j(a).isSingle();)this.setEnd(a,a.childNodes.length);return this},createBookmark:function(a){var b,c=j('<span style="display:none;"></span>',this.doc)[0];c.id="__kindeditor_bookmark_start_"+pc++ +"__";if(!this.collapsed){b=c.cloneNode(true);b.id="__kindeditor_bookmark_end_"+pc++ +"__"}b&&this.cloneRange().collapse(false).insertNode(b).setEndBefore(b);this.insertNode(c).setStartAfter(c);return{start:a?"#"+c.id:c,end:b?a?"#"+b.id:
b:null}},moveToBookmark:function(a){var b=this.doc,c=j(a.start,b);a=a.end?j(a.end,b):null;if(!c||c.length<1)return this;this.setStartBefore(c[0]);c.remove();if(a&&a.length>0){this.setEndBefore(a[0]);a.remove()}else this.collapse(true);return this},dump:function(){console.log("--------------------");console.log(this.startContainer.nodeType==3?this.startContainer.nodeValue:this.startContainer,this.startOffset);console.log(this.endContainer.nodeType==3?this.endContainer.nodeValue:this.endContainer,this.endOffset)}});
j.RangeClass=Ca;j.range=ub;j.START_TO_START=Ua;j.START_TO_END=Ta;j.END_TO_END=Qa;j.END_TO_START=Va;H(Xa,{init:function(a){var b=a.doc;this.doc=b;this.win=Ma(b);this.sel=vb(b);this.range=a},selection:function(a){var b=this.doc,c=Ac(b);this.sel=vb(b);if(c){this.range=ub(c);j(this.range.startContainer).name=="html"&&this.range.selectNodeContents(b.body).collapse(false);return this}a&&this.range.selectNodeContents(b.body).collapse(false);return this},select:function(a){a=D(a,true);var b=this.sel,c=this.range.cloneRange().shrink(),
e=c.startContainer,g=c.startOffset,h=La(e),i=this.win,l,o=false;if(a&&e.nodeType==1&&c.collapsed){if(wa){b=j("<span>&nbsp;</span>",h);c.insertNode(b[0]);l=h.body.createTextRange();try{l.moveToElementText(b[0])}catch(w){}l.collapse(false);l.select();b.remove();i.focus();return this}if(Na){a=e.childNodes;if(j(e).isInline()||g>0&&j(a[g-1]).isInline()||a[g]&&j(a[g]).isInline()){c.insertNode(h.createTextNode("\u200b"));o=true}}}if(wa)try{l=c.get(true);l.select()}catch(A){}else{o&&c.collapse(false);l=c.get(true);
b.removeAllRanges();b.addRange(l);if(h!==document){c=j(l.endContainer).pos();i.scrollTo(c.x,c.y)}}i.focus();return this},wrap:function(a){var b=this.range,c;c=j(a,this.doc);if(b.collapsed){b.shrink();b.insertNode(c[0]).selectNodeContents(c[0]);return this}if(c.isBlock()){for(var e=a=c.clone(true);e.first();)e=e.first();e.append(b.extractContents());b.insertNode(a[0]).selectNode(a[0]);return this}b.enlarge();var g=b.createBookmark();a=b.commonAncestor();var h=false;j(a).scan(function(i){if(!h&&i==
g.start)h=true;else if(h){if(i==g.end)return false;var l=j(i);if(!Ec(l))if(l.type==3&&t(i.nodeValue).length>0){for(var o;(o=l.parent())&&o.isStyle()&&o.children().length==1;)l=o;Dc(l,c)}}});b.moveToBookmark(g);return this},split:function(a,b){for(var c=this.range,e=c.doc,g=c.cloneRange().collapse(a),h=g.startContainer,i=g.startOffset,l=h.nodeType==3?h.parentNode:h,o=false,w;l&&l.parentNode;){w=j(l);if(b){if(!w.isStyle())break;if(!wb(w,b))break}else if(nb[w.name])break;o=true;l=l.parentNode}if(o){b=
e.createElement("span");c.cloneRange().collapse(!a).insertNode(b);a?g.setStartBefore(l.firstChild).setEnd(h,i):g.setStart(h,i).setEndAfter(l.lastChild);h=g.extractContents();i=h.firstChild;e=h.lastChild;if(a){g.insertNode(h);c.setStartAfter(e).setEndBefore(b)}else{l.appendChild(h);c.setStartBefore(b).setEndBefore(i)}g=b.parentNode;if(g==c.endContainer){l=j(b).prev();h=j(b).next();if(l&&h&&l.type==3&&h.type==3)c.setEnd(l[0],l[0].nodeValue.length);else a||c.setEnd(c.endContainer,c.endOffset-1)}g.removeChild(b)}return this},
remove:function(a){var b=this.doc,c=this.range;c.enlarge();if(c.startOffset===0){for(var e=j(c.startContainer),g;(g=e.parent())&&g.isStyle()&&g.children().length==1;)e=g;c.setStart(e[0],0);e=j(c.startContainer);e.isBlock()&&xb(e,a);(e=e.parent())&&e.isBlock()&&xb(e,a)}if(c.collapsed){this.split(true,a);b=c.startContainer;e=c.startOffset;if(e>0)if((g=j(b.childNodes[e-1]))&&Ra(g)){g.remove();c.setStart(b,e-1)}(e=j(b.childNodes[e]))&&Ra(e)&&e.remove();if(Ra(b)){c.startBefore(b);b.remove()}c.collapse(true);
return this}this.split(true,a);this.split(false,a);var h=b.createElement("span"),i=b.createElement("span");c.cloneRange().collapse(false).insertNode(i);c.cloneRange().collapse(true).insertNode(h);var l=[],o=false;j(c.commonAncestor()).scan(function(z){if(!o&&z==h)o=true;else{if(z==i)return false;o&&l.push(z)}});j(h).remove();j(i).remove();b=c.startContainer;e=c.startOffset;g=c.endContainer;var w=c.endOffset;if(e>0){var A=j(b.childNodes[e-1]);if(A&&Ra(A)){A.remove();c.setStart(b,e-1);b==g&&c.setEnd(g,
w-1)}if((e=j(b.childNodes[e]))&&Ra(e)){e.remove();b==g&&c.setEnd(g,w-1)}}(b=j(g.childNodes[c.endOffset]))&&Ra(b)&&b.remove();b=c.createBookmark(true);n(l,function(z,K){xb(j(K),a)});c.moveToBookmark(b);return this},commonNode:function(a){function b(i){var l=i;for(i=i;i;){if(wb(j(i),a))return j(i);i=i.parentNode}for(;l&&(l=l.lastChild);)if(wb(j(l),a))return j(l);return null}var c=this.range,e=c.endContainer;c=c.endOffset;var g=e.nodeType==3||c===0?e:e.childNodes[c-1],h=b(g);if(h)return h;if(g.nodeType==
1||e.nodeType==3&&c===0)if(e=j(g).prev())return b(e);return null},commonAncestor:function(a){function b(i){for(;i;){if(i.nodeType==1)if(i.tagName.toLowerCase()===a)return i;i=i.parentNode}return null}var c=this.range,e=c.startContainer,g=c.startOffset,h=c.endContainer;c=c.endOffset;h=h.nodeType==3||c===0?h:h.childNodes[c-1];e=b(e.nodeType==3||g===0?e:e.childNodes[g-1]);g=b(h);if(e&&g&&e===g)return j(e);return null},state:function(a){var b=this.doc,c=false;try{c=b.queryCommandState(a)}catch(e){}return c},
val:function(a){function b(g){return g.toLowerCase()}var c=this.doc;a=b(a);var e="";if(a==="fontfamily"||a==="fontname"){e=Xb(c,"fontname");e=e.replace(/['"]/g,"");return b(e)}if(a==="formatblock"){e=Xb(c,a);if(e==="")if(a=this.commonNode({"h1,h2,h3,h4,h5,h6,p,div,pre,address":"*"}))e=a.name;if(e==="Normal")e="p";return b(e)}if(a==="fontsize"){if(a=this.commonNode({"*":".font-size"}))e=a.css("font-size");return b(e)}if(a==="forecolor"){if(a=this.commonNode({"*":".color"}))e=a.css("color");e=v(e);
if(e==="")e="default";return b(e)}if(a==="hilitecolor"){if(a=this.commonNode({"*":".background-color"}))e=a.css("background-color");e=v(e);if(e==="")e="default";return b(e)}return e},toggle:function(a,b){this.commonNode(b)?this.remove(b):this.wrap(a);return this.select()},bold:function(){return this.toggle("<strong></strong>",{span:".font-weight=bold",strong:"*",b:"*"})},italic:function(){return this.toggle("<em></em>",{span:".font-style=italic",em:"*",i:"*"})},underline:function(){return this.toggle("<u></u>",
{span:".text-decoration=underline",u:"*"})},strikethrough:function(){return this.toggle("<s></s>",{span:".text-decoration=line-through",s:"*"})},forecolor:function(a){return this.wrap('<span style="color:'+a+';"></span>').select()},hilitecolor:function(a){return this.wrap('<span style="background-color:'+a+';"></span>').select()},fontsize:function(a){return this.wrap('<span style="font-size:'+a+';"></span>').select()},fontname:function(a){return this.fontfamily(a)},fontfamily:function(a){return this.wrap('<span style="font-family:'+
a+';"></span>').select()},removeformat:function(){var a={"*":".font-weight,.font-style,.text-decoration,.color,.background-color,.font-size,.font-family,.text-indent"};n(nc,function(b){a[b]="*"});this.remove(a);return this.select()},inserthtml:function(a,b){function c(l,o){o='<img id="__kindeditor_temp_tag__" width="0" height="0" style="display:none;" />'+o;var w=l.get();if(w.item)w.item(0).outerHTML=o;else w.pasteHTML(o);o=l.doc.getElementById("__kindeditor_temp_tag__");o.parentNode.removeChild(o);
w=Wb(w);l.setEnd(w.endContainer,w.endOffset);l.collapse(false);g.select(false)}function e(l,o){var w=l.doc,A=w.createDocumentFragment();j("@"+o,w).each(function(){A.appendChild(this)});l.deleteContents();l.insertNode(A);l.collapse(false);g.select(false)}var g=this,h=g.range;if(a==="")return g;if(wa&&b){try{c(h,a)}catch(i){e(h,a)}return g}e(h,a);return g},hr:function(){return this.inserthtml("<hr />")},print:function(){this.win.print();return this},insertimage:function(a,b,c,e,g,h){b=D(b,"");D(g,0);
a='<img src="'+u(a)+'" data-ke-src="'+u(a)+'" ';if(c)a+='width="'+u(c)+'" ';if(e)a+='height="'+u(e)+'" ';if(b)a+='title="'+u(b)+'" ';if(h)a+='align="'+u(h)+'" ';a+='alt="'+u(b)+'" ';a+="/>";return this.inserthtml(a)},createlink:function(a,b){function c(o,w,A){j(o).attr("href",w).attr("data-ke-src",w);A?j(o).attr("target",A):j(o).removeAttr("target")}var e=this.doc,g=this.range;this.select();var h=this.commonNode({a:"*"});if(h&&!g.isControl()){g.selectNode(h.get());this.select()}h='<a href="'+u(a)+
'" data-ke-src="'+u(a)+'" ';if(b)h+=' target="'+u(b)+'"';if(g.collapsed){h+=">"+u(a)+"</a>";return this.inserthtml(h)}if(g.isControl()){var i=j(g.startContainer.childNodes[g.startOffset]);h+="></a>";i.after(j(h,e));i.next().append(i);g.selectNode(i[0]);return this.select()}h=g.startContainer;i=g.startOffset;var l=g.endContainer;g=g.endOffset;if(h.nodeType==1&&h===l&&i+1===g){g=h.childNodes[i];if(g.nodeName.toLowerCase()=="a"){c(g,a,b);return this}}Ha(e,"createlink","__kindeditor_temp_url__");j('a[href="__kindeditor_temp_url__"]',
e).each(function(){c(this,a,b)});return this},unlink:function(){var a=this.doc,b=this.range;this.select();if(b.collapsed){var c=this.commonNode({a:"*"});if(c){b.selectNode(c.get());this.select()}Ha(a,"unlink",null);if(Na&&j(b.startContainer).name==="img"){a=j(b.startContainer).parent();a.name==="a"&&a.remove(true)}}else Ha(a,"unlink",null);return this}});n("formatblock,selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript".split(","),
function(a,b){Xa.prototype[b]=function(c){this.select();Ha(this.doc,b,c);wa&&k(b,"justifyleft,justifycenter,justifyright,justifyfull".split(","))>=0&&this.selection();if(!wa||k(b,"formatblock,selectall,insertorderedlist,insertunorderedlist".split(","))>=0)this.selection();return this}});n("cut,copy,paste".split(","),function(a,b){Xa.prototype[b]=function(){if(!this.doc.queryCommandSupported(b))throw"not supported";this.select();Ha(this.doc,b,null);return this}});j.CmdClass=Xa;j.cmd=ac;H(Ja,{init:function(a){var b=
this;b.name=a.name||"";b.doc=a.doc||document;b.win=Ma(b.doc);b.x=r(a.x);b.y=r(a.y);b.z=a.z;b.width=r(a.width);b.height=r(a.height);b.div=j('<div style="display:block;"></div>');b.options=a;b._alignEl=a.alignEl;b.width&&b.div.css("width",b.width);b.height&&b.div.css("height",b.height);b.z&&b.div.css({position:"absolute",left:b.x,top:b.y,"z-index":b.z});if(b.z&&(b.x===f||b.y===f))b.autoPos(b.width,b.height);a.cls&&b.div.addClass(a.cls);a.shadowMode&&b.div.addClass("ke-shadow");a.css&&b.div.css(a.css);
a.src?j(a.src).replaceWith(b.div):j(b.doc.body).append(b.div);a.html&&b.div.html(a.html);if(a.autoScroll)if(ha&&qa<7||Ga){var c=Pa();j(b.win).bind("scroll",function(){var e=Pa(),g=e.x-c.x;e=e.y-c.y;b.pos(q(b.x)+g,q(b.y)+e,false)})}else b.div.css("position","fixed")},pos:function(a,b,c){c=D(c,true);if(a!==null){a=a<0?0:r(a);this.div.css("left",a);if(c)this.x=a}if(b!==null){b=b<0?0:r(b);this.div.css("top",b);if(c)this.y=b}return this},autoPos:function(a,b){a=q(a)||0;var c=q(b)||0;b=Pa();if(this._alignEl){var e=
j(this._alignEl),g=e.pos();a=Ia(e[0].clientWidth/2-a/2);c=Ia(e[0].clientHeight/2-c/2);x=a<0?g.x:g.x+a;y=c<0?g.y:g.y+c}else{g=va(this.doc);x=Ia(b.x+(g.clientWidth-a)/2);y=Ia(b.y+(g.clientHeight-c)/2)}if(!(ha&&qa<7||Ga)){x-=b.x;y-=b.y}return this.pos(x,y)},remove:function(){var a=this;if(ha&&qa<7||Ga)j(a.win).unbind("scroll");a.div.remove();n(a,function(b){a[b]=null});return this},show:function(){this.div.show();return this},hide:function(){this.div.hide();return this},draggable:function(a){var b=this;
a=a||{};a.moveEl=b.div;a.moveFn=function(c,e,g,h,i,l){if((c+=i)<0)c=0;if((e+=l)<0)e=0;b.pos(c,e)};zb(a);return b}});j.WidgetClass=Ja;j.widget=Bb;var Cb="";if(ja=document.getElementsByTagName("html"))Cb=ja[0].dir;H(Za,Ja,{init:function(a){function b(){var w=Ab(c.iframe);w.open();if(l)w.domain=document.domain;w.write(Fc(e,g,h,i));w.close();c.win=c.iframe[0].contentWindow;c.doc=w;var A=ac(w);c.afterChange(function(){A.selection()});Na&&j(w).click(function(z){if(j(z.target).name==="img"){A.selection(true);
A.range.selectNode(z.target);A.select()}});if(ha){c._mousedownHandler=function(){var z=A.range.cloneRange();z.shrink();z.isControl()&&c.blur()};j(document).mousedown(c._mousedownHandler);j(w).keydown(function(z){if(z.which==8){A.selection();var K=A.range;if(K.isControl()){K.collapse(true);j(K.startContainer.childNodes[K.startOffset]).remove();z.preventDefault()}}})}c.cmd=A;c.html(Ya(c.srcElement));if(ha){w.body.disabled=true;w.body.contentEditable=true;w.body.removeAttribute("disabled")}else w.designMode=
"on";a.afterCreate&&a.afterCreate.call(c)}var c=this;Za.parent.init.call(c,a);c.srcElement=j(a.srcElement);c.div.addClass("ke-edit");c.designMode=D(a.designMode,true);c.beforeGetHtml=a.beforeGetHtml;c.beforeSetHtml=a.beforeSetHtml;c.afterSetHtml=a.afterSetHtml;var e=D(a.themesPath,""),g=a.bodyClass,h=a.cssPath,i=a.cssData,l=location.protocol!="res:"&&location.host.replace(/:\d+/,"")!==document.domain,o="document.open();"+(l?'document.domain="'+document.domain+'";':"")+"document.close();";o=ha?' src="javascript:void(function(){'+
encodeURIComponent(o)+'}())"':"";c.iframe=j('<iframe class="ke-edit-iframe" hidefocus="true" frameborder="0"'+o+"></iframe>").css("width","100%");c.textarea=j('<textarea class="ke-edit-textarea" hidefocus="true"></textarea>').css("width","100%");c.tabIndex=isNaN(parseInt(a.tabIndex,10))?c.srcElement.attr("tabindex"):parseInt(a.tabIndex,10);c.iframe.attr("tabindex",c.tabIndex);c.textarea.attr("tabindex",c.tabIndex);c.width&&c.setWidth(c.width);c.height&&c.setHeight(c.height);c.designMode?c.textarea.hide():
c.iframe.hide();l&&c.iframe.bind("load",function(){c.iframe.unbind("load");ha?b():setTimeout(b,0)});c.div.append(c.iframe);c.div.append(c.textarea);c.srcElement.hide();!l&&b()},setWidth:function(a){this.width=a=r(a);this.div.css("width",a);return this},setHeight:function(a){this.height=a=r(a);this.div.css("height",a);this.iframe.css("height",a);if(ha&&qa<8||Ga)a=r(q(a)-2);this.textarea.css("height",a);return this},remove:function(){var a=this.doc;j(a.body).unbind();j(a).unbind();j(this.win).unbind();
this._mousedownHandler&&j(document).unbind("mousedown",this._mousedownHandler);Ya(this.srcElement,this.html());this.srcElement.show();this.iframe.unbind();this.textarea.unbind();Za.parent.remove.call(this)},html:function(a,b){var c=this.doc;if(this.designMode){c=c.body;if(a===f){a=b?"<!doctype html><html>"+c.parentNode.innerHTML+"</html>":c.innerHTML;if(this.beforeGetHtml)a=this.beforeGetHtml(a);if(Oa&&a=="<br />")a="";return a}if(this.beforeSetHtml)a=this.beforeSetHtml(a);if(ha&&qa>=9)a=a.replace(/(<.*?checked=")checked(".*>)/ig,
"$1$2");j(c).html(a);this.afterSetHtml&&this.afterSetHtml();return this}if(a===f)return this.textarea.val();this.textarea.val(a);return this},design:function(a){if(a===f?!this.designMode:a){if(!this.designMode){a=this.html();this.designMode=true;this.textarea.hide();this.html(a);var b=this.iframe,c=q(this.height);b.height(c-2);b.show();setTimeout(function(){b.height(c)},0)}}else if(this.designMode){a=this.html();this.designMode=false;this.html(a);this.iframe.hide();this.textarea.show()}return this.focus()},
focus:function(){this.designMode?this.win.focus():this.textarea[0].focus();return this},blur:function(){if(ha){var a=j('<input type="text" style="float:left;width:0;height:0;padding:0;margin:0;border:0;" value="" />',this.div);this.div.append(a);a[0].focus();a.remove()}else this.designMode?this.win.blur():this.textarea[0].blur();return this},afterChange:function(a){function b(g){setTimeout(function(){a(g)},1)}var c=this.doc,e=c.body;j(c).keyup(function(g){!g.ctrlKey&&!g.altKey&&Hb[g.which]&&a(g)});
j(c).mouseup(a).contextmenu(a);j(this.win).blur(a);j(e).bind("paste",b);j(e).bind("cut",b);return this}});j.EditClass=Za;j.edit=bc;j.iframeDoc=Ab;H(ib,Ja,{init:function(a){function b(g){g=j(g);if(g.hasClass("ke-outline"))return g;if(g.hasClass("ke-toolbar-icon"))return g.parent()}function c(g,h){if(g=b(g.target))g.hasClass("ke-disabled")||g.hasClass("ke-selected")||g[h]("ke-on")}var e=this;ib.parent.init.call(e,a);e.disableMode=D(a.disableMode,false);e.noDisableItemMap=G(D(a.noDisableItems,[]));e._itemMap=
{};e.div.addClass("ke-toolbar").bind("contextmenu,mousedown,mousemove",function(g){g.preventDefault()}).attr("unselectable","on");e.div.mouseover(function(g){c(g,"addClass")}).mouseout(function(g){c(g,"removeClass")}).click(function(g){var h=b(g.target);if(h)h.hasClass("ke-disabled")||e.options.click.call(this,g,h.attr("data-name"))})},get:function(a){if(this._itemMap[a])return this._itemMap[a];return this._itemMap[a]=j("span.ke-icon-"+a,this.div).parent()},select:function(a){cc.call(this,a,function(b){b.addClass("ke-selected")});
return self},unselect:function(a){cc.call(this,a,function(b){b.removeClass("ke-selected").removeClass("ke-on")});return self},enable:function(a){if(a=a.get?a:this.get(a)){a.removeClass("ke-disabled");a.opacity(1)}return this},disable:function(a){if(a=a.get?a:this.get(a)){a.removeClass("ke-selected").addClass("ke-disabled");a.opacity(0.5)}return this},disableAll:function(a,b){var c=this,e=c.noDisableItemMap;if(b)e=G(b);if(a===f?!c.disableMode:a){j("span.ke-outline",c.div).each(function(){var g=j(this),
h=g[0].getAttribute("data-name",2);e[h]||c.disable(g)});c.disableMode=true}else{j("span.ke-outline",c.div).each(function(){var g=j(this),h=g[0].getAttribute("data-name",2);e[h]||c.enable(g)});c.disableMode=false}return c}});j.ToolbarClass=ib;j.toolbar=dc;H($a,Ja,{init:function(a){a.z=a.z||811213;$a.parent.init.call(this,a);this.centerLineMode=D(a.centerLineMode,true);this.div.addClass("ke-menu").bind("click,mousedown",function(b){b.stopPropagation()}).attr("unselectable","on")},addItem:function(a){if(a.title===
"-")this.div.append(j('<div class="ke-menu-separator"></div>'));else{var b=j('<div class="ke-menu-item" unselectable="on"></div>'),c=j('<div class="ke-inline-block ke-menu-item-left"></div>'),e=j('<div class="ke-inline-block ke-menu-item-right"></div>'),g=r(a.height),h=D(a.iconClass,"");this.div.append(b);if(g){b.css("height",g);e.css("line-height",g)}var i;if(this.centerLineMode){i=j('<div class="ke-inline-block ke-menu-item-center"></div>');g&&i.css("height",g)}b.mouseover(function(){j(this).addClass("ke-menu-item-on");
i&&i.addClass("ke-menu-item-center-on")}).mouseout(function(){j(this).removeClass("ke-menu-item-on");i&&i.removeClass("ke-menu-item-center-on")}).click(function(l){a.click.call(j(this));l.stopPropagation()}).append(c);i&&b.append(i);b.append(e);if(a.checked)h="ke-icon-checked";h!==""&&c.html('<span class="ke-inline-block ke-toolbar-icon ke-toolbar-icon-url '+h+'"></span>');e.html(a.title);return this}},remove:function(){this.options.beforeRemove&&this.options.beforeRemove.call(this);j(".ke-menu-item",
this.div[0]).unbind();$a.parent.remove.call(this);return this}});j.MenuClass=$a;j.menu=Db;H(ab,Ja,{init:function(a){a.z=a.z||811213;ab.parent.init.call(this,a);var b=a.colors||[["#E53333","#E56600","#FF9900","#64451D","#DFC5A4","#FFE500"],["#009900","#006600","#99BB00","#B8D100","#60D978","#00D5FF"],["#337FE5","#003399","#4C33E5","#9933E5","#CC33E5","#EE33EE"],["#FFFFFF","#CCCCCC","#999999","#666666","#333333","#000000"]];this.selectedColor=(a.selectedColor||"").toLowerCase();this._cells=[];this.div.addClass("ke-colorpicker").bind("click,mousedown",
function(i){i.stopPropagation()}).attr("unselectable","on");a=this.doc.createElement("table");this.div.append(a);a.className="ke-colorpicker-table";a.cellPadding=0;a.cellSpacing=0;a.border=0;var c=a.insertRow(0),e=c.insertCell(0);e.colSpan=b[0].length;this._addAttr(e,"","ke-colorpicker-cell-top");for(var g=0;g<b.length;g++){c=a.insertRow(g+1);for(var h=0;h<b[g].length;h++){e=c.insertCell(h);this._addAttr(e,b[g][h],"ke-colorpicker-cell")}}},_addAttr:function(a,b,c){var e=this;a=j(a).addClass(c);e.selectedColor===
b.toLowerCase()&&a.addClass("ke-colorpicker-cell-selected");a.attr("title",b||e.options.noColor);a.mouseover(function(){j(this).addClass("ke-colorpicker-cell-on")});a.mouseout(function(){j(this).removeClass("ke-colorpicker-cell-on")});a.click(function(g){g.stop();e.options.click.call(j(this),b)});b?a.append(j('<div class="ke-colorpicker-cell-color" unselectable="on"></div>').css("background-color",b)):a.html(e.options.noColor);j(a).attr("unselectable","on");e._cells.push(a)},remove:function(){n(this._cells,
function(){this.unbind()});ab.parent.remove.call(this);return this}});j.ColorPickerClass=ab;j.colorpicker=ec;H(Eb,{init:function(a){var b=j(a.button),c=a.fieldName||"file",e=a.url||"",g=b.val(),h=a.extraParams||{},i=b[0].className||"",l=a.target||"kindeditor_upload_iframe_"+(new Date).getTime();a.afterError=a.afterError||function(A){alert(A)};var o=[];for(var w in h)o.push('<input type="hidden" name="'+w+'" value="'+h[w]+'" />');c=['<div class="ke-inline-block '+i+'">',a.target?"":'<iframe name="'+
l+'" style="display:none;"></iframe>',a.form?'<div class="ke-upload-area">':'<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="'+l+'" action="'+e+'">','<span class="ke-button-common">',o.join(""),'<input type="button" class="ke-button-common ke-button" value="'+g+'" />',"</span>",'<input type="file" class="ke-upload-file" name="'+c+'" tabindex="-1" />',a.form?"</div>":"</form>","</div>"].join("");c=j(c,b.doc);b.hide();b.before(c);this.div=c;this.button=b;this.iframe=
a.target?j('iframe[name="'+l+'"]'):j("iframe",c);this.form=a.form?j(a.form):j("form",c);this.fileBox=j(".ke-upload-file",c);b=a.width||j(".ke-button-common",c).width();j(".ke-upload-area",c).width(b);this.options=a},submit:function(){var a=this,b=a.iframe;b.bind("load",function(){b.unbind();var c=document.createElement("form");a.fileBox.before(c);j(c).append(a.fileBox);c.reset();j(c).remove(true);c=j.iframeDoc(b);var e=c.getElementsByTagName("pre")[0],g="",h;g=e?e.innerHTML:c.body.innerHTML;g=B(g);
b[0].src="javascript:false";try{h=j.json(g)}catch(i){a.options.afterError.call(a,"<!doctype html><html>"+c.body.parentNode.innerHTML+"</html>")}h&&a.options.afterUpload.call(a,h)});a.form[0].submit();return a},remove:function(){this.fileBox&&this.fileBox.unbind();this.iframe.remove();this.div.remove();this.button.show();return this}});j.UploadButtonClass=Eb;j.uploadbutton=Gc;H(bb,Ja,{init:function(a){var b=D(a.shadowMode,true);a.z=a.z||811213;a.shadowMode=false;a.autoScroll=D(a.autoScroll,true);bb.parent.init.call(this,
a);var c=a.title,e=j(a.body,this.doc),g=a.previewBtn,h=a.yesBtn,i=a.noBtn,l=a.closeBtn,o=D(a.showMask,true);this.div.addClass("ke-dialog").bind("click,mousedown",function(z){z.stopPropagation()});var w=j('<div class="ke-dialog-content"></div>').appendTo(this.div);if(ha&&qa<7)this.iframeMask=j('<iframe src="about:blank" class="ke-dialog-shadow"></iframe>').appendTo(this.div);else b&&j('<div class="ke-dialog-shadow"></div>').appendTo(this.div);b=j('<div class="ke-dialog-header"></div>');w.append(b);
b.html(c);this.closeIcon=j('<span class="ke-dialog-icon-close" title="'+l.name+'"></span>').click(l.click);b.append(this.closeIcon);this.draggable({clickEl:b,beforeDrag:a.beforeDrag});a=j('<div class="ke-dialog-body"></div>');w.append(a);a.append(e);var A=j('<div class="ke-dialog-footer"></div>');if(g||h||i)w.append(A);n([{btn:g,name:"preview"},{btn:h,name:"yes"},{btn:i,name:"no"}],function(){if(this.btn){var z=Hc(this.btn);z.addClass("ke-dialog-"+this.name);A.append(z)}});this.height&&a.height(q(this.height)-
b.height()-A.height());this.div.width(this.div.width());this.div.height(this.div.height());this.mask=null;if(o){g=va(this.doc);e=Math.max(g.scrollWidth,g.clientWidth);g=Math.max(g.scrollHeight,g.clientHeight);this.mask=Bb({x:0,y:0,z:this.z-1,cls:"ke-dialog-mask",width:e,height:g})}this.autoPos(this.div.width(),this.div.height());this.footerDiv=A;this.bodyDiv=a;this.headerDiv=b;this.isLoading=false},setMaskIndex:function(a){this.mask.div.css("z-index",a)},showLoading:function(a){a=D(a,"");var b=this.bodyDiv;
this.loading=j('<div class="ke-dialog-loading"><div class="ke-inline-block ke-dialog-loading-content" style="margin-top:'+Math.round(b.height()/3)+'px;">'+a+"</div></div>").width(b.width()).height(b.height()).css("top",this.headerDiv.height()+"px");b.css("visibility","hidden").after(this.loading);this.isLoading=true;return this},hideLoading:function(){this.loading&&this.loading.remove();this.bodyDiv.css("visibility","visible");this.isLoading=false;return this},remove:function(){this.options.beforeRemove&&
this.options.beforeRemove.call(this);this.mask&&this.mask.remove();this.iframeMask&&this.iframeMask.remove();this.closeIcon.unbind();j("input",this.div).unbind();j("button",this.div).unbind();this.footerDiv.unbind();this.bodyDiv.unbind();this.headerDiv.unbind();j("iframe",this.div).each(function(){j(this).remove()});bb.parent.remove.call(this);return this}});j.DialogClass=bb;j.dialog=fc;j.tabs=Ic;j.loadScript=Fb;j.loadStyle=Gb;j.ajax=Jc;var Da={},Ea={};cb.prototype={lang:function(a){return jc(a,this.langType)},
loadPlugin:function(a,b){var c=this,e=this._pluginStatus;if(!e)e=this._pluginStatus={};if(Da[a]){if(!s(Da[a])){setTimeout(function(){c.loadPlugin(a,b)},100);return c}if(!e[a]){Da[a].call(c,KindEditor);e[a]="inited"}b&&b.call(c);return c}Da[a]="loading";Fb(c.pluginsPath+a+"/"+a+".js?ver="+encodeURIComponent(j.DEBUG?lb:mb),function(){setTimeout(function(){Da[a]&&c.loadPlugin(a,b)},0)});return c},handler:function(a,b){var c=this;c._handlers[a]||(c._handlers[a]=[]);if(s(b)){c._handlers[a].push(b);return c}n(c._handlers[a],
function(){b=this.call(c,b)});return b},clickToolbar:function(a,b){var c=this,e="clickToolbar"+a;if(b===f){if(c._handlers[e])return c.handler(e);c.loadPlugin(a,function(){c.handler(e)});return c}return c.handler(e,b)},updateState:function(){var a=this;n("justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,subscript,superscript,bold,italic,underline,strikethrough".split(","),function(b,c){a.cmd.state(c)?a.toolbar.select(c):a.toolbar.unselect(c)});return a},addContextmenu:function(a){this._contextmenus.push(a);
return this},afterCreate:function(a){return this.handler("afterCreate",a)},beforeRemove:function(a){return this.handler("beforeRemove",a)},beforeGetHtml:function(a){return this.handler("beforeGetHtml",a)},beforeSetHtml:function(a){return this.handler("beforeSetHtml",a)},afterSetHtml:function(a){return this.handler("afterSetHtml",a)},create:function(){function a(){o.height()===0?setTimeout(a,100):b.resize(e,g,false)}var b=this,c=b.fullscreenMode;if(b.isCreated)return b;if(b.srcElement.data("kindeditor"))return b;
b.srcElement.data("kindeditor","true");if(c)va().style.overflow="hidden";else va().style.overflow="";var e=c?va().clientWidth+"px":b.width,g=c?va().clientHeight+"px":b.height;if(ha&&qa<8||Ga)g=r(q(g)+2);var h=b.container=j(b.layout);c?j(document.body).append(h):b.srcElement.before(h);var i=j(".toolbar",h),l=j(".edit",h),o=b.statusbar=j(".statusbar",h);h.removeClass("container").addClass("ke-container ke-container-"+b.themeType).css("width",e);if(c){h.css({position:"absolute",left:0,top:0,"z-index":811211});
if(!Oa)b._scrollPos=Pa();d.scrollTo(0,0);j(document.body).css({height:"1px",overflow:"hidden"});j(document.body.parentNode).css("overflow","hidden");b._fullscreenExecuted=true}else{if(b._fullscreenExecuted){j(document.body).css({height:"",overflow:""});j(document.body.parentNode).css("overflow","")}b._scrollPos&&d.scrollTo(b._scrollPos.x,b._scrollPos.y)}var w=[];j.each(b.items,function(K,Q){if(Q=="|")w.push('<span class="ke-inline-block ke-separator"></span>');else if(Q=="/")w.push('<div class="ke-hr"></div>');
else{w.push('<span class="ke-outline" data-name="'+Q+'" title="'+b.lang(Q)+'" unselectable="on">');w.push('<span class="ke-toolbar-icon ke-toolbar-icon-url ke-icon-'+Q+'" unselectable="on"></span></span>')}});i=b.toolbar=dc({src:i,html:w.join(""),noDisableItems:b.noDisableItems,click:function(K,Q){K.stop();if(b.menu){K=b.menu.name;b.hideMenu();if(K===Q)return}b.clickToolbar(Q)}});var A=q(g)-i.div.height(),z=b.edit=bc({height:A>0&&q(g)>b.minHeight?A:b.minHeight,src:l,srcElement:b.srcElement,designMode:b.designMode,
themesPath:b.themesPath,bodyClass:b.bodyClass,cssPath:b.cssPath,cssData:b.cssData,beforeGetHtml:function(K){K=b.beforeGetHtml(K);K=Ka(kb(K));return Aa(K,b.filterMode?b.htmlTags:null,b.urlType,b.wellFormatMode,b.indentChar)},beforeSetHtml:function(K){K=Aa(K,b.filterMode?b.htmlTags:null,"",false);return b.beforeSetHtml(K)},afterSetHtml:function(){b.edit=z=this;b.afterSetHtml()},afterCreate:function(){b.edit=z=this;b.cmd=z.cmd;b._docMousedownFn=function(){b.menu&&b.hideMenu()};j(z.doc,document).mousedown(b._docMousedownFn);
Kc.call(b);Lc.call(b);Mc.call(b);Nc.call(b);z.afterChange(function(){if(z.designMode){b.updateState();b.addBookmark();b.options.afterChange&&b.options.afterChange.call(b)}});z.textarea.keyup(function(Q){!Q.ctrlKey&&!Q.altKey&&oc[Q.which]&&b.options.afterChange&&b.options.afterChange.call(b)});b.readonlyMode&&b.readonly();b.isCreated=true;if(b.initContent==="")b.initContent=b.html();if(b._undoStack.length>0){var K=b._undoStack.pop();if(K.start){b.html(K.html);z.cmd.range.moveToBookmark(K);b.select()}}b.afterCreate();
b.options.afterCreate&&b.options.afterCreate.call(b)}});o.removeClass("statusbar").addClass("ke-statusbar").append('<span class="ke-inline-block ke-statusbar-center-icon"></span>').append('<span class="ke-inline-block ke-statusbar-right-icon"></span>');if(b._fullscreenResizeHandler){j(d).unbind("resize",b._fullscreenResizeHandler);b._fullscreenResizeHandler=null}a();if(c){b._fullscreenResizeHandler=function(){b.isCreated&&b.resize(va().clientWidth,va().clientHeight,false)};j(d).bind("resize",b._fullscreenResizeHandler);
i.select("fullscreen");o.first().css("visibility","hidden");o.last().css("visibility","hidden")}else{Oa&&j(d).bind("scroll",function(){b._scrollPos=Pa()});b.resizeType>0?zb({moveEl:h,clickEl:o,moveFn:function(K,Q,$,W,pa,F){W+=F;b.resize(null,W)}}):o.first().css("visibility","hidden");b.resizeType===2?zb({moveEl:h,clickEl:o.last(),moveFn:function(K,Q,$,W,pa,F){$+=pa;W+=F;b.resize($,W)}}):o.last().css("visibility","hidden")}return b},remove:function(){var a=this;if(!a.isCreated)return a;a.beforeRemove();
a.srcElement.data("kindeditor","");a.menu&&a.hideMenu();n(a.dialogs,function(){a.hideDialog()});j(document).unbind("mousedown",a._docMousedownFn);a.toolbar.remove();a.edit.remove();a.statusbar.last().unbind();a.statusbar.unbind();a.container.remove();a.container=a.toolbar=a.edit=a.menu=null;a.dialogs=[];a.isCreated=false;return a},resize:function(a,b,c){c=D(c,true);if(a){if(!/%/.test(a)){a=q(a);a=a<this.minWidth?this.minWidth:a}this.container.css("width",r(a));if(c)this.width=r(a)}if(b){b=q(b);editHeight=
q(b)-this.toolbar.div.height()-this.statusbar.height();editHeight=editHeight<this.minHeight?this.minHeight:editHeight;this.edit.setHeight(editHeight);if(c)this.height=r(b)}return this},select:function(){this.isCreated&&this.cmd.select();return this},html:function(a){if(a===f)return this.isCreated?this.edit.html():Ya(this.srcElement);this.isCreated?this.edit.html(a):Ya(this.srcElement,a);this.isCreated&&this.cmd.selection();return this},fullHtml:function(){return this.isCreated?this.edit.html(f,true):
""},text:function(a){return a===f?t(this.html().replace(/<(?!img|embed).*?>/ig,"").replace(/&nbsp;/ig," ")):this.html(u(a))},isEmpty:function(){return t(this.text().replace(/\r\n|\n|\r/,""))===""},isDirty:function(){return t(this.initContent.replace(/\r\n|\n|\r|t/g,""))!==t(this.html().replace(/\r\n|\n|\r|t/g,""))},selectedHtml:function(){var a=this.isCreated?this.cmd.range.html():"";return a=Ka(kb(a))},count:function(a){a=(a||"html").toLowerCase();if(a==="html")return this.html().length;if(a==="text")return this.text().replace(/<(?:img|embed).*?>/ig,
"K").replace(/\r\n|\n|\r/g,"").length;return 0},exec:function(a){a=a.toLowerCase();var b=this.cmd,c=k(a,"selectall,copy,paste,print".split(","))<0;c&&this.addBookmark(false);b[a].apply(b,N(arguments,1));if(c){this.updateState();this.addBookmark(false);this.options.afterChange&&this.options.afterChange.call(this)}return this},insertHtml:function(a,b){if(!this.isCreated)return this;a=this.beforeSetHtml(a);this.exec("inserthtml",a,b);return this},appendHtml:function(a){this.html(this.html()+a);if(this.isCreated){a=
this.cmd;a.range.selectNodeContents(a.doc.body).collapse(false);a.select()}return this},sync:function(){Ya(this.srcElement,this.html());return this},focus:function(){this.isCreated?this.edit.focus():this.srcElement[0].focus();return this},blur:function(){this.isCreated?this.edit.blur():this.srcElement[0].blur();return this},addBookmark:function(a){a=D(a,true);var b=this.edit,c=b.doc.body,e=kb(c.innerHTML);if(a&&this._undoStack.length>0)if(Math.abs(e.length-Ka(this._undoStack[this._undoStack.length-
1].html).length)<this.minChangeSize)return this;if(b.designMode&&!this._firstAddBookmark){b=this.cmd.range;a=b.createBookmark(true);a.html=kb(c.innerHTML);b.moveToBookmark(a)}else a={html:e};this._firstAddBookmark=false;kc(this._undoStack,a);return this},undo:function(){return lc.call(this,this._undoStack,this._redoStack)},redo:function(){return lc.call(this,this._redoStack,this._undoStack)},fullscreen:function(a){this.fullscreenMode=a===f?!this.fullscreenMode:a;this.addBookmark(false);return this.remove().create()},
readonly:function(a){a=D(a,true);var b=this,c=b.edit,e=c.doc;b.designMode?b.toolbar.disableAll(a,[]):n(b.noDisableItems,function(){b.toolbar[a?"disable":"enable"](this)});if(ha)e.body.contentEditable=!a;else e.designMode=a?"off":"on";c.textarea[0].disabled=a},createMenu:function(a){var b=this.toolbar.get(a.name),c=b.pos();a.x=c.x;a.y=c.y+b.height();a.z=this.options.zIndex;a.shadowMode=D(a.shadowMode,this.shadowMode);if(a.selectedColor!==f){a.cls="ke-colorpicker-"+this.themeType;a.noColor=this.lang("noColor");
this.menu=ec(a)}else{a.cls="ke-menu-"+this.themeType;a.centerLineMode=false;this.menu=Db(a)}return this.menu},hideMenu:function(){this.menu.remove();this.menu=null;return this},hideContextmenu:function(){this.contextmenu.remove();this.contextmenu=null;return this},createDialog:function(a){var b=this;a.z=b.options.zIndex;a.shadowMode=D(a.shadowMode,b.shadowMode);a.closeBtn=D(a.closeBtn,{name:b.lang("close"),click:function(){b.hideDialog();ha&&b.cmd&&b.cmd.select()}});a.noBtn=D(a.noBtn,{name:b.lang(a.yesBtn?
"no":"close"),click:function(){b.hideDialog();ha&&b.cmd&&b.cmd.select()}});if(b.dialogAlignType!="page")a.alignEl=b.container;a.cls="ke-dialog-"+b.themeType;if(b.dialogs.length>0){var c=b.dialogs[b.dialogs.length-1];b.dialogs[0].setMaskIndex(c.z+2);a.z=c.z+3;a.showMask=false}a=fc(a);b.dialogs.push(a);return a},hideDialog:function(){this.dialogs.length>0&&this.dialogs.pop().remove();this.dialogs.length>0&&this.dialogs[0].setMaskIndex(this.dialogs[this.dialogs.length-1].z-1);return this},errorDialog:function(a){var b=
this.createDialog({width:750,title:this.lang("uploadError"),body:'<div style="padding:10px 20px;"><iframe frameborder="0" style="width:708px;height:400px;"></iframe></div>'});b=j("iframe",b.div);var c=j.iframeDoc(b);c.open();c.write(a);c.close();j(c.body).css("background-color","#FFF");b[0].contentWindow.focus();return this}};_instances=[];j.remove=function(a){db(a,function(b){this.remove();_instances.splice(b,1)})};j.sync=function(a){db(a,function(){this.sync()})};j.html=function(a,b){db(a,function(){this.html(b)})};
j.insertHtml=function(a,b){db(a,function(){this.insertHtml(b)})};j.appendHtml=function(a,b){db(a,function(){this.appendHtml(b)})};ha&&qa<7&&Ha(document,"BackgroundImageCache",true);j.EditorClass=cb;j.editor=Qc;j.create=mc;j.instances=_instances;j.plugin=hc;j.lang=jc;hc("core",function(a){var b=this,c={undo:"Z",redo:"Y",bold:"B",italic:"I",underline:"U",print:"P",selectall:"A"};b.afterSetHtml(function(){b.options.afterChange&&b.options.afterChange.call(b)});b.afterCreate(function(){if(b.syncType==
"form"){for(var g=a(b.srcElement),h=false;g=g.parent();)if(g.name=="form"){h=true;break}if(h){g.bind("submit",function(){b.sync();a(d).bind("unload",function(){b.edit.textarea.remove()})});var i=a('[type="reset"]',g);i.click(function(){b.html(b.initContent);b.cmd.selection()});b.beforeRemove(function(){g.unbind();i.unbind()})}}});b.clickToolbar("source",function(){if(b.edit.designMode){b.toolbar.disableAll(true);b.edit.design(false);b.toolbar.select("source")}else{b.toolbar.disableAll(false);b.edit.design(true);
b.toolbar.unselect("source");Oa?setTimeout(function(){b.cmd.selection()},0):b.cmd.selection()}b.designMode=b.edit.designMode});b.afterCreate(function(){b.designMode||b.toolbar.disableAll(true).select("source")});b.clickToolbar("fullscreen",function(){b.fullscreen()});if(b.fullscreenShortcut){var e=false;b.afterCreate(function(){a(b.edit.doc,b.edit.textarea).keyup(function(g){g.which==27&&setTimeout(function(){b.fullscreen()},0)});if(e){if(ha&&!b.designMode)return;b.focus()}e||(e=true)})}n("undo,redo".split(","),
function(g,h){c[h]&&b.afterCreate(function(){ma(this.edit.doc,c[h],function(){b.clickToolbar(h)})});b.clickToolbar(h,function(){b[h]()})});b.clickToolbar("formatblock",function(){var g=b.lang("formatblock.formatBlock"),h={h1:28,h2:24,h3:18,H4:14,p:12},i=b.cmd.val("formatblock"),l=b.createMenu({name:"formatblock",width:b.langType=="en"?200:150});n(g,function(o,w){var A="font-size:"+h[o]+"px;";if(o.charAt(0)==="h")A+="font-weight:bold;";l.addItem({title:'<span style="'+A+'" unselectable="on">'+w+"</span>",
height:h[o]+12,checked:i===o||i===w,click:function(){b.select().exec("formatblock","<"+o+">").hideMenu()}})})});b.clickToolbar("fontname",function(){var g=b.cmd.val("fontname"),h=b.createMenu({name:"fontname",width:150});n(b.lang("fontname.fontName"),function(i,l){h.addItem({title:'<span style="font-family: '+i+';" unselectable="on">'+l+"</span>",checked:g===i.toLowerCase()||g===l.toLowerCase(),click:function(){b.exec("fontname",i).hideMenu()}})})});b.clickToolbar("fontsize",function(){var g=b.cmd.val("fontsize"),
h=b.createMenu({name:"fontsize",width:150});n(b.fontSizeTable,function(i,l){h.addItem({title:'<span style="font-size:'+l+';" unselectable="on">'+l+"</span>",height:q(l)+12,checked:g===l,click:function(){b.exec("fontsize",l).hideMenu()}})})});n("forecolor,hilitecolor".split(","),function(g,h){b.clickToolbar(h,function(){b.createMenu({name:h,selectedColor:b.cmd.val(h)||"default",colors:b.colorTable,click:function(i){b.exec(h,i).hideMenu()}})})});n("cut,copy,paste".split(","),function(g,h){b.clickToolbar(h,
function(){b.focus();try{b.exec(h,null)}catch(i){alert(b.lang(h+"Error"))}})});b.clickToolbar("about",function(){var g='<div style="margin:20px;"><div>KindEditor '+mb+'</div><div>Copyright &copy; <a href="http://www.kindsoft.net/" target="_blank">kindsoft.net</a> All rights reserved.</div></div>';b.createDialog({name:"about",width:350,title:b.lang("about"),body:g})});b.plugin.getSelectedLink=function(){return b.cmd.commonAncestor("a")};b.plugin.getSelectedImage=function(){return jb(b.edit.cmd.range,
function(g){return!/^ke-\w+$/i.test(g[0].className)})};b.plugin.getSelectedFlash=function(){return jb(b.edit.cmd.range,function(g){return g[0].className=="ke-flash"})};b.plugin.getSelectedMedia=function(){return jb(b.edit.cmd.range,function(g){return g[0].className=="ke-media"||g[0].className=="ke-rm"})};b.plugin.getSelectedAnchor=function(){return jb(b.edit.cmd.range,function(g){return g[0].className=="ke-anchor"})};n("link,image,flash,media,anchor".split(","),function(g,h){var i=h.charAt(0).toUpperCase()+
h.substr(1);n("edit,delete".split(","),function(l,o){b.addContextmenu({title:b.lang(o+i),click:function(){b.loadPlugin(h,function(){b.plugin[h][o]();b.hideMenu()})},cond:b.plugin["getSelected"+i],width:150,iconClass:o=="edit"?"ke-icon-"+h:f})});b.addContextmenu({title:"-"})});b.plugin.getSelectedTable=function(){return b.cmd.commonAncestor("table")};b.plugin.getSelectedRow=function(){return b.cmd.commonAncestor("tr")};b.plugin.getSelectedCell=function(){return b.cmd.commonAncestor("td")};n("prop,cellprop,colinsertleft,colinsertright,rowinsertabove,rowinsertbelow,rowmerge,colmerge,rowsplit,colsplit,coldelete,rowdelete,insert,delete".split(","),
function(g,h){g=k(h,["prop","delete"])<0?b.plugin.getSelectedCell:b.plugin.getSelectedTable;b.addContextmenu({title:b.lang("table"+h),click:function(){b.loadPlugin("table",function(){b.plugin.table[h]();b.hideMenu()})},cond:g,width:170,iconClass:"ke-icon-table"+h})});b.addContextmenu({title:"-"});n("selectall,justifyleft,justifycenter,justifyright,justifyfull,insertorderedlist,insertunorderedlist,indent,outdent,subscript,superscript,hr,print,bold,italic,underline,strikethrough,removeformat,unlink".split(","),
function(g,h){c[h]&&b.afterCreate(function(){ma(this.edit.doc,c[h],function(){b.cmd.selection();b.clickToolbar(h)})});b.clickToolbar(h,function(){b.focus().exec(h,null)})});b.afterCreate(function(){function g(){i.range.moveToBookmark(l);i.select();if(Na){a("div."+w,o).each(function(){a(this).after("<br />").remove(true)});a("span.Apple-style-span",o).remove(true);a("span.Apple-tab-span",o).remove(true);a("span[style]",o).each(function(){a(this).css("white-space")=="nowrap"&&a(this).remove(true)});
a("meta",o).remove()}var z=o[0].innerHTML;o.remove();if(z!==""){if(Na)z=z.replace(/(<br>)\1/ig,"$1");if(b.pasteType===2){z=z.replace(/(<(?:p|p\s[^>]*)>) *(<\/p>)/ig,"");if(/schemas-microsoft-com|worddocument|mso-\w+/i.test(z))z=Sa(z,b.filterMode?b.htmlTags:a.options.htmlTags);else{z=Aa(z,b.filterMode?b.htmlTags:null);z=b.beforeSetHtml(z)}}if(b.pasteType===1){z=z.replace(/&nbsp;/ig," ");z=z.replace(/\n\s*\n/g,"\n");z=z.replace(/<br[^>]*>/ig,"\n");z=z.replace(/<\/p><p[^>]*>/ig,"\n");z=z.replace(/<[^>]+>/g,
"");z=z.replace(/ {2}/g," &nbsp;");if(b.newlineTag=="p"){if(/\n/.test(z))z=z.replace(/^/,"<p>").replace(/$/,"<br /></p>").replace(/\n/g,"<br /></p><p>")}else z=z.replace(/\n/g,"<br />$&")}b.insertHtml(z,true)}}var h=b.edit.doc,i,l,o,w="__kindeditor_paste__",A=false;a(h.body).bind("paste",function(z){if(b.pasteType===0)z.stop();else if(!A){A=true;a("div."+w,h).remove();i=b.cmd.selection();l=i.range.createBookmark();o=a('<div class="'+w+'"></div>',h).css({position:"absolute",width:"1px",height:"1px",
overflow:"hidden",left:"-1981px",top:a(l.start).pos().y+"px","white-space":"nowrap"});a(h.body).append(o);if(ha){var K=i.range.get(true);K.moveToElementText(o[0]);K.select();K.execCommand("paste");z.preventDefault()}else{i.range.selectNodeContents(o[0]);i.select();o[0].tabIndex=-1;o[0].focus()}setTimeout(function(){g();A=false},0)}})});b.beforeGetHtml(function(g){if(ha&&qa<=8){g=g.replace(/<div\s+[^>]*data-ke-input-tag="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(h,i){return unescape(i)});g=g.replace(/(<input)((?:\s+[^>]*)?>)/ig,
function(h,i,l){if(!/\s+type="[^"]+"/i.test(h))return i+' type="text"'+l;return h})}return g.replace(/(<(?:noscript|noscript\s[^>]*)>)([\s\S]*?)(<\/noscript>)/ig,function(h,i,l,o){return i+B(l).replace(/\s+/g," ")+o}).replace(/<img[^>]*class="?ke-(flash|rm|media)"?[^>]*>/ig,function(h){h=ka(h);var i=ra(h.style||""),l=Pb(h["data-ke-tag"]),o=D(i.width,"");i=D(i.height,"");if(/px/i.test(o))o=q(o);if(/px/i.test(i))i=q(i);l.width=D(h.width,o);l.height=D(h.height,i);return pb(l)}).replace(/<img[^>]*class="?ke-anchor"?[^>]*>/ig,
function(h){h=ka(h);return'<a name="'+unescape(h["data-ke-name"])+'"></a>'}).replace(/<div\s+[^>]*data-ke-script-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(h,i,l){return"<script"+unescape(i)+">"+unescape(l)+"<\/script>"}).replace(/<div\s+[^>]*data-ke-noscript-attr="([^"]*)"[^>]*>([\s\S]*?)<\/div>/ig,function(h,i,l){return"<noscript"+unescape(i)+">"+unescape(l)+"</noscript>"}).replace(/(<[^>]*)data-ke-src="([^"]*)"([^>]*>)/ig,function(h,i,l){h=h.replace(/(\s+(?:href|src)=")[^"]*(")/i,function(o,
w,A){return w+B(l)+A});return h=h.replace(/\s+data-ke-src="[^"]*"/i,"")}).replace(/(<[^>]+\s)data-ke-(on\w+="[^"]*"[^>]*>)/ig,function(h,i,l){return i+l})});b.beforeSetHtml(function(g){if(ha&&qa<=8)g=g.replace(/<input[^>]*>|<(select|button)[^>]*>[\s\S]*?<\/\1>/ig,function(h){var i=ka(h);if(ra(i.style||"").display=="none")return'<div class="ke-display-none" data-ke-input-tag="'+escape(h)+'"></div>';return h});return g.replace(/<embed[^>]*type="([^"]+)"[^>]*>(?:<\/embed>)?/ig,function(h){h=ka(h);h.src=
D(h.src,"");h.width=D(h.width,0);h.height=D(h.height,0);return Qb(b.themesPath+"common/blank.gif",h)}).replace(/<a[^>]*name="([^"]+)"[^>]*>(?:<\/a>)?/ig,function(h){var i=ka(h);if(i.href!==f)return h;return'<img class="ke-anchor" src="'+b.themesPath+'common/anchor.gif" data-ke-name="'+escape(i.name)+'" />'}).replace(/<script([^>]*)>([\s\S]*?)<\/script>/ig,function(h,i,l){return'<div class="ke-script" data-ke-script-attr="'+escape(i)+'">'+escape(l)+"</div>"}).replace(/<noscript([^>]*)>([\s\S]*?)<\/noscript>/ig,
function(h,i,l){return'<div class="ke-noscript" data-ke-noscript-attr="'+escape(i)+'">'+escape(l)+"</div>"}).replace(/(<[^>]*)(href|src)="([^"]*)"([^>]*>)/ig,function(h,i,l,o,w){if(h.match(/\sdata-ke-src="[^"]*"/i))return h;return h=i+l+'="'+o+'" data-ke-src="'+u(o)+'"'+w}).replace(/(<[^>]+\s)(on\w+="[^"]*"[^>]*>)/ig,function(h,i,l){return i+"data-ke-"+l}).replace(/<table[^>]*\s+border="0"[^>]*>/ig,function(h){if(h.indexOf("ke-zeroborder")>=0)return h;return fa(h,"ke-zeroborder")})})})}})(window);
KindEditor.lang({source:"HTML\u6d60\uff47\u721c",preview:"\u68f0\u52ee\ue74d",undo:"\u935a\u5ea8\ufffd\ufffd(Ctrl+Z)",redo:"\u9353\u5d88\u7e58(Ctrl+Y)",cut:"\u9353\ue044\u578f(Ctrl+X)",copy:"\u6fb6\u5d85\u57d7(Ctrl+C)",paste:"\u7eee\u6a3f\u521b(Ctrl+V)",plainpaste:"\u7eee\u6a3f\u521b\u6d93\u70d8\u68e4\u93cd\u714e\u7d21\u93c2\u56e8\u6e70",wordpaste:"\u6d60\u5db9ord\u7eee\u6a3f\u521b",selectall:"\u934f\u3129\ufffd\ufffd(Ctrl+A)",justifyleft:"\u5bb8\ufe40\ue1ee\u69bb\ufffd",justifycenter:"\u705e\u546c\u8151",justifyright:"\u9359\u51b2\ue1ee\u69bb\ufffd",justifyfull:"\u6d93\u3087\ue06c\u7035\u5f52\u7d88",insertorderedlist:"\u7f02\u6827\u5f7f",insertunorderedlist:"\u6924\u572d\u6d30\u7ed7\ufe40\u5f7f",indent:"\u6fa7\u70b2\u59de\u7f02\u2544\u7e58",outdent:"\u9351\u5fd3\u76af\u7f02\u2544\u7e58",subscript:"\u6d93\u5b2b\u7223",superscript:"\u6d93\u5a43\u7223",formatblock:"\u5a08\u4f43\u60e4",fontname:"\u701b\u693e\u7d8b",fontsize:"\u93c2\u56e7\u74e7\u6fb6\u0443\u76ac",forecolor:"\u93c2\u56e7\u74e7\u68f0\u6ec6\u58ca",hilitecolor:"\u93c2\u56e7\u74e7\u9473\u5c7e\u6ad9",
bold:"\u7eee\u693e\u7d8b(Ctrl+B)",italic:"\u93c2\u6ec0\u7d8b(Ctrl+I)",underline:"\u6d93\u5b2a\u579d\u7efe\ufffd(Ctrl+U)",strikethrough:"\u9352\u72bb\u6ace\u7efe\ufffd",removeformat:"\u9352\u72bb\u6ace\u93cd\u714e\u7d21",image:"\u9365\u5267\u5896",multiimage:"\u93b5\u5f52\u567a\u9365\u5267\u5896\u6d93\u5a41\u7d36",flash:"Flash",media:"\u7459\u55db\u7176\u68f0\ufffd",table:"\u741b\u3126\u7278",tablecell:"\u9357\u66de\u5393\u93cd\ufffd",hr:"\u93bb\u6391\u53c6\u59af\ue046\u568e",emoticons:"\u93bb\u6391\u53c6\u741b\u3126\u510f",link:"\u74d2\u546f\u9a87\u95be\u70ac\u5e34",unlink:"\u9359\u6828\u79f7\u74d2\u546f\u9a87\u95be\u70ac\u5e34",fullscreen:"\u934f\u3125\u7746\u93c4\u5267\u305a",about:"\u934f\u5145\u7c2c",print:"\u93b5\u64b3\u5d43(Ctrl+P)",filemanager:"\u93c2\u56e6\u6b22\u7ecc\u6d2a\u68ff",code:"\u93bb\u6391\u53c6\u7ecb\u5b2a\u7c2d\u6d60\uff47\u721c",map:"Google\u9366\u677f\u6d58",baidumap:"\u9427\u60e7\u5bb3\u9366\u677f\u6d58",lineheight:"\u741b\u5c83\u7a9b",clearhtml:"\u5a13\u546f\u608aHTML\u6d60\uff47\u721c",pagebreak:"\u93bb\u6391\u53c6\u9352\u55db\u3009\u7ed7\ufffd",quickformat:"\u6d93\ufffd\u95bf\ue1bd\u5e13\u9417\ufffd",insertfile:"\u93bb\u6391\u53c6\u93c2\u56e6\u6b22",template:"\u93bb\u6391\u53c6\u59af\u2103\u6f98",
anchor:"\u95bf\u6c31\u5063",yes:"\u7ead\ue1bc\u757e",no:"\u9359\u6828\u79f7",close:"\u934f\u62bd\u68f4",editImage:"\u9365\u5267\u5896\u705e\u70b4\ufffd\ufffd",deleteImage:"\u9352\u72bb\u6ace\u9365\u5267\u5896",editFlash:"Flash\u705e\u70b4\ufffd\ufffd",deleteFlash:"\u9352\u72bb\u6aceFlash",editMedia:"\u7459\u55db\u7176\u68f0\u621d\u7758\u93ac\ufffd",deleteMedia:"\u9352\u72bb\u6ace\u7459\u55db\u7176\u68f0\ufffd",editLink:"\u74d2\u546f\u9a87\u95be\u70ac\u5e34\u705e\u70b4\ufffd\ufffd",deleteLink:"\u9359\u6828\u79f7\u74d2\u546f\u9a87\u95be\u70ac\u5e34",editAnchor:"\u95bf\u6c31\u5063\u705e\u70b4\ufffd\ufffd",deleteAnchor:"\u9352\u72bb\u6ace\u95bf\u6c31\u5063",tableprop:"\u741b\u3126\u7278\u705e\u70b4\ufffd\ufffd",tablecellprop:"\u9357\u66de\u5393\u93cd\u714e\u7758\u93ac\ufffd",tableinsert:"\u93bb\u6391\u53c6\u741b\u3126\u7278",tabledelete:"\u9352\u72bb\u6ace\u741b\u3126\u7278",tablecolinsertleft:"\u5bb8\ufe3f\u6676\u93bb\u6391\u53c6\u9352\ufffd",tablecolinsertright:"\u9359\u5145\u6676\u93bb\u6391\u53c6\u9352\ufffd",tablerowinsertabove:"\u6d93\u5a43\u67df\u93bb\u6391\u53c6\u741b\ufffd",tablerowinsertbelow:"\u6d93\u5b2b\u67df\u93bb\u6391\u53c6\u741b\ufffd",tablerowmerge:"\u935a\u621c\u7b05\u935a\u581d\u82df\u9357\u66de\u5393\u93cd\ufffd",tablecolmerge:"\u935a\u621d\u5f78\u935a\u581d\u82df\u9357\u66de\u5393\u93cd\ufffd",
tablerowsplit:"\u93b7\u55d7\u578e\u741b\ufffd",tablecolsplit:"\u93b7\u55d7\u578e\u9352\ufffd",tablecoldelete:"\u9352\u72bb\u6ace\u9352\ufffd",tablerowdelete:"\u9352\u72bb\u6ace\u741b\ufffd",noColor:"\u93c3\u72bb\ue581\u9479\ufffd",pleaseSelectFile:"\u7487\u70fd\ufffd\u590b\u5ae8\u93c2\u56e6\u6b22\u9286\ufffd",invalidImg:"\u7487\u75af\u7ded\u934f\u30e6\u6e41\u93c1\u5822\u6b91URL\u9366\u677f\u6f43\u9286\u4fd3n\u9359\ue044\u5391\u7481\u7ad5pg,gif,bmp,png\u93cd\u714e\u7d21\u9286\ufffd",invalidMedia:"\u7487\u75af\u7ded\u934f\u30e6\u6e41\u93c1\u5822\u6b91URL\u9366\u677f\u6f43\u9286\u4fd3n\u9359\ue044\u5391\u7481\u7ae4wf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb\u93cd\u714e\u7d21\u9286\ufffd",invalidWidth:"\u7039\u85c9\u5bb3\u8e47\u5474\u300f\u6d93\u70d8\u669f\u701b\u693c\ufffd\ufffd",invalidHeight:"\u6942\u6a3a\u5bb3\u8e47\u5474\u300f\u6d93\u70d8\u669f\u701b\u693c\ufffd\ufffd",invalidBorder:"\u6748\u89c4\ue50b\u8e47\u5474\u300f\u6d93\u70d8\u669f\u701b\u693c\ufffd\ufffd",invalidUrl:"\u7487\u75af\u7ded\u934f\u30e6\u6e41\u93c1\u5822\u6b91URL\u9366\u677f\u6f43\u9286\ufffd",invalidRows:"\u741b\u5c7e\u669f\u6d93\u54c4\u7e40\u95ab\u5910\u300d\u951b\u5c7d\u5f67\u934f\u4f7d\ue18f\u6748\u64b3\u53c6\u6fb6\u0442\u7c2c0\u9428\u52ec\u669f\u701b\u693c\ufffd\ufffd",invalidCols:"\u9352\u6941\u669f\u6d93\u54c4\u7e40\u95ab\u5910\u300d\u951b\u5c7d\u5f67\u934f\u4f7d\ue18f\u6748\u64b3\u53c6\u6fb6\u0442\u7c2c0\u9428\u52ec\u669f\u701b\u693c\ufffd\ufffd",invalidPadding:"\u6748\u7845\u7a9b\u8e47\u5474\u300f\u6d93\u70d8\u669f\u701b\u693c\ufffd\ufffd",
invalidSpacing:"\u95c2\u78cb\u7a9b\u8e47\u5474\u300f\u6d93\u70d8\u669f\u701b\u693c\ufffd\ufffd",invalidJson:"\u93c8\u5d85\u59df\u9363\u3125\u5f42\u9422\u71b8\u6660\u95c5\u6ebf\ufffd\ufffd",uploadSuccess:"\u6d93\u5a41\u7d36\u93b4\u612c\u59db\u9286\ufffd",cutError:"\u93ae\u3127\u6b91\u5a34\u5fda\ue74d\u9363\u3125\u7568\u934f\u3128\ue195\u7f03\ue1bb\u7b09\u934f\u4f7d\ue18f\u6d63\u8de8\u6564\u9353\ue044\u578f\u93bf\u5d84\u7d94\u951b\u5c83\ue1ec\u6d63\u8de8\u6564\u8e47\ue0a3\u5d4e\u95bf\ufffd(Ctrl+X)\u93c9\u30e5\u756c\u93b4\u6129\ufffd\ufffd",copyError:"\u93ae\u3127\u6b91\u5a34\u5fda\ue74d\u9363\u3125\u7568\u934f\u3128\ue195\u7f03\ue1bb\u7b09\u934f\u4f7d\ue18f\u6d63\u8de8\u6564\u6fb6\u5d85\u57d7\u93bf\u5d84\u7d94\u951b\u5c83\ue1ec\u6d63\u8de8\u6564\u8e47\ue0a3\u5d4e\u95bf\ufffd(Ctrl+C)\u93c9\u30e5\u756c\u93b4\u6129\ufffd\ufffd",pasteError:"\u93ae\u3127\u6b91\u5a34\u5fda\ue74d\u9363\u3125\u7568\u934f\u3128\ue195\u7f03\ue1bb\u7b09\u934f\u4f7d\ue18f\u6d63\u8de8\u6564\u7eee\u6a3f\u521b\u93bf\u5d84\u7d94\u951b\u5c83\ue1ec\u6d63\u8de8\u6564\u8e47\ue0a3\u5d4e\u95bf\ufffd(Ctrl+V)\u93c9\u30e5\u756c\u93b4\u6129\ufffd\ufffd",ajaxLoading:"\u9354\u72ba\u6d47\u6d93\ue168\u7d1d\u7487\u98ce\u25e2\u934a\ufffd ...",uploadLoading:"\u6d93\u5a41\u7d36\u6d93\ue168\u7d1d\u7487\u98ce\u25e2\u934a\ufffd ...",uploadError:"\u6d93\u5a41\u7d36\u95bf\u6b12\ue1e4","plainpaste.comment":"\u7487\u8702\u5a07\u9422\u3125\u63e9\u93b9\u70fd\u656d(Ctrl+V)\u93b6\u5a42\u5534\u7039\u572d\u77d8\u7490\u6751\u57cc\u6d93\u5b2e\u6f70\u9428\u52ec\u67df\u5997\u55db\u5677\u9286\ufffd","wordpaste.comment":"\u7487\u8702\u5a07\u9422\u3125\u63e9\u93b9\u70fd\u656d(Ctrl+V)\u93b6\u5a42\u5534\u7039\u572d\u77d8\u7490\u6751\u57cc\u6d93\u5b2e\u6f70\u9428\u52ec\u67df\u5997\u55db\u5677\u9286\ufffd","code.pleaseInput":"\u7487\u75af\u7ded\u934f\u30e7\u25bc\u6434\u5fce\u552c\u942e\u4f75\ufffd\ufffd",
"link.url":"URL","link.linkType":"\u93b5\u64b3\u7d11\u7eeb\u8bf2\u7037","link.newWindow":"\u93c2\u626e\u7365\u9359\ufffd","link.selfWindow":"\u8930\u64b3\u58a0\u7ed0\u6940\u5f5b","flash.url":"URL","flash.width":"\u7039\u85c9\u5bb3","flash.height":"\u6942\u6a3a\u5bb3","flash.upload":"\u6d93\u5a41\u7d36","flash.viewServer":"\u93c2\u56e6\u6b22\u7ecc\u6d2a\u68ff","media.url":"URL","media.width":"\u7039\u85c9\u5bb3","media.height":"\u6942\u6a3a\u5bb3","media.autostart":"\u9477\ue044\u59e9\u93be\ue15f\u6581","media.upload":"\u6d93\u5a41\u7d36","media.viewServer":"\u93c2\u56e6\u6b22\u7ecc\u6d2a\u68ff","image.remoteImage":"\u7f03\u6220\u7cb6\u9365\u5267\u5896","image.localImage":"\u93c8\ue100\u6e74\u6d93\u5a41\u7d36","image.remoteUrl":"\u9365\u5267\u5896\u9366\u677f\u6f43","image.localUrl":"\u6d93\u5a41\u7d36\u93c2\u56e6\u6b22","image.size":"\u9365\u5267\u5896\u6fb6\u0443\u76ac","image.width":"\u7039\ufffd","image.height":"\u6942\ufffd",
"image.resetSize":"\u95b2\u5d87\u7586\u6fb6\u0443\u76ac","image.align":"\u7035\u5f52\u7d88\u93c2\u7470\u7d21","image.defaultAlign":"\u699b\u6a3f\ue17b\u93c2\u7470\u7d21","image.leftAlign":"\u5bb8\ufe40\ue1ee\u69bb\ufffd","image.rightAlign":"\u9359\u51b2\ue1ee\u69bb\ufffd","image.imgTitle":"\u9365\u5267\u5896\u7487\u5b58\u69d1","image.upload":"\u5a34\u5fda\ue74d...","image.viewServer":"\u9365\u5267\u5896\u7ecc\u6d2a\u68ff","multiimage.uploadDesc":"\u934f\u4f7d\ue18f\u9422\u3126\u57db\u935a\u5c7e\u6902\u6d93\u5a41\u7d36<%=uploadLimit%>\u5bee\u72b2\u6d58\u9417\u56f7\u7d1d\u9357\u66de\u7d36\u9365\u5267\u5896\u7039\u5f52\u567a\u6d93\u5d88\u79f4\u6769\ufffd%=sizeLimit%>","multiimage.startUpload":"\u5bee\ufffd\u6fee\u5b29\u7b02\u6d7c\ufffd","multiimage.clearAll":"\u934f\u3129\u5134\u5a13\u546f\u2516","multiimage.insertAll":"\u934f\u3129\u5134\u93bb\u6391\u53c6","multiimage.queueLimitExceeded":"\u93c2\u56e6\u6b22\u93c1\u4f34\u567a\u74d2\u5470\u7e43\u95c4\u612c\u57d7\u9286\ufffd","multiimage.fileExceedsSizeLimit":"\u93c2\u56e6\u6b22\u6fb6\u0443\u76ac\u74d2\u5470\u7e43\u95c4\u612c\u57d7\u9286\ufffd","multiimage.zeroByteFile":"\u93c3\u72b3\u7876\u6d93\u5a41\u7d36\u7ecc\u70d8\u6783\u6d60\u8eb2\ufffd\ufffd",
"multiimage.invalidFiletype":"\u93c2\u56e6\u6b22\u7eeb\u8bf2\u7037\u6d93\u5d86\ue11c\u7ead\ue1ba\ufffd\ufffd","multiimage.unknownError":"\u9359\u6220\u6553\u5bee\u509a\u7236\u951b\u5c7e\u68e4\u5a09\u66da\u7b02\u6d7c\u72ae\ufffd\ufffd","multiimage.pending":"\u7edb\u590a\u7ddf\u6d93\u5a41\u7d36","multiimage.uploadError":"\u6d93\u5a41\u7d36\u6fb6\u8fab\u89e6","filemanager.emptyFolder":"\u7ecc\u70d8\u6783\u6d60\u8dfa\u3059","filemanager.moveup":"\u7ec9\u8bf2\u57cc\u6d93\u5a41\u7af4\u7efe\u0444\u6783\u6d60\u8dfa\u3059","filemanager.viewType":"\u93c4\u5267\u305a\u93c2\u7470\u7d21\u951b\ufffd","filemanager.viewImage":"\u7f02\u2543\u6690\u9365\ufffd","filemanager.listImage":"\u7487\ufe3e\u7c8f\u6dc7\u2103\u4f05","filemanager.orderType":"\u93ba\u6391\u7c2d\u93c2\u7470\u7d21\u951b\ufffd","filemanager.fileName":"\u935a\u5d87\u041e","filemanager.fileSize":"\u6fb6\u0443\u76ac","filemanager.fileType":"\u7eeb\u8bf2\u7037","insertfile.url":"URL","insertfile.title":"\u93c2\u56e6\u6b22\u7487\u5b58\u69d1","insertfile.upload":"\u6d93\u5a41\u7d36",
"insertfile.viewServer":"\u93c2\u56e6\u6b22\u7ecc\u6d2a\u68ff","table.cells":"\u9357\u66de\u5393\u93cd\u517c\u669f","table.rows":"\u741b\u5c7e\u669f","table.cols":"\u9352\u6941\u669f","table.size":"\u6fb6\u0443\u76ac","table.width":"\u7039\u85c9\u5bb3","table.height":"\u6942\u6a3a\u5bb3","table.percent":"%","table.px":"px","table.space":"\u6748\u7845\u7a9b\u95c2\u78cb\u7a9b","table.padding":"\u6748\u7845\u7a9b","table.spacing":"\u95c2\u78cb\u7a9b","table.align":"\u7035\u5f52\u7d88\u93c2\u7470\u7d21","table.textAlign":"\u59d8\u6751\u94a9\u7035\u5f52\u7d88","table.verticalAlign":"\u9368\u509c\u6d3f\u7035\u5f52\u7d88","table.alignDefault":"\u699b\u6a3f\ue17b","table.alignLeft":"\u5bb8\ufe40\ue1ee\u69bb\ufffd","table.alignCenter":"\u705e\u546c\u8151","table.alignRight":"\u9359\u51b2\ue1ee\u69bb\ufffd","table.alignTop":"\u6924\u5815\u5134","table.alignMiddle":"\u6d93\ue162\u5134","table.alignBottom":"\u6434\u66e2\u5134",
"table.alignBaseline":"\u9369\u8679\u568e","table.border":"\u6748\u89c4\ue50b","table.borderWidth":"\u6748\u89c4\ue50b","table.borderColor":"\u68f0\u6ec6\u58ca","table.backgroundColor":"\u9473\u5c7e\u6ad9\u68f0\u6ec6\u58ca","map.address":"\u9366\u677f\u6f43: ","map.search":"\u93bc\u6ec5\u50a8","baidumap.address":"\u9366\u677f\u6f43: ","baidumap.search":"\u93bc\u6ec5\u50a8","baidumap.insertDynamicMap":"\u93bb\u6391\u53c6\u9354\u3126\ufffd\u4f78\u6e74\u9365\ufffd","anchor.name":"\u95bf\u6c31\u5063\u935a\u5d87\u041e","formatblock.formatBlock":{h1:"\u93cd\u56ec\ue57d 1",h2:"\u93cd\u56ec\ue57d 2",h3:"\u93cd\u56ec\ue57d 3",h4:"\u93cd\u56ec\ue57d 4",p:"\u59dd\ufffd \u93c2\ufffd"},"fontname.fontName":{SimSun:"\u7039\u5b29\u7d8b",NSimSun:"\u93c2\u677f\u756b\u6d63\ufffd",FangSong_GB2312:"\u6d60\u57ae\u756b_GB2312",KaiTi_GB2312:"\u59a4\u8702\u7d8b_GB2312",SimHei:"\u699b\u621c\u7d8b","Microsoft YaHei":"\u5bf0\ue1bf\u848b\u95c6\u5474\u7ca6",
Arial:"Arial","Arial Black":"Arial Black","Times New Roman":"Times New Roman","Courier New":"Courier New",Tahoma:"Tahoma",Verdana:"Verdana"},"lineheight.lineHeight":[{"1":"\u9357\u66de\ufffd\u5d88\ue511\u74ba\ufffd"},{"1.5":"1.5\u934a\u5d88\ue511\u74ba\ufffd"},{"2":"2\u934a\u5d88\ue511\u74ba\ufffd"},{"2.5":"2.5\u934a\u5d88\ue511\u74ba\ufffd"},{"3":"3\u934a\u5d88\ue511\u74ba\ufffd"}],"template.selectTemplate":"\u9359\ue21e\ufffd\u590b\u0101\u93c9\ufffd","template.replaceContent":"\u93c7\u630e\u5d32\u8930\u64b3\u58a0\u9350\u546d\ue190","template.fileList":{"1.html":"\u9365\u5267\u5896\u935c\u5c7e\u6783\u701b\ufffd","2.html":"\u741b\u3126\u7278","3.html":"\u6924\u572d\u6d30\u7f02\u6827\u5f7f"}},"zh-CN");KindEditor.options.langType="zh-CN";
KindEditor.plugin("anchor",function(d){var f=this,m=f.lang("anchor.");f.plugin.anchor={edit:function(){var s=['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keName">'+m.name+"</label>",'<input class="ke-input-text" type="text" id="keName" name="name" value="" style="width:100px;" /></div></div>'].join("");s=f.createDialog({name:"anchor",width:300,title:f.lang("anchor"),body:s,yesBtn:{name:f.lang("yes"),click:function(){f.insertHtml('<a name="'+k.val()+'">').hideDialog().focus()}}}).div;
var k=d('input[name="name"]',s);(s=f.plugin.getSelectedAnchor())&&k.val(unescape(s.attr("data-ke-name")));k[0].focus();k[0].select()},"delete":function(){f.plugin.getSelectedAnchor().remove()}};f.clickToolbar("anchor",f.plugin.anchor.edit)});
KindEditor.plugin("autoheight",function(d){function f(){var t=k.edit,p=t.doc.body;t.iframe[0].scroll="no";p.style.overflowY="hidden"}function m(){var t=k.edit,p=t.doc.body;t.iframe.height(n);k.resize(null,Math.max((d.IE?p.scrollHeight:p.offsetHeight)+76,n))}function s(){n=d.removeUnit(k.height);k.edit.afterChange(m);f();m()}var k=this;if(k.autoHeightMode){var n;k.isCreated?s():k.afterCreate(s)}});
KindEditor.plugin("baidumap",function(d){var f=this,m=f.lang("baidumap."),s=d.undef(f.mapWidth,558),k=d.undef(f.mapHeight,360);f.clickToolbar("baidumap",function(){function n(){B=v[0].contentWindow;C=d.iframeDoc(v)}var t=['<div style="padding:10px 20px;"><div class="ke-header"><div class="ke-left">',m.address+' <input id="kindeditor_plugin_map_address" name="address" class="ke-input-text" value="" style="width:200px;" /> ','<span class="ke-button-common ke-button-outer">','<input type="button" name="searchBtn" class="ke-button-common ke-button" value="'+
m.search+'" />','</span></div><div class="ke-right">','<input type="checkbox" id="keInsertDynamicMap" name="insertDynamicMap" value="1" /> <label for="keInsertDynamicMap">'+m.insertDynamicMap+"</label>",'</div><div class="ke-clearfix"></div></div>','<div class="ke-map" style="width:'+s+"px;height:"+k+'px;"></div>',"</div>"].join("");t=f.createDialog({name:"baidumap",width:s+42,title:f.lang("baidumap"),body:t,yesBtn:{name:f.lang("yes"),click:function(){var G=B.map,N=G.getCenter();N=N.lng+","+N.lat;
G=G.getZoom();G=[u[0].checked?f.pluginsPath+"baidumap/index.html":"http://api.map.baidu.com/staticimage","?center="+encodeURIComponent(N),"&zoom="+encodeURIComponent(G),"&width="+s,"&height="+k,"&markers="+encodeURIComponent(N),"&markerStyles="+encodeURIComponent("l,A")].join("");u[0].checked?f.insertHtml('<iframe src="'+G+'" frameborder="0" style="width:'+(s+2)+"px;height:"+(k+2)+'px;"></iframe>'):f.exec("insertimage",G);f.hideDialog().focus()}},beforeRemove:function(){q.remove();C&&C.write("");
v.remove()}});var p=t.div,r=d('[name="address"]',p),q=d('[name="searchBtn"]',p),u=d('[name="insertDynamicMap"]',t.div),B,C,v=d('<iframe class="ke-textarea" frameborder="0" src="'+f.pluginsPath+'baidumap/map.html" style="width:'+s+"px;height:"+k+'px;"></iframe>');v.bind("load",function(){v.unbind("load");d.IE?n():setTimeout(n,0)});d(".ke-map",p).replaceWith(v);q.click(function(){B.search(r.val())})})});
KindEditor.plugin("map",function(d){var f=this,m=f.lang("map.");f.clickToolbar("map",function(){function s(){p=q[0].contentWindow;r=d.iframeDoc(q)}var k=['<div style="padding:10px 20px;"><div class="ke-dialog-row">',m.address+' <input id="kindeditor_plugin_map_address" name="address" class="ke-input-text" value="" style="width:200px;" /> ','<span class="ke-button-common ke-button-outer">','<input type="button" name="searchBtn" class="ke-button-common ke-button" value="'+m.search+'" />','</span></div><div class="ke-map" style="width:558px;height:360px;"></div></div>'].join("");
k=f.createDialog({name:"map",width:600,title:f.lang("map"),body:k,yesBtn:{name:f.lang("yes"),click:function(){var u=p.map,B=u.getCenter().lat()+","+u.getCenter().lng(),C=u.getZoom();u=u.getMapTypeId();var v="http://maps.googleapis.com/maps/api/staticmap";v+="?center="+encodeURIComponent(B);v+="&zoom="+encodeURIComponent(C);v+="&size=558x360";v+="&maptype="+encodeURIComponent(u);v+="&markers="+encodeURIComponent(B);v+="&language="+f.langType;v+="&sensor=false";f.exec("insertimage",v).hideDialog().focus()}},
beforeRemove:function(){t.remove();r&&r.write("");q.remove()}}).div;var n=d('[name="address"]',k),t=d('[name="searchBtn"]',k),p,r;['<!doctype html><html><head>\n<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />\n<style>\n\thtml { height: 100% }\n\tbody { height: 100%; margin: 0; padding: 0; background-color: #FFF }\n\t#map_canvas { height: 100% }\n</style>','<script src="http://maps.googleapis.com/maps/api/js?sensor=false&language='+f.langType+'"><\/script>','<script>\nvar map, geocoder;\nfunction initialize() {\n\tvar latlng = new google.maps.LatLng(31.230393, 121.473704);\n\tvar options = {\n\t\tzoom: 11,\n\t\tcenter: latlng,\n\t\tdisableDefaultUI: true,\n\t\tpanControl: true,\n\t\tzoomControl: true,\n\t\tmapTypeControl: true,\n\t\tscaleControl: true,\n\t\tstreetViewControl: false,\n\t\toverviewMapControl: true,\n\t\tmapTypeId: google.maps.MapTypeId.ROADMAP\n\t};\n\tmap = new google.maps.Map(document.getElementById("map_canvas"), options);\n\tgeocoder = new google.maps.Geocoder();\n\tgeocoder.geocode({latLng: latlng}, function(results, status) {\n\t\tif (status == google.maps.GeocoderStatus.OK) {\n\t\t\tif (results[3]) {\n\t\t\t\tparent.document.getElementById("kindeditor_plugin_map_address").value = results[3].formatted_address;\n\t\t\t}\n\t\t}\n\t});\n}\nfunction search(address) {\n\tif (!map) return;\n\tgeocoder.geocode({address : address}, function(results, status) {\n\t\tif (status == google.maps.GeocoderStatus.OK) {\n\t\t\tmap.setZoom(11);\n\t\t\tmap.setCenter(results[0].geometry.location);\n\t\t\tvar marker = new google.maps.Marker({\n\t\t\t\tmap: map,\n\t\t\t\tposition: results[0].geometry.location\n\t\t\t});\n\t\t} else {\n\t\t\talert("Invalid address: " + address);\n\t\t}\n\t});\n}\n<\/script>\n</head>\n<body onload="initialize();">\n<div id="map_canvas" style="width:100%; height:100%"></div>\n</body></html>'].join("\n");
var q=d('<iframe class="ke-textarea" frameborder="0" src="'+f.pluginsPath+'map/map.html" style="width:558px;height:360px;"></iframe>');q.bind("load",function(){q.unbind("load");d.IE?s():setTimeout(s,0)});d(".ke-map",k).replaceWith(q);t.click(function(){p.search(n.val())})})});
KindEditor.plugin("clearhtml",function(d){var f=this;f.clickToolbar("clearhtml",function(){f.focus();var m=f.html();m=m.replace(/(<script[^>]*>)([\s\S]*?)(<\/script>)/ig,"");m=m.replace(/(<style[^>]*>)([\s\S]*?)(<\/style>)/ig,"");m=d.formatHtml(m,{a:["href","target"],embed:["src","width","height","type","loop","autostart","quality",".width",".height","align","allowscriptaccess"],img:["src","width","height","border","alt","title",".width",".height"],table:["border"],"td,th":["rowspan","colspan"],"div,hr,br,tbody,tr,p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6":[]});
f.html(m);f.cmd.selection(true);f.addBookmark()})});
KindEditor.plugin("code",function(d){var f=this;f.clickToolbar("code",function(){var m=f.lang("code."),s=f.createDialog({name:"code",width:450,title:f.lang("code"),body:'<div style="padding:10px 20px;"><div class="ke-dialog-row"><select class="ke-code-type"><option value="js">JavaScript</option><option value="html">HTML</option><option value="css">CSS</option><option value="php">PHP</option><option value="pl">Perl</option><option value="py">Python</option><option value="rb">Ruby</option><option value="java">Java</option><option value="vb">ASP/VB</option><option value="cpp">C/C++</option><option value="cs">C#</option><option value="xml">XML</option><option value="bsh">Shell</option><option value="">Other</option></select></div><textarea class="ke-textarea" style="width:408px;height:260px;"></textarea></div>',yesBtn:{name:f.lang("yes"),
click:function(){var n=d(".ke-code-type",s.div).val(),t=k.val();n='<pre class="prettyprint'+(n===""?"":" lang-"+n)+'">\n'+d.escape(t)+"</pre> ";if(d.trim(t)===""){alert(m.pleaseInput);k[0].focus()}else f.insertHtml(n).hideDialog().focus()}}}),k=d("textarea",s.div);k[0].focus()})});
KindEditor.plugin("emoticons",function(d){var f=this,m=f.emoticonsPath||f.pluginsPath+"emoticons/images/",s=f.allowPreviewEmoticons===undefined?true:f.allowPreviewEmoticons,k=1;f.clickToolbar("emoticons",function(){function n(R,L,J){E?R.mouseover(function(){if(L>N){E.css("left",0);E.css("right","")}else{E.css("left","");E.css("right",0)}H.attr("src",m+J+".gif");d(this).addClass("ke-on")}):R.mouseover(function(){d(this).addClass("ke-on")});R.mouseout(function(){d(this).removeClass("ke-on")});R.click(function(M){f.insertHtml('<img src="'+
m+J+'.gif" border="0" alt="" />').hideMenu().focus();M.stop()})}function t(R,L){var J=document.createElement("table");L.append(J);if(E){d(J).mouseover(function(){E.show("block")});d(J).mouseout(function(){E.hide()});O.push(d(J))}J.className="ke-table";J.cellPadding=0;J.cellSpacing=0;J.border=0;R=(R-1)*v+C;for(L=0;L<u;L++)for(var M=J.insertRow(L),T=0;T<B;T++){var Y=d(M.insertCell(T));Y.addClass("ke-cell");n(Y,T,R);var Z=d('<span class="ke-img"></span>').css("background-position","-"+24*R+"px 0px").css("background-image",
"url("+m+"static.gif)");Y.append(Z);O.push(Y);R++}return J}function p(){d.each(O,function(){this.unbind()})}function r(R,L){R.click(function(J){p();ea.parentNode.removeChild(ea);I.remove();ea=t(L,D);q(L);k=L;J.stop()})}function q(R){I=d('<div class="ke-page"></div>');D.append(I);for(var L=1;L<=G;L++){if(R!==L){var J=d('<a href="javascript:;">['+L+"]</a>");r(J,L);I.append(J);O.push(J)}else I.append(d("@["+L+"]"));I.append(d("@&nbsp;"))}}var u=5,B=9,C=0,v=u*B,G=Math.ceil(135/v),N=Math.floor(B/2),D=
d('<div class="ke-plugin-emoticons"></div>'),O=[];f.createMenu({name:"emoticons",beforeRemove:function(){p()}}).div.append(D);var E,H;if(s){E=d('<div class="ke-preview"></div>').css("right",0);H=d('<img class="ke-preview-img" src="'+m+C+'.gif" />');D.append(E);E.append(H)}var ea=t(k,D),I;q(k)})});
KindEditor.plugin("filemanager",function(d){function f(p,r,q){return p+" ("+Math.ceil(r/1024)+"KB, "+q+")"}function m(p,r){r.is_dir?p.attr("title",r.filename):p.attr("title",f(r.filename,r.filesize,r.datetime))}var s=this,k=d.undef(s.fileManagerJson,s.basePath+"php/file_manager_json.php"),n=s.pluginsPath+"filemanager/images/",t=s.lang("filemanager.");s.plugin.filemanagerDialog=function(p){function r(J,M,T){J="path="+J+"&order="+M+"&dir="+N;E.showLoading(s.lang("ajaxLoading"));d.ajax(d.addParam(k,
J+"&"+(new Date).getTime()),function(Y){E.hideLoading();T(Y)})}function q(J,M,T,Y){var Z=d.formatUrl(M.current_url+T.filename,"absolute"),U=encodeURIComponent(M.current_dir_path+T.filename+"/");T.is_dir?J.click(function(){r(U,R.val(),Y)}):J.click(function(){O.call(this,Z,T.filename)});L.push(J)}function u(J,M){function T(){I.val()=="VIEW"?r(J.current_dir_path,R.val(),C):r(J.current_dir_path,R.val(),B)}d.each(L,function(){this.unbind()});ea.unbind();I.unbind();R.unbind();J.current_dir_path&&ea.click(function(){r(J.moveup_dir_path,
R.val(),M)});I.change(T);R.change(T);H.html("")}function B(J){u(J,B);var M=document.createElement("table");M.className="ke-table";M.cellPadding=0;M.cellSpacing=0;M.border=0;H.append(M);for(var T=J.file_list,Y=0,Z=T.length;Y<Z;Y++){var U=T[Y],ba=d(M.insertRow(Y));ba.mouseover(function(){d(this).addClass("ke-on")}).mouseout(function(){d(this).removeClass("ke-on")});var la=d('<img src="'+(n+(U.is_dir?"folder-16.gif":"file-16.gif"))+'" width="16" height="16" alt="'+U.filename+'" align="absmiddle" />');
la=d(ba[0].insertCell(0)).addClass("ke-cell ke-name").append(la).append(document.createTextNode(" "+U.filename));if(!U.is_dir||U.has_file){ba.css("cursor","pointer");la.attr("title",U.filename);q(la,J,U,B)}else la.attr("title",t.emptyFolder);d(ba[0].insertCell(1)).addClass("ke-cell ke-size").html(U.is_dir?"-":Math.ceil(U.filesize/1024)+"KB");d(ba[0].insertCell(2)).addClass("ke-cell ke-datetime").html(U.datetime)}}function C(J){u(J,C);for(var M=J.file_list,T=0,Y=M.length;T<Y;T++){var Z=M[T],U=d('<div class="ke-inline-block ke-item"></div>');
H.append(U);var ba=d('<div class="ke-inline-block ke-photo"></div>').mouseover(function(){d(this).addClass("ke-on")}).mouseout(function(){d(this).removeClass("ke-on")});U.append(ba);var la=J.current_url+Z.filename;la=d('<img src="'+(Z.is_dir?n+"folder-64.gif":Z.is_photo?la:n+"file-64.gif")+'" width="80" height="80" alt="'+Z.filename+'" />');if(!Z.is_dir||Z.has_file){ba.css("cursor","pointer");m(ba,Z);q(ba,J,Z,C)}else ba.attr("title",t.emptyFolder);ba.append(la);U.append('<div class="ke-name" title="'+
Z.filename+'">'+Z.filename+"</div>")}}var v=d.undef(p.width,650),G=d.undef(p.height,510),N=d.undef(p.dirName,""),D=d.undef(p.viewType,"VIEW").toUpperCase(),O=p.clickFn;p=['<div style="padding:10px 20px;"><div class="ke-plugin-filemanager-header"><div class="ke-left">','<img class="ke-inline-block" name="moveupImg" src="'+n+'go-up.gif" width="16" height="16" border="0" alt="" /> ','<a class="ke-inline-block" name="moveupLink" href="javascript:;">'+t.moveup+"</a>",'</div><div class="ke-right">',t.viewType+
' <select class="ke-inline-block" name="viewType">','<option value="VIEW">'+t.viewImage+"</option>",'<option value="LIST">'+t.listImage+"</option>","</select> ",t.orderType+' <select class="ke-inline-block" name="orderType">','<option value="NAME">'+t.fileName+"</option>",'<option value="SIZE">'+t.fileSize+"</option>",'<option value="TYPE">'+t.fileType+"</option>",'</select></div><div class="ke-clearfix"></div></div><div class="ke-plugin-filemanager-body"></div></div>'].join("");var E=s.createDialog({name:"filemanager",
width:v,height:G,title:s.lang("filemanager"),body:p});v=E.div;var H=d(".ke-plugin-filemanager-body",v);d('[name="moveupImg"]',v);var ea=d('[name="moveupLink"]',v);d('[name="viewServer"]',v);var I=d('[name="viewType"]',v),R=d('[name="orderType"]',v),L=[];I.val(D);r("",R.val(),D=="VIEW"?C:B);return E}});
KindEditor.plugin("flash",function(d){var f=this,m=f.lang("flash."),s=d.undef(f.allowFlashUpload,true),k=d.undef(f.allowFileManager,false),n=d.undef(f.formatUploadUrl,true),t=d.undef(f.extraFileUploadParams,{}),p=d.undef(f.filePostName,"imgFile"),r=d.undef(f.uploadJson,f.basePath+"php/upload_json.php");f.plugin.flash={edit:function(){var q=['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+m.url+"</label>",'<input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:160px;" /> &nbsp;',
'<input type="button" class="ke-upload-button" value="'+m.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+m.viewServer+'" />','</span></div><div class="ke-dialog-row">','<label for="keWidth" style="width:60px;">'+m.width+"</label>",'<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="550" maxlength="4" /> </div><div class="ke-dialog-row">','<label for="keHeight" style="width:60px;">'+
m.height+"</label>",'<input type="text" id="keHeight" class="ke-input-text ke-input-number" name="height" value="400" maxlength="4" /> </div></div>'].join(""),u=f.createDialog({name:"flash",width:450,title:f.lang("flash"),body:q,yesBtn:{name:f.lang("yes"),click:function(){var O=d.trim(C.val()),E=v.val(),H=G.val();if(O=="http://"||d.invalidUrl(O)){alert(f.lang("invalidUrl"));C[0].focus()}else if(/^\d*$/.test(E))if(/^\d*$/.test(H)){O=d.mediaImg(f.themesPath+"common/blank.gif",{src:O,type:d.mediaType(".swf"),
width:E,height:H,quality:"high"});f.insertHtml(O).hideDialog().focus()}else{alert(f.lang("invalidHeight"));G[0].focus()}else{alert(f.lang("invalidWidth"));v[0].focus()}}}}),B=u.div,C=d('[name="url"]',B);q=d('[name="viewServer"]',B);var v=d('[name="width"]',B),G=d('[name="height"]',B);C.val("http://");if(s){var N=d.uploadbutton({button:d(".ke-upload-button",B)[0],fieldName:p,extraParams:t,url:d.addParam(r,"dir=flash"),afterUpload:function(O){u.hideLoading();if(O.error===0){var E=O.url;if(n)E=d.formatUrl(E,
"absolute");C.val(E);f.afterUpload&&f.afterUpload.call(f,E,O,"flash");alert(f.lang("uploadSuccess"))}else alert(O.message)},afterError:function(O){u.hideLoading();f.errorDialog(O)}});N.fileBox.change(function(){u.showLoading(f.lang("uploadLoading"));N.submit()})}else d(".ke-upload-button",B).hide();k?q.click(function(){f.loadPlugin("filemanager",function(){f.plugin.filemanagerDialog({viewType:"LIST",dirName:"flash",clickFn:function(O){if(f.dialogs.length>1){d('[name="url"]',B).val(O);f.afterSelectFile&&
f.afterSelectFile.call(f,O);f.hideDialog()}}})})}):q.hide();if(q=f.plugin.getSelectedFlash()){var D=d.mediaAttrs(q.attr("data-ke-tag"));C.val(D.src);v.val(d.removeUnit(q.css("width"))||D.width||0);G.val(d.removeUnit(q.css("height"))||D.height||0)}C[0].focus();C[0].select()},"delete":function(){f.plugin.getSelectedFlash().remove();f.addBookmark()}};f.clickToolbar("flash",f.plugin.flash.edit)});
KindEditor.plugin("image",function(d){var f=this,m=d.undef(f.allowImageUpload,true),s=d.undef(f.allowImageRemote,true),k=d.undef(f.formatUploadUrl,true),n=d.undef(f.allowFileManager,false),t=d.undef(f.uploadJson,f.basePath+"php/upload_json.php"),p=d.undef(f.imageTabIndex,0),r=f.pluginsPath+"image/images/",q=d.undef(f.extraFileUploadParams,{}),u=d.undef(f.filePostName,"imgFile"),B=d.undef(f.fillDescAfterUploadImage,false),C=f.lang("image.");f.plugin.imageDialog=function(v){function G(fa,ta){Y.val(fa);
Z.val(ta);ra=fa;ka=ta}d.undef(v.imageWidth,"");d.undef(v.imageHeight,"");d.undef(v.imageTitle,"");d.undef(v.imageAlign,"");var N=d.undef(v.showRemote,true),D=d.undef(v.showLocal,true),O=d.undef(v.tabIndex,0),E=v.clickFn,H="kindeditor_upload_iframe_"+(new Date).getTime(),ea=[];for(var I in q)ea.push('<input type="hidden" name="'+I+'" value="'+q[I]+'" />');ea=['<div style="padding:20px;"><div class="tabs"></div><div class="tab1" style="display:none;"><div class="ke-dialog-row">','<label for="remoteUrl" style="width:60px;">'+
C.remoteUrl+"</label>",'<input type="text" id="remoteUrl" class="ke-input-text" name="url" value="" style="width:200px;" /> &nbsp;<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+C.viewServer+'" />','</span></div><div class="ke-dialog-row">','<label for="remoteWidth" style="width:60px;">'+C.size+"</label>",C.width+' <input type="text" id="remoteWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> ',
C.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> ','<img class="ke-refresh-btn" src="'+r+'refresh.png" width="16" height="16" alt="" style="cursor:pointer;" title="'+C.resetSize+'" />','</div><div class="ke-dialog-row">','<label style="width:60px;">'+C.align+"</label>",'<input type="radio" name="align" class="ke-inline-block" value="" checked="checked" /> <img name="defaultImg" src="'+r+'align_top.gif" width="23" height="25" alt="" />',' <input type="radio" name="align" class="ke-inline-block" value="left" /> <img name="leftImg" src="'+
r+'align_left.gif" width="23" height="25" alt="" />',' <input type="radio" name="align" class="ke-inline-block" value="right" /> <img name="rightImg" src="'+r+'align_right.gif" width="23" height="25" alt="" />','</div><div class="ke-dialog-row">','<label for="remoteTitle" style="width:60px;">'+C.imgTitle+"</label>",'<input type="text" id="remoteTitle" class="ke-input-text" name="title" value="" style="width:200px;" /></div></div><div class="tab2" style="display:none;">','<iframe name="'+H+'" style="display:none;"></iframe>',
'<form class="ke-upload-area ke-form" method="post" enctype="multipart/form-data" target="'+H+'" action="'+d.addParam(t,"dir=image")+'">','<div class="ke-dialog-row">',ea.join(""),'<label style="width:60px;">'+C.localUrl+"</label>",'<input type="text" name="localUrl" class="ke-input-text" tabindex="-1" style="width:200px;" readonly="true" /> &nbsp;','<input type="button" class="ke-upload-button" value="'+C.upload+'" />',"</div></form></div></div>"].join("");var R=f.createDialog({name:"image",width:D||
n?450:400,height:D&&N?300:250,title:f.lang("image"),body:ea,yesBtn:{name:f.lang("yes"),click:function(){if(!R.isLoading)if(D&&N&&ma&&ma.selectedIndex===1||!N)if(ua.fileBox.val()=="")alert(f.lang("pleaseSelectFile"));else{R.showLoading(f.lang("uploadLoading"));ua.submit();M.val("")}else{var fa=d.trim(J.val()),ta=Y.val(),Fa=Z.val(),Aa=ba.val(),Sa="";la.each(function(){if(this.checked){Sa=this.value;return false}});if(fa=="http://"||d.invalidUrl(fa)){alert(f.lang("invalidUrl"));J[0].focus()}else if(/^\d*$/.test(ta))if(/^\d*$/.test(Fa))E.call(f,
fa,Aa,ta,Fa,0,Sa);else{alert(f.lang("invalidHeight"));Z[0].focus()}else{alert(f.lang("invalidWidth"));Y[0].focus()}}}},beforeRemove:function(){T.unbind();Y.unbind();Z.unbind();U.unbind()}}),L=R.div,J=d('[name="url"]',L),M=d('[name="localUrl"]',L),T=d('[name="viewServer"]',L),Y=d('.tab1 [name="width"]',L),Z=d('.tab1 [name="height"]',L),U=d(".ke-refresh-btn",L),ba=d('.tab1 [name="title"]',L),la=d('.tab1 [name="align"]',L),ma;if(N&&D){ma=d.tabs({src:d(".tabs",L),afterSelect:function(){}});ma.add({title:C.remoteImage,
panel:d(".tab1",L)});ma.add({title:C.localImage,panel:d(".tab2",L)});ma.select(O)}else if(N)d(".tab1",L).show();else D&&d(".tab2",L).show();var ua=d.uploadbutton({button:d(".ke-upload-button",L)[0],fieldName:u,form:d(".ke-form",L),target:H,width:60,afterUpload:function(fa){R.hideLoading();if(fa.error===0){var ta=fa.url;if(k)ta=d.formatUrl(ta,"absolute");f.afterUpload&&f.afterUpload.call(f,ta,fa,"image");if(B){d(".ke-dialog-row #remoteUrl",L).val(ta);d(".ke-tabs-li",L)[0].click();d(".ke-refresh-btn",
L).click()}else E.call(f,ta,fa.title,fa.width,fa.height,fa.border,fa.align)}else alert(fa.message)},afterError:function(fa){R.hideLoading();f.errorDialog(fa)}});ua.fileBox.change(function(){M.val(ua.fileBox.val())});n?T.click(function(){f.loadPlugin("filemanager",function(){f.plugin.filemanagerDialog({viewType:"VIEW",dirName:"image",clickFn:function(fa){if(f.dialogs.length>1){d('[name="url"]',L).val(fa);f.afterSelectFile&&f.afterSelectFile.call(f,fa);f.hideDialog()}}})})}):T.hide();var ra=0,ka=0;
U.click(function(){var fa=d('<img src="'+J.val()+'" />',document).css({position:"absolute",visibility:"hidden",top:0,left:"-1000px"});fa.bind("load",function(){G(fa.width(),fa.height());fa.remove()});d(document.body).append(fa)});Y.change(function(){ra>0&&Z.val(Math.round(ka/ra*parseInt(this.value,10)))});Z.change(function(){ka>0&&Y.val(Math.round(ra/ka*parseInt(this.value,10)))});J.val(v.imageUrl);G(v.imageWidth,v.imageHeight);ba.val(v.imageTitle);la.each(function(){if(this.value===v.imageAlign){this.checked=
true;return false}});if(N&&O===0){J[0].focus();J[0].select()}return R};f.plugin.image={edit:function(){var v=f.plugin.getSelectedImage();f.plugin.imageDialog({imageUrl:v?v.attr("data-ke-src"):"http://",imageWidth:v?v.width():"",imageHeight:v?v.height():"",imageTitle:v?v.attr("title"):"",imageAlign:v?v.attr("align"):"",showRemote:s,showLocal:m,tabIndex:v?0:p,clickFn:function(G,N,D,O,E,H){if(v){v.attr("src",G);v.attr("data-ke-src",G);v.attr("width",D);v.attr("height",O);v.attr("title",N);v.attr("align",
H);v.attr("alt",N)}else f.exec("insertimage",G,N,D,O,E,H);setTimeout(function(){f.hideDialog().focus()},0)}})},"delete":function(){var v=f.plugin.getSelectedImage();if(v.parent().name=="a")v=v.parent();v.remove();f.addBookmark()}};f.clickToolbar("image",f.plugin.image.edit)});
KindEditor.plugin("insertfile",function(d){var f=this,m=d.undef(f.allowFileUpload,true),s=d.undef(f.allowFileManager,false),k=d.undef(f.formatUploadUrl,true),n=d.undef(f.uploadJson,f.basePath+"php/upload_json.php"),t=d.undef(f.extraFileUploadParams,{}),p=d.undef(f.filePostName,"imgFile"),r=f.lang("insertfile.");f.plugin.fileDialog=function(q){var u=d.undef(q.fileUrl,"http://"),B=d.undef(q.fileTitle,""),C=q.clickFn;q=['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+
r.url+"</label>",'<input type="text" id="keUrl" name="url" class="ke-input-text" style="width:160px;" /> &nbsp;','<input type="button" class="ke-upload-button" value="'+r.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+r.viewServer+'" />','</span></div><div class="ke-dialog-row">','<label for="keTitle" style="width:60px;">'+r.title+"</label>",'<input type="text" id="keTitle" class="ke-input-text" name="title" value="" style="width:160px;" /></div></div></form></div>'].join("");
var v=f.createDialog({name:"insertfile",width:450,title:f.lang("insertfile"),body:q,yesBtn:{name:f.lang("yes"),click:function(){var E=d.trim(N.val()),H=D.val();if(E=="http://"||d.invalidUrl(E)){alert(f.lang("invalidUrl"));N[0].focus()}else{if(d.trim(H)==="")H=E;C.call(f,E,H)}}}}),G=v.div,N=d('[name="url"]',G);q=d('[name="viewServer"]',G);var D=d('[name="title"]',G);if(m){var O=d.uploadbutton({button:d(".ke-upload-button",G)[0],fieldName:p,url:d.addParam(n,"dir=file"),extraParams:t,afterUpload:function(E){v.hideLoading();
if(E.error===0){var H=E.url;if(k)H=d.formatUrl(H,"absolute");N.val(H);D.val(E.title);f.afterUpload&&f.afterUpload.call(f,H,E,"insertfile");alert(f.lang("uploadSuccess"))}else alert(E.message)},afterError:function(E){v.hideLoading();f.errorDialog(E)}});O.fileBox.change(function(){v.showLoading(f.lang("uploadLoading"));O.submit()})}else d(".ke-upload-button",G).hide();s?q.click(function(){f.loadPlugin("filemanager",function(){f.plugin.filemanagerDialog({viewType:"LIST",dirName:"file",clickFn:function(E){if(f.dialogs.length>
1){d('[name="url"]',G).val(E);f.afterSelectFile&&f.afterSelectFile.call(f,E);f.hideDialog()}}})})}):q.hide();N.val(u);D.val(B);N[0].focus();N[0].select()};f.clickToolbar("insertfile",function(){f.plugin.fileDialog({clickFn:function(q,u){f.insertHtml('<a class="ke-insertfile" href="'+q+'" data-ke-src="'+q+'" target="_blank">'+u+"</a>").hideDialog().focus()}})})});
KindEditor.plugin("lineheight",function(d){var f=this,m=f.lang("lineheight.");f.clickToolbar("lineheight",function(){var s="",k=f.cmd.commonNode({"*":".line-height"});if(k)s=k.css("line-height");var n=f.createMenu({name:"lineheight",width:150});d.each(m.lineHeight,function(t,p){d.each(p,function(r,q){n.addItem({title:q,checked:s===r,click:function(){f.cmd.toggle('<span style="line-height:'+r+';"></span>',{span:".line-height="+r});f.updateState();f.addBookmark();f.hideMenu()}})})})})});
KindEditor.plugin("link",function(d){var f=this;f.plugin.link={edit:function(){var m=f.lang("link."),s='<div style="padding:20px;"><div class="ke-dialog-row"><label for="keUrl" style="width:60px;">'+m.url+'</label><input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:260px;" /></div><div class="ke-dialog-row""><label for="keType" style="width:60px;">'+m.linkType+'</label><select id="keType" name="type"></select></div></div>';s=f.createDialog({name:"link",width:450,title:f.lang("link"),
body:s,yesBtn:{name:f.lang("yes"),click:function(){var t=d.trim(k.val());if(t=="http://"||d.invalidUrl(t)){alert(f.lang("invalidUrl"));k[0].focus()}else f.exec("createlink",t,n.val()).hideDialog().focus()}}}).div;var k=d('input[name="url"]',s),n=d('select[name="type"]',s);k.val("http://");n[0].options[0]=new Option(m.newWindow,"_blank");n[0].options[1]=new Option(m.selfWindow,"");f.cmd.selection();if(m=f.plugin.getSelectedLink()){f.cmd.range.selectNode(m[0]);f.cmd.select();k.val(m.attr("data-ke-src"));
n.val(m.attr("target"))}k[0].focus();k[0].select()},"delete":function(){f.exec("unlink",null)}};f.clickToolbar("link",f.plugin.link.edit)});
KindEditor.plugin("media",function(d){var f=this,m=f.lang("media."),s=d.undef(f.allowMediaUpload,true),k=d.undef(f.allowFileManager,false),n=d.undef(f.formatUploadUrl,true),t=d.undef(f.extraFileUploadParams,{}),p=d.undef(f.filePostName,"imgFile"),r=d.undef(f.uploadJson,f.basePath+"php/upload_json.php");f.plugin.media={edit:function(){var q=['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keUrl" style="width:60px;">'+m.url+"</label>",'<input class="ke-input-text" type="text" id="keUrl" name="url" value="" style="width:160px;" /> &nbsp;',
'<input type="button" class="ke-upload-button" value="'+m.upload+'" /> &nbsp;','<span class="ke-button-common ke-button-outer">','<input type="button" class="ke-button-common ke-button" name="viewServer" value="'+m.viewServer+'" />','</span></div><div class="ke-dialog-row">','<label for="keWidth" style="width:60px;">'+m.width+"</label>",'<input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="550" maxlength="4" /></div><div class="ke-dialog-row">','<label for="keHeight" style="width:60px;">'+
m.height+"</label>",'<input type="text" id="keHeight" class="ke-input-text ke-input-number" name="height" value="400" maxlength="4" /></div><div class="ke-dialog-row">','<label for="keAutostart">'+m.autostart+"</label>",'<input type="checkbox" id="keAutostart" name="autostart" value="" /> </div></div>'].join(""),u=f.createDialog({name:"media",width:450,height:230,title:f.lang("media"),body:q,yesBtn:{name:f.lang("yes"),click:function(){var E=d.trim(C.val()),H=v.val(),ea=G.val();if(E=="http://"||d.invalidUrl(E)){alert(f.lang("invalidUrl"));
C[0].focus()}else if(/^\d*$/.test(H))if(/^\d*$/.test(ea)){E=d.mediaImg(f.themesPath+"common/blank.gif",{src:E,type:d.mediaType(E),width:H,height:ea,autostart:N[0].checked?"true":"false",loop:"true"});f.insertHtml(E).hideDialog().focus()}else{alert(f.lang("invalidHeight"));G[0].focus()}else{alert(f.lang("invalidWidth"));v[0].focus()}}}}),B=u.div,C=d('[name="url"]',B);q=d('[name="viewServer"]',B);var v=d('[name="width"]',B),G=d('[name="height"]',B),N=d('[name="autostart"]',B);C.val("http://");if(s){var D=
d.uploadbutton({button:d(".ke-upload-button",B)[0],fieldName:p,extraParams:t,url:d.addParam(r,"dir=media"),afterUpload:function(E){u.hideLoading();if(E.error===0){var H=E.url;if(n)H=d.formatUrl(H,"absolute");C.val(H);f.afterUpload&&f.afterUpload.call(f,H,E,"media");alert(f.lang("uploadSuccess"))}else alert(E.message)},afterError:function(E){u.hideLoading();f.errorDialog(E)}});D.fileBox.change(function(){u.showLoading(f.lang("uploadLoading"));D.submit()})}else d(".ke-upload-button",B).hide();k?q.click(function(){f.loadPlugin("filemanager",
function(){f.plugin.filemanagerDialog({viewType:"LIST",dirName:"media",clickFn:function(E){if(f.dialogs.length>1){d('[name="url"]',B).val(E);f.afterSelectFile&&f.afterSelectFile.call(f,E);f.hideDialog()}}})})}):q.hide();if(q=f.plugin.getSelectedMedia()){var O=d.mediaAttrs(q.attr("data-ke-tag"));C.val(O.src);v.val(d.removeUnit(q.css("width"))||O.width||0);G.val(d.removeUnit(q.css("height"))||O.height||0);N[0].checked=O.autostart==="true"}C[0].focus();C[0].select()},"delete":function(){f.plugin.getSelectedMedia().remove();
f.addBookmark()}};f.clickToolbar("media",f.plugin.media.edit)});
(function(d){function f(m){this.init(m)}d.extend(f,{init:function(m){function s(t,p){d(".ke-status > div",t).hide();d(".ke-message",t).addClass("ke-error").show().html(d.escape(p))}var k=this;m.afterError=m.afterError||function(t){alert(t)};k.options=m;k.progressbars={};k.div=d(m.container).html(['<div class="ke-swfupload"><div class="ke-swfupload-top"><div class="ke-inline-block ke-swfupload-button"><input type="button" value="Browse" /></div>','<div class="ke-inline-block ke-swfupload-desc">'+m.uploadDesc+
"</div>",'<span class="ke-button-common ke-button-outer ke-swfupload-startupload">','<input type="button" class="ke-button-common ke-button" value="'+m.startButtonValue+'" />','</span></div><div class="ke-swfupload-body"></div></div>'].join(""));k.bodyDiv=d(".ke-swfupload-body",k.div);var n={debug:false,upload_url:m.uploadUrl,flash_url:m.flashUrl,file_post_name:m.filePostName,button_placeholder:d(".ke-swfupload-button > input",k.div)[0],button_image_url:m.buttonImageUrl,button_width:m.buttonWidth,
button_height:m.buttonHeight,button_cursor:SWFUpload.CURSOR.HAND,file_types:m.fileTypes,file_types_description:m.fileTypesDesc,file_upload_limit:m.fileUploadLimit,file_size_limit:m.fileSizeLimit,post_params:m.postParams,file_queued_handler:function(t){t.url=k.options.fileIconUrl;k.appendFile(t)},file_queue_error_handler:function(t,p){t="";switch(p){case SWFUpload.QUEUE_ERROR.QUEUE_LIMIT_EXCEEDED:t=m.queueLimitExceeded;break;case SWFUpload.QUEUE_ERROR.FILE_EXCEEDS_SIZE_LIMIT:t=m.fileExceedsSizeLimit;
break;case SWFUpload.QUEUE_ERROR.ZERO_BYTE_FILE:t=m.zeroByteFile;break;case SWFUpload.QUEUE_ERROR.INVALID_FILETYPE:t=m.invalidFiletype;break;default:t=m.unknownError;break}d.DEBUG&&alert(t)},upload_start_handler:function(t){t=d('div[data-id="'+t.id+'"]',this.bodyDiv);d(".ke-status > div",t).hide();d(".ke-progressbar",t).show()},upload_progress_handler:function(t,p,r){p=Math.round(p*100/r);t=k.progressbars[t.id];t.bar.css("width",Math.round(p*80/100)+"px");t.percent.html(p+"%")},upload_error_handler:function(t){if(t&&
t.filestatus==SWFUpload.FILE_STATUS.ERROR){t=d('div[data-id="'+t.id+'"]',k.bodyDiv).eq(0);s(t,k.options.errorMessage)}},upload_success_handler:function(t,p){var r=d('div[data-id="'+t.id+'"]',k.bodyDiv).eq(0),q={};try{q=d.json(p)}catch(u){k.options.afterError.call(this,"<!doctype html><html>"+p+"</html>")}if(q.error!==0)s(r,d.DEBUG?q.message:k.options.errorMessage);else{t.url=q.url;d(".ke-img",r).attr("src",t.url).attr("data-status",t.filestatus).data("data",q);d(".ke-status > div",r).hide()}}};k.swfu=
new SWFUpload(n);d(".ke-swfupload-startupload input",k.div).click(function(){k.swfu.startUpload()})},getUrlList:function(){var m=[];d(".ke-img",self.bodyDiv).each(function(){var s=d(this);s.attr("data-status")==SWFUpload.FILE_STATUS.COMPLETE&&m.push(s.data("data"))});return m},removeFile:function(m){this.swfu.cancelUpload(m);m=d('div[data-id="'+m+'"]',this.bodyDiv);d(".ke-photo",m).unbind();d(".ke-delete",m).unbind();m.remove()},removeFiles:function(){var m=this;d(".ke-item",m.bodyDiv).each(function(){m.removeFile(d(this).attr("data-id"))})},
appendFile:function(m){var s=this,k=d('<div class="ke-inline-block ke-item" data-id="'+m.id+'"></div>');s.bodyDiv.append(k);var n=d('<div class="ke-inline-block ke-photo"></div>').mouseover(function(){d(this).addClass("ke-on")}).mouseout(function(){d(this).removeClass("ke-on")});k.append(n);var t=d('<img src="'+m.url+'" class="ke-img" data-status="'+m.filestatus+'" width="80" height="80" alt="'+m.name+'" />');n.append(t);d('<span class="ke-delete"></span>').appendTo(n).click(function(){s.removeFile(m.id)});
t=d('<div class="ke-status"></div>').appendTo(n);d('<div class="ke-progressbar"><div class="ke-progressbar-bar"><div class="ke-progressbar-bar-inner"></div></div><div class="ke-progressbar-percent">0%</div></div>').hide().appendTo(t);d('<div class="ke-message">'+s.options.pendingMessage+"</div>").appendTo(t);k.append('<div class="ke-name">'+m.name+"</div>");s.progressbars[m.id]={bar:d(".ke-progressbar-bar-inner",n),percent:d(".ke-progressbar-percent",n)}},remove:function(){this.removeFiles();this.swfu.destroy();
this.div.html("")}});d.swfupload=function(m,s){return new f(m,s)}})(KindEditor);
KindEditor.plugin("multiimage",function(d){var f=this;d.undef(f.formatUploadUrl,true);var m=d.undef(f.uploadJson,f.basePath+"php/upload_json.php"),s=f.pluginsPath+"multiimage/images/",k=d.undef(f.imageSizeLimit,"1MB");d.undef(f.imageFileTypes,"*.jpg;*.gif;*.png");var n=d.undef(f.imageUploadLimit,20),t=d.undef(f.filePostName,"imgFile"),p=f.lang("multiimage.");f.plugin.multiImageDialog=function(r){var q=r.clickFn;r=d.tmpl(p.uploadDesc,{uploadLimit:n,sizeLimit:k});var u=f.createDialog({name:"multiimage",
width:650,height:510,title:f.lang("multiimage"),body:'<div style="padding:20px;"><div class="swfupload"></div></div>',previewBtn:{name:p.insertAll,click:function(){q.call(f,B.getUrlList())}},yesBtn:{name:p.clearAll,click:function(){B.removeFiles()}},beforeRemove:function(){if(!d.IE||d.V<=8)B.remove()}}),B=d.swfupload({container:d(".swfupload",u.div),buttonImageUrl:s+(f.langType=="zh-CN"?"select-files-zh-CN.png":"select-files-en.png"),buttonWidth:f.langType=="zh-CN"?72:88,buttonHeight:23,fileIconUrl:s+
"image.png",uploadDesc:r,startButtonValue:p.startUpload,uploadUrl:d.addParam(m,"dir=image"),flashUrl:s+"swfupload.swf",filePostName:t,fileTypes:"*.jpg;*.jpeg;*.gif;*.png;*.bmp",fileTypesDesc:"Image Files",fileUploadLimit:n,fileSizeLimit:k,postParams:d.undef(f.extraFileUploadParams,{}),queueLimitExceeded:p.queueLimitExceeded,fileExceedsSizeLimit:p.fileExceedsSizeLimit,zeroByteFile:p.zeroByteFile,invalidFiletype:p.invalidFiletype,unknownError:p.unknownError,pendingMessage:p.pending,errorMessage:p.uploadError,
afterError:function(C){f.errorDialog(C)}});return u};f.clickToolbar("multiimage",function(){f.plugin.multiImageDialog({clickFn:function(r){if(r.length!==0){d.each(r,function(q,u){f.afterUpload&&f.afterUpload.call(f,u.url,u,"multiimage");f.exec("insertimage",u.url,u.title,u.width,u.height,u.border,u.align)});setTimeout(function(){f.hideDialog().focus()},0)}}})})});
(function(){window.SWFUpload=function(d){this.initSWFUpload(d)};SWFUpload.prototype.initSWFUpload=function(d){try{this.customSettings={};this.settings=d;this.eventQueue=[];this.movieName="KindEditor_SWFUpload_"+SWFUpload.movieCount++;this.movieElement=null;SWFUpload.instances[this.movieName]=this;this.initSettings();this.loadFlash();this.displayDebugInfo()}catch(f){delete SWFUpload.instances[this.movieName];throw f;}};SWFUpload.instances={};SWFUpload.movieCount=0;SWFUpload.version="2.2.0 2009-03-25";
SWFUpload.QUEUE_ERROR={QUEUE_LIMIT_EXCEEDED:-100,FILE_EXCEEDS_SIZE_LIMIT:-110,ZERO_BYTE_FILE:-120,INVALID_FILETYPE:-130};SWFUpload.UPLOAD_ERROR={HTTP_ERROR:-200,MISSING_UPLOAD_URL:-210,IO_ERROR:-220,SECURITY_ERROR:-230,UPLOAD_LIMIT_EXCEEDED:-240,UPLOAD_FAILED:-250,SPECIFIED_FILE_ID_NOT_FOUND:-260,FILE_VALIDATION_FAILED:-270,FILE_CANCELLED:-280,UPLOAD_STOPPED:-290};SWFUpload.FILE_STATUS={QUEUED:-1,IN_PROGRESS:-2,ERROR:-3,COMPLETE:-4,CANCELLED:-5};SWFUpload.BUTTON_ACTION={SELECT_FILE:-100,SELECT_FILES:-110,
START_UPLOAD:-120};SWFUpload.CURSOR={ARROW:-1,HAND:-2};SWFUpload.WINDOW_MODE={WINDOW:"window",TRANSPARENT:"transparent",OPAQUE:"opaque"};SWFUpload.completeURL=function(d){if(typeof d!=="string"||d.match(/^https?:\/\//i)||d.match(/^\//))return d;var f=window.location.pathname.lastIndexOf("/");path=f<=0?"/":window.location.pathname.substr(0,f)+"/";return path+d};SWFUpload.prototype.initSettings=function(){this.ensureDefault=function(d,f){this.settings[d]=this.settings[d]==undefined?f:this.settings[d]};
this.ensureDefault("upload_url","");this.ensureDefault("preserve_relative_urls",false);this.ensureDefault("file_post_name","Filedata");this.ensureDefault("post_params",{});this.ensureDefault("use_query_string",false);this.ensureDefault("requeue_on_error",false);this.ensureDefault("http_success",[]);this.ensureDefault("assume_success_timeout",0);this.ensureDefault("file_types","*.*");this.ensureDefault("file_types_description","All Files");this.ensureDefault("file_size_limit",0);this.ensureDefault("file_upload_limit",
0);this.ensureDefault("file_queue_limit",0);this.ensureDefault("flash_url","swfupload.swf");this.ensureDefault("prevent_swf_caching",true);this.ensureDefault("button_image_url","");this.ensureDefault("button_width",1);this.ensureDefault("button_height",1);this.ensureDefault("button_text","");this.ensureDefault("button_text_style","color: #000000; font-size: 16pt;");this.ensureDefault("button_text_top_padding",0);this.ensureDefault("button_text_left_padding",0);this.ensureDefault("button_action",SWFUpload.BUTTON_ACTION.SELECT_FILES);
this.ensureDefault("button_disabled",false);this.ensureDefault("button_placeholder_id","");this.ensureDefault("button_placeholder",null);this.ensureDefault("button_cursor",SWFUpload.CURSOR.ARROW);this.ensureDefault("button_window_mode",SWFUpload.WINDOW_MODE.WINDOW);this.ensureDefault("debug",false);this.settings.debug_enabled=this.settings.debug;this.settings.return_upload_start_handler=this.returnUploadStart;this.ensureDefault("swfupload_loaded_handler",null);this.ensureDefault("file_dialog_start_handler",
null);this.ensureDefault("file_queued_handler",null);this.ensureDefault("file_queue_error_handler",null);this.ensureDefault("file_dialog_complete_handler",null);this.ensureDefault("upload_start_handler",null);this.ensureDefault("upload_progress_handler",null);this.ensureDefault("upload_error_handler",null);this.ensureDefault("upload_success_handler",null);this.ensureDefault("upload_complete_handler",null);this.ensureDefault("debug_handler",this.debugMessage);this.ensureDefault("custom_settings",{});
this.customSettings=this.settings.custom_settings;if(this.settings.prevent_swf_caching)this.settings.flash_url=this.settings.flash_url+(this.settings.flash_url.indexOf("?")<0?"?":"&")+"preventswfcaching="+(new Date).getTime();if(!this.settings.preserve_relative_urls){this.settings.upload_url=SWFUpload.completeURL(this.settings.upload_url);this.settings.button_image_url=SWFUpload.completeURL(this.settings.button_image_url)}delete this.ensureDefault};SWFUpload.prototype.loadFlash=function(){var d,f;
if(document.getElementById(this.movieName)!==null)throw"ID "+this.movieName+" is already in use. The Flash Object could not be added";d=document.getElementById(this.settings.button_placeholder_id)||this.settings.button_placeholder;if(d==undefined)throw"Could not find the placeholder element: "+this.settings.button_placeholder_id;f=document.createElement("div");f.innerHTML=this.getFlashHTML();d.parentNode.replaceChild(f.firstChild,d);if(window[this.movieName]==undefined)window[this.movieName]=this.getMovieElement()};
SWFUpload.prototype.getFlashHTML=function(){var d="";if(KindEditor.IE&&KindEditor.V>8)d=' classid = "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"';return['<object id="',this.movieName,'"'+d+' type="application/x-shockwave-flash" data="',this.settings.flash_url,'" width="',this.settings.button_width,'" height="',this.settings.button_height,'" class="swfupload"><param name="wmode" value="',this.settings.button_window_mode,'" /><param name="movie" value="',this.settings.flash_url,'" /><param name="quality" value="high" /><param name="menu" value="false" /><param name="allowScriptAccess" value="always" />',
'<param name="flashvars" value="'+this.getFlashVars()+'" />',"</object>"].join("")};SWFUpload.prototype.getFlashVars=function(){var d=this.buildParamString(),f=this.settings.http_success.join(",");return["movieName=",encodeURIComponent(this.movieName),"&amp;uploadURL=",encodeURIComponent(this.settings.upload_url),"&amp;useQueryString=",encodeURIComponent(this.settings.use_query_string),"&amp;requeueOnError=",encodeURIComponent(this.settings.requeue_on_error),"&amp;httpSuccess=",encodeURIComponent(f),
"&amp;assumeSuccessTimeout=",encodeURIComponent(this.settings.assume_success_timeout),"&amp;params=",encodeURIComponent(d),"&amp;filePostName=",encodeURIComponent(this.settings.file_post_name),"&amp;fileTypes=",encodeURIComponent(this.settings.file_types),"&amp;fileTypesDescription=",encodeURIComponent(this.settings.file_types_description),"&amp;fileSizeLimit=",encodeURIComponent(this.settings.file_size_limit),"&amp;fileUploadLimit=",encodeURIComponent(this.settings.file_upload_limit),"&amp;fileQueueLimit=",
encodeURIComponent(this.settings.file_queue_limit),"&amp;debugEnabled=",encodeURIComponent(this.settings.debug_enabled),"&amp;buttonImageURL=",encodeURIComponent(this.settings.button_image_url),"&amp;buttonWidth=",encodeURIComponent(this.settings.button_width),"&amp;buttonHeight=",encodeURIComponent(this.settings.button_height),"&amp;buttonText=",encodeURIComponent(this.settings.button_text),"&amp;buttonTextTopPadding=",encodeURIComponent(this.settings.button_text_top_padding),"&amp;buttonTextLeftPadding=",
encodeURIComponent(this.settings.button_text_left_padding),"&amp;buttonTextStyle=",encodeURIComponent(this.settings.button_text_style),"&amp;buttonAction=",encodeURIComponent(this.settings.button_action),"&amp;buttonDisabled=",encodeURIComponent(this.settings.button_disabled),"&amp;buttonCursor=",encodeURIComponent(this.settings.button_cursor)].join("")};SWFUpload.prototype.getMovieElement=function(){if(this.movieElement==undefined)this.movieElement=document.getElementById(this.movieName);if(this.movieElement===
null)throw"Could not find Flash element";return this.movieElement};SWFUpload.prototype.buildParamString=function(){var d=this.settings.post_params,f=[];if(typeof d==="object")for(var m in d)d.hasOwnProperty(m)&&f.push(encodeURIComponent(m.toString())+"="+encodeURIComponent(d[m].toString()));return f.join("&amp;")};SWFUpload.prototype.destroy=function(){try{this.cancelUpload(null,false);var d=null;if((d=this.getMovieElement())&&typeof d.CallFunction==="unknown"){for(var f in d)try{if(typeof d[f]===
"function")d[f]=null}catch(m){}try{d.parentNode.removeChild(d)}catch(s){}}window[this.movieName]=null;SWFUpload.instances[this.movieName]=null;delete SWFUpload.instances[this.movieName];this.movieName=this.eventQueue=this.customSettings=this.settings=this.movieElement=null;return true}catch(k){return false}};SWFUpload.prototype.displayDebugInfo=function(){this.debug(["---SWFUpload Instance Info---\nVersion: ",SWFUpload.version,"\nMovie Name: ",this.movieName,"\nSettings:\n\tupload_url:               ",
this.settings.upload_url,"\n\tflash_url:                ",this.settings.flash_url,"\n\tuse_query_string:         ",this.settings.use_query_string.toString(),"\n\trequeue_on_error:         ",this.settings.requeue_on_error.toString(),"\n\thttp_success:             ",this.settings.http_success.join(", "),"\n\tassume_success_timeout:   ",this.settings.assume_success_timeout,"\n\tfile_post_name:           ",this.settings.file_post_name,"\n\tpost_params:              ",this.settings.post_params.toString(),
"\n\tfile_types:               ",this.settings.file_types,"\n\tfile_types_description:   ",this.settings.file_types_description,"\n\tfile_size_limit:          ",this.settings.file_size_limit,"\n\tfile_upload_limit:        ",this.settings.file_upload_limit,"\n\tfile_queue_limit:         ",this.settings.file_queue_limit,"\n\tdebug:                    ",this.settings.debug.toString(),"\n\tprevent_swf_caching:      ",this.settings.prevent_swf_caching.toString(),"\n\tbutton_placeholder_id:    ",this.settings.button_placeholder_id.toString(),
"\n\tbutton_placeholder:       ",this.settings.button_placeholder?"Set":"Not Set","\n\tbutton_image_url:         ",this.settings.button_image_url.toString(),"\n\tbutton_width:             ",this.settings.button_width.toString(),"\n\tbutton_height:            ",this.settings.button_height.toString(),"\n\tbutton_text:              ",this.settings.button_text.toString(),"\n\tbutton_text_style:        ",this.settings.button_text_style.toString(),"\n\tbutton_text_top_padding:  ",this.settings.button_text_top_padding.toString(),
"\n\tbutton_text_left_padding: ",this.settings.button_text_left_padding.toString(),"\n\tbutton_action:            ",this.settings.button_action.toString(),"\n\tbutton_disabled:          ",this.settings.button_disabled.toString(),"\n\tcustom_settings:          ",this.settings.custom_settings.toString(),"\nEvent Handlers:\n\tswfupload_loaded_handler assigned:  ",(typeof this.settings.swfupload_loaded_handler==="function").toString(),"\n\tfile_dialog_start_handler assigned: ",(typeof this.settings.file_dialog_start_handler===
"function").toString(),"\n\tfile_queued_handler assigned:       ",(typeof this.settings.file_queued_handler==="function").toString(),"\n\tfile_queue_error_handler assigned:  ",(typeof this.settings.file_queue_error_handler==="function").toString(),"\n\tupload_start_handler assigned:      ",(typeof this.settings.upload_start_handler==="function").toString(),"\n\tupload_progress_handler assigned:   ",(typeof this.settings.upload_progress_handler==="function").toString(),"\n\tupload_error_handler assigned:      ",
(typeof this.settings.upload_error_handler==="function").toString(),"\n\tupload_success_handler assigned:    ",(typeof this.settings.upload_success_handler==="function").toString(),"\n\tupload_complete_handler assigned:   ",(typeof this.settings.upload_complete_handler==="function").toString(),"\n\tdebug_handler assigned:             ",(typeof this.settings.debug_handler==="function").toString(),"\n"].join(""))};SWFUpload.prototype.addSetting=function(d,f,m){return f==undefined?(this.settings[d]=
m):(this.settings[d]=f)};SWFUpload.prototype.getSetting=function(d){if(this.settings[d]!=undefined)return this.settings[d];return""};SWFUpload.prototype.callFlash=function(d,f){f=f||[];var m=this.getMovieElement(),s,k;try{k=m.CallFunction('<invoke name="'+d+'" returntype="javascript">'+__flash__argumentsToXML(f,0)+"</invoke>");s=eval(k)}catch(n){throw"Call to "+d+" failed";}if(s!=undefined&&typeof s.post==="object")s=this.unescapeFilePostParams(s);return s};SWFUpload.prototype.selectFile=function(){this.callFlash("SelectFile")};
SWFUpload.prototype.selectFiles=function(){this.callFlash("SelectFiles")};SWFUpload.prototype.startUpload=function(d){this.callFlash("StartUpload",[d])};SWFUpload.prototype.cancelUpload=function(d,f){if(f!==false)f=true;this.callFlash("CancelUpload",[d,f])};SWFUpload.prototype.stopUpload=function(){this.callFlash("StopUpload")};SWFUpload.prototype.getStats=function(){return this.callFlash("GetStats")};SWFUpload.prototype.setStats=function(d){this.callFlash("SetStats",[d])};SWFUpload.prototype.getFile=
function(d){return typeof d==="number"?this.callFlash("GetFileByIndex",[d]):this.callFlash("GetFile",[d])};SWFUpload.prototype.addFileParam=function(d,f,m){return this.callFlash("AddFileParam",[d,f,m])};SWFUpload.prototype.removeFileParam=function(d,f){this.callFlash("RemoveFileParam",[d,f])};SWFUpload.prototype.setUploadURL=function(d){this.settings.upload_url=d.toString();this.callFlash("SetUploadURL",[d])};SWFUpload.prototype.setPostParams=function(d){this.settings.post_params=d;this.callFlash("SetPostParams",
[d])};SWFUpload.prototype.addPostParam=function(d,f){this.settings.post_params[d]=f;this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.removePostParam=function(d){delete this.settings.post_params[d];this.callFlash("SetPostParams",[this.settings.post_params])};SWFUpload.prototype.setFileTypes=function(d,f){this.settings.file_types=d;this.settings.file_types_description=f;this.callFlash("SetFileTypes",[d,f])};SWFUpload.prototype.setFileSizeLimit=function(d){this.settings.file_size_limit=
d;this.callFlash("SetFileSizeLimit",[d])};SWFUpload.prototype.setFileUploadLimit=function(d){this.settings.file_upload_limit=d;this.callFlash("SetFileUploadLimit",[d])};SWFUpload.prototype.setFileQueueLimit=function(d){this.settings.file_queue_limit=d;this.callFlash("SetFileQueueLimit",[d])};SWFUpload.prototype.setFilePostName=function(d){this.settings.file_post_name=d;this.callFlash("SetFilePostName",[d])};SWFUpload.prototype.setUseQueryString=function(d){this.settings.use_query_string=d;this.callFlash("SetUseQueryString",
[d])};SWFUpload.prototype.setRequeueOnError=function(d){this.settings.requeue_on_error=d;this.callFlash("SetRequeueOnError",[d])};SWFUpload.prototype.setHTTPSuccess=function(d){if(typeof d==="string")d=d.replace(" ","").split(",");this.settings.http_success=d;this.callFlash("SetHTTPSuccess",[d])};SWFUpload.prototype.setAssumeSuccessTimeout=function(d){this.settings.assume_success_timeout=d;this.callFlash("SetAssumeSuccessTimeout",[d])};SWFUpload.prototype.setDebugEnabled=function(d){this.settings.debug_enabled=
d;this.callFlash("SetDebugEnabled",[d])};SWFUpload.prototype.setButtonImageURL=function(d){if(d==undefined)d="";this.settings.button_image_url=d;this.callFlash("SetButtonImageURL",[d])};SWFUpload.prototype.setButtonDimensions=function(d,f){this.settings.button_width=d;this.settings.button_height=f;var m=this.getMovieElement();if(m!=undefined){m.style.width=d+"px";m.style.height=f+"px"}this.callFlash("SetButtonDimensions",[d,f])};SWFUpload.prototype.setButtonText=function(d){this.settings.button_text=
d;this.callFlash("SetButtonText",[d])};SWFUpload.prototype.setButtonTextPadding=function(d,f){this.settings.button_text_top_padding=f;this.settings.button_text_left_padding=d;this.callFlash("SetButtonTextPadding",[d,f])};SWFUpload.prototype.setButtonTextStyle=function(d){this.settings.button_text_style=d;this.callFlash("SetButtonTextStyle",[d])};SWFUpload.prototype.setButtonDisabled=function(d){this.settings.button_disabled=d;this.callFlash("SetButtonDisabled",[d])};SWFUpload.prototype.setButtonAction=
function(d){this.settings.button_action=d;this.callFlash("SetButtonAction",[d])};SWFUpload.prototype.setButtonCursor=function(d){this.settings.button_cursor=d;this.callFlash("SetButtonCursor",[d])};SWFUpload.prototype.queueEvent=function(d,f){if(f==undefined)f=[];else f instanceof Array||(f=[f]);var m=this;if(typeof this.settings[d]==="function"){this.eventQueue.push(function(){this.settings[d].apply(this,f)});setTimeout(function(){m.executeNextEvent()},0)}else if(this.settings[d]!==null)throw"Event handler "+
d+" is unknown or is not a function";};SWFUpload.prototype.executeNextEvent=function(){var d=this.eventQueue?this.eventQueue.shift():null;typeof d==="function"&&d.apply(this)};SWFUpload.prototype.unescapeFilePostParams=function(d){var f=/[$]([0-9a-f]{4})/i,m={},s;if(d!=undefined){for(var k in d.post)if(d.post.hasOwnProperty(k)){s=k;for(var n;(n=f.exec(s))!==null;)s=s.replace(n[0],String.fromCharCode(parseInt("0x"+n[1],16)));m[s]=d.post[k]}d.post=m}return d};SWFUpload.prototype.testExternalInterface=
function(){try{return this.callFlash("TestExternalInterface")}catch(d){return false}};SWFUpload.prototype.flashReady=function(){var d=this.getMovieElement();if(d){this.cleanUp(d);this.queueEvent("swfupload_loaded_handler")}else this.debug("Flash called back ready but the flash movie can't be found.")};SWFUpload.prototype.cleanUp=function(d){try{if(this.movieElement&&typeof d.CallFunction==="unknown"){this.debug("Removing Flash functions hooks (this should only run in IE and should prevent memory leaks)");
for(var f in d)try{if(typeof d[f]==="function")d[f]=null}catch(m){}}}catch(s){}window.__flash__removeCallback=function(k,n){try{if(k)k[n]=null}catch(t){}}};SWFUpload.prototype.fileDialogStart=function(){this.queueEvent("file_dialog_start_handler")};SWFUpload.prototype.fileQueued=function(d){d=this.unescapeFilePostParams(d);this.queueEvent("file_queued_handler",d)};SWFUpload.prototype.fileQueueError=function(d,f,m){d=this.unescapeFilePostParams(d);this.queueEvent("file_queue_error_handler",[d,f,m])};
SWFUpload.prototype.fileDialogComplete=function(d,f,m){this.queueEvent("file_dialog_complete_handler",[d,f,m])};SWFUpload.prototype.uploadStart=function(d){d=this.unescapeFilePostParams(d);this.queueEvent("return_upload_start_handler",d)};SWFUpload.prototype.returnUploadStart=function(d){var f;if(typeof this.settings.upload_start_handler==="function"){d=this.unescapeFilePostParams(d);f=this.settings.upload_start_handler.call(this,d)}else if(this.settings.upload_start_handler!=undefined)throw"upload_start_handler must be a function";
if(f===undefined)f=true;f=!!f;this.callFlash("ReturnUploadStart",[f])};SWFUpload.prototype.uploadProgress=function(d,f,m){d=this.unescapeFilePostParams(d);this.queueEvent("upload_progress_handler",[d,f,m])};SWFUpload.prototype.uploadError=function(d,f,m){d=this.unescapeFilePostParams(d);this.queueEvent("upload_error_handler",[d,f,m])};SWFUpload.prototype.uploadSuccess=function(d,f,m){d=this.unescapeFilePostParams(d);this.queueEvent("upload_success_handler",[d,f,m])};SWFUpload.prototype.uploadComplete=
function(d){d=this.unescapeFilePostParams(d);this.queueEvent("upload_complete_handler",d)};SWFUpload.prototype.debug=function(d){this.queueEvent("debug_handler",d)};SWFUpload.prototype.debugMessage=function(d){if(this.settings.debug){var f=[];if(typeof d==="object"&&typeof d.name==="string"&&typeof d.message==="string"){for(var m in d)d.hasOwnProperty(m)&&f.push(m+": "+d[m]);d=f.join("\n")||"";f=d.split("\n");d="EXCEPTION: "+f.join("\nEXCEPTION: ");SWFUpload.Console.writeLine(d)}else SWFUpload.Console.writeLine(d)}};
SWFUpload.Console={};SWFUpload.Console.writeLine=function(d){var f,m;try{f=document.getElementById("SWFUpload_Console");if(!f){m=document.createElement("form");document.getElementsByTagName("body")[0].appendChild(m);f=document.createElement("textarea");f.id="SWFUpload_Console";f.style.fontFamily="monospace";f.setAttribute("wrap","off");f.wrap="off";f.style.overflow="auto";f.style.width="700px";f.style.height="350px";f.style.margin="5px";m.appendChild(f)}f.value+=d+"\n";f.scrollTop=f.scrollHeight-
f.clientHeight}catch(s){alert("Exception: "+s.name+" Message: "+s.message)}}})();
(function(){if(typeof SWFUpload==="function"){SWFUpload.queue={};SWFUpload.prototype.initSettings=function(d){return function(){typeof d==="function"&&d.call(this);this.queueSettings={};this.queueSettings.queue_cancelled_flag=false;this.queueSettings.queue_upload_count=0;this.queueSettings.user_upload_complete_handler=this.settings.upload_complete_handler;this.queueSettings.user_upload_start_handler=this.settings.upload_start_handler;this.settings.upload_complete_handler=SWFUpload.queue.uploadCompleteHandler;
this.settings.upload_start_handler=SWFUpload.queue.uploadStartHandler;this.settings.queue_complete_handler=this.settings.queue_complete_handler||null}}(SWFUpload.prototype.initSettings);SWFUpload.prototype.startUpload=function(d){this.queueSettings.queue_cancelled_flag=false;this.callFlash("StartUpload",[d])};SWFUpload.prototype.cancelQueue=function(){this.queueSettings.queue_cancelled_flag=true;this.stopUpload();for(var d=this.getStats();d.files_queued>0;){this.cancelUpload();d=this.getStats()}};
SWFUpload.queue.uploadStartHandler=function(d){var f;if(typeof this.queueSettings.user_upload_start_handler==="function")f=this.queueSettings.user_upload_start_handler.call(this,d);f=f===false?false:true;this.queueSettings.queue_cancelled_flag=!f;return f};SWFUpload.queue.uploadCompleteHandler=function(d){var f=this.queueSettings.user_upload_complete_handler;d.filestatus===SWFUpload.FILE_STATUS.COMPLETE&&this.queueSettings.queue_upload_count++;if(typeof f==="function"?f.call(this,d)===false?false:
true:d.filestatus===SWFUpload.FILE_STATUS.QUEUED?false:true)if(this.getStats().files_queued>0&&this.queueSettings.queue_cancelled_flag===false)this.startUpload();else{if(this.queueSettings.queue_cancelled_flag===false)this.queueEvent("queue_complete_handler",[this.queueSettings.queue_upload_count]);else this.queueSettings.queue_cancelled_flag=false;this.queueSettings.queue_upload_count=0}}}})();
KindEditor.plugin("pagebreak",function(d){var f=this,m=d.undef(f.pagebreakHtml,'<hr style="page-break-after: always;" class="ke-pagebreak" />');f.clickToolbar("pagebreak",function(){var s=f.cmd,k=s.range;f.focus();var n=f.newlineTag=="br"||d.WEBKIT?"":'<span id="__kindeditor_tail_tag__"></span>';f.insertHtml(m+n);if(n!==""){n=d("#__kindeditor_tail_tag__",f.edit.doc);k.selectNodeContents(n[0]);n.removeAttr("id");s.select()}})});
KindEditor.plugin("plainpaste",function(d){var f=this;f.clickToolbar("plainpaste",function(){var m='<div style="padding:10px 20px;"><div style="margin-bottom:10px;">'+f.lang("plainpaste.").comment+'</div><textarea class="ke-textarea" style="width:408px;height:260px;"></textarea></div>';m=f.createDialog({name:"plainpaste",width:450,title:f.lang("plainpaste"),body:m,yesBtn:{name:f.lang("yes"),click:function(){var k=s.val();k=d.escape(k);k=k.replace(/ {2}/g," &nbsp;");k=f.newlineTag=="p"?k.replace(/^/,
"<p>").replace(/$/,"</p>").replace(/\n/g,"</p><p>"):k.replace(/\n/g,"<br />$&");f.insertHtml(k).hideDialog().focus()}}});var s=d("textarea",m.div);s[0].focus()})});
KindEditor.plugin("preview",function(d){var f=this;f.clickToolbar("preview",function(){f.lang("preview.");var m=f.createDialog({name:"preview",width:750,title:f.lang("preview"),body:'<div style="padding:10px 20px;"><iframe class="ke-textarea" frameborder="0" style="width:708px;height:400px;"></iframe></div>'});m=d("iframe",m.div);var s=d.iframeDoc(m);s.open();s.write(f.fullHtml());s.close();d(s.body).css("background-color","#FFF");m[0].contentWindow.focus()})});
KindEditor.plugin("quickformat",function(d){function f(k){for(k=k.first();k&&k.first();)k=k.first();return k}var m=this,s=d.toMap("blockquote,center,div,h1,h2,h3,h4,h5,h6,p");m.clickToolbar("quickformat",function(){m.focus();for(var k=m.edit.doc,n=m.cmd.range,t=d(k.body).first(),p,r=[],q=[],u=n.createBookmark(true);t;){p=t.next();var B=f(t);if(!B||B.name!="img"){if(s[t.name]){t.html(t.html().replace(/^(\s|&nbsp;|\u9286\ufffd)+/ig,""));t.css("text-indent","2em")}else q.push(t);if(!p||s[p.name]||s[t.name]&&!s[p.name]){q.length>
0&&r.push(q);q=[]}}t=p}d.each(r,function(C,v){var G=d('<p style="text-indent:2em;"></p>',k);v[0].before(G);d.each(v,function(N,D){G.append(D)})});n.moveToBookmark(u);m.addBookmark()})});
KindEditor.plugin("table",function(d){function f(p,r){r=r.toUpperCase();p.css("background-color",r);p.css("color",r==="#000000"?"#FFFFFF":"#000000");p.html(r)}function m(p,r){function q(){d.each(t,function(){this.remove()});t=[];d(document).unbind("click,mousedown",q);p.unbind("click,mousedown",q)}r.bind("click,mousedown",function(u){u.stopPropagation()});r.click(function(){q();var u=d(this),B=u.pos();B=d.colorpicker({x:B.x,y:B.y+u.height(),z:811214,selectedColor:d(this).html(),colors:k.colorTable,
noColor:k.lang("noColor"),shadowMode:k.shadowMode,click:function(C){f(u,C);q()}});t.push(B);d(document).bind("click,mousedown",q);p.bind("click,mousedown",q)})}function s(p,r,q){for(var u=p=0,B=r.cells.length;u<B;u++){if(r.cells[u]==q)break;p+=r.cells[u].rowSpan-1}return q.cellIndex-p}var k=this,n=k.lang("table."),t=[];k.plugin.table={prop:function(p){var r=['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keRows" style="width:90px;">'+n.cells+"</label>",n.rows+' <input type="text" id="keRows" class="ke-input-text ke-input-number" name="rows" value="" maxlength="4" /> &nbsp; ',
n.cols+' <input type="text" class="ke-input-text ke-input-number" name="cols" value="" maxlength="4" />','</div><div class="ke-dialog-row">','<label for="keWidth" style="width:90px;">'+n.size+"</label>",n.width+' <input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> &nbsp; ','<select name="widthType">','<option value="%">'+n.percent+"</option>",'<option value="px">'+n.px+"</option>","</select> &nbsp; ",n.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> &nbsp; ',
'<select name="heightType">','<option value="%">'+n.percent+"</option>",'<option value="px">'+n.px+"</option>",'</select></div><div class="ke-dialog-row">','<label for="kePadding" style="width:90px;">'+n.space+"</label>",n.padding+' <input type="text" id="kePadding" class="ke-input-text ke-input-number" name="padding" value="" maxlength="4" /> &nbsp; ',n.spacing+' <input type="text" class="ke-input-text ke-input-number" name="spacing" value="" maxlength="4" />','</div><div class="ke-dialog-row">',
'<label for="keAlign" style="width:90px;">'+n.align+"</label>",'<select id="keAlign" name="align">','<option value="">'+n.alignDefault+"</option>",'<option value="left">'+n.alignLeft+"</option>",'<option value="center">'+n.alignCenter+"</option>",'<option value="right">'+n.alignRight+"</option>",'</select></div><div class="ke-dialog-row">','<label for="keBorder" style="width:90px;">'+n.border+"</label>",n.borderWidth+' <input type="text" id="keBorder" class="ke-input-text ke-input-number" name="border" value="" maxlength="4" /> &nbsp; ',
n.borderColor+' <span class="ke-inline-block ke-input-color"></span>','</div><div class="ke-dialog-row">','<label for="keBgColor" style="width:90px;">'+n.backgroundColor+"</label>",'<span class="ke-inline-block ke-input-color"></span></div></div>'].join(""),q=k.cmd.range.createBookmark();r=k.createDialog({name:"table",width:500,title:k.lang("table"),body:r,beforeRemove:function(){ea.unbind()},yesBtn:{name:k.lang("yes"),click:function(){var L=u.val(),J=B.val(),M=C.val(),T=v.val(),Y=G.val(),Z=N.val(),
U=D.val(),ba=O.val(),la=E.val(),ma=H.val(),ua=d(ea[0]).html()||"",ra=d(ea[1]).html()||"";if(L==0||!/^\d+$/.test(L)){alert(k.lang("invalidRows"));u[0].focus()}else if(J==0||!/^\d+$/.test(J)){alert(k.lang("invalidRows"));B[0].focus()}else if(/^\d*$/.test(M))if(/^\d*$/.test(T))if(/^\d*$/.test(U))if(/^\d*$/.test(ba))if(/^\d*$/.test(ma)){if(I){M!==""?I.width(M+Y):I.css("width","");I[0].width!==undefined&&I.removeAttr("width");T!==""?I.height(T+Z):I.css("height","");I[0].height!==undefined&&I.removeAttr("height");
I.css("background-color",ra);I[0].bgColor!==undefined&&I.removeAttr("bgColor");if(U!=="")I[0].cellPadding=U;else I.removeAttr("cellPadding");if(ba!=="")I[0].cellSpacing=ba;else I.removeAttr("cellSpacing");if(la!=="")I[0].align=la;else I.removeAttr("align");ma!==""?I.attr("border",ma):I.removeAttr("border");ma===""||ma==="0"?I.addClass("ke-zeroborder"):I.removeClass("ke-zeroborder");ua!==""?I.attr("borderColor",ua):I.removeAttr("borderColor");k.hideDialog().focus();k.cmd.range.moveToBookmark(q);k.cmd.select()}else{var ka=
"";if(M!=="")ka+="width:"+M+Y+";";if(T!=="")ka+="height:"+T+Z+";";if(ra!=="")ka+="background-color:"+ra+";";M="<table";if(ka!=="")M+=' style="'+ka+'"';if(U!=="")M+=' cellpadding="'+U+'"';if(ba!=="")M+=' cellspacing="'+ba+'"';if(la!=="")M+=' align="'+la+'"';if(ma!=="")M+=' border="'+ma+'"';if(ma===""||ma==="0")M+=' class="ke-zeroborder"';if(ua!=="")M+=' bordercolor="'+ua+'"';M+=">";for(U=0;U<L;U++){M+="<tr>";for(ba=0;ba<J;ba++)M+="<td>"+(d.IE?"&nbsp;":"<br />")+"</td>";M+="</tr>"}M+="</table>";d.IE||
(M+="<br />");k.insertHtml(M);k.select().hideDialog().focus()}k.addBookmark()}else{alert(k.lang("invalidBorder"));H[0].focus()}else{alert(k.lang("invalidSpacing"));O[0].focus()}else{alert(k.lang("invalidPadding"));D[0].focus()}else{alert(k.lang("invalidHeight"));v[0].focus()}else{alert(k.lang("invalidWidth"));C[0].focus()}}}}).div;var u=d('[name="rows"]',r).val(3),B=d('[name="cols"]',r).val(2),C=d('[name="width"]',r).val(100),v=d('[name="height"]',r),G=d('[name="widthType"]',r),N=d('[name="heightType"]',
r),D=d('[name="padding"]',r).val(2),O=d('[name="spacing"]',r).val(0),E=d('[name="align"]',r),H=d('[name="border"]',r).val(1),ea=d(".ke-input-color",r);m(r,ea.eq(0));m(r,ea.eq(1));f(ea.eq(0),"#000000");f(ea.eq(1),"");u[0].focus();u[0].select();var I;if(!p)if(I=k.plugin.getSelectedTable()){u.val(I[0].rows.length);B.val(I[0].rows.length>0?I[0].rows[0].cells.length:0);u.attr("disabled",true);B.attr("disabled",true);var R;p=I[0].style.width||I[0].width;r=I[0].style.height||I[0].height;if(p!==undefined&&
(R=/^(\d+)((?:px|%)*)$/.exec(p))){C.val(R[1]);G.val(R[2])}else C.val("");if(r!==undefined&&(R=/^(\d+)((?:px|%)*)$/.exec(r))){v.val(R[1]);N.val(R[2])}D.val(I[0].cellPadding||"");O.val(I[0].cellSpacing||"");E.val(I[0].align||"");H.val(I[0].border===undefined?"":I[0].border);f(ea.eq(0),d.toHex(I.attr("borderColor")||""));f(ea.eq(1),d.toHex(I[0].style.backgroundColor||I[0].bgColor||""));C[0].focus();C[0].select()}},cellprop:function(){var p=['<div style="padding:20px;"><div class="ke-dialog-row">','<label for="keWidth" style="width:90px;">'+
n.size+"</label>",n.width+' <input type="text" id="keWidth" class="ke-input-text ke-input-number" name="width" value="" maxlength="4" /> &nbsp; ','<select name="widthType">','<option value="%">'+n.percent+"</option>",'<option value="px">'+n.px+"</option>","</select> &nbsp; ",n.height+' <input type="text" class="ke-input-text ke-input-number" name="height" value="" maxlength="4" /> &nbsp; ','<select name="heightType">','<option value="%">'+n.percent+"</option>",'<option value="px">'+n.px+"</option>",
'</select></div><div class="ke-dialog-row">','<label for="keAlign" style="width:90px;">'+n.align+"</label>",n.textAlign+' <select id="keAlign" name="textAlign">','<option value="">'+n.alignDefault+"</option>",'<option value="left">'+n.alignLeft+"</option>",'<option value="center">'+n.alignCenter+"</option>",'<option value="right">'+n.alignRight+"</option>","</select> ",n.verticalAlign+' <select name="verticalAlign">','<option value="">'+n.alignDefault+"</option>",'<option value="top">'+n.alignTop+
"</option>",'<option value="middle">'+n.alignMiddle+"</option>",'<option value="bottom">'+n.alignBottom+"</option>",'<option value="baseline">'+n.alignBaseline+"</option>",'</select></div><div class="ke-dialog-row">','<label for="keBorder" style="width:90px;">'+n.border+"</label>",n.borderWidth+' <input type="text" id="keBorder" class="ke-input-text ke-input-number" name="border" value="" maxlength="4" /> &nbsp; ',n.borderColor+' <span class="ke-inline-block ke-input-color"></span>','</div><div class="ke-dialog-row">',
'<label for="keBgColor" style="width:90px;">'+n.backgroundColor+"</label>",'<span class="ke-inline-block ke-input-color"></span></div></div>'].join(""),r=k.cmd.range.createBookmark();p=k.createDialog({name:"table",width:500,title:k.lang("tablecell"),body:p,beforeRemove:function(){E.unbind()},yesBtn:{name:k.lang("yes"),click:function(){var I=q.val(),R=u.val(),L=B.val(),J=C.val();v.val();G.val();var M=N.val(),T=D.val(),Y=O.val(),Z=d(E[0]).html()||"",U=d(E[1]).html()||"";if(/^\d*$/.test(I))if(/^\d*$/.test(R))if(/^\d*$/.test(Y)){H.css({width:I!==
""?I+L:"",height:R!==""?R+J:"","background-color":U,"text-align":M,"vertical-align":T,"border-width":Y,"border-style":Y!==""?"solid":"","border-color":Z});k.hideDialog().focus();k.cmd.range.moveToBookmark(r);k.cmd.select();k.addBookmark()}else{alert(k.lang("invalidBorder"));O[0].focus()}else{alert(k.lang("invalidHeight"));u[0].focus()}else{alert(k.lang("invalidWidth"));q[0].focus()}}}}).div;var q=d('[name="width"]',p).val(100),u=d('[name="height"]',p),B=d('[name="widthType"]',p),C=d('[name="heightType"]',
p),v=d('[name="padding"]',p).val(2),G=d('[name="spacing"]',p).val(0),N=d('[name="textAlign"]',p),D=d('[name="verticalAlign"]',p),O=d('[name="border"]',p).val(1),E=d(".ke-input-color",p);m(p,E.eq(0));m(p,E.eq(1));f(E.eq(0),"#000000");f(E.eq(1),"");q[0].focus();q[0].select();var H=k.plugin.getSelectedCell(),ea=H[0].style.height||H[0].height||"";if(p=/^(\d+)((?:px|%)*)$/.exec(H[0].style.width||H[0].width||"")){q.val(p[1]);B.val(p[2])}else q.val("");if(p=/^(\d+)((?:px|%)*)$/.exec(ea)){u.val(p[1]);C.val(p[2])}N.val(H[0].style.textAlign||
"");D.val(H[0].style.verticalAlign||"");if(p=H[0].style.borderWidth||"")p=parseInt(p);O.val(p);f(E.eq(0),d.toHex(H[0].style.borderColor||""));f(E.eq(1),d.toHex(H[0].style.backgroundColor||""));q[0].focus();q[0].select()},insert:function(){this.prop(true)},"delete":function(){var p=k.plugin.getSelectedTable();k.cmd.range.setStartBefore(p[0]).collapse(true);k.cmd.select();p.remove();k.addBookmark()},colinsert:function(p){var r=k.plugin.getSelectedTable()[0],q=k.plugin.getSelectedRow()[0],u=k.plugin.getSelectedCell()[0];
p=u.cellIndex+p;p+=r.rows[0].cells.length-q.cells.length;q=0;for(var B=r.rows.length;q<B;q++){var C=r.rows[q];p=C.insertCell(p);p.innerHTML=d.IE?"":"<br />";p=s(r,C,p)}k.cmd.range.selectNodeContents(u).collapse(true);k.cmd.select();k.addBookmark()},colinsertleft:function(){this.colinsert(0)},colinsertright:function(){this.colinsert(1)},rowinsert:function(p){var r=k.plugin.getSelectedTable()[0],q=k.plugin.getSelectedRow()[0],u=k.plugin.getSelectedCell()[0],B=q.rowIndex;if(p===1)B=q.rowIndex+(u.rowSpan-
1)+p;for(var C=r.insertRow(B),v=0,G=q.cells.length;v<G;v++){if(q.cells[v].rowSpan>1)G-=q.cells[v].rowSpan-1;var N=C.insertCell(v);if(p===1&&q.cells[v].colSpan>1)N.colSpan=q.cells[v].colSpan;N.innerHTML=d.IE?"":"<br />"}for(q=B;q>=0;q--){p=r.rows[q].cells;if(p.length>v){for(r=u.cellIndex;r>=0;r--)if(p[r].rowSpan>1)p[r].rowSpan+=1;break}}k.cmd.range.selectNodeContents(u).collapse(true);k.cmd.select();k.addBookmark()},rowinsertabove:function(){this.rowinsert(0)},rowinsertbelow:function(){this.rowinsert(1)},
rowmerge:function(){var p=k.plugin.getSelectedTable()[0],r=k.plugin.getSelectedRow()[0],q=k.plugin.getSelectedCell()[0],u=r.rowIndex+q.rowSpan;r=p.rows[u];if(!(p.rows.length<=u)){p=q.cellIndex;if(!(r.cells.length<=p)){u=r.cells[p];if(q.colSpan===u.colSpan){q.rowSpan+=u.rowSpan;r.deleteCell(p);k.cmd.range.selectNodeContents(q).collapse(true);k.cmd.select();k.addBookmark()}}}},colmerge:function(){k.plugin.getSelectedTable();var p=k.plugin.getSelectedRow()[0],r=k.plugin.getSelectedCell()[0],q=r.cellIndex+
1;if(!(p.cells.length<=q)){var u=p.cells[q];if(r.rowSpan===u.rowSpan){r.colSpan+=u.colSpan;p.deleteCell(q);k.cmd.range.selectNodeContents(r).collapse(true);k.cmd.select();k.addBookmark()}}},rowsplit:function(){var p=k.plugin.getSelectedTable()[0],r=k.plugin.getSelectedRow()[0],q=k.plugin.getSelectedCell()[0],u=r.rowIndex;if(q.rowSpan!==1){var B=s(p,r,q);r=1;for(var C=q.rowSpan;r<C;r++){var v=p.rows[u+r];B=v.insertCell(B);if(q.colSpan>1)B.colSpan=q.colSpan;B.innerHTML=d.IE?"":"<br />";B=s(p,v,B)}d(q).removeAttr("rowSpan");
k.cmd.range.selectNodeContents(q).collapse(true);k.cmd.select();k.addBookmark()}},colsplit:function(){k.plugin.getSelectedTable();var p=k.plugin.getSelectedRow()[0],r=k.plugin.getSelectedCell()[0],q=r.cellIndex;if(r.colSpan!==1){for(var u=1,B=r.colSpan;u<B;u++){var C=p.insertCell(q+u);if(r.rowSpan>1)C.rowSpan=r.rowSpan;C.innerHTML=d.IE?"":"<br />"}d(r).removeAttr("colSpan");k.cmd.range.selectNodeContents(r).collapse(true);k.cmd.select();k.addBookmark()}},coldelete:function(){for(var p=k.plugin.getSelectedTable()[0],
r=k.plugin.getSelectedRow()[0],q=k.plugin.getSelectedCell()[0].cellIndex,u=0,B=p.rows.length;u<B;u++){var C=p.rows[u],v=C.cells[q];if(v.colSpan>1){v.colSpan-=1;v.colSpan===1&&d(v).removeAttr("colSpan")}else C.deleteCell(q);if(v.rowSpan>1)u+=v.rowSpan-1}if(r.cells.length===0){k.cmd.range.setStartBefore(p).collapse(true);k.cmd.select();d(p).remove()}else k.cmd.selection(true);k.addBookmark()},rowdelete:function(){var p=k.plugin.getSelectedTable()[0],r=k.plugin.getSelectedRow()[0],q=k.plugin.getSelectedCell()[0];
r=r.rowIndex;for(q=q.rowSpan-1;q>=0;q--)p.deleteRow(r+q);if(p.rows.length===0){k.cmd.range.setStartBefore(p).collapse(true);k.cmd.select();d(p).remove()}else k.cmd.selection(true);k.addBookmark()}};k.clickToolbar("table",k.plugin.table.prop)});
KindEditor.plugin("template",function(d){function f(k){return s+k+"?ver="+encodeURIComponent(d.DEBUG?d.TIME:d.VERSION)}var m=this;m.lang("template.");var s=m.pluginsPath+"template/html/";m.clickToolbar("template",function(){var k=m.lang("template."),n=['<div style="padding:10px 20px;">','<div class="ke-header">','<div class="ke-left">',k.selectTemplate+" <select>"];d.each(k.fileList,function(q,u){n.push('<option value="'+q+'">'+u+"</option>")});html=[n.join(""),'</select></div><div class="ke-right">',
'<input type="checkbox" id="keReplaceFlag" name="replaceFlag" value="1" /> <label for="keReplaceFlag">'+k.replaceContent+"</label>",'</div><div class="ke-clearfix"></div></div><iframe class="ke-textarea" frameborder="0" style="width:458px;height:260px;background-color:#FFF;"></iframe></div>'].join("");k=m.createDialog({name:"template",width:500,title:m.lang("template"),body:html,yesBtn:{name:m.lang("yes"),click:function(){var q=d.iframeDoc(r);m[p[0].checked?"html":"insertHtml"](q.body.innerHTML).hideDialog().focus()}}});
var t=d("select",k.div),p=d('[name="replaceFlag"]',k.div),r=d("iframe",k.div);p[0].checked=true;r.attr("src",f(t.val()));t.change(function(){r.attr("src",f(this.value))})})});
KindEditor.plugin("wordpaste",function(d){var f=this;f.clickToolbar("wordpaste",function(){var m='<div style="padding:10px 20px;"><div style="margin-bottom:10px;">'+f.lang("wordpaste.").comment+'</div><iframe class="ke-textarea" frameborder="0" style="width:408px;height:260px;"></iframe></div>';m=f.createDialog({name:"wordpaste",width:450,title:f.lang("wordpaste"),body:m,yesBtn:{name:f.lang("yes"),click:function(){var k=s.body.innerHTML;k=d.clearMsWord(k,f.filterMode?f.htmlTags:d.options.htmlTags);
f.insertHtml(k).hideDialog().focus()}}}).div;m=d("iframe",m);var s=d.iframeDoc(m);if(!d.IE)s.designMode="on";s.open();s.write("<!doctype html><html><head><title>WordPaste</title></head>");s.write('<body style="background-color:#FFF;font-size:12px;margin:2px;">');d.IE||s.write("<br />");s.write("</body></html>");s.close();if(d.IE)s.body.contentEditable="true";m[0].contentWindow.focus()})});
KindEditor.plugin("fixtoolbar",function(d){function f(){var m=d(".ke-toolbar"),s=m.pos().y;d(window).bind("scroll",function(){if(m.css("position")=="fixed"){if(document.body.scrollTop-s<0){m.css("position","static");m.css("top","auto")}}else if(m.pos().y-document.body.scrollTop<0){m.css("position","fixed");m.css("top",0)}})}if(this.fixToolBar)this.isCreated?f():this.afterCreate(f)});
