/*! xhEditor v1.2.2 | (c) 2009, 2013 xheditor.com. Licence: http://xheditor.com/license/lgpl.txt */ !function(){var a={};window.XHEDITOR=a}(),function(a,b){a.mapLang={},a.setLang=function(c,d){d===b&&(d=c,c=""),""!==c&&(c+=".");var e,f;for(var g in d)f=d[g],e=c+g,"string"==typeof f||f instanceof Array?a.mapLang[e]=f:a.setLang(e,f)},a.getLang=function(c){var d=a.mapLang[c];if(d===b&&(d=c.replace(/{#([^{}]+)}/g,function(b,c){var d=a.mapLang[c];return d?d:c})),"string"==typeof d){var e=arguments;d=d.replace(/{\$(\d+)}/g,function(a,c){var d=e[parseInt(c,10)+1];return d!==b?d:a})}return d}}(XHEDITOR),function(a,b){function c(a){a=a.toLowerCase();var b=/(chrome)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[];return{browser:b[1]||"",version:b[2]||"0"}}if(!a.browser){var d=c(navigator.userAgent),e={};d.browser&&(e[d.browser]=!0,e.version=d.version),e.chrome?e.webkit=!0:e.webkit&&(e.safari=!0),a.browser=e}}(jQuery),function(XHEDITOR,$,undefined){var agent=navigator.userAgent.toLowerCase(),bMobile=/mobile/i.test(agent),browser=$.browser,browerVer=parseFloat(browser.version),isIE=browser.msie,isIE11=/trident\//i.test(agent)&&(/rv:/i.test(agent)||/Netscape/i.test(agent.appName)),isMozilla=browser.mozilla,isWebkit=browser.webkit,isOpera=browser.opera,isChrome=browser.chrome,bAir=agent.indexOf(" adobeair/")>-1,xCount=0,bShowPanel=!1,bClickCancel=!0,bShowModal=!1,bCheckEscInit=!1,_jPanel,_jShadow,_jCntLine,_jPanelButton,jModal,jModalShadow,layerShadow,jOverlay,jHideSelect,onModalRemove,editorRoot,getLang=XHEDITOR.getLang;if($("script[src*=xheditor]").each(function(){var a=this.src;return a.match(/xheditor[^\/]*\.js/i)?(editorRoot=a.replace(/[\?#].*$/,"").replace(/(^|[\/\\])[^\/]*$/,"$1"),!1):void 0}),isIE){try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e){}var jqueryVer=$.fn.jquery;jqueryVer&&jqueryVer.match(/^1\.[67]/)&&($.attrHooks.width=$.attrHooks.height=null)}var specialKeys={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"},arrAlign=[{v:"justifyleft"},{v:"justifycenter"},{v:"justifyright"},{v:"justifyfull"}],arrList=[{v:"insertOrderedList"},{v:"insertUnorderedList"}],htmlPastetext='
',htmlLink='',htmlAnchor='',htmlImg='")):(_this.pasteHTML("
"),isIE&&b.length>0&&2===_this.getRng().parentElement().childNodes.length&&_this.pasteHTML("
"),!1)}function fixFullHeight(){isMozilla||isWebkit||(bFullscreen&&_jArea.height("100%").css("height",_jArea.outerHeight()-_jTools.outerHeight()),isIE&&_jTools.hide().show())}function fixAppleSel(a){if(a=a.target,a.tagName.match(/(img|embed)/i)){var b=_this.getSel(),c=_this.getRng(!0);c.selectNode(a),b.removeAllRanges(),b.addRange(c)}}function xheAttr(a,b,c){if(!b)return!1;var d="_xhe_"+b;return c&&(urlType&&(c=getLocalUrl(c,urlType,urlBase)),a.attr(b,urlBase?getLocalUrl(c,"abs",urlBase):c).removeAttr(d).attr(d,c)),a.attr(d)||a.attr(b)}function clickCancelPanel(){bClickCancel&&_this.hidePanel()}function checkShortcuts(a){if(bSource)return!0;var b=a.which,c=specialKeys[b],d=c?c:String.fromCharCode(b).toLowerCase();sKey="",sKey+=a.ctrlKey?"ctrl+":"",sKey+=a.altKey?"alt+":"",sKey+=a.shiftKey?"shift+":"",sKey+=d;var e,f=arrShortCuts[sKey];for(e in f){if(e=f[e],!$.isFunction(e))return _this.exec(e),!1;if(e.call(_this)===!1)return!1}}function is(a,b){var c=typeof a;return b?"array"===b&&a.hasOwnProperty&&a instanceof Array?!0:c===b:"undefined"!=c}function getLocalUrl(a,b,c){if(a.match(/^(\w+):\/\//i)&&!a.match(/^https?:/i)||/^#/i.test(a)||/^data:/i.test(a))return a;var d=c?$('')[0]:location,e=d.protocol,f=d.host,g=d.hostname,h=d.port,i=d.pathname.replace(/\\/g,"/").replace(/[^\/]+$/i,"");if(""===h&&(h="80"),""===i?i="/":"/"!==i.charAt(0)&&(i="/"+i),a=$.trim(a),"abs"!==b&&(a=a.replace(new RegExp(e+"\\/\\/"+g.replace(/\./g,"\\.")+"(?::"+h+")"+("80"===h?"?":"")+"(/|$)","i"),"/")),"rel"===b&&(a=a.replace(new RegExp("^"+i.replace(/([\/\.\+\[\]\(\)])/g,"\\$1"),"i"),"")),"rel"!==b&&(a.match(/^(https?:\/\/|\/)/i)||(a=i+a),"/"===a.charAt(0))){var j,k,l=[],m=a.split("/"),n=m.length;for(k=0;n>k;k++)j=m[k],".."===j?l.pop():""!==j&&"."!==j&&l.push(j);""===m[n-1]&&l.push(""),a="/"+l.join("/")}return"abs"!==b||a.match(/^https?:\/\//i)||(a=e+"//"+f+a),a=a.replace(/(https?:\/\/[^:\/?#]+):80(\/|$)/i,"$1$2")}function checkFileExt(a,b){return"*"===b||a.match(new RegExp(".("+b.replace(/,/g,"|")+")$","i"))?!0:(alert(getLang("upload.extLimit",b)),!1)}function formatBytes(a){var b=["Byte","KB","MB","GB","TB","PB"],c=Math.floor(Math.log(a)/Math.log(1024));return(a/Math.pow(1024,Math.floor(c))).toFixed(2)+b[c]}function returnFalse(){return!1}var _this=this,_text=textarea,_jText=$(_text),_jForm=_jText.closest("form"),_jTools,_jArea,_win,_jWin,_doc,_jDoc,bookmark,bInit=!1,bSource=!1,bFullscreen=!1,bCleanPaste=!1,outerScroll,bShowBlocktag=!1,sLayoutStyle="",ev=null,timer,bDisableHoverExec=!1,bQuickHoverExec=!1,lastPoint=null,lastAngle=null,editorHeight=0,settings=_this.settings=$.extend({},XHEDITOR.settings,options),plugins=settings.plugins,strPlugins=[];if(plugins&&(arrTools=$.extend({},arrTools,plugins),$.each(plugins,function(a){strPlugins.push(a)}),strPlugins=strPlugins.join(",")),settings.tools.match(/^\s*(m?full|simple|mini)\s*$/i)){var toolsTheme=toolsThemes[$.trim(settings.tools)];settings.tools=settings.tools.match(/m?full/i)&&plugins?toolsTheme.replace("Table","Table,"+strPlugins):toolsTheme}settings.tools.match(/(^|,)\s*About\s*(,|$)/i)||(settings.tools+=",About"),settings.tools=settings.tools.split(","),settings.editorRoot&&(editorRoot=settings.editorRoot),bAir===!1&&(editorRoot=getLocalUrl(editorRoot,"abs")),settings.urlBase&&(settings.urlBase=getLocalUrl(settings.urlBase,"abs"));var idCSS="xheCSS_"+settings.skin,idContainer="xhe"+xCount+"_container",idTools="xhe"+xCount+"_Tool",idIframeArea="xhe"+xCount+"_iframearea",idIframe="xhe"+xCount+"_iframe",idFixFFCursor="xhe"+xCount+"_fixffcursor",headHTML="",bodyClass="",skinPath=editorRoot+"xheditor_skin/"+settings.skin+"/",arrEmots=itemEmots,urlType=settings.urlType,urlBase=settings.urlBase,emotPath=settings.emotPath,emotPath=emotPath?emotPath:editorRoot+"xheditor_emot/",selEmotGroup="";arrEmots=$.extend({},arrEmots,settings.emots),emotPath=getLocalUrl(emotPath,"rel",urlBase?urlBase:null),bShowBlocktag=settings.showBlocktag,bShowBlocktag&&(bodyClass+=" showBlocktag");var arrShortCuts=[];this.init=function(){function a(a){var b,c=$(a.target);(b=c.css("width"))&&c.css("width","").attr("width",b.replace(/[^0-9%]+/g,"")),(b=c.css("height"))&&c.css("height","").attr("height",b.replace(/[^0-9%]+/g,""))}0===$("#"+idCSS).length&&$("head").append('');var b=_jText.outerWidth(),c=_jText.outerHeight(),d=settings.width||_text.style.width||(b>10?b:0);editorHeight=settings.height||_text.style.height||(c>10?c:150),/^\d+(?:\.\d+)?$/.test(d)&&(d+="px"),is(editorHeight,"string")&&(editorHeight=editorHeight.replace(/[^\d]+/g,""));var e,f,g=settings.background||_text.style.background,h=[''],i=/\||\//i;$.each(settings.tools,function(a,b){if(b.match(i)&&h.push(''),"|"===b)h.push('');else if("/"===b)h.push("
");else{if(e=arrTools[b],!e)return;f=e.c?e.c:"xheIcon xheBtn"+b,h.push(''+e.t+""),e.s&&_this.addShortcuts(e.s,b)}b.match(i)&&h.push('')}),h.push('
'),_jText.after($(' ')),_jTools=$("#"+idTools),_jArea=$("#"+idIframeArea),headHTML='';var j=settings.loadCSS;if(j)if(is(j,"array"))for(var k in j)headHTML+='';else headHTML+=j.match(/\s*"),l+='