]*>)([\s\S]*?)(<\/pre>)/ig,function(m,p,o,q){return p+o.replace(/
]*>/ig,"\n")+q});var g={},h=["xx-small","x-small","small","medium","large","x-large","xx-large"];
e&&d.each(b,function(m,p){for(var o=m.split(","),q=0,r=o.length;q]+)|(?:\s+[\w-:]+="[^"]*")|(?:\s+[\w-:]+='[^']*'))*)(\/)?>((?:\r\n|\n|\r)*)/g,function(m,p,o,q,r,u,n){m=p||"";o=o||"";var v=q.toLowerCase();q=r||"";u=u?" "+u:"";n=n||"";if(e&&
typeof g[v]=="undefined")return"";if(u===""&&typeof i[v]!="undefined")u=" /";if(v in j){if(o||u)n="\n"}else if(n)n=" ";if(v!=="script"&&v!=="style")m="";if(v==="font"){var t={},x="";q=q.replace(/\s*([\w-:]+)=([^\s"'<>]+|"[^"]*"|'[^']*')/g,function(w,y,s){y=y.toLowerCase();s=s||"";s=s.replace(/^["']|["']$/g,"");if(y==="color"){t.color=s;return" "}if(y==="size"){t["font-size"]=h[parseInt(s)-1]||"";return" "}if(y==="face"){t["font-family"]=s;return" "}if(y==="style"){x=s;return" "}return w});if(x&&!/;$/.test(x))x+=
";";d.each(t,function(w,y){if(y!==""){if(/\s/.test(y))y="'"+y+"'";x+=w+":"+y+";"}});if(x)q+=' style="'+x+'"';v="span"}if(q!==""){q=q.replace(/\s*([\w-:]+)=([^\s"'<>]+|"[^"]*"|'[^']*')/g,function(w,y,s){w=y.toLowerCase();s=s||"";if(e)if(w.charAt(0)==="."||w!=="style"&&typeof g[v][w]=="undefined")return" ";if(s==="")s='""';else{if(w==="style"){s=s.substr(1,s.length-2);s=s.replace(/\s*([^\s]+?)\s*:(.*?)(;|$)/g,function(z,A,B){z=A.toLowerCase();if(e)if(typeof g[v].style=="undefined"&&typeof g[v]["."+
z]=="undefined")return"";B=d.util.trim(B);B=d.util.rgbToHex(B);return z+":"+B+";"});s=d.util.trim(s);if(s==="")return"";s='"'+s+'"'}if(d.util.inArray(w,["src","href"])){if(s.charAt(0)==='"')s=s.substr(1,s.length-2);s=d.format.getUrl(s,c)}if(s.charAt(0)!=='"')s='"'+s+'"'}return" "+w+"="+s+" "});q=q.replace(/\s+(checked|selected|disabled|readonly)(\s+|$)/ig,function(w,y){var s=y.toLowerCase();if(e)if(s.charAt(0)==="."||typeof g[v][s]=="undefined")return" ";return" "+s+'="'+s+'" '});q=d.util.trim(q);
if(q=q.replace(/\s+/g," "))q=" "+q;return m+"<"+o+v+q+u+">"+n}else return m+"<"+o+v+u+">"+n});if(!d.browser.IE){a=a.replace(/
\n<\/p>/ig,"
");a=a.replace(/
\n<\/p>/ig,"")}var k=d.setting.inlineTags.join("|"),l=function(m){var p=m.replace(new RegExp("<("+k+")[^>]*><\\/("+k+")>","ig"),function(o,q,r){return q==r?"":o});if(m!==p)p=l(p);return p};return d.util.trim(l(a))}};d.addClass=function(a,b){if(typeof a=="object"){var c=a.className;if(c){if((" "+c+" ").indexOf(" "+
b+" ")<0)a.className=c+" "+b}else a.className=b}else if(typeof a=="string")a=/\s+class\s*=/.test(a)?a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(e,g,h,i){return(" "+h+" ").indexOf(" "+b+" ")<0?h===""?g+b+i:g+h+" "+b+i:e}):a.substr(0,a.length-1)+' class="'+b+'">';return a};d.removeClass=function(a,b){var c=a.className||"";c=" "+c+" ";b=" "+b+" ";if(c.indexOf(b)>=0){c=d.util.trim(c.replace(new RegExp(b,"ig"),""));if(c===""){c=a.getAttribute("class")?"class":"className";a.removeAttribute(c)}else a.className=
c}return a};d.getComputedStyle=function(a,b){var c=a.ownerDocument,e=c.parentWindow||c.defaultView;c=d.util.getJsKey(b);var g="";if(e.getComputedStyle){e=e.getComputedStyle(a,null);g=e[c]||e.getPropertyValue(b)||a.style[c]}else if(a.currentStyle)g=a.currentStyle[c]||a.style[c];return g};d.getCommonAncestor=function(a,b){function c(i){for(;i;){if(i.nodeType==1)if(i.tagName.toLowerCase()===b)return i;i=i.parentNode}return null}var e=a.range,g=a.keRange,h=g.startNode;g=g.endNode;if(d.util.inArray(b,
["table","td","tr"]))if(d.browser.IE)if(e.item){if(e.item(0).nodeName.toLowerCase()===b)h=g=e.item(0)}else{h=e.duplicate();h.collapse(true);e=e.duplicate();e.collapse(false);h=h.parentElement();g=e.parentElement()}else{h=e.cloneRange();h.collapse(true);e=e.cloneRange();e.collapse(false);h=h.startContainer;g=e.startContainer}e=c(h);h=c(g);if(e&&h&&e===h)return e;return null};d.queryCommandValue=function(a,b){function c(){var i=a.queryCommandValue(b);if(typeof i!=="string")i="";return i}b=b.toLowerCase();
var e="";if(b==="fontname"){e=c();e=e.replace(/['"]/g,"")}else if(b==="formatblock"){e=c();if(e===""){var g=new d.selection(a),h=d.getCommonAncestor(g,"h1");h||(h=d.getCommonAncestor(g,"h2"));h||(h=d.getCommonAncestor(g,"h3"));h||(h=d.getCommonAncestor(g,"h4"));h||(h=d.getCommonAncestor(g,"p"));if(h)e=h.nodeName}if(e==="Normal")e="p"}else if(b==="fontsize"){g=new d.selection(a);if(h=d.getCommonAncestor(g,"span"))e=d.getComputedStyle(h,"font-size")}else if(b==="textcolor"){g=new d.selection(a);if(h=
d.getCommonAncestor(g,"span"))e=d.getComputedStyle(h,"color");e=d.util.rgbToHex(e);if(e==="")e="default"}else if(b==="bgcolor"){g=new d.selection(a);if(h=d.getCommonAncestor(g,"span"))e=d.getComputedStyle(h,"background-color");e=d.util.rgbToHex(e);if(e==="")e="default"}return e.toLowerCase()};d.util={getDocumentElement:function(a){a=a||document;return a.compatMode!="CSS1Compat"?a.body:a.documentElement},getDocumentHeight:function(a){a=this.getDocumentElement(a);return Math.max(a.scrollHeight,a.clientHeight)},
getDocumentWidth:function(a){a=this.getDocumentElement(a);return Math.max(a.scrollWidth,a.clientWidth)},createTable:function(a){a=d.$$("table",a);a.cellPadding=0;a.cellSpacing=0;a.border=0;return{table:a,cell:a.insertRow(0).insertCell(0)}},loadStyle:function(a){var b=d.$$("link");b.setAttribute("type","text/css");b.setAttribute("rel","stylesheet");b.setAttribute("href",a);document.getElementsByTagName("head")[0].appendChild(b)},getAttrList:function(a){for(var b=/\s+(?:([\w-:]+)|(?:([\w-:]+)=([\w-:]+))|(?:([\w-:]+)="([^"]*)")|(?:([\w-:]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,
c,e,g={};c=b.exec(a);){e=c[1]||c[2]||c[4]||c[6];c=c[1]||(c[2]?c[3]:c[4]?c[5]:c[7]);g[e]=c}return g},inArray:function(a,b){for(var c=0;c0?b[c].charAt(0).toUpperCase()+b[c].substr(1):b[c];return a},arrayToHash:function(a){for(var b={},c=0,e=a.length;c/g,">");return a=a.replace(/"/g,""")},unescape:function(a){a=a.replace(/</g,"<");a=a.replace(/>/g,">");a=a.replace(/"/g,'"');return a=a.replace(/&/g,"&")},getScrollPos:function(){var a,b;if(d.browser.IE||d.browser.OPERA){b=this.getDocumentElement();a=b.scrollLeft;b=b.scrollTop}else{a=window.scrollX;b=window.scrollY}return{x:a,y:b}},getElementPos:function(a){var b=0,c=0;if(a.getBoundingClientRect){c=a.getBoundingClientRect();a=this.getScrollPos();
b=c.left+a.x;c=c.top+a.y}else{b=a.offsetLeft;c=a.offsetTop;for(a=a.offsetParent;a;){b+=a.offsetLeft;c+=a.offsetTop;a=a.offsetParent}}return{x:b,y:c}},getCoords:function(a){a=a||window.event;return{x:a.clientX,y:a.clientY}},setOpacity:function(a,b){if(typeof a.style.opacity=="undefined")a.style.filter=b==100?"":"alpha(opacity="+b+")";else a.style.opacity=b==100?"":"0."+b.toString()},getIframeDoc:function(a){return a.contentDocument||a.contentWindow.document},rgbToHex:function(a){function b(c){c=parseInt(c).toString(16);
return c.length>1?c:"0"+c}return a.replace(/rgb\s*?\(\s*?(\d+)\s*?,\s*?(\d+)\s*?,\s*?(\d+)\s*?\)/ig,function(c,e,g,h){return"#"+b(e)+b(g)+b(h)})},parseJson:function(a){var b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;b.lastIndex=0;if(b.test(a))a=a.replace(b,function(c){return"\\u"+("0000"+c.charCodeAt(0).toString(16)).slice(-4)});if(/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return eval("("+a+")");throw"JSON parse error";},createRange:function(a){return a.createRange?a.createRange():a.body.createTextRange()},getNodeType:function(a){return a.nodeType==1&&d.util.inArray(a.tagName.toLowerCase(),d.setting.noEndTags)?88:a.nodeType},inMarquee:function(a){for(a=a;a;){if(a.nodeName.toLowerCase()==="marquee")return true;a=a.parentNode}return false},moveToElementText:function(a,b){this.inMarquee(b)||a.moveToElementText(b)},getNodeTextLength:function(a){var b=
d.util.getNodeType(a);if(b==1)return a.innerHTML.replace(/<.*?>/ig,"").length;else if(b==3)return a.nodeValue.length},getNodeStartRange:function(a,b){var c=d.util.createRange(a),e=b.nodeType;if(e==1){d.util.moveToElementText(c,b);return c}else if(e==3){e=0;for(var g=b.previousSibling;g;){if(g.nodeType==1){var h=d.util.createRange(a);d.util.moveToElementText(h,g);c.setEndPoint("StartToEnd",h);c.moveStart("character",e);return c}else if(g.nodeType==3)e+=g.nodeValue.length;g=g.previousSibling}d.util.moveToElementText(c,
b.parentNode);c.moveStart("character",e);return c}},removeParent:function(a){if(a.hasChildNodes)for(var b=a.firstChild;b;){var c=b.nextSibling;a.parentNode.insertBefore(b,a);b=c}a.parentNode.removeChild(a)},pluginLang:function(a,b){d.each(d.lang.plugins[a],function(c,e){var g=d.$("lang."+c,b);if(g){g.parentNode.insertBefore(b.createTextNode(e),g);g.parentNode.removeChild(g)}})},drag:function(a,b,c,e){var g=d.g[a];b.onmousedown=function(h){function i(s){if(x){var z=d.util.getCoords(s),A=d.util.getScrollPos();
s=parseInt(z.y-u-v+A.y);z=parseInt(z.x-n-t+A.x);e(p,o,q,r,s,z)}}function j(s){if(x){var z=d.util.getCoords(s,g.iframeDoc);s=parseInt(w.y+z.y-u-v);z=parseInt(w.x+z.x-n-t);e(p,o,q,r,s,z)}}function k(s){x=false;l.releaseCapture&&l.releaseCapture();d.event.remove(document,"mousemove",i);d.event.remove(document,"mouseup",k);d.event.remove(g.iframeDoc,"mousemove",j);d.event.remove(g.iframeDoc,"mouseup",k);d.event.remove(document,"selectstart",y);d.event.stop(s);return false}var l=this;h=h||window.event;
var m=d.util.getCoords(h),p=parseInt(c.style.top),o=parseInt(c.style.left),q=c.style.width,r=c.style.height;if(q.match(/%$/))q=c.offsetWidth+"px";if(r.match(/%$/))r=c.offsetHeight+"px";q=parseInt(q);r=parseInt(r);var u=m.y,n=m.x;m=d.util.getScrollPos();var v=m.y,t=m.x,x=true,w=d.util.getElementPos(g.iframe),y=function(){return false};d.event.add(document,"mousemove",i);d.event.add(document,"mouseup",k);d.event.add(g.iframeDoc,"mousemove",j);d.event.add(g.iframeDoc,"mouseup",k);d.event.add(document,
"selectstart",y);l.setCapture&&l.setCapture();d.event.stop(h);return false}},resize:function(a,b,c,e,g){g=typeof g=="undefined"?true:g;a=d.g[a];if(a.container)if(!(e&&(parseInt(b)<=a.minWidth||parseInt(c)<=a.minHeight))){if(g)a.container.style.width=b;a.container.style.height=c;b=parseInt(c)-a.toolbarHeight-a.statusbarHeight;if(b>=0){a.iframe.style.height=b+"px";a.newTextarea.style.height=(d.browser.IE&&d.browser.VERSION<8||document.compatMode!="CSS1Compat"?b-2:b)+"px"}}},hideLoadingPage:function(a){a=
d.g[a].dialogStack;a=a[a.length-1];a.loading.style.display="none";a.iframe.style.display=""},showLoadingPage:function(a){a=d.g[a].dialogStack;a=a[a.length-1];a.loading.style.display="";a.iframe.style.display="none"},setDefaultPlugin:function(){for(var a=["selectall","justifyleft","justifycenter","justifyright","justifyfull","insertorderedlist","insertunorderedlist","indent","outdent","subscript","superscript","bold","italic","underline","strikethrough"],b={bold:"B",italic:"I",underline:"U"},c=0;c<
a.length;c++){var e=a[c],g={};if(e in b)g.init=function(h){return function(i){d.event.ctrl(d.g[i].iframeDoc,b[h],function(){d.plugin[h].click(i);d.util.focus(i)},i)}}(e);g.click=function(h){return function(i){d.util.execCommand(i,h,null)}}(e);d.plugin[e]=g}},getFullHtml:function(a){var b="";b+="";b+='';b+="KindEditor ";b+='';
a=d.g[a].cssPath;if(typeof a=="string")a=[a];for(var c=0,e=a.length;c ';b+="";b+='';b+="";return b},getMediaType:function(a){return a.match(/\.(rm|rmvb)(\?|$)/i)?"rm":a.match(/\.(swf|flv)(\?|$)/i)?"flash":"media"},getMediaImage:function(a,b,c){var e=c.width,g=c.height;b=b||this.getMediaType(c.src);c=this.getMediaEmbed(c);var h="";if(e>0)h+="width:"+e+"px;";if(g>0)h+="height:"+
g+"px;";a='
';return a},getMediaEmbed:function(a){var b="";return b},execGetHtmlHooks:function(a,b){for(var c=d.g[a].getHtmlHooks,e=0,g=c.length;e]*>\s*$/ig,"");e=e.replace(/^\s*\s* \s*<\/p>\s*$/ig,"");return c.filterMode?d.format.getHtml(e,c.htmlTags,c.urlType):d.format.getHtml(e,null,c.urlType)},getData:function(a,b){var c=d.g[a];(b=b===f?c.wyswygMode:b)||this.innerHtml(c.iframeDoc.body,d.util.execSetHtmlHooks(a,c.newTextarea.value));return this.toData(a,c.iframeDoc.body.innerHTML)},
getSrcData:function(a){var b=d.g[a];b.wyswygMode||this.innerHtml(b.iframeDoc.body,d.util.execSetHtmlHooks(a,b.newTextarea.value));return b.iframeDoc.body.innerHTML},getPureData:function(a){return this.extractText(this.getData(a))},extractText:function(a){a=a.replace(/<(?!img|embed).*?>/ig,"");return a=a.replace(/ /ig," ")},isEmpty:function(a){return this.getPureData(a).replace(/\r\n|\n|\r/,"").replace(/^\s+|\s+$/,"")===""},setData:function(a){var b=d.g[a];if(b.srcTextarea)b.srcTextarea.value=
this.getData(a)},focus:function(a){a=d.g[a];a.wyswygMode?a.iframeWin.focus():a.newTextarea.focus()},click:function(a,b){this.focus(a);d.hideMenu(a);d.plugin[b].click(a)},selection:function(a){if(!d.browser.IE||!d.g[a].keRange)this.setSelection(a)},setSelection:function(a){a=d.g[a];var b=new d.selection(a.iframeDoc);if(!d.browser.IE||b.range.item||b.range.parentElement().ownerDocument===a.iframeDoc){a.keSel=b;a.keRange=a.keSel.keRange;a.sel=a.keSel.sel;a.range=a.keSel.range}},select:function(a){d.browser.IE&&
d.g[a].wyswygMode&&d.g[a].range&&d.g[a].range.select()},execCommand:function(a,b,c){d.util.focus(a);d.util.select(a);try{d.g[a].iframeDoc.execCommand(b,false,c)}catch(e){}d.toolbar.updateState(a);d.util.execOnchangeHandler(a)},innerHtml:function(a,b){if(d.browser.IE){a.innerHTML='
'+b;var c=d.$("__ke_temp_tag__",a.ownerDocument);c&&c.parentNode.removeChild(c)}else a.innerHTML=b},pasteHtml:function(a,b,c){a=d.g[a];if(c)b='
'+
b;else b+='
';if(d.browser.IE)if(a.range.item)a.range.item(0).outerHTML=b;else a.range.pasteHTML(b);else{a.range.deleteContents();b=a.range.createContextualFragment(b);a.range.insertNode(b)}b=d.$("__ke_temp_tag__",a.iframeDoc);c=a.iframeDoc.createTextNode("");b.parentNode.replaceChild(c,b);a.keRange.selectNode(c);a.keSel.addRange(a.keRange)},insertHtml:function(a,b){if(b!==""){var c=d.g[a];if(c.wyswygMode)if(c.range){b=this.execSetHtmlHooks(a,b);if(d.browser.IE){this.select(a);
if(c.range.item)try{c.range.item(0).outerHTML=b}catch(e){c=c.range.item(0);var g=c.parentNode;g.removeChild(c);if(g.nodeName.toLowerCase()!="body")g=g.parentNode;this.innerHtml(g,b+g.innerHTML)}else c.range.pasteHTML(b)}else if(d.browser.GECKO&&d.browser.VERSION<3){this.execCommand(a,"inserthtml",b);return}else this.pasteHtml(a,b);d.util.execOnchangeHandler(a)}}},setFullHtml:function(a,b){var c=d.g[a];if(!d.browser.IE&&b==="")b="
";b=d.util.execSetHtmlHooks(a,b);this.innerHtml(c.iframeDoc.body,
b);if(!c.wyswygMode)c.newTextarea.value=d.util.getData(a,true);d.util.execOnchangeHandler(a)},selectImageWebkit:function(a,b,c){if(d.browser.WEBKIT){b=b.srcElement||b.target;if(b.tagName.toLowerCase()=="img"){c&&d.util.selection(a);c=d.g[a].keRange;c.selectNode(b);d.g[a].keSel.addRange(c)}}},addTabEvent:function(a){d.event.add(d.g[a].iframeDoc,"keydown",function(b){if(b.keyCode==9){d.util.setSelection(a);d.util.insertHtml(a," ");d.event.stop(b);return false}},a)},addContextmenuEvent:function(a){var b=
d.g[a];b.contextmenuItems.length!=0&&d.event.add(b.iframeDoc,"contextmenu",function(c){d.hideMenu(a);d.util.setSelection(a);d.util.selectImageWebkit(a,c,false);for(var e=0,g=[],h=0,i=b.contextmenuItems.length;he)e=k}}j=j}for(;g.length>0&&g[0]==="-";)g.shift();for(;g.length>0&&g[g.length-1]==="-";)g.pop();j=null;h=0;for(i=g.length;h0){var l=new d.menu({id:a,event:c,type:"contextmenu",width:e});h=0;for(i=g.length;h");e=b.keRange.startNode.nextSibling;if(d.browser.IE)e||d.util.pasteHtml(a,"
",true);else if(d.browser.WEBKIT)if(e){var g=new d.range(b.iframeDoc);g.selectNode(e.parentNode);g.setStart(e,
0);g.cloneContents().innerHTML.replace(/<(?!img|embed).*?>/ig,"")===""&&d.util.pasteHtml(a,"
",true)}else d.util.pasteHtml(a,"
",true);d.event.stop(c);return false}}else d.util.inArray(e,["p","h1","h2","h3","h4","h5","h6","pre","div","li"])||d.util.execCommand(a,"formatblock","
");return true}},a)}};d.layout={hide:function(a){var b=d.g[a];d.hideMenu(a);for(a=b.dialogStack;a.length>0;)a[a.length-1].hide();b.maskDiv.style.display="none"}};d.hideMenu=function(a){a=d.g[a];a.hideDiv.innerHTML=
"";a.hideDiv.style.display="none"};d.colorpicker=function(a){var b,c=a.x||0,e=a.y||0,g=a.z||0,h=a.colors||d.setting.colorTable,i=a.doc||document,j=a.onclick,k=(a.selectedColor||"").toLowerCase();b=d.$$("div");b.className="ke-colorpicker";b.style.top=e+"px";b.style.left=c+"px";b.style.zIndex=g;this.remove=function(){i.body.removeChild(b)};this.getElement=function(){function l(n,v,t){if(k===v.toLowerCase())t+=" ke-colorpicker-cell-selected";n.className=t;n.title=v||d.lang.noColor;n.onmouseover=function(){this.className=
t+" ke-colorpicker-cell-on"};n.onmouseout=function(){this.className=t};n.onclick=function(){j(v)};if(v){var x=d.$$("div");x.className="ke-colorpicker-cell-color";x.style.backgroundColor=v;n.appendChild(x)}else n.innerHTML=d.lang.noColor}var m=d.$$("table");m.className="ke-colorpicker-table";m.cellPadding=0;m.cellSpacing=0;m.border=0;var p=m.insertRow(0),o=p.insertCell(0);o.colSpan=h[0].length;l(o,"","ke-colorpicker-cell-top");for(var q=0;q0||e>0){g=d.util.getScrollPos();
var j=d.util.getDocumentElement();g=g.x+j.clientWidth-c-2;if(h>g)h=g}return{x:h,y:i}}(function(){var c=a.width;this.type=a.type&&a.type=="contextmenu"?a.type:"menu";var e=d.$$("div");e.className="ke-"+this.type;e.setAttribute("name",a.cmd);var g=b.call(this,0,0);e.style.top=g.y+"px";e.style.left=g.x+"px";if(a.width)e.style.width=/^\d+$/.test(c)?c+"px":c;d.event.bind(e,"click",function(){},a.id);d.event.bind(e,"mousedown",function(){},a.id);this.div=e}).call(this);this.add=function(c,e,g){var h,i,
j=false;if(g!==f){h=g.height;i=g.iconHtml;j=g.checked}var k=this;g=d.$$("div");g.className="ke-"+k.type+"-item";if(h)g.style.height=h;var l=d.$$("div");l.className="ke-"+this.type+"-left";var m=d.$$("div");m.className="ke-"+k.type+"-center";if(h)m.style.height=h;var p=d.$$("div");p.className="ke-"+this.type+"-right";if(h)p.style.lineHeight=h;g.onmouseover=function(){this.className="ke-"+k.type+"-item ke-"+k.type+"-item-on";m.className="ke-"+k.type+"-center ke-"+k.type+"-center-on"};g.onmouseout=function(){this.className=
"ke-"+k.type+"-item";m.className="ke-"+k.type+"-center"};g.onclick=e;g.appendChild(l);g.appendChild(m);g.appendChild(p);if(j)d.util.innerHtml(l,'');else i&&d.util.innerHtml(l,i);d.util.innerHtml(p,c);this.append(g)};this.addSeparator=function(){var c=d.$$("div");c.className="ke-"+this.type+"-separator";this.append(c)};this.append=function(c){this.div.appendChild(c)};this.insert=function(c){d.util.innerHtml(this.div,c)};this.hide=
function(){d.hideMenu(a.id)};this.show=function(){this.hide();var c=a.id;d.g[c].hideDiv.style.display="";d.g[c].hideDiv.appendChild(this.div);c=b.call(this,this.div.clientWidth,this.div.clientHeight);this.div.style.top=c.y+"px";this.div.style.left=c.x+"px"};this.picker=function(c){this.append((new d.colorpicker({colors:d.g[a.id].colorTable,onclick:function(e){d.plugin[a.cmd].exec(a.id,e)},selectedColor:c})).getElement());this.show()}};d.dialog=function(a){function b(){d.util.getDocumentElement();
var h=d.util.getScrollPos();e=h.y;g=h.x}function c(){var h=this.width+this.widthMargin,i=this.height+this.heightMargin,j=a.id,k=d.g[j],l=0,m=0;if(k.dialogAlignType=="page"){k=d.util.getDocumentElement();j=d.util.getScrollPos();l=Math.round(j.x+(k.clientWidth-h)/2);m=Math.round(j.y+(k.clientHeight-i)/2)}else{j=d.util.getElementPos(d.g[j].container);k=k.container;l=Math.round(k.clientWidth/2)-Math.round(h/2);i=Math.round(k.clientHeight/2)-Math.round(i/2);l=l<0?j.x:j.x+l;m=i<0?j.y:j.y+i}return{x:l<0?
0:l,y:m<0?0:m}}this.widthMargin=30;this.heightMargin=100;this.zIndex=19811214;this.width=a.width;this.height=a.height;var e,g;this.beforeHide=a.beforeHide;this.afterHide=a.afterHide;this.beforeShow=a.beforeShow;this.afterShow=a.afterShow;this.ondrag=a.ondrag;this.resize=function(h,i){if(h)this.width=h;if(i)this.height=i;this.hide();this.show()};this.hide=function(){this.beforeHide&&this.beforeHide(h);var h=a.id,i=d.g[h].dialogStack;if(i[i.length-1]==this){var j=i.pop().iframe;j.src="javascript:false";
j.parentNode.removeChild(j);document.body.removeChild(this.div);if(i.length<1)d.g[h].maskDiv.style.display="none";d.event.remove(window,"resize",b);d.event.remove(window,"scroll",b);this.afterHide&&this.afterHide(h);d.util.focus(h)}};this.show=function(){this.beforeShow&&this.beforeShow(i);var h=this,i=a.id,j=d.$$("div");j.className="ke-dialog";d.event.bind(j,"click",function(){},i);d.event.bind(j,"mousedown",function(){},i);var k=d.g[i].dialogStack;if(k.length>0)this.zIndex=k[k.length-1].zIndex+
1;j.style.zIndex=this.zIndex;k=c.call(this);j.style.top=k.y+"px";j.style.left=k.x+"px";var l;if(d.g[i].shadowMode){k=d.$$("table");k.className="ke-dialog-table";k.cellPadding=0;k.cellSpacing=0;k.border=0;for(var m=["t","m","b"],p=["l","c","r"],o=0;o<3;o++)for(var q=k.insertRow(o),r=0;r<3;r++){var u=q.insertCell(r);u.className="ke-"+m[o]+p[r];if(o==1&&r==1)l=u;else u.innerHTML=''}j.appendChild(k)}else{d.addClass(j,"ke-dialog-no-shadow");l=j}k=d.$$("div");k.className=
"ke-dialog-title";k.innerHTML=a.title;m=d.$$("span");m.className="ke-dialog-close";d.g[i].shadowMode?d.addClass(m,"ke-dialog-close-shadow"):d.addClass(m,"ke-dialog-close-no-shadow");m.alt=d.lang.close;m.title=d.lang.close;m.onclick=function(){h.hide();d.util.select(i)};k.appendChild(m);b();d.event.add(window,"resize",b);d.event.add(window,"scroll",b);d.util.drag(i,k,j,function(n,v,t,x,w,y){h.ondrag&&h.ondrag(i);b();w=n+w;y=v+y;if(w0)c=a[a.length-1];if(a.length==0||b!==c)a.push(b)},add:function(a,
b){var c=d.g[a],e=d.util.getSrcData(a);if(c.undoStack.length>0)if(Math.abs(e.length-c.undoStack[c.undoStack.length-1].length)0)e=b.undoStack.pop();e=d.util.toData(a,e);if(b.wyswygMode)d.util.innerHtml(b.iframeDoc.body,d.util.execSetHtmlHooks(a,e));else b.newTextarea.value=e}},redo:function(a){var b=
d.g[a];if(b.redoStack.length!=0){var c=d.util.getSrcData(a);this.addStackData(b.undoStack,c);c=b.redoStack.pop();c=d.util.toData(a,c);if(b.wyswygMode)d.util.innerHtml(b.iframeDoc.body,d.util.execSetHtmlHooks(a,c));else b.newTextarea.value=c}}};d.readonly=function(a,b){b=b==f?true:b;var c=d.g[a];if(d.browser.IE)c.iframeDoc.body.contentEditable=b?"false":"true";else c.iframeDoc.designMode=b?"off":"on"};d.focus=function(a,b){b=(b||"").toLowerCase();if(d.g[a].container){d.util.focus(a);if(b==="end"){d.util.setSelection(a);
if(d.g[a].sel){var c=d.g[a].keSel,e=d.g[a].keRange;e.selectTextNode(d.g[a].iframeDoc.body);e.collapse(false);c.addRange(e)}}}};d.html=function(a,b){if(b===f)return d.util.getData(a);else if(d.g[a].container){d.util.setFullHtml(a,b);d.focus(a,"end")}};d.text=function(a,b){if(b===f){b=d.html(a);b=b.replace(/<.*?>/ig,"");b=b.replace(/ /ig," ");return b=d.util.trim(b)}else d.html(a,d.util.escape(b))};d.insertHtml=function(a,b){if(d.g[a].container)if(d.g[a].range){d.focus(a);d.util.selection(a);d.util.insertHtml(a,
b)}else d.appendHtml(a,b)};d.appendHtml=function(a,b){d.html(a,d.html(a)+b);d.focus(a,"end")};d.isEmpty=function(a){return d.util.isEmpty(a)};d.selectedHtml=function(a){var b=d.g[a].range;if(!b)return"";var c="";if(d.browser.IE)c=b.item?b.item(0).outerHTML:b.htmlText;else{c=d.$$("div",d.g[a].iframeDoc);c.appendChild(b.cloneContents());c=c.innerHTML}return d.util.toData(a,c)};d.count=function(a,b){b=(b||"html").toLowerCase();if(b==="html")return d.html(a).length;else if(b==="text"){var c=d.util.getPureData(a);
c=c.replace(/<(?:img|embed).*?>/ig,"K");c=c.replace(/\r\n|\n|\r/g,"");c=d.util.trim(c);return c.length}return 0};d.remove=function(a,b){var c=d.g[a];if(!c.container)return false;b=typeof b=="undefined"?0:b;d.util.setData(a);for(var e=c.container,g=c.eventStack,h=0,i=g.length;h0&&d.util.resize(a,A+"px",B+C+"px",true,false)});d.each(d.plugin,function(s,z){z.init&&z.init(a)});d.g[a].getHtmlHooks.push(function(s){return s.replace(/(<[^>]*)kesrc="([^"]+)"([^>]*>)/ig,function(z,A,B){z=z.replace(/(\s+(?:href|src)=")[^"]+(")/i,"$1"+B+"$2");return z=z.replace(/\s+kesrc="[^"]+"/i,"")})});d.g[a].setHtmlHooks.push(function(s){return s.replace(/(<[^>]*)(href|src)="([^"]+)"([^>]*>)/ig,
function(z,A,B,C,D){if(z.match(/\skesrc="[^"]+"/i))return z;return A+B+'="'+C+'" kesrc="'+C+'"'+D})});d.util.addContextmenuEvent(a);d.util.addNewlineEvent(a);d.util.addTabEvent(a);d.event.input(w,g,a);d.event.add(w,"mouseup",g,a);d.event.add(document,"mousedown",g,a);d.onchange(a,function(s){if(d.g[s].autoSetDataMode){d.util.setData(s);d.g[s].afterSetData&&d.g[s].afterSetData(s)}d.history.add(s,d.g[s].minChangeSize)});d.browser.IE&&d.browser.VERSION>7&&d.readonly(a,false);d.util.setFullHtml(a,i.value);
d.history.add(a,0);b>0&&d.util.focus(a);d.g[a].afterCreate&&d.g[a].afterCreate(a)}};d.onchange=function(a,b){function c(){b(a)}var e=d.g[a];e.onchangeHandlerStack.push(c);d.event.input(e.iframeDoc,c,a);d.event.input(e.newTextarea,c,a);d.event.add(e.iframeDoc,"mouseup",function(){window.setTimeout(function(){b(a)},0)},a)};d.init=function(a){var b=d.g[a.id]=a;b.config={};b.undoStack=[];b.redoStack=[];b.dialogStack=[];b.contextmenuItems=[];b.getHtmlHooks=[];b.setHtmlHooks=[];b.onchangeHandlerStack=[];
b.eventStack=[];d.each(d.setting,function(c,e){b[c]=typeof a[c]=="undefined"?e:a[c];b.config[c]=b[c]});b.loadStyleMode&&d.util.loadStyle(b.skinsPath+b.skinType+".css")};d.show=function(a){d.init(a);d.event.ready(function(){d.create(a.id)})};if(window.KE===f)window.KE=d;window.KindEditor=d})();
(function(f){f.langType="zh_CN";f.lang={source:"HTML\u4ee3\u7801",undo:"\u540e\u9000(Ctrl+Z)",redo:"\u524d\u8fdb(Ctrl+Y)",cut:"\u526a\u5207(Ctrl+X)",copy:"\u590d\u5236(Ctrl+C)",paste:"\u7c98\u8d34(Ctrl+V)",plainpaste:"\u7c98\u8d34\u4e3a\u65e0\u683c\u5f0f\u6587\u672c",wordpaste:"\u4eceWord\u7c98\u8d34",selectall:"\u5168\u9009",justifyleft:"\u5de6\u5bf9\u9f50",justifycenter:"\u5c45\u4e2d",justifyright:"\u53f3\u5bf9\u9f50",justifyfull:"\u4e24\u7aef\u5bf9\u9f50",insertorderedlist:"\u7f16\u53f7",insertunorderedlist:"\u9879\u76ee\u7b26\u53f7",
indent:"\u589e\u52a0\u7f29\u8fdb",outdent:"\u51cf\u5c11\u7f29\u8fdb",subscript:"\u4e0b\u6807",superscript:"\u4e0a\u6807",title:"\u6807\u9898",fontname:"\u5b57\u4f53",fontsize:"\u6587\u5b57\u5927\u5c0f",textcolor:"\u6587\u5b57\u989c\u8272",bgcolor:"\u6587\u5b57\u80cc\u666f",bold:"\u7c97\u4f53(Ctrl+B)",italic:"\u659c\u4f53(Ctrl+I)",underline:"\u4e0b\u5212\u7ebf(Ctrl+U)",strikethrough:"\u5220\u9664\u7ebf",removeformat:"\u5220\u9664\u683c\u5f0f",image:"\u56fe\u7247",flash:"\u63d2\u5165Flash",media:"\u63d2\u5165\u591a\u5a92\u4f53",
table:"\u63d2\u5165\u8868\u683c",hr:"\u63d2\u5165\u6a2a\u7ebf",emoticons:"\u63d2\u5165\u8868\u60c5",link:"\u8d85\u7ea7\u94fe\u63a5",unlink:"\u53d6\u6d88\u8d85\u7ea7\u94fe\u63a5",fullscreen:"\u5168\u5c4f\u663e\u793a",about:"\u5173\u4e8e",print:"\u6253\u5370",fileManager:"\u6d4f\u89c8\u670d\u52a1\u5668",advtable:"\u8868\u683c",yes:"\u786e\u5b9a",no:"\u53d6\u6d88",close:"\u5173\u95ed",editImage:"\u56fe\u7247\u5c5e\u6027",deleteImage:"\u5220\u9664\u56fe\u7247",editLink:"\u8d85\u7ea7\u94fe\u63a5\u5c5e\u6027",
deleteLink:"\u53d6\u6d88\u8d85\u7ea7\u94fe\u63a5",tableprop:"\u8868\u683c\u5c5e\u6027",tableinsert:"\u63d2\u5165\u8868\u683c",tabledelete:"\u5220\u9664\u8868\u683c",tablecolinsertleft:"\u5de6\u4fa7\u63d2\u5165\u5217",tablecolinsertright:"\u53f3\u4fa7\u63d2\u5165\u5217",tablerowinsertabove:"\u4e0a\u65b9\u63d2\u5165\u884c",tablerowinsertbelow:"\u4e0b\u65b9\u63d2\u5165\u884c",tablecoldelete:"\u5220\u9664\u5217",tablerowdelete:"\u5220\u9664\u884c",noColor:"\u65e0\u989c\u8272",invalidImg:"\u8bf7\u8f93\u5165\u6709\u6548\u7684URL\u5730\u5740\u3002\n\u53ea\u5141\u8bb8jpg,gif,bmp,png\u683c\u5f0f\u3002",
invalidMedia:"\u8bf7\u8f93\u5165\u6709\u6548\u7684URL\u5730\u5740\u3002\n\u53ea\u5141\u8bb8swf,flv,mp3,wav,wma,wmv,mid,avi,mpg,asf,rm,rmvb\u683c\u5f0f\u3002",invalidWidth:"\u5bbd\u5ea6\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidHeight:"\u9ad8\u5ea6\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidBorder:"\u8fb9\u6846\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidUrl:"\u8bf7\u8f93\u5165\u6709\u6548\u7684URL\u5730\u5740\u3002",invalidRows:"\u884c\u6570\u4e3a\u5fc5\u9009\u9879\uff0c\u53ea\u5141\u8bb8\u8f93\u5165\u5927\u4e8e0\u7684\u6570\u5b57\u3002",
invalidCols:"\u5217\u6570\u4e3a\u5fc5\u9009\u9879\uff0c\u53ea\u5141\u8bb8\u8f93\u5165\u5927\u4e8e0\u7684\u6570\u5b57\u3002",invalidPadding:"\u8fb9\u8ddd\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidSpacing:"\u95f4\u8ddd\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",invalidBorder:"\u8fb9\u6846\u5fc5\u987b\u4e3a\u6570\u5b57\u3002",pleaseInput:"\u8bf7\u8f93\u5165\u5185\u5bb9\u3002",invalidJson:"\u670d\u52a1\u5668\u53d1\u751f\u6545\u969c\u3002",cutError:"\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u526a\u5207\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+X)\u6765\u5b8c\u6210\u3002",
copyError:"\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u590d\u5236\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+C)\u6765\u5b8c\u6210\u3002",pasteError:"\u60a8\u7684\u6d4f\u89c8\u5668\u5b89\u5168\u8bbe\u7f6e\u4e0d\u5141\u8bb8\u4f7f\u7528\u7c98\u8d34\u64cd\u4f5c\uff0c\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+V)\u6765\u5b8c\u6210\u3002"};var d=f.lang.plugins={};d.about={version:f.version,title:"HTML\u53ef\u89c6\u5316\u7f16\u8f91\u5668"};d.plainpaste=
{comment:"\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+V)\u628a\u5185\u5bb9\u7c98\u8d34\u5230\u4e0b\u9762\u7684\u65b9\u6846\u91cc\u3002"};d.wordpaste={comment:"\u8bf7\u4f7f\u7528\u5feb\u6377\u952e(Ctrl+V)\u628a\u5185\u5bb9\u7c98\u8d34\u5230\u4e0b\u9762\u7684\u65b9\u6846\u91cc\u3002"};d.link={url:"URL\u5730\u5740",linkType:"\u6253\u5f00\u7c7b\u578b",newWindow:"\u65b0\u7a97\u53e3",selfWindow:"\u5f53\u524d\u7a97\u53e3"};d.flash={url:"Flash\u5730\u5740",width:"\u5bbd\u5ea6",height:"\u9ad8\u5ea6"};d.media=
{url:"\u5a92\u4f53\u6587\u4ef6\u5730\u5740",width:"\u5bbd\u5ea6",height:"\u9ad8\u5ea6",autostart:"\u81ea\u52a8\u64ad\u653e"};d.image={remoteImage:"\u8fdc\u7a0b\u56fe\u7247",localImage:"\u672c\u5730\u4e0a\u4f20",remoteUrl:"\u56fe\u7247\u5730\u5740",localUrl:"\u56fe\u7247\u5730\u5740",size:"\u56fe\u7247\u5927\u5c0f",width:"\u5bbd",height:"\u9ad8",resetSize:"\u91cd\u7f6e\u5927\u5c0f",align:"\u5bf9\u9f50\u65b9\u5f0f",defaultAlign:"\u9ed8\u8ba4\u65b9\u5f0f",leftAlign:"\u5de6\u5bf9\u9f50",rightAlign:"\u53f3\u5bf9\u9f50",
imgTitle:"\u56fe\u7247\u8bf4\u660e",viewServer:"\u6d4f\u89c8..."};d.file_manager={emptyFolder:"\u7a7a\u6587\u4ef6\u5939",moveup:"\u79fb\u5230\u4e0a\u4e00\u7ea7\u6587\u4ef6\u5939",viewType:"\u663e\u793a\u65b9\u5f0f\uff1a",viewImage:"\u7f29\u7565\u56fe",listImage:"\u8be6\u7ec6\u4fe1\u606f",orderType:"\u6392\u5e8f\u65b9\u5f0f\uff1a",fileName:"\u540d\u79f0",fileSize:"\u5927\u5c0f",fileType:"\u7c7b\u578b"};d.advtable={cells:"\u5355\u5143\u683c\u6570",rows:"\u884c\u6570",cols:"\u5217\u6570",size:"\u8868\u683c\u5927\u5c0f",
width:"\u5bbd\u5ea6",height:"\u9ad8\u5ea6",percent:"%",px:"px",space:"\u8fb9\u8ddd\u95f4\u8ddd",padding:"\u8fb9\u8ddd",spacing:"\u95f4\u8ddd",align:"\u5bf9\u9f50\u65b9\u5f0f",alignDefault:"\u9ed8\u8ba4",alignLeft:"\u5de6\u5bf9\u9f50",alignCenter:"\u5c45\u4e2d",alignRight:"\u53f3\u5bf9\u9f50",border:"\u8868\u683c\u8fb9\u6846",borderWidth:"\u8fb9\u6846",borderColor:"\u989c\u8272",backgroundColor:"\u80cc\u666f\u989c\u8272"};d.title={h1:"\u6807\u9898 1",h2:"\u6807\u9898 2",h3:"\u6807\u9898 3",h4:"\u6807\u9898 4",
p:"\u6b63 \u6587"};d.fontname={fontName:{SimSun:"\u5b8b\u4f53",NSimSun:"\u65b0\u5b8b\u4f53",FangSong_GB2312:"\u4eff\u5b8b_GB2312",KaiTi_GB2312:"\u6977\u4f53_GB2312",SimHei:"\u9ed1\u4f53","Microsoft YaHei":"\u5fae\u8f6f\u96c5\u9ed1",Arial:"Arial","Arial Black":"Arial Black","Times New Roman":"Times New Roman","Courier New":"Courier New",Tahoma:"Tahoma",Verdana:"Verdana"}}})(KindEditor);
(function(f,d){f.plugin.about={click:function(a){f.util.selection(a);(new f.dialog({id:a,cmd:"about",file:"about.html",width:300,height:70,loadingMode:true,title:f.lang.about,noButton:f.lang.close})).show()}};f.plugin.undo={init:function(a){f.event.ctrl(f.g[a].iframeDoc,"Z",function(){f.plugin.undo.click(a);f.util.focus(a)},a);f.event.ctrl(f.g[a].newTextarea,"Z",function(){f.plugin.undo.click(a);f.util.focus(a)},a)},click:function(a){f.history.undo(a);f.util.execOnchangeHandler(a)}};f.plugin.redo=
{init:function(a){f.event.ctrl(f.g[a].iframeDoc,"Y",function(){f.plugin.redo.click(a);f.util.focus(a)},a);f.event.ctrl(f.g[a].newTextarea,"Y",function(){f.plugin.redo.click(a);f.util.focus(a)},a)},click:function(a){f.history.redo(a);f.util.execOnchangeHandler(a)}};f.plugin.cut={click:function(a){try{if(!f.g[a].iframeDoc.queryCommandSupported("cut"))throw"e";}catch(b){alert(f.lang.cutError);return}f.util.execCommand(a,"cut",null)}};f.plugin.copy={click:function(a){try{if(!f.g[a].iframeDoc.queryCommandSupported("copy"))throw"e";
}catch(b){alert(f.lang.copyError);return}f.util.execCommand(a,"copy",null)}};f.plugin.paste={click:function(a){try{if(!f.g[a].iframeDoc.queryCommandSupported("paste"))throw"e";}catch(b){alert(f.lang.pasteError);return}f.util.execCommand(a,"paste",null)}};f.plugin.plainpaste={click:function(a){f.util.selection(a);this.dialog=new f.dialog({id:a,cmd:"plainpaste",file:"plainpaste.html",width:450,height:300,loadingMode:true,title:f.lang.plainpaste,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},
exec:function(a){var b=f.util.getIframeDoc(this.dialog.iframe);b=f.$("textArea",b).value;b=f.util.escape(b);b=b.replace(/ /g," ");b=b.replace(/\r\n|\n|\r/g,"
$&");f.util.insertHtml(a,b);this.dialog.hide();f.util.focus(a)}};f.plugin.wordpaste={click:function(a){f.util.selection(a);this.dialog=new f.dialog({id:a,cmd:"wordpaste",file:"wordpaste.html",width:450,height:300,loadingMode:true,title:f.lang.wordpaste,yesButton:f.lang.yes,noButton:f.lang.no});this.dialog.show()},exec:function(a){var b=
f.util.getIframeDoc(this.dialog.iframe);b=f.$("wordIframe",b);b=f.util.getIframeDoc(b).body.innerHTML;b=b.replace(//ig,"");b=b.replace(//ig,"");b=b.replace(/