(function(d){if(d.xheditor)return false;d.fn.xheditor=function(A){var B=[];this.each(function(){if(d.nodeName(this,"TEXTAREA"))if(A===false){if(this.xheditor){this.xheditor.remove();this.xheditor=null}}else if(!this.xheditor){var C=/({.*})/.exec(d(this).attr("class"));if(C){try{C=eval("("+C[1]+")")}catch(ja){}A=d.extend({},C,A)}C=new d.xheditor(this,A);if(C.init()){this.xheditor=C;B.push(C)}}});if(B.length==0)B=false;if(B.length==1)B=B[0];return B};var V=0,qa=d.browser.version,D=d.browser.msie,ka=
d.browser.mozilla,W=d.browser.safari,Oa=d.browser.opera,R=false,la=true,K,$,aa,ba,ra,S;d("script[src*=xheditor]").each(function(){var A=this.src;if(A.match(/xheditor[^\/]*\.js/i)){S=A.replace(/[\?#].*$/,"").replace(/(^|[\/\\])[^\/]*$/,"$1");return false}});var Pa={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"},Qa=["#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"],Ra=[{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"}],Sa=[{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 Narrow"},{n:"Arial Black"},{n:"Comic Sans MS"},{n:"Courier New"},{n:"System"},{n:"Times New Roman"},{n:"Tahoma"},{n:"Verdana"}],M=[{n:"xx-small",wkn:"x-small",s:"8pt",t:"\u6781\u5c0f"},{n:"x-small",wkn:"small",s:"10pt",t:"\u7279\u5c0f"},{n:"small",wkn:"medium",
s:"12pt",t:"\u5c0f"},{n:"medium",wkn:"large",s:"14pt",t:"\u4e2d"},{n:"large",wkn:"x-large",s:"18pt",t:"\u5927"},{n:"x-large",wkn:"xx-large",s:"24pt",t:"\u7279\u5927"},{n:"xx-large",wkn:"-webkit-xxx-large",s:"36pt",t:"\u6781\u5927"}],Ta=[{s:"\u5de6\u5bf9\u9f50",v:"justifyleft"},{s:"\u5c45\u4e2d",v:"justifycenter"},{s:"\u53f3\u5bf9\u9f50",v:"justifyright"},{s:"\u4e24\u7aef\u5bf9\u9f50",v:"justifyfull"}],Ua=[{s:"\u6570\u5b57\u5217\u8868",v:"insertOrderedList"},{s:"\u7b26\u53f7\u5217\u8868",v:"insertUnorderedList"}],
Va={"default":{name:"\u9ed8\u8ba4",width:25,height:18,line:6,list:{biggrin:"Big grin",smile:"Smile",titter:"Titter",lol:"Lol",call:"Call",victory:"Victory",shy:"Shy",handshake:"Handshake",kiss:"Kiss",sad:"Sad",cry:"Cry",huffy:"Huffy",mad:"Mad",tongue:"Tongue",sweat:"Sweat",shocked:"Shocked",time:"Time",hug:"Hug"}}},ca={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:D?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 (Ctrl+S)",s:"Ctrl+S"},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 (Shift+Tab)",s:"Shift+Tab"},Indent:{t:"\u589e\u52a0\u7f29\u8fdb (Tab)",s:"Tab"},Link:{t:"\u8d85\u94fe\u63a5 (Ctrl+K)",s:"Ctrl+K",h:1},Unlink:{t:"\u53d6\u6d88\u8d85\u94fe\u63a5"},Img:{t:"\u56fe\u7247",h:1},Flash:{t:"Flash\u52a8\u753b",h:1},Media:{t:"\u591a\u5a92\u4f53\u6587\u4ef6",h:1},Emot:{t:"\u8868\u60c5",s:"ctrl+e",h:1},Table:{t:"\u8868\u683c",h:1},Source:{t:"\u6e90\u4ee3\u7801"},Print:{t:"\u6253\u5370 (Ctrl+P)",s:"Ctrl+P"},Fullscreen:{t:"\u5168\u5c4f\u7f16\u8f91 (Esc)",
s:"Esc"},About:{t:"\u5173\u4e8e xhEditor",h:1}},sa={mini:"Bold,Italic,Underline,Strikethrough,Separator,Align,List,Separator,Link,Img,About",simple:"Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,Separator,Align,List,Outdent,Indent,Separator,Link,Img,Emot,About",full:"Cut,Copy,Paste,Pastetext,Separator,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,SelectAll,Removeformat,Separator,Align,List,Outdent,Indent,Separator,Link,Unlink,Img,Flash,Media,Emot,Table,Separator,Source,Print,Fullscreen,About"};
sa.mfull=sa.full.replace(/Separator(,Align)/i,"BtnBr$1");d.xheditor=function(A,B){function C(a,c){var e=typeof a;if(!c)return e!="undefined";if(c=="array"&&a.hasOwnProperty&&a instanceof Array)return true;return e==c}function ja(a,c){var e=location.protocol,h=location.hostname,o=location.port,j=location.pathname.replace(/\\/g,"/").replace(/[^\/]+$/i,"");o=o==""?"80":o;a=d.trim(a);if(e=="file:")c="abs";if(c!="abs")a=a.replace(new RegExp(e+"\\/\\/"+h.replace(/\./g,"\\.")+"(?::"+o+")"+(o=="80"?"?":"")+
"(/|$)","i"),"/");if(c=="rel")a=a.replace(new RegExp("^"+j.replace(/([\/\.\+\[\]\(\)])/g,"\\$1"),"i"),"");if(c!="rel")a.match(/^((https?|file):\/\/|\/)/i)||(a=j+a);if(c=="abs")a.match(/(https?|file):\/\//i)||(a=e+"//"+location.host+a);return a}function Aa(a){var c=Math.floor(Math.log(a)/Math.log(1024));return(a/Math.pow(1024,Math.floor(c))).toFixed(2)+["Byte","KB","MB","GB","TB","PB"][c]}var b=this,N=d(A),Ba=N.closest("form"),J,O,P,ma,u,da,X,ta=false,H=false,ea=false,Ca,fa=false,Da="",L=null,ua,ga=
false,va=false,Y=null,T=null,Q=0;this.settings=d.extend({},{skin:"default",tools:"full",clickCancelDialog:true,linkTag:false,internalScript:false,inlineScript:false,internalStyle:true,inlineStyle:true,showBlocktag:false,forcePtag:true,upLinkExt:"zip,rar,txt",upImgExt:"jpg,jpeg,gif,png",upFlashExt:"swf",upMediaExt:"wmv,avi,wma,mp3,mid",modalWidth:350,modalHeight:220,modalTitle:true,defLinkText:"\u70b9\u51fb\u6253\u5f00\u94fe\u63a5",layerShadow:3,emotMark:false,upBtnText:"\u4e0a\u4f20",wordDeepClean:true,
hoverExecDelay:100,upMultiple:true},B);B=b.settings.plugins;var na=[];if(B){ca=d.extend({},ca,B);d.each(B,function(a){na.push(a)});na=na.join(",")}if(b.settings.tools.match(/^\s*(m?full|simple|mini)\s*$/i)){var Ea=sa[d.trim(b.settings.tools)];b.settings.tools=b.settings.tools.match(/m?full/i)&&B?Ea.replace("Table","Table,"+na):Ea}b.settings.tools.match(/(^|,)\s*About\s*(,|$)/i)||(b.settings.tools+=",About");b.settings.tools=b.settings.tools.split(",");S=ja(S,"abs");var Fa="xheCSS_"+b.settings.skin,
ha="xhe"+V+"_container",Ga="xhe"+V+"_Tool",Ha="xhe"+V+"_iframearea",Ia="xhe"+V+"_iframe",wa="xhe"+V+"_fixffcursor",Z="",xa=S+"xheditor_skin/"+b.settings.skin+"/",oa=Va,Ja=ja(S,"rel")+"xheditor_emot/",ya="";oa=d.extend({},oa,b.settings.emots);if(fa=b.settings.showBlocktag)Z+=" showBlocktag";var pa=[];this.init=function(){d("#"+Fa).length==0&&d("head").append('<link id="'+Fa+'" rel="stylesheet" type="text/css" href="'+xa+'ui.css" />');var a=b.settings.width||A.style.width||N.outerWidth();Q=b.settings.height||
A.style.height||N.outerHeight();if(C(Q,"string"))Q=Q.replace(/[^\d]+/g,"");if(a<=0||Q<=0){alert("\u5f53\u524dtextarea\u5904\u4e8e\u9690\u85cf\u72b6\u6001\uff0c\u8bf7\u5c06\u4e4b\u663e\u793a\u540e\u518d\u521d\u59cb\u5316xhEditor\uff0c\u6216\u8005\u76f4\u63a5\u8bbe\u7f6etextarea\u7684width\u548cheight\u6837\u5f0f");return false}if(/^[0-9\.]+$/i.test(""+a))a+="px";var c='<span class="xheGStart"/>',e,h,o=/Separator|BtnBr/i;d.each(b.settings.tools,function(g,f){e=ca[f];if(f.match(o))c+='<span class="xheGEnd"/>';
if(f=="Separator")c+='<span class="xheSeparator"/>';else if(f=="BtnBr")c+="<br />";else{h=e.c?e.c:"xheIcon xheBtn"+f;c+='<span><a href="javascript:void(0);" title="'+e.t+'" name="'+f+'" class="xheButton xheEnabled" tabindex="-1"><span class="'+h+'"/></a></span>';e.s&&b.addShortcuts(e.s,f)}if(f.match(o))c+='<span class="xheGStart"/>'});c+='<span class="xheGEnd"/><br />';N.after(d('<input type="text" id="'+wa+'" style="position:absolute;display:none;" /><span id="'+ha+'" class="xhe_'+b.settings.skin+
'" style="display:none"><table cellspacing="0" cellpadding="0" class="xheLayout" style="width:'+a+";height:"+Q+'px;"><tbody><tr><td id="'+Ga+'" class="xheTool" style="height:1px;"></td></tr><tr><td id="'+Ha+'" class="xheIframeArea"><iframe frameborder="0" id="'+Ia+'" src="" style="width:100%;"></iframe></td></tr></tbody></table></span>'));J=d("#"+Ga);O=d("#"+Ha);a='<html><head><base /><meta content="text/html; charset=UTF-8" http-equiv="Content-Type"/><link rel="stylesheet" href="'+xa+'iframe.css"/>';
var j=b.settings.loadCSS;if(j)if(C(j,"array"))for(var p in j)a+='<link rel="stylesheet" href="'+j[p]+'"/>';else a+=j.match(/\s*<style(\s+[^>]*?)?>[\s\S]+?<\/style>\s*/i)?j:'<link rel="stylesheet" href="'+j+'"/>';a+='</head><body spellcheck="false" dir="ltr" class="editMode'+Z+'"></body></html>';b.win=P=d("#"+Ia)[0].contentWindow;ma=d(P);try{this.doc=u=P.document;da=d(u);u.open();u.write(a);u.close();if(D)u.body.contentEditable="true";else u.designMode="On"}catch(k){}setTimeout(b.setOpts,300);b.setSource();
P.setInterval=null;J.append(c).bind("mousedown contextmenu",function(){return false});J.find(".xheButton").click(function(g){var f=d(this);if(f.is(".xheEnabled")){L=g;b.exec(f.attr("name"))}return false}).hover(function(g){var f=d(this),l=b.settings.hoverExecDelay,m=T;T=null;if(l==-1||ga||!f.is(".xheEnabled"))return false;if(m&&m>10){ga=true;setTimeout(function(){ga=false},100);return false}var n=f.attr("name");if(ca[n].h!=1){b.hidePanel();return false}if(va)l=0;if(l>=0)ua=setTimeout(function(){L=
g;Y={x:L.clientX,y:L.clientY};b.exec(n)},l)},function(){Y=null;ua&&clearTimeout(ua)}).mousemove(function(g){if(Y){var f={x:g.clientX-Y.x,y:g.clientY-Y.y};if(Math.abs(f.x)>1||Math.abs(f.y)>1){if(f.x>0&&f.y>0){f=Math.round(Math.atan(f.y/f.x)/0.017453293);T=T?(T+f)/2:f}else T=null;Y={x:g.clientX,y:g.clientY}}}});K=d("#xhePanel");$=d("#xheShadow");aa=d("#xheCntLine");ra=d("#xheTempIframe");if(K.length==0){K=d('<div id="xhePanel"></div>').mousedown(function(g){g.stopPropagation()});$=d('<div id="xheShadow"></div>');
aa=d('<div id="xheCntLine"></div>');d(document.body).append(K).append($).append(aa);if(D)d(document.body).append(ra=d('<iframe id="xheTempIframe" style="display:none;" />'))}d(document).mousedown(b.clickCancelPanel);da.mousedown(b.clickCancelPanel);d("#"+ha).show();O.css("height",Q-J.outerHeight());N.hide();N.focus(b.focus);Ba.submit(b.saveResult).bind("reset",b.loadReset);p=d(window);p.unload(b.saveResult).bind("beforeunload",b.saveResult);p.resize(b.fixFullHeight);ma.focus(function(){b.settings.focus&&
b.settings.focus()}).blur(function(){b.settings.blur&&b.settings.blur()});W&&ma.click(b.fixAppleSel);da.keydown(b.checkShortcuts).keypress(b.forcePtag).bind("mousedown click",function(g){N.trigger(g.type)});if(D){function q(g){g=d(g.target);var f;if(f=g.css("width"))g.css("width","").attr("width",f.replace(/[^0-9%]+/g,""));if(f=g.css("height"))g.css("height","").attr("height",f.replace(/[^0-9%]+/g,""))}da.bind("controlselect",function(g){g=g.target;d.nodeName(g,"IMG")&&d(g).unbind("resizeend",q).bind("resizeend",
q)})}d("body",da).bind("paste",b.cleanWordPaste);(p=b.settings.shortcuts)&&d.each(p,function(g,f){b.addShortcuts(g,f)});V++;ta=true;if(b.settings.fullscreen)b.toggleFullscreen();else b.settings.sourceMode&&setTimeout(b.toggleSource,20);return true};this.remove=function(){b.hidePanel();b.saveResult();N.unbind("focus",b.focus);Ba.unbind("submit",b.saveResult).unbind("reset",b.loadReset);var a=d(window);a.unbind("unload",b.saveResult).unbind("beforeunload",b.saveResult);a.unbind("resize",b.fixFullHeight);
d("#"+ha).remove();N.show();ta=false};this.loadReset=function(){setTimeout(b.setSource,10)};this.saveResult=function(){b.getSource()};this.cleanWordPaste=function(){if(D&&!H){var a;a=ra[0].contentWindow.document.body;a.innerHTML="";a.createTextRange().execCommand("Paste");a=a.innerHTML;if(!a.match(/mso-|MsoNormal/i))return true;if(a.indexOf("&nbsp;")==0)a=a.substring(6);a=b.cleanHTML(a);a=b.formatXHTML(a);a=b.cleanWord(a);b.pasteHTML(a);return false}};this.setCSS=function(a){try{b._exec("styleWithCSS",
a,true)}catch(c){try{b._exec("useCSS",!a,true)}catch(e){}}};this.setOpts=function(){if(ta&&!H){b.setCSS(false);try{b._exec("enableObjectResizing",true,true)}catch(a){}if(D)try{b._exec("BackgroundImageCache",true,true)}catch(c){}}};this.forcePtag=function(a){if(H||a.which!=13||a.shiftKey||a.ctrlKey||a.altKey)return true;a=b.getParent("p,h1,h2,h3,h4,h5,h6,pre,address,div,li");if(a.is("li"))return true;if(b.settings.forcePtag)a.length==0&&b._exec("formatblock","<p>");else{b.pasteHTML("<br />");return false}};
this.fixFullHeight=function(){if(!ka&&!W){ea&&O.height("100%").css("height",O.outerHeight()-J.outerHeight());D&&J.hide().show()}};this.fixAppleSel=function(a){a=a.target;if(a.tagName.match(/(img|embed)/i)){var c=b.getSel(),e=b.getRng();e.selectNode(a);c.removeAllRanges();c.addRange(e)}};this.saveBookmark=function(){H||(X=b.getRng())};this.loadBookmark=function(){if(!(H||!X)){b.focus();if(D)X.select();else{var a=b.getSel();a.removeAllRanges();a.addRange(X)}X=null}};this.focus=function(){H?d("#sourceCode",
u).focus():ma.focus();return false};this.setCursorFirst=function(a){b.focus();P.scrollTo(0,0);var c=b.getRng(),e=u.body,h=e,o;if(a&&h.firstChild&&(o=h.firstChild.tagName)&&o.match(/^p|div|h[1-6]$/i))h=e.firstChild;D?c.moveToElementText(h):c.setStart(h,0);c.collapse(true);if(D)c.select();else{a=b.getSel();a.removeAllRanges();a.addRange(c)}};this.getSel=function(){return P.getSelection?P.getSelection():u.selection};this.getRng=function(){var a=b.getSel(),c;try{c=a.rangeCount>0?a.getRangeAt(0):a.createRange?
a.createRange():u.createRange()}catch(e){}c||(c=D?u.body.createTextRange():u.createRange());return c};this.getParent=function(a){var c=b.getRng(),e;if(D)e=c.item?c.item(0):c.parentElement();else{e=c.commonAncestorContainer;if(!c.collapsed)if(c.startContainer==c.endContainer&&c.startOffset-c.endOffset<2&&c.startContainer.hasChildNodes())e=c.startContainer.childNodes[c.startOffset]}a=a?a:"*";e=d(e);e.is(a)||(e=d(e).closest(a));return e};this.getSelect=function(a){var c=b.getSel(),e=b.getRng(),h=true;
h=!e||e.item?false:!c||e.boundingWidth==0||e.collapsed;if(a=="text")return h?"":e.text||(c.toString?c.toString():"");if(e.cloneContents){a=d("<div></div>");(e=e.cloneContents())&&a.append(e);e=a.html()}else e=C(e.item)?e.item(0).outerHTML:C(e.htmlText)?e.htmlText:e.toString();if(h)e="";e=b.processHTML(e,"read");e=b.cleanHTML(e);return e=b.formatXHTML(e)};this.pasteHTML=function(a,c){if(H)return false;b.focus();a=b.processHTML(a,"write");var e=b.getSel(),h=b.getRng();if(c!=undefined){if(h.item){var o=
h.item(0);h=u.body.createTextRange();h.moveToElementText(o);h.select()}h.collapse(c)}if(h.insertNode){h.deleteContents();a=h.createContextualFragment(a);c=a.lastChild;h.insertNode(a);h.setEndAfter(c);h.collapse(false);e.removeAllRanges();e.addRange(h)}else{if(e.type.toLowerCase()=="control"){e.clear();h=b.getRng()}h.pasteHTML(a)}};this.pasteText=function(a,c){a||(a="");a=b.domEncode(a);a=a.replace(/\r?\n/g,"<br />");b.pasteHTML(a,c)};this.appendHTML=function(a){if(H)return false;b.focus();a=b.processHTML(a,
"write");d(u.body).append(a)};this.domEncode=function(a){return a.replace(/[<>]/g,function(c){return{"<":"&lt;",">":"&gt;"}[c]})};this.setSource=function(a){X=null;if(typeof a!="string"&&a!="")a=A.value;if(H)d("#sourceCode",u).val(a);else{if(b.settings.beforeSetSource)a=b.settings.beforeSetSource(a);a=b.cleanHTML(a);a=b.formatXHTML(a);a=b.cleanWord(a);u.body.innerHTML=b.processHTML(a,"write")}};this.processHTML=function(a,c){if(c=="write"){function e(g,f,l,m){m=m.split(",");if(!m[1]){m[1]=m[0];m[0]=
""}if(m[0]=="default")m[0]="";return g.replace(/\s+src\s*=\s*(["']?).*?\1(\s|$|\/|>)/i,"$2").replace(f,' src="'+Ja+(m[0]?m[0]:"default")+"/"+m[1]+'.gif"'+(b.settings.emotMark?' emot="'+(m[0]?m[0]+",":"")+m[1]+'" alt="'+m[1]+'"':""))}a=a.replace(/<img(?:\s+[^>]*?)?(\s+emot\s*=\s*(["']?)\s*(.*?)\s*\2)(?:\s+[^>]*?)?\/?>/ig,e);function h(g,f,l,m,n,i){return g.replace(l,l+" _xhe_"+m+'="'+i+'"')}a=a.replace(/<(\w+(?:\:\w+)?)(?:\s+[^>]*?)?(\s+(src|href)\s*=\s*(["']?)\s*(.*?)\s*\4)(?:\s+[^>]*?)?\/?>/ig,h);
a=a.replace(/<(\/?)del(\s+[^>]*?)?>/ig,"<$1strike$2>");if(ka){a=a.replace(/<(\/?)strong(\s+[^>]*?)?>/ig,"<$1b$2>");a=a.replace(/<(\/?)em(\s+[^>]*?)?>/ig,"<$1i$2>")}else if(W){a=a.replace(/("|;)\s*font-size\s*:\s*([a-z-]+)(;?)/ig,function(g,f,l,m){for(var n,i=0;i<M.length;i++){g=M[i];if(l==g.n){n=g.wkn;break}}return f+"font-size:"+n+m});a=a.replace(/<strong(\s+[^>]*?)?>/ig,'<span class="Apple-style-span" style="font-weight: bold;"$1>');a=a.replace(/<em(\s+[^>]*?)?>/ig,'<span class="Apple-style-span" style="font-style: italic;"$1>');
a=a.replace(/<u(\s+[^>]*?)?>/ig,'<span class="Apple-style-span" style="text-decoration: underline;"$1>');a=a.replace(/<strike(\s+[^>]*?)?>/ig,'<span class="Apple-style-span" style="text-decoration: line-through;"$1>');a=a.replace(/<\/(strong|em|u|strike)>/ig,"</span>");a=a.replace(/<span((?:\s+[^>]*?)?\s+style="([^"]*;)*\s*(font-family|font-size|color|background-color)\s*:\s*[^;"]+\s*;?"[^>]*)>/ig,'<span class="Apple-style-span"$1>')}else if(D){a=a.replace(/&apos;/ig,"&#39;");a=a.replace(/\s+(disabled|checked|readonly|selected)\s*=\s*[\"\']?(false|0)[\"\']?/ig,
"")}a=a.replace(/<a(\s+[^>]*?)?\/>/,"<a$1></a>");if(!W){function o(g,f,l,m){f="";var n,i;if(n=l.match(/font-family\s*:\s*([^;"]+)/i))f+=' face="'+n[1]+'"';if(n=l.match(/font-size\s*:\s*([^;"]+)/i)){n=n[1].toLowerCase();for(var r=0;r<M.length;r++)if(n==M[r].n||n==M[r].s){i=r+1;break}if(i){f+=' size="'+i+'"';l=l.replace(/(^|;)(\s*font-size\s*:\s*[^;"]+;?)+/ig,"$1")}}if(i=l.match(/(?:^|[\s;])color\s*:\s*([^;"]+)/i)){if(n=i[1].match(/\s*rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i)){i[1]="#";for(r=
1;r<=3;r++)i[1]+=(n[r]-0).toString(16)}i[1]=i[1].replace(/^#([0-9a-f])([0-9a-f])([0-9a-f])$/i,"#$1$1$2$2$3$3");f+=' color="'+i[1]+'"'}l=l.replace(/(^|;)(\s*(font-family|color)\s*:\s*[^;"]+;?)+/ig,"$1");if(f!=""){if(l)f+=' style="'+l+'"';return"<font"+f+">"+m+"</font>"}else return g}a=a.replace(/<(span)(?:\s+[^>]*?)?\s+style\s*=\s*"((?:[^"]*?;)*\s*(?:font-family|font-size|color)\s*:[^"]*)"(?: [^>]+)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,o);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,
o);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,o)}}else{var j=b.settings.localUrl;function p(g,f,l,m){if(j)m=ja(m,j);return g.replace(new RegExp("\\s+"+f+"\\s*=\\s*([\"']?).*?\\1(\\s|/?>)","ig")," "+f+'="'+m.replace(/\$/g,"$$$$")+'"$2')}a=a.replace(/<(?:\w+(?:\:\w+)?)(?:\s+[^>]*?)?\s+_xhe_(src|href)\s*=\s*(["']?)\s*(.*?)\s*\2(?:\s+[^>]*?)?\/?>/ig,
p);if(W){a=a.replace(/("|;)\s*font-size\s*:\s*([a-z-]+)(;?)/ig,function(g,f,l,m){for(var n,i=0;i<M.length;i++){g=M[i];if(l==g.wkn){n=g.n;break}}return f+"font-size:"+n+m});var k=[{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"}];function q(g,f,l,m,n){f=l+m;l="";for(m=0;m<k.length;m++)if(f.match(k[m].r)){l=k[m].t;break}return l?"<"+l+">"+n+"</"+l+">":g}a=a.replace(/<(span)(\s+[^>]*?)?\s+class\s*=\s*"Apple-style-span"(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,
q);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,q);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,q)}a=a.replace(/(<\w+(?:\s+[^>]*?)?)\s+(?:_xhe_|_moz_|_webkit_)[^=]+?\s*=\s*(["']?).*?\2(\s|\/?>)/ig,
"$1$3");a=a.replace(/(<\w+[^>]*?)\s+class\s*=\s*(["']?)\s*(?:apple|webkit)\-.+?\s*\2(\s|\/?>)/ig,"$1$3");a=a.replace(/<img(\s+[^>]+?)\/?>/ig,function(g,f){f.match(/\s+alt\s*(["']?).*?\1(\s|$)/i)||(f+=' alt=""');return"<img"+f+" />"})}return a};this.getSource=function(a){var c,e=b.settings.beforeGetSource;if(H){c=d("#sourceCode",u).val();e||(c=c.replace(/(\t*\r?\n\t*)+/g,""))}else{c=b.processHTML(u.body.innerHTML,"read");c=c.replace(/^\s*(?:<(p|div)(?:\s+[^>]*?)?>)?\s*(<br(?:\s+[^>]*?)?>)*\s*(?:<\/\1>)?\s*$/i,
"");c=b.cleanHTML(c);c=b.formatXHTML(c,a);c=b.cleanWord(c);if(e)c=e(c)}return A.value=c};this.cleanWord=function(a){if(a.match(/mso-|MsoNormal/i)){var c=b.settings.wordDeepClean;a=a.replace(/(<link(?:\s+[^>]*?)?)\s+href\s*=\s*(["']?)\s*file:\/\/.+?\s*\2((?:\s+[^>]*?)?\s*\/?>)/ig,"");a=a.replace(/<!--[\s\S]*?--\>|<!(--)?\[[\s\S]+?\](--)?>|<style(\s+[^>]*?)?>[\s\S]*?<\/style>/ig,"");a=a.replace(/<\/?\w+:[^>]*>/ig,"");if(c)a=a.replace(/<\/?(span|a|img)(\s+[^>]*?)?>/ig,"");a=a.replace(/(<\w+(?:\s+[^>]*?)?)\s+class\s*=\s*(["']?)\s*mso.+?\s*\2((?:\s+[^>]*?)?\s*\/?>)/ig,
"$1$3");a=a.replace(/(<\w+(?:\s+[^>]*?)?)\s+lang\s*=\s*(["']?)\s*.+?\s*\2((?:\s+[^>]*?)?\s*\/?>)/ig,"$1$3");a=a.replace(/(<\w+(?:\s+[^>]*?)?)\s+align\s*=\s*(["']?)\s*left\s*\2((?:\s+[^>]*?)?\s*\/?>)/ig,"$1$3");a=a.replace(/<\w+(?:\s+[^>]*?)?(\s+style\s*=\s*(["']?)\s*(.*?)\s*\2)(?:\s+[^>]*?)?\s*\/?>/ig,function(e,h,o,j){j=d.trim(j.replace(/\s*(mso-[^:]+:.+?|margin\s*:\s*0cm 0cm 0pt\s*|(text-align|font-variant|line-height)\s*:\s*.+?)(;|$)\s*/ig,""));return e.replace(h,c?"":j?' style="'+j+'"':"")})}return a};
this.cleanHTML=function(a){a=a.replace(/<!?\/?(DOCTYPE|html|body)(\s+[^>]*?)?>/ig,"");var c;a=a.replace(/<head(?:\s+[^>]*?)?>([\s\S]*?)<\/head>/i,function(e,h){c=h.match(/<(script|style)(\s+[^>]*?)?>[\s\S]*?<\/\1>/ig);return""});if(c)a=c.join("")+a;a=a.replace(/<\??xml(:\w+)?(\s+[^>]*?)?>([\s\S]*?<\/xml>)?/ig,"");b.settings.linkTag||(a=a.replace(/<link(\s+[^>]*?)?>/ig,""));b.settings.internalScript||(a=a.replace(/<script(\s+[^>]*?)?>[\s\S]*?<\/script>/ig,""));b.settings.inlineScript||(a=a.replace(/(<\w+)(\s+[^>]*?)?\s+on(?:click|dblclick|mousedown|mouseup|mousemove|mouseover|mouseout|mouseenter|mouseleave|keydown|keypress|keyup|change|select|submit|reset|blur|focus|load|unload)\s*=\s*(["']?).*?\3((?:\s+[^>]*?)?\/?>)/ig,
"$1$2$4"));b.settings.internalStyle||(a=a.replace(/<style(\s+[^>]*?)?>[\s\S]*?<\/style>/ig,""));b.settings.inlineStyle||(a=a.replace(/(<\w+)(\s+[^>]*?)?\s+(style|class)\s*=\s*(["']?).*?\3((?:\s+[^>]*?)?\/?>)/ig,"$1$2$4"));return a=a.replace(/<\/(strong|b|u|strike|em|i)>((?:\s|<br\/?>|&nbsp;)*?)<\1(\s+[^>]*?)?>/ig,"$2")};this.formatXHTML=function(a,c){function e(s){var v={};s=s.split(",");for(var F=0;F<s.length;F++)v[s[F]]=true;return v}function h(s){if(s){s=s.toLowerCase();var v=r[s];if(v)s=v}else s=
"";return s}function o(s,v,F){s=h(s);if(f[s])for(;y.last()&&l[y.last()];)j(y.last());m[s]&&y.last()==s&&j(s);(F=g[s]||!!F)||y.push(s);var I=Array();I.push("<"+s);v.replace(x,function(Ka,ia,La,Ma,Na){ia=ia.toLowerCase();I.push(" "+ia+'="'+(La?La:Ma?Ma:Na?Na:n[ia]?ia:"")+'"')});I.push((F?" /":"")+">");p(I.join(""),s,true)}function j(s){if(s){s=h(s);for(v=y.length-1;v>=0;v--)if(y[v]==s)break}else var v=0;if(v>=0){for(s=y.length-1;s>=v;s--)p("</"+y[s]+">",y[s]);y.length=v}}function p(s,v,F){if(c==true){s=
s.replace(/(\t*\r?\n\t*)+/g,"");if(!s.match(/^\s*$/)){var I=f[v],Ka=I?v:"";if(I){F&&E++;U==""&&E--}else U&&E++;if(Ka!=U||I)k();G.push(s);v=="br"&&k();if(I&&(g[v]||!F))E--;U=I?v:"";za=F}}else G.push(s)}function k(){G.push("\r\n");if(E>0)for(var s=E;s--;)G.push("\t")}function q(s,v,F,I){s="";if(v=F.match(/ face\s*=\s*"\s*([^"]+)\s*"/i))s+="font-family:"+v[1]+";";if(v=F.match(/ size\s*=\s*"\s*(\d+)\s*"/i))s+="font-size:"+M[(v[1]>7?7:v[1]<1?1:v[1])-1].n+";";if(v=F.match(/ color\s*=\s*"\s*([^"]+)\s*"/i))s+=
"color:"+v[1]+";";if(F=F.match(/ style\s*=\s*"\s*([^"]+)\s*"/i))s+=F[1];if(s)I='<span style="'+s+'">'+I+"</span>";return I}var g=e("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed"),f=e("address,applet,blockquote,button,center,dd,dir,div,dl,dt,fieldset,form,frameset,hr,iframe,ins,isindex,li,map,menu,noframes,noscript,object,ol,p,pre,script,table,tbody,td,tfoot,th,thead,tr,ul"),l=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"),
m=e("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr"),n=e("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected"),i=e("script,style"),r={b:"strong",i:"em",s:"del",strike:"del"},t=/^<\??(\w+(?:\:\w+)?)((?:\s+[\w-\:]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/,z=/^<\/(\w+(?:\:\w+)?)[^>]*>/,x=/([\w-(?:\:\w+)?]+)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g,w=0,y=[];a=a;var G=Array(),E=-1,U="body",za;for(y.last=
function(){return this[this.length-1]};a.length>0;)if(!y.last()||!i[y.last()]){w=0;if(a.substring(0,4)=="<!--"){w=a.indexOf("--\>");if(w!=-1){w+=3;p(a.substring(0,w))}}else if(a.substring(0,2)=="</"){if(match=a.match(z)){j(match[1]);w=match[0].length}}else if(a.charAt(0)=="<")if(match=a.match(t)){o(match[1],match[2],match[3]);w=match[0].length}if(w==0){w=a.indexOf("<");if(w==0)w=1;else if(w<0)w=a.length;p(b.domEncode(a.substring(0,w)))}a=a.substring(w)}else{a=a.replace(/^([\s\S]*?)<\/(style|script)>/i,
function(s,v){p(v);return""});j(y.last())}j();a=G.join("");G=null;a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S])*?)<\/\1>/ig,q);a=a.replace(/<(font)(\s+[^>]*?)?>(((?!<\1(\s+[^>]*?)?>)[\s\S]|<\1(\s+[^>]*?)?>((?!<\1(\s+[^>]*?)?>)[\s\S])*?<\/\1>)*?)<\/\1>/ig,q);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,q);a=a.replace(/^(\s*\r?\n)+|(\s*\r?\n)+$/g,"");
return a=a.replace(/(\t*\r?\n)+/g,"\r\n")};this.toggleShowBlocktag=function(a){if(fa!==a){fa=!fa;a=d(u.body);if(fa){Z+=" showBlocktag";a.addClass("showBlocktag")}else{Z=Z.replace(" showBlocktag","");a.removeClass("showBlocktag")}}};this.toggleSource=function(a){if(H!==a){J.find("[name=Source]").toggleClass("xheEnabled").toggleClass("xheActive");var c=u.body,e=d(c),h,o,j="_xhe_cursor"+(new Date).getTime();a=0;if(H){h=b.getSource();e.find("#sourceCode").remove();e.removeAttr("scroll").attr("class",
"editMode"+Z);if(D)c.contentEditable="true";else u.designMode="On";if(ka){b._exec("inserthtml","-");d("#"+wa).show().focus().hide()}}else{b.pasteHTML(j,true);h=b.getSource(true);a=h.indexOf(j);if(!Oa)a=h.substring(0,a).replace(/\r/g,"").length;h=h.replace(j,"");if(D)c.contentEditable="false";else u.designMode="Off";e.attr("scroll","no").attr("class","sourceMode").html('<textarea id="sourceCode" wrap="soft" spellcheck="false" height="100%" />');o=d("#sourceCode",e).blur(b.getSource)[0]}H=!H;b.setSource(h);
if(H){b.focus();if(o.setSelectionRange)o.setSelectionRange(a,a);else{o=o.createTextRange();o.move("character",a);o.select()}}else b.setCursorFirst(true);J.find("[name=Source]").toggleClass("xheEnabled");J.find(".xheButton").not("[name=Source],[name=Fullscreen],[name=About]").toggleClass("xheEnabled");setTimeout(b.setOpts,300)}};this.toggleFullscreen=function(a){if(ea!==a){a=d("#"+ha).find(".xheLayout");var c=d("#"+ha);if(ea){a.attr("style",Da);O.height(Q-J.outerHeight());setTimeout(function(){d(window).scrollTop(Ca)},
10)}else{Ca=d(window).scrollTop();Da=a.attr("style");a.removeAttr("style");O.height("100%");setTimeout(b.fixFullHeight,100)}if(ka){d("#"+wa).show().focus().hide();setTimeout(b.focus,1)}ea=!ea;c.toggleClass("xhe_Fullscreen");d("html").toggleClass("xhe_Fullfix");J.find("[name=Fullscreen]").toggleClass("xheActive");setTimeout(b.setOpts,300)}};this.showMenu=function(a,c){var e=d('<div class="xheMenu"></div>'),h=[];d.each(a,function(o,j){h.push('<a href="javascript:void(0);" title="'+(j.t?j.t:j.s)+'" v="'+
j.v+'">'+j.s+"</a>")});e.append(h.join(""));e.click(function(o){c(d(o.target).closest("a").attr("v"));b.hidePanel();return false}).mousedown(function(){return false});b.showPanel(e)};this.showColor=function(a){var c=d('<div class="xheColor"></div>'),e=[],h=0;d.each(Qa,function(o,j){if(h%7==0)e.push((h>0?"</div>":"")+"<div>");e.push('<a href="javascript:void(0);" title="'+j+'" style="background:'+j+'"></a>');h++});e.push("</div>");c.append(e.join(""));c.click(function(o){o=o.target;if(d.nodeName(o,
"A")){a(d(o).attr("title"));b.hidePanel();return false}}).mousedown(function(){return false});b.showPanel(c)};this.showPastetext=function(){var a=d('<div>\u4f7f\u7528\u952e\u76d8\u5feb\u6377\u952e(Ctrl+V)\u628a\u5185\u5bb9\u7c98\u8d34\u5230\u65b9\u6846\u91cc\uff0c\u6309 \u786e\u5b9a</div><div><textarea id="xhePastetextValue" wrap="soft" spellcheck="false" style="width:300px;height:100px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>'),c=d("#xhePastetextValue",
a);d("#xheSave",a).click(function(){b.loadBookmark();var e=c.val();e&&b.pasteText(e);b.hidePanel();return false});b.showDialog(a)};this.showLink=function(){var a=d('<div>\u94fe\u63a5\u5730\u5740: <input type="text" id="xheLinkHref" value="http://" class="xheText" /></div><div>\u6253\u5f00\u65b9\u5f0f: <select id="xheLinkTarget"><option selected="selected" value="">\u9ed8\u8ba4</option><option value="_blank">\u65b0\u7a97\u53e3</option><option value="_self">\u5f53\u524d\u7a97\u53e3</option><option value="_parent">\u7236\u7a97\u53e3</option></select></div><div style="display:none">\u94fe\u63a5\u6587\u5b57: <input type="text" id="xheLinkText" value="" class="xheText" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>'),
c=b.getParent("a"),e=d("#xheLinkText",a),h=d("#xheLinkHref",a),o=d("#xheLinkTarget",a),j=d("#xheSave",a),p=b.getSelect();if(c.length==1){h.val(b.attr(c,"href"));o.attr("value",c.attr("target"))}else p==""&&e.val(b.settings.defLinkText).closest("div").show();b.settings.upLinkUrl&&b.uploadInit(h,b.settings.upLinkUrl,b.settings.upLinkExt);j.click(function(){var k=h.val();b.loadBookmark();if(k==""||c.length==0)b._exec("unlink");if(k!=""&&k!="http://"){var q=k.split(" "),g=o.val(),f=e.val();if(q.length>
1){b._exec("unlink");p=b.getSelect();var l='<a href="xhe_tmpurl"',m=[];if(g!="")l+=' target="'+g+'"';l+=">xhe_tmptext</a>";f=p!=""?p:f?f:k;for(var n in q){k=q[n];if(k!=""){k=k.split(",");g=l;g=g.replace("xhe_tmpurl",k[0]);g=g.replace("xhe_tmptext",k[1]?k[1]:f);m.push(g)}}b.pasteHTML(m.join("&nbsp;"))}else{k=q[0].split(",");f||(f=k[0]);f=k[1]?k[1]:p!=""?"":f?f:k[0];if(c.length==0){f?b.pasteHTML('<a href="#xhe_tmpurl">'+f+"</a>"):b._exec("createlink","#xhe_tmpurl");c=d('a[href$="#xhe_tmpurl"]',u)}b.attr(c,
"href",k[0]);g!=""?c.attr("target",g):c.removeAttr("target");f&&!W&&c.text(f)}}b.hidePanel();return false});b.showDialog(a)};this.showImg=function(){var a=d('<div>\u56fe\u7247\u6587\u4ef6: <input type="text" id="xheImgSrc" value="http://" class="xheText" /></div><div>\u66ff\u6362\u6587\u672c: <input type="text" id="xheImgAlt" /></div><div>\u5bf9\u9f50\u65b9\u5f0f: <select id="xheImgAlign"><option selected="selected" value="">\u9ed8\u8ba4</option><option value="left">\u5de6\u5bf9\u9f50</option><option value="right">\u53f3\u5bf9\u9f50</option><option value="top">\u9876\u7aef</option><option value="middle">\u5c45\u4e2d</option><option value="baseline">\u57fa\u7ebf</option><option value="bottom">\u5e95\u8fb9</option></select></div><div>\u5bbd\u5ea6\u9ad8\u5ea6: <input type="text" id="xheImgWidth" style="width:40px;" /> x <input type="text" id="xheImgHeight" style="width:40px;" /></div><div>\u8fb9\u6846\u5927\u5c0f: <input type="text" id="xheImgBorder" style="width:40px;" /></div><div>\u6c34\u5e73\u95f4\u8ddd: <input type="text" id="xheImgHspace" style="width:40px;" /> \u5782\u76f4\u95f4\u8ddd: <input type="text" id="xheImgVspace" style="width:40px;" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>'),
c=b.getParent("img"),e=d("#xheImgSrc",a),h=d("#xheImgAlt",a),o=d("#xheImgAlign",a),j=d("#xheImgWidth",a),p=d("#xheImgHeight",a),k=d("#xheImgBorder",a),q=d("#xheImgVspace",a),g=d("#xheImgHspace",a),f=d("#xheSave",a);if(c.length==1){e.val(b.attr(c,"src"));h.val(c.attr("alt"));o.val(c.attr("align"));j.val(c.attr("width"));p.val(c.attr("height"));k.val(c.attr("border"));var l=c.attr("vspace"),m=c.attr("hspace");q.val(l<=0?"":l);g.val(m<=0?"":m)}b.settings.upImgUrl&&b.uploadInit(e,b.settings.upImgUrl,
b.settings.upImgExt);f.click(function(){b.loadBookmark();var n=e.val();if(n!=""&&n!="http://"){var i=n.split(" "),r=h.val(),t=o.val(),z=j.val(),x=p.val(),w=k.val(),y=q.val(),G=g.val();if(i.length>1){var E='<img src="xhe_tmpurl"',U=[];if(r!="")E+=' alt="'+r+'"';if(t!="")E+=' align="'+t+'"';if(z!="")E+=' width="'+z+'"';if(x!="")E+=' height="'+x+'"';if(w!="")E+=' border="'+w+'"';if(y!="")E+=' vspace="'+y+'"';if(G!="")E+=' hspace="'+G+'"';E+=" />";for(var za in i){n=i[za];if(n!=""){n=n.split(",");r=E;
r=r.replace("xhe_tmpurl",n[0]);if(n[1])r='<a href="'+n[1]+'" target="_blank">'+r+"</a>";U.push(r)}}b.pasteHTML(U.join("&nbsp;"))}else if(i.length==1){n=i[0];if(n!=""){n=n.split(",");if(c.length==0){b.pasteHTML('<img src="'+n[0]+'#xhe_tmpurl" />');c=d('img[src$="#xhe_tmpurl"]',u)}b.attr(c,"src",n[0]);r!=""&&c.attr("alt",r);t!=""?c.attr("align",t):c.removeAttr("align");z!=""?c.attr("width",z):c.removeAttr("width");x!=""?c.attr("height",x):c.removeAttr("height");w!=""?c.attr("border",w):c.removeAttr("border");
y!=""?c.attr("vspace",y):c.removeAttr("vspace");G!=""?c.attr("hspace",G):c.removeAttr("hspace");if(n[1]){i=c.parent("a");if(i.length==0){c.wrap("<a></a>");i=c.parent("a")}b.attr(i,"href",n[1]);i.attr("target","_blank")}}}}else c.length==1&&c.remove();b.hidePanel();return false});b.showDialog(a)};this.showEmbed=function(a,c,e,h,o,j,p){c=d(c);var k=b.getParent('embed[type="'+e+'"],embed[classid="'+h+'"]'),q=d("#xhe"+a+"Src",c),g=d("#xhe"+a+"Width",c),f=d("#xhe"+a+"Height",c);a=d("#xheSave",c);j&&b.uploadInit(q,
j,p);b.showDialog(c);if(k.length==1){q.val(b.attr(k,"src"));g.val(k.attr("width"));f.val(k.attr("height"))}a.click(function(){b.loadBookmark();var l=q.val();if(l!=""&&l!="http://"){var m=g.val(),n=f.val(),i=/^[0-9]+$/;i.test(m)||(m=412);i.test(n)||(n=300);var r='<embed type="'+e+'" classid="'+h+'" src="xhe_tmpurl"'+o;i=l.split(" ");if(i.length>1){r=r+"";var t,z=[];r+=' width="xhe_width" height="xhe_height" />';for(var x in i){l=i[x].split(",");t=r;t=t.replace("xhe_tmpurl",l[0]);t=t.replace("xhe_width",
l[1]?l[1]:m);t=t.replace("xhe_height",l[2]?l[2]:n);l!=""&&z.push(t)}b.pasteHTML(z.join("&nbsp;"))}else if(i.length==1){l=i[0].split(",");if(k.length==0){b.pasteHTML(r.replace("xhe_tmpurl",l[0]+"#xhe_tmpurl")+" />");k=d('embed[src$="#xhe_tmpurl"]',u)}b.attr(k,"src",l[0]);k.attr("width",l[1]?l[1]:m);k.attr("height",l[2]?l[2]:n)}}else k.length==1&&k.remove();b.hidePanel();return false})};this.showEmot=function(a){var c=d('<div class="xheEmot"></div>');a=a?a:ya?ya:"default";var e=oa[a],h=Ja+a+"/",o=0,
j=[],p="";p=e.width;var k=e.height,q=e.line,g=e.count;e=e.list;if(g)for(e=1;e<=g;e++){o++;j.push('<a href="javascript:void(0);" style="background-image:url('+h+e+'.gif);" emot="'+a+","+e+'" title='+e+">&nbsp;</a>");o%q==0&&j.push("<br />")}else d.each(e,function(n,i){o++;j.push('<a href="javascript:void(0);" style="background-image:url('+h+n+'.gif);" emot="'+a+","+n+'" title="'+i+'">&nbsp;</a>');o%q==0&&j.push("<br />")});g=q*(p+12);e=Math.ceil(o/q)*(k+12);var f=g*0.75;if(e<=f)f="";p=d("<style>"+
(f?".xheEmot div{width:"+(g+20)+"px;height:"+f+"px;}":"")+".xheEmot div a{width:"+p+"px;height:"+k+"px;}</style><div>"+j.join("")+"</div>").click(function(n){n=n.target;var i=d(n);if(d.nodeName(n,"A")){b.pasteHTML('<img emot="'+i.attr("emot")+'" alt="'+i.attr("title")+'">');b.hidePanel();return false}}).mousedown(function(){return false});c.append(p);var l=0,m=["<ul>"];d.each(oa,function(n,i){l++;m.push("<li"+(a==n?' class="cur"':"")+'><a href="javascript:void(0);" group="'+n+'">'+i.name+"</a></li>")});
if(l>1){m.push('</ul><br style="clear:both;" />');p=d(m.join("")).click(function(n){ya=d(n.target).attr("group");b.exec("Emot");return false}).mousedown(function(){return false});c.append(p)}b.showPanel(c)};this.showTable=function(){var a=d('<div>\u884c\u6570\u5217\u6570: <input type="text" id="xheTableRows" style="width:40px;" value="3" /> x <input type="text" id="xheTableColumns" style="width:40px;" value="2" /></div><div>\u6807\u9898\u5355\u5143: <select id="xheTableHeaders"><option selected="selected" value="">\u65e0</option><option value="row">\u7b2c\u4e00\u884c</option><option value="col">\u7b2c\u4e00\u5217</option><option value="both">\u7b2c\u4e00\u884c\u548c\u7b2c\u4e00\u5217</option></select></div><div>\u5bbd\u5ea6\u9ad8\u5ea6: <input type="text" id="xheTableWidth" style="width:40px;" value="200" /> x <input type="text" id="xheTableHeight" style="width:40px;" value="" /></div><div>\u8fb9\u6846\u5927\u5c0f: <input type="text" id="xheTableBorder" style="width:40px;" value="1" /></div><div>\u8868\u683c\u95f4\u8ddd: <input type="text" id="xheTableCellSpacing" style="width:40px;" value="1" /> \u8868\u683c\u586b\u5145: <input type="text" id="xheTableCellPadding" style="width:40px;" value="1" /></div><div>\u5bf9\u9f50\u65b9\u5f0f: <select id="xheTableAlign"><option selected="selected" value="">\u9ed8\u8ba4</option><option value="left">\u5de6\u5bf9\u9f50</option><option value="center">\u5c45\u4e2d</option><option value="right">\u53f3\u5bf9\u9f50</option></select></div><div>\u8868\u683c\u6807\u9898: <input type="text" id="xheTableCaption" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>'),
c=d("#xheTableRows",a),e=d("#xheTableColumns",a),h=d("#xheTableHeaders",a),o=d("#xheTableWidth",a),j=d("#xheTableHeight",a),p=d("#xheTableBorder",a),k=d("#xheTableCellSpacing",a),q=d("#xheTableCellPadding",a),g=d("#xheTableAlign",a),f=d("#xheTableCaption",a);d("#xheSave",a).click(function(){b.loadBookmark();var l=f.val(),m=p.val(),n=c.val(),i=e.val(),r=h.val(),t=o.val(),z=j.val(),x=k.val(),w=q.val(),y=g.val();m="<table"+(m!=""?' border="'+m+'"':"")+(t!=""?' width="'+t+'"':"")+(z!=""?' width="'+z+
'"':"")+(x!=""?' cellspacing="'+x+'"':"")+(w!=""?' cellpadding="'+w+'"':"")+(y!=""?' align="'+y+'"':"")+">";if(l!="")m+="<caption>"+l+"</caption>";if(r=="row"||r=="both"){m+="<tr>";for(l=0;l<i;l++)m+='<th scope="col">&nbsp;</th>';m+="</tr>";n--}m+="<tbody>";for(l=0;l<n;l++){m+="<tr>";for(t=0;t<i;t++)m+=t==0&&(r=="col"||r=="both")?'<th scope="row">&nbsp;</th>':"<td>&nbsp;</td>";m+="</tr>"}m+="</tbody></table>";b.pasteHTML(m);b.hidePanel();return false});b.showDialog(a)};this.showAbout=function(){var a=
d('<div style="font:12px Arial;width:245px;word-wrap:break-word;word-break:break-all;"><p><span style="font-size:20px;color:#1997DF;">xhEditor</span><br />v1.0.0 RC3 (build 100506)</p><p>xhEditor\u662f\u57fa\u4e8ejQuery\u5f00\u53d1\u7684\u8de8\u5e73\u53f0\u8f7b\u91cfXHTML\u7f16\u8f91\u5668\uff0c\u57fa\u4e8e<a href="http://www.gnu.org/licenses/lgpl.html" target="_blank">LGPL</a>\u5f00\u6e90\u534f\u8bae\u53d1\u5e03\u3002</p><p>Copyright \u00a9 <a href="http://xheditor.com/" target="_blank">xhEditor.com</a>. All rights reserved.</p></div>');
b.showDialog(a)};this.attr=function(a,c,e){if(!c)return false;var h="_xhe_"+c;e&&a.attr(c,e).removeAttr(h).attr(h,e);return a.attr(h)||a.attr(c)};this.addShortcuts=function(a,c){a=a.toLowerCase();if(pa[a]==undefined)pa[a]=Array();pa[a].push(c)};this.checkShortcuts=function(a){if(H)return true;var c=a.which,e=Pa[c];c=e?e:String.fromCharCode(c).toLowerCase();sKey="";sKey+=a.ctrlKey?"ctrl+":"";sKey+=a.altKey?"alt+":"";sKey+=a.shiftKey?"shift+":"";sKey+=c;a=pa[sKey];var h;for(h in a){h=a[h];if(d.isFunction(h)){if(h.call(b)===
false)return false}else{b.exec(h);return false}}};this.uploadInit=function(a,c,e){function h(){a.closest(".xheDialog").bind("dragenter dragover",function(){return false}).bind("drop",function(i){i=i.originalEvent.dataTransfer;var r;if(i&&(r=i.files)&&r.length>0)o(r);return false})}function o(i){n=[];var r,t,z=d('<div style="margin:22px 0;text-align:center;line-height:30px;">\u6587\u4ef6\u4e0a\u4f20\u4e2d\uff0c\u8bf7\u7a0d\u5019\u2026\u2026<br /></div>'),x='<img src="'+xa+'img/loading.gif">';if(i.nodeType&&
!((t=i.files)&&t[0])){if(!j(i.value))return;z.append(x);r=new b.html4Upload(i,c,p)}else{t||(t=i);var w=t.length;if(!l&&w>1){alert("\u8bf7\u4e0d\u8981\u4e00\u6b21\u4e0a\u4f20\u591a\u4e2a\u6587\u4ef6");return}for(i=0;i<w;i++)if(!j(t[i].fileName))return;var y=d('<div class="xheProgress"><div><span>0%</span></div></div>');z.append(y);r=new b.html5Upload(q,t,c,p,function(G){if(G.loaded>=0){var E=Math.round(G.loaded*100/G.total)+"%";d("div",y).css("width",E);d("span",y).text(E+" ( "+Aa(G.loaded)+" / "+
Aa(G.total)+" )")}else y.replaceWith(x)})}R=false;b.showModal("\u6587\u4ef6\u4e0a\u4f20\u4e2d(Esc\u53d6\u6d88\u4e0a\u4f20)",z,320,150,function(){R=true;r.remove()});r.start()}function j(i){if(e=="*"||i.match(new RegExp(".("+e.replace(/,/g,"|")+")$","i")))return true;else{alert("\u4e0a\u4f20\u6587\u4ef6\u6269\u5c55\u540d\u5fc5\u9700\u4e3a: "+e);return false}}function p(i,r){var t=Object,z=false,x=b.settings.onUpload;try{t=eval("("+i+")")}catch(w){}if(t.err==undefined||t.msg==undefined)alert(c+" \u4e0a\u4f20\u63a5\u53e3\u53d1\u751f\u9519\u8bef\uff01\r\n\r\n\u8fd4\u56de\u7684\u9519\u8bef\u5185\u5bb9\u4e3a: \r\n\r\n"+
i);else if(t.err)alert(t.err);else{n.push(t.msg);z=true}if(!z||r)b.removeModal();if(r&&z){k(n);x&&x(n)}return z}function k(i){if(C(i,"string"))i=[i];var r=false,t,z=i.length,x,w=[];for(t=0;t<z;t++){x=i[t];x=C(x,"string")?x:x.url;if(x.substr(0,1)=="!"){r=true;x=x.substr(1)}w.push(x)}a.val(w.join(" "));r&&a.closest(".xheDialog").find("#xheSave").click()}var q="filedata",g=d('<span class="xheUpload"><input type="text" style="visibility:hidden;" tabindex="-1" /><input type="button" value="'+b.settings.upBtnText+
'" class="xheBtn" tabindex="-1" /></span>'),f=d(".xheBtn",g),l=b.settings.upMultiple;a.after(g);f.before(a);c=c.replace(/{editorRoot}/ig,S);if(c.substr(0,1)=="!")f.click(function(){R=false;b.showIframeModal("\u4e0a\u4f20\u6587\u4ef6",c.substr(1),k,null,null,function(){R=true})});else{g.append('<input type="file"'+(l?' multiple=""':"")+' class="xheFile" size="13" name="'+q+'" tabindex="-1" />');var m=d(".xheFile",g),n=[];m.change(function(){o(m[0])});setTimeout(h,10)}};this.html4Upload=function(a,
c,e){var h="jUploadFrame"+(new Date).getTime(),o=this,j=d('<iframe name="'+h+'" class="xheHideArea" />').appendTo("body"),p=d('<form action="'+c+'" target="'+h+'" method="post" enctype="multipart/form-data" class="xheHideArea"></form>').appendTo("body"),k=d(a),q=k.clone().attr("disabled","true");k.before(q).appendTo(p);this.remove=function(){if(o!=null){q.before(k).remove();j.remove();p.remove();o=null}};this.onLoad=function(){e(d(j[0].contentWindow.document.body).text(),true)};this.start=function(){p.submit();
j.load(o.onLoad)};return this};this.html5Upload=function(a,c,e,h,o){function j(i,r,t,z){k=new XMLHttpRequest;upload=k.upload;k.onreadystatechange=function(){k.readyState==4&&t(k.responseText)};if(upload)upload.onprogress=function(x){z(x.loaded)};else z(-1);k.open("POST",r);k.setRequestHeader("Content-Type","application/octet-stream");k.setRequestHeader("Content-Disposition",'attachment; name="'+a+'"; filename="'+i.fileName+'"');k.sendAsBinary?k.sendAsBinary(i.getAsBinary()):k.send(i)}function p(i){o&&
o({loaded:f+i,total:l})}for(var k,q=0,g=c.length,f=0,l=0,m=this,n=0;n<g;n++)l+=c[n].fileSize;this.remove=function(){if(k){k.abort();k=null}};this.uploadNext=function(i){if(i){f+=c[q-1].fileSize;p(0)}if((!i||i&&h(i,q==g)==true)&&q<g)j(c[q++],e,m.uploadNext,function(r){p(r)})};this.start=function(){m.uploadNext()}};this.showIframeModal=function(a,c,e,h,o,j){c=d('<iframe frameborder="0" src="'+c.replace(/{editorRoot}/ig,S)+'" style="width:100%;height:100%;display:none;" /><div class="xheModalIfmWait"></div>');
var p=d(c[0]),k=d(c[1]);b.showModal(a,c,h,o,j);p.load(function(){var q=p[0].contentWindow,g=d(q.document);q.callback=function(f){b.removeModal();e(f)};g.keydown(b.modalEscCheck);p.show();k.remove()})};this.showModal=function(a,c,e,h,o){if(d(".xheModal").length==1)return false;var j,p,k,q,g;e=e?e:b.settings.modalWidth;h=h?h:b.settings.modalHeight;q=b.settings.layerShadow;j=d('<div class="xheModal" style="width:'+(e-1)+"px;height:"+h+"px;margin-left:-"+Math.ceil(e/2)+"px;"+(D&&qa<=7?"":"margin-top:-"+
Math.ceil(h/2)+"px")+'">'+(b.settings.modalTitle?'<div class="xheModalTitle"><span class="xheModalClose" title="\u5173\u95ed (Esc)"></span>'+a+"</div>":"")+'<div class="xheModalContent"></div></div>').appendTo("body");k=d('<div class="xheModalOverlay"></div>').appendTo("body");if(q>0)p=d('<div class="xheModalShadow" style="width:'+j.outerWidth()+"px;height:"+j.outerHeight()+"px;margin-left:-"+(Math.ceil(e/2)-q-2)+"px;"+(D&&qa<=7?"":"margin-top:-"+(Math.ceil(h/2)-q-2)+"px")+'"></div>').appendTo("body");
d(".xheModalContent",j).css("height",h-(b.settings.modalTitle?d(".xheModalTitle").outerHeight():0)).html(c);if(D&&qa==6)g=d("select:visible").css("visibility","hidden");this.removeModal=function(){g&&g.css("visibility","visible");d(document).unbind("keydown",b.modalEscCheck);j.remove();q>0&&p.remove();k.remove();o&&o()};this.modalEscCheck=function(f){if(f.which==27){b.removeModal();return false}};d(document).keydown(b.modalEscCheck);d(".xheModalClose",j).click(b.removeModal);k.show();q>0&&p.show();
j.show()};this.showDialog=function(a){var c=d('<div class="xheDialog"></div>');a=d(a);var e=d("#xheSave",a);if(e.length==1){a.find("input[type=text],select").keypress(function(j){if(j.which==13){e.click();return false}});a.find("textarea").keydown(function(j){if(j.ctrlKey&&j.which==13){e.click();return false}});e.after(' <input type="button" id="xheCancel" value="\u53d6\u6d88" />');d("#xheCancel",a).click(b.hidePanel);if(!b.settings.clickCancelDialog){la=false;var h=d('<div class="xheFixCancel"></div>').appendTo("body").mousedown(function(){return false}),
o=O.offset();h.css({left:o.left,top:o.top,width:O.outerWidth(),height:O.outerHeight()})}c.mousedown(function(){ga=true})}c.append(a);b.showPanel(c);D||setTimeout(function(){c.find("input[type=text],textarea").filter(":visible").filter(function(){return d(this).css("visibility")!="hidden"}).eq(0).focus()},10)};this.clickCancelPanel=function(){la&&b.hidePanel()};this.showPanel=function(a){if(!L.target)return false;K.empty().append(a).css("left",-999).css("top",-999);ba=d(L.target).closest("a").addClass("xheActive");
var c=ba.offset();a=c.left;c=c.top;c+=ba.outerHeight()-1;aa.css({left:a+1,top:c}).show();if(a+K.outerWidth()>document.body.clientWidth)a-=K.outerWidth()-ba.outerWidth();var e=b.settings.layerShadow;e>0&&$.css({left:a+e,top:c+e,width:K.outerWidth(),height:K.outerHeight()}).show();K.css("left",a).css("top",c).show();va=R=true};this.hidePanel=function(){if(R){ba.removeClass("xheActive");$.hide();aa.hide();K.hide();R=false;if(!la){d(".xheFixCancel").remove();la=true}va=ga=false;T=null}};this.exec=function(a){b.hidePanel();
b.focus();b.saveBookmark();var c=ca[a];if(!c)return false;if(L==null){L={};var e=J.find(".xheButton[name="+a+"]");if(e.length==1)L.target=e}if(c.e)c.e.call(b);else{a=a.toLowerCase();switch(a){case "cut":try{u.execCommand(a);if(!u.queryCommandSupported(a))throw"Error";}catch(h){alert("\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u526a\u5207\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u952e\u76d8\u5feb\u6377\u952e(Ctrl + X)\u6765\u5b8c\u6210")}break;case "copy":try{u.execCommand(a);
if(!u.queryCommandSupported(a))throw"Error";}catch(o){alert("\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u590d\u5236\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u952e\u76d8\u5feb\u6377\u952e(Ctrl + C)\u6765\u5b8c\u6210")}break;case "paste":try{u.execCommand(a);if(!u.queryCommandSupported(a))throw"Error";}catch(j){alert("\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u7c98\u8d34\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u952e\u76d8\u5feb\u6377\u952e(Ctrl + V)\u6765\u5b8c\u6210")}break;
case "pastetext":window.clipboardData?b.pasteText(window.clipboardData.getData("Text",true)):b.showPastetext();break;case "blocktag":var p=[];d.each(Ra,function(g,f){p.push({s:"<"+f.n+">"+f.t+"</"+f.n+">",v:"<"+f.n+">",t:f.t})});b.showMenu(p,function(g){b._exec("formatblock",g)});break;case "fontface":var k=[];d.each(Sa,function(g,f){f.c=f.c?f.c:f.n;k.push({s:'<span style="font-family:'+f.c+'">'+f.n+"</span>",v:f.c,t:f.n})});b.showMenu(k,function(g){b._exec("fontname",g)});break;case "fontsize":var q=
[];d.each(M,function(g,f){q.push({s:'<span style="font-size:'+f.s+';">'+f.t+"("+f.s+")</span>",v:g+1,t:f.t})});b.showMenu(q,function(g){b._exec("fontsize",g)});break;case "fontcolor":b.showColor(function(g){b._exec("forecolor",g)});break;case "backcolor":b.showColor(function(g){if(D)b._exec("backcolor",g);else{b.setCSS(true);b._exec("hilitecolor",g);b.setCSS(false)}});break;case "align":b.showMenu(Ta,function(g){b._exec(g)});break;case "list":b.showMenu(Ua,function(g){b._exec(g)});break;case "link":b.showLink();
break;case "img":b.showImg();break;case "flash":b.showEmbed("Flash",'<div>\u52a8\u753b\u6587\u4ef6: <input type="text" id="xheFlashSrc" value="http://" class="xheText" /></div><div>\u5bbd\u5ea6\u9ad8\u5ea6: <input type="text" id="xheFlashWidth" style="width:40px;" value="480" /> x <input type="text" id="xheFlashHeight" style="width:40px;" value="400" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>',"application/x-shockwave-flash","clsid:d27cdb6e-ae6d-11cf-96b8-4445535400000",
' wmode="opaque" quality="high" menu="false" play="true" loop="true"',b.settings.upFlashUrl,b.settings.upFlashExt);break;case "media":b.showEmbed("Media",'<div>\u5a92\u4f53\u6587\u4ef6: <input type="text" id="xheMediaSrc" value="http://" class="xheText" /></div><div>\u5bbd\u5ea6\u9ad8\u5ea6: <input type="text" id="xheMediaWidth" style="width:40px;" value="480" /> x <input type="text" id="xheMediaHeight" style="width:40px;" value="400" /></div><div style="text-align:right;"><input type="button" id="xheSave" value="\u786e\u5b9a" /></div>',
"application/x-mplayer2","clsid:6bf52a52-394a-11d3-b153-00c04f79faa6",' enablecontextmenu="false" autostart="false"',b.settings.upMediaUrl,b.settings.upMediaExt);break;case "emot":b.showEmot();break;case "table":b.showTable();break;case "source":b.toggleSource();break;case "print":P.print();break;case "fullscreen":b.toggleFullscreen();break;case "about":b.showAbout();break;default:b._exec(a);break}}L=null};this._exec=function(a,c,e){e||b.focus();return c!=undefined?u.execCommand(a,false,c):u.execCommand(a,
false,null)}};d(function(){d.fn.oldVal=d.fn.val;d.fn.val=function(A){var B=this,C;if(A===undefined)return this[0]&&(C=this[0].xheditor)?C.getSource():B.oldVal(A);return this.each(function(){(C=this.xheditor)?C.setSource(A):B.oldVal(A)})};d("textarea").each(function(){var A=d(this),B=A.attr("class").match(/(?:^|\s)xheditor(?:\-(m?full|simple|mini))?(?:\s|$)/i);if(B)A.xheditor(B[1]?{tools:B[1]}:null)})})})(jQuery);
