/** * SmartEditor2 NAVER_Library:SE2.8.2.O12056 * Copyright NAVER Corp. Licensed under LGPL v2 * See license text at http://dev.naver.com/projects/smarteditor/wiki/LICENSE */ function fontProperty(e,t,i,n,o){this.fontId=e,this.fontName=t,this.defaultSize=i,this.fontURL=n,this.fontCSSURL=o,this.displayName=t,this.isLoaded=!0,this.fontFamily=this.fontId,""!=this.fontCSSURL?(this.displayName+=""+i,this.fontFamily+="_"+i,this.isLoaded=!1,this.loadCSS=function(e){this.isLoaded||(this._importCSS(e),this.isLoaded=!0)},this.loadCSSToMenu=function(){this._importCSS(document)},this._importCSS=function(e){var t=e.styleSheets.length,i=e.styleSheets[t-1];(0===t||30==i.imports.length)&&(e.createStyleSheet?i=e.createStyleSheet():(i=e.createElement("style"),e.documentElement.firstChild.appendChild(i),i=i.sheet)),i.addImport(this.fontCSSURL)}):(this.loadCSS=function(){},this.loadCSSToMenu=function(){}),this.toStruct=function(){return{fontId:this.fontId,fontName:this.fontName,defaultSize:this.defaultSize,fontURL:this.fontURL,fontCSSURL:this.fontCSSURL}}}function Shortcut(e,t){var e=e.replace(/\s+/g,""),i=Shortcut.Store,n=Shortcut.Action;if("undefined"==typeof t&&e.constructor==String)return i.set("document",e,document),n.init(i.get("document"),e);if(t.constructor==String&&e.constructor==String)return i.set(t,e,jindo.$(t)),n.init(i.get(t),e);if(t.constructor!=String&&e.constructor==String){var o="nonID"+(new Date).getTime();return o=Shortcut.Store.searchId(o,t),i.set(o,e,t),n.init(i.get(o),e)}alert(t+"는 반드시 string이거나 없어야 됩니다.")}"undefined"==typeof window.nhn&&(window.nhn={}),nhn.husky||(nhn.husky={}),function(){var e=/^\$(LOCAL|BEFORE|ON|AFTER)_/,t=/^\$(BEFORE|ON|AFTER)_MSG_APP_READY$/,i=[],n={};nhn.husky.HuskyCore=jindo.$Class({name:"HuskyCore",aCallerStack:null,bMobile:jindo.$Agent().navigator().mobile||jindo.$Agent().navigator().msafari,$init:function(e){this.htOptions=e||{},i.push(this),this.htOptions.oDebugger&&(nhn.husky.HuskyCore.getCore=function(){return i},this.htOptions.oDebugger.setApp(this)),this.messageQueue=[],this.oMessageMap={},this.oDisabledMessage={},this.oLazyMessage={},this.aPlugins=[],this.appStatus=nhn.husky.APP_STATUS.NOT_READY,this.aCallerStack=[],this._fnWaitForPluginReady=jindo.$Fn(this._waitForPluginReady,this).bind(),this.registerPlugin(this)},setDebugger:function(e){this.htOptions.oDebugger=e,e.setApp(this)},exec:function(e,t,i){return this.appStatus==nhn.husky.APP_STATUS.NOT_READY?(this.messageQueue[this.messageQueue.length]={msg:e,args:t,event:i},!0):(this.exec=this._exec,void this.exec(e,t,i))},delayedExec:function(e,t,i,n){var o=jindo.$Fn(this.exec,this).bind(e,t,n);setTimeout(o,i)},_exec:function(e,t,i){return(this._exec=this.htOptions.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this,e,t,i)},_execWithDebugger:function(e,t,i){this.htOptions.oDebugger.log_MessageStart(e,t);var n=this._doExec(e,t,i);return this.htOptions.oDebugger.log_MessageEnd(e,t),n},_execWithoutDebugger:function(e,t,i){return this._doExec(e,t,i)},_doExec:function(e,t,i){var n=!1;if(this.oLazyMessage[e]){var o=this.oLazyMessage[e];return this._loadLazyFiles(e,t,i,o.aFilenames,0),!1}if(!this.oDisabledMessage[e]){var s=[];if(t&&t.length)for(var r=t.length,a=0;r>a;a++)s[a]=t[a];i&&(s[s.length]=i),n=this._execMsgStep("BEFORE",e,s),n&&(n=this._execMsgStep("ON",e,s)),n&&(n=this._execMsgStep("AFTER",e,s))}return n},registerPlugin:function(t){if(!t)throw"An error occured in registerPlugin(): invalid plug-in";if(t.nIdx=this.aPlugins.length,t.oApp=this,this.aPlugins[t.nIdx]=t,t.status!=nhn.husky.PLUGIN_STATUS.NOT_READY&&(t.status=nhn.husky.PLUGIN_STATUS.READY),this.appStatus!=nhn.husky.APP_STATUS.NOT_READY)for(var i in t)e.test(i)&&this.addToMessageMap(i,t);return this.exec("MSG_PLUGIN_REGISTERED",[t]),t.nIdx},disableMessage:function(e,t){this.oDisabledMessage[e]=t},registerBrowserEvent:function(e,t,i,n,o){n=n||[];var s=o?jindo.$Fn(this.delayedExec,this).bind(i,n,o):jindo.$Fn(this.exec,this).bind(i,n);return jindo.$Fn(s,this).attach(e,t)},run:function(e){this.htRunOptions=e||{},this._changeAppStatus(nhn.husky.APP_STATUS.WAITING_FOR_PLUGINS_READY);for(var t=this.messageQueue.length,i=0;t>i;i++){var n=this.messageQueue[i];this.exec(n.msg,n.args,n.event)}this._fnWaitForPluginReady()},acceptLocalBeforeFirstAgain:function(e,t){e._husky_bRun=!t},createMessageMap:function(e){this.oMessageMap[e]=[];for(var t=this.aPlugins.length,i=0;t>i;i++)this._doAddToMessageMap(e,this.aPlugins[i])},addToMessageMap:function(e,t){this.oMessageMap[e]&&this._doAddToMessageMap(e,t)},_changeAppStatus:function(e){this.appStatus=e,this.appStatus==nhn.husky.APP_STATUS.READY&&this.exec("MSG_APP_READY")},_execMsgStep:function(e,t,i){return(this._execMsgStep=this.htOptions.oDebugger?this._execMsgStepWithDebugger:this._execMsgStepWithoutDebugger).call(this,e,t,i)},_execMsgStepWithDebugger:function(e,t,i){this.htOptions.oDebugger.log_MessageStepStart(e,t,i);var n=this._execMsgHandler("$"+e+"_"+t,i);return this.htOptions.oDebugger.log_MessageStepEnd(e,t,i),n},_execMsgStepWithoutDebugger:function(e,t,i){return this._execMsgHandler("$"+e+"_"+t,i)},_execMsgHandler:function(e,i){var n;this.oMessageMap[e]||this.createMessageMap(e);var o=this.oMessageMap[e],s=o.length;if(0===s)return!0;var r=!0;if(t.test(e)){for(n=0;s>n;n++)if(this._execHandler(o[n],e,i)===!1){r=!1;break}}else for(n=0;s>n;n++)if((o[n]._husky_bRun||(o[n]._husky_bRun=!0,"function"!=typeof o[n].$LOCAL_BEFORE_FIRST||this._execHandler(o[n],"$LOCAL_BEFORE_FIRST",[e,i])!==!1))&&("function"!=typeof o[n].$LOCAL_BEFORE_ALL||this._execHandler(o[n],"$LOCAL_BEFORE_ALL",[e,i])!==!1)&&this._execHandler(o[n],e,i)===!1){r=!1;break}return r},_execHandler:function(e,t,i){return(this._execHandler=this.htOptions.oDebugger?this._execHandlerWithDebugger:this._execHandlerWithoutDebugger).call(this,e,t,i)},_execHandlerWithDebugger:function(e,t,i){this.htOptions.oDebugger.log_CallHandlerStart(e,t,i);var n;try{this.aCallerStack.push(e),n=e[t].apply(e,i),this.aCallerStack.pop()}catch(o){this.htOptions.oDebugger.handleException(o),n=!1}return this.htOptions.oDebugger.log_CallHandlerEnd(e,t,i),n},_execHandlerWithoutDebugger:function(e,t,i){this.aCallerStack.push(e);var n=e[t].apply(e,i);return this.aCallerStack.pop(),n},_doAddToMessageMap:function(e,t){if("function"==typeof t[e]){for(var i=this.oMessageMap[e],n=0,o=i.length;o>n;n++)if(this.oMessageMap[e][n]==t)return;this.oMessageMap[e][n]=t}},_waitForPluginReady:function(){for(var e=!0,t=0;t=r)return this.oLazyMessage[e]=null,void this.oApp.exec(e,t,i);var a=o[s];n[a]?this._loadLazyFiles(e,t,i,o,s+1):jindo.LazyLoading.load(nhn.husky.SE2M_Configuration.LazyLoad.sJsBaseURI+"/"+a,jindo.$Fn(function(e,t,i,o,s){var r=o[s];n[r]=1,this._loadLazyFiles(e,t,i,o,s+1)},this).bind(e,t,i,o,s),"utf-8")},registerLazyMessage:function(e,t){e=e||[],t=t||[];for(var i,n,o=0;i=e[o];o++)n=this.oLazyMessage[i],n?n.aFilenames=n.aFilenames.concat(t):this.oLazyMessage[i]={sMsg:i,aFilenames:t}}}),nhn.husky.HuskyCore._htLoadedFile={},nhn.husky.HuskyCore.addLoadedFile=function(e){n[e]=1},nhn.husky.HuskyCore.mixin=function(t,n,o,s){for(var r,a=[],l=0;r=i[l];l++)for(var h,d=0;h=r.aPlugins[d];d++)if(h instanceof t)a.push(h),"function"!=typeof h.$LOCAL_BEFORE_FIRST&&h.oApp.acceptLocalBeforeFirstAgain(h,!0);else if(h._$superClass===t){"function"!=typeof h.$LOCAL_BEFORE_FIRST&&h.oApp.acceptLocalBeforeFirstAgain(h,!0);for(var c in n)(o||!h.hasOwnProperty(c))&&(h[c]=n[c],e.test(c)&&h.oApp.addToMessageMap(c,h))}for(var c in n)if((o||!t.prototype.hasOwnProperty(c))&&(t.prototype[c]=n[c],e.test(c)))for(var h,d=0;h=a[d];d++)h.oApp.addToMessageMap(c,h)},nhn.husky.APP_STATUS={NOT_READY:0,WAITING_FOR_PLUGINS_READY:1,READY:2},nhn.husky.PLUGIN_STATUS={NOT_READY:0,READY:1}}(),"undefined"==typeof window.nhn&&(window.nhn={}),nhn.CurrentSelection_IE=function(){this.getCommonAncestorContainer=function(){try{return this._oSelection=this._document.selection,"Control"==this._oSelection.type?this._oSelection.createRange().item(0):this._oSelection.createRangeCollection().item(0).parentElement()}catch(e){return this._document.body}},this.isCollapsed=function(){return this._oSelection=this._document.selection,"None"==this._oSelection.type}},nhn.CurrentSelection_FF=function(){this.getCommonAncestorContainer=function(){return this._getSelection().commonAncestorContainer},this.isCollapsed=function(){var e=this._window.getSelection();return e.rangeCount<1?!0:e.getRangeAt(0).collapsed},this._getSelection=function(){try{return this._window.getSelection().getRangeAt(0)}catch(e){return this._document.createRange()}}},nhn.CurrentSelection=new(jindo.$Class({$init:function(){var e=jindo.$Agent().navigator();e.ie&&document.selection?nhn.CurrentSelection_IE.apply(this):nhn.CurrentSelection_FF.apply(this)},setWindow:function(e){this._window=e,this._document=e.document}})),nhn.W3CDOMRange=jindo.$Class({$init:function(e){this.reset(e)},reset:function(e){this._window=e,this._document=this._window.document,this.collapsed=!0,this.commonAncestorContainer=this._document.body,this.endContainer=this._document.body,this.endOffset=0,this.startContainer=this._document.body,this.startOffset=0,this.oBrowserSelection=new nhn.BrowserSelection(this._window),this.selectionLoaded=this.oBrowserSelection.selectionLoaded},cloneContents:function(){var e=this._document.createDocumentFragment(),t=this._document.createDocumentFragment(),i=this._getNodesInRange();if(i.length<1)return e;var n=this._constructClonedTree(i,t),o=t.firstChild;if(o)for(var s,r=o.firstChild;r;)s=r.nextSibling,e.appendChild(r),r=s;return n=this._splitTextEndNodes({oStartContainer:n.oStartContainer,iStartOffset:this.startOffset,oEndContainer:n.oEndContainer,iEndOffset:this.endOffset}),n.oStartContainer&&n.oStartContainer.previousSibling&&nhn.DOMFix.parentNode(n.oStartContainer).removeChild(n.oStartContainer.previousSibling),n.oEndContainer&&n.oEndContainer.nextSibling&&nhn.DOMFix.parentNode(n.oEndContainer).removeChild(n.oEndContainer.nextSibling),e},_constructClonedTree:function(e,t){var i=null,n=null,o=this.startContainer,s=this.endContainer,r=function(e,t,r){if(0>t)return t;var a=t-1,l=e[t].cloneNode(!1);for(e[t]==o&&(i=l),e[t]==s&&(n=l);a>=0&&nhn.DOMFix.parentNode(e[a])==e[t];)a=this._recurConstructClonedTree(e,a,l);return r.insertBefore(l,r.firstChild),a};return this._recurConstructClonedTree=r,e[e.length]=nhn.DOMFix.parentNode(e[e.length-1]),this._recurConstructClonedTree(e,e.length-1,t),{oStartContainer:i,oEndContainer:n}},cloneRange:function(){return this._copyRange(new nhn.W3CDOMRange(this._window))},_copyRange:function(e){return e.collapsed=this.collapsed,e.commonAncestorContainer=this.commonAncestorContainer,e.endContainer=this.endContainer,e.endOffset=this.endOffset,e.startContainer=this.startContainer,e.startOffset=this.startOffset,e._document=this._document,e},collapse:function(e){e?(this.endContainer=this.startContainer,this.endOffset=this.startOffset):(this.startContainer=this.endContainer,this.startOffset=this.endOffset),this._updateRangeInfo()},compareBoundaryPoints:function(e,t){switch(e){case nhn.W3CDOMRange.START_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,t.startContainer,t.startOffset);case nhn.W3CDOMRange.START_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,t.startContainer,t.startOffset);case nhn.W3CDOMRange.END_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,t.endContainer,t.endOffset);case nhn.W3CDOMRange.END_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,t.endContainer,t.endOffset)}},_findBody:function(e){if(!e)return null;for(;e;){if("BODY"==e.tagName)return e;e=nhn.DOMFix.parentNode(e)}return null},_compareEndPoint:function(e,t,i,n){return this.oBrowserSelection.compareEndPoints(e,t,i,n)},_getCommonAncestorContainer:function(e,t){e=e||this.startContainer,t=t||this.endContainer;for(var i=t;e;){for(;i;){if(e==i)return e;i=nhn.DOMFix.parentNode(i)}i=t,e=nhn.DOMFix.parentNode(e)}return this._document.body},deleteContents:function(){if(!this.collapsed){this._splitTextEndNodesOfTheRange();var e=this._getNodesInRange();if(!(e.length<1)){for(var t=e[0].previousSibling;t&&this._isBlankTextNode(t);)t=t.previousSibling;var i,n=-1;t||(i=nhn.DOMFix.parentNode(e[0]),n=0);for(var o=0;oe.nodeValue.length&&(t=e.nodeValue.length):t>nhn.DOMFix.childNodes(e).length&&(t=nhn.DOMFix.childNodes(e).length),t},setEnd:function(e,t,i,n){i||(t=this._endsNodeValidation(e,t)),this.endContainer=e,this.endOffset=t,n||(this.startContainer&&-1==this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)?this._updateRangeInfo():this.collapse(!1))},setEndAfter:function(e,t){if(!e)throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter");return"BODY"==e.tagName?void this.setEnd(e,nhn.DOMFix.childNodes(e).length,!0,t):void this.setEnd(nhn.DOMFix.parentNode(e),this._getPosIdx(e)+1,!0,t)},setEndBefore:function(e,t){if(!e)throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore");return"BODY"==e.tagName?void this.setEnd(e,0,!0,t):void this.setEnd(nhn.DOMFix.parentNode(e),this._getPosIdx(e),!0,t)},setStart:function(e,t,i,n){i||(t=this._endsNodeValidation(e,t)),this.startContainer=e,this.startOffset=t,n||(this.endContainer&&-1==this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)?this._updateRangeInfo():this.collapse(!0))},setStartAfter:function(e,t){if(!e)throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter");return"BODY"==e.tagName?void this.setStart(e,nhn.DOMFix.childNodes(e).length,!0,t):void this.setStart(nhn.DOMFix.parentNode(e),this._getPosIdx(e)+1,!0,t)},setStartBefore:function(e,t){if(!e)throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore");return"BODY"==e.tagName?void this.setStart(e,0,!0,t):void this.setStart(nhn.DOMFix.parentNode(e),this._getPosIdx(e),!0,t)},surroundContents:function(e){e.appendChild(this.extractContents()),this.insertNode(e),this.selectNode(e)},toString:function(){var e=this._document.createElement("DIV");return e.appendChild(this.cloneContents()),e.textContent||e.innerText||""},fixCommonAncestorContainer:function(){jindo.$Agent().navigator().ie&&(this.commonAncestorContainer=this._getCommonAncestorContainer())},_isBlankTextNode:function(e){return 3==e.nodeType&&""==e.nodeValue?!0:!1},_isAllChildBlankText:function(e){for(var t=0,i=e.childNodes.length;i>t;t++)if(!this._isBlankTextNode(e.childNodes[t]))return!1;return!0},_getPosIdx:function(e){for(var t=0,i=e.previousSibling;i;i=i.previousSibling)t++;return t},_updateRangeInfo:function(){return this.startContainer?(this.collapsed=this.oBrowserSelection.isCollapsed(this)||this.startContainer===this.endContainer&&this.startOffset===this.endOffset,void(this.commonAncestorContainer=this.oBrowserSelection.getCommonAncestorContainer(this))):void this.reset(this._window)},_isCollapsed:function(e,t,i,n){var o=!1;if(e==i&&t==n)o=!0;else{var s=this._getActualStartNode(e,t),r=this._getActualEndNode(i,n);s=this._getNextNode(this._getPrevNode(s)),r=this._getPrevNode(this._getNextNode(r)),s&&r&&"BODY"!=r.tagName&&(this._getNextNode(r)==s||r==s&&this._isBlankTextNode(r))&&(o=!0)}return o},_splitTextEndNodesOfTheRange:function(){var e=this._splitTextEndNodes({oStartContainer:this.startContainer,iStartOffset:this.startOffset,oEndContainer:this.endContainer,iEndOffset:this.endOffset});this.startContainer=e.oStartContainer,this.startOffset=e.iStartOffset,this.endContainer=e.oEndContainer,this.endOffset=e.iEndOffset},_splitTextEndNodes:function(e){return e=this._splitStartTextNode(e),e=this._splitEndTextNode(e)},_splitStartTextNode:function(e){var t=e.oStartContainer,i=e.iStartOffset,n=e.oEndContainer,o=e.iEndOffset;if(!t)return e;if(3!=t.nodeType)return e;if(0===i)return e;if(t.nodeValue.length<=i)return e;var s=t.splitText(i);return t==n&&(o-=i,n=s),t=s,i=0,{oStartContainer:t,iStartOffset:i,oEndContainer:n,iEndOffset:o}},_splitEndTextNode:function(e){var t=e.oStartContainer,i=e.iStartOffset,n=e.oEndContainer,o=e.iEndOffset;return n?3!=n.nodeType?e:o>=n.nodeValue.length?e:0===o?e:(n.splitText(o),{oStartContainer:t,iStartOffset:i,oEndContainer:n,iEndOffset:o}):e},_getNodesInRange:function(){if(this.collapsed)return[];var e=this._getActualStartNode(this.startContainer,this.startOffset),t=this._getActualEndNode(this.endContainer,this.endOffset);return this._getNodesBetween(e,t)},_getActualStartNode:function(e,t){var i=e;return 3==e.nodeType?t>=e.nodeValue.length?(i=this._getNextNode(e),"BODY"==i.tagName&&(i=null)):i=e:t)$/i,_rxTextAlign:/text-align:[^"';]*;?/i,setWindow:function(e){this.reset(e||window)},$init:function(e){this.HUSKY_BOOMARK_START_ID_PREFIX="husky_bookmark_start_",this.HUSKY_BOOMARK_END_ID_PREFIX="husky_bookmark_end_",this.sBlockElement="P|DIV|LI|H[1-6]|PRE",this.sBlockContainer="BODY|TABLE|TH|TR|TD|UL|OL|BLOCKQUOTE|FORM",this.rxBlockElement=new RegExp("^("+this.sBlockElement+")$"),this.rxBlockContainer=new RegExp("^("+this.sBlockContainer+")$"),this.rxLineBreaker=new RegExp("^("+this.sBlockElement+"|"+this.sBlockContainer+")$"),this.rxHasBlock=new RegExp("(?:<(?:"+this.sBlockElement+"|"+this.sBlockContainer+").*?>|style=[\"']?[^>]*?(?:displays?:s?block)[^>]*?[\"']?)","gi"),this.setWindow(e)},select:function(){try{this.oBrowserSelection.selectRange(this)}catch(e){}},setFromSelection:function(e){this.setRange(this.oBrowserSelection.getRangeAt(e),!0)},setRange:function(e,t){this.reset(this._window),this.setStart(e.startContainer,e.startOffset,t,!0),this.setEnd(e.endContainer,e.endOffset,t)},setEndNodes:function(e,t){this.reset(this._window),this.setEndAfter(t,!0),this.setStartBefore(e)},splitTextAtBothEnds:function(){this._splitTextEndNodesOfTheRange()},getStartNode:function(){return this.collapsed?3==this.startContainer.nodeType?0===this.startOffset?null:this.startContainer.nodeValue.length<=this.startOffset?null:this.startContainer:null:3==this.startContainer.nodeType?this.startOffset>=this.startContainer.nodeValue.length?this._getNextNode(this.startContainer):this.startContainer:this.startOffset>=nhn.DOMFix.childNodes(this.startContainer).length?this._getNextNode(this.startContainer):nhn.DOMFix.childNodes(this.startContainer)[this.startOffset]},getEndNode:function(){return this.collapsed?this.getStartNode():3==this.endContainer.nodeType?0===this.endOffset?this._getPrevNode(this.endContainer):this.endContainer:0===this.endOffset?this._getPrevNode(this.endContainer):nhn.DOMFix.childNodes(this.endContainer)[this.endOffset-1]},getNodeAroundRange:function(e,t){if(!this.collapsed)return this.getStartNode();if(this.startContainer&&3==this.startContainer.nodeType)return this.startContainer;var i,n,o;return n=this.startOffset>=nhn.DOMFix.childNodes(this.startContainer).length?this._getNextNode(this.startContainer):nhn.DOMFix.childNodes(this.startContainer)[this.startOffset],i=0===this.endOffset?this._getPrevNode(this.endContainer):nhn.DOMFix.childNodes(this.endContainer)[this.endOffset-1],e?(o=i,o||t||(o=n)):(o=n,o||t||(o=i)),o},_getXPath:function(e){for(var t="";e&&1==e.nodeType;)t="/"+e.tagName+"["+this._getPosIdx4XPath(e)+"]"+t,e=nhn.DOMFix.parentNode(e);return t},_getPosIdx4XPath:function(e){for(var t=0,i=e.previousSibling;i;i=i.previousSibling)i.tagName==e.tagName&&t++;return t},_evaluateXPath:function(e,t){e=e.substring(1,e.length-1);for(var i=e.split(/\//),n=t.body,o=2;oc;c++)a[c].tagName==s&&(l[d++]=a[c]);n=l.length-1&&o){for(var s=nhn.DOMFix.childNodes(o),r=null,a=i,l=n;(r=s[a])&&3==r.nodeType&&r.nodeValue.length=i&&s>=0?!0:t?1==n?!1:-1==o?!1:!0:!1},isNodeInRange:function(e,t,i){var n=new nhn.HuskyRange(this._window);return i&&e.firstChild?(n.setStartBefore(e.firstChild),n.setEndAfter(e.lastChild)):n.selectNode(e),this.isRangeInRange(n,t)},pasteText:function(e){this.pasteHTML(e.replace(/&/g,"&").replace(//g,">").replace(/ /g," ").replace(/"/g,"""))},pasteHTML:function(e){var t=this._document.createElement("DIV");if(t.innerHTML=e,!t.firstChild)return void this.deleteContents();var i=this.cloneRange(),n=i.placeStringBookmark(),o=i.getLineInfo(),s=o.oStart,r=o.oEnd;if(s.oLineBreaker&&"P"===s.oLineBreaker.nodeName&&i.rxHasBlock.test(e)){i.deleteContents();var a=s.oLineBreaker.parentNode,l=s.oLineBreaker.nextSibling;if(s.oLineBreaker===r.oLineBreaker){var h=i.getStringBookmark(n);i.setEndNodes(h,r.oLineBreaker);var d=i.extractContents();l?a.insertBefore(d,l):a.appendChild(d),l=s.oLineBreaker.nextSibling}t.style.cssText=s.oLineBreaker.style.cssText.replace(this._rxTextAlign,""),t.align=s.oLineBreaker.align,l?a.insertBefore(t,l):a.appendChild(t),i.removeStringBookmark(n),this._removeEmptyP(this._getPrevElement(t));var c=this._getNextElement(t);if(c){var p=this._getNextElement(c);p&&(this._removeEmptyP(c),c=p)}else c=this._document.createElement("P"),c.style.cssText=s.oLineBreaker.style.cssText,c.align=s.oLineBreaker.align,c.innerHTML="\ufeff",a.appendChild(c);this.selectNodeContents(c),this.collapseToStart()}else{var _=t.firstChild,E=t.lastChild;for(this.collapseToStart();t.lastChild;)this.insertNode(t.lastChild);this.setEndNodes(_,E),i.moveToBookmark(n),i.deleteContents(),i.removeStringBookmark(n)}},_removeEmptyP:function(e){if(e&&"P"===e.nodeName){var t=e.innerHTML;(""===t||this._rxCursorHolder.test(t))&&e.parentNode.removeChild(e)}},_getSiblingElement:function(e,t){if(!e)return null;var i=e[t?"previousSibling":"nextSibling"];return i&&1===i.nodeType?i:arguments.callee(i,t)},_getPrevElement:function(e){return this._getSiblingElement(e,!0)},_getNextElement:function(e){return this._getSiblingElement(e,!1)},toString:function(){return this.toString=nhn.W3CDOMRange.prototype.toString,this.toString()},toHTMLString:function(){var e=this._document.createElement("DIV");return e.appendChild(this.cloneContents()),e.innerHTML},findAncestorByTagName:function(e){for(var t=this.commonAncestorContainer;t&&t.tagName!=e;)t=nhn.DOMFix.parentNode(t);return t},selectNodeContents:function(e){if(e){var t=e.firstChild?e.firstChild:e,i=e.lastChild?e.lastChild:e;this.reset(this._window),3==t.nodeType?this.setStart(t,0,!0):this.setStartBefore(t),3==i.nodeType?this.setEnd(i,i.nodeValue.length,!0):this.setEndAfter(i)}},_hasTextDecoration:function(e,t){return e&&e.style?e.style.textDecoration.indexOf(t)>-1?!0:"underline"===t&&"U"===e.tagName?!0:"line-through"!==t||"S"!==e.tagName&&"STRIKE"!==e.tagName?!1:!0:!1},_setTextDecoration:function(e,t){jindo.$Agent().navigator().firefox?e.style.textDecoration=e.style.textDecoration?e.style.textDecoration+" "+t:t:"underline"===t?e.innerHTML=""+e.innerHTML+"":"line-through"===t&&(e.innerHTML=""+e.innerHTML+"")},_checkTextDecoration:function(e){if("SPAN"===e.tagName){var t=!1,i=!1,n=null;for(oChildNode=e.firstChild;oChildNode;){if(1===oChildNode.nodeType&&(t=t||"U"===oChildNode.tagName,i=i||"S"===oChildNode.tagName||"STRIKE"===oChildNode.tagName),t&&i)return;oChildNode=oChildNode.nextSibling}for(n=nhn.DOMFix.parentNode(e);n&&"BODY"!==n.tagName;)if(1===n.nodeType){if(!t&&this._hasTextDecoration(n,"underline")&&(t=!0,this._setTextDecoration(e,"underline")),!i&&this._hasTextDecoration(n,"line-through")&&(i=!0,this._setTextDecoration(e,"line-through")),t&&i)return;n=nhn.DOMFix.parentNode(n)}else n=nhn.DOMFix.parentNode(n)}},styleRange:function(e,t,i,n,o){var s=this.aStyleParents=this._getStyleParentNodes(i,n);if(!(s.length<1)){for(var r,a,l=0;lp;p++)if(i=r[p])if(t&&"LI"==i.tagName&&this._isFullyContained(i,d))a[l++]=i;else if(3==i.nodeType&&""!=i.nodeValue&&!i.nodeValue.match(/^(\r|\n)+$/)){var _=nhn.DOMFix.parentNode(i);if("SPAN"==_.tagName){if(this._isFullyContained(_,d,i)){a[l++]=_;continue}}else{var E=this._findParentSingleSpan(_);if(E){a[l++]=E;continue}}n=this._document.createElement("SPAN"),_.insertBefore(n,i),n.appendChild(i),a[l++]=n,e&&n.setAttribute(e,"true")}return this.setStartBefore(o),this.setEndAfter(s),a},_findParentSingleSpan:function(e){if(!e)return null;for(var t,i,n=0,o=0,s=e.childNodes;i=s[n];n++)if(t=i.nodeValue,!this._rxCursorHolder.test(t)&&(o++,o>1))return null;return"SPAN"===e.nodeName?e:this._findParentSingleSpan(e.parentNode)},_isFullyContained:function(e,t,i){var n,o,s=this._getVeryFirstRealChild(e);return n=i&&s==i?1:t.indexOf(s),-1!=n&&(s=this._getVeryLastRealChild(e),o=i&&s==i?1:t.indexOf(s)),-1!=n&&-1!=o},_getVeryFirstChild:function(e){return e.firstChild?this._getVeryFirstChild(e.firstChild):e},_getVeryLastChild:function(e){return e.lastChild?this._getVeryLastChild(e.lastChild):e},_getFirstRealChild:function(e){for(var t=e.firstChild;t&&3==t.nodeType&&""==t.nodeValue;)t=t.nextSibling;return t},_getLastRealChild:function(e){for(var t=e.lastChild;t&&3==t.nodeType&&""==t.nodeValue;)t=t.previousSibling;return t},_getVeryFirstRealChild:function(e){var t=this._getFirstRealChild(e);return t?this._getVeryFirstRealChild(t):e},_getVeryLastRealChild:function(e){var t=this._getLastRealChild(e);return t?this._getVeryLastChild(t):e},_getLineStartInfo:function(e){function t(e){if(e&&!n){if(a.test(e.tagName))return s=e,n=o,void(r=!0);o=e,i(e.previousSibling),n||t(nhn.DOMFix.parentNode(e))}}function i(e){if(e&&!n){if(a.test(e.tagName))return s=e,n=o,void(r=!1);if(e.firstChild&&"TABLE"!=e.tagName)for(var t=e.lastChild;t&&!n;)i(t),t=t.previousSibling;else o=e;n||i(e.previousSibling)}}var n=null,o=e,s=e,r=!1,a=this.rxLineBreaker;return a.test(e.tagName)?n=e:t(e),{oNode:n,oLineBreaker:s,bParentBreak:r}},_getLineEndInfo:function(e){function t(e){if(e&&!n){if(a.test(e.tagName))return s=e,n=o,void(r=!0);o=e,i(e.nextSibling),n||t(nhn.DOMFix.parentNode(e))}}function i(e){if(e&&!n){if(a.test(e.tagName))return s=e,n=o,void(r=!1);if(e.firstChild&&"TABLE"!=e.tagName)for(var t=e.firstChild;t&&!n;)i(t),t=t.nextSibling;else o=e;n||i(e.nextSibling)}}var n=null,o=e,s=e,r=!1,a=this.rxLineBreaker;return a.test(e.tagName)?n=e:t(e),{oNode:n,oLineBreaker:s,bParentBreak:r}},getLineInfo:function(e){var e=e||!1,t=this.getStartNode(),i=this.getEndNode();t||(t=this.getNodeAroundRange(!e,!0)),i||(i=this.getNodeAroundRange(!e,!0));var n=this._getLineStartInfo(t),o=n.oNode,s=this._getLineEndInfo(i),r=s.oNode;if(t!=o||i!=r){var a=this._compareEndPoint(nhn.DOMFix.parentNode(o),this._getPosIdx(o),this.endContainer,this.endOffset),l=this._compareEndPoint(nhn.DOMFix.parentNode(r),this._getPosIdx(r)+1,this.startContainer,this.startOffset);0>=a&&l>=0||(t=this.getNodeAroundRange(!1,!0),i=this.getNodeAroundRange(!1,!0),n=this._getLineStartInfo(t),s=this._getLineEndInfo(i))}return{oStart:n,oEnd:s}},_findSingleChild:function(e){if(!e)return null;for(var t,i,n=null,o=0,s=0,r=e.childNodes;i=r[o];o++)if(t=i.nodeValue,!this._rxCursorHolder.test(t)&&(n=i,s++,s>1))return null;return n},_hasCursorHolderOnly:function(e){return e&&1===e.nodeType?this._rxCursorHolder.test(e.innerHTML)?!0:this._hasCursorHolderOnly(this._findSingleChild(e)):!1}}).extend(nhn.W3CDOMRange),nhn.BrowserSelection=function(e){this.init=function(e){this._window=e||window,this._document=this._window.document},this.init(e),this._document.createRange?nhn.BrowserSelectionImpl_FF.apply(this):nhn.BrowserSelectionImpl_IE.apply(this),this.selectRange=function(e){this.selectNone(),this.addRange(e)},this.selectionLoaded=!0,this._oSelection||(this.selectionLoaded=!1)},nhn.BrowserSelectionImpl_FF=function(){this._oSelection=this._window.getSelection(),this.getRangeAt=function(e){e=e||0;try{var t=this._oSelection.getRangeAt(e)}catch(i){return new nhn.W3CDOMRange(this._window)}return this._FFRange2W3CRange(t)},this.addRange=function(e){var t=this._W3CRange2FFRange(e);this._oSelection.addRange(t)},this.selectNone=function(){this._oSelection.removeAllRanges()},this.getCommonAncestorContainer=function(e){var t=this._W3CRange2FFRange(e);return t.commonAncestorContainer},this.isCollapsed=function(e){var t=this._W3CRange2FFRange(e);return t.collapsed},this.compareEndPoints=function(e,t,i,n){var o=this._document.createRange(),s=this._document.createRange();o.setStart(e,t),s.setStart(i,n),o.collapse(!0),s.collapse(!0);try{return o.compareBoundaryPoints(1,s)}catch(r){return 1}},this._FFRange2W3CRange=function(e){var t=new nhn.W3CDOMRange(this._window);return t.setStart(e.startContainer,e.startOffset,!0),t.setEnd(e.endContainer,e.endOffset,!0),t},this._W3CRange2FFRange=function(e){var t=this._document.createRange();return t.setStart(e.startContainer,e.startOffset),t.setEnd(e.endContainer,e.endOffset),t}},nhn.BrowserSelectionImpl_IE=function(){this._oSelection=this._document.selection,this.oLastRange={oBrowserRange:null,elStartContainer:null,nStartOffset:-1,elEndContainer:null,nEndOffset:-1},this._updateLastRange=function(e,t){this.oLastRange.oBrowserRange=e,this.oLastRange.elStartContainer=t.startContainer,this.oLastRange.nStartOffset=t.startOffset,this.oLastRange.elEndContainer=t.endContainer,this.oLastRange.nEndOffset=t.endOffset},this.getRangeAt=function(e){e=e||0;var t,i;if("Control"==this._oSelection.type){t=new nhn.W3CDOMRange(this._window);var n=this._oSelection.createRange().item(e);return n&&n.ownerDocument==this._document?(t.selectNode(n),t):t}i=this._oSelection.createRange();var n=i.parentElement();return t=n&&n.ownerDocument==this._document?this._IERange2W3CRange(i):new nhn.W3CDOMRange(this._window)},this.addRange=function(e){var t=this._W3CRange2IERange(e);t.select()},this.selectNone=function(){this._oSelection.empty()},this.getCommonAncestorContainer=function(e){return this._W3CRange2IERange(e).parentElement()},this.isCollapsed=function(e){var t=this._W3CRange2IERange(e),i=t.duplicate();return i.collapse(),t.isEqual(i)},this.compareEndPoints=function(e,t,i,n){var o,s;return e===this.oLastRange.elStartContainer&&t===this.oLastRange.nStartOffset?(o=this.oLastRange.oBrowserRange.duplicate(),o.collapse(!0)):e===this.oLastRange.elEndContainer&&t===this.oLastRange.nEndOffset?(o=this.oLastRange.oBrowserRange.duplicate(),o.collapse(!1)):o=this._getIERangeAt(e,t),i===this.oLastRange.elStartContainer&&n===this.oLastRange.nStartOffset?(s=this.oLastRange.oBrowserRange.duplicate(),s.collapse(!0)):i===this.oLastRange.elEndContainer&&n===this.oLastRange.nEndOffset?(s=this.oLastRange.oBrowserRange.duplicate(),s.collapse(!1)):s=this._getIERangeAt(i,n),o.compareEndPoints("StartToStart",s)},this._W3CRange2IERange=function(e){if(this.oLastRange.elStartContainer===e.startContainer&&this.oLastRange.nStartOffset===e.startOffset&&this.oLastRange.elEndContainer===e.endContainer&&this.oLastRange.nEndOffset===e.endOffset)return this.oLastRange.oBrowserRange;var t=this._getIERangeAt(e.startContainer,e.startOffset),i=this._getIERangeAt(e.endContainer,e.endOffset);return t.setEndPoint("EndToEnd",i),this._updateLastRange(t,e),t},this._getIERangeAt=function(e,t){var i=this._document.body.createTextRange(),n=this._getSelectableNodeAndOffsetForIE(e,t),o=n.oSelectableNodeForIE,s=n.iOffsetForIE;return i.moveToElementText(o),i.collapse(n.bCollapseToStart),i.moveStart("character",s),i},this._getSelectableNodeAndOffsetForIE=function(e,t){var i=null,n=null,o=0;3==e.nodeType?(i=nhn.DOMFix.parentNode(e),n=nhn.DOMFix.childNodes(i),o=n.length):(i=e,n=nhn.DOMFix.childNodes(i),o=tl;l++)if(s=n[l],3==s.nodeType){if(s==e)break;r+=s.nodeValue.length}else i=s,r=0,a=!1;return 3==e.nodeType&&(r+=t),{oSelectableNodeForIE:i,iOffsetForIE:r,bCollapseToStart:a}},this._IERange2W3CRange=function(e){var t=new nhn.W3CDOMRange(this._window),i=null,n=null;i=e.duplicate(),i.collapse(!0),n=this._getW3CContainerAndOffset(i,!0),t.setStart(n.oContainer,n.iOffset,!0,!0);var o=e.duplicate();return o.collapse(!0),o.isEqual(e)?t.collapse(!0):(i=e.duplicate(),i.collapse(!1),n=this._getW3CContainerAndOffset(i),t.setEnd(n.oContainer,n.iOffset,!0)),this._updateLastRange(e,t),t},this._getW3CContainerAndOffset=function(e,t){for(var i=e,n=i.parentElement(),o=-1,s=this._document.body.createTextRange(),r=nhn.DOMFix.childNodes(n),a=null,l=0,h=0;h=0)break;a=r[h]}var l=h;if(0!==l&&3==r[l-1].nodeType){var d=this._document.body.createTextRange(),c=null;a?(d.moveToElementText(a),d.collapse(!1),c=a.nextSibling):(d.moveToElementText(n),d.collapse(!0),c=n.firstChild);var p=i.duplicate();p.setEndPoint("StartToStart",d);for(var _=p.text.replace(/[\r\n]/g,"").length;_>c.nodeValue.length&&c.nextSibling;)_-=c.nodeValue.length,c=c.nextSibling;c.nodeValue;t&&c.nextSibling&&3==c.nextSibling.nodeType&&_==c.nodeValue.length&&(_-=c.nodeValue.length,c=c.nextSibling),n=c,o=_}else n=i.parentElement(),o=l;return{oContainer:n,iOffset:o}}},nhn.DOMFix=new(jindo.$Class({$init:function(){jindo.$Agent().navigator().ie||jindo.$Agent().navigator().opera?(this.childNodes=this._childNodes_Fix,this.parentNode=this._parentNode_Fix):(this.childNodes=this._childNodes_Native,this.parentNode=this._parentNode_Native)},_parentNode_Native:function(e){return e.parentNode},_parentNode_Fix:function(e){if(!e)return e;for(;e.previousSibling;)e=e.previousSibling;return e.parentNode},_childNodes_Native:function(e){return e.childNodes},_childNodes_Fix:function(e){var t=null,i=0;if(e){var t=[];for(e=e.firstChild;e;)t[i++]=e,e=e.nextSibling}return t}})),nhn.husky.CorePlugin=jindo.$Class({name:"CorePlugin",htLazyLoadRequest_plugins:{},htLazyLoadRequest_allFiles:{},htHTMLLoaded:{},$AFTER_MSG_APP_READY:function(){this.oApp.exec("EXEC_ON_READY_FUNCTION",[])},$ON_ADD_APP_PROPERTY:function(e,t){this.oApp[e]=t},$ON_REGISTER_BROWSER_EVENT:function(e,t,i,n,o){this.oApp.registerBrowserEvent(e,t,i,n,o)},$ON_DISABLE_MESSAGE:function(e){this.oApp.disableMessage(e,!0)},$ON_ENABLE_MESSAGE:function(e){this.oApp.disableMessage(e,!1)},$ON_LOAD_FULL_PLUGIN:function(e,t,i,n,o){var s=(n.$this||n,e[0]);this.htLazyLoadRequest_plugins[s]||(this.htLazyLoadRequest_plugins[s]={nStatus:1,sContents:""}),2===this.htLazyLoadRequest_plugins[s].nStatus?this.oApp.exec("MSG_FULL_PLUGIN_LOADED",[s,t,i,n,o,!1]):this._loadFullPlugin(e,t,i,n,o,0)},_loadFullPlugin:function(e,t,i,n,o,s){jindo.LazyLoading.load(nhn.husky.SE2M_Configuration.LazyLoad.sJsBaseURI+"/"+e[s],jindo.$Fn(function(e,t,i,n,o,s){var r=(e[s],e[0]);return s==e.length-1?(this.htLazyLoadRequest_plugins[r].nStatus=2,void this.oApp.exec("MSG_FULL_PLUGIN_LOADED",[e,t,i,n,o])):void this._loadFullPlugin(e,t,i,n,o,s+1)},this).bind(e,t,i,n,o,s),"utf-8")},$ON_MSG_FULL_PLUGIN_LOADED:function(aFilenames,sClassName,sMsgName,oThisRef,oArguments,oRes){for(var oPluginRef=oThisRef.$this||oThisRef,sFilename=aFilenames,i=0,nLen=oThisRef._huskyFLT.length;nLen>i;i++){var sLoaderHandlerName="$BEFORE_"+oThisRef._huskyFLT[i],oRemoveFrom=oThisRef.$this&&oThisRef[sLoaderHandlerName]?oThisRef:oPluginRef;oRemoveFrom[sLoaderHandlerName]=null,this.oApp.createMessageMap(sLoaderHandlerName)}var oPlugin=eval(sClassName+".prototype"),bAcceptLocalBeforeFirstAgain=!1;"function"!=typeof oPluginRef.$LOCAL_BEFORE_FIRST&&this.oApp.acceptLocalBeforeFirstAgain(oPluginRef,!0);for(var x in oPlugin)oThisRef.$this&&(!oThisRef[x]||"function"==typeof oPlugin[x]&&"constructor"!=x)&&(oThisRef[x]=jindo.$Fn(oPlugin[x],oPluginRef).bind()),oPlugin[x]&&(!oPluginRef[x]||"function"==typeof oPlugin[x]&&"constructor"!=x)&&(oPluginRef[x]=oPlugin[x],x.match(/^\$(LOCAL|BEFORE|ON|AFTER)_/)&&this.oApp.addToMessageMap(x,oPluginRef));bAcceptLocalBeforeFirstAgain&&this.oApp.acceptLocalBeforeFirstAgain(oPluginRef,!0),oThisRef.$this||this.oApp.exec(sMsgName,oArguments)},$ON_LOAD_HTML:function(e){if(!this.htHTMLLoaded[e]){var t=jindo.$("_llh_"+e);if(t){this.htHTMLLoaded[e]=!0;var i=document.createElement("DIV");for(i.innerHTML=t.value;i.firstChild;)t.parentNode.insertBefore(i.firstChild,t)}}},$ON_EXEC_ON_READY_FUNCTION:function(){"function"==typeof this.oApp.htRunOptions.fnOnAppReady&&this.oApp.htRunOptions.fnOnAppReady()}}),nhn.husky.HuskyRangeManager=jindo.$Class({name:"HuskyRangeManager",oWindow:null,$init:function(e){this.oWindow=e||window},$BEFORE_MSG_APP_READY:function(){this.oWindow&&"IFRAME"==this.oWindow.tagName&&(this.oWindow=this.oWindow.contentWindow,nhn.CurrentSelection.setWindow(this.oWindow)),this.oApp.exec("ADD_APP_PROPERTY",["getSelection",jindo.$Fn(this.getSelection,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getEmptySelection",jindo.$Fn(this.getEmptySelection,this).bind()])},$ON_SET_EDITING_WINDOW:function(e){this.oWindow=e},getEmptySelection:function(e){var t=new nhn.HuskyRange(e||this.oWindow);return t},getSelection:function(e){this.oApp.exec("RESTORE_IE_SELECTION",[]);var t=this.getEmptySelection(e);try{t.setFromSelection()}catch(i){}return t}}),nhn.husky.SE2M_Toolbar=jindo.$Class({name:"SE2M_Toolbar",toolbarArea:null,toolbarButton:null,uiNameTag:"uiName",nUIStatus:1,sUIClassPrefix:"husky_seditor_ui_",aUICmdMap:null,elFirstToolbarItem:null,_assignHTMLElements:function(e){e=jindo.$(e)||document,this.rxUI=new RegExp(this.sUIClassPrefix+"([^ ]+)"),this.toolbarArea=jindo.$$.getSingle(".se2_tool",e),this.aAllUI=jindo.$$("[class*="+this.sUIClassPrefix+"]",this.toolbarArea),this.elTextTool=jindo.$$.getSingle("div.husky_seditor_text_tool",this.toolbarArea),this.welToolbarArea=jindo.$Element(this.toolbarArea);for(var t=0,i=this.aAllUI.length;i>t;t++)if(this.rxUI.test(this.aAllUI[t].className)){var n=RegExp.$1;if(void 0!==this.htUIList[n])continue;this.htUIList[n]=this.aAllUI[t],this.htWrappedUIList[n]=jindo.$Element(this.htUIList[n])}null!=jindo.$$.getSingle("DIV.se2_icon_tool")&&(this.elFirstToolbarItem=jindo.$$.getSingle("DIV.se2_icon_tool UL.se2_itool1>li>button"))},$LOCAL_BEFORE_FIRST:function(e){var t=jindo.$$(">ul>li[class*="+this.sUIClassPrefix+"]>button",this.elTextTool),i=t.length;this.elFirstToolbarItem=this.elFirstToolbarItem||t[0],this.elLastToolbarItem=t[i-1],this.oApp.registerBrowserEvent(this.toolbarArea,"keydown","NAVIGATE_TOOLBAR",[])},$init:function(e,t){this._htOptions=t||{},this.htUIList={},this.htWrappedUIList={},this.aUICmdMap={},this._assignHTMLElements(e)},$ON_MSG_APP_READY:function(){this.oApp.bMobile?this.oApp.registerBrowserEvent(this.toolbarArea,"touchstart","EVENT_TOOLBAR_TOUCHSTART"):(this.oApp.registerBrowserEvent(this.toolbarArea,"mouseover","EVENT_TOOLBAR_MOUSEOVER"),this.oApp.registerBrowserEvent(this.toolbarArea,"mouseout","EVENT_TOOLBAR_MOUSEOUT")),this.oApp.registerBrowserEvent(this.toolbarArea,"mousedown","EVENT_TOOLBAR_MOUSEDOWN"),this.oApp.exec("ADD_APP_PROPERTY",["getToolbarButtonByUIName",jindo.$Fn(this.getToolbarButtonByUIName,this).bind()]);var e=jindo.$$.getSingle(".se2_tool");this.oApp.exec("REGISTER_HOTKEY",["esc","FOCUS_EDITING_AREA",[],e]),this._htOptions.aDisabled&&(this._htOptions._sDisabled=","+this._htOptions.aDisabled.toString()+",",this.oApp.exec("DISABLE_UI",[this._htOptions.aDisabled]))},$ON_NAVIGATE_TOOLBAR:function(e){var t=9;e.element==this.elLastToolbarItem&&e.key().keyCode==t&&(e.key().shift||(this.elFirstToolbarItem.focus(),e.stopDefault())),e.element==this.elFirstToolbarItem&&e.key().keyCode==t&&e.key().shift&&(e.stopDefault(),this.elLastToolbarItem.focus())},$ON_FOCUS_EDITING_AREA:function(){this.oApp.exec("FOCUS")},$ON_TOGGLE_TOOLBAR_ACTIVE_LAYER:function(e,t,i,n,o,s){this.oApp.exec("TOGGLE_ACTIVE_LAYER",[e,"MSG_TOOLBAR_LAYER_SHOWN",[e,t,i,n],o,s])},$ON_MSG_TOOLBAR_LAYER_SHOWN:function(e,t,i,n){this.oApp.exec("POSITION_TOOLBAR_LAYER",[e,t]),i&&this.oApp.exec(i,n)},$ON_SHOW_TOOLBAR_ACTIVE_LAYER:function(e,t,i,n){this.oApp.exec("SHOW_ACTIVE_LAYER",[e,t,i]),this.oApp.exec("POSITION_TOOLBAR_LAYER",[e,n])},$ON_ENABLE_UI:function(e){this._enableUI(e)},$ON_DISABLE_UI:function(e){if(e instanceof Array)for(var t,i=0;t=e[i];i++)this._disableUI(t);else this._disableUI(e)},$ON_SELECT_UI:function(e){var t=this.htWrappedUIList[e];t&&(t.removeClass("hover"),t.addClass("active"))},$ON_DESELECT_UI:function(e){var t=this.htWrappedUIList[e];t&&t.removeClass("active")},$ON_TOGGLE_UI_SELECTED:function(e){var t=this.htWrappedUIList[e];t&&(t.hasClass("active")?t.removeClass("active"):(t.removeClass("hover"),t.addClass("active")))},$ON_ENABLE_ALL_UI:function(e){if(1!==this.nUIStatus){var t;e=e||{};var i=jindo.$A(e.aExceptions||[]);for(t in this.htUIList)t&&!i.has(t)&&this._enableUI(t);this.nUIStatus=1}},$ON_DISABLE_ALL_UI:function(e){if(2!==this.nUIStatus){var t;e=e||{};var i=jindo.$A(e.aExceptions||[]),n=e.bLeaveActiveLayer||!1;n||this.oApp.exec("HIDE_ACTIVE_LAYER");for(t in this.htUIList)t&&!i.has(t)&&this._disableUI(t);this.nUIStatus=2}},$ON_MSG_STYLE_CHANGED:function(e,t){"@^"===t?this.oApp.exec("SELECT_UI",[e]):this.oApp.exec("DESELECT_UI",[e])},$ON_POSITION_TOOLBAR_LAYER:function(e,t){var i,n,o,s;e=jindo.$(e),t=t||{};var r=jindo.$(t.elBtn),a=t.sAlign,l=-1;if(e){r&&r.tagName&&"BUTTON"==r.tagName&&r.parentNode.appendChild(e);var h=jindo.$Element(e);"right"!=a?(e.style.left="0",i=h.offset().left,n=i+e.offsetWidth,o=this.welToolbarArea.offset().left,s=o+this.toolbarArea.offsetWidth,n>s&&h.css("left",s-n-l+"px"),o>i&&h.css("left",o-i+l+"px")):(e.style.right="0",i=h.offset().left,n=i+e.offsetWidth,o=this.welToolbarArea.offset().left,s=o+this.toolbarArea.offsetWidth,n>s&&h.css("right",-1*(s-n-l)+"px"),o>i&&h.css("right",-1*(o-i+l)+"px"))}},$ON_EVENT_TOOLBAR_MOUSEOVER:function(e){if(2!==this.nUIStatus)for(var t=this._getAffectedElements(e.element),i=0;i2||t.parentNode.className.match(/se2_pair/)))return;t=t.parentNode}this.oApp.exec("HIDE_ACTIVE_LAYER_IF_NOT_CHILD",[e.element])},_enableUI:function(e){if(!(this._htOptions._sDisabled&&this._htOptions._sDisabled.indexOf(","+e+",")>-1)){var t,i;this.nUIStatus=0;var n=this.htWrappedUIList[e],o=this.htUIList[e];if(n){n.removeClass("off");var s=o.getElementsByTagName("BUTTON");for(t=0,i=s.length;i>t;t++)s[t].disabled=!1;var r="";if(this.aUICmdMap[e])for(t=0;tt;t++)s[t].disabled=!0;var r="";if(this.aUICmdMap[e])for(t=0;to;o++)n[o].onmousedown=function(){return!1}}if(!e||!e.tagName)return[];if("BUTTON"==(t=e).tagName)return(t=t.parentNode)&&"LI"==t.tagName&&this.rxUI.test(t.className)?[jindo.$Element(t)]:(t=e,(t=t.parentNode.parentNode)&&"LI"==t.tagName&&(i=jindo.$Element(t)).hasClass("se2_pair")?[i,jindo.$Element(e.parentNode)]:[]);if("SPAN"==(t=e).tagName){if((t=t.parentNode.parentNode)&&"LI"==t.tagName&&this.rxUI.test(t.className))return[jindo.$Element(t)];if((t=t.parentNode)&&"LI"==t.tagName&&this.rxUI.test(t.className))return[jindo.$Element(t)]}return[]},$ON_REGISTER_UI_EVENT:function(e,t,i,n){if(this.htUIList[e]){var o;this.aUICmdMap[e]||(this.aUICmdMap[e]=[]),this.aUICmdMap[e][this.aUICmdMap[e].length]=i,o=jindo.$$.getSingle("button",this.htUIList[e]),o&&this.oApp.registerBrowserEvent(o,t,i,n)}},getToolbarButtonByUIName:function(e){return jindo.$$.getSingle("BUTTON",this.htUIList[e])}}),nhn.husky.SE_EditingAreaManager=jindo.$Class({name:"SE_EditingAreaManager",oActivePlugin:null,elContentsField:null,bIsDirty:!1,bAutoResize:!1,$init:function(e,t,i,n,o){this.sDefaultEditingMode=e,this.elContentsField=jindo.$(t),this._assignHTMLElements(o),this.fOnBeforeUnload=n,this.oEditingMode={},this.elContentsField.style.display="none",this.nMinWidth=parseInt(i.nMinWidth||60,10),this.nMinHeight=parseInt(i.nMinHeight||60,10);var s=this._getSize([i.nWidth,i.width,this.elEditingAreaContainer.offsetWidth],this.nMinWidth),r=this._getSize([i.nHeight,i.height,this.elEditingAreaContainer.offsetHeight],this.nMinHeight);this.elEditingAreaContainer.style.width=s.nSize+s.sUnit,this.elEditingAreaContainer.style.height=r.nSize+r.sUnit,"px"===s.sUnit?o.style.width=s.nSize+2+"px":"%"===s.sUnit&&(o.style.minWidth=this.nMinWidth+"px")},_getSize:function(e,t){var i,n,o,s,r,a="px";for(t=parseInt(t,10),i=0,n=e.length;n>i;i++)if(e[i]){if(!isNaN(e[i])){s=parseInt(e[i],10),r=a;break}if(o=/([0-9]+)(.*)/i.exec(e[i]),!(!o||o.length<2||o[1]<=0)){s=parseInt(o[1],10),r=o[2],r||(r=a),t>s&&r===a&&(s=t);break}}return r||(r=a),(isNaN(s)||t>s&&r===a)&&(s=t),{nSize:s,sUnit:r}},_assignHTMLElements:function(e){this.elEditingAreaContainer=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container",e),this.toolbarArea=jindo.$$.getSingle(".se2_tool",e)},$BEFORE_MSG_APP_READY:function(e){this.oApp.exec("ADD_APP_PROPERTY",["version",nhn.husky.SE_EditingAreaManager.version]),this.oApp.exec("ADD_APP_PROPERTY",["elEditingAreaContainer",this.elEditingAreaContainer]),this.oApp.exec("ADD_APP_PROPERTY",["welEditingAreaContainer",jindo.$Element(this.elEditingAreaContainer)]),this.oApp.exec("ADD_APP_PROPERTY",["getEditingAreaHeight",jindo.$Fn(this.getEditingAreaHeight,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getEditingAreaWidth",jindo.$Fn(this.getEditingAreaWidth,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getRawContents",jindo.$Fn(this.getRawContents,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getContents",jindo.$Fn(this.getContents,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getIR",jindo.$Fn(this.getIR,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["setContents",this.setContents]),this.oApp.exec("ADD_APP_PROPERTY",["setIR",this.setIR]),this.oApp.exec("ADD_APP_PROPERTY",["getEditingMode",jindo.$Fn(this.getEditingMode,this).bind()])},$ON_MSG_APP_READY:function(){this.htOptions=this.oApp.htOptions[this.name]||{},this.sDefaultEditingMode=this.htOptions.sDefaultEditingMode||this.sDefaultEditingMode,this.iframeWindow=this.oApp.getWYSIWYGWindow(),this.oApp.exec("REGISTER_CONVERTERS",[]),this.oApp.exec("CHANGE_EDITING_MODE",[this.sDefaultEditingMode,!0]),this.oApp.exec("LOAD_CONTENTS_FIELD",[!1]),this.oApp.exec("REGISTER_HOTKEY",["esc","CLOSE_LAYER_POPUP",[],document]),this.fOnBeforeUnload?window.onbeforeunload=this.fOnBeforeUnload:window.onbeforeunload=jindo.$Fn(function(){return this.getRawContents()!=this.sCurrentRawContents||this.bIsDirty?this.oApp.$MSG("SE_EditingAreaManager.onExit"):void 0},this).bind()},$ON_CLOSE_LAYER_POPUP:function(){this.oApp.exec("ENABLE_ALL_UI"),this.oApp.exec("DESELECT_UI",["helpPopup"]),this.oApp.exec("HIDE_ALL_DIALOG_LAYER",[]),this.oApp.exec("HIDE_EDITING_AREA_COVER"),this.oApp.exec("FOCUS")},$AFTER_MSG_APP_READY:function(){this.oApp.exec("UPDATE_RAW_CONTENTS"),this.oApp.htOptions[this.name]&&this.oApp.htOptions[this.name].bAutoResize&&(this.bAutoResize=this.oApp.htOptions[this.name].bAutoResize),this.oApp.oNavigator.msafari&&(this.bAutoResize=!0),this.startAutoResize()},$ON_LOAD_CONTENTS_FIELD:function(e){var t=this.elContentsField.value;t=t.replace(/^\s+/,""),this.oApp.exec("SET_CONTENTS",[t,e])},$ON_UPDATE_CONTENTS_FIELD:function(){this.elContentsField.value=this.oApp.getContents(),this.oApp.exec("UPDATE_RAW_CONTENTS")},$ON_UPDATE_RAW_CONTENTS:function(){this.sCurrentRawContents=this.oApp.getRawContents()},$BEFORE_CHANGE_EDITING_MODE:function(e){return this.oEditingMode[e]?(this.stopAutoResize(),this._oPrevActivePlugin=this.oActivePlugin,void(this.oActivePlugin=this.oEditingMode[e])):!1},$AFTER_CHANGE_EDITING_MODE:function(e,t){if(this._oPrevActivePlugin){var i=this._oPrevActivePlugin.getIR();this.oApp.exec("SET_IR",[i]),this._setEditingAreaDimension()}this.startAutoResize(),t||this.oApp.delayedExec("FOCUS",[],0)},$ON_SET_IS_DIRTY:function(e){this.bIsDirty=e},$ON_FOCUS:function(e){this.oActivePlugin&&"function"==typeof this.oActivePlugin.setIR&&(this.iframeWindow&&this.iframeWindow.document.hasFocus&&!this.iframeWindow.document.hasFocus()&&"WYSIWYG"==this.oActivePlugin.sMode?this.iframeWindow.focus():this.oActivePlugin.focus(),e&&this.oApp.bMobile||this.oActivePlugin.focus())},$ON_IE_FOCUS:function(){this.oApp.oNavigator.ie&&this.oApp.exec("FOCUS")},$ON_SET_CONTENTS:function(e,t){this.setContents(e,t)},$BEFORE_SET_IR:function(e,t){t=t||!1,t||this.oApp.exec("RECORD_UNDO_ACTION",["BEFORE SET CONTENTS",{sSaveTarget:"BODY"}])},$ON_SET_IR:function(e){this.oActivePlugin&&"function"==typeof this.oActivePlugin.setIR&&this.oActivePlugin.setIR(e)},$AFTER_SET_IR:function(e,t){t=t||!1,t||this.oApp.exec("RECORD_UNDO_ACTION",["AFTER SET CONTENTS",{sSaveTarget:"BODY"}])},$ON_REGISTER_EDITING_AREA:function(e){this.oEditingMode[e.sMode]=e,"WYSIWYG"==e.sMode&&this.attachDocumentEvents(e.oEditingArea),this._setEditingAreaDimension(e)},$ON_MSG_EDITING_AREA_RESIZE_STARTED:function(){this._isLayerReasonablyShown=!1;var e=jindo.$$.getSingle("ul[class^='se2_itool']>li.active",this.toolbarArea,{oneTimeOffCache:!0});if(e)var t=e.parentNode;!t||"se2_itool2"!=t.className&&"se2_itool4"!=t.className||(this._isLayerReasonablyShown=!0),this._fitElementInEditingArea(this.elEditingAreaContainer),this.oApp.exec("STOP_AUTORESIZE_EDITING_AREA"),this.oApp.exec("SHOW_EDITING_AREA_COVER"),this.elEditingAreaContainer.style.overflow="hidden",this.iStartingHeight=parseInt(this.elEditingAreaContainer.style.height,10)},$ON_STOP_AUTORESIZE_EDITING_AREA:function(){this.bAutoResize&&(this.stopAutoResize(),this.bAutoResize=!1)},startAutoResize:function(){this.bAutoResize&&this.oActivePlugin&&"function"==typeof this.oActivePlugin.startAutoResize&&this.oActivePlugin.startAutoResize()},stopAutoResize:function(){this.bAutoResize&&this.oActivePlugin&&"function"==typeof this.oActivePlugin.stopAutoResize&&this.oActivePlugin.stopAutoResize()},$ON_RESIZE_EDITING_AREA:function(e,t){null!==e&&"undefined"!=typeof e&&this._resizeWidth(e,"px"),null!==t&&"undefined"!=typeof t&&this._resizeHeight(t,"px"),this._fitElementInEditingArea(this.elResizingBoard),this._setEditingAreaDimension()},_resizeWidth:function(e,t){var i=parseInt(e,10);ithis.oApp.elEditingAreaContainer.offsetHeight&&("number"==typeof t?e.style.top=i-e.offsetHeight-t+"px":e.style.top=this.oApp.elEditingAreaContainer.offsetHeight-e.offsetHeight+"px");var n=parseInt(e.style.left,10);n+e.offsetWidth>this.oApp.elEditingAreaContainer.offsetWidth&&(e.style.left=this.oApp.elEditingAreaContainer.offsetWidth-e.offsetWidth+"px")},$ON_EVENT_EDITING_AREA_KEYDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_EVENT_EDITING_AREA_MOUSEDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_EVENT_EDITING_AREA_SCROLL:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},_setEditingAreaDimension:function(e){e=e||this.oActivePlugin,this._fitElementInEditingArea(e.elEditingArea)},_fitElementInEditingArea:function(e){e.style.height=this.elEditingAreaContainer.offsetHeight+"px"},attachDocumentEvents:function(e){this.oApp.registerBrowserEvent(e,"click","EVENT_EDITING_AREA_CLICK"),this.oApp.registerBrowserEvent(e,"dblclick","EVENT_EDITING_AREA_DBLCLICK"),this.oApp.registerBrowserEvent(e,"mousedown","EVENT_EDITING_AREA_MOUSEDOWN"),this.oApp.registerBrowserEvent(e,"mousemove","EVENT_EDITING_AREA_MOUSEMOVE"),this.oApp.registerBrowserEvent(e,"mouseup","EVENT_EDITING_AREA_MOUSEUP"),this.oApp.registerBrowserEvent(e,"mouseout","EVENT_EDITING_AREA_MOUSEOUT"),this.oApp.registerBrowserEvent(e,"mousewheel","EVENT_EDITING_AREA_MOUSEWHEEL"),this.oApp.registerBrowserEvent(e,"keydown","EVENT_EDITING_AREA_KEYDOWN"),this.oApp.registerBrowserEvent(e,"keypress","EVENT_EDITING_AREA_KEYPRESS"),this.oApp.registerBrowserEvent(e,"keyup","EVENT_EDITING_AREA_KEYUP"),this.oApp.registerBrowserEvent(e,"scroll","EVENT_EDITING_AREA_SCROLL")},createCoverDiv:function(){this.elResizingBoard=document.createElement("DIV"),this.elEditingAreaContainer.insertBefore(this.elResizingBoard,this.elEditingAreaContainer.firstChild),this.elResizingBoard.style.position="absolute",this.elResizingBoard.style.background="#000000",this.elResizingBoard.style.zIndex=100,this.elResizingBoard.style.border=1,this.elResizingBoard.style.opacity=0,this.elResizingBoard.style.filter="alpha(opacity=0.0)",this.elResizingBoard.style.MozOpacity=0,this.elResizingBoard.style["-moz-opacity"]=0,this.elResizingBoard.style["-khtml-opacity"]=0,this._fitElementInEditingArea(this.elResizingBoard),this.elResizingBoard.style.width=this.elEditingAreaContainer.offsetWidth+"px",this.elResizingBoard.style.display="none"},$ON_GET_COVER_DIV:function(e,t){this.elResizingBoard&&(t[e]=this.elResizingBoard)},getIR:function(){return this.oActivePlugin?this.oActivePlugin.getIR():""},setIR:function(e,t){this.oApp.exec("SET_IR",[e,t])},getRawContents:function(){return this.oActivePlugin?this.oActivePlugin.getRawContents():""},getContents:function(){var e,t=this.oApp.getIR();return e=this.oApp.applyConverter?this.oApp.applyConverter("IR_TO_DB",t,this.oApp.getWYSIWYGDocument()):t,e=this._cleanContents(e)},_cleanContents:function(e){return e.replace(new RegExp("(]*>)"+unescape("%uFEFF"),"ig"),"$1")},setContents:function(e,t){var i;i=this.oApp.applyConverter?this.oApp.applyConverter("DB_TO_IR",e,this.oApp.getWYSIWYGDocument()):e,this.oApp.exec("SET_IR",[i,t])},getEditingMode:function(){return this.oActivePlugin.sMode},getEditingAreaWidth:function(){return this.elEditingAreaContainer.offsetWidth},getEditingAreaHeight:function(){return this.elEditingAreaContainer.offsetHeight}});var nSE2Version="12056";nhn.husky.SE_EditingAreaManager.version={revision:"12056",type:"open",number:"2.8.2"},nhn.husky.SE_EditingArea_WYSIWYG=jindo.$Class({name:"SE_EditingArea_WYSIWYG",status:nhn.husky.PLUGIN_STATUS.NOT_READY,sMode:"WYSIWYG",iframe:null,doc:null,bStopCheckingBodyHeight:!1,bAutoResize:!1,nBodyMinHeight:0,nScrollbarWidth:0,iLastUndoRecorded:0,_nIFrameReadyCount:50,bWYSIWYGEnabled:!1,$init:function(e){this.iframe=jindo.$(e);var t=jindo.$Agent().navigator();t.ie&&(this.iframe.style.display="none"), this.sBlankPageURL="smart_editor2_inputarea.html",this.sBlankPageURL_EmulateIE7="smart_editor2_inputarea_ie8.html",this.aAddtionalEmulateIE7=[],this.htOptions=nhn.husky.SE2M_Configuration.SE_EditingAreaManager,this.htOptions&&(this.sBlankPageURL=this.htOptions.sBlankPageURL||this.sBlankPageURL,this.sBlankPageURL_EmulateIE7=this.htOptions.sBlankPageURL_EmulateIE7||this.sBlankPageURL_EmulateIE7,this.aAddtionalEmulateIE7=this.htOptions.aAddtionalEmulateIE7||this.aAddtionalEmulateIE7),this.aAddtionalEmulateIE7.push(8),this.sIFrameSrc=this.sBlankPageURL,t.ie&&jindo.$A(this.aAddtionalEmulateIE7).has(t.nativeVersion)&&(this.sIFrameSrc=this.sBlankPageURL_EmulateIE7);var i=this.sIFrameSrc,e=this.iframe,n=jindo.$Fn(this.initIframe,this).bind(),o=jindo.$Fn(function(){this.iframe.src=i},this).bind();!t.ie||t.version>=9&&document.addEventListener?(e.addEventListener("load",n,!1),e.addEventListener("error",o,!1)):(e.attachEvent("onload",n),e.attachEvent("onerror",o)),e.src=i,this.elEditingArea=e},$BEFORE_MSG_APP_READY:function(){this.oEditingArea=this.iframe.contentWindow.document,this.oApp.exec("REGISTER_EDITING_AREA",[this]),this.oApp.exec("ADD_APP_PROPERTY",["getWYSIWYGWindow",jindo.$Fn(this.getWindow,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getWYSIWYGDocument",jindo.$Fn(this.getDocument,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["isWYSIWYGEnabled",jindo.$Fn(this.isWYSIWYGEnabled,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["getRawHTMLContents",jindo.$Fn(this.getRawHTMLContents,this).bind()]),this.oApp.exec("ADD_APP_PROPERTY",["setRawHTMLContents",jindo.$Fn(this.setRawHTMLContents,this).bind()]),this.isWYSIWYGEnabled()&&this.oApp.exec("ENABLE_WYSIWYG_RULER"),this.oApp.registerBrowserEvent(this.getDocument().body,"paste","EVENT_EDITING_AREA_PASTE")},$ON_MSG_APP_READY:function(){this.oApp.hasOwnProperty("saveSnapShot")||(this.$ON_EVENT_EDITING_AREA_MOUSEUP=function(){},this._recordUndo=function(){}),this._bIERangeReset=!0,this.oApp.oNavigator.ie?(jindo.$Fn(function(e){var t=this.iframe.contentWindow.document.selection;t&&"control"===t.type.toLowerCase()&&8===e.key().keyCode&&(this.oApp.exec("EXECCOMMAND",["delete",!1,!1]),e.stop()),this._bIERangeReset=!1},this).attach(this.iframe.contentWindow.document,"keydown"),jindo.$Fn(function(e){this._oIERange=null,this._bIERangeReset=!0},this).attach(this.iframe.contentWindow.document.body,"mousedown"),this.getDocument().createRange||jindo.$Fn(this._onIEBeforeDeactivate,this).attach(this.iframe.contentWindow.document.body,"beforedeactivate"),jindo.$Fn(function(e){this._bIERangeReset=!1},this).attach(this.iframe.contentWindow.document.body,"mouseup")):this.oApp.oNavigator.bGPadBrowser&&(this.$ON_EVENT_TOOLBAR_TOUCHSTART=function(){this._oIERange=this.oApp.getSelection().cloneRange()}),this.fnSetBodyHeight=jindo.$Fn(this._setBodyHeight,this).bind(),this.fnCheckBodyChange=jindo.$Fn(this._checkBodyChange,this).bind(),this.fnSetBodyHeight(),this._setScrollbarWidth()},_setScrollbarWidth:function(){var e=this.getDocument(),t=e.createElement("div");t.style.width="100px",t.style.height="100px",t.style.overflow="scroll",t.style.position="absolute",t.style.top="-9999px",e.body.appendChild(t),this.nScrollbarWidth=t.offsetWidth-t.clientWidth,e.body.removeChild(t)},$AFTER_EVENT_EDITING_AREA_KEYUP:function(e){if(this.bAutoResize){var t=e.key();t.keyCode>=33&&t.keyCode<=40||t.alt||t.ctrl||16===t.keyCode||this._setAutoResize()}},$AFTER_PASTE_HTML:function(){this.bAutoResize&&this._setAutoResize()},startAutoResize:function(){this.oApp.exec("STOP_CHECKING_BODY_HEIGHT"),this.bAutoResize=!0;var e=this.oApp.oNavigator;e.ie&&e.version<9?jindo.$Element(this.getDocument().body).css({overflow:"visible"}):jindo.$Element(this.getDocument().body).css({overflowX:"visible",overflowY:"hidden"}),this._setAutoResize(),this.nCheckBodyInterval=setInterval(this.fnCheckBodyChange,500),this.oApp.exec("START_FLOAT_TOOLBAR")},stopAutoResize:function(){this.bAutoResize=!1,clearInterval(this.nCheckBodyInterval),this.oApp.exec("STOP_FLOAT_TOOLBAR"),jindo.$Element(this.getDocument().body).css({overflow:"visible",overflowY:"visible"}),this.oApp.exec("START_CHECKING_BODY_HEIGHT")},_checkBodyChange:function(){if(this.bAutoResize){var e=this.getDocument().body.innerHTML.length;e!==this.nBodyLength&&(this.nBodyLength=e,this._setAutoResize())}},_getResizeHeight:function(){var e,t,i,n,o=this.getDocument().body,s=["width","fontFamily","fontSize","fontWeight","fontStyle","lineHeight","letterSpacing","textTransform","wordSpacing"];if(this.oApp.oNavigator.msafari||!this.oApp.oNavigator.firefox&&!this.oApp.oNavigator.safari)return this.oApp.oNavigator.ie&&8===this.oApp.oNavigator.version&&8===document.documentMode&&jindo.$Element(o).css("height","0px"),t=parseInt(o.scrollHeight,10),t-1&&(i.lineHeight=parseInt(i.lineHeight,10)/parseInt(i.fontSize,10)),jindo.$Element(this.elDummy).css(i),this.elDummy.innerHTML=o.innerHTML,t=this.elDummy.scrollHeight},_setAutoResize:function(){var e,t,i,n,o=this.getDocument().body,s=jindo.$Element(o),r=!1,a=this.oApp.oNavigator;this.nTopBottomMargin=this.nTopBottomMargin||parseInt(s.css("marginTop"),10)+parseInt(s.css("marginBottom"),10),this.nBodyMinHeight=this.nBodyMinHeight||this.oApp.getEditingAreaHeight()-this.nTopBottomMargin,(a.ie&&a.nativeVersion>=9||a.chrome||this.oApp.oNavigator.msafari)&&(s.css("height","0px"),this.iframe.style.height="0px"),e=this._getResizeHeight(),a.ie?e>this.nBodyMinHeight?(i=this.oApp.getCurrentStyle(),n=this._getStyleSize(i),nthis.nBodyMinHeight?(i=this.oApp.getCurrentStyle(),n=this._getStyleSize(i),ns?e-o:r,this._isHorizontalScrollbarVisible()&&(t-=this.nScrollbarWidth),h&&d||n.css("height",t+"px"),this.nBodyHeight_last=t,setTimeout(this.fnSetBodyHeight,500)}},_isHorizontalScrollbarVisible:function(){var e=this.getDocument();return e.documentElement.clientWidth8){var n=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container").childNodes[0];"DIV"==n.tagName&&1e3==n.style.zIndex&&n.parentNode.removeChild(n)}this.iframe.style.visibility="visible","block"!=this.iframe.style.display&&(this.iframe.style.display="block"),this.oApp.exec("REFRESH_WYSIWYG"),this.oApp.exec("SET_EDITING_WINDOW",[this.getWindow()]),this.oApp.exec("START_CHECKING_BODY_HEIGHT")}else this.iframe.style.visibility="hidden",this.oApp.exec("STOP_CHECKING_BODY_HEIGHT")},$AFTER_CHANGE_EDITING_MODE:function(e,t){this._oIERange=null},$ON_REFRESH_WYSIWYG:function(){jindo.$Agent().navigator().firefox&&(this._disableWYSIWYG(),this._enableWYSIWYG())},$ON_ENABLE_WYSIWYG:function(){this._enableWYSIWYG()},$ON_DISABLE_WYSIWYG:function(){this._disableWYSIWYG()},$ON_IE_HIDE_CURSOR:function(){if(this.oApp.oNavigator.ie){this._onIEBeforeDeactivate();var e=this.oApp.getWYSIWYGDocument().selection;if(e&&e.createRange)try{e.empty()}catch(t){e=this.oApp.getSelection(),e.select(),e.oBrowserSelection.selectNone()}else this.oApp.getEmptySelection().oBrowserSelection.selectNone()}},$AFTER_SHOW_ACTIVE_LAYER:function(){this.oApp.exec("IE_HIDE_CURSOR"),this.bActiveLayerShown=!0},$BEFORE_EVENT_EDITING_AREA_KEYDOWN:function(e){this._bKeyDown=!0},$ON_EVENT_EDITING_AREA_KEYDOWN:function(e){if(this.oApp.getEditingMode()===this.sMode){var t=e.key();if(this.oApp.oNavigator.ie)switch(t.keyCode){case 33:this._pageUp(e);break;case 34:this._pageDown(e);break;case 8:this._backspace(e)}else this.oApp.oNavigator.firefox&&8===t.keyCode&&this._backspace(e);this._recordUndo(t)}},_backspace:function(e){var t=this.oApp.getSelection(),i=null;t.collapsed&&(i=t.getNodeAroundRange(!0,!1),i&&3===i.nodeType&&(/^[\n]*$/.test(i.nodeValue)?i=i.previousSibling:("​"===i.nodeValue||"\ufeff"===i.nodeValue)&&(i.nodeValue="")),i&&1===i.nodeType&&"TABLE"===i.tagName&&(jindo.$Element(i).leave(),e.stop(jindo.$Event.CANCEL_ALL)))},$BEFORE_EVENT_EDITING_AREA_KEYUP:function(e){return this._bKeyDown?void(this._bKeyDown=!1):!1},$ON_EVENT_EDITING_AREA_MOUSEUP:function(e){this.oApp.saveSnapShot()},$BEFORE_PASTE_HTML:function(){this.oApp.getEditingMode()!==this.sMode&&this.oApp.exec("CHANGE_EDITING_MODE",[this.sMode])},$ON_PASTE_HTML:function(e,t,i){var n,o,s,r,a,l,h,d;if(this.oApp.getEditingMode()===this.sMode){if(i||this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["PASTE HTML"]),o=jindo.$Agent().navigator(),n=t||this.oApp.getSelection(),o.ie&&8==o.nativeVersion&&8==document.documentMode&&(e+=unescape("%uFEFF")),n.pasteHTML(e),o.ie?(n.collapseToEnd(),n.select(),this._oIERange=null,this._bIERangeReset=!1):(s=n.placeStringBookmark(),this.oApp.getWYSIWYGDocument().body.innerHTML=this.oApp.getWYSIWYGDocument().body.innerHTML,n.moveToBookmark(s),n.collapseToEnd(),n.select(),n.removeStringBookmark(s),n=this.oApp.getSelection(),t&&t.setRange(n)),e.indexOf("-1&&(r=n.startContainer,1===r.nodeType&&"P"===r.tagName&&(a=jindo.$Element(r).child(function(e){return 1===e.$value().nodeType&&"IMG"===e.$value().tagName},1),a.length>0)))for(l=a[a.length-1].$value(),h=l.nextSibling;h;)d=h.nextSibling,3!==h.nodeType||" "!==h.nodeValue&&h.nodeValue!==unescape("%u00A0")||r.removeChild(h),h=d;i||this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["PASTE HTML"])}},$ON_FOCUS_N_CURSOR:function(e,t){var i,n;return t&&(i=jindo.$(t,this.getDocument()))?(clearTimeout(this._nTimerFocus),void(this._nTimerFocus=setTimeout(jindo.$Fn(function(e){this._scrollIntoView(e),this.oApp.exec("FOCUS")},this).bind(i),300))):(n=this.oApp.getSelection(),void(n.collapsed?e?(this.oApp.exec("FOCUS"),i=this.getDocument().body,n.selectNode(i),n.collapseToEnd(),n.select(),this._scrollIntoView(i)):this.oApp.exec("FOCUS"):(e?n.collapseToEnd():n.collapseToStart(),n.select())))},_getElementVerticalPosition:function(e){var t=0,i=e,n={nTop:0,nBottom:0};if(!e)return n;try{for(;i;)t+=i.offsetTop,i=i.offsetParent}catch(o){}return n.nTop=t,n.nBottom=t+jindo.$Element(e).height(),n},_getVisibleVerticalPosition:function(){var e,t,i,n={nTop:0,nBottom:0};return e=this.getWindow(),t=this.getDocument(),i=e.innerHeight?e.innerHeight:t.documentElement.clientHeight||t.body.clientHeight,n.nTop=e.pageYOffset||t.documentElement.scrollTop,n.nBottom=n.nTop+i,n},_isElementVisible:function(e,t){return e.nTop>=t.nTop&&e.nBottom<=t.nBottom},_scrollIntoView:function(e){var t=this._getElementVerticalPosition(e),i=this._getVisibleVerticalPosition(),n=0;if(!this._isElementVisible(t,i))return(n=t.nBottom-i.nBottom)>0?void this.getWindow().scrollTo(0,i.nTop+n):void this.getWindow().scrollTo(0,t.nTop)},$BEFORE_MSG_EDITING_AREA_RESIZE_STARTED:function(){if(!jindo.$Agent().navigator().ie){var e=null;e=this.oApp.getSelection(),this.sBM=e.placeStringBookmark()}},$AFTER_MSG_EDITING_AREA_RESIZE_ENDED:function(e,t,i){if(this.oApp.getEditingMode()===this.sMode&&(this.oApp.exec("REFRESH_WYSIWYG"),!jindo.$Agent().navigator().ie)){var n=this.oApp.getEmptySelection();n.moveToBookmark(this.sBM),n.select(),n.removeStringBookmark(this.sBM)}},$ON_CLEAR_IE_BACKUP_SELECTION:function(){this._oIERange=null},$ON_RESTORE_IE_SELECTION:function(){if(this._oIERange)try{this._oIERange.select(),this._oPrevIERange=this._oIERange,this._oIERange=null}catch(e){}},$ON_EVENT_EDITING_AREA_PASTE:function(e){this.oApp.delayedExec("EVENT_EDITING_AREA_PASTE_DELAY",[e],0)},$ON_EVENT_EDITING_AREA_PASTE_DELAY:function(e){this._replaceBlankToNbsp(e.element)},_replaceBlankToNbsp:function(e){var t=this.oApp.oNavigator;if(t.ie&&9===t.nativeVersion&&7===document.documentMode&&1===e.nodeType&&"BR"!==e.tagName){var i=jindo.$$("p:empty()",this.oApp.getWYSIWYGDocument().body,{oneTimeOffCache:!0});jindo.$A(i).forEach(function(e,t,i){e.innerHTML=" "})}},_pageUp:function(e){var t,i=this._getEditorHeight(),n=jindo.$Document(this.oApp.getWYSIWYGDocument()).scrollPosition();t=n.top<=i?0:n.top-i,this.oApp.getWYSIWYGWindow().scrollTo(0,t),e.stop()},_pageDown:function(e){var t,i=this._getEditorHeight(),n=jindo.$Document(this.oApp.getWYSIWYGDocument()).scrollPosition(),o=this._getBodyHeight();t=n.top+i>=o?o-i:n.top+i,this.oApp.getWYSIWYGWindow().scrollTo(0,t),e.stop()},_getEditorHeight:function(){return this.oApp.elEditingAreaContainer.offsetHeight-this.nTopBottomMargin},_getBodyHeight:function(){return parseInt(this.getDocument().body.scrollHeight,10)},initIframe:function(){try{if(!this.iframe.contentWindow.document||!this.iframe.contentWindow.document.body||"about:blank"===this.iframe.contentWindow.document.location.href)throw new Error("Access denied");var e=nhn.husky.SE2M_Configuration.SE2M_CSSLoader&&nhn.husky.SE2M_Configuration.SE2M_CSSLoader.sCSSBaseURI?nhn.husky.SE2M_Configuration.SE2M_CSSLoader.sCSSBaseURI:"";if(nhn.husky.SE2M_Configuration.SE_EditingAreaManager.sCSSBaseURI&&(e=nhn.husky.SE2M_Configuration.SE_EditingAreaManager.sCSSBaseURI),e){var t=this.getDocument(),i=t.getElementsByTagName("head")[0],n=t.createElement("link");n.type="text/css",n.rel="stylesheet",n.href=e+"/smart_editor2_in.css",n.onload=jindo.$Fn(function(){this.oApp&&this.oApp.getEditingMode&&this.oApp.getEditingMode()===this.sMode&&this.oApp.exec("RESET_STYLE_STATUS")},this).bind(),i.appendChild(n)}this._enableWYSIWYG(),this.status=nhn.husky.PLUGIN_STATUS.READY}catch(o){if(!(this._nIFrameReadyCount-- >0))throw"iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). ";setTimeout(jindo.$Fn(this.initIframe,this).bind(),100)}},getIR:function(){var e,t=this.iframe.contentWindow.document.body.innerHTML;return e=this.oApp.applyConverter?this.oApp.applyConverter(this.sMode+"_TO_IR",t,this.oApp.getWYSIWYGDocument()):t},setIR:function(e){var t,i=this.oApp.oNavigator,n=jindo.$Agent().navigator(),o=i.ie&&n.nativeVersion<11,s=o?"":"
";if(t=this.oApp.applyConverter?this.oApp.applyConverter("IR_TO_"+this.sMode,e,this.oApp.getWYSIWYGDocument()):e,""===t.replace(/[\r\n\t\s]*/,"")&&("BR"!==this.oApp.sLineBreaker&&(s="

"+s+"

"),t=s),this.iframe.contentWindow.document.body.innerHTML=t,o&&this.oApp.getEditingMode()===this.sMode)for(var r=this.oApp.getWYSIWYGDocument().body.getElementsByTagName("P"),a=0,l=r.length;l>a;a++)1===r[a].childNodes.length&&" "===r[a].innerHTML&&(r[a].innerHTML="")},getRawContents:function(){return this.iframe.contentWindow.document.body.innerHTML},getRawHTMLContents:function(){return this.getRawContents()},setRawHTMLContents:function(e){this.iframe.contentWindow.document.body.innerHTML=e},getWindow:function(){return this.iframe.contentWindow},getDocument:function(){return this.iframe.contentWindow.document},focus:function(){this.getDocument().body.focus(),this.oApp.exec("RESTORE_IE_SELECTION")},_recordUndo:function(e){return e.keyCode>=33&&e.keyCode<=40?void this.oApp.saveSnapShot():void(e.alt||e.ctrl||16===e.keyCode||this.oApp.getLastKey()!==e.keyCode&&(this.oApp.setLastKey(e.keyCode),(e.enter||46===e.keyCode||8===e.keyCode)&&this.oApp.exec("RECORD_UNDO_ACTION",["KEYPRESS("+e.keyCode+")",{bMustBlockContainer:!0}])))},_enableWYSIWYG:function(){null!==this.iframe.contentWindow.document.body.contentEditable?this.iframe.contentWindow.document.body.contentEditable=!0:this.iframe.contentWindow.document.designMode="on",this.bWYSIWYGEnabled=!0,jindo.$Agent().navigator().firefox&&setTimeout(jindo.$Fn(function(){this.iframe.contentWindow.document.execCommand("enableInlineTableEditing",!1,!1)},this).bind(),0)},_disableWYSIWYG:function(){null!==this.iframe.contentWindow.document.body.contentEditable?this.iframe.contentWindow.document.body.contentEditable=!1:this.iframe.contentWindow.document.designMode="off",this.bWYSIWYGEnabled=!1},isWYSIWYGEnabled:function(){return this.bWYSIWYGEnabled}}),nhn.husky.SE_EditingArea_HTMLSrc=jindo.$Class({name:"SE_EditingArea_HTMLSrc",sMode:"HTMLSrc",bAutoResize:!1,nMinHeight:null,$init:function(e){this.elEditingArea=jindo.$(e)},$BEFORE_MSG_APP_READY:function(){this.oNavigator=jindo.$Agent().navigator(),this.oApp.exec("REGISTER_EDITING_AREA",[this])},$ON_MSG_APP_READY:function(){this.oApp.getEditingAreaHeight&&(this.nMinHeight=this.oApp.getEditingAreaHeight())},$ON_CHANGE_EDITING_MODE:function(e){e==this.sMode?(this.elEditingArea.style.display="block",this.elEditingArea.style.position="absolute",this.elEditingArea.style.top="0px"):(this.elEditingArea.style.display="none",this.elEditingArea.style.position="",this.elEditingArea.style.top="")},$AFTER_CHANGE_EDITING_MODE:function(e,t){if(e==this.sMode&&!t){var i=new TextRange(this.elEditingArea);i.setSelection(0,0)}},startAutoResize:function(){var e={nMinHeight:this.nMinHeight,wfnCallback:jindo.$Fn(this.oApp.checkResizeGripPosition,this).bind()};this.oNavigator.msafari&&(e.wfnCallback=function(){}),this.bAutoResize=!0,this.AutoResizer=new nhn.husky.AutoResizer(this.elEditingArea,e),this.AutoResizer.bind()},stopAutoResize:function(){this.AutoResizer.unbind()},getIR:function(){var e=this.getRawContents();return this.oApp.applyConverter&&(e=this.oApp.applyConverter(this.sMode+"_TO_IR",e,this.oApp.getWYSIWYGDocument())),e},setIR:function(e){("
"===e.toLowerCase()||"

 

"===e.toLowerCase()||"


"===e.toLowerCase()||"

"===e.toLowerCase())&&(e="");var t=jindo.$Agent().navigator();t.ie&&11==t.nativeVersion&&11==document.documentMode&&(e=e.replace(/(

$)/,""));var i=e;this.oApp.applyConverter&&(i=this.oApp.applyConverter("IR_TO_"+this.sMode,i,this.oApp.getWYSIWYGDocument())),this.setRawContents(i)},setRawContents:function(e){"undefined"!=typeof e&&(this.elEditingArea.value=e)},getRawContents:function(){return this.elEditingArea.value},focus:function(){this.elEditingArea.focus()}}),"undefined"==typeof window.TextRange&&(window.TextRange={}),TextRange=function(e,t){this._o=e,this._oDoc=t||document},TextRange.prototype.getSelection=function(){var e=this._o,t=[-1,-1];if(isNaN(this._o.selectionStart)){e.focus();var i=this._oDoc.body.createTextRange(),n=null;n=this._oDoc.selection.createRange().duplicate(),i.moveToElementText(e),n.collapse(!0),i.setEndPoint("EndToEnd",n),t[0]=i.text.length,n=this._oDoc.selection.createRange().duplicate(),i.moveToElementText(e),n.collapse(!1),i.setEndPoint("EndToEnd",n),t[1]=i.text.length,e.blur()}else t[0]=e.selectionStart,t[1]=e.selectionEnd;return t},TextRange.prototype.setSelection=function(e,t){var i=this._o;if("undefined"==typeof t&&(t=e),i.setSelectionRange)i.setSelectionRange(e,t);else if(i.createTextRange){var n=i.createTextRange();n.collapse(!0),n.moveStart("character",e),n.moveEnd("character",t-e),n.select(),i.blur()}},TextRange.prototype.copy=function(){var e=this.getSelection();return this._o.value.substring(e[0],e[1])},TextRange.prototype.paste=function(e){var t=this._o,i=this.getSelection(),n=t.value,o=n.substr(0,i[0]),s=n.substr(i[1]);n=o+e+s,t.value=n;var r=0;if("undefined"==typeof this._oDoc.body.style.maxHeight){var a=o.match(/\n/gi);r=null!==a?a.length:0}this.setSelection(i[0]+e.length-r)},TextRange.prototype.cut=function(){var e=this.copy();return this.paste(""),e},nhn.husky.SE_EditingArea_TEXT=jindo.$Class({name:"SE_EditingArea_TEXT",sMode:"TEXT",sRxConverter:"@[0-9]+@",bAutoResize:!1,nMinHeight:null,$init:function(e){this.elEditingArea=jindo.$(e)},$BEFORE_MSG_APP_READY:function(){this.oNavigator=jindo.$Agent().navigator(),this.oApp.exec("REGISTER_EDITING_AREA",[this]),this.oApp.exec("ADD_APP_PROPERTY",["getTextAreaContents",jindo.$Fn(this.getRawContents,this).bind()])},$ON_MSG_APP_READY:function(){this.oApp.getEditingAreaHeight&&(this.nMinHeight=this.oApp.getEditingAreaHeight())},$ON_REGISTER_CONVERTERS:function(){this.oApp.exec("ADD_CONVERTER",["IR_TO_TEXT",jindo.$Fn(this.irToText,this).bind()]),this.oApp.exec("ADD_CONVERTER",["TEXT_TO_IR",jindo.$Fn(this.textToIr,this).bind()])},$ON_CHANGE_EDITING_MODE:function(e){e==this.sMode?(this.elEditingArea.style.display="block",this.elEditingArea.style.position="absolute",this.elEditingArea.style.top="0px"):(this.elEditingArea.style.display="none",this.elEditingArea.style.position="",this.elEditingArea.style.top="")},$AFTER_CHANGE_EDITING_MODE:function(e,t){if(e==this.sMode&&!t){var i=new TextRange(this.elEditingArea);i.setSelection(0,0)}},irToText:function(e){var t=e,i=0,n=t.match(new RegExp(this.sRxConverter));return null!==n&&(t=t.replace(new RegExp(this.sRxConverter),"")),t=t.replace(/\r/g,""),t=t.replace(/[\n|\t]/g,""),t=t.replace(/[\v|\f]/g,""),t=t.replace(/


<\/p>/gi,"\n"),t=t.replace(/

 <\/P>/gi,"\n"),t=t.replace(//gi,"\n"),t=t.replace(//gi,"\n"),t=t.replace(/<\/p(\s[^\/]*)?>/gi,"\n"),t=t.replace(/<\/li(\s[^\/]*)?>/gi,"\n"),t=t.replace(/<\/tr(\s[^\/]*)?>/gi,"\n"),i=t.lastIndexOf("\n"),i>-1&&"\n"==t.substring(i)&&(t=t.substring(0,i)),t=jindo.$S(t).stripTags().toString(),t=this.unhtmlSpecialChars(t),null!==n&&(t=n[0]+t),t},textToIr:function(e){if(e){var t=e,i=null;return i=t.match(new RegExp(this.sRxConverter)),null!==i&&(t=t.replace(i[0],"")),t=this.htmlSpecialChars(t),t=this._addLineBreaker(t),null!==i&&(t=i[0]+t),t}},_addLineBreaker:function(e){if("BR"===this.oApp.sLineBreaker)return e.replace(/\r?\n/g,"
");for(var t=new StringBuffer,i=e.split("\n"),n=i.length,o="",s=0;n>s&&(o=jindo.$S(i[s]).trim().$value(),s!==n-1||""!==o);s++)null!==o&&""!==o?(t.append("

"),t.append(i[s]),t.append("

")):jindo.$Agent().navigator().ie?t.append("

 

"):t.append("


");return t.toString()},startAutoResize:function(){var e={nMinHeight:this.nMinHeight,wfnCallback:jindo.$Fn(this.oApp.checkResizeGripPosition,this).bind()};this.oNavigator.msafari&&(e.wfnCallback=function(){}),this.bAutoResize=!0,this.AutoResizer=new nhn.husky.AutoResizer(this.elEditingArea,e),this.AutoResizer.bind()},stopAutoResize:function(){this.AutoResizer.unbind()},getIR:function(){var e=this.getRawContents();return this.oApp.applyConverter&&(e=this.oApp.applyConverter(this.sMode+"_TO_IR",e,this.oApp.getWYSIWYGDocument())),e},setIR:function(e){var t=e;this.oApp.applyConverter&&(t=this.oApp.applyConverter("IR_TO_"+this.sMode,t,this.oApp.getWYSIWYGDocument())),this.setRawContents(t)},setRawContents:function(e){"undefined"!=typeof e&&(this.elEditingArea.value=e)},getRawContents:function(){return this.elEditingArea.value},focus:function(){this.elEditingArea.focus()},htmlSpecialChars:function(e){return e.replace(/&/g,"&").replace(//g,">").replace(/ /g," ")},unhtmlSpecialChars:function(e){return e.replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/&/g,"&")}}),nhn.husky.SE2M_EditingAreaRuler=jindo.$Class({name:"SE2M_EditingAreaRuler",$init:function(e){this._assignHTMLElements(e),this.htConfig=nhn.husky.SE2M_Configuration.SE2M_EditingAreaRuler||{}},_assignHTMLElements:function(e){this.elEditingAreaRuler=jindo.$$.getSingle("DIV.se2_editor_mark",e)},_adjustWysiwygWidth:function(){var e=jindo.$Element(this.oApp.getWYSIWYGDocument().body);if(e&&this.htConfig[this.nRulerWidth]){var t="{"+this.htConfig[this.nRulerWidth].sStyle.replace(/;/gi,",").replace(/\"/gi,"")+"}",i=jindo.$Json(t.replace(/(\w+)\s?:\s?([\w\s]*[^,}])/gi,'$1:"$2"'));e.css(i.toObject());var n=jindo.$Element(this.elEditingAreaRuler),o={width:e.css("width"),marginLeft:e.css("marginLeft"),top:e.css("marginTop")};n.css(o),this.bUse?n.show():n.hide()}},$ON_ENABLE_WYSIWYG_RULER:function(){this.oApp.htOptions[this.name]&&(this.bUse=this.oApp.htOptions[this.name].bUse||!1,this.nRulerWidth=this.oApp.htOptions[this.name].nRulerWidth||0),!this.elEditingAreaRuler||0>=this.nRulerWidth||this._adjustWysiwygWidth()},$ON_CHANGE_EDITING_MODE:function(e){this.elEditingAreaRuler&&("WYSIWYG"===e&&this.bUse&&this.htConfig[this.nRulerWidth]?jindo.$Element(this.elEditingAreaRuler).show():jindo.$Element(this.elEditingAreaRuler).hide())}}),nhn.husky.SE_EditingAreaVerticalResizer=jindo.$Class({name:"SE_EditingAreaVerticalResizer",oResizeGrip:null,sCookieNotice:"bHideResizeNotice",nEditingAreaMinHeight:null,htConversionMode:null,$init:function(e,t){this.htConversionMode=t,this._assignHTMLElements(e)},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["isUseVerticalResizer",jindo.$Fn(this.isUseVerticalResizer,this).bind()])},$ON_MSG_APP_READY:function(){this.oApp.bMobile?(this.oResizeGrip.disabled=!0,this.oResizeGrip.style.height="0"):(this.oApp.exec("REGISTER_HOTKEY",["shift+esc","FOCUS_RESIZER"]),this.isUseVerticalResizer()?(this.oResizeGrip.style.display="block",this.welNoticeLayer&&!Number(jindo.$Cookie().get(this.sCookieNotice))&&(this.welNoticeLayer.delegate("click","BUTTON.bt_clse",jindo.$Fn(this._closeNotice,this).bind()),this.welNoticeLayer.show()),this.$FnMouseDown=jindo.$Fn(this._mousedown,this),this.$FnMouseMove=jindo.$Fn(this._mousemove,this),this.$FnMouseUp=jindo.$Fn(this._mouseup,this),this.$FnMouseOver=jindo.$Fn(this._mouseover,this),this.$FnMouseOut=jindo.$Fn(this._mouseout,this),this.$FnMouseDown.attach(this.oResizeGrip,"mousedown"),this.$FnMouseOver.attach(this.oResizeGrip,"mouseover"),this.$FnMouseOut.attach(this.oResizeGrip,"mouseout")):(this.oResizeGrip.style.display="none",this.oApp.isUseModeChanger()||(this.elModeToolbar.style.display="none"))),this.oApp.exec("ADD_APP_PROPERTY",["checkResizeGripPosition",jindo.$Fn(this.checkResizeGripPosition,this).bind()]),this.oApp.getEditingAreaHeight&&(this.nEditingAreaMinHeight=this.oApp.getEditingAreaHeight())},isUseVerticalResizer:function(){return"undefined"==typeof this.htConversionMode||"undefined"==typeof this.htConversionMode.bUseVerticalResizer||this.htConversionMode.bUseVerticalResizer===!0?!0:!1},checkResizeGripPosition:function(e){var t=jindo.$Document(),i=jindo.$Element(this.oResizeGrip).offset().top-t.scrollPosition().top+25-t.clientSize().height;0>=i||(e&&(this.nEditingAreaMinHeight>this.oApp.getEditingAreaHeight()-i&&(i=-1*(this.nEditingAreaMinHeight-this.oApp.getEditingAreaHeight())),this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED"),this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,-1*i]),this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED")),this.oApp.exec("STOP_AUTORESIZE_EDITING_AREA"))},$ON_FOCUS_RESIZER:function(){this.oApp.exec("IE_HIDE_CURSOR"),this.oResizeGrip.focus()},_assignHTMLElements:function(e,t){this.oResizeGrip=jindo.$$.getSingle("BUTTON.husky_seditor_editingArea_verticalResizer",e),this.elModeToolbar=jindo.$$.getSingle("DIV.se2_conversion_mode",e),this.welNoticeLayer=jindo.$Element(jindo.$$.getSingle("DIV.husky_seditor_resize_notice",e)),this.welConversionMode=jindo.$Element(this.oResizeGrip.parentNode)},_mouseover:function(e){e.stopBubble(),this.welConversionMode.addClass("controller_on")},_mouseout:function(e){e.stopBubble(),this.welConversionMode.removeClass("controller_on")},_mousedown:function(e){this.iStartHeight=e.pos().clientY,this.iStartHeightOffset=e.pos().layerY,this.$FnMouseMove.attach(document,"mousemove"),this.$FnMouseUp.attach(document,"mouseup"),this.iStartHeight=e.pos().clientY,this.oApp.exec("HIDE_ACTIVE_LAYER"),this.oApp.exec("HIDE_ALL_DIALOG_LAYER"),this.oApp.exec("MSG_EDITING_AREA_RESIZE_STARTED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])},_mousemove:function(e){var t=e.pos().clientY-this.iStartHeight;this.oApp.exec("RESIZE_EDITING_AREA_BY",[0,t])},_mouseup:function(e){this.$FnMouseMove.detach(document,"mousemove"),this.$FnMouseUp.detach(document,"mouseup"),this.oApp.exec("MSG_EDITING_AREA_RESIZE_ENDED",[this.$FnMouseDown,this.$FnMouseMove,this.$FnMouseUp])},_closeNotice:function(){this.welNoticeLayer.hide(),jindo.$Cookie().set(this.sCookieNotice,1,3650)}}),nhn.husky.SE_WYSIWYGEnterKey=jindo.$Class({name:"SE_WYSIWYGEnterKey",$init:function(e){"BR"==e?this.sLineBreaker="BR":this.sLineBreaker="P",this.htBrowser=jindo.$Agent().navigator(),this.htBrowser.opera&&"P"==this.sLineBreaker&&(this.$ON_MSG_APP_READY=function(){}),this.htBrowser.ie?this._addCursorHolder=this._addCursorHolderSpace:(this._addExtraCursorHolder=function(){},this._addBlankText=function(){})},$ON_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["sLineBreaker",this.sLineBreaker]),this.oSelection=this.oApp.getEmptySelection(),this.tmpTextNode=this.oSelection._document.createTextNode(unescape("%u00A0")),jindo.$Fn(this._onKeyDown,this).attach(this.oApp.getWYSIWYGDocument(),"keydown")},_onKeyDown:function(e){var t=e.key();t.shift||t.enter&&("BR"==this.sLineBreaker?this._insertBR(e):this._wrapBlock(e))},$ON_REGISTER_CONVERTERS:function(){this.oApp.exec("ADD_CONVERTER",["IR_TO_DB",jindo.$Fn(this.onIrToDB,this).bind()])},onIrToDB:function(e){var t=e,i=/]*)?\/?>((?:<\/span>)?<\/p>)/gi,n=/(]*>)(?:[\s^>]*)(<\/p>)/gi;return t=t.replace(i," $2"),t=t.replace(n,"$1 $2")},_addBlankText:function(e){var t,i,n,o,s,r=e.getNodes();for(t=0,i=r.length;i>t;t++)n=r[t],1===n.nodeType&&"SPAN"===n.tagName&&(n.id.indexOf(e.HUSKY_BOOMARK_START_ID_PREFIX)>-1||n.id.indexOf(e.HUSKY_BOOMARK_END_ID_PREFIX)>-1||(o=n.firstChild,(!o||3==o.nodeType&&nhn.husky.SE2M_Utils.isBlankTextNode(o)||1==o.nodeType&&1==n.childNodes.length&&(o.id.indexOf(e.HUSKY_BOOMARK_START_ID_PREFIX)>-1||o.id.indexOf(e.HUSKY_BOOMARK_END_ID_PREFIX)>-1))&&(s=e._document.createTextNode(unescape("%uFEFF")),n.appendChild(s))))},_addCursorHolder:function(e){var t=e;return(""==e.innerHTML||(t=this._getStyleOnlyNode(e)))&&(t.innerHTML="
"),t||(t=this._getStyleNode(e)),t},_addCursorHolderSpace:function(e){var t;if(this._addSpace(e),t=this._getStyleNode(e),""==t.innerHTML&&"param"!=t.nodeName.toLowerCase())try{t.innerHTML=unescape("%uFEFF")}catch(i){}return t},_getBlockEndNode:function(e,t){return e?"BR"===e.nodeName?e:e===t?t:this._getBlockEndNode(e.nextSibling,t):t; },_convertHeadSpace:function(e){var t;if(e&&(t=e.nextSibling)&&3===t.nodeType){for(var i,n=t.nodeValue,o="",s=0;(i=n[s])&&" "===i;s++)o+=" ";s>0&&(t.nodeValue=o+n.substring(s))}},_wrapBlock:function(e,t){var i,n,o,s=this.oApp.getSelection(),r=s.placeStringBookmark(),a=s.getLineInfo(),l=a.oStart,h=a.oEnd;if((!l.bParentBreak||s.rxBlockContainer.test(l.oLineBreaker.tagName))&&(e.stop(),s.deleteContents(),l.oNode.parentNode&&11!==l.oNode.parentNode.nodeType)){i=this.oApp.getWYSIWYGDocument().createElement(this.sLineBreaker),s.moveToBookmark(r),s.setStartBefore(l.oNode),this._addBlankText(s),s.surroundContents(i),s.collapseToEnd(),n=this.oApp.getWYSIWYGDocument().createElement(this.sLineBreaker);var d=this._getBlockEndNode(l.oNode,h.oNode);return d===l.oNode&&(d=h.oNode),s.setEndAfter(d),this._addBlankText(s),s.surroundContents(n),s.moveToStringBookmark(r,!0),s.collapseToEnd(),s.removeStringBookmark(r),s.select(),null!==n.lastChild&&"BR"==n.lastChild.tagName&&n.removeChild(n.lastChild),o=this._addCursorHolder(n),n.nextSibling&&"BR"==n.nextSibling.tagName&&n.parentNode.removeChild(n.nextSibling),s.selectNodeContents(o),s.collapseToStart(),s.select(),this.oApp.exec("CHECK_STYLE_CHANGE"),r=s.placeStringBookmark(),void setTimeout(jindo.$Fn(function(e){var t=s.getStringBookmark(e);t&&(s.moveToStringBookmark(e),s.select(),s.removeStringBookmark(e))},this).bind(r),0)}var c=s.getStringBookmark(r,!0);if(this.htBrowser.firefox)c&&c.nextSibling&&"IFRAME"==c.nextSibling.tagName?setTimeout(jindo.$Fn(function(e){var t=s.getStringBookmark(e);t&&(s.moveToStringBookmark(e),s.select(),s.removeStringBookmark(e))},this).bind(r),0):setTimeout(jindo.$Fn(function(e){var t=s.getStringBookmark(e,!0);t&&(this._convertHeadSpace(t),s.removeStringBookmark(e))},this).bind(r),0);else if(this.htBrowser.ie){var p=c.parentNode,_=!1,E=!1;if(!c||!p)return void s.removeStringBookmark(r);if(s.removeStringBookmark(r),_="U"===p.tagName||null!==nhn.husky.SE2M_Utils.findAncestorByTagName("U",p),E="S"===p.tagName||"STRIKE"===p.tagName||null!==nhn.husky.SE2M_Utils.findAncestorByTagName("S",p)&&null!==nhn.husky.SE2M_Utils.findAncestorByTagName("STRIKE",p),_||E)return void setTimeout(jindo.$Fn(this._addTextDecorationTag,this).bind(_,E),0);setTimeout(jindo.$Fn(this._addExtraCursorHolder,this).bind(p),0)}else this._convertHeadSpace(c),s.removeStringBookmark(r)},_addExtraCursorHolder:function(e){var t,i,n;if(e=this._getStyleOnlyNode(e),e&&"SPAN"===e.tagName){for(t=e.lastChild;t;)i=t.previousSibling,3===t.nodeType?(nhn.husky.SE2M_Utils.isBlankTextNode(t)&&t.parentNode.removeChild(t),t=i):t=i;n=e.innerHTML,""===n.replace("​","").replace("\ufeff","")&&(e.innerHTML="​")}var o,s=this.oApp.getSelection();s.collapsed&&(s.fixCommonAncestorContainer(),o=s.commonAncestorContainer,o&&(o=s._getVeryFirstRealChild(o),3===o.nodeType&&(o=o.parentNode),o&&"SPAN"===o.tagName&&(n=o.innerHTML,""===n.replace("​","").replace("\ufeff","")&&(o.innerHTML="​"),s.selectNodeContents(o),s.collapseToStart(),s.select())))},_addSpace:function(e){var t,i,n,o,s,r;if(e){if(3===e.nodeType)return e.parentNode;if("P"!==e.tagName)return e;if(s=jindo.$Element(e).child(function(e){return 1===e.$value().nodeType&&"IMG"===e.$value().tagName},1),s.length>0){for(r=s[s.length-1].$value(),i=r.nextSibling;i;)n=i.nextSibling,3!==i.nodeType||" "!==i.nodeValue&&i.nodeValue!==unescape("%u00A0")&&"​"!==i.nodeValue||e.removeChild(i),i=n;return e}for(i=e.firstChild,n=i,o=!1;i;)n=i.nextSibling,3===i.nodeType&&(i.nodeValue===unescape("%uFEFF")&&e.removeChild(i),o||" "!==i.nodeValue&&i.nodeValue!==unescape("%u00A0")&&"​"!==i.nodeValue||(o=!0)),i=n;return o||(t=this.tmpTextNode.cloneNode(),e.appendChild(t)),e}},_addTextDecorationTag:function(e,t){var i,n,o=this.oApp.getSelection();if(o.collapsed){for(i=o.startContainer;i;){if(3===i.nodeType){i=nhn.DOMFix.parentNode(i);break}if(!i.childNodes||0===i.childNodes.length)break;i=i.firstChild}i&&"U"!==i.tagName&&"S"!==i.tagName&&"STRIKE"!==i.tagName&&(e&&(n=o._document.createElement("U"),i.appendChild(n),i=n),t&&(n=o._document.createElement("STRIKE"),i.appendChild(n)),n.innerHTML="​",o.selectNodeContents(n),o.collapseToEnd(),o.select())}},_getStyleNode:function(e){for(;e.firstChild&&this.oSelection._isBlankTextNode(e.firstChild);)e.removeChild(e.firstChild);var t=e.firstChild;return t?3===t.nodeType||1===t.nodeType&&("IMG"==t.tagName||"BR"==t.tagName||"HR"==t.tagName||"IFRAME"==t.tagName)?e:this._getStyleNode(e.firstChild):e},_getStyleOnlyNode:function(e){if(!e)return null;if(!e.insertBefore)return null;if("IMG"==e.tagName||"BR"==e.tagName||"HR"==e.tagName||"IFRAME"==e.tagName)return null;for(;e.firstChild&&this.oSelection._isBlankTextNode(e.firstChild);)e.removeChild(e.firstChild);return e.childNodes.length>1?null:e.firstChild?3===e.firstChild.nodeType?nhn.husky.SE2M_Utils.isBlankTextNode(e.firstChild)?e:null:this._getStyleOnlyNode(e.firstChild):e},_insertBR:function(e){e.stop();var t=this.oApp.getSelection(),i=this.oApp.getWYSIWYGDocument().createElement("BR");if(t.insertNode(i),t.selectNode(i),t.collapseToEnd(),!this.htBrowser.ie){var n=t.getLineInfo(),o=n.oEnd;if(o.bParentBreak){for(;o.oNode&&3==o.oNode.nodeType&&""==o.oNode.nodeValue;)o.oNode=o.oNode.previousSibling;var s=1;(o.oNode==i||o.oNode.nextSibling==i)&&(s=0),0===s&&(t.pasteHTML("
"),t.collapseToEnd())}}t.insertNode(this.oApp.getWYSIWYGDocument().createTextNode("")),t.select()}}),nhn.husky.SE2M_EditingModeChanger=jindo.$Class({name:"SE2M_EditingModeChanger",htConversionMode:null,$init:function(e,t){this.htConversionMode=t,this._assignHTMLElements(e)},_assignHTMLElements:function(e){e=jindo.$(e)||document,this.elWYSIWYGButton=jindo.$$.getSingle("BUTTON.se2_to_editor",e),this.elHTMLSrcButton=jindo.$$.getSingle("BUTTON.se2_to_html",e),this.elTEXTButton=jindo.$$.getSingle("BUTTON.se2_to_text",e),this.elModeToolbar=jindo.$$.getSingle("DIV.se2_conversion_mode",e),this.welWYSIWYGButtonLi=jindo.$Element(this.elWYSIWYGButton.parentNode),this.welHTMLSrcButtonLi=jindo.$Element(this.elHTMLSrcButton.parentNode),this.welTEXTButtonLi=jindo.$Element(this.elTEXTButton.parentNode)},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["isUseModeChanger",jindo.$Fn(this.isUseModeChanger,this).bind()])},$ON_MSG_APP_READY:function(){this.oApp.htOptions.bOnlyTextMode?(this.elWYSIWYGButton.style.display="none",this.elHTMLSrcButton.style.display="none",this.elTEXTButton.style.display="block",this.oApp.exec("CHANGE_EDITING_MODE",["TEXT"])):(this.oApp.registerBrowserEvent(this.elWYSIWYGButton,"click","EVENT_CHANGE_EDITING_MODE_CLICKED",["WYSIWYG"]),this.oApp.registerBrowserEvent(this.elHTMLSrcButton,"click","EVENT_CHANGE_EDITING_MODE_CLICKED",["HTMLSrc"]),this.oApp.registerBrowserEvent(this.elTEXTButton,"click","EVENT_CHANGE_EDITING_MODE_CLICKED",["TEXT",!1]),this.showModeChanger(),this.isUseModeChanger()===!1&&this.oApp.isUseVerticalResizer()===!1&&(this.elModeToolbar.style.display="none"))},showModeChanger:function(){this.isUseModeChanger()?(this.elWYSIWYGButton.style.display="block",this.elHTMLSrcButton.style.display="block",this.elTEXTButton.style.display="block"):(this.elWYSIWYGButton.style.display="none",this.elHTMLSrcButton.style.display="none",this.elTEXTButton.style.display="none")},isUseModeChanger:function(){return"undefined"==typeof this.htConversionMode||"undefined"==typeof this.htConversionMode.bUseModeChanger||this.htConversionMode.bUseModeChanger===!0?!0:!1},$ON_EVENT_CHANGE_EDITING_MODE_CLICKED:function(e,t){if("TEXT"==e){var i=this.oApp.getIR();if(i.length>0&&!t&&!confirm(this.oApp.$MSG("SE2M_EditingModeChanger.confirmTextMode")))return!1;this.oApp.exec("CHANGE_EDITING_MODE",[e])}else this.oApp.exec("CHANGE_EDITING_MODE",[e]);"HTMLSrc"==e?this.oApp.exec("MSG_NOTIFY_CLICKCR",["htmlmode"]):"TEXT"==e?this.oApp.exec("MSG_NOTIFY_CLICKCR",["textmode"]):this.oApp.exec("MSG_NOTIFY_CLICKCR",["editormode"])},$ON_DISABLE_ALL_UI:function(e){e=e||{};var t=jindo.$A(e.aExceptions||[]);t.has("mode_switcher")||("WYSIWYG"==this.oApp.getEditingMode()?(this.welWYSIWYGButtonLi.removeClass("active"),this.elHTMLSrcButton.disabled=!0,this.elTEXTButton.disabled=!0):"TEXT"==this.oApp.getEditingMode()?(this.welTEXTButtonLi.removeClass("active"),this.elWYSIWYGButton.disabled=!0,this.elHTMLSrcButton.disabled=!0):(this.welHTMLSrcButtonLi.removeClass("active"),this.elWYSIWYGButton.disabled=!0,this.elTEXTButton.disabled=!0))},$ON_ENABLE_ALL_UI:function(){"WYSIWYG"==this.oApp.getEditingMode()?(this.welWYSIWYGButtonLi.addClass("active"),this.elHTMLSrcButton.disabled=!1,this.elTEXTButton.disabled=!1):"TEXT"==this.oApp.getEditingMode()?(this.welTEXTButtonLi.addClass("active"),this.elWYSIWYGButton.disabled=!1,this.elHTMLSrcButton.disabled=!1):(this.welHTMLSrcButtonLi.addClass("active"),this.elWYSIWYGButton.disabled=!1,this.elTEXTButton.disabled=!1)},$ON_CHANGE_EDITING_MODE:function(e){"HTMLSrc"==e?(this.welWYSIWYGButtonLi.removeClass("active"),this.welHTMLSrcButtonLi.addClass("active"),this.welTEXTButtonLi.removeClass("active"),this.elWYSIWYGButton.disabled=!1,this.elHTMLSrcButton.disabled=!0,this.elTEXTButton.disabled=!1,this.oApp.exec("HIDE_ALL_DIALOG_LAYER"),this.oApp.exec("DISABLE_ALL_UI",[{aExceptions:["mode_switcher"]}])):"TEXT"==e?(this.welWYSIWYGButtonLi.removeClass("active"),this.welHTMLSrcButtonLi.removeClass("active"),this.welTEXTButtonLi.addClass("active"),this.elWYSIWYGButton.disabled=!1,this.elHTMLSrcButton.disabled=!1,this.elTEXTButton.disabled=!0,this.oApp.exec("HIDE_ALL_DIALOG_LAYER"),this.oApp.exec("DISABLE_ALL_UI",[{aExceptions:["mode_switcher"]}])):(this.welWYSIWYGButtonLi.addClass("active"),this.welHTMLSrcButtonLi.removeClass("active"),this.welTEXTButtonLi.removeClass("active"),this.elWYSIWYGButton.disabled=!0,this.elHTMLSrcButton.disabled=!1,this.elTEXTButton.disabled=!1,this.oApp.exec("RESET_STYLE_STATUS"),this.oApp.exec("ENABLE_ALL_UI",[]))}}),nhn.husky.SE_PasteHandler=jindo.$Class({name:"SE_PasteHandler",$init:function(e){this.sParagraphContainer=e||"P",this.aConversionTarget=["TABLE"],this.htBrowser=jindo.$Agent().navigator()},$ON_REGISTER_CONVERTERS:function(){this.htBrowser.ie&&this.oApp.exec("ADD_CONVERTER",["IR_TO_DB",jindo.$Fn(this.irToDb,this).bind()])},irToDb:function(e){if("undefined"==typeof e||!e)return e;var t=this._filterPastedContents(e,!0);return t},$ON_MSG_APP_READY:function(){this.elEditingAreaContainer=jindo.$$.getSingle("DIV.husky_seditor_editing_area_container",null,{oneTimeOffCache:!0}),this.oApp.exec("ADD_APP_PROPERTY",["filterPastedContents",jindo.$Fn(this._filterPastedContents,this).bind()]),(this.htBrowser.chrome||this.htBrowser.safari&&this.htBrowser.version>=6)&&(this.$ON_EVENT_EDITING_AREA_PASTE=this._handlePaste)},_handlePaste:function(e){var t,i,n,o,s=!1;t=e.$value().clipboardData.getData("text/html"),i=document.createElement("DIV"),i.innerHTML=t,n=jindo.$$.getSingle("style",i,{oneTimeOffCache:!0}),n&&(o=n.innerHTML,o=o.replace(/"/g,"'"),this._sStyleFromClipboard=o),s=this._hasConversionTarget(t),s&&(this._preparePaste(),setTimeout(jindo.$Fn(function(){var e=new RegExp("^[​]");this.zwspStart&&("unknown"==typeof this.zwspStart.nodeValue?"unknown"!=typeof this.zwspStart.parentNode&&this.zwspStart.parentNode&&this.zwspStart.parentNode.removeChild(this.zwspStart):(this.zwspStart.nodeValue&&(this.zwspStart.nodeValue=this.zwspStart.nodeValue.replace(e,"")),""==this.zwspStart.nodeValue&&this.zwspStart.parentNode&&this.zwspStart.parentNode.removeChild(this.zwspStart)));var t=new RegExp("[​]$");this.zwspEnd&&("unknown"==typeof this.zwspEnd.nodeValue?"unknown"!=typeof this.zwspEnd.parentNode&&this.zwspEnd.parentNode&&this.zwspEnd.parentNode.removeChild(this.zwspEnd):(this.zwspEnd.nodeValue&&(this.zwspEnd.nodeValue=this.zwspEnd.nodeValue.replace(t,"")),""==this.zwspEnd.nodeValue&&this.zwspEnd.parentNode&&this.zwspEnd.parentNode.removeChild(this.zwspEnd)));var i=this.oApp.getSelection();this.oSelectionClone=null;try{this._processPaste()}catch(n){if("undefined"!=typeof JEagleEyeClient){var o="http://blog.naver.com/hp_SE_PasteHandler.js/_handlePaste",s=n.lineNumber;s||(s=0),JEagleEyeClient.sendError(n,o,s)}}i.moveToStringBookmark(this._sBM),i.collapseToEnd(),i.select(),i.removeStringBookmark(this._sBM)},this).bind(),0))},_hasConversionTarget:function(e){var t=!1,i=new RegExp("<("+this.aConversionTarget.join("|")+")[^>]*>","i");return e&&i.test(e)&&(t=!0),t},_preparePaste:function(){this._securePasteArea()},_securePasteArea:function(){var e=this.oApp.getSelection();this._sBM=e.placeStringBookmark();var t=e.getStringBookmark(this._sBM,!0),i=e.getStringBookmark(this._sBM),n=document.createTextNode("");this.zwspStart=n.cloneNode(!0),this.zwspStart.nodeValue="​",this.zwspEnd=this.zwspStart.cloneNode(!0);var o=i.nextSibling;o?(this._isEmptyTextNode(o)&&(o=o.nextSibling),i.parentNode.insertBefore(this.zwspStart,o)):i.parentNode.appendChild(this.zwspStart),t.parentNode.insertBefore(this.zwspEnd,t),i.innerHTML="​",e.setStartAfter(i),e.setEndBefore(this.zwspEnd),e.select()},_processPaste:function(){if(this._savePastedContents(),this._sTarget)try{this.elPasteHelper?(this._clearPasteHelper(),this._showPasteHelper()):this._createPasteHelper(),this._loadToPasteHelper(),this._loadToBody(),this._hidePasteHelper()}catch(e){throw this._hidePasteHelper(),e}},_savePastedContents:function(){var e=this.oApp.getSelection();e.moveToStringBookmark(this._sBM),e.select(),this.oSelectionClone=e.cloneContents(),e.collapseToEnd(),e.select();var t=this._outerHTML(this.oSelectionClone);if(this._isPastedContentsEmpty=!0,""!=t){if(this._isPastedContentsEmpty=!1,this.htBrowser.firefox||this.htBrowser.safari&&this.htBrowser.version>=6){var i=t.match(/