function editorGetContent(a){var b=editorRelKeys[a].func(a),c=new RegExp(request_uri.replace(/\//g,"\\/")+"(files|common|modules|layouts|widgets)","ig");return b.replace(c,"$1")}function editorFocus(a){try{var b=editorGetIFrame(a);jQuery.isFunction(b.setFocus)?b.setFocus():b.contentWindow.focus()}catch(c){}}function editorEnableAutoSave(a,b,c){var d=a.title.value,e=editorRelKeys[b].content.value;editorAutoSaveObj={fo_obj:a,editor_sequence:b,title:d,content:e,locked:!1},clearTimeout(editorEnableAutoSave.timer),editorEnableAutoSave.timer=setTimeout(function(){_editorAutoSave(!1,c)},5e4)}function _editorAutoSave(a,b){var c=editorAutoSaveObj.fo_obj,d=editorAutoSaveObj.editor_sequence;if(a||(clearTimeout(editorEnableAutoSave.timer),editorEnableAutoSave.timer=setTimeout(function(){_editorAutoSave(a,b)},5e4)),editorAutoSaveObj.locked!==!0&&c&&"undefined"!=typeof c.title&&d){var e=c.title.value,f="";try{f=editorGetContent(d)}catch(g){}if(e!=editorAutoSaveObj.title||f!=editorAutoSaveObj.content||a){var h,i=new Date;h={title:e,content:f,mid:current_mid,document_srl:editorRelKeys[d].primary.value},editorAutoSaveObj.title=e,editorAutoSaveObj.content=f,jQuery("#editor_autosaved_message_"+d).text(i.getHours()+":"+i.getMinutes()+" "+auto_saved_msg).show(300),editorAutoSaveObj.locked=!0,show_waiting_message=!1,exec_xml("editor","procEditorSaveDoc",h,function(){var a=jQuery.extend({},h,{auto_saved_msg:auto_saved_msg});editorAutoSaveObj.locked=!1,jQuery.isFunction(b)&&b(a)}),show_waiting_message=!0}}}function editorRemoveSavedDoc(){var a=[];a.mid=current_mid,exec_xml("editor","procEditorRemoveSavedDoc",a)}function editorGetIFrame(a){return void 0!==editorRelKeys&&void 0!==editorRelKeys[a]&&void 0!==editorRelKeys[a].editor?editorRelKeys[a].editor.getFrame(a):document.getElementById("editor_iframe_"+a)}function editorGetTextarea(a){return document.getElementById("editor_textarea_"+a)}function eOptionOver(a){a.style.marginTop="-21px",a.style.zIndex="99"}function eOptionOut(a){a.style.marginTop="0",a.style.zIndex="1"}function eOptionClick(a){a.style.marginTop="-42px",a.style.zIndex="99"}function editorEventCheck(a){editorPrevNode=null;var b=a.target.id;if(b){var c=b.split("_");if("component"==c[0]){var d=c[1],e=b.replace(/^component_[0-9]+_/,"");if(d&&e&&"html"!=editorMode[d])switch(e){case"Bold":case"Italic":case"Underline":case"StrikeThrough":case"undo":case"redo":case"JustifyLeft":case"JustifyCenter":case"JustifyRight":case"JustifyFull":case"Indent":case"Outdent":case"InsertOrderedList":case"InsertUnorderedList":case"SaveAs":case"Print":case"Copy":case"Cut":case"Paste":case"RemoveFormat":case"Subscript":case"Superscript":editorDo(e,"",d);break;default:return openComponent(e,d),!1}}}}function openComponent(a,b,c){if(editorPrevSrl=b,"html"!=editorMode[b]){var d=request_uri+"?module=editor&act=dispEditorPopup&editor_sequence="+b+"&component="+a;"undefined"!=typeof c&&c&&(d+="&manual_url="+escape(c)),popopen(d,"editorComponent")}}function editorSearchComponent(a){var b=new xEvent(a);editorPrevNode=null;var c,d=b.target,e=d;if(d.getAttribute("widget")){for(;e&&"BODY"!=e.nodeName;)e=xParent(e);if(!e||"BODY"!=e.nodeName||!e.getAttribute("editor_sequence"))return void(editorPrevNode=null);c=e.getAttribute("editor_sequence");var f=d.getAttribute("widget");if(editorPrevNode=d,"html"==editorMode[c])return;return void popopen(request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+f+"&module_srl="+c,"GenerateCodeInPage")}if(!d.getAttribute("editor_component"))for(;d&&!d.getAttribute("editor_component");)d=d.parentElement?d.parentElement:xParent(d);d||(d=b.target);var g=d.getAttribute("editor_component");if(g?editorPrevNode=d:"IMG"!=d.nodeName||d.getAttribute("widget")||(g="image_link",editorPrevNode=d),!g)return void(editorPrevNode=null);for(e=d;e&&"BODY"!=e.nodeName;)e=xParent(e);return e&&"BODY"==e.nodeName&&e.getAttribute("editor_sequence")?(c=e.getAttribute("editor_sequence"),void openComponent(g,c)):void(editorPrevNode=null)}function editorReplaceHTML(a,b){var c,d=/src=("|\'){1}(\.\/)?(files\/attach|files\/cache|files\/faceOff|files\/member_extra_info|modules|common|widgets|widgetstyle|layouts|addons)\/([^"\']+)\.(jpg|jpeg|png|gif)("|\'){1}/g;b=b.replace(d,'src="'+request_uri+'$3/$4.$5"');var e=/href=("|\'){1}(\.\/)?\?([^"\']+)("|\'){1}/g;b=b.replace(e,'href="'+request_uri+'?$3"');a.editor_sequence||a.contentWindow.document.body.getAttribute("editor_sequence");try{a.contentWindow.focus()}catch(f){}if(jQuery.isFunction(a.replaceHTML))a.replaceHTML(b);else if(xIE4Up)c=a.contentWindow.document.selection.createRange(),c.pasteHTML?c.pasteHTML(b):editorPrevNode&&(editorPrevNode.outerHTML=b);else try{"HTML"==a.contentWindow.getSelection().focusNode.tagName?(c=a.contentDocument.createRange(),c.setStart(a.contentDocument.body,0),c.setEnd(a.contentDocument.body,0),c.insertNode(c.createContextualFragment(b))):(c=a.contentWindow.getSelection().getRangeAt(0),c.deleteContents(),c.insertNode(c.createContextualFragment(b)))}catch(f){xInnerHtml(a.contentWindow.document.body,b+xInnerHtml(a.contentWindow.document.body))}}function editorGetSelectedHtml(a){var b,c,d,e=editorGetIFrame(a);return jQuery.isFunction(e.getSelectedHTML)?e.getSelectedHTML():xIE4Up?(b=e.contentWindow.document.selection.createRange(),c=b.htmlText):(b=e.contentWindow.getSelection().getRangeAt(0),d=xCreateElement("div"),d.appendChild(b.cloneContents()),c=xInnerHtml(d))}var editorMode=[],editorAutoSaveObj={fo_obj:null,editor_sequence:0,title:"",content:"",locked:!1},editorRelKeys=[],editorDragObj={isDrag:!1,y:0,obj:null,id:"",det:0,source_height:0};editorEnableAutoSave.timer=null;var editorPrevSrl=null;jQuery(document).click(editorEventCheck);var editorPrevNode=null;!function(a){}(jQuery);