(function(d,$){if(window.xheditor)return!1;var H=navigator.userAgent.toLowerCase(),Ba=-1!==H.indexOf("mobile"),I=d.browser,pa=parseFloat(I.version),i=I.msie,qa=I.mozilla,R=I.safari,Ca=I.opera,eb=-1":">",'"':""","\u00ae":"®","\u00a9":"©"},nb=/[<>"\u00ae\u00a9]/g,ra=function(z,o){function p(a){var a=a.target,b=lb[a.tagName.toLowerCase()];b&&("Embed"===b&&(b={"application/x-shockwave-flash":"Flash","application/x-mplayer2":"Media"}[a.type.toLowerCase()]),c.exec(b))}function H(a){if(27===a.which)return ta?c.removeModal():S&&c.hidePanel(),!1}function I(){setTimeout(c.setSource, 10)}function U(){c.getSource()}function Ua(a){var b,e,f;if(a&&(b=a.originalEvent.clipboardData)&&(e=b.items)&&(f=e[0])&&"file"==f.kind&&f.type.match(/^image\//i))return a=f.getAsFile(),b=new FileReader,b.onload=function(){var a='',a=Va(a);c.pasteHTML(a)},b.readAsDataURL(a),!1;var h=g.cleanPaste;if(0===h||y||Ja)return!0;Ja=!0;c.saveBookmark();var a=i?"pre":"div",n=d("<"+a+' class="xhe-paste">\ufeff\ufeff",k).appendTo(k.body),a=n[0];b=c.getSel();e=c.getRng(!0); n.css("top",fa.scrollTop());i?(e.moveToElementText(a),e.select()):(e.selectNodeContents(a),b.removeAllRanges(),b.addRange(e));setTimeout(function(){var a=3===h,b;if(a)b=n.text();else{var e=[];d(".xhe-paste",k.body).each(function(a,b){0==d(b).find(".xhe-paste").length&&e.push(b.innerHTML)});b=e.join("
")}n.remove();c.loadBookmark();if(b=b.replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,""))if(a)c.pasteText(b);else if(b=c.cleanHTML(b),b=c.cleanWord(b),b=c.formatXHTML(b),!g.onPaste||g.onPaste&&!1!==(b=g.onPaste(b)))b= Va(b),c.pasteHTML(b);Ja=!1},0)}function Va(a){var b=g.localUrlTest,e=g.remoteImgSaveUrl;if(b&&e){var f=[],h=0,a=a.replace(/(]*?)?(?:\s+src="\s*([^"]+)\s*")(?: [^>]*)?)(\/?>)/ig,function(a,e,c,d,r){/^(https?|data:image)/i.test(d)&&!b.test(d)&&(f[h]=d,c=c.replace(/\s+(width|height)="[^"]*"/ig,"").replace(/\s+src="[^"]*"/ig,' src="'+ua+'img/waiting.gif" remoteimg="'+h++ +'"'));return e+c+r});0");else return c.pasteHTML("
"),i&&0"),!1}function Na(){!qa&&!R&&(la&&A.height("100%").css("height",A.outerHeight()-q.outerHeight()),i&&q.hide().show())}function Da(a){a=a.target;if(a.tagName.match(/(img|embed)/i)){var b=c.getSel(),e=c.getRng(!0);e.selectNode(a);b.removeAllRanges();b.addRange(e)}}function L(a,b,e){if(!b)return!1;var c="_xhe_"+b;e&&(va&&(e=V(e,va,B)),a.attr(b,B?V(e,"abs", B):e).removeAttr(c).attr(c,e));return a.attr(c)||a.attr(b)}function Oa(){sa&&c.hidePanel()}function ob(a){if(y)return!0;var b=a.which,e=fb[b],b=e?e:String.fromCharCode(b).toLowerCase();sKey="";sKey+=a.ctrlKey?"ctrl+":"";sKey+=a.altKey?"alt+":"";sKey+=a.shiftKey?"shift+":"";sKey+=b;var a=ma[sKey],f;for(f in a)if(f=a[f],d.isFunction(f)){if(!1===f.call(c))return!1}else return c.exec(f),!1}function M(a,b){var e=typeof a;return!b?"undefined"!=e:"array"===b&&a.hasOwnProperty&&a instanceof Array?!0:e=== b}function V(a,b,e){if(a.match(/^(\w+):\/\//i)&&!a.match(/^https?:/i)||/^#/i.test(a)||/^data:/i.test(a))return a;var c=e?d('')[0]:location,e=c.protocol,h=c.host,n=c.hostname,j=c.port,c=c.pathname.replace(/\\/g,"/").replace(/[^\/]+$/i,"");""===j&&(j="80");""===c?c="/":"/"!==c.charAt(0)&&(c="/"+c);a=d.trim(a);"abs"!==b&&(a=a.replace(RegExp(e+"\\/\\/"+n.replace(/\./g,"\\.")+"(?::"+j+")"+("80"===j?"?":"")+"(/|$)","i"),"/"));"rel"===b&&(a=a.replace(RegExp("^"+c.replace(/([\/\.\+\[\]\(\)])/g, "\\$1"),"i"),""));if("rel"!==b&&(a.match(/^(https?:\/\/|\/)/i)||(a=c+a),"/"===a.charAt(0))){for(var n=[],a=a.split("/"),l=a.length,c=0;c');var a=F.outerWidth(),b=F.outerHeight(),a=g.width||z.style.width||(10'], f,h,n=/\||\//i;d.each(g.tools,function(a,b){b.match(n)&&e.push('');if("|"===b)e.push('');else if("/"===b)e.push("
");else{f=ka[b];if(!f)return;h=f.c?f.c:"xheIcon xheBtn"+b;e.push('
'+f.t+"");f.s&&c.addShortcuts(f.s,b)}b.match(n)&& e.push('')});e.push('
');F.after(d(''));q=d("#"+bb);A=d("#"+cb);P='';if(a=g.loadCSS)if(M(a,"array"))for(var j in a)P+='';else P=a.match(/\s*]*?)?>[\s\S]+?<\/style>\s*/i)?P+a:P+('');j=""+P+"\u53ef\u89c6\u5316\u7f16\u8f91\u5668,alt+1\u52309\u952e,\u5207\u6362\u5230\u5de5\u5177\u533a,tab\u952e,\u9009\u62e9\u6309\u94ae,esc\u952e,\u8fd4\u56de\u7f16\u8f91 "+ (g.readTip?g.readTip:"")+"";b&&(j+="");j+='';c.win=W=d("#"+db)[0].contentWindow;fa=d(W);try{this.doc=k=W.document,ga=d(k),k.open(),k.write(j),k.close(),i?k.body.contentEditable="true":k.designMode="On"}catch(l){}setTimeout(La,300);c.setSource();W.setInterval=null;q.append(e.join("")).bind("mousedown contextmenu",N).click(function(a){var b=d(a.target).closest("a");b.is(".xheEnabled")&&(clearTimeout(wa), q.find("a").attr("tabindex","-1"),w=a,c.exec(b.attr("cmd")));return!1});q.find(".xheButton").hover(function(a){var b=d(this),e=g.hoverExecDelay,m=X;X=null;if(-1===e||oa||!b.is(".xheEnabled"))return!1;if(m&&10').mousedown(function(a){a.stopPropagation()}),ba=d('
'),ca=d('
'),setTimeout(function(){d(document.body).append(t).append(ba).append(ca)},10));d("#"+ja).show();F.hide();A.css("height",O-q.outerHeight()); i&8>pa&&setTimeout(function(){A.css("height",O-q.outerHeight())},1);F.focus(c.focus);Ya.submit(U).bind("reset",I);g.submitID&&d("#"+g.submitID).mousedown(U);d(window).bind("unload beforeunload",U).bind("resize",Na);d(document).mousedown(Oa);Sa||(d(document).keydown(H),Sa=!0);fa.focus(function(){g.focus&&g.focus()}).blur(function(){g.blur&&g.blur()});R&&fa.click(Da);ga.mousedown(Oa).keydown(ob).keypress(Ba).dblclick(p).bind("mousedown click",function(a){F.trigger(a.type)});if(i){ga.keydown(function(a){var b= c.getRng();if(8===a.which&&b.item)return d(b.item(0)).remove(),!1});var u=function(a){var a=d(a.target),b;(b=a.css("width"))&&a.css("width","").attr("width",b.replace(/[^0-9%]+/g,""));(b=a.css("height"))&&a.css("height","").attr("height",b.replace(/[^0-9%]+/g,""))};ga.bind("controlselect",function(a){a=a.target;d.nodeName(a,"IMG")&&d(a).unbind("resizeend",u).bind("resizeend",u)})}ga.keydown(function(a){var b=a.which;if(a.altKey&&49<=b&&57>=b)return q.find("a").attr("tabindex","0"),q.find(".xheGStart").eq(b- 49).next().find("a").focus(),k.title="\ufeff\ufeff",!1}).click(function(){q.find("a").attr("tabindex","-1")});q.keydown(function(a){var b=a.which;if(27==b)q.find("a").attr("tabindex","-1"),c.focus();else if(a.altKey&&49<=b&&57>=b)return q.find(".xheGStart").eq(b-49).next().find("a").focus(),!1});j=d(k.documentElement);Ca?j.bind("keydown",function(a){a.ctrlKey&&86===a.which&&Ua()}):j.bind(i?"beforepaste":"paste",Ua);g.disableContextmenu&&j.bind("contextmenu",N);g.html5Upload&&j.bind("dragenter dragover", function(a){var b;if((b=a.originalEvent.dataTransfer.types)&&-1!==d.inArray("Files",b))return!1}).bind("drop",function(a){var a=a.originalEvent.dataTransfer,b;if(a&&(b=a.files)&&0b.startOffset-b.endOffset&&b.startContainer.hasChildNodes()&&(e=b.startContainer.childNodes[b.startOffset]));a=a?a:"*";e=d(e);e.is(a)||(e=d(e).closest(a));return e};this.getSelect=function(a){var b=c.getSel(),e=c.getRng(),f=!0,f=!e||e.item?!1:!b||0===e.boundingWidth||e.collapsed;if("text"===a)return f?"":e.text||(b.toString?b.toString(): "");e.cloneContents?(a=d("
"),(e=e.cloneContents())&&a.append(e),e=a.html()):e=M(e.item)?e.item(0).outerHTML:M(e.htmlText)?e.htmlText:e.toString();f&&(e="");e=c.processHTML(e,"read");e=c.cleanHTML(e);return e=c.formatXHTML(e)};this.pasteHTML=function(a,b){if(y)return!1;c.focus();var a=c.processHTML(a,"write"),e=c.getSel(),f=c.getRng();if(b!==$){if(f.item){var h=f.item(0),f=c.getRng(!0);f.moveToElementText(h);f.select()}f.collapse(b)}a+="<"+(i?"img":"span")+' id="_xhe_temp" width="0" height="0" />'; if(f.insertNode){if(0");c.pasteHTML(a,b)};this.appendHTML=function(a){if(y)return!1; c.focus();a=c.processHTML(a,"write");d(k.body).append(a);c.setTextCursor(!0)};this.domEncode=function(a){return a.replace(nb,function(a){return mb[a]})};this.setSource=function(a){ha=null;if("string"!==typeof a&&""!==a)a=z.value;y?d("#sourceCode",k).val(a):(g.beforeSetSource&&(a=g.beforeSetSource(a)),a=c.cleanHTML(a),a=c.formatXHTML(a),a=c.processHTML(a,"write"),i?(k.body.innerHTML=''+a,d("#_xhe_temp",k).remove()):k.body.innerHTML=a)};this.processHTML=function(a, b){if("write"===b){a=a.replace(/(<(\/?)(\w+))((?:\s+[\w\-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*((\/?)>)/g,function(a,b,c,e,d,f,h){e=e.toLowerCase();qa?"strong"===e?e="b":"em"===e&&(e="i"):R&&("strong"===e?(e="span",c||(d+=' class="Apple-style-span" style="font-weight: bold;"')):"em"===e?(e="span",c||(d+=' class="Apple-style-span" style="font-style: italic;"')):"u"===e?(e="span",c||(d+=' class="Apple-style-span" style="text-decoration: underline;"')):"strike"===e&&(e="span",c||(d+=' class="Apple-style-span" style="text-decoration: line-through;"'))); var m,x="";if("del"===e)e="strike";else if("img"===e)d=d.replace(/\s+emot\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i,function(a,b){m=b.match(/^(["']?)(.*)\1/)[2];m=m.split(",");m[1]||(m[1]=m[0],m[0]="");"default"===m[0]&&(m[0]="");return g.emotMark?a:""});else if("a"===e)!d.match(/ href=[^ ]/i)&&d.match(/ name=[^ ]/i)&&(x+=" xhe-anchor"),h&&(f=">");else if("table"===e&&!c&&(a=d.match(/\s+border\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i),!a||a[1].match(/^(["']?)\s*0\s*\1$/)))x+=" xhe-border";var Z,d=d.replace(/\s+([\w\-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g, function(a,b,c){b=b.toLowerCase();c=c.match(/^(["']?)(.*)\1/)[2];aft="";if(i&&b.match(/^(disabled|checked|readonly|selected)$/)&&c.match(/^(false|0)$/i)||"img"===e&&m&&"src"===b)return"";b.match(/^(src|href)$/)&&(aft=" _xhe_"+b+'="'+c+'"',B&&(c=V(c,"abs",B)));x&&"class"===b&&(c+=" "+x,x="");R&&"style"===b&&"span"===e&&c.match(/(^|;)\s*(font-family|font-size|color|background-color)\s*:\s*[^;]+\s*(;|$)/i)&&(Z=!0);return" "+b+'="'+c+'"'+aft});m&&(a=Y+(m[0]?m[0]:"default")+"/"+m[1]+".gif",d+=' src="'+ a+'" _xhe_src="'+a+'"');Z&&(d+=' class="Apple-style-span"');x&&(d+=' class="'+x+'"');return"<"+c+e+d+f});i&&(a=a.replace(/'/ig,"'"));if(!R)var e=function(a,b,e,c,d,f){var b="",h,m;(h=c.match(/font-family\s*:\s*([^;"]+)/i))&&(b+=' face="'+h[1]+'"');if(h=c.match(/font-size\s*:\s*([^;"]+)/i)){h=h[1].toLowerCase();for(var x=0;x=x;x++)m[1]+=(h[x]-0).toString(16)}m[1]=m[1].replace(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,"#$1$1$2$2$3$3");b+=' color="'+m[1]+'"'}c=c.replace(/(^|;)(\s*(font-family|color)\s*:\s*[^;"]+;?)+/ig,"$1");return""!==b?(c&&(b+=' style="'+c+'"'),""+f+""):a},a=a.replace(/<(span)(\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"( [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig, e),a=a.replace(/<(span)(\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"( [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,e),a=a.replace(/<(span)(\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"( [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,e);a=a.replace(/<(td|th)(\s+[^>]*?)?>(\s| )*<\/\1>/ig,"<$1$2>"+(i?"":"
")+"")}else{if(R)for(var c=[{r:/font-weight\s*:\s*bold;?/ig, t:"strong"},{r:/font-style\s*:\s*italic;?/ig,t:"em"},{r:/text-decoration\s*:\s*underline;?/ig,t:"u"},{r:/text-decoration\s*:\s*line-through;?/ig,t:"strike"}],e=function(a,b,e,d,h){for(var a=(e?e:"")+(d?d:""),g=[],D=[],m,e=0;e");D.push("");return""});a=a.replace(/\s+style\s*=\s*"\s*"/i,"");return(a?"":"")+g.join("")+h+D.join("")+(a?"
":"")},d=0;2>d;d++)a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig, e),a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,e),a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,e);a=a.replace(/(<(\w+))((?:\s+[\w\-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/g,function(a,b,e,c,d){var e=e.toLowerCase(),f,c=c.replace(/\s+_xhe_(?:src|href)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i,function(a, b){f=b.match(/^(["']?)(.*)\1/)[2];return""});f&&va&&(f=V(f,va,B));c=c.replace(/\s+([\w\-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g,function(a,b,c){b=b.toLowerCase();c=c.match(/^(["']?)(.*)\1/)[2].replace(/"/g,"'");if("class"===b){if(c.match(/^["']?(apple|webkit)/i))return"";c=c.replace(/\s?xhe-[a-z]+/ig,"");if(""===c)return""}else{if(b.match(/^((_xhe_|_moz_|_webkit_)|jquery\d+)/i))return"";if(f&&b.match(/^(src|href)$/i))return" "+b+'="'+f+'"';"style"===b&&(c=c.replace(/(^|;)\s*(font-size)\s*:\s*([a-z-]+)\s*(;|$)/i, function(a,b,c,e,d){for(var f,h=0;h\s]+)/i)&&(c+=' alt=""');return b+c+d});a=a.replace(/(<(td|th)(?:\s+[^>]*?)?>)\s*([\s\S]*?)()?\s*<\/\2>/ig,function(a,b,c,e){return b+(e?e:" ")+""});a=a.replace(/^\s*(?:<(p|div)(?:\s+[^>]*?)?>)?\s*(]*?)?>\s*<\/span>|]*?)?>| )*\s*(?:<\/\1>)?\s*$/i,"")}return a=a.replace(/(]*?)?>)([\s\S]+?)(<\/pre>)/gi, function(a,b,c,e){return b+c.replace(//ig,"\r\n")+e})};this.getSource=function(a){var b,e=g.beforeGetSource;y?(b=d("#sourceCode",k).val(),e||(b=c.formatXHTML(b,!1))):(b=c.processHTML(k.body.innerHTML,"read"),b=c.cleanHTML(b),b=c.formatXHTML(b,a),e&&(b=e(b)));return z.value=b};this.cleanWord=function(a){var b=g.cleanPaste;if(0b&&a.match(/mso(-|normal)|WordDocument|]*?x:str/i)){for(var a=a.replace(/<\!--[\s\S]*?--\>||]*?)?>[\s\S]*?<\/style>/ig, ""),a=a.replace(/\r?\n/ig,""),a=a.replace(/(<(\/?)([\w\-:]+))((?:\s+[\w\-:]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))?)*)\s*(\/?>)/g,function(a,c,e,d,g,u){d=d.toLowerCase();if(d.match(/^(link|img)$/)&&g.match(/file:\/\//i)||d.match(/:/)||"span"===d&&2===b||!e&&(g=g.replace(/\s([\w\-:]+)(?:\s*=\s*("[^"]*"|'[^']*'|[^>\s]+))?/ig,function(a,c,e){c=c.toLowerCase();e=e.match(/^(["']?)(.*)\1/)[2];if(c.match(/:/)||c.match(/^(class|lang|language|span)$/)||"td"===d&&("height"===c||"width"===c&&!g.match(/\scolspan="\d+"/i)))return""; return"style"===c?2===b?"":(e=e.replace(/"|"/ig,"'").replace(/\s*([^:]+)\s*:\s*(.*?)(;|$)/ig,function(a,b,c){return/^(color|background)$/i.test(b)?b+":"+c+";":""}).replace(/^\s+|\s+$/g,""))?" "+c+'="'+e+'"':"":a}),"span"===d&&/^\s*$/.test(g)))return"";return c+g+u}),c=0;3>c;c++)a=a.replace(/<([^\s>]+)(\s+[^>]*)?>\s*<\/\1>/g,function(a,b){return b.match(/^a$/i)?a:""});for(c=0;3>c;c++)a=a.replace(/]+)>]+)>/ig,function(a,b,c){return""})}return a};this.cleanHTML= function(a){var a=a.replace(/]*?)?>/ig,""),b,a=a.replace(/]*?)?>([\s\S]*?)<\/head>/i,function(a,c){b=c.match(/<(script|style)(\s+[^>]*?)?>[\s\S]*?<\/\1>/ig);return""});b&&(a=b.join("")+a);a=a.replace(/<\??xml(:\w+)?(\s+[^>]*?)?>([\s\S]*?<\/xml>)?/ig,"");g.internalScript||(a=a.replace(/]*?)?>[\s\S]*?<\/script>/ig,""));g.internalStyle||(a=a.replace(/]*?)?>[\s\S]*?<\/style>/ig,""));if(!g.linkTag||!g.inlineScript||!g.inlineStyle)a= a.replace(/(<(\w+))((?:\s+[\w-]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/ig,function(a,b,c,d,j){if(!g.linkTag&&"link"===c.toLowerCase())return"";g.inlineScript||(d=d.replace(/\s+on(?:click|dblclick|mouse(down|up|move|over|out|enter|leave|wheel)|key(down|press|up)|change|select|submit|reset|blur|focus|load|unload)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/ig,""));g.inlineStyle||(d=d.replace(/\s+(style|class)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/ig,""));return b+d+j});return a=a.replace(/<\/(strong|b|u|strike|em|i)>((?:\s|| )*?)<\1(\s+[^>]*?)?>/ig, "$2")};this.formatXHTML=function(a,b){function e(a){for(var b={},a=a.split(","),c=0;c");u(e.join(""),a,!0);"pre"===a&&(B=!0)}function g(a){if(a)for(b= E.length-1;0<=b&&!(E[b]===a);b--);else var b=0;if(0<=b){for(var c=E.length-1;c>=b;c--)u("",E[c]);E.length=b}"pre"===a&&(B=!1,w--)}function j(a){u(c.domEncode(a))}function l(a){G.push(a.replace(/^[\s\r\n]+|[\s\r\n]+$/g,""))}function u(a,c,e){B||(a=a.replace(/(\t*\r?\n\t*)+/g,""));if(!B&&!0===b)if(a.match(/^\s*$/))G.push(a);else{var d=m[c];d?(e&&w++,""===A&&w--):A&&w++;((d?c:"")!==A||d)&&r();G.push(a);"br"===c&&r();d&&(D[c]||!e)&&w--;A=d?c:""}else G.push(a)}function r(){G.push("\r\n");if(0< w)for(var a=w;a--;)G.push("\t")}function s(a,b,c,e){if(!c)return e;var d="",c=c.replace(/ face\s*=\s*"\s*([^"]*)\s*"/i,function(a,b){b&&(d+="font-family:"+b+";");return""}),c=c.replace(/ size\s*=\s*"\s*(\d+)\s*"/i,function(a,b){d+="font-size:"+T[(7b?1:b)-1].s+";";return""}),c=c.replace(/ color\s*=\s*"\s*([^"]*)\s*"/i,function(a,b){b&&(d+="color:"+b+";");return""}),c=c.replace(/ style\s*=\s*"\s*([^"]*)\s*"/i,function(a,b){b&&(d+=b);return""});return(c+=' style="'+d+'"')?""+e+"
": e}var D=e("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),m=e("address,applet,blockquote,button,center,dd,dir,div,dl,dt,fieldset,form,frameset,h1,h2,h3,h4,h5,h6,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,table,tbody,td,tfoot,th,thead,tr,ul,script"),x=e("a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var"), Z=e("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),k=e("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),i=e("script,style"),o={b:"strong",i:"em",s:"del",strike:"del"},q=/<(?:\/([^\s>]+)|!([^>]*?)|([\w\-:]+)((?:"[^"]*"|'[^']*'|[^"'<>])*)\s*(\/?))>/g,y=/\s*([\w\-:]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s]+)))?/g,G=[],E=[];E.last=function(){return this[this.length-1]};for(var v,C,p=0,t,z,w=-1,A="body",B=!1;v=q.exec(a);){C=v.index;C>p&&(p= a.substring(p,C),t?z.push(p):j(p));p=q.lastIndex;if(C=v[1])if(C=d(C),t&&C===t&&(l(z.join("")),z=t=null),!t){g(C);continue}t?z.push(v[0]):(C=v[3])?(C=d(C),h(C,v[4],v[5]),i[C]&&(t=C,z=[])):v[2]&&G.push(v[0])}a.length>p&&j(a.substring(p,a.length));g();a=G.join("");G=null;a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?<\/\1>)*?)<\/\1>/ig,s);a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig, s);a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,s);return a=a.replace(/^(\s*\r?\n)+|(\s*\r?\n)+$/g,"")};this.toggleShowBlocktag=function(a){na!==a&&(na=!na,a=d(k.body),na?(Q+=" showBlocktag",a.addClass("showBlocktag")):(Q=Q.replace(" showBlocktag",""),a.removeClass("showBlocktag")))};this.toggleSource=function(a){if(y!==a){q.find("[cmd=Source]").toggleClass("xheEnabled").toggleClass("xheActive");var b=k.body,e=d(b),f,h,a=0,g="";if(y)f=c.getSource(),e.html("").removeAttr("scroll").attr("class", "editMode"+Q),i?b.contentEditable="true":k.designMode="On",qa&&(c._exec("inserthtml","-"),d("#"+za).show().focus().hide()),g="\u6e90\u4ee3\u7801";else{c.pasteHTML('',!0);f=c.getSource(!0);a=f.indexOf('');if(!Ca)a=f.substring(0,a).replace(/\r/g,"").length;f=f.replace(/(\r?\n\s*|)<\/span>(\s*\r?\n|)/,function(a,b,c){return b&&c?"\r\n":b+c});i?b.contentEditable="false":k.designMode="Off";e.attr("scroll","no").attr("class", "sourceMode").html('