(function(e,Z){if(e.xheditor)return false;var wb=navigator.userAgent.toLowerCase().indexOf("mobile")>-1,qa=e.browser,Ca=parseFloat(qa.version),y=qa.msie,Da=qa.mozilla,$=qa.safari,db=qa.opera;e.fn.xheditor=function(B){if(wb)return false;var A=[];this.each(function(){if(e.nodeName(this,"TEXTAREA"))if(B===false){if(this.xheditor){this.xheditor.remove();this.xheditor=null}}else if(this.xheditor)A.push(this.xheditor);else{var J=/({.*})/.exec(e(this).attr("class"));if(J){try{J=eval("("+J[1]+")")}catch(Pa){}B= e.extend({},J,B)}J=new e.xheditor(this,B);if(J.init()){this.xheditor=J;A.push(J)}}});if(A.length===0)A=false;if(A.length===1)A=A[0];return A};var ja=0,S=false,Ea=true,Fa=false,eb=false,L,ra,sa,ka,T,Qa,la,Ra,Sa,Ta,U;e("script[src*=xheditor]").each(function(){var B=this.src;if(B.match(/xheditor[^\/]*\.js/i)){U=B.replace(/[\?#].*$/,"").replace(/(^|[\/\\])[^\/]*$/,"$1");return false}});if(y)try{document.execCommand("BackgroundImageCache",false,true)}catch(Jb){}var xb={27:"esc",9:"tab",32:"space",13:"enter", 8:"backspace",145:"scroll",20:"capslock",144:"numlock",19:"pause",45:"insert",36:"home",46:"del",35:"end",33:"pageup",34:"pagedown",37:"left",38:"up",39:"right",40:"down",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12"},fb=["#FFFFFF","#CCCCCC","#C0C0C0","#999999","#666666","#333333","#000000","#FFCCCC","#FF6666","#FF0000","#CC0000","#990000","#660000","#330000","#FFCC99","#FF9966","#FF9900","#FF6600","#CC6600","#993300","#663300","#FFFF99", "#FFFF66","#FFCC66","#FFCC33","#CC9933","#996633","#663333","#FFFFCC","#FFFF33","#FFFF00","#FFCC00","#999900","#666600","#333300","#99FF99","#66FF99","#33FF33","#33CC00","#009900","#006600","#003300","#99FFFF","#33FFFF","#66CCCC","#00CCCC","#339999","#336666","#003333","#CCFFFF","#66FFFF","#33CCFF","#3366FF","#3333FF","#000099","#000066","#CCCCFF","#9999FF","#6666CC","#6633FF","#6600CC","#333399","#330099","#FFCCFF","#FF99FF","#CC66CC","#CC33CC","#993399","#663366","#330033"],yb=[{n:"p",t:"\u666e\u901a\u6bb5\u843d"}, {n:"h1",t:"\u6807\u98981"},{n:"h2",t:"\u6807\u98982"},{n:"h3",t:"\u6807\u98983"},{n:"h4",t:"\u6807\u98984"},{n:"h5",t:"\u6807\u98985"},{n:"h6",t:"\u6807\u98986"},{n:"pre",t:"\u5df2\u7f16\u6392\u683c\u5f0f"},{n:"address",t:"\u5730\u5740"}],zb=[{n:"\u5b8b\u4f53",c:"SimSun"},{n:"\u4eff\u5b8b\u4f53",c:"FangSong_GB2312"},{n:"\u9ed1\u4f53",c:"SimHei"},{n:"\u6977\u4f53",c:"KaiTi_GB2312"},{n:"\u5fae\u8f6f\u96c5\u9ed1",c:"Microsoft YaHei"},{n:"Arial"},{n:"Arial Black"},{n:"Comic Sans MS"},{n:"Courier New"}, {n:"System"},{n:"Times New Roman"},{n:"Tahoma"},{n:"Verdana"}],aa=[{n:"x-small",s:"10px",t:"\u6781\u5c0f"},{n:"small",s:"13px",t:"\u7279\u5c0f"},{n:"medium",s:"16px",t:"\u5c0f"},{n:"large",s:"18px",t:"\u4e2d"},{n:"x-large",s:"24px",t:"\u5927"},{n:"xx-large",s:"32px",t:"\u7279\u5927"},{n:"-webkit-xxx-large",s:"48px",t:"\u6781\u5927"}],Ab=[{s:"\u5de6\u5bf9\u9f50",v:"justifyleft"},{s:"\u5c45\u4e2d",v:"justifycenter"},{s:"\u53f3\u5bf9\u9f50",v:"justifyright"},{s:"\u4e24\u7aef\u5bf9\u9f50",v:"justifyfull"}], Bb=[{s:"\u6570\u5b57\u5217\u8868",v:"insertOrderedList"},{s:"\u7b26\u53f7\u5217\u8868",v:"insertUnorderedList"}],Cb={"default":{name:"\u9ed8\u8ba4",width:24,height:24,line:7,list:{smile:"\u5fae\u7b11",tongue:"\u5410\u820c\u5934",titter:"\u5077\u7b11",laugh:"\u5927\u7b11",sad:"\u96be\u8fc7",wronged:"\u59d4\u5c48",fastcry:"\u5feb\u54ed\u4e86",cry:"\u54ed",wail:"\u5927\u54ed",mad:"\u751f\u6c14",knock:"\u6572\u6253",curse:"\u9a82\u4eba",crazy:"\u6293\u72c2",angry:"\u53d1\u706b",ohmy:"\u60ca\u8bb6",awkward:"\u5c34\u5c2c", panic:"\u60ca\u6050",shy:"\u5bb3\u7f9e",cute:"\u53ef\u601c",envy:"\u7fa1\u6155",proud:"\u5f97\u610f",struggle:"\u594b\u6597",quiet:"\u5b89\u9759",shutup:"\u95ed\u5634",doubt:"\u7591\u95ee",despise:"\u9119\u89c6",sleep:"\u7761\u89c9",bye:"\u518d\u89c1"}}},ta={Cut:{t:"\u526a\u5207 (Ctrl+X)"},Copy:{t:"\u590d\u5236 (Ctrl+C)"},Paste:{t:"\u7c98\u8d34 (Ctrl+V)"},Pastetext:{t:"\u7c98\u8d34\u6587\u672c",h:y?0:1},Blocktag:{t:"\u6bb5\u843d\u6807\u7b7e",h:1},Fontface:{t:"\u5b57\u4f53",h:1},FontSize:{t:"\u5b57\u4f53\u5927\u5c0f", h:1},Bold:{t:"\u52a0\u7c97 (Ctrl+B)",s:"Ctrl+B"},Italic:{t:"\u659c\u4f53 (Ctrl+I)",s:"Ctrl+I"},Underline:{t:"\u4e0b\u5212\u7ebf (Ctrl+U)",s:"Ctrl+U"},Strikethrough:{t:"\u5220\u9664\u7ebf"},FontColor:{t:"\u5b57\u4f53\u989c\u8272",h:1},BackColor:{t:"\u80cc\u666f\u989c\u8272",h:1},SelectAll:{t:"\u5168\u9009 (Ctrl+A)"},Removeformat:{t:"\u5220\u9664\u6587\u5b57\u683c\u5f0f"},Align:{t:"\u5bf9\u9f50",h:1},List:{t:"\u5217\u8868",h:1},Outdent:{t:"\u51cf\u5c11\u7f29\u8fdb"},Indent:{t:"\u589e\u52a0\u7f29\u8fdb"}, Link:{t:"\u8d85\u94fe\u63a5 (Ctrl+L)",s:"Ctrl+L",h:1},Unlink:{t:"\u53d6\u6d88\u8d85\u94fe\u63a5"},Anchor:{t:"\u951a\u70b9",h:1},Img:{t:"\u56fe\u7247",h:1},Flash:{t:"Flash\u52a8\u753b",h:1},Media:{t:"\u591a\u5a92\u4f53\u6587\u4ef6",h:1},Hr:{t:"\u63d2\u5165\u6c34\u5e73\u7ebf"},Emot:{t:"\u8868\u60c5",s:"ctrl+e",h:1},Table:{t:"\u8868\u683c",h:1},Source:{t:"\u6e90\u4ee3\u7801"},Preview:{t:"\u9884\u89c8"},Print:{t:"\u6253\u5370 (Ctrl+P)",s:"Ctrl+P"},Fullscreen:{t:"\u5168\u5c4f\u7f16\u8f91 (Esc)",s:"Esc"}, About:{t:"\u5173\u4e8e xhEditor"}},Ua={mini:"Bold,Italic,Underline,Strikethrough,|,Align,List,|,Link,Img",simple:"Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,|,Align,List,Outdent,Indent,|,Link,Img,Emot",full:"Cut,Copy,Paste,Pastetext,|,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,|,Align,List,Outdent,Indent,|,Link,Unlink,Anchor,Img,Flash,Media,Hr,Emot,Table,|,Source,Preview,Print,Fullscreen"};Ua.mfull= Ua.full.replace(/\|(,Align)/i,"/$1");var Db={a:"Link",img:"Img",embed:"Embed"},Eb={"<":"<",">":">",'"':""","\u00ae":"®","\u00a9":"©"},Fb=/[<>"\u00ae\u00a9]/g;e.xheditor=function(B,A){function J(a){a=a.target;var b=Db[a.tagName.toLowerCase()];if(b){if(b==="Embed")b={"application/x-shockwave-flash":"Flash","application/x-mplayer2":"Media"}[a.type.toLowerCase()];d.exec(b)}}function Pa(a){if(a.which===27){if(Fa)d.removeModal();else S&&d.hidePanel();return false}}function gb(){setTimeout(d.setSource, 10)}function ba(){d.getSource()}function hb(a){var b,c,g;if(a&&(b=a.originalEvent.clipboardData)&&(c=b.items)&&(g=c[0])&&g.kind=="file"&&g.type.match(/^image\//i)){a=g.getAsFile();b=new FileReader;b.onload=function(){var j='';j=ib(j);d.pasteHTML(j)};b.readAsDataURL(a);return false}var k=p.cleanPaste;if(k===0||F||Va)return true;Va=true;d.saveBookmark();b=y?"pre":"div";var n=e("<"+b+' class="xhe-paste">\ufeff\ufeff",w).appendTo(w.body);b=n[0];c=d.getSel(); g=d.getRng(true);n.css("top",ca.scrollTop());if(y){g.moveToElementText(b);g.select();g.execCommand("Paste");if(b.innerHTML=="\ufeff\ufeff"){n.remove();return}a.preventDefault()}else{g.selectNodeContents(b);c.removeAllRanges();c.addRange(g)}setTimeout(function(){var j=k===3,i;if(j)i=n.text();else{var m=[];e(".xhe-paste",w.body).each(function(f,h){e(h).find(".xhe-paste").length==0&&m.push(h.innerHTML)});i=m.join("
")}n.remove();d.loadBookmark();if(j)d.pasteText(i);else{i=d.cleanHTML(i);i=d.cleanWord(i); i=d.formatXHTML(i);if(!p.onPaste||p.onPaste&&(i=p.onPaste(i))!==false){i=ib(i);d.pasteHTML(i)}}Va=false},0)}function ib(a){var b=p.localUrlTest,c=p.remoteImgSaveUrl;if(b&&c){var g=[],k=0;a=a.replace(/(]*?)?(?:\s+src="\s*([^"]+)\s*")(?: [^>]*)?)(\/?>)/ig,function(n,j,i,m,f){if(/^(https?|data:image)/i.test(m)&&!b.test(m)){g[k]=m;i=i.replace(/\s+(width|height)="[^"]*"/ig,"").replace(/\s+src="[^"]*"/ig,' src="'+Ga+'img/waiting.gif" remoteimg="'+k++ +'"')}return j+i+f});g.length>0&&e.post(c, {urls:g.join("|")},function(n){n=n.split("|");e("img[remoteimg]",d.doc).each(function(){var j=e(this);V(j,"src",n[j.attr("remoteimg")]);j.removeAttr("remoteimg")})})}return a}function Wa(a){try{d._exec("styleWithCSS",a,true)}catch(b){try{d._exec("useCSS",!a,true)}catch(c){}}}function Xa(){if(Ya&&!F){Wa(false);try{d._exec("enableObjectResizing",true,true)}catch(a){}if(y)try{d._exec("BackgroundImageCache",true,true)}catch(b){}}}function Gb(a){if(F||a.which!==13||a.shiftKey||a.ctrlKey||a.altKey)return true; a=d.getParent("p,h1,h2,h3,h4,h5,h6,pre,address,div,li");if(a.is("li"))return true;if(p.forcePtag)a.length===0&&d._exec("formatblock","

");else{d.pasteHTML("
");y&&a.length>0&&d.getRng().parentElement().childNodes.length===2&&d.pasteHTML("
");return false}}function Za(){if(!Da&&!$){ua&&O.height("100%").css("height",O.outerHeight()-C.outerHeight());y&&C.hide().show()}}function Hb(a){a=a.target;if(a.tagName.match(/(img|embed)/i)){var b=d.getSel(),c=d.getRng(true);c.selectNode(a);b.removeAllRanges(); b.addRange(c)}}function V(a,b,c){if(!b)return false;var g="_xhe_"+b;if(c){if(Ha)c=da(c,Ha,P);a.attr(b,P?da(c,"abs",P):c).removeAttr(g).attr(g,c)}return a.attr(g)||a.attr(b)}function $a(){Ea&&d.hidePanel()}function Ib(a){if(F)return true;var b=a.which,c=xb[b];b=c?c:String.fromCharCode(b).toLowerCase();sKey="";sKey+=a.ctrlKey?"ctrl+":"";sKey+=a.altKey?"alt+":"";sKey+=a.shiftKey?"shift+":"";sKey+=b;a=va[sKey];for(var g in a){g=a[g];if(e.isFunction(g)){if(g.call(d)===false)return false}else{d.exec(g); return false}}}function W(a,b){var c=typeof a;if(!b)return c!="undefined";if(b==="array"&&a.hasOwnProperty&&a instanceof Array)return true;return c===b}function da(a,b,c){if(a.match(/^(\w+):\/\//i)&&!a.match(/^https?:/i))return a;var g=c?e('')[0]:location;c=g.protocol;var k=g.host,n=g.hostname,j=g.port;g=g.pathname.replace(/\\/g,"/").replace(/[^\/]+$/i,"");if(j==="")j="80";if(g==="")g="/";else if(g.charAt(0)!=="/")g="/"+g;a=e.trim(a);if(b!=="abs")a=a.replace(RegExp(c+"\\/\\/"+n.replace(/\./g, "\\.")+"(?::"+j+")"+(j==="80"?"?":"")+"(/|$)","i"),"/");if(b==="rel")a=a.replace(RegExp("^"+g.replace(/([\/\.\+\[\]\(\)])/g,"\\$1"),"i"),"");if(b!=="rel"){a.match(/^(https?:\/\/|\/)/i)||(a=g+a);if(a.charAt(0)==="/"){n=[];a=a.split("/");var i=a.length;for(g=0;g');var a=Q.outerWidth(),b=Q.outerHeight();a=p.width||B.style.width||(a> 10?a:0);Y=p.height||B.style.height||(b>10?b:150);if(W(a,"number"))a+="px";if(W(Y,"string"))Y=Y.replace(/[^\d]+/g,"");b=p.background||B.style.background;var c=[''],g,k,n=/\||\//i;e.each(p.tools,function(f,h){h.match(n)&&c.push('');if(h==="|")c.push('');else if(h==="/")c.push("
");else{g=ta[h];if(!g)return;k=g.c?g.c:"xheIcon xheBtn"+h;c.push('
'+g.t+"");g.s&&d.addShortcuts(g.s,h)}h.match(n)&&c.push('')});c.push('
');Q.after(e(''));C=e("#"+pb);O=e("#"+qb);za='';if(a=p.loadCSS)if(W(a,"array"))for(var j in a)za+=''; else za+=a.match(/\s*]*?)?>[\s\S]+?<\/style>\s*/i)?a:'';j=""+za+"\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 "+(p.readTip?p.readTip:"")+"";if(b)j+="";j+='';d.win=ea=e("#"+rb)[0].contentWindow;ca=e(ea);try{this.doc= w=ea.document;ma=e(w);w.open();w.write(j);w.close();if(y)w.body.contentEditable="true";else w.designMode="On"}catch(i){}setTimeout(Xa,300);d.setSource();ea.setInterval=null;C.append(c.join("")).bind("mousedown contextmenu",X).click(function(f){var h=e(f.target).closest("a");if(h.is(".xheEnabled")){clearTimeout(Ia);C.find("a").attr("tabindex","-1");M=f;d.exec(h.attr("cmd"))}return false});C.find(".xheButton").hover(function(f){var h=e(this),o=p.hoverExecDelay,l=fa;fa=null;if(o===-1||xa||!h.is(".xheEnabled"))return false; if(l&&l>10){xa=true;setTimeout(function(){xa=false},100);return false}var q=h.attr("cmd");if(ta[q].h!==1){d.hidePanel();return false}if(bb)o=0;if(o>=0)Ia=setTimeout(function(){M=f;oa={x:M.clientX,y:M.clientY};d.exec(q)},o)},function(){oa=null;Ia&&clearTimeout(Ia)}).mousemove(function(f){if(oa){var h={x:f.clientX-oa.x,y:f.clientY-oa.y};if(Math.abs(h.x)>1||Math.abs(h.y)>1){if(h.x>0&&h.y>0){h=Math.round(Math.atan(h.y/h.x)/0.017453293);fa=fa?(fa+h)/2:h}else fa=null;oa={x:f.clientX,y:f.clientY}}}});L= e("#xhePanel");ra=e("#xheShadow");sa=e("#xheCntLine");if(L.length===0){L=e('

').mousedown(function(f){f.stopPropagation()});ra=e('
');sa=e('
');setTimeout(function(){e(document.body).append(L).append(ra).append(sa)},10)}e("#"+ya).show();Q.hide();O.css("height",Y-C.outerHeight());y&Ca<8&&setTimeout(function(){O.css("height",Y-C.outerHeight())},1);Q.focus(d.focus);lb.submit(ba).bind("reset",gb);p.submitID&&e("#"+p.submitID).click(ba); e(window).bind("unload beforeunload",ba).bind("resize",Za);e(document).mousedown($a);if(!eb){e(document).keydown(Pa);eb=true}ca.focus(function(){p.focus&&p.focus()}).blur(function(){p.blur&&p.blur()});$&&ca.click(Hb);ma.mousedown($a).keydown(Ib).keypress(Gb).dblclick(J).bind("mousedown click",function(f){Q.trigger(f.type)});if(y){ma.keydown(function(f){var h=d.getRng();if(f.which===8&&h.item){e(h.item(0)).remove();return false}});var m=function(f){f=e(f.target);var h;if(h=f.css("width"))f.css("width", "").attr("width",h.replace(/[^0-9%]+/g,""));if(h=f.css("height"))f.css("height","").attr("height",h.replace(/[^0-9%]+/g,""))};ma.bind("controlselect",function(f){f=f.target;e.nodeName(f,"IMG")&&e(f).unbind("resizeend",m).bind("resizeend",m)})}ma.keydown(function(f){var h=f.which;if(f.altKey&&h>=49&&h<=57){C.find("a").attr("tabindex","0");C.find(".xheGStart").eq(h-49).next().find("a").focus();w.title="\ufeff\ufeff";return false}}).click(function(){C.find("a").attr("tabindex","-1")});C.keydown(function(f){var h= f.which;if(h==27){C.find("a").attr("tabindex","-1");d.focus()}else if(f.altKey&&h>=49&&h<=57){C.find(".xheGStart").eq(h-49).next().find("a").focus();return false}});j=e(w.documentElement);db?j.bind("keydown",function(f){f.ctrlKey&&f.which===86&&hb()}):j.bind("paste",hb);p.disableContextmenu&&j.bind("contextmenu",X);p.html5Upload&&j.bind("dragenter dragover",function(f){var h;if((h=f.originalEvent.dataTransfer.types)&&e.inArray("Files",h)!==-1)return false}).bind("drop",function(f){f=f.originalEvent.dataTransfer; var h;if(f&&(h=f.files)&&h.length>0){var o,l;f=["Link","Img","Flash","Media"];var q=[],r;for(o in f){l=f[o];p["up"+l+"Url"]&&p["up"+l+"Url"].match(/^[^!].*/i)&&q.push(l+":,"+p["up"+l+"Ext"])}if(q.length===0)return false;else r=q.join(",");l=function(t){var s,u;for(o=0;o0?b.getRangeAt(0):null}c||(c=w.body.createTextRange?w.body.createTextRange():w.createRange())}catch(g){}return c};this.getParent=function(a){var b=d.getRng(),c;if(y)c=b.item?b.item(0):b.parentElement(); else{c=b.commonAncestorContainer;if(!b.collapsed)if(b.startContainer===b.endContainer&&b.startOffset-b.endOffset<2&&b.startContainer.hasChildNodes())c=b.startContainer.childNodes[b.startOffset]}a=a?a:"*";c=e(c);c.is(a)||(c=e(c).closest(a));return c};this.getSelect=function(a){var b=d.getSel(),c=d.getRng(),g=true;g=!c||c.item?false:!b||c.boundingWidth===0||c.collapsed;if(a==="text")return g?"":c.text||(b.toString?b.toString():"");if(c.cloneContents){a=e("
");(c=c.cloneContents())&&a.append(c); c=a.html()}else c=W(c.item)?c.item(0).outerHTML:W(c.htmlText)?c.htmlText:c.toString();if(g)c="";c=d.processHTML(c,"read");c=d.cleanHTML(c);return c=d.formatXHTML(c)};this.pasteHTML=function(a,b){if(F)return false;d.focus();a=d.processHTML(a,"write");var c=d.getSel(),g=d.getRng();if(b!==Z){if(g.item){var k=g.item(0);g=d.getRng(true);g.moveToElementText(k);g.select()}g.collapse(b)}a+="<"+(y?"img":"span")+' id="_xhe_temp" width="0" height="0" />';if(g.insertNode){if(e(g.startContainer).closest("style,script").length> 0)return false;g.deleteContents();g.insertNode(g.createContextualFragment(a))}else{if(c.type.toLowerCase()==="control"){c.clear();g=d.getRng()}g.pasteHTML(a)}k=e("#_xhe_temp",w);var n=k[0];if(y){g.moveToElementText(n);g.select()}else{g.selectNode(n);c.removeAllRanges();c.addRange(g)}k.remove()};this.pasteText=function(a,b){a||(a="");a=d.domEncode(a);a=a.replace(/\r?\n/g,"
");d.pasteHTML(a,b)};this.appendHTML=function(a){if(F)return false;d.focus();a=d.processHTML(a,"write");e(w.body).append(a)}; this.domEncode=function(a){return a.replace(Fb,function(b){return Eb[b]})};this.setSource=function(a){na=null;if(typeof a!=="string"&&a!=="")a=B.value;if(F)e("#sourceCode",w).val(a);else{if(p.beforeSetSource)a=p.beforeSetSource(a);a=d.cleanHTML(a);a=d.formatXHTML(a);a=d.processHTML(a,"write");if(y){w.body.innerHTML=''+a+"\n";e("#_xhe_temp",w).remove()}else w.body.innerHTML=a}};this.processHTML=function(a,b){if(b==="write"){a=a.replace(/(<(\/?)(\w+))((?:\s+[\w-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*((\/?)>)/g, function(n,j,i,m,f,h,o){m=m.toLowerCase();if(Da)if(m==="strong")m="b";else{if(m==="em")m="i"}else if($)if(m==="strong"){m="span";i||(f+=' class="Apple-style-span" style="font-weight: bold;"')}else if(m==="em"){m="span";i||(f+=' class="Apple-style-span" style="font-style: italic;"')}else if(m==="u"){m="span";i||(f+=' class="Apple-style-span" style="text-decoration: underline;"')}else if(m==="strike"){m="span";i||(f+=' class="Apple-style-span" style="text-decoration: line-through;"')}var l,q="";if(m=== "del")m="strike";else if(m==="img")f=f.replace(/\s+emot\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i,function(t,s){l=s.match(/^(["']?)(.*)\1/)[2];l=l.split(",");if(!l[1]){l[1]=l[0];l[0]=""}if(l[0]==="default")l[0]="";return p.emotMark?t:""});else if(m==="a"){if(!f.match(/ href=[^ ]/i)&&f.match(/ name=[^ ]/i))q+=" xhe-anchor";if(o)h=">"}else if(m==="table"&&!i){n=f.match(/\s+border\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i);if(!n||n[1].match(/^(["']?)\s*0\s*\1$/))q+=" xhe-border"}var r;f=f.replace(/\s+([\w-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g, function(t,s,u){s=s.toLowerCase();u=u.match(/^(["']?)(.*)\1/)[2];aft="";if(y&&s.match(/^(disabled|checked|readonly|selected)$/)&&u.match(/^(false|0)$/i))return"";if(m==="img"&&l&&s==="src")return"";if(s.match(/^(src|href)$/)){aft=" _xhe_"+s+'="'+u+'"';if(P)u=da(u,"abs",P)}if(q&&s==="class"){u+=" "+q;q=""}if($&&s==="style")if(m==="span"&&u.match(/(^|;)\s*(font-family|font-size|color|background-color)\s*:\s*[^;]+\s*(;|$)/i))r=true;return" "+s+'="'+u+'"'+aft});if(l){n=ga+(l[0]?l[0]:"default")+"/"+l[1]+ ".gif";f+=' src="'+n+'" _xhe_src="'+n+'"'}if(r)f+=' class="Apple-style-span"';if(q)f+=' class="'+q+'"';return"<"+i+m+f+h});if(y)a=a.replace(/'/ig,"'");if(!$){var c=function(n,j,i,m){j="";var f,h;if(f=i.match(/font-family\s*:\s*([^;"]+)/i))j+=' face="'+f[1]+'"';if(f=i.match(/font-size\s*:\s*([^;"]+)/i)){f=f[1].toLowerCase();for(var o=0;o"+m+""}else return n};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, c);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,c);a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)?\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]*)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,c)}a=a.replace(/<(td|th)(\s+[^>]*?)?>(\s| )*<\/\1>/ig,"<$1$2>"+(y?"":"
")+"")}else{if($){var g=[{r:/font-weight:\sbold/ig, t:"strong"},{r:/font-style:\sitalic/ig,t:"em"},{r:/text-decoration:\sunderline/ig,t:"u"},{r:/text-decoration:\sline-through/ig,t:"strike"}];c=function(n,j,i,m,f){j=i+m;i="";if(!j)return f;for(m=0;m"+f+"":n};for(var k=0;k<2;k++){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, c);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,c);a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,c)}}a=a.replace(/(<(\w+))((?:\s+[\w-:]+\s*=\s*(?:"[^"]*"|'[^']*'|[^>\s]+))*)\s*(\/?>)/g,function(n,j,i,m,f){i=i.toLowerCase();var h;m=m.replace(/\s+_xhe_(?:src|href)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/i,function(o, l){h=l.match(/^(["']?)(.*)\1/)[2];return""});if(h&&Ha)h=da(h,Ha,P);m=m.replace(/\s+([\w-:]+)\s*=\s*("[^"]*"|'[^']*'|[^>\s]+)/g,function(o,l,q){l=l.toLowerCase();q=q.match(/^(["']?)(.*)\1/)[2];if(l==="class"){if(q.match(/^["']?(apple|webkit)/i))return"";q=q.replace(/\s?xhe-[a-z]+/ig,"");if(q==="")return""}else if(l.match(/^((_xhe_|_moz_|_webkit_)|jquery\d+)/i))return"";else if(h&&l.match(/^(src|href)$/i))return" "+l+'="'+h+'"';else if(l==="style")q=q.replace(/(^|;)\s*(font-size)\s*:\s*([a-z-]+)\s*(;|$)/i, function(r,t,s,u,G){for(var N,D=0;D\s]+)/i))m+=' alt=""';return j+m+f});a=a.replace(/(<(td|th)(?:\s+[^>]*?)?>)\s*([\s\S]*?)()?\s*<\/\2>/ig,function(n,j,i,m){return j+(m?m:" ")+""});a=a.replace(/^\s*(?:<(p|div)(?:\s+[^>]*?)?>)?\s*(]*?)?>\s*<\/span>|]*?)?>| )*\s*(?:<\/\1>)?\s*$/i,"")}return a=a.replace(/(]*?)?>)([\s\S]+?)(<\/pre>)/gi, function(n,j,i,m){return j+i.replace(//ig,"\r\n")+m})};this.getSource=function(a){var b,c=p.beforeGetSource;if(F){b=e("#sourceCode",w).val();c||(b=d.formatXHTML(b,false))}else{b=d.processHTML(w.body.innerHTML,"read");b=d.cleanHTML(b);b=d.formatXHTML(b,a);if(c)b=c(b)}return B.value=b};this.cleanWord=function(a){var b=p.cleanPaste;if(b>0&&b<3&&a.match(/mso(-|normal)|WordDocument|]*?x:str/i)){a=a.replace(/