/* kindeditor 4.1.4 (2012-11-11), copyright (c) kindsoft.net, licence: http://www.kindsoft.net/license.php */(function(z,m){function w(a){if(!a)return!1;return object.prototype.tostring.call(a)==="[object array]"}function cb(a){if(!a)return!1;return object.prototype.tostring.call(a)==="[object function]"}function m(a,b){for(var c=0,d=b.length;c=0}function r(a,b){b=b||"px";return a&&/^\d+$/.test(a)?a+b:a}function s(a){var b;return a&&(b=/(\d+)/.exec(a))?parseint(b[1],10):0}function b(a){return a.replace(/&/g,"&").replace(//g,">").replace(/"/g,""")}function ta(a){return a.replace(/</g,"<").replace(/>/g,">").replace(/"/g,'"').replace(/&/g,"&")}function da(a){var b=a.split("-"),a="";k(b,function(b,d){a+=b>0?d.charat(0).touppercase()+
d.substr(1):d});return a}function ua(a){function b(a){a=parseint(a,10).tostring(16).touppercase();return a.length>1?a:"0"+a}return a.replace(/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/ig,function(a,d,e,g){return"#"+b(d)+b(e)+b(g)})}function u(a,b){var b=b===m?",":b,c={},d=w(a)?a:a.split(b),e;k(d,function(a,b){if(e=/^(\d+)\.\.(\d+)$/.exec(b))for(var d=parseint(e[1],10);d<=parseint(e[2],10);d++)c[d.tostring()]=!0;else c[b]=!0});return c}function ga(a,b){return array.prototype.slice.call(a,b||0)}
function n(a,b){return a===m?b:a}function f(a,b,c){c||(c=b,b=null);var d;if(b){var e=function(){};e.prototype=b.prototype;d=new e;k(c,function(a,b){d[a]=b})}else d=c;d.constructor=a;a.prototype=d;a.parent=b?b.prototype:null}function db(a){var b;if(b=/\{[\s\s]*\}|\[[\s\s]*\]/.exec(a))a=b[0];b=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;b.lastindex=0;b.test(a)&&(a=a.replace(b,function(a){return"\\u"+("0000"+a.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";}function qb(a,b,c){a.addeventlistener?a.addeventlistener(b,c,eb):a.attachevent&&a.attachevent("on"+b,c)}function va(a,b,c){a.removeeventlistener?a.removeeventlistener(b,c,eb):a.detachevent&&a.detachevent("on"+b,c)}function fb(a,b){this.init(a,b)}function gb(a){try{delete a[x]}catch(b){a.removeattribute&&
a.removeattribute(x)}}function y(a,b,c){if(b.indexof(",")>=0)k(b.split(","),function(){y(a,this,c)});else{var d=a[x]||null;d||(a[x]=++hb,d=hb);v[d]===m&&(v[d]={});var e=v[d][b];e&&e.length>0?va(a,b,e[0]):(v[d][b]=[],v[d].el=a);e=v[d][b];e.length===0&&(e[0]=function(b){var c=b?new fb(a,b):m;k(e,function(b,d){b>0&&d&&d.call(a,c)})});m(c,e)<0&&e.push(c);qb(a,b,e[0])}}function ea(a,b,c){if(b&&b.indexof(",")>=0)k(b.split(","),function(){ea(a,this,c)});else{var d=a[x]||null;if(d)if(b===m)d in v&&(k(v[d],
function(b,c){b!="el"&&c.length>0&&va(a,b,c[0])}),delete v[d],gb(a));else if(v[d]){var e=v[d][b];if(e&&e.length>0){c===m?(va(a,b,e[0]),delete v[d][b]):(k(e,function(a,b){a>0&&b===c&&e.splice(a,1)}),e.length==1&&(va(a,b,e[0]),delete v[d][b]));var g=0;k(v[d],function(){g++});g<2&&(delete v[d],gb(a))}}}}function ib(a,b){if(b.indexof(",")>=0)k(b.split(","),function(){ib(a,this)});else{var c=a[x]||null;if(c){var d=v[c][b];if(v[c]&&d&&d.length>0)d[0]()}}}function ha(a,b,c){b=/^\d{2,}$/.test(b)?b:b.touppercase().charcodeat(0);
y(a,"keydown",function(d){d.ctrlkey&&d.which==b&&!d.shiftkey&&!d.altkey&&(c.call(a),d.stop())})}function fa(a){for(var b={},c=/\s*([\w\-]+)\s*:([^;]*)(;|$)/g,d;d=c.exec(a);){var e=a(d[1].tolowercase());d=a(ua(d[2]));b[e]=d}return b}function j(a){for(var b={},c=/\s+(?:([\w\-:]+)|(?:([\w\-:]+)=([^\s"'<>]+))|(?:([\w\-:"]+)="([^"]*)")|(?:([\w\-:"]+)='([^']*)'))(?=(?:\s|\/|>)+)/g,d;d=c.exec(a);){var e=(d[1]||d[2]||d[4]||d[6]).tolowercase();b[e]=(d[2]?d[3]:d[4]?d[5]:d[7])||""}return b}function rb(a,b){return a=
/\s+class\s*=/.test(a)?a.replace(/(\s+class=["']?)([^"']*)(["']?[\s>])/,function(a,d,e,g){return(" "+e+" ").indexof(" "+b+" ")<0?e===""?d+b+g:d+e+" "+b+g:a}):a.substr(0,a.length-1)+' class="'+b+'">'}function sb(a){var b="";k(fa(a),function(a,d){b+=a+":"+d+";"});return b}function ga(a,b,c,d){function e(a){for(var a=a.split("/"),b=[],c=0,d=a.length;c0&&b.pop():e!==""&&e!="."&&b.push(e)}return"/"+b.join("/")}function g(b,c){if(a.substr(0,b.length)===b){for(var e=[],
h=0;h0&&(h+="/"+e.join("/"));d=="/"&&(h+="/");return h+a.substr(b.length)}else if(f=/^(.*)\//.exec(b))return g(f[1],++c)}b=n(b,"").tolowercase();a.substr(0,5)!="data:"&&(a=a.replace(/([^:])\/\//g,"$1/"));if(m(b,["absolute","relative","domain"])<0)return a;c=c||location.protocol+"//"+location.host;if(d===m)var h=location.pathname.match(/^(\/.*)\//),d=h?h[1]:"";var f;if(f=/^(\w+:\/\/[^\/]*)/.exec(a)){if(f[1]!==c)return a}else if(/^\w+:/.test(a))return a;/^\//.test(a)?
a=c+e(a.substr(1)):/^\w+:\/\//.test(a)||(a=c+e(d+"/"+a));b==="relative"?a=g(c+d,0).substr(2):b==="absolute"&&a.substr(0,c.length)===c&&(a=a.substr(c.length));return a}function r(a,b,c,d,e){var c=c||"",d=n(d,!1),e=n(e,"\t"),g="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\s]*?)(<\/pre>)/ig,function(a,b,c,d){return b+c.replace(/<(?:br|br\s[^>]*)>/ig,"\n")+d}),a=a.replace(/<(?:br|br\s[^>]*)\s*\/?>\s*<\/p>/ig,"
"),a=a.replace(/(<(?:p|p\s[^>]*)>)\s*(<\/p>)/ig,
"$1
$2"),a=a.replace(/\u200b/g,""),a=a.replace(/\u00a9/g,"©"),h={};b&&(k(b,function(a,b){for(var c=a.split(","),d=0,e=c.length;d]*)>)([\s\s]*?)(<\/script>)/ig,"")),h.style||(a=a.replace(/(<(?:style|style\s[^>]*)>)([\s\s]*?)(<\/style>)/ig,"")));var f=[],a=a.replace(/([ \t\n\r]*)<(\/)?([\w\-:]+)((?:\s+|(?:\s+[\w\-:]+)|(?:\s+[\w\-:]+=[^\s"'<>]+)|(?:\s+[\w\-:"]+="[^"]*")|(?:\s+[\w\-:"]+='[^']*'))*)(\/)?>([ \t\n\r]*)/g,function(a,
l,p,t,wa,e,g){var l=l||"",p=p||"",m=t.tolowercase(),n=wa||"",t=e?" "+e:"",g=g||"";if(b&&!h[m])return"";t===""&&jb[m]&&(t=" /");kb[m]&&(l&&(l=" "),g&&(g=" "));ia[m]&&(p?g="\n":l="\n");d&&m=="br"&&(g="\n");if(lb[m]&&!ia[m])if(d){p&&f.length>0&&f[f.length-1]===m?f.pop():f.push(m);g=l="\n";wa=0;for(e=p?f.length:f.length-1;wa=0&&(w[a]=ga(d,c));(b&&a!=="style"&&!h[m]["*"]&&!h[m][a]||m==="body"&&a==="contenteditable"||/^kindeditor_\d+$/.test(a))&&delete w[a];if(a==="style"&&d!==""){var e=fa(d);k(e,function(a){b&&!h[m].style&&!h[m]["."+a]&&delete e[a]});var g=
"";k(e,function(a,b){g+=a+":"+b+";"});w.style=g}});n="";k(w,function(a,b){a==="style"&&b===""||(b=b.replace(/"/g,"""),n+=" "+a+'="'+b+'"')})}m==="font"&&(m="span");return l+"<"+p+m+n+t+">"+g}),a=a.replace(/(<(?:pre|pre\s[^>]*)>)([\s\s]*?)(<\/pre>)/ig,function(a,b,c,d){return b+c.replace(/\n/g,'\n')+d}),a=a.replace(/\n\s*\n/g,"\n"),a=a.replace(/\n/g,"\n");return a(a)}function mb(a,b){a=a.replace(//ig,"").replace(//ig,
"").replace(/"];w(c)||(c=[c]);k(c,function(a,b){b&&e.push('')});d&&e.push("");e.push("