(function(e){e.extend({Class:function(m){function n(){if(typeof this.$super!="undefined"){this.$super.$this=this}if(e.isFunction(this.$init)){this.$init.apply(this,arguments)}}n.prototype=m;n.constructor=n;n.extend=a;return n},$:function(m){if(typeof m=="string"){if(m.substring(0,1)=="<"){return e(m).get(0)}return e("#"+m).get(0)}else{return m}},fnBind:function(n,o){var m=e.makeArray(arguments);m.shift();m.shift();return function(){var p=m.concat(e.makeArray(arguments));return n.apply(o,p)}}});function a(n){var o=n.prototype;this.prototype.$super={};function p(q){return function(){return q.apply(this.$this,arguments)}}for(var m in o){if(!o.propertyIsEnumerable(m)){continue}if(typeof this.prototype[m]=="undefined"){this.prototype[m]=o[m]}this.prototype.$super[m]=e.isFunction(o[m])?p(o[m]):o[m]}return this}if(typeof window.xe=="undefined"){window.xe={}}xe.XpressCore=e.Class({name:"XpressCore",$init:function(m){m=!m?{}:e.Class({}).extend({oDebugger:null}).extend(m);if(m.oDebugger){this.oDebugger=m.oDebugger;this.oDebugger.oApp=this}this.commandQueue=[];this.oCommandMap={};this.oDisabledCommand={};this.aPlugins=[];this.appStatus=xe.APP_STATUS.NOT_READY;this.registerPlugin(this)},exec:function(o,n,m){if(this.appStatus==xe.APP_STATUS.NOT_READY){this.commandQueue[this.commandQueue.length]={msg:o,args:n,event:m};return true}this.exec=this._exec;this.exec(o,n,m)},delayedExec:function(q,o,m,n){var p=e.fnBind(this.exec,this,q,o,n);setTimeout(p,m)},_exec:function(o,n,m){return(this._exec=this.oDebugger?this._execWithDebugger:this._execWithoutDebugger).call(this,o,n,m)},_execWithDebugger:function(p,o,n){this.oDebugger.log_MessageStart(p,o);var m=this._doExec(p,o,n);this.oDebugger.log_MessageEnd(p,o);return m},_execWithoutDebugger:function(o,n,m){return this._doExec(o,n,m)},_doExec:function(t,q,p){var n=false;if(!this.oDisabledCommand[t]){var o=[];if(q&&q.length){var m=q.length;for(var r=0;r=0&&xe.DOMFix.parentNode(x[y])==x[w]){y=this._recurConstructClonedTree(x,y,x[w],u,m,o)}v.insertBefore(u,v.firstChild);return y};n[n.length]=xe.DOMFix.parentNode(n[n.length-1]);_recurConstructClonedTree(n,n.length-1,n[n.length-1],p);return{oStartContainer:m,oEndContainer:o}},cloneRange:function(){return this._copyRange(new xe.W3CDOMRange(this._document))},_copyRange:function(m){m.collapsed=this.collapsed;m.commonAncestorContainer=this.commonAncestorContainer;m.endContainer=this.endContainer;m.endOffset=this.endOffset;m.startContainer=this.startContainer;m.startOffset=this.startOffset;m._document=this._document;return m},collapse:function(m){if(m){this.endContainer=this.startContainer;this.endOffset=this.startOffset}else{this.startContainer=this.endContainer;this.startOffset=this.endOffset}this._updateRangeInfo()},compareBoundaryPoints:function(m,n){switch(m){case xe.W3CDOMRange.START_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,n.startContainer,n.startOffset);case xe.W3CDOMRange.START_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,n.startContainer,n.startOffset);case xe.W3CDOMRange.END_TO_END:return this._compareEndPoint(this.endContainer,this.endOffset,n.endContainer,n.endOffset);case xe.W3CDOMRange.END_TO_START:return this._compareEndPoint(this.startContainer,this.startOffset,n.endContainer,n.endOffset)}},_findBody:function(m){if(!m){return null}while(m){if(m.tagName=="BODY"){return m}m=xe.DOMFix.parentNode(m)}return null},_compareEndPoint:function(p,t,o,q){var w,v;if(!p||this._findBody(p)!=this._document.body){p=this._document.body;t=0}if(!o||this._findBody(o)!=this._document.body){o=this._document.body;q=0}var r=function(y,x){if(x==-1){x=y+1}if(yn.nodeValue.length){m=n.nodeValue.length}}else{if(m>xe.DOMFix.childNodes(n).length){m=xe.DOMFix.childNodes(n).length}}return m},setEnd:function(m,n){n=this._endsNodeValidation(m,n);this.endContainer=m;this.endOffset=n;if(!this.startContainer||this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)!=-1){this.collapse(false)}this._updateRangeInfo()},setEndAfter:function(m){if(!m){throw new Error("INVALID_NODE_TYPE_ERR in setEndAfter")}if(m.tagName=="BODY"){this.setEnd(m,xe.DOMFix.childNodes(m).length);return}this.setEnd(xe.DOMFix.parentNode(m),this._getPosIdx(m)+1)},setEndBefore:function(m){if(!m){throw new Error("INVALID_NODE_TYPE_ERR in setEndBefore")}if(m.tagName=="BODY"){this.setEnd(m,0);return}this.setEnd(xe.DOMFix.parentNode(m),this._getPosIdx(m))},setStart:function(m,n){n=this._endsNodeValidation(m,n);this.startContainer=m;this.startOffset=n;if(!this.endContainer||this._compareEndPoint(this.startContainer,this.startOffset,this.endContainer,this.endOffset)!=-1){this.collapse(true)}this._updateRangeInfo()},setStartAfter:function(m){if(!m){throw new Error("INVALID_NODE_TYPE_ERR in setStartAfter")}if(m.tagName=="BODY"){this.setStart(m,xe.DOMFix.childNodes(m).length);return}this.setStart(xe.DOMFix.parentNode(m),this._getPosIdx(m)+1)},setStartBefore:function(m){if(!m){throw new Error("INVALID_NODE_TYPE_ERR in setStartBefore")}if(m.tagName=="BODY"){this.setStart(m,0);return}this.setStart(xe.DOMFix.parentNode(m),this._getPosIdx(m))},surroundContents:function(m){m.appendChild(this.extractContents());this.insertNode(m);this.selectNode(m)},toString:function(){var m=this._document.createElement("DIV");m.appendChild(this.cloneContents());return m.textContent||m.innerText||""},_isBlankTextNode:function(m){if(m.nodeType==3&&m.nodeValue==""){return true}return false},_getPosIdx:function(n){var m=0;for(var o=n.previousSibling;o;o=o.previousSibling){m++}return m},_updateRangeInfo:function(){if(!this.startContainer){this.init(this._document);return}this.collapsed=this._isCollapsed(this.startContainer,this.startOffset,this.endContainer,this.endOffset);this.commonAncestorContainer=this._getCommonAncestorContainer(this.startContainer,this.endContainer)},_isCollapsed:function(r,q,p,o){var n=false;if(r==p&&q==o){n=true}else{var m=this._getActualStartNode(r,q);var t=this._getActualEndNode(p,o);m=this._getNextNode(this._getPrevNode(m));t=this._getPrevNode(this._getNextNode(t));if(m&&t&&t.tagName!="BODY"&&(this._getNextNode(t)==m||(t==m&&this._isBlankTextNode(t)))){n=true}}return n},_splitTextEndNodesOfTheRange:function(){var m=this._splitTextEndNodes({oStartContainer:this.startContainer,iStartOffset:this.startOffset,oEndContainer:this.endContainer,iEndOffset:this.endOffset});this.startContainer=m.oStartContainer;this.startOffset=m.iStartOffset;this.endContainer=m.oEndContainer;this.endOffset=m.iEndOffset},_splitTextEndNodes:function(m){m=this._splitStartTextNode(m);m=this._splitEndTextNode(m);return m},_splitStartTextNode:function(n){var r=n.oStartContainer;var q=n.iStartOffset;var p=n.oEndContainer;var m=n.iEndOffset;if(!r){return n}if(r.nodeType!=3){return n}if(q==0){return n}if(r.nodeValue.length<=q){return n}var o=r.splitText(q);if(r==p){m-=q;p=o}r=o;q=0;return{oStartContainer:r,iStartOffset:q,oEndContainer:p,iEndOffset:m}},_splitEndTextNode:function(n){var q=n.oStartContainer;var p=n.iStartOffset;var o=n.oEndContainer;var m=n.iEndOffset;if(!o){return n}if(o.nodeType!=3){return n}if(m>=o.nodeValue.length){return n}if(m==0){return n}o.splitText(m);return{oStartContainer:q,iStartOffset:p,oEndContainer:o,iEndOffset:m}},_getNodesInRange:function(){if(this.collapsed){return[]}var n=this._getActualStartNode(this.startContainer,this.startOffset);var m=this._getActualEndNode(this.endContainer,this.endOffset);return this._getNodesBetween(n,m)},_getActualStartNode:function(o,n){var m=o;if(o.nodeType==3){if(n>=o.nodeValue.length){m=this._getNextNode(o);if(m.tagName=="BODY"){m=null}}else{m=o}}else{if(n=this.startContainer.nodeValue.length){return this._getNextNode(this.startContainer)}return this.startContainer}else{if(this.startOffset>=xe.DOMFix.childNodes(this.startContainer).length){return this._getNextNode(this.startContainer)}return xe.DOMFix.childNodes(this.startContainer)[this.startOffset]}},getEndNode:function(){if(this.collapsed){return this.getStartNode()}if(this.endContainer.nodeType==3){if(this.endOffset==0){return this._getPrevNode(this.endContainer)}return this.endContainer}else{if(this.endOffset==0){return this._getPrevNode(this.endContainer)}return xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]}},getNodeAroundRange:function(p,m){if(this.collapsed&&this.startContainer&&this.startContainer.nodeType==3){return this.startContainer}if(!this.collapsed||(this.startContainer&&this.startContainer.nodeType==3)){return this.getStartNode()}var q,o,n;if(this.startOffset>=xe.DOMFix.childNodes(this.startContainer).length){o=this._getNextNode(this.startContainer)}else{o=xe.DOMFix.childNodes(this.startContainer)[this.startOffset]}if(this.endOffset==0){q=this._getPrevNode(this.endContainer)}else{q=xe.DOMFix.childNodes(this.endContainer)[this.endOffset-1]}if(p){n=q;if(!n&&!m){n=o}}else{n=o;if(!n&&!m){n=q}}return n},_getXPath:function(n){var m="";while(n&&n.nodeType==1){m="/"+n.tagName+"["+this._getPosIdx4XPath(n)+"]"+m;n=xe.DOMFix.parentNode(n)}return m},_getPosIdx4XPath:function(n){var m=0;for(var o=n.previousSibling;o;o=o.previousSibling){if(o.tagName==n.tagName){m++}}return m},_evaluateXPath:function(x,v){x=x.substring(1,x.length-1);var r=x.split(/\//);var p=v.body;for(var q=2;q-1&&q){var t=xe.DOMFix.childNodes(q);var p=null;var n=m;var r=o;while((p=t[n])&&p.nodeType==3&&p.nodeValue.length=0){return true}if(bIncludePartlyIncluded){if(o==1){return false}if(p==-1){return false}return true}return false},isNodeInRange:function(p,o,n){var m=new xe.XpressRange(this._window);if(n&&p.firstChild){m.setStartBefore(p.firstChild);m.setEndAfter(p.lastChild)}else{m.selectNode(p)}return isRangeInRange(m,o)},pasteHTML:function(o){if(o==""){this.deleteContents();return}var n=this._document.createElement("DIV");n.innerHTML=o;var q=n.firstChild;var p=n.lastChild;var r=this.cloneRange();var m=r.placeStringBookmark();while(n.lastChild){this.insertNode(n.lastChild)}this.setEndNodes(q,p);r.moveToBookmark(m);r.deleteContents();r.removeStringBookmark(m)},toString:function(){this.toString=xe.W3CDOMRange.prototype.toString;return this.toString()},toHTMLString:function(){var m=this._document.createElement("DIV");m.appendChild(this.cloneContents());return m.innerHTML},findAncestorByTagName:function(m){var n=this.commonAncestorContainer;while(n&&n.tagName!=m){n=xe.DOMFix.parentNode(n)}return n},selectNodeContents:function(o){if(!o){return}var n=o.firstChild?o.firstChild:o;var m=o.lastChild?o.lastChild:o;if(n.nodeType==3){this.setStart(n,0)}else{this.setStartBefore(n)}if(m.nodeType==3){this.setEnd(m,m.nodeValue.length)}else{this.setEndAfter(m)}},styleRange:function(n,q,t){var p=this._getStyleParentNodes(t);if(p.length<1){return}var r,u;for(var o=0;o=0)){t=this.getNodeAroundRange(false,true);n=this.getNodeAroundRange(false,true);r=this._getLineStartInfo(t);q=this._getLineEndInfo(n)}return{oStart:r,oEnd:q}}}).extend(xe.W3CDOMRange);xe.SimpleSelection=function(m){this.init=function(n){this._window=n||window;this._document=this._window.document};this.init(m);if(navigator.appName=="Microsoft Internet Explorer"){xe.SimpleSelectionImpl_IE.apply(this)}else{xe.SimpleSelectionImpl_FF.apply(this)}this.selectRange=function(n){this.selectNone();this.addRange(n)};this.selectionLoaded=true;if(!this._oSelection){this.selectionLoaded=false}};xe.SimpleSelectionImpl_FF=function(){this._oSelection=this._window.getSelection();this.getRangeAt=function(m){m=m||0;try{var n=this._oSelection.getRangeAt(m)}catch(o){return new xe.W3CDOMRange(this._document)}return this._FFRange2W3CRange(n)};this.addRange=function(m){var n=this._W3CRange2FFRange(m);this._oSelection.addRange(n)};this.selectNone=function(){this._oSelection.removeAllRanges()};this._FFRange2W3CRange=function(n){var m=new xe.W3CDOMRange(this._document);m.setStart(n.startContainer,n.startOffset);m.setEnd(n.endContainer,n.endOffset);return m};this._W3CRange2FFRange=function(m){var n=this._document.createRange();n.setStart(m.startContainer,m.startOffset);n.setEnd(m.endContainer,m.endOffset);return n}};xe.SimpleSelectionImpl_IE=function(){this._oSelection=this._document.selection;this.getRangeAt=function(n){n=n||0;if(this._oSelection.type=="Control"){var m=new xe.W3CDOMRange(this._document);var o=this._oSelection.createRange().item(n);if(!o||o.ownerDocument!=this._document){return m}m.selectNode(o);return m}else{var o=this._oSelection.createRangeCollection().item(n).parentElement();if(!o||o.ownerDocument!=this._document){var m=new xe.W3CDOMRange(this._document);return m}return this._IERange2W3CRange(this._oSelection.createRangeCollection().item(n))}};this.addRange=function(m){var n=this._W3CRange2IERange(m);n.select()};this.selectNone=function(){this._oSelection.empty()};this._W3CRange2IERange=function(m){var n=this._getIERangeAt(m.startContainer,m.startOffset);var o=this._getIERangeAt(m.endContainer,m.endOffset);n.setEndPoint("EndToEnd",o);return n};this._getIERangeAt=function(r,p){var o=this._document.body.createTextRange();var n=this._getSelectableNodeAndOffsetForIE(r,p);var q=n.oSelectableNodeForIE;var m=n.iOffsetForIE;o.moveToElementText(q);o.collapse(n.bCollapseToStart);o.moveStart("character",m);return o};this._getSelectableNodeAndOffsetForIE=function(r,u){var m=this._document.body.createTextRange();var n=null;var q=null;var o=0;if(r.nodeType==3){n=xe.DOMFix.parentNode(r);q=xe.DOMFix.childNodes(n);o=q.length}else{n=r;q=xe.DOMFix.childNodes(n);o=u}var w=null;var t=0;var v=true;for(var p=0;p=0){break}t=w[v]}var z=v;if(z!=0&&w[z-1].nodeType==3){var m=this._document.body.createTextRange();var p=null;if(t){m.moveToElementText(t);m.collapse(false);p=t.nextSibling}else{m.moveToElementText(A);m.collapse(true);p=A.firstChild}var y=B.duplicate();y.setEndPoint("StartToStart",m);var n=y.text.length;while(n>p.nodeValue.length&&p.nextSibling){n-=p.nodeValue.length;p=p.nextSibling}var x=p.nodeValue;if(r&&p.nextSibling&&p.nextSibling.nodeType==3&&n==p.nodeValue.length){n-=p.nodeValue.length;p=p.nextSibling}A=p;u=n}else{A=B.parentElement();u=z}return{oContainer:A,iOffset:u}}};xe.DOMFix=new (e.Class({$init:function(){if(navigator.appName=="Microsoft Internet Explorer"||navigator.userAgent.indexOf("Opera")>-1){this.childNodes=this._childNodes_Fix;this.parentNode=this._parentNode_Fix}else{this.childNodes=this._childNodes_Native;this.parentNode=this._parentNode_Native}},_parentNode_Native:function(m){return m.parentNode},_parentNode_Fix:function(m){if(!m){return m}while(m.previousSibling){m=m.previousSibling}return m.parentNode},_childNodes_Native:function(m){return m.childNodes},_childNodes_Fix:function(m){var o=null;var n=0;if(m){var o=[];m=m.firstChild;while(m){o[n++]=m;m=m.nextSibling}}return o}}))();xe.DraggableLayer=e.Class({$init:function(m,n){this.oOptions=e.extend({bModal:"false",oHandle:m,iMinX:-999999,iMinY:-999999,iMaxX:999999,iMaxY:999999},n);this.oHandle=this.oOptions.oHandle;m.style.display="block";m.style.position="absolute";m.style.zIndex="9999";this.aBasePosition=this.getBaseOffset(m);m.style.top=(this.toInt(e(m).offset().top)-this.aBasePosition.top)+"px";m.style.left=(this.toInt(e(m).offset().left)-this.aBasePosition.left)+"px";this.$FnMouseDown=e.fnBind(this._mousedown,this,m);this.$FnMouseMove=e.fnBind(this._mousemove,this,m);this.$FnMouseUp=e.fnBind(this._mouseup,this,m);e(this.oHandle).bind("mousedown",this.$FnMouseDown)},_mousedown:function(m,n){if(n.target.tagName=="INPUT"){return}this.MouseOffsetY=(n.pageY-this.toInt(m.style.top)-this.aBasePosition.top);this.MouseOffsetX=(n.pageX-this.toInt(m.style.left)-this.aBasePosition.left);e(m).bind("mousemove",this.$FnMouseMove);e(m).bind("mouseup",this.$FnMouseUp)},_mousemove:function(m,n){var p=(n.pageY-this.MouseOffsetY-this.aBasePosition.top);var o=(n.pageX-this.MouseOffsetX-this.aBasePosition.left);if(pthis.oOptions.iMaxY){p=this.oOptions.iMaxY}if(othis.oOptions.iMaxX){o=this.oOptions.iMaxX}m.style.top=p+"px";m.style.left=o+"px"},_mouseup:function(m,n){e(m).unbind("mousemove",this.$FnMouseMove);e(m).unbind("mouseup",this.$FnMouseUp)},toInt:function(n){var m=parseInt(n);return m||0},findNonStatic:function(m){if(!m){return null}if(m.tagName=="BODY"){return m}if(e(m).css("position").match(/absolute|relative/i)){return m}return this.findNonStatic(m.offsetParent)},getBaseOffset:function(m){var o=this.findNonStatic(m.offsetParent);var n=e(o).offset();return{top:n.top,left:n.left}}});xe.CorePlugin=e.Class({name:"CorePlugin",$init:function(m){this.funcOnReady=m},$AFTER_MSG_APP_READY:function(){this.oApp.exec("EXEC_ON_READY_FUNCTION",[])},$ON_ADD_APP_PROPERTY:function(m,n){this.oApp[m]=n},$ON_REGISTER_BROWSER_EVENT:function(p,q,n,o,m){this.oApp.registerBrowserEvent(p,q,n,o,m)},$ON_DISABLE_COMMAND:function(m){this.oApp.disableCommand(m,true)},$ON_ENABLE_COMMAND:function(m){this.oApp.disableCommand(m,false)},$ON_EXEC_ON_READY_FUNCTION:function(){if(typeof this.funcOnReady=="function"){this.funcOnReady()}}});xe.Utils=e.Class({name:"Utils",$init:function(){},$ON_ATTACH_HOVER_EVENTS:function(n,m){m=m||"hover";if(!n){return}e(n).hover(function(){e(this).addClass(m)},function(){e(this).removeClass(m)})}});xe.XpressRangeManager=e.Class({name:"XpressRangeManager",oWindow:null,$init:function(m){this.oWindow=m||window},$BEFORE_MSG_APP_READY:function(){if(this.oWindow&&this.oWindow.tagName=="IFRAME"){this.oWindow=this.oWindow.contentWindow}this.oApp.exec("ADD_APP_PROPERTY",["getSelection",e.fnBind(this.getSelection,this)]);this.oApp.exec("ADD_APP_PROPERTY",["getEmptySelection",e.fnBind(this.getEmptySelection,this)])},$ON_SET_EDITING_WINDOW:function(m){this.oWindow=m},getEmptySelection:function(){var m=new xe.XpressRange(this.oWindow);return m},getSelection:function(){this.oApp.exec("RESTORE_IE_SELECTION",[]);var n=this.getEmptySelection();try{n.setFromSelection()}catch(m){}return n}});xe.Hotkey=e.Class({name:"Hotkey",storage:{},keyhash:{},$init:function(){this.storage={};this.keyhash={backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,meta:224,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,del:46,comma:188,period:190,slash:191,hyphen:109,equal:61};if(navigator.appName=="Microsoft Internet Explorer"||navigator.userAgent.indexOf("Safari")>-1){this.keyhash.hyphen=189;this.keyhash.equal=187;this.keyhash.meta=91}},$ON_MSG_APP_READY:function(){e(this.oApp.getWYSIWYGDocument()||document).keydown(e.fnBind(this.keydown,this))},$ON_REGISTER_HOTKEY:function(n,m,p){if(!p){p=[]}var o=e.fnBind(this.oApp.exec,this.oApp,m,p);n=this.normalize(n);if(!n){return false}this.add(n,o)},add:function(m,n){if(typeof this.storage[m]=="undefined"){this.storage[m]=[n]}else{this.storage[m].push(n)}},keydown:function(n){var m=[],o=this.keyhash;if(e.inArray(n.keyCode,[o.shift,o.ctrl,o.alt,o.meta])>=0){return}if(n.shiftKey){m.push("shift")}if(n.altKey){m.push("alt")}if(n.ctrlKey){m.push("ctrl")}if(n.metaKey){m.push("meta")}if(!m.length){return}if(m.length==1&&n.metaKey){m=["ctrl","meta"]}m.push(n.keyCode);m=m.join("+");if(!this.storage[m]){return}e.each(this.storage[m],function(){this()});return false},normalize:function(o){var m,q,t,r,n,p=(o||"").toLowerCase().split("+");m=q=t=r=n=false;e.each(p,function(){var u=""+this;switch(u){case"shift":m=true;case"alt":t=true;case"ctrl":q=true;case"meta":r=true;default:n=u}});if(!n){return""}p=[];if(m){p.push("shift")}if(t){p.push("alt")}if(q){p.push("ctrl")}if(r||(q&&!m&&!t)){p.push("meta")}p.push(this.keyhash[n]||n.toUpperCase().charCodeAt(0));return p.join("+")}});xe.DialogLayerManager=e.Class({name:"DialogLayerManager",aMadeDraggable:null,aOpenedLayers:null,$init:function(){this.aMadeDraggable=[];this.aOpenedLayers=[]},$ON_SHOW_DIALOG_LAYER:function(m,n){m=e.$(m);n=e.$(n)||false;if(!m){return}if(e.inArray(m,this.aOpenedLayers)!=-1){return}this.oApp.exec("POSITION_DIALOG_LAYER",[m]);this.aOpenedLayers[this.aOpenedLayers.length]=m;if(e.inArray(m,this.aMadeDraggable)==-1){new xe.DraggableLayer(m,{bModal:n,iMinY:0});this.aMadeDraggable[this.aMadeDraggable.length]=m}else{m.style.display="block"}},$ON_HIDE_LAST_DIALOG_LAYER:function(){this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[this.aOpenedLayers.length-1]])},$ON_HIDE_ALL_DIALOG_LAYER:function(){for(var m=this.aOpenedLayers.length-1;m>=0;m--){this.oApp.exec("HIDE_DIALOG_LAYER",[this.aOpenedLayers[m]])}},$ON_HIDE_DIALOG_LAYER:function(m){m=e.$(m);if(m){m.style.display="none"}this.aOpenedLayers=e.grep(this.aOpenedLayers,function(n){return n!=m})},$ON_SET_DIALOG_LAYER_POSITION:function(m,o,n){m.style.top=o;m.style.left=n}});xe.ActiveLayerManager=e.Class({name:"ActiveLayerManager",oCurrentLayer:null,$ON_TOGGLE_ACTIVE_LAYER:function(m,p,n,q,o){if(m==this.oCurrentLayer){this.oApp.exec("HIDE_ACTIVE_LAYER",[])}else{this.oApp.exec("SHOW_ACTIVE_LAYER",[m,q,o]);if(p){this.oApp.exec(p,n)}}},$ON_SHOW_ACTIVE_LAYER:function(m,p,n){m=e.$(m);this.sOnCloseCmd=p;this.aOnCloseParam=n;var o=this.oCurrentLayer;if(m==o){return}this.oApp.exec("HIDE_ACTIVE_LAYER",[]);m.style.display="block";this.oCurrentLayer=m},$ON_HIDE_ACTIVE_LAYER:function(){var m=this.oCurrentLayer;if(!m){return}m.style.display="none";this.oCurrentLayer=null;if(this.sOnCloseCmd){this.oApp.exec(this.sOnCloseCmd,this.aOnCloseParam)}},$ON_HIDE_CURRENT_ACTIVE_LAYER:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_EVENT_EDITING_AREA_KEYDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_EVENT_EDITING_AREA_MOUSEDOWN:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])}});xe.StringConverterManager=e.Class({name:"StringConverterManager",oConverters:null,$init:function(){this.oConverters={}},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("ADD_APP_PROPERTY",["applyConverter",e.fnBind(this.applyConverter,this)]);this.oApp.exec("ADD_APP_PROPERTY",["addConverter",e.fnBind(this.addConverter,this)])},applyConverter:function(o,n){var p=this.oConverters[o];if(!p){return n}for(var m=0;m*:first-child",o[p]).get(0)}}},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.toolbarArea,"mouseover","EVENT_TOOLBAR_MOUSEOVER",[]);this.oApp.registerBrowserEvent(this.toolbarArea,"mouseout","EVENT_TOOLBAR_MOUSEOUT",[]);this.oApp.exec("ADD_APP_PROPERTY",["getToolbarButtonByUIName",e.fnBind(this.getToolbarButtonByUIName,this)])},$ON_EVENT_TOOLBAR_MOUSEOVER:function(m){if(m.target.tagName=="BUTTON"){e(m.target).addClass("hover").parent("span").addClass("hover")}},$ON_EVENT_TOOLBAR_MOUSEOUT:function(m){if(m.target.tagName=="BUTTON"){e(m.target).removeClass("hover").parent("span").removeClass("hover")}},$ON_TOGGLE_TOOLBAR_ACTIVE_LAYER:function(m,q,p,n,r,o){this.oApp.exec("TOGGLE_ACTIVE_LAYER",[m,"MSG_TOOLBAR_LAYER_SHOWN",[m,q,p,n],r,o])},$ON_MSG_TOOLBAR_LAYER_SHOWN:function(m,p,o,n){this.oApp.exec("POSITION_TOOLBAR_LAYER",[m,p]);if(o){this.oApp.exec(o,n)}},$ON_SHOW_TOOLBAR_ACTIVE_LAYER:function(m,p,o,n){this.oApp.exec("SHOW_ACTIVE_LAYER",[m,p,o]);this.oApp.exec("POSITION_TOOLBAR_LAYER",[m,n])},$ON_ENABLE_UI:function(n){var p=this.htUIList[n];if(!p){return}e(p).removeClass("off");p.disabled=false;var o="";if(this.aUICmdMap[n]){for(var m=0;mo){m.style.left=(o-q-5)+"px"}},getToolbarButtonByUIName:function(m){return this.htUIList[m]}});xe.XE_EditingAreaManager=e.Class({name:"XE_EditingAreaManager",oActivePlugin:null,oIRField:null,bIsDirty:false,$init:function(p,q,m,o,n){this.sInitialMode=p;this.oIRField=e.$(q);this._assignHTMLObjects(n);this.fOnBeforeUnload=o;this.oEditingMode={};this.elEditingAreaContainer.style.height=parseInt(m.nHeight||this.elEditingAreaContainer.offsetHeight)+"px";this.nMinHeight=m.nMinHeight||10;this.niMinWidth=m.nMinWidth||10},_assignHTMLObjects:function(m){m=e.$(m)||document;this.elEditingAreaContainer=e("DIV.xpress_xeditor_editing_area_container",m).get(0);this.elEditingAreaSkipUI=e("A.skip",m).get(0)},$BEFORE_MSG_APP_READY:function(m){this.oApp.exec("ADD_APP_PROPERTY",["elEditingAreaContainer",this.elEditingAreaContainer]);this.oApp.exec("ADD_APP_PROPERTY",["getIR",e.fnBind(this.getIR,this)]);this.oApp.exec("ADD_APP_PROPERTY",["setIR",this.setIR]);this.oApp.exec("ADD_APP_PROPERTY",["getEditingMode",e.fnBind(this.getEditingMode,this)])},$ON_MSG_APP_READY:function(){this.oApp.exec("CHANGE_EDITING_MODE",[this.sInitialMode,true]);this.oApp.exec("LOAD_IR_FIELD",[false]);this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"focus","MSG_EDITING_AREA_SIZE_CHANGED",[],50);this.oApp.registerBrowserEvent(this.elEditingAreaSkipUI,"blur","MSG_EDITING_AREA_SIZE_CHANGED",[],50)},$AFTER_MSG_APP_READY:function(){this.oApp.exec("UPDATE_IR_FIELD",[])},$ON_LOAD_IR_FIELD:function(m){this.oApp.setIR(this.oIRField.value,m)},$ON_UPDATE_IR_FIELD:function(){this.oIRField.value=this.oApp.getIR()},$BEFORE_CHANGE_EDITING_MODE:function(m){this._oPrevActivePlugin=this.oActivePlugin;this.oActivePlugin=this.oEditingMode[m]},$AFTER_CHANGE_EDITING_MODE:function(m,n){if(this._oPrevActivePlugin){var o=this._oPrevActivePlugin.getIR();this.oApp.exec("SET_IR",[o]);this.oApp.exec("ENABLE_UI",[this._oPrevActivePlugin.sMode]);this._setEditingAreaDimension()}this.oApp.exec("DISABLE_UI",[this.oActivePlugin.sMode]);if(!n){this.oApp.exec("FOCUS",[])}},$ON_SET_IS_DIRTY:function(m){this.bIsDirty=m},$ON_FOCUS:function(){if(!this.oActivePlugin||typeof this.oActivePlugin.setIR!="function"){return}this.oActivePlugin.focus()},$BEFORE_SET_IR:function(n,m){m=m||false;if(!m){this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"])}},$ON_SET_IR:function(m){if(!this.oActivePlugin||typeof this.oActivePlugin.setIR!="function"){return}this.oActivePlugin.setIR(m)},$AFTER_SET_IR:function(n,m){m=m||false;if(!m){this.oApp.exec("RECORD_UNDO_ACTION",["SET CONTENTS"])}},$ON_REGISTER_EDITING_AREA:function(m){this.oEditingMode[m.sMode]=m;this.attachDocumentEvents(m.oEditingArea)},$ON_MSG_EDITING_AREA_RESIZE_STARTED:function(){this.oActivePlugin.elEditingArea.style.display="none";this.iStartingHeight=parseInt(this.elEditingAreaContainer.style.height)},$ON_RESIZE_EDITING_AREA:function(o,n){var m=parseInt(o);var p=parseInt(n);if(m-1)){return}this._disableWYSIWYG();this._enableWYSIWYG()},$ON_ENABLE_WYSIWYG:function(){this._enableWYSIWYG()},$ON_DISABLE_WYSIWYG:function(){this._disableWYSIWYG()},$ON_EVENT_EDITING_AREA_KEYDOWN:function(m){if(!m.ctrlKey){return}switch(m.keyCode){case 37:this.oApp.exec("EXECCOMMAND",["outdent",false,false]);break;case 39:this.oApp.exec("EXECCOMMAND",["indent",false,false]);break;case 49:case 50:case 51:case 52:case 53:case 54:this.oApp.exec("EXECCOMMAND",["FormatBlock",false,""]);break;default:return}m.preventDefault();m.stopPropagation()},$ON_EVENT_EDITING_AREA_KEYUP:function(m){if(m.keyCode==229||m.keyCode==13||m.altKey||m.ctrlKey||(m.keyCode>=33&&m.keyCode<=40)||m.keyCode==16){return}this._recordUndo(m)},$ON_PASTE_HTML:function(o,p){if(this.oApp.getEditingMode()!=this.sMode){return}var n=p||this.oApp.getSelection();n.pasteHTML(o);if(!navigator.appName=="Microsoft Internet Explorer"){var m=n.placeStringBookmark();this.oApp.getWYSIWYGDocument().body.innerHTML=this.oApp.getWYSIWYGDocument().body.innerHTML;n.moveToBookmark(m);n.collapseToEnd();n.select();n.removeStringBookmark(m)}this.oApp.exec("RECORD_UNDO_ACTION",["INSERT HTML"])},$AFTER_MSG_EDITING_AREA_RESIZE_ENDED:function(m,n,o){this.oApp.exec("REFRESH_WYSIWYG",[])},$ON_RESTORE_IE_SELECTION:function(){if(this._oIERange){this._oIERange.select();this._oPrevIERange=this._oIERange;this._oIERange=null}},initIframe:function(){try{this.doc=this.iframe.contentWindow.document;if(this.doc==null||this.doc.location.href=="about:blank"){throw new Error("Access denied")}this._enableWYSIWYG();this.status=xe.PLUGIN_STATUS.READY}catch(m){if(this._nIFrameReadyCount-->0){setTimeout(e.fnBind(this.initIframe,this),100)}else{throw ("iframe for WYSIWYG editing mode can't be initialized. Please check if the iframe document exists and is also accessable(cross-domain issues). ")}}},getIR:function(){var m=this.doc.body.innerHTML;var n;if(this.oApp.applyConverter){n=this.oApp.applyConverter(this.sMode+"_TO_IR",m)}else{n=m}return n},setIR:function(n){var m;if(this.oApp.applyConverter){m=this.oApp.applyConverter("IR_TO_"+this.sMode,n)}else{m=n}this.doc.body.innerHTML=m;if(navigator.userAgent.indexOf("Firefox")>-1){if(this.doc.body.innerHTML==""){this.doc.body.innerHTML="
"}}},getWindow:function(){return this.iframe.contentWindow},getDocument:function(){return this.iframe.contentWindow.document},focus:function(){},_recordUndo:function(n){var m=new Date();if(m-this.iLastUndoRecorded"}if(r.innerHTML==""){r.innerHTML="
"}if(r.nextSibling&&r.nextSibling.tagName=="BR"){r.parentNode.removeChild(r.nextSibling)}u.selectNodeContents(r);u.collapseToStart();u.select();this.oApp.exec("CHECK_STYLE_CHANGE",[])}else{u.removeStringBookmark(n)}}}});xe.XE_WYSIWYGStyler=e.Class({name:"XE_WYSIWYGStyler",$PRECONDITION:function(m,n){return(this.oApp.getEditingMode()=="WYSIWYG")},$ON_SET_WYSIWYG_STYLE:function(m){var n=this.oApp.getSelection();if(n.collapsed){var p=this.oApp.getWYSIWYGDocument().createElement("SPAN");n.insertNode(p);p.innerHTML=unescape("%uFEFF");var q;for(var o in m){q=m[o];if(typeof q!="string"){continue}p.style[o]=q}n.selectNodeContents(p);n.collapseToEnd();n._window.focus();n._window.document.body.focus();n.select();return}this.oApp.exec("RECORD_UNDO_BEFORE_ACTION",["FONT STYLE"]);n.styleRange(m);n._window.focus();n.select();this.oApp.exec("RECORD_UNDO_AFTER_ACTION",["FONT STYLE"])}});xe.XE_WYSIWYGStyleGetter=e.Class({name:"XE_WYSIWYGStyleGetter",hKeyUp:null,getStyleInterval:200,oStyleMap:{fontFamily:{type:"Value",css:"fontFamily"},fontSize:{type:"Value",css:"fontSize"},lineHeight:{type:"Value",css:"lineHeight",converter:function(n,m){if(!n.match(/px$/)){return n}return Math.ceil((parseInt(n)/parseInt(m.fontSize))*10)/10}},bold:{command:"bold"},underline:{command:"underline"},italic:{command:"italic"},lineThrough:{command:"strikethrough"},superscript:{command:"superscript"},subscript:{command:"subscript"},justifyleft:{command:"justifyleft"},justifycenter:{command:"justifycenter"},justifyright:{command:"justifyright"},justifyfull:{command:"justifyfull"},orderedlist:{command:"insertorderedlist"},unorderedlist:{command:"insertunorderedlist"}},$init:function(){this.oStyle=this._getBlankStyle()},$PRECONDITION:function(){if(this.oApp.getEditingMode()!="WYSIWYG"){return false}return true},$ON_MSG_APP_READY:function(){this.oDocument=this.oApp.getWYSIWYGDocument();this.oApp.exec("ADD_APP_PROPERTY",["getCurrentStyle",e.fnBind(this.getCurrentStyle,this)])},$ON_EVENT_EDITING_AREA_MOUSEUP:function(m){if(this.hKeyUp){clearTimeout(this.hKeyUp)}this.oApp.exec("CHECK_STYLE_CHANGE",[])},$ON_EVENT_EDITING_AREA_KEYUP:function(m){if(!(m.keyCode==8||(m.keyCode>=33&&m.keyCode<=40)||m.keyCode==45||m.keyCode==46)){return}if(this.hKeyUp){clearTimeout(this.hKeyUp)}this.hKeyUp=setTimeout(e.fnBind(this.oApp.exec,this.oApp,"CHECK_STYLE_CHANGE",[]),this.getStyleInterval)},$ON_CHECK_STYLE_CHANGE:function(){this._getStyle()},$ON_RESET_STYLE_STATUS:function(){var m=this._getBlankStyle();for(var n in m){this.oApp.exec("SET_STYLE_STATUS",[n,m[n]])}},getCurrentStyle:function(){return this.oStyle},_check_style_change:function(){this.oApp.exec("CHECK_STYLE_CHANGE",[])},_getBlankStyle:function(){var m={};for(var n in this.oStyleMap){if(this.oStyleMap[n].type=="Value"){m[n]=""}else{m[n]=0}}return m},_getStyle:function(){var r=this.oApp.getSelection();var q=function(u){if(!u.childNodes||u.childNodes.length==0){return true}else{return false}};var t=r.getNodes(false,q);var m,p,o,n;if(t.length==0){m=this._getStyleOf(r.commonAncestorContainer)}else{m=this._getStyleOf(t[0])}for(n in m){if(this.oStyleMap[n].converter){m[n]=this.oStyleMap[n].converter(m[n],m)}if(this.oStyle[n]!=m[n]){this.oApp.exec("MSG_STYLE_CHANGED",[n,m[n]])}}this.oStyle=m},_getStyleOf:function(r){var m=this._getBlankStyle();if(!r){return m}if(r.nodeType==3){r=r.parentNode}var q=e(r);var o,u;for(var n in this.oStyle){o=this.oStyleMap[n];if(o.type&&o.type=="Value"){if(o.css){var t=q.css(o.css);if(n=="fontFamily"){t=t.split(/,/)[0]}m[n]=t}else{if(o.command){try{m[n]=this.oDocument.queryCommandState(o.command)}catch(p){}}else{}}}else{if(o.command){try{if(this.oDocument.queryCommandState(o.command)){m[n]=1}else{m[n]=0}}catch(p){}}else{}}}return m}});xe.XE_FontSizeWithSelectUI=e.Class({name:"XE_FontSizeWithSelectUI",$init:function(m){this._assignHTMLObjects(m)},_assignHTMLObjects:function(m){this.elFontSizeSelect=e("SELECT.xpress_xeditor_ui_fontSize_select",m).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFontSizeSelect,"change","SET_FONTSIZE_FROM_SELECT_UI");this.elFontSizeSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(n,m){if(n=="fontSize"){this.elFontSizeSelect.value=m;if(this.elFontSizeSelect.selectedIndex<0){this.elFontSizeSelect.selectedIndex=0}}},$ON_SET_FONTSIZE_FROM_SELECT_UI:function(){var m=this.elFontSizeSelect.value;if(!m){return}this.oApp.exec("SET_WYSIWYG_STYLE",[{fontSize:m}]);this.oApp.exec("CHECK_STYLE_CHANGE",[])}});xe.XE_FontNameWithSelectUI=e.Class({name:"XE_FontNameWithSelectUI",$init:function(m){this._assignHTMLObjects(m)},_assignHTMLObjects:function(m){this.elFontNameSelect=e("SELECT.xpress_xeditor_ui_fontName_select",m).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFontNameSelect,"change","SET_FONTNAME_FROM_SELECT_UI");this.elFontNameSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(n,m){if(n=="fontFamily"){this.elFontNameSelect.value=m.toLowerCase();if(this.elFontNameSelect.selectedIndex<0){this.elFontNameSelect.selectedIndex=0}}},$ON_SET_FONTNAME_FROM_SELECT_UI:function(){var m=this.elFontNameSelect.value;if(!m){return}this.oApp.exec("SET_WYSIWYG_STYLE",[{fontFamily:m}]);this.oApp.exec("CHECK_STYLE_CHANGE",[])}});xe.XE_LineHeight=e.Class({name:"XE_LineHeight",$init:function(m){this._assignHTMLObjects(m)},_assignHTMLObjects:function(m){},$ON_SET_LINEHEIGHT:function(m){this.setLineHeight(m)},getLineHeight:function(){var p=this._getSelectedNodes(false);var u,v;var q,m;if(p.length==0){return -1}var r=p.length;if(r==0){m=-1}else{v=this._getLineWrapper(p[0]);m=this._getWrapperLineheight(v)}var n=this.oSelection.getStartNode();if(m>0){for(var t=1;t=0;p--){if(u[p].nodeType==3||u[p].tagName=="BR"){var x=o._document.createElement("P");m=u[p].nextSibling;while(p>=0&&u[p]&&(u[p].nodeType==3||u[p].tagName=="BR")){x.insertBefore(u[p--],x.firstChild)}oFormattingNode.insertBefore(x,m);p++}}if(oFormattingNode&&oFormattingNode.parentNode){var x=o._document.createElement("P");x.innerHTML=unescape("
");oFormattingNode.parentNode.insertBefore(x,oFormattingNode.nextSibling)}this.oApp.exec("RECORD_UNDO_ACTION",["Block Quote"]);return oFormattingNode},_expandToTableStart:function(p,q){var m=p.commonAncestorContainer;var n=null;var o=false;while(q&&!o){if(q==m){o=true}if(/TBODY|TFOOT|THEAD|TR/i.test(q.tagName)){n=this._getTableRoot(q);break}q=q.parentNode}return n},_getTableRoot:function(m){while(m&&m.tagName!="TABLE"){m=m.parentNode}return m}});xe.XE_SCharacter=e.Class({name:"XE_SCharacter",$init:function(m){this.bIE=navigator.appName=="Microsoft Internet Explorer";this._assignHTMLObjects(m);this.charSet=[];this.charSet[0]=unescape("FF5B FF5D 3014 3015 3008 3009 300A 300B 300C 300D 300E 300F 3010 3011 2018 2019 201C 201D 3001 3002 %B7 2025 2026 %A7 203B 2606 2605 25CB 25CF 25CE 25C7 25C6 25A1 25A0 25B3 25B2 25BD 25BC 25C1 25C0 25B7 25B6 2664 2660 2661 2665 2667 2663 2299 25C8 25A3 25D0 25D1 2592 25A4 25A5 25A8 25A7 25A6 25A9 %B1 %D7 %F7 2260 2264 2265 221E 2234 %B0 2032 2033 2220 22A5 2312 2202 2261 2252 226A 226B 221A 223D 221D 2235 222B 222C 2208 220B 2286 2287 2282 2283 222A 2229 2227 2228 FFE2 21D2 21D4 2200 2203 %B4 FF5E 02C7 02D8 02DD 02DA 02D9 %B8 02DB %A1 %BF 02D0 222E 2211 220F 266D 2669 266A 266C 327F 2192 2190 2191 2193 2194 2195 2197 2199 2196 2198 321C 2116 33C7 2122 33C2 33D8 2121 2668 260F 260E 261C 261E %B6 2020 2021 %AE %AA %BA 2642 2640").replace(/(\S{4})/g,function(n){return"%u"+n}).split(" ");this.charSet[1]=unescape("%BD 2153 2154 %BC %BE 215B 215C 215D 215E %B9 %B2 %B3 2074 207F 2081 2082 2083 2084 2160 2161 2162 2163 2164 2165 2166 2167 2168 2169 2170 2171 2172 2173 2174 2175 2176 2177 2178 2179 FFE6 %24 FFE5 FFE1 20AC 2103 212B 2109 FFE0 %A4 2030 3395 3396 3397 2113 3398 33C4 33A3 33A4 33A5 33A6 3399 339A 339B 339C 339D 339E 339F 33A0 33A1 33A2 33CA 338D 338E 338F 33CF 3388 3389 33C8 33A7 33A8 33B0 33B1 33B2 33B3 33B4 33B5 33B6 33B7 33B8 33B9 3380 3381 3382 3383 3384 33BA 33BB 33BC 33BD 33BE 33BF 3390 3391 3392 3393 3394 2126 33C0 33C1 338A 338B 338C 33D6 33C5 33AD 33AE 33AF 33DB 33A9 33AA 33AB 33AC 33DD 33D0 33D3 33C3 33C9 33DC 33C6").replace(/(\S{4})/g,function(n){return"%u"+n}).split(" ");this.charSet[2]=unescape("3260 3261 3262 3263 3264 3265 3266 3267 3268 3269 326A 326B 326C 326D 326E 326F 3270 3271 3272 3273 3274 3275 3276 3277 3278 3279 327A 327B 24D0 24D1 24D2 24D3 24D4 24D5 24D6 24D7 24D8 24D9 24DA 24DB 24DC 24DD 24DE 24DF 24E0 24E1 24E2 24E3 24E4 24E5 24E6 24E7 24E8 24E9 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 246A 246B 246C 246D 246E 3200 3201 3202 3203 3204 3205 3206 3207 3208 3209 320A 320B 320C 320D 320E 320F 3210 3211 3212 3213 3214 3215 3216 3217 3218 3219 321A 321B 249C 249D 249E 249F 24A0 24A1 24A2 24A3 24A4 24A5 24A6 24A7 24A8 24A9 24AA 24AB 24AC 24AD 24AE 24AF 24B0 24B1 24B2 24B3 24B4 24B5 2474 2475 2476 2477 2478 2479 247A 247B 247C 247D 247E 247F 2480 2481 2482").replace(/(\S{4})/g,function(n){return"%u"+n}).split(" ");this.charSet[3]=unescape("3131 3132 3133 3134 3135 3136 3137 3138 3139 313A 313B 313C 313D 313E 313F 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 314A 314B 314C 314D 314E 314F 3150 3151 3152 3153 3154 3155 3156 3157 3158 3159 315A 315B 315C 315D 315E 315F 3160 3161 3162 3163 3165 3166 3167 3168 3169 316A 316B 316C 316D 316E 316F 3170 3171 3172 3173 3174 3175 3176 3177 3178 3179 317A 317B 317C 317D 317E 317F 3180 3181 3182 3183 3184 3185 3186 3187 3188 3189 318A 318B 318C 318D 318E").replace(/(\S{4})/g,function(n){return"%u"+n}).split(" ");this.charSet[4]=unescape("0391 0392 0393 0394 0395 0396 0397 0398 0399 039A 039B 039C 039D 039E 039F 03A0 03A1 03A3 03A4 03A5 03A6 03A7 03A8 03A9 03B1 03B2 03B3 03B4 03B5 03B6 03B7 03B8 03B9 03BA 03BB 03BC 03BD 03BE 03BF 03C0 03C1 03C3 03C4 03C5 03C6 03C7 03C8 03C9 %C6 %D0 0126 0132 013F 0141 %D8 0152 %DE 0166 014A %E6 0111 %F0 0127 I 0133 0138 0140 0142 0142 0153 %DF %FE 0167 014B 0149 0411 0413 0414 0401 0416 0417 0418 0419 041B 041F 0426 0427 0428 0429 042A 042B 042C 042D 042E 042F 0431 0432 0433 0434 0451 0436 0437 0438 0439 043B 043F 0444 0446 0447 0448 0449 044A 044B 044C 044D 044E 044F").replace(/(\S{4})/g,function(n){return"%u"+n}).split(" ");this.charSet[5]=unescape("3041 3042 3043 3044 3045 3046 3047 3048 3049 304A 304B 304C 304D 304E 304F 3050 3051 3052 3053 3054 3055 3056 3057 3058 3059 305A 305B 305C 305D 305E 305F 3060 3061 3062 3063 3064 3065 3066 3067 3068 3069 306A 306B 306C 306D 306E 306F 3070 3071 3072 3073 3074 3075 3076 3077 3078 3079 307A 307B 307C 307D 307E 307F 3080 3081 3082 3083 3084 3085 3086 3087 3088 3089 308A 308B 308C 308D 308E 308F 3090 3091 3092 3093 30A1 30A2 30A3 30A4 30A5 30A6 30A7 30A8 30A9 30AA 30AB 30AC 30AD 30AE 30AF 30B0 30B1 30B2 30B3 30B4 30B5 30B6 30B7 30B8 30B9 30BA 30BB 30BC 30BD 30BE 30BF 30C0 30C1 30C2 30C3 30C4 30C5 30C6 30C7 30C8 30C9 30CA 30CB 30CC 30CD 30CE 30CF 30D0 30D1 30D2 30D3 30D4 30D5 30D6 30D7 30D8 30D9 30DA 30DB 30DC 30DD 30DE 30DF 30E0 30E1 30E2 30E3 30E4 30E5 30E6 30E7 30E8 30E9 30EA 30EB 30EC 30ED 30EE 30EF 30F0 30F1 30F2 30F3 30F4 30F5 30F6").replace(/(\S{4})/g,function(n){return"%u"+n}).split(" ")},_assignHTMLObjects:function(n){n=e.$(n)||document;this.elDropdownLayer=e("DIV.xpress_xeditor_sCharacter_layer",n).get(0);this.oTextField=e("INPUT",this.elDropdownLayer).get(0);this.oInsertButton=e("+ BUTTON",this.oTextField).get(0);this.aCloseButton=e("BUTTON.close",this.elDropdownLayer).get();this.aSCharList=e(".list",this.elDropdownLayer).get();var m=e(">UL",this.elDropdownLayer).get(0);this.aLabelA=e("A",m).get()},$ON_MSG_APP_READY:function(){var n=e.fnBind(this.oApp.exec,this.oApp,"INSERT_SCHARACTERS",[this.oTextField.value]);e(this.oInsertButton).click(n);this.oApp.exec("SET_SCHARACTER_LIST",[this.charSet]);for(var m=0;m'+unescape(this.charSet[o][p])+"";this.aSCharList[o].appendChild(r[p])}},_stopBrowserEvent:function(m,n){e(m).bind(n,function(o){o.stopPropagation();o.preventDefault()})}});xe.XE_UndoRedo=e.Class({name:"XE_UndoRedo",actionHistory:null,oCurStateIdx:null,iMinimumSizeChange:10,sBlankContentsForFF:"
",$init:function(){this.aUndoHistory=[];this.oCurStateIdx={nIdx:0,nStep:0}},$PRECONDITION:function(n){if(n.match(/_DO_RECORD_UNDO_HISTORY_AT$/)){return true}try{if(this.oApp.getEditingMode()!="WYSIWYG"){return false}}catch(m){return false}return true},$BEFORE_MSG_APP_READY:function(){this.oApp.exec("DO_RECORD_UNDO_HISTORY_AT",[this.oCurStateIdx,"","",null])},$ON_MSG_APP_READY:function(){this.bFF=(navigator.userAgent.indexOf("Firefox")>-1);this.oApp.exec("ADD_APP_PROPERTY",["getUndoHistory",e.fnBind(this.getUndoHistory,this)]);this.oApp.exec("ADD_APP_PROPERTY",["getUndoStateIdx",e.fnBind(this.getUndoStateIdx,this)]);this.oApp.exec("REGISTER_UI_EVENT",["undo","click","UNDO"]);this.oApp.exec("REGISTER_UI_EVENT",["redo","click","REDO"]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+z","UNDO"]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+y","REDO"])},$ON_UNDO:function(){var n={};this.oApp.exec("DO_RECORD_UNDO_HISTORY",["KEYPRESS",false,false,1]);if(this.oCurStateIdx.nIdx==0){return}if(this.oCurStateIdx.nStep>0){this.oCurStateIdx.nStep--}else{var m=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nIdx--;if(m.nTotalSteps>1){this.oCurStateIdx.nStep=0}else{m=this.aUndoHistory[this.oCurStateIdx.nIdx];this.oCurStateIdx.nStep=m.nTotalSteps-1}}this.oApp.exec("RESTORE_UNDO_HISTORY",[this.oCurStateIdx.nIdx,this.oCurStateIdx.nStep]);this.oApp.exec("CHECK_STYLE_CHANGE",[])},$ON_REDO:function(){if(this.oCurStateIdx.nIdx>=this.aUndoHistory.length){return}var m=this.aUndoHistory[this.oCurStateIdx.nIdx];if(this.oCurStateIdx.nIdx==this.aUndoHistory.length-1&&this.oCurStateIdx.nStep>=m.nTotalSteps-1){return}if(this.oCurStateIdx.nStep"+q+"";this.oSelection.pasteHTML(r)}else{var o=Math.ceil(Math.random()*10000);var u=this.sATagMarker+o;var v=(q==""?["unlink"]:["createLink",false,u+q]);this.oApp.exec("EXECCOMMAND",v);try{this.oSelection.setFromSelection()}catch(p){}var t=this.oApp.getWYSIWYGDocument();e(t.body.getElementsByTagName("A")).filter('[href^="'+u+'"]').attr("href",function(){var w=new RegExp("^"+u.replace(/([\.\\])/g,"\\$1"),"i");if(m){e(this).attr("target",m)}else{e(this).removeAttr("target")}return this.href.replace(w,"")})}this.oApp.exec("HIDE_ACTIVE_LAYER");setTimeout(e.fnBind(function(){try{this.oSelection.select()}catch(w){}},this),0)},_validateURL:function(m){return/^(http|https|ftp|mailto):(?:\/\/)?((\w|-)+(?:[\.:@](\w|-))+)(?:\/|@)?([^"\?]*?)(?:\?([^\?"]*?))?$/.test(m)},$ON_EVENT_XE_HYPERLINK_KEYDOWN:function(m){if(m.keyCode==13){this.oApp.exec("XE_APPLY_HYPERLINK");m.preventDefault();m.stopPropagation()}}});xe.XE_Table=e.Class({name:"XE_Table",iMinRows:1,iMaxRows:20,iMinColumns:1,iMaxColumns:10,iMinBorderWidth:1,iMaxBorderWidth:10,oSelection:null,$init:function(m){this._assignHTMLObjects(m)},_assignHTMLObjects:function(n){var m=null;this.elDropdownLayer=e("DIV.xpress_xeditor_table_layer",n).get(0);this.welDropdownLayer=e(this.elDropdownLayer);m=e("INPUT",this.elDropdownLayer).get();this.oRowInput=m[0];this.oColumnInput=m[1];this.oBorderWidthInput=m[2];this.oBorderColorInput=m[3];this.oBGColorInput=m[4];m=e("BUTTON",this.elDropdownLayer).get();this.oButton_AddRow=m[0];this.oButton_RemoveRow=m[1];this.oButton_AddColumn=m[2];this.oButton_RemoveColumn=m[3];this.oButton_IncBorderWidth=m[4];this.oButton_DecBorderWidth=m[5];this.oButton_BorderColorPreview=m[6];this.oButton_BorderColor=m[7];this.oButton_BGColorPreview=m[8];this.oButton_BGColor=m[9];this.oButton_Insert=m[10];this.oButton_Cancel=m[11];this.oSampleTable=e("TABLE",this.elDropdownLayer).get(0)},$ON_MSG_APP_READY:function(){this.oApp.exec("REGISTER_UI_EVENT",["table","click","ST_TOGGLE_TOOLBAR_LAYER"]);this.oApp.registerBrowserEvent(this.oRowInput,"change","ST_SET_ROW_NUM",[null,0]);this.oApp.registerBrowserEvent(this.oColumnInput,"change","ST_SET_COLUMN_NUM",[null,0]);this.oApp.registerBrowserEvent(this.oBorderWidthInput,"change","ST_SET_BORDER_WIDTH",[null,0]);this.oApp.registerBrowserEvent(this.oButton_AddRow,"click","ST_ADD_ROW");this.oApp.registerBrowserEvent(this.oButton_RemoveRow,"click","ST_REMOVE_ROW");this.oApp.registerBrowserEvent(this.oButton_AddColumn,"click","ST_ADD_COLUMN");this.oApp.registerBrowserEvent(this.oButton_RemoveColumn,"click","ST_REMOVE_COLUMN");this.oApp.registerBrowserEvent(this.oButton_IncBorderWidth,"click","ST_INC_BORDER_WIDTH");this.oApp.registerBrowserEvent(this.oButton_DecBorderWidth,"click","ST_DEC_BORDER_WIDTH");this.oApp.registerBrowserEvent(this.oButton_BorderColorPreview,"click","ST_TOGGLE_BORDER_COLOR_LAYER");this.oApp.registerBrowserEvent(this.oButton_BGColorPreview,"click","ST_TOGGLE_BGCOLOR_LAYER");this.oApp.registerBrowserEvent(this.oButton_BorderColor,"click","ST_TOGGLE_BORDER_COLOR_LAYER");this.oApp.registerBrowserEvent(this.oButton_BGColor,"click","ST_TOGGLE_BGCOLOR_LAYER");this.oApp.registerBrowserEvent(this.oButton_Insert,"click","ST_INSERT_TABLE");this.oApp.registerBrowserEvent(this.oButton_Cancel,"click","ST_CLOSE");this.oApp.exec("ST_SET_BORDER_COLOR",["#CCCCCC"]);this.oApp.exec("ST_SET_BGCOLOR",["#FFFFFF"])},$ON_ST_TOGGLE_TOOLBAR_LAYER:function(){this.oApp.exec("RECORD_UNDO_ACTION_FORCED",["KEYPRESS"]);this._showNewTable();this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer])},$ON_ST_ADD_ROW:function(){this.oApp.exec("ST_SET_ROW_NUM",[null,1])},$ON_ST_REMOVE_ROW:function(){this.oApp.exec("ST_SET_ROW_NUM",[null,-1])},$ON_ST_ADD_COLUMN:function(){this.oApp.exec("ST_SET_COLUMN_NUM",[null,1])},$ON_ST_REMOVE_COLUMN:function(){this.oApp.exec("ST_SET_COLUMN_NUM",[null,-1])},$ON_ST_SET_ROW_NUM:function(m,n){m=m||parseInt(this.oRowInput.value);n=n||0;m+=n;if(mthis.iMaxRows){m=this.iMaxRows}this.oRowInput.value=m;this._showNewTable()},$ON_ST_SET_COLUMN_NUM:function(n,m){n=n||parseInt(this.oColumnInput.value);m=m||0;n+=m;if(nthis.iMaxColumns){n=this.iMaxColumns}this.oColumnInput.value=n;this._showNewTable()},$ON_ST_INSERT_TABLE:function(){var m=this._getTableString();this.oApp.exec("PASTE_HTML",[m]);this.oApp.exec("ST_CLOSE",[])},$ON_ST_CLOSE:function(){this.oApp.exec("HIDE_ACTIVE_LAYER",[])},$ON_ST_SET_BORDER_WIDTH:function(n,m){n=n||parseInt(this.oBorderWidthInput.value);m=m||0;n+=m;if(nthis.iMaxBorderWidth){n=this.iMaxBorderWidth}this.oBorderWidthInput.value=n;this._showNewTable()},$ON_ST_INC_BORDER_WIDTH:function(){this.oApp.exec("ST_SET_BORDER_WIDTH",[null,1])},$ON_ST_DEC_BORDER_WIDTH:function(){this.oApp.exec("ST_SET_BORDER_WIDTH",[null,-1])},$ON_ST_TOGGLE_BORDER_COLOR_LAYER:function(){if(this.welDropdownLayer.hasClass("p1")){this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER",[])}else{this.oApp.exec("ST_SHOW_BORDER_COLOR_LAYER",[])}},$ON_ST_SHOW_BORDER_COLOR_LAYER:function(){this.welDropdownLayer.addClass("p1");this.welDropdownLayer.removeClass("p2");this.oApp.exec("SHOW_COLOR_PALETTE",["ST_SET_BORDER_COLOR_FROM_PALETTE",this.elDropdownLayer])},$ON_ST_HIDE_BORDER_COLOR_LAYER:function(){this.welDropdownLayer.removeClass("p1");this.oApp.exec("HIDE_COLOR_PALETTE",[])},$ON_ST_TOGGLE_BGCOLOR_LAYER:function(){if(this.welDropdownLayer.hasClass("p2")){this.oApp.exec("ST_HIDE_BGCOLOR_LAYER",[])}else{this.oApp.exec("ST_SHOW_BGCOLOR_LAYER",[])}},$ON_ST_SHOW_BGCOLOR_LAYER:function(){this.welDropdownLayer.removeClass("p1");this.welDropdownLayer.addClass("p2");this.oApp.exec("SHOW_COLOR_PALETTE",["ST_SET_BGCOLOR_FROM_PALETTE",this.elDropdownLayer])},$ON_ST_HIDE_BGCOLOR_LAYER:function(){this.welDropdownLayer.removeClass("p2");this.oApp.exec("HIDE_COLOR_PALETTE",[])},$ON_ST_SET_BORDER_COLOR_FROM_PALETTE:function(m){this.oApp.exec("ST_SET_BORDER_COLOR",[m]);this.oApp.exec("ST_HIDE_BORDER_COLOR_LAYER",[])},$ON_ST_SET_BORDER_COLOR:function(m){this.oBorderColorInput.value=m;this.oButton_BorderColorPreview.style.backgroundColor=m;this._showNewTable()},$ON_ST_SET_BGCOLOR_FROM_PALETTE:function(m){this.oApp.exec("ST_SET_BGCOLOR",[m]);this.oApp.exec("ST_HIDE_BGCOLOR_LAYER",[])},$ON_ST_SET_BGCOLOR:function(m){this.oBGColorInput.value=m;this.oButton_BGColorPreview.style.backgroundColor=m;this._showNewTable()},_showNewTable:function(){var m=document.createElement("DIV");m.innerHTML=this._getTableString();var n=m.firstChild;this.oSampleTable.parentNode.insertBefore(n,this.oSampleTable);this.oSampleTable.parentNode.removeChild(this.oSampleTable);this.oSampleTable=n},_getTableString:function(){var q=this.oBorderColorInput.value;var n=this.oBGColorInput.value;var r=this.oBorderWidthInput.value;var u="";if(navigator.appName=="Microsoft Internet Explorer"){u="

"}else{if(navigator.userAgent.indexOf("Firefox")>-1){u="


"}else{u="

 

"}}var v='';var m='';var o=this.oColumnInput.value;for(var t=0;t\n";var p=this.oRowInput.value;v+="";for(var t=0;t";v+="
";return v}});xe.XE_EditingModeToggler=e.Class({name:"XE_EditingModeToggler",$init:function(m){this._assignHTMLObjects(m)},_assignHTMLObjects:function(m){m=e.$(m)||document;this.elModeToggleButton=e("BUTTON.xpress_xeditor_mode_toggle_button",m).get(0);this.welModeToggleButton=e(this.elModeToggleButton)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elModeToggleButton,"click","EVENT_TOGGLE_EDITING_MODE",[])},$ON_EVENT_TOGGLE_EDITING_MODE:function(){if(this.oApp.getEditingMode()=="WYSIWYG"){this.oApp.exec("CHANGE_EDITING_MODE",["HTMLSrc"])}else{this.oApp.exec("CHANGE_EDITING_MODE",["WYSIWYG"])}},$ON_CHANGE_EDITING_MODE:function(m){if(m=="HTMLSrc"){this.welModeToggleButton.addClass("active").parent("span").addClass("active");this.oApp.exec("DISABLE_ALL_UI",[])}else{this.welModeToggleButton.removeClass("active").parent("span").removeClass("active");this.oApp.exec("ENABLE_ALL_UI",[])}}});xe.XE_Editorresize=e.Class({name:"XE_Editorresize",$init:function(n,o){this.inputArea=e(".xpress_xeditor_editing_area_container",n).get(0);this.oVerticalResizer=e(".xpress_xeditor_editingArea_verticalResizer",n).get(0);this.oCheckBox=e("#editorresize",n).get(0);this.oIframe=o;var m=this;e(o).load(function(){m.oIframeBody=e(o).contents().find("body")})},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.oCheckBox,"change","XE_TOGGLE_EDITOR_RESIZE")},$ON_XE_TOGGLE_EDITOR_RESIZE:function(){if(this.oCheckBox.checked==true){if(this._prevHeight==undefined){this._prevHeight=this.inputArea.style.height}this.oVerticalResizer.style.display="none";this.oApp.registerBrowserEvent(this.oIframeBody,"keydown","XE_EDITOR_RESIZE");this.inputArea.style.height=this.oIframe.style.height=this.oIframeBody[0].scrollHeight+"px"}else{e(this.oIframeBody).unbind("keydown");this.oVerticalResizer.style.display="block";this.inputArea.style.height=this._prevHeight;this.oIframe.style.height=this._prevHeight}},$ON_XE_EDITOR_RESIZE:function(){var m=this;setTimeout(function(){m.inputArea.style.height=m.oIframe.style.height=m.oIframeBody[0].scrollHeight+"px"},0)}});var g={"XE_EditingAreaManager.onExit":"%uB0B4%uC6A9%uC774%20%uBCC0%uACBD%uB418%uC5C8%uC2B5%uB2C8%uB2E4.","XE_FontColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff","XE_BGColor.invalidColorCode":"%uC0C9%uC0C1%20%uCF54%uB4DC%uB97C%20%uC62C%uBC14%uB974%uAC8C%20%uC785%uB825%uD558%uC5EC%20%uC8FC%uC2DC%uAE30%20%uBC14%uB78D%uB2C8%uB2E4.\n\n%uC608%29%20%23000000%2C%20%23FF0000%2C%20%23FFFFFF%2C%20%23ffffff%2C%20ffffff","XE_Hyperlink.invalidURL":"%uC785%uB825%uD558%uC2E0%20URL%uC774%20%uC62C%uBC14%uB974%uC9C0%20%uC54A%uC2B5%uB2C8%uB2E4."};xe.XpressCore.oMessageMap=g;var l=/<(.*?)\s+style\s*=\s*"(.*?(?:margin|padding)\s*:\s*0(?:px)?.*?|.*?\-(?:moz|ms|webkit|opera).*?)"(.*?)>/ig,k=/(?:(?:margin|padding)\s*:\s*0(?:px)?|\-(?:moz|ms|webkit|opera)\-[\w-]+\s*:\s*.*?|[\w-]+\s*:\s*\-(?:moz|ms|webkit|opera)\-[\w-]+|(?:line-height|font-variant|font-stretch|font-size-adjust|font-size)\s*:\s*[a-z_-]+)\s*;?\s*|font-(?:weight|style)\s*:\s*normal;?/ig,f=/<(.*?)\s+class\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))(.*?)>/ig,j=/xe_selected_cell/g;regex_handler=/<(.*?)\s+on[a-z]+\s*=(?:\s*".*?"|\s*'.*?'|[^\s>]+)(.*?)>/ig,regex_font_color=/color\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i,regex_font_face=/face\s*=(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i,regex_font_size=/size\s*=(?:\s*"(\d+)"|\s*'(\d+)'|(\d+))/i,regex_style=/style\s*=\s*(?:\s*"(.*?)"|\s*'(.*?)'|([^\s>]+))/i,regex_font_weight=/font-weight\s*:\s*([a-z]+);?/i,regex_font_style=/font-style\s*:\s*italic;?/i,regex_font_decoration=/text-decoration\s*:\s*([a-z -]+);?/i,regex_jquery=/jQuery\d+\s*=(\s*"\d+"|\d+)/ig,regex_quote_attr=/([\w-]+\s*=(?:\s*"[^"]+"|\s*'[^']+'))|([\w-]+)=([^\s]+)/g;var h="a,abbr,acronym,address,area,blockquote,br,caption,center,cite,code,col,colgroup,dd,del,dfn,div,dl,dt,em,embed,h1,h2,h3,h4,h5,h6,hr,img,ins,kbd,li,map,object,ol,p,param,pre,q,samp,span,strong,sub,sup,table,tbody,td,tfoot,th,thead,tr,tt,u,ul,var,iframe,object,param,style".split(","),b="base,meta,link,hr,br,basefont,param,img,area,input,isindex,col".split(",");var d={b:"strong",i:"em",s:"del",strike:"del"};xe.XE_XHTMLFormatter=e.Class({name:"XE_XHTMLFormatter",$ON_MSG_APP_READY:function(){this.oApp.addConverter("WYSIWYG_TO_IR",this.TO_IR);this.oApp.addConverter("HTMLSrc_TO_IR",this.TO_IR);this.oApp.addConverter("IR_TO_HTMLSrc",this.IR_TO);this.oApp.addConverter("IR_TO_WYSIWYG",this.IR_TO)},TO_IR:function(o){var m=[];if(navigator.appName=="Microsoft Internet Explorer"){o=o.replace(regex_jquery,"");o=o.replace(/<(\w+) ([^>]+)>/g,function(r,q,p){return"<"+q+" "+p.replace(regex_quote_attr,function(w,v,u,t){if(v){return v}if(/^"/.test(t)||/"$/.test(t)){return u+"="+t}return u+'="'+(t||u)+'"'})+">"})}regex=/<(\/)?([:\w\/-]+)(.*?)>/ig;o=o.replace(regex,function(x,q,z,u){var w=[];var p="";q=q||"";z=z.toLowerCase();u=e.trim(u||"");if(!q){if(e.inArray(z,b)>=0){var r=u.length;if(z=="br"){u=""}if(!u||u.substring(r-1,r)!="/"){u+=" /"}return"<"+z+" "+e.trim(u)+">"}else{m.push({tag:z,state:p})}}else{var y=[],v="";if(e.inArray(z,b)>=0){return""}if(!m.length){return""}do{v=m.pop();if(v.tag!=z){continue}if(v.state!="deleted"){y.push("")}}while(m.length&&v.tag!=z);return y.join("")}return"<"+q+z+(u?" "+u:"")+">"});if(m.length){var n="";do{n=m.pop();if(n.state!="deleted"){o+=""}}while(m.length)}regex=/<\/p>[ \t]*(\n)?/ig;o=o.replace(regex,"

\n");return o},IR_TO:function(m){return m}});xe.XE_Extension=e.Class({name:"XE_Extension",seq:"",last_doc:"",$init:function(n,m){this.seq=m;this._assignHTMLObjects(n)},_assignHTMLObjects:function(m){this.elDropdownLayer=e("DIV.xpress_xeditor_extension_layer",m).get(0)},_removeAttrs:function(m){return m},_addEvent:function(){if(this.oApp.getEditingMode()!="WYSIWYG"){return}var o=this.oApp.getWYSIWYGDocument();var m=this.seq;var n=function(){var q=e(this);var p=q.attr("editor_component");if(p&&e.isFunction(openComponent)){editorPrevNode=q.get(0);openComponent(p,m)}};e(o).find("img,div[editor_component]").each(function(){var p=e(this);if(this.nodeName=="IMG"&&!p.attr("editor_component")&&!p.attr("widget")){p.attr("editor_component","image_link")}if(this.last_doc!=o){p.unbind("dblclick.widget").bind("dblclick.widget",n);this.last_doc=o}})},$ON_MSG_APP_READY:function(){var m=this.oApp;m.exec("REGISTER_UI_EVENT",["extension","click","TOGGLE_EXTENSION_LAYER"]);var n=function(){m.exec("HIDE_ACTIVE_LAYER",[])};e("a",this.elDropdownLayer).each(function(){var o=e(this);if(!o.attr("component_onclick_event_added")){o.click(n);o.attr("component_onclick_event_added","Y")}})},$ON_TOGGLE_EXTENSION_LAYER:function(){this.oApp.exec("TOGGLE_TOOLBAR_ACTIVE_LAYER",[this.elDropdownLayer])},$ON_CHANGE_EDITING_MODE:function(n){var m=this;setTimeout(function(){m._addEvent()},100)},$ON_PASTE_HTML:function(){var m=this;setTimeout(function(){m._addEvent()},100)},$ON_LOAD_IR_FIELD:function(){var m=this;setTimeout(function(){m._addEvent()},100)},$ON_SET_IR:function(){var m=this;setTimeout(function(){m._addEvent()},100)}});xe.XE_AutoSave=e.Class({name:"XE_AutoSave",form:null,textarea:null,$init:function(m,n){this.form=m.form;this.textarea=m;this._assignHTMLObjects(n)},_assignHTMLObjects:function(m){this.welMessageBox=e("autosave_message")},$ON_MSG_APP_READY:function(){var o=e(this.form._saved_doc_title);var m=e(this.form._saved_doc_content);var p=e.trim(o.val());var n=e.trim(m.val());if(p||n){if(confirm(this.form._saved_doc_message.value)){e(this.form.title).val(p);this.oApp.setIR(n);if(typeof(editorGetAutoSavedDoc)=="function"){editorGetAutoSavedDoc(this.form)}}else{editorRemoveSavedDoc()}}editorEnableAutoSave(this.form,e(this.form).attr("editor_sequence"));this.oApp.exec("REGISTER_HOTKEY",["ctrl+shift+s","AUTO_SAVE"])},$ON_AUTO_SAVE:function(){_editorAutoSave()}});xe.XE_FormatWithSelectUI=e.Class({name:"XE_FormatWithSelectUI",$init:function(m){this._assignHTMLObjects(m)},_assignHTMLObjects:function(m){this.elFormatSelect=e("SELECT.xpress_xeditor_ui_format_select",m).get(0)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elFormatSelect,"change","SET_FORMAT_FROM_SELECT_UI");this.elFormatSelect.selectedIndex=0},$ON_MSG_STYLE_CHANGED:function(o,m){var n=this.oApp.getWYSIWYGDocument().queryCommandValue("FormatBlock");if(!n){return(this.elFormatSelect.selectedIndex=0)}if(navigator.appName=="Microsoft Internet Explorer"&&/([0-9])/.test(n)){n="h"+(RegExp.$1)}this.elFormatSelect.value=n.toLowerCase();if(this.elFormatSelect.selectedIndex<0){this.elFormatSelect.selectedIndex=0}if(this.elFormatSelect.value!=n.toLowerCase()){this.elFormatSelect.selectedIndex=0}},$ON_SET_FORMAT_FROM_SELECT_UI:function(){var m=this.elFormatSelect.value;if(!m){return}if(navigator.appName=="Microsoft Internet Explorer"){m="<"+m+">"}this.oApp.exec("EXECCOMMAND",["FormatBlock",false,m]);this.oApp.exec("CHECK_STYLE_CHANGE",[])}});xe.XE_Table=e.Class({_startSel:null,_endSel:null,$ON_MSG_APP_READY:function(){this._doc=e(this.oApp.getWYSIWYGDocument());this.$FnMouseDown=e.fnBind(this._mousedown,this);this.$FnMouseUp=e.fnBind(this._mouseup,this);this.$FnMouseMove=e.fnBind(this._mousemove,this);this._doc.mousedown(this.$FnMouseDown);this._startSel=null;this._endSel=null;this.oApp.exec("REGISTER_UI_EVENT",["merge_cells","click","MERGE_CELLS"]);this.oApp.exec("REGISTER_UI_EVENT",["split_col","click","CELL_SPLIT_BY_COL"]);this.oApp.exec("REGISTER_UI_EVENT",["split_row","click","CELL_SPLIT_BY_ROW"]);this.oApp.exec("REGISTER_HOTKEY",["ctrl+alt+m","MERGE_CELLS"]);this.$super.$ON_MSG_APP_READY()},$ON_MERGE_CELLS:function(){var p="";var t=e(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th");var u=this;if(!t.length){return}this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Merge"]);t.each(function(){p+=e(this).html()}).eq(0).html(p);var n=0;t.eq(0).nextAll("td,th").andSelf().filter(".xe_selected_cell").each(function(w){n+=u._getSpan(this,"col")});var r=this._getRect(t.eq(0));var m=t.eq(0).parent("tr");var q=t.eq(t.length-1).parent("tr");var v=t.parents("table").eq(0).find("tr");var o=v.index(q.get(0))-v.index(m.get(0))+this._getSpan(t.eq(t.length-1),"row");t.eq(0).attr("colSpan",n).attr("rowSpan",o);t.slice(1).remove()},$ON_CELL_SPLIT_BY_ROW:function(r){var m=e(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th");var p=m.parents("table").eq(0);var n=this;if(!m.length){return}this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Row"]);var q=this._getRect(m.eq(0)).top;var o=this._getRect(m.eq(m.length-1)).bottom;(m=p.find("td,th").filter(function(){var t=n._getRect(e(this));return !(t.bottom<=q||t.top>=o)})).filter(".xe_selected_cell").each(function(){var B=e(this);var D=B.parent("tr");var x=n._getSpan(B,"row");var A=n._getRect(B);var y=[];var z=B.clone().html("
");var u=1,v=1;if(x>1){u=Math.ceil(x/2);v=x-u;y.push(function(){B.attr("rowSpan",u)});z.attr("rowSpan",v)}else{m.filter(function(){if(B.get(0)==this){return false}var t=e(this);var E=n._getRect(t);if(E.bottom<=A.top||E.top>=A.bottom){return false}return true}).each(function(){var t=e(this);var E=n._getSpan(t,"row")+1;y.push(function(){t.attr("rowSpan",E)})});if(navigator.appName=="Microsoft Internet Explorer"){D.after(D.clone().empty().get(0).outerHTML)}else{D.after(D.clone().empty())}}var C=D.nextAll("tr");if(!C.length){D.after(D.clone().empty().append(z))}else{var w=C.eq(u-1).children("td,th").filter(function(){return(n._getRect(e(this)).left>A.left)});if(navigator.appName=="Microsoft Internet Explorer"){w.length?w.eq(0).before(z.get(0).outerHTML):C.eq(u-1).append(z.get(0).outerHTML)}else{w.length?w.slice(0,1).before(z):C.slice(u-1,1).append(z)}}e.each(y,function(){this()})})},$ON_CELL_SPLIT_BY_COL:function(o){var t=e(".xe_selected_cell",this.oApp.getWYSIWYGDocument()).filter("td,th");var u=t.parents("table").slice(0,1);var v=this;var r=[],n=(new Date).getTime(),p="";if(!t.length){return}this.oApp.exec("RECORD_UNDO_ACTION",["Cell:Split By Column"]);var q=t.eq(0).parent("tr");var w=this._getRect(q.find(".xe_selected_cell:first")).left;var m=this._getRect(q.find(".xe_selected_cell:last")).right;(t=u.find("td,th").filter(function(){var x=v._getRect(e(this));return !(x.right<=w||x.left>=m)})).filter(".xe_selected_cell").each(function(x){var z=e(this);var D=v._getSpan(z,"col");var C=z.clone().html("
");if(D>1){var B=Math.ceil(D/2);var y=D-B;z.attr("colSpan",B);C.attr("colSpan",y)}else{var A=v._getRect(z);t.filter(function(){if(z.get(0)==this){return false}var E=e(this);var F=v._getRect(E);if(F.right<=A.left||F.left>=A.right){return false}return true}).each(function(){var E=e(this);E.attr("colSpan",v._getSpan(E,"col")+1)});C.attr("colSpan",1)}if(navigator.appName=="Microsoft Internet Explorer"){z.after(C.get(0).outerHTML)}else{z.after(C)}})},$ON_CHECK_STYLE_CHANGE:function(){var m=["merge_cells","split_col","split_row"];var o=this.oApp;var n=(this._startSel&&this._startSel.is(".xe_selected_cell"))?"ENABLE_UI":"DISABLE_UI";e.each(m,function(){o.exec(n,[this])})},_mousedown:function(o){var r=e(o.target);var p=r.parents().andSelf().filter("td,th,table");var q=this.oApp;var m=this;e("td.xe_selected_cell",this.oApp.getWYSIWYGDocument()).removeClass("xe_selected_cell");this._startSel=null;this._endSel=null;if(!p.length||!this._isLeftClicked(o.button)){return}function n(){p=q.getSelection().cloneRange();p.collapseToStart();p=e(p.startContainer).parents().andSelf().filter("td,th").eq(0);if(!p.length){return m._removeAllListener()||true}m._getRect(m._startSel=p);m._doc.bind("mousemove",m.$FnMouseMove);m._doc.bind("mouseup",m.$FnMouseUp)}setTimeout(n,0)},_mouseup:function(m){this._removeAllListener();this._startSel=this._endSel=null},_mousemove:function(n){var t=e(n.target);var u=t.parents().andSelf().filter("td,th").eq(0);var y=this;if(!u.length||!this._isLeftClicked(n.button)){return}if(!this._endSel&&u.get(0)==this._startSel.get(0)){return}if(this._endSel&&u.get(0)==this._endSel.get(0)){return}this._getRect(this._endSel=u);var x=Math.min(this._startSel.rect.top,this._endSel.rect.top);var z=Math.min(this._startSel.rect.left,this._endSel.rect.left);var r=Math.max(this._startSel.rect.bottom,this._endSel.rect.bottom);var m=Math.max(this._startSel.rect.right,this._endSel.rect.right);var w=u.parents("table");var v=w.find("td,th").removeClass("xe_selected_cell");var q=0;var p=e();do{p.each(function(){var A=y._getRect(e(this));if(A.right>m){m=A.right}if(A.leftr){r=A.bottom}});v=v.filter(":not(.xe_selected_cell)");p=v.filter(function(){var A=y._getRect(e(this));if(A.right<=z||A.left>=m||A.bottom<=x||A.top>=r){return false}return true}).addClass("xe_selected_cell")}while(p.length);if(!(navigator.userAgent.indexOf("Firefox")>-1)){function o(){var A=y.oApp.getSelection();if(!y._startSel){return}if(!y._startSel.get(0).firstChild){y._startSel.text(" ")}A.selectNode(y._startSel.get(0).firstChild);A.collapseToStart();A.select()}setTimeout(o,0)}return false},_removeAllListener:function(){this._doc.unbind("mousemove",this.$FnMouseMove);this._doc.unbind("mouseup",this.$FnMouseUp)},_isLeftClicked:function(m){return navigator.appName=="Microsoft Internet Explorer"?!!(m&1):(m==0)},_getRect:function(n){var m=n.get(0);n.rect={};n.rect.top=m.offsetTop;n.rect.left=m.offsetLeft;n.rect.bottom=n.rect.top+m.offsetHeight;n.rect.right=n.rect.left+m.offsetWidth;return n.rect},_getSpan:function(o,n){var m=parseInt(e(o).attr(n+"span"));return isNaN(m)?1:m}}).extend(xe.XE_Table)})(jQuery);if(!window.xe){xe={}}xe.Editors=[];function editorStart_xe(e,p,m,c,a,b,w,g){if(typeof(a)=="undefined"){a="white"}if(typeof(b)=="undefined"){b="xeStyle"}if(typeof(w)=="undefined"){w=""}if(typeof(g)=="undefined"){g=""}var u=request_uri+"modules/editor/styles/"+b+"/editor.html";var n=jQuery("#xpress-editor-"+e);var k=jQuery('');var q=jQuery('');var d=n.get(0).form;d.setAttribute("editor_sequence",e);n.css("display","none");var v="";if(jQuery("input[name=content]",d).size()>0){v=jQuery("input[name=content]",d).val().replace(/src=\"files\/attach/g,'src="'+request_uri+"files/attach");jQuery("#xpress-editor-"+e).val(v)}n.hide().css("width","100%").before(k).after(q);var l=new xe.XpressCore();var h=k.get(0);var f=n.get(0);var t=q.get(0);var o=jQuery(".xpress-editor",d).get(0);l.getFrame=function(){return h};l.getContent=function(){editorGetContentTextarea_xe(e)};var r=d[m].value;if(xFF&&!r){r="
"}r=editorReplacePath(r);d[m].value=r;jQuery("#xpress-editor-"+e).val(r);editorRelKeys[e]=new Array();editorRelKeys[e]["primary"]=d[p];editorRelKeys[e]["content"]=d[m];editorRelKeys[e]["func"]=editorGetContentTextarea_xe;editorRelKeys[e]["editor"]=l;editorRelKeys[e]["pasteHTML"]=function(x){l.exec("PASTE_HTML",[x])};xe.Editors[e]=l;l.registerPlugin(new xe.CorePlugin(null));l.registerPlugin(new xe.XE_PreservTemplate(jQuery("#xpress-editor-"+e).val()));l.registerPlugin(new xe.StringConverterManager());l.registerPlugin(new xe.XE_EditingAreaManager("WYSIWYG",f,{nHeight:parseInt(c),nMinHeight:100},null,o));l.registerPlugin(new xe.XE_EditingArea_HTMLSrc(t));l.registerPlugin(new xe.XE_EditingAreaVerticalResizer(o));l.registerPlugin(new xe.Utils());l.registerPlugin(new xe.DialogLayerManager());l.registerPlugin(new xe.ActiveLayerManager());l.registerPlugin(new xe.Hotkey());l.registerPlugin(new xe.XE_WYSIWYGStyler());l.registerPlugin(new xe.XE_WYSIWYGStyleGetter());l.registerPlugin(new xe.MessageManager(xe.XpressCore.oMessageMap));l.registerPlugin(new xe.XE_Toolbar(o));l.registerPlugin(new xe.XE_XHTMLFormatter);l.registerPlugin(new xe.XE_GET_WYSYWYG_MODE(e));if(jQuery("ul.extra1").length){l.registerPlugin(new xe.XE_ColorPalette(o));l.registerPlugin(new xe.XE_FontColor(o));l.registerPlugin(new xe.XE_BGColor(o));l.registerPlugin(new xe.XE_Quote(o));l.registerPlugin(new xe.XE_FontNameWithSelectUI(o));l.registerPlugin(new xe.XE_FontSizeWithSelectUI(o));l.registerPlugin(new xe.XE_LineHeightWithSelectUI(o));l.registerPlugin(new xe.XE_UndoRedo());l.registerPlugin(new xe.XE_Table(o));l.registerPlugin(new xe.XE_Hyperlink(o));l.registerPlugin(new xe.XE_FormatWithSelectUI(o));l.registerPlugin(new xe.XE_SCharacter(o))}if(jQuery("ul.extra2").length){l.registerPlugin(new xe.XE_Extension(o,e))}if(jQuery("ul.extra3").length){l.registerPlugin(new xe.XE_EditingModeToggler(o))}if(jQuery("#editorresize").length){l.registerPlugin(new xe.XE_Editorresize(o,h))}if(!(navigator.appName=="Microsoft Internet Explorer")&&!(navigator.userAgent.indexOf("Presto")>-1)){l.registerPlugin(new xe.XE_WYSIWYGEnterKey(h))}if(s=d._saved_doc_title){l.registerPlugin(new xe.XE_AutoSave(f,o))}function j(){try{var y=h.contentWindow.document,z;if(y.location=="about:blank"){throw"blank"}y.body.innerHTML=y.body.innerHTML.trim();z=y.body.innerHTML;l.registerPlugin(new xe.XE_EditingArea_WYSIWYG(h));l.registerPlugin(new xe.XpressRangeManager(h));l.registerPlugin(new xe.XE_ExecCommand(h));if(w&&!y.body.style.fontFamily){y.body.style.fontFamily=w}if(g&&!y.body.style.fontSize){y.body.style.fontSize=g}l.run()}catch(x){setTimeout(j,0)}}j();return l}function editorGetContentTextarea_xe(d){var e=xe.Editors[d]||null;if(!e){return""}var f=e.getIR();if(!jQuery.trim(f.replace(/( |<\/?(p|br|span|div)([^>]+)?>)/ig,""))){return""}f=f.replace(/
$/i,"");if(f.length<1024){var b=Array("#text","A","BR","IMG","EM","STRONG","SPAN","BIG","CITE","CODE","DD","DFN","HR","INS","KBD","LINK","Q","SAMP","SMALL","SUB","SUP","TT");var a=true;var g=jQuery("
"+f+"
").eq(0);var c=g.contents();jQuery.each(c,function(){if(this.nodeType!=3){if(jQuery.inArray(this.nodeName,b)==-1){a=false}}});if(a){f="

"+f+"

"}}f=f.replace(/src\s?=\s?(["']?)(?:\.\.\/)+(files\/attach\/)/ig,function(k,j,h){return"src="+(j||"")+h});f=f.replace(/\<(\/)?([A-Z]+)([^>]*)\>/ig,function(l,k,j,h){if(h){h=h.replace(/ ([A-Z]+?)\=/ig,function(n,m){m=m.toLowerCase();return" "+m+"="})}else{h=""}j=j.toLowerCase();if(!k){k=""}return"<"+k+j+h+">"});f=f.replace("
","
");return f}function editorGetIframe(a){return jQuery("iframe#editor_iframe_"+a).get(0)}function editorReplaceHTML(c,b){b=editorReplacePath(b);var a=parseInt(c.id.replace(/^.*_/,""),10);editorRelKeys[a]["pasteHTML"](b)}function editorReplacePath(a){a=a.replace(/\<([^\>\<]*)(src=|href=|url\()("|\')*([^"\'\)]+)("|\'|\))*(\s|>)*/ig,function(f,e,d,c,b,j,h){if(d=="url("){c="";j=")"}else{if(typeof(c)=="undefined"){c='"'}if(typeof(j)=="undefined"){j='"'}if(typeof(h)=="undefined"){h=""}}var g=jQuery.trim(b).replace(/^\.\//,"");if(/^(http\:|https\:|ftp\:|telnet\:|mms\:|mailto\:|\/|\.\.|\#)/i.test(g)){return f}return"<"+e+d+c+request_uri+g+j+h});return a}function editorGetAutoSavedDoc(a){var b=new Array();b.mid=current_mid;b.editor_sequence=a.getAttribute("editor_sequence");setTimeout(function(){var c=new Array("error","message","editor_sequence","title","content","document_srl");exec_xml("editor","procEditorLoadSavedDocument",b,function(e,d,f){editorRelKeys[b.editor_sequence]["primary"].value=e.document_srl;if(typeof(uploadSettingObj[b.editor_sequence])=="object"){editorUploadInit(uploadSettingObj[b.editor_sequence],true)}},c)},0)}xe.XE_GET_WYSYWYG_MODE=jQuery.Class({name:"XE_GET_WYSYWYG_MODE",$init:function(a){this.editor_sequence=a},$ON_CHANGE_EDITING_MODE:function(a){editorMode[this.editor_sequence]=(a=="HTMLSrc")?"html":"wysiwyg"}});xe.XE_PreservTemplate=jQuery.Class({name:"XE_PreservTemplate",isRun:false,$BEFORE_SET_IR:function(a){if(!this.isRun&&!a){this.isRun=true;return false}}});xe.XE_Preview=jQuery.Class({name:"XE_Preview",elPreviewButton:null,$init:function(a){this._assignHTMLObjects(a)},_assignHTMLObjects:function(a){this.elPreviewButton=jQuery("BUTTON.xpress_xeditor_preview_button",a)},$ON_MSG_APP_READY:function(){this.oApp.registerBrowserEvent(this.elPreviewButton.get(0),"click","EVENT_PREVIEW",[])},$ON_EVENT_PREVIEW:function(){}});