(function(e,ha){if(window.xheditor)return false;var xb=navigator.useragent.tolowercase().indexof("mobile")>-1,qa=e.browser,ca=parsefloat(qa.version),y=qa.msie,da=qa.mozilla,y=qa.safari,eb=qa.opera;e.fn.xheditor=function(b){if(xb)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(qa){}b=
e.extend({},j,b)}j=new ea(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 ia=0,z=false,fa=true,ga=false,fb=false,l,ra,sa,ja,s,ra,ka,sa,ta,ua,t;e("script[src*=xheditor]").each(function(){var b=this.src;if(b.match(/xheditor[^\/]*\.js/i)){t=b.replace(/[\?#].*$/,"").replace(/(^|[\/\\])[^\/]*$/,"$1");return false}});if(y)try{document.execcommand("backgroundimagecache",false,true)}catch(kb){}var yb={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"},gb=["#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"],zb=[{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"}],ab=[{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"}],$=[{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"}],bb=[{s:"\u5de6\u5bf9\u9f50",v:"justifyleft"},{s:"\u5c45\u4e2d",v:"justifycenter"},{s:"\u53f3\u5bf9\u9f50",v:"justifyright"},{s:"\u4e24\u7aef\u5bf9\u9f50",v:"justifyfull"}],
cb=[{s:"\u6570\u5b57\u5217\u8868",v:"insertorderedlist"},{s:"\u7b26\u53f7\u5217\u8868",v:"insertunorderedlist"}],db={"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"}
},va={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"};va.mfull=
va.full.replace(/\|(,align)/i,"/$1");var eb={a:"link",img:"img",embed:"embed"},fb={"<":"<",">":">",'"':""","\u00ae":"®","\u00a9":"©"},gb=/[<>"\u00ae\u00a9]/g,ea=function(b,a){function j(a){a=a.target;var b=eb[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 qa(a){if(a.which===27){if(ga)d.removemodal();else z&&d.hidepanel();return false}}function hb(){settimeout(d.setsource,
10)}function aa(){d.getsource()}function ib(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=jb(j);d.pastehtml(j)};b.readasdataurl(a);return false}var n=p.cleanpaste;if(n===0||f||wa)return true;wa=true;d.savebookmark();b=y?"pre":"div";var m=e("<"+b+' class="xhe-paste">\ufeff\ufeff'+b+">",v).appendto(v.body);b=m[0];c=d.getsel();
g=d.getrng(true);m.css("top",ba.scrolltop());if(y){g.movetoelementtext(b);g.select();g.execcommand("paste");if(b.innerhtml=="\ufeff\ufeff"){m.remove();return}a.preventdefault()}else{g.selectnodecontents(b);c.removeallranges();c.addrange(g)}settimeout(function(){var j=n===3,i;if(j)i=m.text();else{var l=[];e(".xhe-paste",v.body).each(function(f,h){e(h).find(".xhe-paste").length==0&&l.push(h.innerhtml)});i=l.join("
")}m.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=jb(i);d.pastehtml(i)}}wa=false},0)}function jb(a){var b=p.localurltest,c=p.remoteimgsaveurl;if(b&&c){var g=[],n=0;a=a.replace(/(]*?)?(?:\s+src="\s*([^"]+)\s*")(?: [^>]*)?)(\/?>)/ig,function(m,j,i,l,f){if(/^(https?|data:image)/i.test(l)&&!b.test(l)){g[n]=l;i=i.replace(/\s+(width|height)="[^"]*"/ig,"").replace(/\s+src="[^"]*"/ig,' src="'+ha+'img/waiting.gif" remoteimg="'+n++ +'"')}return j+i+f});g.length>0&&e.post(c,
{urls:g.join("|")},function(m){m=m.split("|");e("img[remoteimg]",d.doc).each(function(){var j=e(this);u(j,"src",m[j.attr("remoteimg")]);j.removeattr("remoteimg")})})}return a}function xa(a){try{d._exec("stylewithcss",a,true)}catch(b){try{d._exec("usecss",!a,true)}catch(c){}}}function ya(){if(za&&!f){xa(false);try{d._exec("enableobjectresizing",true,true)}catch(a){}if(y)try{d._exec("backgroundimagecache",true,true)}catch(b){}}}function hb(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 $a(){if(!da&&!y){ua&&o.height("100%").css("height",o.outerheight()-c.outerheight());y&&c.hide().show()}}function ib(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 u(a,b,c){if(!b)return false;var g="_xhe_"+b;if(c){if(ia)c=ca(c,ia,p);a.attr(b,p?ca(c,"abs",p):c).removeattr(g).attr(g,c)}return a.attr(g)||a.attr(b)}function ab(){fa&&d.hidepanel()}function jb(a){if(f)return true;var b=a.which,c=yb[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 v(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 ca(a,b,c){if(a.match(/^(\w+):\/\//i)&&!a.match(/^https?:/i)||a.match(/^#/i))return a;var g=c?e('')[0]:location;c=g.protocol;var n=g.host,m=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+
"\\/\\/"+m.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)==="/"){m=[];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);x=p.height||b.style.height||(b>10?b:150);if(v(a,"number"))a+="px";if(v(x,"string"))x=x.replace(/[^\d]+/g,"");b=p.background||b.style.background;var c=[''],g,n,m=/\||\//i;e.each(p.tools,function(f,h){h.match(m)&&c.push('');if(h==="|")c.push('');else if(h==="/")c.push("
");else{g=ta[h];if(!g)return;n=g.c?g.c:"xheicon xhebtn"+h;c.push(''+g.t+"");g.s&&d.addshortcuts(g.s,h)}h.match(m)&&c.push('')});c.push('
');q.after(e(' '));c=e("#"+qb);o=e("#"+rb);za='';if(a=p.loadcss)if(v(a,
"array"))for(var j in a)za+='';else za+=a.match(/\s*";j+='