function TinyMCE_Engine(){var A;this.majorVersion="2";this.minorVersion="1.0";this.releaseDate="2007-02-13";this.instances=new Array();this.switchClassCache=new Array();this.windowArgs=new Array();this.loadedFiles=new Array();this.pendingFiles=new Array();this.loadingIndex=0;this.configs=new Array();this.currentConfig=0;this.eventHandlers=new Array();this.log=new Array();this.undoLevels=[];this.undoIndex=0;this.typingUndoIndex=-1;A=navigator.userAgent;this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isMSIE5=this.isMSIE&&(A.indexOf("MSIE 5")!=-1);this.isMSIE5_0=this.isMSIE&&(A.indexOf("MSIE 5.0")!=-1);this.isMSIE7=this.isMSIE&&(A.indexOf("MSIE 7")!=-1);this.isGecko=A.indexOf("Gecko")!=-1;this.isSafari=A.indexOf("Safari")!=-1;this.isOpera=A.indexOf("Opera")!=-1;this.isMac=A.indexOf("Mac")!=-1;this.isNS7=A.indexOf("Netscape/7")!=-1;this.isNS71=A.indexOf("Netscape/7.1")!=-1;this.dialogCounter=0;this.plugins=new Array();this.themes=new Array();this.menus=new Array();this.loadedPlugins=new Array();this.buttonMap=new Array();this.isLoaded=false;if(this.isOpera){this.isMSIE=true;this.isGecko=false;this.isSafari=false}this.isIE=this.isMSIE;this.isRealIE=this.isMSIE&&!this.isOpera;this.idCounter=0}TinyMCE_Engine.prototype={init:function(F){var H,C,M="",I;if(this.isMSIE5_0){return }this.settings=F;if(typeof (document.execCommand)=="undefined"){return }if(!tinyMCE.baseURL){var B=document.getElementsByTagName("script");C=document.getElementsByTagName("base");for(I=0;I<C.length;I++){if(C[I].href){M=C[I].href}}for(var I=0;I<B.length;I++){if(B[I].src&&(B[I].src.indexOf("tiny_mce.js")!=-1||B[I].src.indexOf("tiny_mce_dev.js")!=-1||B[I].src.indexOf("tiny_mce_src.js")!=-1||B[I].src.indexOf("tiny_mce_gzip")!=-1)){var A=B[I].src;tinyMCE.srcMode=(A.indexOf("_src")!=-1||A.indexOf("_dev")!=-1)?"_src":"";tinyMCE.gzipMode=A.indexOf("_gzip")!=-1;A=A.substring(0,A.lastIndexOf("/"));if(F.exec_mode=="src"||F.exec_mode=="normal"){tinyMCE.srcMode=F.exec_mode=="src"?"_src":""}if(M!=""&&A.indexOf("://")==-1){tinyMCE.baseURL=M+A}else{tinyMCE.baseURL=A}break}}}this.documentBasePath=document.location.href;if(this.documentBasePath.indexOf("?")!=-1){this.documentBasePath=this.documentBasePath.substring(0,this.documentBasePath.indexOf("?"))}this.documentURL=this.documentBasePath;this.documentBasePath=this.documentBasePath.substring(0,this.documentBasePath.lastIndexOf("/"));if(tinyMCE.baseURL.indexOf("://")==-1&&tinyMCE.baseURL.charAt(0)!="/"){tinyMCE.baseURL=this.documentBasePath+"/"+tinyMCE.baseURL}this._def("mode","none");this._def("theme","advanced");this._def("plugins","",true);this._def("language","en");this._def("docs_language",this.settings["language"]);this._def("elements","");this._def("textarea_trigger","mce_editable");this._def("editor_selector","");this._def("editor_deselector","mceNoEditor");this._def("valid_elements","+a[id|style|rel|rev|charset|hreflang|dir|lang|tabindex|accesskey|type|name|href|target|title|class|onfocus|onblur|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup],-strong/-b[class|style],-em/-i[class|style],-strike[class|style],-u[class|style],#p[id|style|dir|class|align],-ol[class|style],-ul[class|style],-li[class|style],br,img[id|dir|lang|longdesc|usemap|style|class|src|onmouseover|onmouseout|border|alt=|title|hspace|vspace|width|height|align],-sub[style|class],-sup[style|class],-blockquote[dir|style],-table[border=0|cellspacing|cellpadding|width|height|class|align|summary|style|dir|id|lang|bgcolor|background|bordercolor],-tr[id|lang|dir|class|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor],tbody[id|class],thead[id|class],tfoot[id|class],#td[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|bgcolor|background|bordercolor|scope],-th[id|lang|dir|class|colspan|rowspan|width|height|align|valign|style|scope],caption[id|lang|dir|class|style],-div[id|dir|class|align|style],-span[style|class|align],-pre[class|align|style],address[class|align|style],-h1[id|style|dir|class|align],-h2[id|style|dir|class|align],-h3[id|style|dir|class|align],-h4[id|style|dir|class|align],-h5[id|style|dir|class|align],-h6[id|style|dir|class|align],hr[class|style],-font[face|size|style|id|class|dir|color],dd[id|class|title|style|dir|lang],dl[id|class|title|style|dir|lang],dt[id|class|title|style|dir|lang],cite[title|id|class|style|dir|lang],abbr[title|id|class|style|dir|lang],acronym[title|id|class|style|dir|lang],del[title|id|class|style|dir|lang|datetime|cite],ins[title|id|class|style|dir|lang|datetime|cite]");this._def("extended_valid_elements","");this._def("invalid_elements","");this._def("encoding","");this._def("urlconverter_callback",tinyMCE.getParam("urlconvertor_callback","TinyMCE_Engine.prototype.convertURL"));this._def("save_callback","");this._def("debug",false);this._def("force_br_newlines",false);this._def("force_p_newlines",true);this._def("add_form_submit_trigger",true);this._def("relative_urls",false);this._def("remove_script_host",true);this._def("focus_alert",true);this._def("document_base_url",this.documentURL);this._def("visual",true);this._def("visual_table_class","mceVisualAid");this._def("setupcontent_callback","");this._def("fix_content_duplication",true);this._def("custom_undo_redo",true);this._def("custom_undo_redo_levels",-1);this._def("custom_undo_redo_keyboard_shortcuts",true);this._def("custom_undo_redo_restore_selection",true);this._def("custom_undo_redo_global",false);this._def("verify_html",true);this._def("apply_source_formatting",false);this._def("directionality","ltr");this._def("cleanup_on_startup",false);this._def("inline_styles",false);this._def("convert_newlines_to_brs",false);this._def("auto_reset_designmode",true);this._def("entities","39,#39,160,nbsp,161,iexcl,162,cent,163,pound,164,curren,165,yen,166,brvbar,167,sect,168,uml,169,copy,170,ordf,171,laquo,172,not,173,shy,174,reg,175,macr,176,deg,177,plusmn,178,sup2,179,sup3,180,acute,181,micro,182,para,183,middot,184,cedil,185,sup1,186,ordm,187,raquo,188,frac14,189,frac12,190,frac34,191,iquest,192,Agrave,193,Aacute,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,201,Eacute,202,Ecirc,203,Euml,204,Igrave,205,Iacute,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,211,Oacute,212,Ocirc,213,Otilde,214,Ouml,215,times,216,Oslash,217,Ugrave,218,Uacute,219,Ucirc,220,Uuml,221,Yacute,222,THORN,223,szlig,224,agrave,225,aacute,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,233,eacute,234,ecirc,235,euml,236,igrave,237,iacute,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,243,oacute,244,ocirc,245,otilde,246,ouml,247,divide,248,oslash,249,ugrave,250,uacute,251,ucirc,252,uuml,253,yacute,254,thorn,255,yuml,402,fnof,913,Alpha,914,Beta,915,Gamma,916,Delta,917,Epsilon,918,Zeta,919,Eta,920,Theta,921,Iota,922,Kappa,923,Lambda,924,Mu,925,Nu,926,Xi,927,Omicron,928,Pi,929,Rho,931,Sigma,932,Tau,933,Upsilon,934,Phi,935,Chi,936,Psi,937,Omega,945,alpha,946,beta,947,gamma,948,delta,949,epsilon,950,zeta,951,eta,952,theta,953,iota,954,kappa,955,lambda,956,mu,957,nu,958,xi,959,omicron,960,pi,961,rho,962,sigmaf,963,sigma,964,tau,965,upsilon,966,phi,967,chi,968,psi,969,omega,977,thetasym,978,upsih,982,piv,8226,bull,8230,hellip,8242,prime,8243,Prime,8254,oline,8260,frasl,8472,weierp,8465,image,8476,real,8482,trade,8501,alefsym,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8704,forall,8706,part,8707,exist,8709,empty,8711,nabla,8712,isin,8713,notin,8715,ni,8719,prod,8721,sum,8722,minus,8727,lowast,8730,radic,8733,prop,8734,infin,8736,ang,8743,and,8744,or,8745,cap,8746,cup,8747,int,8756,there4,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8804,le,8805,ge,8834,sub,8835,sup,8836,nsub,8838,sube,8839,supe,8853,oplus,8855,otimes,8869,perp,8901,sdot,8968,lceil,8969,rceil,8970,lfloor,8971,rfloor,9001,lang,9002,rang,9674,loz,9824,spades,9827,clubs,9829,hearts,9830,diams,34,quot,38,amp,60,lt,62,gt,338,OElig,339,oelig,352,Scaron,353,scaron,376,Yuml,710,circ,732,tilde,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,8211,ndash,8212,mdash,8216,lsquo,8217,rsquo,8218,sbquo,8220,ldquo,8221,rdquo,8222,bdquo,8224,dagger,8225,Dagger,8240,permil,8249,lsaquo,8250,rsaquo,8364,euro",true);this._def("entity_encoding","named");this._def("cleanup_callback","");this._def("add_unload_trigger",true);this._def("ask",false);this._def("nowrap",false);this._def("auto_resize",false);this._def("auto_focus",false);this._def("cleanup",true);this._def("remove_linebreaks",true);this._def("button_tile_map",false);this._def("submit_patch",true);this._def("browsers","msie,safari,gecko,opera",true);this._def("dialog_type","window");this._def("accessibility_warnings",true);this._def("accessibility_focus",true);this._def("merge_styles_invalid_parents","");this._def("force_hex_style_colors",true);this._def("trim_span_elements",true);this._def("convert_fonts_to_spans",false);this._def("doctype",'<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');this._def("font_size_classes","");this._def("font_size_style_values","xx-small,x-small,small,medium,large,x-large,xx-large",true);this._def("event_elements","a,img",true);this._def("convert_urls",true);this._def("table_inline_editing",false);this._def("object_resizing",true);this._def("custom_shortcuts",true);this._def("convert_on_click",false);this._def("content_css","");this._def("fix_list_elements",true);this._def("fix_table_elements",false);this._def("strict_loading_mode",document.contentType=="application/xhtml+xml");this._def("hidden_tab_class","");this._def("display_tab_class","");this._def("gecko_spellcheck",false);this._def("hide_selects_on_submit",true);if(this.isMSIE&&!this.isOpera){this.settings.strict_loading_mode=false}if(this.isMSIE&&this.settings["browsers"].indexOf("msie")==-1){return }if(this.isGecko&&this.settings["browsers"].indexOf("gecko")==-1){return }if(this.isSafari&&this.settings["browsers"].indexOf("safari")==-1){return }if(this.isOpera&&this.settings["browsers"].indexOf("opera")==-1){return }M=tinyMCE.settings["document_base_url"];var J=document.location.href;var D=J.indexOf("://");if(D>0&&document.location.protocol!="file:"){D=J.indexOf("/",D+3);J=J.substring(0,D);if(M.indexOf("://")==-1){M=J+M}tinyMCE.settings["document_base_url"]=M;tinyMCE.settings["document_base_prefix"]=J}if(M.indexOf("?")!=-1){M=M.substring(0,M.indexOf("?"))}this.settings["base_href"]=M.substring(0,M.lastIndexOf("/"))+"/";H=this.settings["theme"];this.inlineStrict="A|BR|SPAN|BDO|MAP|OBJECT|IMG|TT|I|B|BIG|SMALL|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|#text|#comment";this.inlineTransitional="A|BR|SPAN|BDO|OBJECT|APPLET|IMG|MAP|IFRAME|TT|I|B|U|S|STRIKE|BIG|SMALL|FONT|BASEFONT|EM|STRONG|DFN|CODE|Q|SAMP|KBD|VAR|CITE|ABBR|ACRONYM|SUB|SUP|INPUT|SELECT|TEXTAREA|LABEL|BUTTON|#text|#comment";this.blockElms="H[1-6]|P|DIV|ADDRESS|PRE|FORM|TABLE|LI|OL|UL|TD|BLOCKQUOTE|CENTER|DL|DT|DD|DIR|FIELDSET|FORM|NOSCRIPT|NOFRAMES|MENU|ISINDEX|SAMP";this.blockRegExp=new RegExp("^("+this.blockElms+")$","i");this.posKeyCodes=new Array(13,45,36,35,33,34,37,38,39,40);this.uniqueURL="javascript:void(091039730);";this.uniqueTag='<div id="mceTMPElement" style="display: none">TMP</div>';this.callbacks=new Array("onInit","getInfo","getEditorTemplate","setupContent","onChange","onPageLoad","handleNodeChange","initInstance","execCommand","getControlHTML","handleEvent","cleanup","removeInstance");this.settings["theme_href"]=tinyMCE.baseURL+"/themes/"+H;if(!tinyMCE.isIE||tinyMCE.isOpera){this.settings["force_br_newlines"]=false}if(tinyMCE.getParam("popups_css",false)){var G=tinyMCE.getParam("popups_css","");if(G.indexOf("://")==-1&&G.charAt(0)!="/"){this.settings["popups_css"]=this.documentBasePath+"/"+G}else{this.settings["popups_css"]=G}}else{this.settings["popups_css"]=tinyMCE.baseURL+"/themes/"+H+"/css/editor_popup.css"}if(tinyMCE.getParam("editor_css",false)){var G=tinyMCE.getParam("editor_css","");if(G.indexOf("://")==-1&&G.charAt(0)!="/"){this.settings["editor_css"]=this.documentBasePath+"/"+G}else{this.settings["editor_css"]=G}}else{if(this.settings.editor_css!=""){this.settings["editor_css"]=tinyMCE.baseURL+"/themes/"+H+"/css/editor_ui.css"}}if(tinyMCE.settings["debug"]){var E="Debug: \n";E+="baseURL: "+this.baseURL+"\n";E+="documentBasePath: "+this.documentBasePath+"\n";E+="content_css: "+this.settings["content_css"]+"\n";E+="popups_css: "+this.settings["popups_css"]+"\n";E+="editor_css: "+this.settings["editor_css"]+"\n";alert(E)}if(this.configs.length==0){if(typeof (TinyMCECompressed)=="undefined"){tinyMCE.addEvent(window,"DOMContentLoaded",TinyMCE_Engine.prototype.onLoad);if(tinyMCE.isRealIE){if(document.body){tinyMCE.addEvent(document.body,"readystatechange",TinyMCE_Engine.prototype.onLoad)}else{tinyMCE.addEvent(document,"readystatechange",TinyMCE_Engine.prototype.onLoad)}}tinyMCE.addEvent(window,"load",TinyMCE_Engine.prototype.onLoad);tinyMCE._addUnloadEvents()}}this.loadScript(tinyMCE.baseURL+"/themes/"+this.settings["theme"]+"/editor_template"+tinyMCE.srcMode+".js");this.loadScript(tinyMCE.baseURL+"/langs/"+this.settings["language"]+".js");this.loadCSS(this.settings["editor_css"]);var D=tinyMCE.getParam("plugins","",true,",");if(D.length>0){for(var I=0;I<D.length;I++){if(D[I].charAt(0)!="-"){this.loadScript(tinyMCE.baseURL+"/plugins/"+D[I]+"/editor_plugin"+tinyMCE.srcMode+".js")}}}if(tinyMCE.getParam("entity_encoding")=="named"){F["cleanup_entities"]=new Array();var K=tinyMCE.getParam("entities","",true,",");for(var I=0;I<K.length;I+=2){F["cleanup_entities"]["c"+K[I]]=K[I+1]}}F["index"]=this.configs.length;this.configs[this.configs.length]=F;this.loadNextScript();if(this.isIE&&!this.isOpera){try{document.execCommand("BackgroundImageCache",false,true)}catch(L){}}this.xmlEncodeAposRe=new RegExp("[<>&\"']","g");this.xmlEncodeRe=new RegExp('[<>&"]',"g")},_addUnloadEvents:function(){if(tinyMCE.isIE){if(tinyMCE.settings["add_unload_trigger"]){tinyMCE.addEvent(window,"unload",TinyMCE_Engine.prototype.unloadHandler);tinyMCE.addEvent(window.document,"beforeunload",TinyMCE_Engine.prototype.unloadHandler)}}else{if(tinyMCE.settings["add_unload_trigger"]){tinyMCE.addEvent(window,"unload",function(){tinyMCE.triggerSave(true,true)})}}},_def:function(D,B,C){var A=tinyMCE.getParam(D,B);A=C?A.replace(/\s+/g,""):A;this.settings[D]=A},hasPlugin:function(A){return typeof (this.plugins[A])!="undefined"&&this.plugins[A]!=null},addPlugin:function(C,A){var B=this.plugins[C];A.baseURL=B?B.baseURL:tinyMCE.baseURL+"/plugins/"+C;this.plugins[C]=A;this.loadNextScript()},setPluginBaseURL:function(C,A){var B=this.plugins[C];if(B){B.baseURL=A}else{this.plugins[C]={baseURL:A}}},loadPlugin:function(B,A){A=A.indexOf(".js")!=-1?A.substring(0,A.lastIndexOf("/")):A;A=A.charAt(A.length-1)=="/"?A.substring(0,A.length-1):A;this.plugins[B]={baseURL:A};this.loadScript(A+"/editor_plugin"+(tinyMCE.srcMode?"_src":"")+".js")},hasTheme:function(A){return typeof (this.themes[A])!="undefined"&&this.themes[A]!=null},addTheme:function(B,A){this.themes[B]=A;this.loadNextScript()},addMenu:function(B,A){this.menus[B]=A},hasMenu:function(A){return typeof (this.plugins[A])!="undefined"&&this.plugins[A]!=null},loadScript:function(A){var B;for(B=0;B<this.loadedFiles.length;B++){if(this.loadedFiles[B]==A){return }}if(tinyMCE.settings.strict_loading_mode){this.pendingFiles[this.pendingFiles.length]=A}else{document.write('<script language="javascript" type="text/javascript" src="'+A+'"><\/script>')}this.loadedFiles[this.loadedFiles.length]=A},loadNextScript:function(){var B=document,A;if(!tinyMCE.settings.strict_loading_mode){return }if(this.loadingIndex<this.pendingFiles.length){A=B.createElementNS("http://www.w3.org/1999/xhtml","script");A.setAttribute("language","javascript");A.setAttribute("type","text/javascript");A.setAttribute("src",this.pendingFiles[this.loadingIndex++]);B.getElementsByTagName("head")[0].appendChild(A)}else{this.loadingIndex=-1}},loadCSS:function(C){var D=C.replace(/\s+/,"").split(",");var F=0,I=0;var H=false;var G=0,E=0,B,A;for(G=0,I=D.length;G<I;G++){if(D[G]!=null&&D[G]!="null"&&D[G].length>0){for(E=0,F=this.loadedFiles.length;E<F;E++){if(this.loadedFiles[E]==D[G]){H=true;break}}if(!H){if(tinyMCE.settings.strict_loading_mode){B=document.getElementsByTagName("head");A=document.createElement("link");A.setAttribute("href",D[G]);A.setAttribute("rel","stylesheet");A.setAttribute("type","text/css");B[0].appendChild(A)}else{document.write('<link href="'+D[G]+'" rel="stylesheet" type="text/css" />')}this.loadedFiles[this.loadedFiles.length]=D[G]}}}},importCSS:function(G,E){var D=E.replace(/\s+/,"").split(",");var F,H,B,A,C;for(A=0,F=D.length;A<F;A++){C=D[A];if(C!=null&&C!="null"&&C.length>0){if(C.indexOf("://")==-1&&C.charAt(0)!="/"){C=this.documentBasePath+"/"+C}if(typeof (G.createStyleSheet)=="undefined"){H=G.createElement("link");H.rel="stylesheet";H.href=C;if((B=G.getElementsByTagName("head"))!=null&&B.length>0){B[0].appendChild(H)}}else{G.createStyleSheet(C)}}}},confirmAdd:function(C,B){var D=tinyMCE.isIE?event.srcElement:C.target;var A=D.name?D.name:D.id;tinyMCE.settings=B;if(tinyMCE.settings["convert_on_click"]||(!D.getAttribute("mce_noask")&&confirm(tinyMCELang["lang_edit_confirm"]))){tinyMCE.addMCEControl(D,A)}D.setAttribute("mce_noask","true")},updateContent:function(A){var B=document.getElementById(A);for(var E in tinyMCE.instances){var C=tinyMCE.instances[E];if(!tinyMCE.isInstance(C)){continue}C.switchSettings();if(C.formElement==B){var D=C.getDoc();tinyMCE._setHTML(D,C.formElement.value);if(!tinyMCE.isIE){D.body.innerHTML=tinyMCE._cleanupHTML(C,D,this.settings,D.body,C.visualAid)}}}},addMCEControl:function(D,A,B){var E="mce_editor_"+tinyMCE.idCounter++;var C=new TinyMCE_Control(tinyMCE.settings);C.editorId=E;this.instances[E]=C;C._onAdd(D,A,B)},removeInstance:function(C){var B=[],D,A;for(D in tinyMCE.instances){A=tinyMCE.instances[D];if(tinyMCE.isInstance(A)&&C!=A){B[D]=A}}tinyMCE.instances=B;D=[];B=tinyMCE.undoLevels;for(A=0;A<B.length;A++){if(B[A]!=C){D.push(B[A])}}tinyMCE.undoLevels=D;tinyMCE.undoIndex=D.length;tinyMCE.dispatchCallback(C,"remove_instance_callback","removeInstance",C);return C},removeMCEControl:function(F){var E=tinyMCE.getInstanceById(F),C,B,D,A;if(E){E.switchSettings();F=E.editorId;C=tinyMCE.getContent(F);this.removeInstance(E);tinyMCE.selectedElement=null;tinyMCE.selectedInstance=null;B=document.getElementById(F+"_parent");D=E.oldTargetElement;A=D.nodeName.toLowerCase();if(A=="textarea"||A=="input"){B.parentNode.removeChild(B);D.style.display="inline";D.value=C}else{D.innerHTML=C;D.style.display="block";B.parentNode.insertBefore(D,B);B.parentNode.removeChild(B)}}},triggerSave:function(B,A){var C,D;if(typeof (B)=="undefined"){B=false}if(typeof (A)=="undefined"){A=false}for(D in tinyMCE.instances){C=tinyMCE.instances[D];if(!tinyMCE.isInstance(C)){continue}C.triggerSave(B,A)}},resetForm:function(D){var B,C,E,A=document.forms[D];for(E in tinyMCE.instances){C=tinyMCE.instances[E];if(!tinyMCE.isInstance(C)){continue}C.switchSettings();for(B=0;B<A.elements.length;B++){if(C.formTargetElementId==A.elements[B].name){C.getBody().innerHTML=C.startContent}}}},execInstanceCommand:function(F,E,G,D,A){var C=tinyMCE.getInstanceById(F),B;if(C){B=C.selection.getRng();if(typeof (A)=="undefined"){A=true}if(A&&(!B||!B.item)){C.contentWindow.focus()}C.autoResetDesignMode();this.selectedElement=C.getFocusElement();C.select();tinyMCE.execCommand(E,G,D);if(tinyMCE.isIE&&window.event!=null){tinyMCE.cancelEvent(window.event)}}},execCommand:function(F,H,C){var B=tinyMCE.selectedInstance;H=H?H:false;C=C?C:null;if(B){B.switchSettings()}switch(F){case"Undo":if(this.getParam("custom_undo_redo_global")){if(this.undoIndex>0){tinyMCE.nextUndoRedoAction="Undo";B=this.undoLevels[--this.undoIndex];B.select();if(!tinyMCE.nextUndoRedoInstanceId){B.execCommand("Undo")}}}else{B.execCommand("Undo")}return true;case"Redo":if(this.getParam("custom_undo_redo_global")){if(this.undoIndex<=this.undoLevels.length-1){tinyMCE.nextUndoRedoAction="Redo";B=this.undoLevels[this.undoIndex++];B.select();if(!tinyMCE.nextUndoRedoInstanceId){B.execCommand("Redo")}}}else{B.execCommand("Redo")}return true;case"mceFocus":var B=tinyMCE.getInstanceById(C);if(B){B.getWin().focus()}return ;case"mceAddControl":case"mceAddEditor":tinyMCE.addMCEControl(tinyMCE._getElementById(C),C);return ;case"mceAddFrameControl":tinyMCE.addMCEControl(tinyMCE._getElementById(C["element"],C["document"]),C["element"],C["document"]);return ;case"mceRemoveControl":case"mceRemoveEditor":tinyMCE.removeMCEControl(C);return ;case"mceToggleEditor":var B=tinyMCE.getInstanceById(C),A,E;if(B){A=document.getElementById(B.editorId+"_parent");E=B.oldTargetElement;if(typeof (B.enabled)=="undefined"){B.enabled=true}B.enabled=!B.enabled;if(!B.enabled){A.style.display="none";E.value=B.getHTML();E.style.display=B.oldTargetDisplay;tinyMCE.dispatchCallback(B,"hide_instance_callback","hideInstance",B)}else{A.style.display="block";E.style.display="none";B.setHTML(E.value);B.useCSS=false;tinyMCE.dispatchCallback(B,"show_instance_callback","showInstance",B)}}else{tinyMCE.addMCEControl(tinyMCE._getElementById(C),C)}return ;case"mceResetDesignMode":if(!tinyMCE.isIE){for(var G in tinyMCE.instances){if(!tinyMCE.isInstance(tinyMCE.instances[G])){continue}try{tinyMCE.instances[G].getDoc().designMode="on"}catch(D){}}}return }if(B){B.execCommand(F,H,C)}else{if(tinyMCE.settings["focus_alert"]){alert(tinyMCELang["lang_focus_alert"])}}},_createIFrame:function(F,E,D){var B,G=F.getAttribute("id");var C,A;if(typeof (E)=="undefined"){E=document}if(typeof (D)=="undefined"){D=window}B=E.createElement("iframe");C=""+tinyMCE.settings["area_width"];A=""+tinyMCE.settings["area_height"];if(C.indexOf("%")==-1){C=parseInt(C);C=(isNaN(C)||C<0)?300:C;C=C+"px"}if(A.indexOf("%")==-1){A=parseInt(A);A=(isNaN(A)||A<0)?240:A;A=A+"px"}B.setAttribute("id",G);B.setAttribute("name",G);B.setAttribute("class","mceEditorIframe");B.setAttribute("border","0");B.setAttribute("frameBorder","0");B.setAttribute("marginWidth","0");B.setAttribute("marginHeight","0");B.setAttribute("leftMargin","0");B.setAttribute("topMargin","0");B.setAttribute("width",C);B.setAttribute("height",A);B.setAttribute("allowtransparency","true");B.className="mceEditorIframe";if(tinyMCE.settings["auto_resize"]){B.setAttribute("scrolling","no")}if(tinyMCE.isRealIE){B.setAttribute("src",this.settings["default_document"])}B.style.width=C;B.style.height=A;if(tinyMCE.settings.strict_loading_mode){B.style.marginBottom="-5px"}if(tinyMCE.isRealIE){F.outerHTML=B.outerHTML}else{F.parentNode.replaceChild(B,F)}if(tinyMCE.isRealIE){return D.frames[G]}else{return B}},setupContent:function(editor_id){var inst=tinyMCE.instances[editor_id],i;var doc=inst.getDoc();var head=doc.getElementsByTagName("head").item(0);var content=inst.startContent;if(tinyMCE.settings.strict_loading_mode){content=content.replace(/&lt;/g,"<");content=content.replace(/&gt;/g,">");content=content.replace(/&quot;/g,'"');content=content.replace(/&amp;/g,"&")}tinyMCE.selectedInstance=inst;inst.switchSettings();if(!tinyMCE.isIE&&tinyMCE.getParam("setupcontent_reload",false)&&doc.title!="blank_page"){try{doc.location.href=tinyMCE.baseURL+"/blank.htm"}catch(ex){}window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",1000);return }if(!head){window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",10);return }tinyMCE.importCSS(inst.getDoc(),tinyMCE.baseURL+"/themes/"+inst.settings["theme"]+"/css/editor_content.css");tinyMCE.importCSS(inst.getDoc(),inst.settings["content_css"]);tinyMCE.dispatchCallback(inst,"init_instance_callback","initInstance",inst);if(tinyMCE.getParam("custom_undo_redo_keyboard_shortcuts")){inst.addShortcut("ctrl","z","lang_undo_desc","Undo");inst.addShortcut("ctrl","y","lang_redo_desc","Redo")}for(i=1;i<=6;i++){inst.addShortcut("ctrl",""+i,"","FormatBlock",false,"<h"+i+">")}inst.addShortcut("ctrl","7","","FormatBlock",false,"<p>");inst.addShortcut("ctrl","8","","FormatBlock",false,"<div>");inst.addShortcut("ctrl","9","","FormatBlock",false,"<address>");if(tinyMCE.isGecko){inst.addShortcut("ctrl","b","lang_bold_desc","Bold");inst.addShortcut("ctrl","i","lang_italic_desc","Italic");inst.addShortcut("ctrl","u","lang_underline_desc","Underline")}if(tinyMCE.getParam("convert_fonts_to_spans")){inst.getBody().setAttribute("id","mceSpanFonts")}if(tinyMCE.settings["nowrap"]){doc.body.style.whiteSpace="nowrap"}doc.body.dir=this.settings["directionality"];doc.editorId=editor_id;if(!tinyMCE.isIE){doc.documentElement.editorId=editor_id}inst.setBaseHREF(tinyMCE.settings["base_href"]);if(tinyMCE.settings["convert_newlines_to_brs"]){content=tinyMCE.regexpReplace(content,"\r\n","<br />","gi");content=tinyMCE.regexpReplace(content,"\r","<br />","gi");content=tinyMCE.regexpReplace(content,"\n","<br />","gi")}content=tinyMCE.storeAwayURLs(content);content=tinyMCE._customCleanup(inst,"insert_to_editor",content);if(tinyMCE.isIE){window.setInterval('try{tinyMCE.getCSSClasses(tinyMCE.instances["'+editor_id+'"].getDoc(), "'+editor_id+'");}catch(e){}',500);if(tinyMCE.settings["force_br_newlines"]){doc.styleSheets[0].addRule("p","margin: 0;")}var body=inst.getBody();body.editorId=editor_id}content=tinyMCE.cleanupHTMLCode(content);if(!tinyMCE.isIE){var contentElement=inst.getDoc().createElement("body");var doc=inst.getDoc();contentElement.innerHTML=content;if(tinyMCE.isGecko&&tinyMCE.settings["remove_lt_gt"]){content=content.replace(new RegExp("&lt;&gt;","g"),"")}if(tinyMCE.settings["cleanup_on_startup"]){tinyMCE.setInnerHTML(inst.getBody(),tinyMCE._cleanupHTML(inst,doc,this.settings,contentElement))}else{tinyMCE.setInnerHTML(inst.getBody(),content)}tinyMCE.convertAllRelativeURLs(inst.getBody())}else{if(tinyMCE.settings["cleanup_on_startup"]){tinyMCE._setHTML(inst.getDoc(),content);eval("try {tinyMCE.setInnerHTML(inst.getBody(), tinyMCE._cleanupHTML(inst, inst.contentDocument, this.settings, inst.getBody()));} catch(e) {}")}else{tinyMCE._setHTML(inst.getDoc(),content)}}tinyMCE.handleVisualAid(inst.getBody(),true,tinyMCE.settings["visual"],inst);tinyMCE.dispatchCallback(inst,"setupcontent_callback","setupContent",editor_id,inst.getBody(),inst.getDoc());if(!tinyMCE.isIE){tinyMCE.addEventHandlers(inst)}if(tinyMCE.isIE){tinyMCE.addEvent(inst.getBody(),"blur",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(inst.getBody(),"beforedeactivate",TinyMCE_Engine.prototype._eventPatch);if(!tinyMCE.isOpera){tinyMCE.addEvent(doc.body,"mousemove",TinyMCE_Engine.prototype.onMouseMove);tinyMCE.addEvent(doc.body,"beforepaste",TinyMCE_Engine.prototype._eventPatch);tinyMCE.addEvent(doc.body,"drop",TinyMCE_Engine.prototype._eventPatch)}}inst.select();tinyMCE.selectedElement=inst.contentWindow.document.body;tinyMCE._customCleanup(inst,"insert_to_editor_dom",inst.getBody());tinyMCE._customCleanup(inst,"setup_content_dom",inst.getBody());tinyMCE._setEventsEnabled(inst.getBody(),false);tinyMCE.cleanupAnchors(inst.getDoc());if(tinyMCE.getParam("convert_fonts_to_spans")){tinyMCE.convertSpansToFonts(inst.getDoc())}inst.startContent=tinyMCE.trim(inst.getBody().innerHTML);inst.undoRedo.add({content:inst.startContent});if(tinyMCE.isGecko){tinyMCE.selectNodes(inst.getBody(),function(n){if(n.nodeType==3||n.nodeType==8){n.nodeValue=n.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)="[^"]*"',"gi"),"")}return false})}if(tinyMCE.isGecko){inst.getBody().spellcheck=tinyMCE.getParam("gecko_spellcheck")}tinyMCE._removeInternal(inst.getBody());inst.select();tinyMCE.triggerNodeChange(false,true)},storeAwayURLs:function(A){if(!A.match(/(mce_src|mce_href)/gi,A)){A=A.replace(new RegExp('src\\s*=\\s*"([^ >"]*)"',"gi"),'src="$1" mce_src="$1"');A=A.replace(new RegExp('href\\s*=\\s*"([^ >"]*)"',"gi"),'href="$1" mce_href="$1"')}return A},_removeInternal:function(A){if(tinyMCE.isGecko){tinyMCE.selectNodes(A,function(B){if(B.nodeType==3||B.nodeType==8){B.nodeValue=B.nodeValue.replace(new RegExp('\\s(mce_src|mce_href)="[^"]*"',"gi"),"")}return false})}},removeTinyMCEFormElements:function(B){var C,A;if(!tinyMCE.getParam("hide_selects_on_submit")){return }if(typeof (B)=="undefined"||B==null){return }if(B.nodeName!="FORM"){if(B.form){B=B.form}else{B=tinyMCE.getParentElement(B,"form")}}if(B==null){return }for(C=0;C<B.elements.length;C++){A=B.elements[C].name?B.elements[C].name:B.elements[C].id;if(A.indexOf("mce_editor_")==0){B.elements[C].disabled=true}}},handleEvent:function(G){var D=tinyMCE.selectedInstance;if(typeof (tinyMCE)=="undefined"){return true}if(tinyMCE.executeCallback(tinyMCE.selectedInstance,"handle_event_callback","handleEvent",G)){return false}switch(G.type){case"beforedeactivate":case"blur":if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.execCommand("mceEndTyping")}tinyMCE.hideMenus();return ;case"drop":case"beforepaste":if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.setBaseHREF(null)}if(tinyMCE.isRealIE){var N=tinyMCE.selectedInstance.iframeElement;if(N.style.height.indexOf("%")!=-1){N._oldHeight=N.style.height;N.style.height=N.clientHeight}}window.setTimeout("tinyMCE.selectedInstance.setBaseHREF(tinyMCE.settings['base_href']);tinyMCE._resetIframeHeight();",1);return ;case"submit":tinyMCE.removeTinyMCEFormElements(tinyMCE.isMSIE?window.event.srcElement:G.target);tinyMCE.triggerSave();tinyMCE.isNotDirty=true;return ;case"reset":var E=tinyMCE.isIE?window.event.srcElement:G.target;for(var C=0;C<document.forms.length;C++){if(document.forms[C]==E){window.setTimeout("tinyMCE.resetForm("+C+");",10)}}return ;case"keypress":if(D&&D.handleShortcut(G)){return false}if(G.target.editorId){tinyMCE.instances[G.target.editorId].select()}else{if(G.target.ownerDocument.editorId){tinyMCE.instances[G.target.ownerDocument.editorId].select()}}if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.switchSettings()}if((tinyMCE.isGecko||tinyMCE.isOpera||tinyMCE.isSafari)&&tinyMCE.settings["force_p_newlines"]&&G.keyCode==13&&!G.shiftKey){if(TinyMCE_ForceParagraphs._insertPara(tinyMCE.selectedInstance,G)){tinyMCE.execCommand("mceAddUndoLevel");return tinyMCE.cancelEvent(G)}}if((tinyMCE.isGecko&&!tinyMCE.isSafari)&&tinyMCE.settings["force_p_newlines"]&&(G.keyCode==8||G.keyCode==46)&&!G.shiftKey){if(TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance,G.type)){tinyMCE.execCommand("mceAddUndoLevel");return tinyMCE.cancelEvent(G)}}if(tinyMCE.isIE&&tinyMCE.settings["force_br_newlines"]&&G.keyCode==13){if(G.target.editorId){tinyMCE.instances[G.target.editorId].select()}if(tinyMCE.selectedInstance){var B=tinyMCE.selectedInstance.getDoc().selection;var A=B.createRange();if(tinyMCE.getParentElement(A.parentElement(),"li")!=null){return false}G.returnValue=false;G.cancelBubble=true;A.pasteHTML("<br />");A.collapse(false);A.select();tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.triggerNodeChange(false);return false}}if(G.keyCode==8||G.keyCode==46){tinyMCE.selectedElement=G.target;tinyMCE.linkElement=tinyMCE.getParentElement(G.target,"a");tinyMCE.imgElement=tinyMCE.getParentElement(G.target,"img");tinyMCE.triggerNodeChange(false)}return false;break;case"keyup":case"keydown":tinyMCE.hideMenus();tinyMCE.hasMouseMoved=false;if(D&&D.handleShortcut(G)){return false}if(G.target.editorId){tinyMCE.instances[G.target.editorId].select()}if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.switchSettings()}var D=tinyMCE.selectedInstance;if(tinyMCE.isGecko&&tinyMCE.settings["force_p_newlines"]&&(G.keyCode==8||G.keyCode==46)&&!G.shiftKey){if(TinyMCE_ForceParagraphs._handleBackSpace(tinyMCE.selectedInstance,G.type)){tinyMCE.execCommand("mceAddUndoLevel");G.preventDefault();return false}}tinyMCE.selectedElement=null;tinyMCE.selectedNode=null;var H=tinyMCE.selectedInstance.getFocusElement();tinyMCE.linkElement=tinyMCE.getParentElement(H,"a");tinyMCE.imgElement=tinyMCE.getParentElement(H,"img");tinyMCE.selectedElement=H;if(tinyMCE.isGecko&&G.type=="keyup"&&G.keyCode==9){tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(),true,tinyMCE.settings["visual"],tinyMCE.selectedInstance)}if(tinyMCE.isIE&&G.type=="keydown"&&G.keyCode==13){tinyMCE.enterKeyElement=tinyMCE.selectedInstance.getFocusElement()}if(tinyMCE.isIE&&G.type=="keyup"&&G.keyCode==13){var H=tinyMCE.enterKeyElement;if(H){var M=new RegExp("^HR|IMG|BR$","g");var I=new RegExp("^H[1-6]$","g");if(!H.hasChildNodes()&&!M.test(H.nodeName)){if(I.test(H.nodeName)){H.innerHTML="&nbsp;&nbsp;"}else{H.innerHTML="&nbsp;"}}}}var L=tinyMCE.posKeyCodes;var F=false;for(var C=0;C<L.length;C++){if(L[C]==G.keyCode){F=true;break}}if(tinyMCE.isIE&&tinyMCE.settings["custom_undo_redo"]){var L=new Array(8,46);for(var C=0;C<L.length;C++){if(L[C]==G.keyCode){if(G.type=="keyup"){tinyMCE.triggerNodeChange(false)}}}}if(G.keyCode==17){return true}if(tinyMCE.isGecko){if(!F&&G.type=="keyup"&&!G.ctrlKey||(G.ctrlKey&&(G.keyCode==86||G.keyCode==88))){tinyMCE.execCommand("mceStartTyping")}}else{if(!F&&G.type=="keyup"){tinyMCE.execCommand("mceStartTyping")}}if(G.type=="keydown"&&(F||G.ctrlKey)&&D){D.undoBookmark=D.selection.getBookmark()}if(G.type=="keyup"&&(F||G.ctrlKey)){tinyMCE.execCommand("mceEndTyping")}if(F&&G.type=="keyup"){tinyMCE.triggerNodeChange(false)}if(tinyMCE.isIE&&G.ctrlKey){window.setTimeout("tinyMCE.triggerNodeChange(false);",1)}break;case"mousedown":case"mouseup":case"click":case"dblclick":case"focus":tinyMCE.hideMenus();if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.switchSettings();tinyMCE.selectedInstance.isFocused=true}var K=tinyMCE.getParentElement(G.target,"html");for(var J in tinyMCE.instances){if(!tinyMCE.isInstance(tinyMCE.instances[J])){continue}var D=tinyMCE.instances[J];D.autoResetDesignMode();if(D.getBody().parentNode==K){D.select();tinyMCE.selectedElement=G.target;tinyMCE.linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");tinyMCE.imgElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"img");break}}if(!tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark&&(G.type=="mouseup"||G.type=="dblclick")){tinyMCE.selectedInstance.undoRedo.undoLevels[0].bookmark=tinyMCE.selectedInstance.selection.getBookmark()}if(G.type!="focus"){tinyMCE.selectedNode=null}tinyMCE.triggerNodeChange(false);tinyMCE.execCommand("mceEndTyping");if(G.type=="mouseup"){tinyMCE.execCommand("mceAddUndoLevel")}if(!tinyMCE.selectedInstance&&G.target.editorId){tinyMCE.instances[G.target.editorId].select()}return false;break}},getButtonHTML:function(A,B,F,D,I,C){var G="",E,J,H="";D="tinyMCE.execInstanceCommand('{$editor_id}','"+D+"'";if(typeof (I)!="undefined"&&I!=null){D+=","+I}if(typeof (C)!="undefined"&&C!=null){D+=",'"+C+"'"}D+=");";if(tinyMCE.isRealIE){H='onmouseover="tinyMCE.lastHover = this;"'}if(tinyMCE.getParam("button_tile_map")&&(!tinyMCE.isIE||tinyMCE.isOpera)&&(E=this.buttonMap[A])!=null&&(tinyMCE.getParam("language")=="en"||F.indexOf("$lang")==-1)){J=0-(E*20)==0?"0":0-(E*20);G+='<a id="{$editor_id}_'+A+'" href="javascript:'+D+'" onclick="'+D+'return false;" onmousedown="return false;" '+H+' class="mceTiledButton mceButtonNormal" target="_self">';G+='<img src="{$themeurl}/images/spacer.gif" style="background-position: '+J+'px 0" title="{$'+B+'}" />';G+="</a>"}else{G+='<a id="{$editor_id}_'+A+'" href="javascript:'+D+'" onclick="'+D+'return false;" onmousedown="return false;" '+H+' class="mceButtonNormal" target="_self">';G+='<img src="'+F+'" title="{$'+B+'}" />';G+="</a>"}return G},getMenuButtonHTML:function(A,B,F,J,E,H,C){var G="",D,I;J="tinyMCE.execInstanceCommand('{$editor_id}','"+J+"');";E="tinyMCE.execInstanceCommand('{$editor_id}','"+E+"'";if(typeof (H)!="undefined"&&H!=null){E+=","+H}if(typeof (C)!="undefined"&&C!=null){E+=",'"+C+"'"}E+=");";if(tinyMCE.getParam("button_tile_map")&&(!tinyMCE.isIE||tinyMCE.isOpera)&&(D=tinyMCE.buttonMap[A])!=null&&(tinyMCE.getParam("language")=="en"||F.indexOf("$lang")==-1)){I=0-(D*20)==0?"0":0-(D*20);if(tinyMCE.isRealIE){G+='<span id="{$editor_id}_'+A+'" class="mceMenuButton" onmouseover="tinyMCE._menuButtonEvent(\'over\',this);tinyMCE.lastHover = this;" onmouseout="tinyMCE._menuButtonEvent(\'out\',this);">'}else{G+='<span id="{$editor_id}_'+A+'" class="mceMenuButton">'}G+='<a href="javascript:'+E+'" onclick="'+E+'return false;" onmousedown="return false;" class="mceTiledButton mceMenuButtonNormal" target="_self">';G+='<img src="{$themeurl}/images/spacer.gif" style="width: 20px; height: 20px; background-position: '+I+'px 0" title="{$'+B+'}" /></a>';G+='<a href="javascript:'+J+'" onclick="'+J+'return false;" onmousedown="return false;"><img src="{$themeurl}/images/button_menu.gif" title="{$'+B+'}" class="mceMenuButton" />';G+="</a></span>"}else{if(tinyMCE.isRealIE){G+='<span id="{$editor_id}_'+A+'" dir="ltr" class="mceMenuButton" onmouseover="tinyMCE._menuButtonEvent(\'over\',this);tinyMCE.lastHover = this;" onmouseout="tinyMCE._menuButtonEvent(\'out\',this);">'}else{G+='<span id="{$editor_id}_'+A+'" dir="ltr" class="mceMenuButton">'}G+='<a href="javascript:'+E+'" onclick="'+E+'return false;" onmousedown="return false;" class="mceMenuButtonNormal" target="_self">';G+='<img src="'+F+'" title="{$'+B+'}" /></a>';G+='<a href="javascript:'+J+'" onclick="'+J+'return false;" onmousedown="return false;"><img src="{$themeurl}/images/button_menu.gif" title="{$'+B+'}" class="mceMenuButton" />';G+="</a></span>"}return G},_menuButtonEvent:function(A,B){if(B.className=="mceMenuButtonFocus"){return }if(A=="over"){B.className=B.className+" mceMenuHover"}else{B.className=B.className.replace(/\s.*$/,"")}},addButtonMap:function(A){var C,B=A.replace(/\s+/,"").split(",");for(C=0;C<B.length;C++){this.buttonMap[B[C]]=C}},submitPatch:function(){tinyMCE.removeTinyMCEFormElements(this);tinyMCE.triggerSave();tinyMCE.isNotDirty=true;this.mceOldSubmit()},onLoad:function(){var B;if(tinyMCE.settings.strict_loading_mode&&this.loadingIndex!=-1){window.setTimeout("tinyMCE.onLoad();",1);return }if(tinyMCE.isRealIE&&window.event.type=="readystatechange"&&document.readyState!="complete"){return true}if(tinyMCE.isLoaded){return true}tinyMCE.isLoaded=true;if(tinyMCE.isRealIE&&document.body){B=document.body.createTextRange();B.collapse(true);B.select()}tinyMCE.dispatchCallback(null,"onpageload","onPageLoad");for(var O=0;O<tinyMCE.configs.length;O++){tinyMCE.settings=tinyMCE.configs[O];var H=tinyMCE.getParam("editor_selector");var D=tinyMCE.getParam("editor_deselector");var P=new Array();if(document.forms&&tinyMCE.settings["add_form_submit_trigger"]&&!tinyMCE.submitTriggers){for(var K=0;K<document.forms.length;K++){var C=document.forms[K];tinyMCE.addEvent(C,"submit",TinyMCE_Engine.prototype.handleEvent);tinyMCE.addEvent(C,"reset",TinyMCE_Engine.prototype.handleEvent);tinyMCE.submitTriggers=true;if(tinyMCE.settings["submit_patch"]){try{C.mceOldSubmit=C.submit;C.submit=TinyMCE_Engine.prototype.submitPatch}catch(M){}}}}var L=tinyMCE.settings["mode"];switch(L){case"exact":var A=tinyMCE.getParam("elements","",true,",");for(var K=0;K<A.length;K++){var J=tinyMCE._getElementById(A[K]);var E=J?J.getAttribute(tinyMCE.settings["textarea_trigger"]):"";if(new RegExp("\\b"+D+"\\b").test(tinyMCE.getAttrib(J,"class"))){continue}if(E=="false"){continue}if((tinyMCE.settings["ask"]||tinyMCE.settings["convert_on_click"])&&J){P[P.length]=J;continue}if(J){tinyMCE.addMCEControl(J,A[K])}else{if(tinyMCE.settings["debug"]){alert("Error: Could not find element by id or name: "+A[K])}}}break;case"specific_textareas":case"textareas":var G=document.getElementsByTagName("textarea");for(var K=0;K<G.length;K++){var N=G.item(K);var E=N.getAttribute(tinyMCE.settings["textarea_trigger"]);if(H!=""&&!new RegExp("\\b"+H+"\\b").test(tinyMCE.getAttrib(N,"class"))){continue}if(H!=""){E=H!=""?"true":""}if(new RegExp("\\b"+D+"\\b").test(tinyMCE.getAttrib(N,"class"))){continue}if((L=="specific_textareas"&&E=="true")||(L=="textareas"&&E!="false")){P[P.length]=N}}break}for(var K=0;K<P.length;K++){var J=P[K];var I=J.name?J.name:J.id;if(tinyMCE.settings["ask"]||tinyMCE.settings["convert_on_click"]){if(tinyMCE.isGecko){var F=tinyMCE.settings;tinyMCE.addEvent(J,"focus",function(Q){window.setTimeout(function(){TinyMCE_Engine.prototype.confirmAdd(Q,F)},10)});if(J.nodeName!="TEXTAREA"&&J.nodeName!="INPUT"){tinyMCE.addEvent(J,"click",function(Q){window.setTimeout(function(){TinyMCE_Engine.prototype.confirmAdd(Q,F)},10)})}}else{var F=tinyMCE.settings;tinyMCE.addEvent(J,"focus",function(){TinyMCE_Engine.prototype.confirmAdd(null,F)});tinyMCE.addEvent(J,"click",function(){TinyMCE_Engine.prototype.confirmAdd(null,F)})}}else{tinyMCE.addMCEControl(J,I)}}if(tinyMCE.settings["auto_focus"]){window.setTimeout(function(){var Q=tinyMCE.getInstanceById(tinyMCE.settings["auto_focus"]);Q.selection.selectNode(Q.getBody(),true,true);Q.contentWindow.focus()},100)}tinyMCE.dispatchCallback(null,"oninit","onInit")}},isInstance:function(A){return A!=null&&typeof (A)=="object"&&A.isTinyMCE_Control},getParam:function(C,A,G,B){var F=(typeof (this.settings[C])=="undefined")?A:this.settings[C];if(F=="true"||F=="false"){return(F=="true")}if(G){F=tinyMCE.regexpReplace(F,"[ \t\r\n]","")}if(typeof (B)!="undefined"&&B!=null){F=F.split(B);var E=new Array();for(var D=0;D<F.length;D++){if(F[D]&&F[D]!=""){E[E.length]=F[D]}}F=E}return F},getLang:function(D,A,C,E){var B=(typeof (tinyMCELang[D])=="undefined")?A:tinyMCELang[D],F;if(C){B=tinyMCE.entityDecode(B)}if(E){for(F in E){B=this.replaceVar(B,F,E[F])}}return B},entityDecode:function(A){var B=document.createElement("div");B.innerHTML=A;return B.firstChild.nodeValue},addToLang:function(C,A){for(var B in A){if(typeof (A[B])=="function"){continue}tinyMCELang[(B.indexOf("lang_")==-1?"lang_":"")+(C!=""?(C+"_"):"")+B]=A[B]}this.loadNextScript()},triggerNodeChange:function(J,G){var E,B,A,C=-1,I=-1,F,D=false,H;if(tinyMCE.selectedInstance){B=tinyMCE.selectedInstance;E=(typeof (G)!="undefined"&&G)?tinyMCE.selectedElement:B.getFocusElement();A=B.editorId;H=B.selection.getSelectedText();if(tinyMCE.settings.auto_resize){B.resizeToContent()}if(G&&tinyMCE.isGecko&&B.isHidden()){E=B.getBody()}B.switchSettings();if(tinyMCE.selectedElement){D=(tinyMCE.selectedElement.nodeName.toLowerCase()=="img")||(H&&H.length>0)}if(tinyMCE.settings["custom_undo_redo"]){C=B.undoRedo.undoIndex;I=B.undoRedo.undoLevels.length}tinyMCE.dispatchCallback(B,"handle_node_change_callback","handleNodeChange",A,E,C,I,B.visualAid,D,G)}if(this.selectedInstance&&(typeof (J)=="undefined"||J)){this.selectedInstance.contentWindow.focus()}},_customCleanup:function(inst,type,content){var pl,po,i;var customCleanup=tinyMCE.settings["cleanup_callback"];if(customCleanup!=""&&eval("typeof("+customCleanup+")")!="undefined"){content=eval(customCleanup+"(type, content, inst);")}po=tinyMCE.themes[tinyMCE.settings["theme"]];if(po&&po.cleanup){content=po.cleanup(type,content,inst)}pl=inst.plugins;for(i=0;i<pl.length;i++){po=tinyMCE.plugins[pl[i]];if(po&&po.cleanup){content=po.cleanup(type,content,inst)}}return content},setContent:function(A){if(tinyMCE.selectedInstance){tinyMCE.selectedInstance.execCommand("mceSetContent",false,A);tinyMCE.selectedInstance.repaint()}},importThemeLanguagePack:function(A){if(typeof (A)=="undefined"){A=tinyMCE.settings["theme"]}tinyMCE.loadScript(tinyMCE.baseURL+"/themes/"+A+"/langs/"+tinyMCE.settings["language"]+".js")},importPluginLanguagePack:function(B){var A=tinyMCE.baseURL+"/plugins/"+B;if(this.plugins[B]){A=this.plugins[B].baseURL}tinyMCE.loadScript(A+"/langs/"+tinyMCE.settings["language"]+".js")},applyTemplate:function(B,A){return B.replace(new RegExp("\\{\\$([a-z0-9_]+)\\}","gi"),function(C,D){if(D.indexOf("lang_")==0&&tinyMCELang[D]){return tinyMCELang[D]}if(A&&A[D]){return A[D]}if(tinyMCE.settings[D]){return tinyMCE.settings[D]}if(C=="themeurl"){return tinyMCE.themeURL}return C})},replaceVar:function(B,C,A){return B.replace(new RegExp("{\\$"+C+"}","g"),A)},openWindow:function(template,args){var html,width,height,x,y,resizable,scrollbars,url;args=!args?{}:args;args["mce_template_file"]=template["file"];args["mce_width"]=template["width"];args["mce_height"]=template["height"];tinyMCE.windowArgs=args;html=template["html"];if(!(width=parseInt(template["width"]))){width=320}if(!(height=parseInt(template["height"]))){height=200}if(tinyMCE.isIE){height+=40}else{height+=20}x=parseInt(screen.width/2)-(width/2);y=parseInt(screen.height/2)-(height/2);resizable=(args&&args["resizable"])?args["resizable"]:"no";scrollbars=(args&&args["scrollbars"])?args["scrollbars"]:"no";if(template["file"].charAt(0)!="/"&&template["file"].indexOf("://")==-1){url=tinyMCE.baseURL+"/themes/"+tinyMCE.getParam("theme")+"/"+template["file"]}else{url=template["file"]}for(var name in args){if(typeof (args[name])=="function"){continue}url=tinyMCE.replaceVar(url,name,escape(args[name]))}if(html){html=tinyMCE.replaceVar(html,"css",this.settings["popups_css"]);html=tinyMCE.applyTemplate(html,args);var win=window.open("","mcePopup"+new Date().getTime(),"top="+y+",left="+x+",scrollbars="+scrollbars+",dialog=yes,minimizable="+resizable+",modal=yes,width="+width+",height="+height+",resizable="+resizable);if(win==null){alert(tinyMCELang["lang_popup_blocked"]);return }win.document.write(html);win.document.close();win.resizeTo(width,height);win.focus()}else{if((tinyMCE.isRealIE)&&resizable!="yes"&&tinyMCE.settings["dialog_type"]=="modal"){height+=10;var features="resizable:"+resizable+";scroll:"+scrollbars+";status:yes;center:yes;help:no;dialogWidth:"+width+"px;dialogHeight:"+height+"px;";window.showModalDialog(url,window,features)}else{var modal=(resizable=="yes")?"no":"yes";if(tinyMCE.isGecko&&tinyMCE.isMac){modal="no"}if(template["close_previous"]!="no"){try{tinyMCE.lastWindow.close()}catch(ex){}}var win=window.open(url,"mcePopup"+new Date().getTime(),"top="+y+",left="+x+",scrollbars="+scrollbars+",dialog="+modal+",minimizable="+resizable+",modal="+modal+",width="+width+",height="+height+",resizable="+resizable);if(win==null){alert(tinyMCELang["lang_popup_blocked"]);return }if(template["close_previous"]!="no"){tinyMCE.lastWindow=win}eval("try { win.resizeTo(width, height); } catch(e) { }");if(tinyMCE.isGecko){if(win.document.defaultView.statusbar.visible){win.resizeBy(0,tinyMCE.isMac?10:24)}}win.focus()}}},closeWindow:function(A){A.close()},getVisualAidClass:function(E,D){var G=tinyMCE.settings["visual_table_class"];if(typeof (D)=="undefined"){D=tinyMCE.settings["visual"]}var F=new Array();var A=E.split(" ");for(var B=0;B<A.length;B++){if(A[B]==G){A[B]=""}if(A[B]!=""){F[F.length]=A[B]}}if(D){F[F.length]=G}var C="";for(var B=0;B<F.length;B++){if(B>0){C+=" "}C+=F[B]}return C},handleVisualAid:function(D,M,C,F,I){if(!D){return }if(!I){tinyMCE.dispatchCallback(F,"handle_visual_aid_callback","handleVisualAid",D,M,C,F)}var A=null;switch(D.nodeName){case"TABLE":var N=D.style.width;var G=D.style.height;var B=tinyMCE.getAttrib(D,"border");B=B==""||B=="0"?true:false;tinyMCE.setAttrib(D,"class",tinyMCE.getVisualAidClass(tinyMCE.getAttrib(D,"class"),C&&B));D.style.width=N;D.style.height=G;for(var J=0;J<D.rows.length;J++){for(var L=0;L<D.rows[J].cells.length;L++){var K=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(D.rows[J].cells[L],"class"),C&&B);tinyMCE.setAttrib(D.rows[J].cells[L],"class",K)}}break;case"A":var H=tinyMCE.getAttrib(D,"name");if(H!=""&&C){D.title=H;tinyMCE.addCSSClass(D,"mceItemAnchor")}else{if(H!=""&&!C){D.className=""}}break}if(M&&D.hasChildNodes()){for(var E=0;E<D.childNodes.length;E++){tinyMCE.handleVisualAid(D.childNodes[E],M,C,F,true)}}},fixGeckoBaseHREFBug:function(A,E,C){var B,D;if(tinyMCE.isGecko){if(A==1){C=C.replace(/\ssrc=/gi," mce_tsrc=");C=C.replace(/\shref=/gi," mce_thref=");return C}else{if(!new RegExp("(src|href)=","g").test(C)){return C}tinyMCE.selectElements(E,"A,IMG,SELECT,AREA,IFRAME,BASE,INPUT,SCRIPT,EMBED,OBJECT,LINK",function(G){B=tinyMCE.getAttrib(G,"mce_tsrc");D=tinyMCE.getAttrib(G,"mce_thref");if(B!=""){try{G.src=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings["base_href"],B)}catch(F){}G.removeAttribute("mce_tsrc")}if(D!=""){try{G.href=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings["base_href"],D)}catch(F){}G.removeAttribute("mce_thref")}return false});tinyMCE.selectNodes(E,function(F){if(F.nodeType==3||F.nodeType==8){F.nodeValue=F.nodeValue.replace(/\smce_tsrc=/gi," src=");F.nodeValue=F.nodeValue.replace(/\smce_thref=/gi," href=")}return false})}}return C},_setHTML:function(G,E){E=tinyMCE.cleanupHTMLCode(E);try{tinyMCE.setInnerHTML(G.body,E)}catch(F){if(this.isMSIE){G.body.createTextRange().pasteHTML(E)}}if(tinyMCE.isIE&&tinyMCE.settings["fix_content_duplication"]){var A=G.getElementsByTagName("P");for(var C=0;C<A.length;C++){var D=A[C];while((D=D.parentNode)!=null){if(D.nodeName=="P"){D.outerHTML=D.innerHTML}}}var B=G.body.innerHTML;tinyMCE.setInnerHTML(G.body,B)}tinyMCE.cleanupAnchors(G);if(tinyMCE.getParam("convert_fonts_to_spans")){tinyMCE.convertSpansToFonts(G)}},getEditorId:function(A){var B=this.getInstanceById(A);if(!B){return null}return B.editorId},getInstanceById:function(C){var B=this.instances[C];if(!B){for(var D in tinyMCE.instances){var A=tinyMCE.instances[D];if(!tinyMCE.isInstance(A)){continue}if(A.formTargetElementId==C){B=A;break}}}return B},queryInstanceCommandValue:function(C,B){var A=tinyMCE.getInstanceById(C);if(A){return A.queryCommandValue(B)}return false},queryInstanceCommandState:function(C,B){var A=tinyMCE.getInstanceById(C);if(A){return A.queryCommandState(B)}return null},setWindowArg:function(B,A){this.windowArgs[B]=A},getWindowArg:function(B,A){return(typeof (this.windowArgs[B])=="undefined")?A:this.windowArgs[B]},getCSSClasses:function(editor_id,doc){var inst=tinyMCE.getInstanceById(editor_id);if(inst&&inst.cssClasses.length>0){return inst.cssClasses}if(typeof (editor_id)=="undefined"&&typeof (doc)=="undefined"){var instance;for(var instanceName in tinyMCE.instances){instance=tinyMCE.instances[instanceName];if(!tinyMCE.isInstance(instance)){continue}break}doc=instance.getDoc()}if(typeof (doc)=="undefined"){var instance=tinyMCE.getInstanceById(editor_id);doc=instance.getDoc()}if(doc){var styles=doc.styleSheets;if(styles&&styles.length>0){for(var x=0;x<styles.length;x++){var csses=null;eval("try {var csses = tinyMCE.isIE ? doc.styleSheets("+x+").rules : styles["+x+"].cssRules;} catch(e) {}");if(!csses){return new Array()}for(var i=0;i<csses.length;i++){var selectorText=csses[i].selectorText;if(selectorText){var rules=selectorText.split(",");for(var c=0;c<rules.length;c++){var rule=rules[c];while(rule.indexOf(" ")==0){rule=rule.substring(1)}if(rule.indexOf(" ")!=-1||rule.indexOf(":")!=-1||rule.indexOf("mceItem")!=-1){continue}if(rule.indexOf(tinyMCE.settings["visual_table_class"])!=-1||rule.indexOf("mceEditable")!=-1||rule.indexOf("mceNonEditable")!=-1){continue}if(rule.indexOf(".")!=-1){var cssClass=rule.substring(rule.indexOf(".")+1);var addClass=true;for(var p=0;p<inst.cssClasses.length&&addClass;p++){if(inst.cssClasses[p]==cssClass){addClass=false}}if(addClass){inst.cssClasses[inst.cssClasses.length]=cssClass}}}}}}}}return inst.cssClasses},regexpReplace:function(E,A,C,D){if(E==null){return E}if(typeof (D)=="undefined"){D="g"}var B=new RegExp(A,D);return E.replace(B,C)},trim:function(A){return A.replace(/^\s*|\s*$/g,"")},cleanupEventStr:function(A){A=""+A;A=A.replace("function anonymous()\n{\n","");A=A.replace("\n}","");A=A.replace(/^return true;/gi,"");return A},getControlHTML:function(G){var C,A,F,E,B,D=tinyMCE.getLang("lang_dir")=="rtl";A=tinyMCE.plugins;for(F in A){E=A[F];if(E.getControlHTML&&(B=E.getControlHTML(G))!=""){if(D){return'<span dir="rtl">'+tinyMCE.replaceVar(B,"pluginurl",E.baseURL)+"</span>"}return tinyMCE.replaceVar(B,"pluginurl",E.baseURL)}}E=tinyMCE.themes[tinyMCE.settings["theme"]];if(E.getControlHTML&&(B=E.getControlHTML(G))!=""){if(D){return'<span dir="rtl">'+B+"</span>"}return B}return""},evalFunc:function(C,A,B,D){D=!D?window:D;C=typeof (C)=="function"?C:D[C];return C.apply(D,Array.prototype.slice.call(B,A))},dispatchCallback:function(A,B,C){return this.callFunc(A,B,C,0,this.dispatchCallback.arguments)},executeCallback:function(A,B,C){return this.callFunc(A,B,C,1,this.executeCallback.arguments)},execCommandCallback:function(A,B,C){return this.callFunc(A,B,C,2,this.execCommandCallback.arguments)},callFunc:function(G,A,C,D,I){var E,F,H,B,K,J;K=D==2;E=tinyMCE.getParam(A,"");if(E!=""&&(J=tinyMCE.evalFunc(E,3,I))==K&&D>0){return true}if(G!=null){for(F=0,E=G.plugins;F<E.length;F++){B=tinyMCE.plugins[E[F]];if(B[C]&&(J=tinyMCE.evalFunc(C,3,I,B))==K&&D>0){return true}}}E=tinyMCE.themes;for(H in E){B=E[H];if(B[C]&&(J=tinyMCE.evalFunc(C,3,I,B))==K&&D>0){return true}}return false},xmlEncode:function(B,A){return B?(""+B).replace(!A?this.xmlEncodeAposRe:this.xmlEncodeRe,function(D,C){switch(D){case"&":return"&amp;";case'"':return"&quot;";case"'":return"&#39;";case"<":return"&lt;";case">":return"&gt;"}return D}):B},extend:function(B,A){var C={};C.parent=B;for(n in B){C[n]=B[n]}for(n in A){C[n]=A[n]}return C},hideMenus:function(){var A=tinyMCE.lastSelectedMenuBtn;if(tinyMCE.lastMenu){tinyMCE.lastMenu.hide();tinyMCE.lastMenu=null}if(A){tinyMCE.switchClass(A,tinyMCE.lastMenuBtnClass);tinyMCE.lastSelectedMenuBtn=null}}};var TinyMCE=TinyMCE_Engine;var tinyMCE=new TinyMCE_Engine();var tinyMCELang={};function TinyMCE_Control(C){var I,E,H,D,A,G,F,D,B,J=C;this.undoRedoLevel=true;this.isTinyMCE_Control=true;this.settings=J;this.settings["theme"]=tinyMCE.getParam("theme","default");this.settings["width"]=tinyMCE.getParam("width",-1);this.settings["height"]=tinyMCE.getParam("height",-1);this.selection=new TinyMCE_Selection(this);this.undoRedo=new TinyMCE_UndoRedo(this);this.cleanup=new TinyMCE_Cleanup();this.shortcuts=new Array();this.hasMouseMoved=false;this.foreColor=this.backColor="#999999";this.data={};this.cssClasses=[];this.cleanup.init({valid_elements:J.valid_elements,extended_valid_elements:J.extended_valid_elements,valid_child_elements:J.valid_child_elements,entities:J.entities,entity_encoding:J.entity_encoding,debug:J.cleanup_debug,indent:J.apply_source_formatting,invalid_elements:J.invalid_elements,verify_html:J.verify_html,fix_content_duplication:J.fix_content_duplication,convert_fonts_to_spans:J.convert_fonts_to_spans});I=this.settings["theme"];if(!tinyMCE.hasTheme(I)){F=tinyMCE.callbacks;H={};for(E=0;E<F.length;E++){if((D=window["TinyMCE_"+I+"_"+F[E]])){H[F[E]]=D}}tinyMCE.addTheme(I,H)}this.plugins=new Array();A=tinyMCE.getParam("plugins","",true,",");if(A.length>0){for(E=0;E<A.length;E++){B=A[E];if(B.charAt(0)=="-"){B=B.substring(1)}if(!tinyMCE.hasPlugin(B)){F=tinyMCE.callbacks;H={};for(G=0;G<F.length;G++){if((D=window["TinyMCE_"+B+"_"+F[G]])){H[F[G]]=D}}tinyMCE.addPlugin(B,H)}this.plugins[this.plugins.length]=B}}}TinyMCE_Control.prototype={selection:null,settings:null,cleanup:null,getData:function(A){var B=this.data[A];if(!B){B=this.data[A]={}}return B},hasPlugin:function(B){var A;for(A=0;A<this.plugins.length;A++){if(this.plugins[A]==B){return true}}return false},addPlugin:function(B,A){if(!this.hasPlugin(B)){tinyMCE.addPlugin(B,A);this.plugins[this.plugins.length]=B}},repaint:function(){var C,A,B;if(tinyMCE.isRealIE){return }try{C=this.selection;A=C.getBookmark(true);this.getBody().style.display="none";this.getDoc().execCommand("selectall",false,null);this.getSel().collapseToStart();this.getBody().style.display="block";C.moveToBookmark(A)}catch(B){}},switchSettings:function(){if(tinyMCE.configs.length>1&&tinyMCE.currentConfig!=this.settings["index"]){tinyMCE.settings=this.settings;tinyMCE.currentConfig=this.settings["index"]}},select:function(){var A=tinyMCE.selectedInstance;if(A!=this){if(A){A.execCommand("mceEndTyping")}tinyMCE.dispatchCallback(this,"select_instance_callback","selectInstance",this,A);tinyMCE.selectedInstance=this}},getBody:function(){return this.contentBody?this.contentBody:this.getDoc().body},getDoc:function(){return this.contentWindow.document},getWin:function(){return this.contentWindow},getContainerWin:function(){return this.containerWindow?this.containerWindow:window},getViewPort:function(){return tinyMCE.getViewPort(this.getWin())},getParentNode:function(B,A){return tinyMCE.getParentNode(B,A,this.getBody())},getParentElement:function(C,A,B){return tinyMCE.getParentElement(C,A,B,this.getBody())},getParentBlockElement:function(A){return tinyMCE.getParentBlockElement(A,this.getBody())},resizeToContent:function(){var B=this.getDoc(),A=B.body,C=B.documentElement;this.iframeElement.style.height=(tinyMCE.isRealIE)?A.scrollHeight:C.offsetHeight+"px"},addShortcut:function(D,E,G,C,J,K){var B=typeof (E)=="number",A=tinyMCE.isIE,I,H,F,L=this.shortcuts;if(!tinyMCE.getParam("custom_shortcuts")){return false}D=D.toLowerCase();E=A&&!B?E.toUpperCase():E;I=B?null:E.charCodeAt(0);G=G&&G.indexOf("lang_")==0?tinyMCE.getLang(G):G;H={alt:D.indexOf("alt")!=-1,ctrl:D.indexOf("ctrl")!=-1,shift:D.indexOf("shift")!=-1,charCode:I,keyCode:B?E:(A?I:null),desc:G,cmd:C,ui:J,val:K};for(F=0;F<L.length;F++){if(H.alt==L[F].alt&&H.ctrl==L[F].ctrl&&H.shift==L[F].shift&&H.charCode==L[F].charCode&&H.keyCode==L[F].keyCode){return false}}L[L.length]=H;return true},handleShortcut:function(C){var A,B,D;if(!C.altKey&&!C.ctrlKey){return false}B=this.shortcuts;for(A=0;A<B.length;A++){D=B[A];if(D.alt==C.altKey&&D.ctrl==C.ctrlKey&&(D.keyCode==C.keyCode||D.charCode==C.charCode)){if(D.cmd&&(C.type=="keydown"||(C.type=="keypress"&&!tinyMCE.isOpera))){tinyMCE.execCommand(D.cmd,D.ui,D.val)}tinyMCE.cancelEvent(C);return true}}return false},autoResetDesignMode:function(){if(!tinyMCE.isIE&&this.isHidden()&&tinyMCE.getParam("auto_reset_designmode")){eval('try { this.getDoc().designMode = "On"; this.useCSS = false; } catch(e) {}')}},isHidden:function(){var A;if(tinyMCE.isIE){return false}A=this.getSel();return(!A||!A.rangeCount||A.rangeCount==0)},isDirty:function(){return tinyMCE.trim(this.startContent)!=tinyMCE.trim(this.getBody().innerHTML)&&!tinyMCE.isNotDirty},_mergeElements:function(C,G,F,D){if(C=="removeformat"){G.className="";G.style.cssText="";F.className="";F.style.cssText="";return }var B=tinyMCE.parseStyle(tinyMCE.getAttrib(G,"style"));var A=tinyMCE.parseStyle(tinyMCE.getAttrib(F,"style"));var E=tinyMCE.getAttrib(G,"class");E=tinyMCE.getAttrib(F,"class");if(D){for(var H in B){if(typeof (B[H])=="function"){continue}A[H]=B[H]}}else{for(var H in A){if(typeof (A[H])=="function"){continue}B[H]=A[H]}}tinyMCE.setAttrib(G,"style",tinyMCE.serializeStyle(B));tinyMCE.setAttrib(G,"class",tinyMCE.trim(E));F.className="";F.style.cssText="";F.removeAttribute("class");F.removeAttribute("style")},_setUseCSS:function(A){var C=this.getDoc();try{C.execCommand("useCSS",false,!A)}catch(B){}try{C.execCommand("styleWithCSS",false,A)}catch(B){}if(!tinyMCE.getParam("table_inline_editing")){try{C.execCommand("enableInlineTableEditing",false,"false")}catch(B){}}if(!tinyMCE.getParam("object_resizing")){try{C.execCommand("enableObjectResizing",false,"false")}catch(B){}}},execCommand:function(command,user_interface,value){var doc=this.getDoc(),win=this.getWin(),focusElm=this.getFocusElement();if(!new RegExp("mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel","gi").test(command)){this.undoBookmark=null}if(!tinyMCE.isIE&&!this.useCSS){this._setUseCSS(false);this.useCSS=true}this.contentDocument=doc;if(!/mceStartTyping|mceEndTyping/.test(command)){if(tinyMCE.execCommandCallback(this,"execcommand_callback","execCommand",this.editorId,this.getBody(),command,user_interface,value)){return }}if(focusElm&&focusElm.nodeName=="IMG"){var align=focusElm.getAttribute("align");var img=command=="JustifyCenter"?focusElm.cloneNode(false):focusElm;switch(command){case"JustifyLeft":if(align=="left"){img.removeAttribute("align")}else{img.setAttribute("align","left")}var div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode){div.parentNode.replaceChild(img,div)}this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return ;case"JustifyCenter":img.removeAttribute("align");var div=tinyMCE.getParentElement(focusElm,"div");if(div&&div.style.textAlign=="center"){if(div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode){div.parentNode.replaceChild(img,div)}}else{var div=this.getDoc().createElement("div");div.style.textAlign="center";div.appendChild(img);focusElm.parentNode.replaceChild(div,focusElm)}this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return ;case"JustifyRight":if(align=="right"){img.removeAttribute("align")}else{img.setAttribute("align","right")}var div=focusElm.parentNode;if(div&&div.nodeName=="DIV"&&div.childNodes.length==1&&div.parentNode){div.parentNode.replaceChild(img,div)}this.selection.selectNode(img);this.repaint();tinyMCE.triggerNodeChange();return }}if(tinyMCE.settings["force_br_newlines"]){var alignValue="";if(doc.selection.type!="Control"){switch(command){case"JustifyLeft":alignValue="left";break;case"JustifyCenter":alignValue="center";break;case"JustifyFull":alignValue="justify";break;case"JustifyRight":alignValue="right";break}if(alignValue!=""){var rng=doc.selection.createRange();if((divElm=tinyMCE.getParentElement(rng.parentElement(),"div"))!=null){divElm.setAttribute("align",alignValue)}else{if(rng.pasteHTML&&rng.htmlText.length>0){rng.pasteHTML('<div align="'+alignValue+'">'+rng.htmlText+"</div>")}}tinyMCE.triggerNodeChange();return }}}switch(command){case"mceRepaint":this.repaint();return true;case"unlink":if(tinyMCE.isGecko&&this.getSel().isCollapsed){focusElm=tinyMCE.getParentElement(focusElm,"A");if(focusElm){this.selection.selectNode(focusElm,false)}}this.getDoc().execCommand(command,user_interface,value);tinyMCE.isGecko&&this.getSel().collapseToEnd();tinyMCE.triggerNodeChange();return true;case"InsertUnorderedList":case"InsertOrderedList":this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case"Strikethrough":this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();break;case"mceSelectNode":this.selection.selectNode(value);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=value;break;case"FormatBlock":if(value==null||value==""){var elm=tinyMCE.getParentElement(this.getFocusElement(),"p,div,h1,h2,h3,h4,h5,h6,pre,address,blockquote,dt,dl,dd,samp");if(elm){this.execCommand("mceRemoveNode",false,elm)}}else{if(!this.cleanup.isValid(value)){return true}if(tinyMCE.isGecko&&new RegExp("<(div|blockquote|code|dt|dd|dl|samp)>","gi").test(value)){value=value.replace(/[^a-z]/gi,"")}if(tinyMCE.isIE&&new RegExp("blockquote|code|samp","gi").test(value)){var b=this.selection.getBookmark();this.getDoc().execCommand("FormatBlock",false,"<p>");tinyMCE.renameElement(tinyMCE.getParentBlockElement(this.getFocusElement()),value);this.selection.moveToBookmark(b)}else{this.getDoc().execCommand("FormatBlock",false,value)}}tinyMCE.triggerNodeChange();break;case"mceRemoveNode":if(!value){value=tinyMCE.getParentElement(this.getFocusElement())}if(tinyMCE.isIE){value.outerHTML=value.innerHTML}else{var rng=value.ownerDocument.createRange();rng.setStartBefore(value);rng.setEndAfter(value);rng.deleteContents();rng.insertNode(rng.createContextualFragment(value.innerHTML))}tinyMCE.triggerNodeChange();break;case"mceSelectNodeDepth":var parentNode=this.getFocusElement();for(var i=0;parentNode;i++){if(parentNode.nodeName.toLowerCase()=="body"){break}if(parentNode.nodeName.toLowerCase()=="#text"){i--;parentNode=parentNode.parentNode;continue}if(i==value){this.selection.selectNode(parentNode,false);tinyMCE.triggerNodeChange();tinyMCE.selectedNode=parentNode;return }parentNode=parentNode.parentNode}break;case"mceSetStyleInfo":case"SetStyleInfo":var rng=this.getRng();var sel=this.getSel();var scmd=value["command"];var sname=value["name"];var svalue=value["value"]==null?"":value["value"];var wrapper=value["wrapper"]?value["wrapper"]:"span";var parentElm=null;var invalidRe=new RegExp("^BODY|HTML$","g");var invalidParentsRe=tinyMCE.settings["merge_styles_invalid_parents"]!=""?new RegExp(tinyMCE.settings["merge_styles_invalid_parents"],"gi"):null;if(tinyMCE.isIE){if(rng.item){parentElm=rng.item(0)}else{var pelm=rng.parentElement();var prng=doc.selection.createRange();prng.moveToElementText(pelm);if(rng.htmlText==prng.htmlText||rng.boundingWidth==0){if(invalidParentsRe==null||!invalidParentsRe.test(pelm.nodeName)){parentElm=pelm}}}}else{var felm=this.getFocusElement();if(sel.isCollapsed||(new RegExp("td|tr|tbody|table","gi").test(felm.nodeName)&&sel.anchorNode==felm.parentNode)){parentElm=felm}}if(parentElm&&!invalidRe.test(parentElm.nodeName)){if(scmd=="setstyle"){tinyMCE.setStyleAttrib(parentElm,sname,svalue)}if(scmd=="setattrib"){tinyMCE.setAttrib(parentElm,sname,svalue)}if(scmd=="removeformat"){parentElm.style.cssText="";tinyMCE.setAttrib(parentElm,"class","")}var ch=tinyMCE.getNodeTree(parentElm,new Array(),1);for(var z=0;z<ch.length;z++){if(ch[z]==parentElm){continue}if(scmd=="setstyle"){tinyMCE.setStyleAttrib(ch[z],sname,"")}if(scmd=="setattrib"){tinyMCE.setAttrib(ch[z],sname,"")}if(scmd=="removeformat"){ch[z].style.cssText="";tinyMCE.setAttrib(ch[z],"class","")}}}else{this._setUseCSS(false);doc.execCommand("FontName",false,"#mce_temp_font#");var elementArray=tinyMCE.getElementsByAttributeValue(this.getBody(),"font","face","#mce_temp_font#");for(var x=0;x<elementArray.length;x++){elm=elementArray[x];if(elm){var spanElm=doc.createElement(wrapper);if(scmd=="setstyle"){tinyMCE.setStyleAttrib(spanElm,sname,svalue)}if(scmd=="setattrib"){tinyMCE.setAttrib(spanElm,sname,svalue)}if(scmd=="removeformat"){spanElm.style.cssText="";tinyMCE.setAttrib(spanElm,"class","")}if(elm.hasChildNodes()){for(var i=0;i<elm.childNodes.length;i++){spanElm.appendChild(elm.childNodes[i].cloneNode(true))}}spanElm.setAttribute("mce_new","true");elm.parentNode.replaceChild(spanElm,elm);var ch=tinyMCE.getNodeTree(spanElm,new Array(),1);for(var z=0;z<ch.length;z++){if(ch[z]==spanElm){continue}if(scmd=="setstyle"){tinyMCE.setStyleAttrib(ch[z],sname,"")}if(scmd=="setattrib"){tinyMCE.setAttrib(ch[z],sname,"")}if(scmd=="removeformat"){ch[z].style.cssText="";tinyMCE.setAttrib(ch[z],"class","")}}}}}var nodes=doc.getElementsByTagName(wrapper);for(var i=nodes.length-1;i>=0;i--){var elm=nodes[i];var isNew=tinyMCE.getAttrib(elm,"mce_new")=="true";elm.removeAttribute("mce_new");if(elm.childNodes&&elm.childNodes.length==1&&elm.childNodes[0].nodeType==1){this._mergeElements(scmd,elm,elm.childNodes[0],isNew);continue}if(elm.parentNode.childNodes.length==1&&!invalidRe.test(elm.nodeName)&&!invalidRe.test(elm.parentNode.nodeName)){if(invalidParentsRe==null||!invalidParentsRe.test(elm.parentNode.nodeName)){this._mergeElements(scmd,elm.parentNode,elm,false)}}}var nodes=doc.getElementsByTagName(wrapper);for(var i=nodes.length-1;i>=0;i--){var elm=nodes[i];var isEmpty=true;var tmp=doc.createElement("body");tmp.appendChild(elm.cloneNode(false));tmp.innerHTML=tmp.innerHTML.replace(new RegExp('style=""|class=""',"gi"),"");if(new RegExp("<span>","gi").test(tmp.innerHTML)){for(var x=0;x<elm.childNodes.length;x++){if(elm.parentNode!=null){elm.parentNode.insertBefore(elm.childNodes[x].cloneNode(true),elm)}}elm.parentNode.removeChild(elm)}}if(scmd=="removeformat"){tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this)}tinyMCE.triggerNodeChange();break;case"FontName":if(value==null){var s=this.getSel();if(tinyMCE.isGecko&&s.isCollapsed){var f=tinyMCE.getParentElement(this.getFocusElement(),"font");if(f!=null){this.selection.selectNode(f,false)}}this.getDoc().execCommand("RemoveFormat",false,null);if(f!=null&&tinyMCE.isGecko){var r=this.getRng().cloneRange();r.collapse(true);s.removeAllRanges();s.addRange(r)}}else{this.getDoc().execCommand("FontName",false,value)}if(tinyMCE.isGecko){window.setTimeout("tinyMCE.triggerNodeChange(false);",1)}return ;case"FontSize":this.getDoc().execCommand("FontSize",false,value);if(tinyMCE.isGecko){window.setTimeout("tinyMCE.triggerNodeChange(false);",1)}return ;case"forecolor":value=value==null?this.foreColor:value;value=tinyMCE.trim(value);value=value.charAt(0)!="#"?(isNaN("0x"+value)?value:"#"+value):value;this.foreColor=value;this.getDoc().execCommand("forecolor",false,value);break;case"HiliteColor":value=value==null?this.backColor:value;value=tinyMCE.trim(value);value=value.charAt(0)!="#"?(isNaN("0x"+value)?value:"#"+value):value;this.backColor=value;if(tinyMCE.isGecko){this._setUseCSS(true);this.getDoc().execCommand("hilitecolor",false,value);this._setUseCSS(false)}else{this.getDoc().execCommand("BackColor",false,value)}break;case"Cut":case"Copy":case"Paste":var cmdFailed=false;eval("try {this.getDoc().execCommand(command, user_interface, value);} catch (e) {cmdFailed = true;}");if(tinyMCE.isOpera&&cmdFailed){alert("Currently not supported by your browser, use keyboard shortcuts instead.")}if(tinyMCE.isGecko&&cmdFailed){if(confirm(tinyMCE.entityDecode(tinyMCE.getLang("lang_clipboard_msg")))){window.open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","mceExternal")}return }else{tinyMCE.triggerNodeChange()}break;case"mceSetContent":if(!value){value=""}value=tinyMCE.storeAwayURLs(value);value=tinyMCE._customCleanup(this,"insert_to_editor",value);if(this.getBody().nodeName=="BODY"){tinyMCE._setHTML(doc,value)}else{this.getBody().innerHTML=value}tinyMCE.setInnerHTML(this.getBody(),tinyMCE._cleanupHTML(this,doc,this.settings,this.getBody(),false,false,false,true));tinyMCE.convertAllRelativeURLs(this.getBody());tinyMCE._removeInternal(this.getBody());if(tinyMCE.getParam("convert_fonts_to_spans")){tinyMCE.convertSpansToFonts(doc)}tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE._setEventsEnabled(this.getBody(),false);return true;case"mceCleanup":var b=this.selection.getBookmark();tinyMCE._setHTML(this.contentDocument,this.getBody().innerHTML);tinyMCE.setInnerHTML(this.getBody(),tinyMCE._cleanupHTML(this,this.contentDocument,this.settings,this.getBody(),this.visualAid));tinyMCE.convertAllRelativeURLs(doc.body);if(tinyMCE.getParam("convert_fonts_to_spans")){tinyMCE.convertSpansToFonts(doc)}tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE._setEventsEnabled(this.getBody(),false);this.repaint();this.selection.moveToBookmark(b);tinyMCE.triggerNodeChange();break;case"mceReplaceContent":if(!value){value=""}this.getWin().focus();var selectedText="";if(tinyMCE.isIE){var rng=doc.selection.createRange();selectedText=rng.text}else{selectedText=this.getSel().toString()}if(selectedText.length>0){value=tinyMCE.replaceVar(value,"selection",selectedText);tinyMCE.execCommand("mceInsertContent",false,value)}tinyMCE.triggerNodeChange();break;case"mceSetAttribute":if(typeof (value)=="object"){var targetElms=(typeof (value["targets"])=="undefined")?"p,img,span,div,td,h1,h2,h3,h4,h5,h6,pre,address":value["targets"];var targetNode=tinyMCE.getParentElement(this.getFocusElement(),targetElms);if(targetNode){targetNode.setAttribute(value["name"],value["value"]);tinyMCE.triggerNodeChange()}}break;case"mceSetCSSClass":this.execCommand("mceSetStyleInfo",false,{command:"setattrib",name:"class",value:value});break;case"mceInsertRawHTML":var key="tiny_mce_marker";this.execCommand("mceBeginUndoLevel");this.execCommand("mceInsertContent",false,key);var scrollX=this.getBody().scrollLeft+this.getDoc().documentElement.scrollLeft;var scrollY=this.getBody().scrollTop+this.getDoc().documentElement.scrollTop;var html=this.getBody().innerHTML;if((pos=html.indexOf(key))!=-1){tinyMCE.setInnerHTML(this.getBody(),html.substring(0,pos)+value+html.substring(pos+key.length))}this.contentWindow.scrollTo(scrollX,scrollY);this.execCommand("mceEndUndoLevel");break;case"mceInsertContent":if(!value){value=""}var insertHTMLFailed=false;if(tinyMCE.isGecko||tinyMCE.isOpera){try{if(value.indexOf("<")==-1&&!value.match(/(&#38;|&#160;|&#60;|&#62;)/g)){var r=this.getRng();var n=this.getDoc().createTextNode(tinyMCE.entityDecode(value));var s=this.getSel();var r2=r.cloneRange();s.removeAllRanges();r.deleteContents();r.insertNode(n);r2.selectNode(n);r2.collapse(false);s.removeAllRanges();s.addRange(r2)}else{value=tinyMCE.fixGeckoBaseHREFBug(1,this.getDoc(),value);this.getDoc().execCommand("inserthtml",false,value);tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value)}}catch(ex){insertHTMLFailed=true}if(!insertHTMLFailed){tinyMCE.triggerNodeChange();return }}if(!tinyMCE.isIE){var isHTML=value.indexOf("<")!=-1;var sel=this.getSel();var rng=this.getRng();if(isHTML){if(tinyMCE.isSafari){var tmpRng=this.getDoc().createRange();tmpRng.setStart(this.getBody(),0);tmpRng.setEnd(this.getBody(),0);value=tmpRng.createContextualFragment(value)}else{value=rng.createContextualFragment(value)}}else{var el=document.createElement("div");el.innerHTML=value;value=el.firstChild.nodeValue;value=doc.createTextNode(value)}if(tinyMCE.isSafari&&!isHTML){this.execCommand("InsertText",false,value.nodeValue);tinyMCE.triggerNodeChange();return true}else{if(tinyMCE.isSafari&&isHTML){rng.deleteContents();rng.insertNode(value);tinyMCE.triggerNodeChange();return true}}rng.deleteContents();if(rng.startContainer.nodeType==3){var node=rng.startContainer.splitText(rng.startOffset);node.parentNode.insertBefore(value,node)}else{rng.insertNode(value)}if(!isHTML){sel.selectAllChildren(doc.body);sel.removeAllRanges();var rng=doc.createRange();rng.selectNode(value);rng.collapse(false);sel.addRange(rng)}else{rng.collapse(false)}tinyMCE.fixGeckoBaseHREFBug(2,this.getDoc(),value)}else{var rng=doc.selection.createRange(),tmpRng=null;var c=value.indexOf("<!--")!=-1;if(c){value=tinyMCE.uniqueTag+value}if(rng.item){rng.item(0).outerHTML=value}else{rng.pasteHTML(value)}if(c){var e=this.getDoc().getElementById("mceTMPElement");e.parentNode.removeChild(e)}}tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.triggerNodeChange();break;case"mceStartTyping":if(tinyMCE.settings["custom_undo_redo"]&&this.undoRedo.typingUndoIndex==-1){this.undoRedo.typingUndoIndex=this.undoRedo.undoIndex;tinyMCE.typingUndoIndex=tinyMCE.undoIndex;this.execCommand("mceAddUndoLevel")}break;case"mceEndTyping":if(tinyMCE.settings["custom_undo_redo"]&&this.undoRedo.typingUndoIndex!=-1){this.execCommand("mceAddUndoLevel");this.undoRedo.typingUndoIndex=-1}tinyMCE.typingUndoIndex=-1;break;case"mceBeginUndoLevel":this.undoRedoLevel=false;break;case"mceEndUndoLevel":this.undoRedoLevel=true;this.execCommand("mceAddUndoLevel");break;case"mceAddUndoLevel":if(tinyMCE.settings["custom_undo_redo"]&&this.undoRedoLevel){if(this.undoRedo.add()){tinyMCE.triggerNodeChange(false)}}break;case"Undo":if(tinyMCE.settings["custom_undo_redo"]){tinyMCE.execCommand("mceEndTyping");this.undoRedo.undo();tinyMCE.triggerNodeChange()}else{this.getDoc().execCommand(command,user_interface,value)}break;case"Redo":if(tinyMCE.settings["custom_undo_redo"]){tinyMCE.execCommand("mceEndTyping");this.undoRedo.redo();tinyMCE.triggerNodeChange()}else{this.getDoc().execCommand(command,user_interface,value)}break;case"mceToggleVisualAid":this.visualAid=!this.visualAid;tinyMCE.handleVisualAid(this.getBody(),true,this.visualAid,this);tinyMCE.triggerNodeChange();break;case"Indent":this.getDoc().execCommand(command,user_interface,value);tinyMCE.triggerNodeChange();if(tinyMCE.isIE){var n=tinyMCE.getParentElement(this.getFocusElement(),"blockquote");do{if(n&&n.nodeName=="BLOCKQUOTE"){n.removeAttribute("dir");n.removeAttribute("style")}}while(n!=null&&(n=n.parentNode)!=null)}break;case"RemoveFormat":case"removeformat":var text=this.selection.getSelectedText();if(tinyMCE.isOpera){this.getDoc().execCommand("RemoveFormat",false,null);return }if(tinyMCE.isIE){try{var rng=doc.selection.createRange();rng.execCommand("RemoveFormat",false,null)}catch(e){}this.execCommand("mceSetStyleInfo",false,{command:"removeformat"})}else{this.getDoc().execCommand(command,user_interface,value);this.execCommand("mceSetStyleInfo",false,{command:"removeformat"})}if(text.length==0){this.execCommand("mceSetCSSClass",false,"")}tinyMCE.triggerNodeChange();break;default:this.getDoc().execCommand(command,user_interface,value);if(tinyMCE.isGecko){window.setTimeout("tinyMCE.triggerNodeChange(false);",1)}else{tinyMCE.triggerNodeChange()}}if(command!="mceAddUndoLevel"&&command!="Undo"&&command!="Redo"&&command!="mceStartTyping"&&command!="mceEndTyping"){tinyMCE.execCommand("mceAddUndoLevel")}},queryCommandValue:function(B){try{return this.getDoc().queryCommandValue(B)}catch(A){return null}},queryCommandState:function(A){return this.getDoc().queryCommandState(A)},_onAdd:function(L,C,E){var H,G,D,J;G=this.settings["theme"];D=tinyMCE.themes[G];var P=E?E:document;this.targetDoc=P;tinyMCE.themeURL=tinyMCE.baseURL+"/themes/"+this.settings["theme"];this.settings["themeurl"]=tinyMCE.themeURL;if(!L){alert("Error: Could not find the target element.");return false}if(D.getEditorTemplate){J=D.getEditorTemplate(this.settings,this.editorId)}var M=J["delta_width"]?J["delta_width"]:0;var N=J["delta_height"]?J["delta_height"]:0;var K='<span id="'+this.editorId+'_parent" class="mceEditorContainer">'+J["html"];K=tinyMCE.replaceVar(K,"editor_id",this.editorId);this.settings["default_document"]=tinyMCE.baseURL+"/blank.htm";this.settings["old_width"]=this.settings["width"];this.settings["old_height"]=this.settings["height"];if(this.settings["width"]==-1){this.settings["width"]=L.offsetWidth}if(this.settings["height"]==-1){this.settings["height"]=L.offsetHeight}if(this.settings["width"]==0){this.settings["width"]=L.style.width}if(this.settings["height"]==0){this.settings["height"]=L.style.height}if(this.settings["width"]==0){this.settings["width"]=320}if(this.settings["height"]==0){this.settings["height"]=240}this.settings["area_width"]=parseInt(this.settings["width"]);this.settings["area_height"]=parseInt(this.settings["height"]);this.settings["area_width"]+=M;this.settings["area_height"]+=N;this.settings["width_style"]=""+this.settings["width"];this.settings["height_style"]=""+this.settings["height"];if((""+this.settings["width"]).indexOf("%")!=-1){this.settings["area_width"]="100%"}else{this.settings["width_style"]+="px"}if((""+this.settings["height"]).indexOf("%")!=-1){this.settings["area_height"]="100%"}else{this.settings["height_style"]+="px"}if((""+L.style.width).indexOf("%")!=-1){this.settings["width"]=L.style.width;this.settings["area_width"]="100%";this.settings["width_style"]="100%"}if((""+L.style.height).indexOf("%")!=-1){this.settings["height"]=L.style.height;this.settings["area_height"]="100%";this.settings["height_style"]="100%"}K=tinyMCE.applyTemplate(K);this.settings["width"]=this.settings["old_width"];this.settings["height"]=this.settings["old_height"];this.visualAid=this.settings["visual"];this.formTargetElementId=C;if(L.nodeName=="TEXTAREA"||L.nodeName=="INPUT"){this.startContent=L.value}else{this.startContent=L.innerHTML}if(L.nodeName!="TEXTAREA"&&L.nodeName!="INPUT"){this.oldTargetElement=L;if(tinyMCE.settings["debug"]){H='<textarea wrap="off" id="'+C+'" name="'+C+'" cols="100" rows="15"></textarea>'}else{H='<input type="hidden" id="'+C+'" name="'+C+'" />';this.oldTargetDisplay=tinyMCE.getStyle(this.oldTargetElement,"display","inline");this.oldTargetElement.style.display="none"}K+="</span>";if(tinyMCE.isGecko){K=H+K}else{K+=H}if(tinyMCE.isGecko){var I=L.ownerDocument.createRange();I.setStartBefore(L);var A=I.createContextualFragment(K);tinyMCE.insertAfter(A,L)}else{L.insertAdjacentHTML("beforeBegin",K)}}else{K+="</span>";this.oldTargetElement=L;if(!tinyMCE.settings["debug"]){this.oldTargetDisplay=tinyMCE.getStyle(this.oldTargetElement,"display","inline");this.oldTargetElement.style.display="none"}if(tinyMCE.isGecko){var I=L.ownerDocument.createRange();I.setStartBefore(L);var A=I.createContextualFragment(K);tinyMCE.insertAfter(A,L)}else{L.insertAdjacentHTML("beforeBegin",K)}}var F=false;var Q=P.getElementById(this.editorId);if(!tinyMCE.isIE){if(Q&&(Q.nodeName=="SPAN"||Q.nodeName=="span")){Q=tinyMCE._createIFrame(Q,P);F=true}this.targetElement=Q;this.iframeElement=Q;this.contentDocument=Q.contentDocument;this.contentWindow=Q.contentWindow}else{if(Q&&Q.nodeName=="SPAN"){Q=tinyMCE._createIFrame(Q,P,P.parentWindow)}else{Q=P.frames[this.editorId]}this.targetElement=Q;this.iframeElement=P.getElementById(this.editorId);if(tinyMCE.isOpera){this.contentDocument=this.iframeElement.contentDocument;this.contentWindow=this.iframeElement.contentWindow;F=true}else{this.contentDocument=Q.window.document;this.contentWindow=Q.window}this.getDoc().designMode="on"}var R=this.contentDocument;if(F){var K=tinyMCE.getParam("doctype")+'<html><head xmlns="http://www.w3.org/1999/xhtml"><base href="'+tinyMCE.settings["base_href"]+'" /><title>blank_page</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body class="mceContentBody"></body></html>';try{if(!this.isHidden()){this.getDoc().designMode="on"}R.open();R.write(K);R.close()}catch(O){this.getDoc().location.href=tinyMCE.baseURL+"/blank.htm"}}if(tinyMCE.isIE){window.setTimeout('tinyMCE.addEventHandlers(tinyMCE.instances["'+this.editorId+'"]);',1)}var B=this.targetDoc.getElementById(this.editorId+"_parent");this.formElement=tinyMCE.isGecko?B.previousSibling:B.nextSibling;tinyMCE.setupContent(this.editorId,true);return true},setBaseHREF:function(C){var D,A,E,B;E=this.getDoc();B=E.getElementsByTagName("base");A=B.length>0?B[0]:null;if(!A){B=E.getElementsByTagName("head");D=B.length>0?B[0]:null;A=E.createElement("base");A.setAttribute("href",C);D.appendChild(A)}else{if(C==""||C==null){A.parentNode.removeChild(A)}else{A.setAttribute("href",C)}}},getHTML:function(C){var B,D=this.getDoc(),A=this.getBody();if(C){return A.innerHTML}B=tinyMCE._cleanupHTML(this,D,this.settings,A,false,true,false,true);if(tinyMCE.getParam("convert_fonts_to_spans")){tinyMCE.convertSpansToFonts(D)}return B},setHTML:function(A){this.execCommand("mceSetContent",false,A);this.repaint()},getFocusElement:function(){return this.selection.getFocusElement()},getSel:function(){return this.selection.getSel()},getRng:function(){return this.selection.getRng()},triggerSave:function(skip_cleanup,skip_callback){var e,nl=[],i,s;this.switchSettings();s=tinyMCE.settings;if(tinyMCE.isRealIE){e=this.iframeElement;do{if(e.style&&e.style.display=="none"){e.style.display="block";nl[nl.length]={elm:e,type:"style"}}if(e.style&&s.hidden_tab_class.length>0&&e.className.indexOf(s.hidden_tab_class)!=-1){e.className=s.display_tab_class;nl[nl.length]={elm:e,type:"class"}}}while((e=e.parentNode)!=null)}tinyMCE.settings["preformatted"]=false;if(typeof (skip_cleanup)=="undefined"){skip_cleanup=false}if(typeof (skip_callback)=="undefined"){skip_callback=false}tinyMCE._setHTML(this.getDoc(),this.getBody().innerHTML);if(this.settings["cleanup"]==false){tinyMCE.handleVisualAid(this.getBody(),true,false,this);tinyMCE._setEventsEnabled(this.getBody(),true)}tinyMCE._customCleanup(this,"submit_content_dom",this.contentWindow.document.body);var htm=skip_cleanup?this.getBody().innerHTML:tinyMCE._cleanupHTML(this,this.getDoc(),this.settings,this.getBody(),tinyMCE.visualAid,true,true);htm=tinyMCE._customCleanup(this,"submit_content",htm);if(!skip_callback&&tinyMCE.settings["save_callback"]!=""){var content=eval(tinyMCE.settings["save_callback"]+"(this.formTargetElementId,htm,this.getBody());")}if((typeof (content)!="undefined")&&content!=null){htm=content}htm=tinyMCE.regexpReplace(htm,"&#40;","(","gi");htm=tinyMCE.regexpReplace(htm,"&#41;",")","gi");htm=tinyMCE.regexpReplace(htm,"&#59;",";","gi");htm=tinyMCE.regexpReplace(htm,"&#34;","&quot;","gi");htm=tinyMCE.regexpReplace(htm,"&#94;","^","gi");if(this.formElement){this.formElement.value=htm}if(tinyMCE.isSafari&&this.formElement){this.formElement.innerText=htm}for(i=0;i<nl.length;i++){if(nl[i].type=="style"){nl[i].elm.style.display="none"}else{nl[i].elm.className=s.hidden_tab_class}}}};TinyMCE_Engine.prototype.cleanupHTMLCode=function(A){A=A.replace(new RegExp("<p \\/>","gi"),"<p>&nbsp;</p>");A=A.replace(new RegExp("<p>\\s*<\\/p>","gi"),"<p>&nbsp;</p>");A=A.replace(new RegExp("<br>\\s*<\\/br>","gi"),"<br />");A=A.replace(new RegExp("<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|font|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\\\|>]*)\\/>","gi"),"<$1$2$3></$1$2>");A=A.replace(new RegExp("\\s+></","gi"),"></");A=A.replace(new RegExp("<(img|br|hr)([^>]*)><\\/(img|br|hr)>","gi"),"<$1$2 />");if(tinyMCE.isIE){A=A.replace(new RegExp("<p><hr \\/><\\/p>","gi"),"<hr>")}if(tinyMCE.isIE){A=A.replace(/<!(\s*)\/>/g,"")}return A};TinyMCE_Engine.prototype.parseStyle=function(F){var A=new Array();if(F==null){return A}var B=F.split(";");tinyMCE.clearArray(A);for(var C=0;C<B.length;C++){if(B[C]==""){continue}var E=new RegExp("^\\s*([^:]*):\\s*(.*)\\s*$");var D=B[C].replace(E,"$1||$2").split("||");if(D.length==2){A[D[0].toLowerCase()]=D[1]}}return A};TinyMCE_Engine.prototype.compressStyle=function(B,G,F,D){var E=new Array();E[0]=B[G+"-top"+F];E[1]=B[G+"-left"+F];E[2]=B[G+"-right"+F];E[3]=B[G+"-bottom"+F];for(var C=0;C<E.length;C++){if(E[C]==null){return }for(var A=0;A<E.length;A++){if(E[A]!=E[C]){return }}}B[D]=E[0];B[G+"-top"+F]=null;B[G+"-left"+F]=null;B[G+"-right"+F]=null;B[G+"-bottom"+F]=null};TinyMCE_Engine.prototype.serializeStyle=function(ar){var str="";tinyMCE.compressStyle(ar,"border","","border");tinyMCE.compressStyle(ar,"border","-width","border-width");tinyMCE.compressStyle(ar,"border","-color","border-color");tinyMCE.compressStyle(ar,"border","-style","border-style");tinyMCE.compressStyle(ar,"padding","","padding");tinyMCE.compressStyle(ar,"margin","","margin");for(var key in ar){var val=ar[key];if(typeof (val)=="function"){continue}if(key.indexOf("mso-")==0){continue}if(val!=null&&val!=""){val=""+val;val=val.replace(new RegExp("url\\(\\'?([^\\']*)\\'?\\)","gi"),"url('$1')");if(val.indexOf("url(")!=-1&&tinyMCE.getParam("convert_urls")){var m=new RegExp("url\\('(.*?)'\\)").exec(val);if(m.length>1){val="url('"+eval(tinyMCE.getParam("urlconverter_callback")+"(m[1], null, true);")+"')"}}if(tinyMCE.getParam("force_hex_style_colors")){val=tinyMCE.convertRGBToHex(val,true)}val=val.replace(/\"/g,"'");if(val!="url('')"){str+=key.toLowerCase()+": "+val+"; "}}}if(new RegExp("; $").test(str)){str=str.substring(0,str.length-2)}return str};TinyMCE_Engine.prototype.convertRGBToHex=function(D,A){if(D.toLowerCase().indexOf("rgb")!=-1){var C=new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)","gi");var B=D.replace(C,"$1,$2,$3,$4,$5").split(",");if(B.length==5){r=parseInt(B[1]).toString(16);g=parseInt(B[2]).toString(16);b=parseInt(B[3]).toString(16);r=r.length==1?"0"+r:r;g=g.length==1?"0"+g:g;b=b.length==1?"0"+b:b;D="#"+r+g+b;if(A){D=B[0]+D+B[4]}}}return D};TinyMCE_Engine.prototype.convertHexToRGB=function(A){if(A.indexOf("#")!=-1){A=A.replace(new RegExp("[^0-9A-F]","gi"),"");return"rgb("+parseInt(A.substring(0,2),16)+","+parseInt(A.substring(2,4),16)+","+parseInt(A.substring(4,6),16)+")"}return A};TinyMCE_Engine.prototype.convertSpansToFonts=function(F){var G=tinyMCE.getParam("font_size_style_values").replace(/\s+/,"").split(",");var H=tinyMCE.selectElements(F,"span,font");for(var C=0;C<H.length;C++){var I=tinyMCE.trim(H[C].style.fontSize).toLowerCase();var D=0;for(var E=0;E<G.length;E++){if(G[E]==I){D=E+1;break}}if(D>0){tinyMCE.setAttrib(H[C],"size",D);H[C].style.fontSize=""}var A=H[C].style.fontFamily;if(A!=null&&A!=""){tinyMCE.setAttrib(H[C],"face",A);H[C].style.fontFamily=""}var B=H[C].style.color;if(B!=null&&B!=""){tinyMCE.setAttrib(H[C],"color",tinyMCE.convertRGBToHex(B));H[C].style.color=""}}};TinyMCE_Engine.prototype.convertFontsToSpans=function(G){var D=tinyMCE.getParam("font_size_style_values").replace(/\s+/,"").split(",");var H=tinyMCE.getParam("font_size_classes");if(H!=""){H=H.replace(/\s+/,"").split(",")}else{H=null}var C=tinyMCE.selectElements(G,"span,font");for(var B=0;B<C.length;B++){var F,A,E;F=tinyMCE.getAttrib(C[B],"size");A=tinyMCE.getAttrib(C[B],"face");E=tinyMCE.getAttrib(C[B],"color");if(F!=""){F=parseInt(F);if(F>0&&F<8){if(H!=null){tinyMCE.setAttrib(C[B],"class",H[F-1])}else{C[B].style.fontSize=D[F-1]}}C[B].removeAttribute("size")}if(A!=""){C[B].style.fontFamily=A;C[B].removeAttribute("face")}if(E!=""){C[B].style.color=E;C[B].removeAttribute("color")}}};TinyMCE_Engine.prototype.cleanupAnchors=function(D){var B,E,A,C=D.getElementsByTagName("a");for(B=C.length-1;B>=0;B--){if(tinyMCE.getAttrib(C[B],"name")!=""&&tinyMCE.getAttrib(C[B],"href")==""){E=C[B].childNodes;for(A=E.length-1;A>=0;A--){tinyMCE.insertAfter(E[A],C[B])}}}};TinyMCE_Engine.prototype.getContent=function(A){if(typeof (A)!="undefined"){tinyMCE.getInstanceById(A).select()}if(tinyMCE.selectedInstance){return tinyMCE.selectedInstance.getHTML()}return null};TinyMCE_Engine.prototype._fixListElements=function(F){var B,H,G=["ol","ul"],E,D,C,A=new RegExp("^(OL|UL)$"),I;for(H=0;H<G.length;H++){B=F.getElementsByTagName(G[H]);for(E=0;E<B.length;E++){D=B[E];C=D.parentNode;if(A.test(C.nodeName)){I=tinyMCE.prevNode(D,"LI");if(!I){I=F.createElement("li");I.innerHTML="&nbsp;";I.appendChild(D);C.insertBefore(I,C.firstChild)}else{I.appendChild(D)}}}}};TinyMCE_Engine.prototype._fixTables=function(G){var B,D,H,F,E,A,C;B=G.getElementsByTagName("table");for(D=0;D<B.length;D++){H=B[D];if((F=tinyMCE.getParentElement(H,"p,h1,h2,h3,h4,h5,h6"))!=null){E=F.cloneNode(false);E.removeAttribute("id");C=H;while((H=H.nextSibling)){E.appendChild(H)}tinyMCE.insertAfter(E,F);tinyMCE.insertAfter(C,F)}}};TinyMCE_Engine.prototype._cleanupHTML=function(A,R,Q,C,O,L,K,B){var M,N,I,H,G,F,E,P,J,D;if(!tinyMCE.getParam("cleanup")){return C.innerHTML}L=typeof (L)=="undefined"?false:L;P=A.cleanup;J=A.settings;N=P.settings.debug;if(N){I=new Date().getTime()}if(tinyMCE.getParam("convert_fonts_to_spans")){tinyMCE.convertFontsToSpans(R)}if(tinyMCE.getParam("fix_list_elements")){tinyMCE._fixListElements(R)}if(tinyMCE.getParam("fix_table_elements")){tinyMCE._fixTables(R)}tinyMCE._customCleanup(A,L?"get_from_editor_dom":"insert_to_editor_dom",R.body);if(N){H=new Date().getTime()}P.settings.on_save=L;P.idCount=0;P.serializationId++;P.serializedNodes=new Array();P.sourceIndex=-1;if(J.cleanup_serializer=="xml"){M=P.serializeNodeAsXML(C,B)}else{M=P.serializeNodeAsHTML(C,B)}if(N){G=new Date().getTime()}D=tinyMCE.getParam("entity_encoding")=="numeric"?"&#160;":"&nbsp;";M=M.replace(/<\/?(body|head|html)[^>]*>/gi,"");M=M.replace(new RegExp(' (rowspan="1"|colspan="1")',"g"),"");M=M.replace(/<p><hr \/><\/p>/g,"<hr />");M=M.replace(/<p>(&nbsp;|&#160;)<\/p><hr \/><p>(&nbsp;|&#160;)<\/p>/g,"<hr />");M=M.replace(/<td>\s*<br \/>\s*<\/td>/g,"<td>"+D+"</td>");M=M.replace(/<p>\s*<br \/>\s*<\/p>/g,"<p>"+D+"</p>");M=M.replace(/<br \/>$/,"");M=M.replace(/<br \/><\/p>/g,"</p>");M=M.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*(&nbsp;|&#160;)\s*<\/p>/g,"<p>"+D+"</p>");M=M.replace(/<p>\s*(&nbsp;|&#160;)\s*<br \/>\s*<\/p>/g,"<p>"+D+"</p>");M=M.replace(/<p>\s*<br \/>\s*&nbsp;\s*<\/p>/g,"<p>"+D+"</p>");M=M.replace(new RegExp("<a>(.*?)<\\/a>","g"),"$1");M=M.replace(/<p([^>]*)>\s*<\/p>/g,"<p$1>"+D+"</p>");if(/^\s*(<br \/>|<p>&nbsp;<\/p>|<p>&#160;<\/p>|<p><\/p>)\s*$/.test(M)){M=""}if(J.preformatted){M=M.replace(/^<pre>/,"");M=M.replace(/<\/pre>$/,"");M="<pre>"+M+"</pre>"}if(tinyMCE.isGecko){M=M.replace(/<o:p _moz-userdefined="" \/>/g,"");M=M.replace(/<td([^>]*)>\s*<br \/>\s*<\/td>/g,"<td$1>"+D+"</td>")}if(J.force_br_newlines){M=M.replace(/<p>(&nbsp;|&#160;)<\/p>/g,"<br />")}M=tinyMCE._customCleanup(A,L?"get_from_editor":"insert_to_editor",M);if(L){M=M.replace(new RegExp(" ?(mceItem[a-zA-Z0-9]*|"+J.visual_table_class+")","g"),"");M=M.replace(new RegExp(' ?class=""',"g"),"")}if(J.remove_linebreaks&&!P.settings.indent){M=M.replace(/\n|\r/g," ")}if(N){F=new Date().getTime()}if(L&&P.settings.indent){M=P.formatHTML(M)}if(K&&(J.encoding=="xml"||J.encoding=="html")){M=P.xmlEncode(M)}if(N){E=new Date().getTime()}if(P.settings.debug){tinyMCE.debug("Cleanup in ms: Pre="+(H-I)+", Serialize: "+(G-H)+", Post: "+(F-G)+", Format: "+(E-F)+", Sum: "+(E-I)+".")}return M};function TinyMCE_Cleanup(){this.isIE=(navigator.appName=="Microsoft Internet Explorer");this.rules=tinyMCE.clearArray(new Array());this.settings={indent_elements:"head,table,tbody,thead,tfoot,form,tr,ul,ol,blockquote,object",newline_before_elements:"h1,h2,h3,h4,h5,h6,pre,address,div,ul,ol,li,meta,option,area,title,link,base,script,td",newline_after_elements:"br,hr,p,pre,address,div,ul,ol,meta,option,area,link,base,script",newline_before_after_elements:"html,head,body,table,thead,tbody,tfoot,tr,form,ul,ol,blockquote,p,object,param,hr,div",indent_char:"\t",indent_levels:1,entity_encoding:"raw",valid_elements:"*[*]",entities:"",url_converter:"",invalid_elements:"",verify_html:false};this.vElements=tinyMCE.clearArray(new Array());this.vElementsRe="";this.closeElementsRe=/^(IMG|BR|HR|LINK|META|BASE|INPUT|AREA)$/;this.codeElementsRe=/^(SCRIPT|STYLE)$/;this.serializationId=0;this.mceAttribs={href:"mce_href",src:"mce_src",type:"mce_type"}}TinyMCE_Cleanup.prototype={init:function(D){var G,A,C,E,F,B;for(G in D){this.settings[G]=D[G]}D=this.settings;this.inRe=this._arrayToRe(D.indent_elements.split(","),"","^<(",")[^>]*");this.ouRe=this._arrayToRe(D.indent_elements.split(","),"","^<\\/(",")[^>]*");this.nlBeforeRe=this._arrayToRe(D.newline_before_elements.split(","),"gi","<(",")([^>]*)>");this.nlAfterRe=this._arrayToRe(D.newline_after_elements.split(","),"gi","<(",")([^>]*)>");this.nlBeforeAfterRe=this._arrayToRe(D.newline_before_after_elements.split(","),"gi","<(\\/?)(",")([^>]*)>");this.serializedNodes=[];if(D.invalid_elements!=""){this.iveRe=this._arrayToRe(D.invalid_elements.toUpperCase().split(","),"g","^(",")$")}else{this.iveRe=null}B="";for(C=0;C<D.indent_levels;C++){B+=D.indent_char}this.inStr=B;if(!D.verify_html){D.valid_elements="*[*]";D.extended_valid_elements=""}this.fillStr=D.entity_encoding=="named"?"&nbsp;":"&#160;";this.idCount=0;this.xmlEncodeRe=new RegExp('[\u007F-\uFFFF<>&"]',"g");this.xmlEncodeAposRe=new RegExp("[\u007F-\uFFFF<>&\"']","g")},addRuleStr:function(A){var B=this.parseRuleStr(A);var C;for(C in B){if(B[C]){this.rules[C]=B[C]}}this.vElements=tinyMCE.clearArray(new Array());for(C in this.rules){if(this.rules[C]){this.vElements[this.vElements.length]=this.rules[C].tag}}this.vElementsRe=this._arrayToRe(this.vElements,"")},isValid:function(A){this._setupRules();if(!A){return true}A=A.replace(/[^a-z0-9]+/gi,"").toUpperCase();return !tinyMCE.getParam("cleanup")||this.vElementsRe.test(A)},addChildRemoveRuleStr:function(J){var F,E,B,C,I,H,D,G,A;if(!J){return }D=J.split(",");for(F=0;F<D.length;F++){J=D[F];B=this.split(/\[|\]/,J);if(B==null||B.length<1){I=J.toUpperCase()}else{I=B[0].toUpperCase()}H=this.split("/",I);for(E=0;E<H.length;E++){A="^(";G=this.split(/\|/,B[1]);for(C=0;C<G.length;C++){if(G[C]=="%istrict"){A+=tinyMCE.inlineStrict}else{if(G[C]=="%itrans"){A+=tinyMCE.inlineTransitional}else{if(G[C]=="%istrict_na"){A+=tinyMCE.inlineStrict.substring(2)}else{if(G[C]=="%itrans_na"){A+=tinyMCE.inlineTransitional.substring(2)}else{if(G[C]=="%btrans"){A+=tinyMCE.blockElms}else{if(G[C]=="%strict"){A+=tinyMCE.blockStrict}else{A+=(G[C].charAt(0)!="#"?G[C].toUpperCase():G[C])}}}}}}A+=(C!=G.length-1?"|":"")}A+=")$";if(this.childRules==null){this.childRules=tinyMCE.clearArray(new Array())}this.childRules[H[E]]=new RegExp(A);if(B.length>1){this.childRules[H[E]].wrapTag=B[2]}}}},parseRuleStr:function(N){var G,D,A,I,F,J,K,M,L,H,C,E=tinyMCE.clearArray(new Array()),B;if(N==null||N.length==0){return E}G=N.split(",");for(J=0;J<G.length;J++){N=G[J];if(N.length==0){continue}D=this.split(/\[|\]/,N);if(D==null||D.length<1){M=N.toUpperCase()}else{M=D[0].toUpperCase()}L=this.split("/",M);for(H=0;H<L.length;H++){A={};A.tag=L[H];A.forceAttribs=null;A.defaultAttribs=null;A.validAttribValues=null;K=A.tag.charAt(0);A.forceOpen=K=="+";A.removeEmpty=K=="-";A.fill=K=="#";A.tag=A.tag.replace(/\+|-|#/g,"");A.oTagName=L[0].replace(/\+|-|#/g,"").toLowerCase();A.isWild=new RegExp("\\*|\\?|\\+","g").test(A.tag);A.validRe=new RegExp(this._wildcardToRe("^"+A.tag+"$"));if(D.length>1){A.vAttribsRe="^(";I=this.split(/\|/,D[1]);for(F=0;F<I.length;F++){M=I[F];if(M.charAt(0)=="!"){I[F]=M=M.substring(1);if(!A.reqAttribsRe){A.reqAttribsRe="\\s+("+M}else{A.reqAttribsRe+="|"+M}}C=new RegExp("(=|:|<)(.*?)$").exec(M);M=M.replace(new RegExp("(=|:|<).*?$"),"");if(C&&C.length>0){if(C[0].charAt(0)==":"){if(!A.forceAttribs){A.forceAttribs=tinyMCE.clearArray(new Array())}A.forceAttribs[M.toLowerCase()]=C[0].substring(1)}else{if(C[0].charAt(0)=="="){if(!A.defaultAttribs){A.defaultAttribs=tinyMCE.clearArray(new Array())}B=C[0].substring(1);A.defaultAttribs[M.toLowerCase()]=B==""?"mce_empty":B}else{if(C[0].charAt(0)=="<"){if(!A.validAttribValues){A.validAttribValues=tinyMCE.clearArray(new Array())}A.validAttribValues[M.toLowerCase()]=this._arrayToRe(this.split("?",C[0].substring(1)),"i")}}}}A.vAttribsRe+=""+M.toLowerCase()+(F!=I.length-1?"|":"");I[F]=M.toLowerCase()}if(A.reqAttribsRe){A.reqAttribsRe=new RegExp(A.reqAttribsRe+')="',"g")}A.vAttribsRe+=")$";A.vAttribsRe=this._wildcardToRe(A.vAttribsRe);A.vAttribsReIsWild=new RegExp("\\*|\\?|\\+","g").test(A.vAttribsRe);A.vAttribsRe=new RegExp(A.vAttribsRe);A.vAttribs=I.reverse()}else{A.vAttribsRe="";A.vAttribs=tinyMCE.clearArray(new Array());A.vAttribsReIsWild=false}E[A.tag]=A}}return E},serializeNodeAsXML:function(D){var B,A;if(!this.xmlDoc){if(this.isIE){try{this.xmlDoc=new ActiveXObject("MSXML2.DOMDocument")}catch(C){}if(!this.xmlDoc){try{this.xmlDoc=new ActiveXObject("Microsoft.XmlDom")}catch(C){}}}else{this.xmlDoc=document.implementation.createDocument("","",null)}if(!this.xmlDoc){alert("Error XML Parser could not be found.")}}if(this.xmlDoc.firstChild){this.xmlDoc.removeChild(this.xmlDoc.firstChild)}A=this.xmlDoc.createElement("html");A=this.xmlDoc.appendChild(A);this._convertToXML(D,A);if(this.isIE){return this.xmlDoc.xml}else{return new XMLSerializer().serializeToString(this.xmlDoc)}},_convertToXML:function(B,F){var J,A,E,D,H,C,I,G=false;if(tinyMCE.isRealIE&&this._isDuplicate(B)){return }J=this.xmlDoc;switch(B.nodeType){case 1:G=B.hasChildNodes();A=J.createElement(B.nodeName.toLowerCase());C=B.attributes;for(E=C.length-1;E>-1;E--){I=C[E];if(I.specified&&I.nodeValue){A.setAttribute(I.nodeName.toLowerCase(),I.nodeValue)}}if(!G&&!this.closeElementsRe.test(B.nodeName)){A.appendChild(J.createTextNode(""))}F=F.appendChild(A);break;case 3:F.appendChild(J.createTextNode(B.nodeValue));return ;case 8:F.appendChild(J.createComment(B.nodeValue));return }if(G){H=B.childNodes;for(E=0,D=H.length;E<D;E++){this._convertToXML(H[E],F)}}},serializeNodeAsHTML:function(D,M){var B,N,G="",F,E,Q,P,A,L,K=false,I=false,C,H,J,O;this._setupRules();if(tinyMCE.isRealIE&&this._isDuplicate(D)){return""}if(D.parentNode&&this.childRules!=null){J=this.childRules[D.parentNode.nodeName];if(typeof (J)!="undefined"&&!J.test(D.nodeName)){P=true;Q=null}}switch(D.nodeType){case 1:H=D.hasChildNodes();if(P){break}if((tinyMCE.isRealIE)&&D.nodeName.indexOf("/")!=-1){break}O=D.nodeName;if(this.settings.convert_fonts_to_spans){if(this.settings.on_save&&O=="FONT"){O="SPAN"}if(!this.settings.on_save&&O=="SPAN"){O="FONT"}}if(this.vElementsRe.test(O)&&(!this.iveRe||!this.iveRe.test(O))&&!M){K=true;A=this.rules[O];if(!A){C=this.rules;for(N in C){if(C[N]&&C[N].validRe.test(O)){A=C[N];break}}}B=A.isWild?O.toLowerCase():A.oTagName;I=A.fill;if(A.removeEmpty&&!H){return""}Q="<"+B;if(A.vAttribsReIsWild){C=D.attributes;for(F=C.length-1;F>-1;F--){N=C[F];if(N.specified&&A.vAttribsRe.test(N.nodeName)){Q+=this._serializeAttribute(D,A,N.nodeName)}}}else{for(F=A.vAttribs.length-1;F>-1;F--){Q+=this._serializeAttribute(D,A,A.vAttribs[F])}}if(!this.settings.on_save){C=this.mceAttribs;for(N in C){if(C[N]){Q+=this._serializeAttribute(D,A,C[N])}}}if(A.reqAttribsRe&&!Q.match(A.reqAttribsRe)){Q=null}if(Q!=null&&this.closeElementsRe.test(O)){return Q+" />"}if(Q!=null){G+=Q+">"}if(this.isIE&&this.codeElementsRe.test(O)){G+=D.innerHTML}}break;case 3:if(P){break}if(D.parentNode&&this.codeElementsRe.test(D.parentNode.nodeName)){return this.isIE?"":D.nodeValue}return this.xmlEncode(D.nodeValue);case 8:if(P){break}return"<!--"+this._trimComment(D.nodeValue)+"-->"}if(H){L=D.childNodes;for(F=0,E=L.length;F<E;F++){G+=this.serializeNodeAsHTML(L[F])}}if(I&&!H){G+=this.fillStr}if(Q!=null&&K){G+="</"+B+">"}return G},_serializeAttribute:function(F,C,B){var E="",A,D=this.settings.on_save;if(D&&(B.indexOf("mce_")==0||B.indexOf("_moz")==0)){return""}if(D&&this.mceAttribs[B]){E=this._getAttrib(F,this.mceAttribs[B])}if(E.length==0){E=this._getAttrib(F,B)}if(E.length==0&&C.defaultAttribs&&(A=C.defaultAttribs[B])){E=A;if(E=="mce_empty"){return" "+B+'=""'}}if(C.forceAttribs&&(A=C.forceAttribs[B])){E=A}if(D&&E.length!=0&&/^(src|href|longdesc)$/.test(B)){E=this._urlConverter(this,F,E)}if(E.length!=0&&C.validAttribValues&&C.validAttribValues[B]&&!C.validAttribValues[B].test(E)){return""}if(E.length!=0&&E=="{$uid}"){E="uid_"+(this.idCount++)}if(E.length!=0){if(B.indexOf("on")!=0){E=this.xmlEncode(E,1)}return" "+B+'="'+E+'"'}return""},formatHTML:function(E){var D=this.settings,F="",C=0,A=0,G="",B;E=E.replace(/<pre([^>]*)>(.*?)<\/pre>/gi,function(I,H,J){J=J.replace(/<br\s*\/>/gi,"\n");return"<pre"+H+">"+J+"</pre>"});E=E.replace(/\r/g,"");E="\n"+E;E=E.replace(new RegExp("\\n\\s+","gi"),"\n");E=E.replace(this.nlBeforeRe,"\n<$1$2>");E=E.replace(this.nlAfterRe,"<$1$2>\n");E=E.replace(this.nlBeforeAfterRe,"\n<$1$2$3>\n");E+="\n";while((C=E.indexOf("\n",C+1))!=-1){if((B=E.substring(A+1,C)).length!=0){if(this.ouRe.test(B)&&F.length>=D.indent_levels){F=F.substring(D.indent_levels)}G+=F+B+"\n";if(this.inRe.test(B)){F+=this.inStr}}A=C}return G},xmlEncode:function(D,B){var A=this,C=!B?this.xmlEncodeAposRe:this.xmlEncodeRe;this._setupEntities();switch(this.settings.entity_encoding){case"raw":return tinyMCE.xmlEncode(D,B);case"named":return D.replace(C,function(F,E){E=A.entities[F.charCodeAt(0)];return E?"&"+E+";":F});case"numeric":return D.replace(C,function(F,E){return E?"&#"+F.charCodeAt(0)+";":F})}return D},split:function(D,C){var F=C.split(D);var B,A,E=new Array();for(B=0,A=F.length;B<A;B++){if(F[B]!=""){E[B]=F[B]}}return E},_trimComment:function(A){A=A.replace(new RegExp('\\smce_src="[^"]*"',"gi"),"");A=A.replace(new RegExp('\\smce_href="[^"]*"',"gi"),"");return A},_getAttrib:function(C,F,D){var A,B,E;if(typeof (D)=="undefined"){D=""}if(!C||C.nodeType!=1){return D}try{A=C.getAttribute(F,0)}catch(B){A=C.getAttribute(F,2)}if(F=="class"&&!A){A=C.className}if(this.isIE){if(F=="http-equiv"){A=C.httpEquiv}E=C.nodeName;if(E=="FORM"&&F=="enctype"&&A=="application/x-www-form-urlencoded"){A=""}if(E=="INPUT"&&F=="size"&&A=="20"){A=""}if(E=="INPUT"&&F=="maxlength"&&A=="2147483647"){A=""}}if(F=="style"&&A){if(!tinyMCE.isOpera){A=C.style.cssText}A=tinyMCE.serializeStyle(tinyMCE.parseStyle(A))}if(this.settings.on_save&&F.indexOf("on")!=-1&&this.settings.on_save&&A&&A!=""){A=tinyMCE.cleanupEventStr(A)}return(A&&A!="")?""+A:D},_urlConverter:function(c,n,v){if(!c.settings.on_save){return tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings.base_href,v)}else{if(tinyMCE.getParam("convert_urls")){if(!this.urlConverter){this.urlConverter=eval(tinyMCE.settings.urlconverter_callback)}return this.urlConverter(v,n,true)}}return v},_arrayToRe:function(A,F,E,B){var C,D;F=typeof (F)=="undefined"?"gi":F;E=typeof (E)=="undefined"?"^(":E;B=typeof (B)=="undefined"?")$":B;D=E;for(C=0;C<A.length;C++){D+=this._wildcardToRe(A[C])+(C!=A.length-1?"|":"")}D+=B;return new RegExp(D,F)},_wildcardToRe:function(A){A=A.replace(/\?/g,"(\\S?)");A=A.replace(/\+/g,"(\\S+)");A=A.replace(/\*/g,"(\\S*)");return A},_setupEntities:function(){var D,A,B,C=this.settings;if(!this.entitiesDone){if(C.entity_encoding=="named"){D=tinyMCE.clearArray(new Array());A=this.split(",",C.entities);for(B=0;B<A.length;B+=2){D[A[B]]=A[B+1]}this.entities=D}this.entitiesDone=true}},_setupRules:function(){var A=this.settings;if(!this.rulesDone){this.addRuleStr(A.valid_elements);this.addRuleStr(A.extended_valid_elements);this.addChildRemoveRuleStr(A.valid_child_elements);this.rulesDone=true}},_isDuplicate:function(B){var A;if(!this.settings.fix_content_duplication){return false}if(tinyMCE.isRealIE&&B.nodeType==1){if(B.mce_serialized==this.serializationId){return true}B.setAttribute("mce_serialized",this.serializationId)}else{for(A=0;A<this.serializedNodes.length;A++){if(this.serializedNodes[A]==B){return true}}this.serializedNodes[this.serializedNodes.length]=B}return false}};TinyMCE_Engine.prototype.createTagHTML=function(A,B,C){var E="",D=tinyMCE.xmlEncode;E="<"+A;if(B){for(n in B){if(typeof (B[n])!="function"&&B[n]!=null){E+=" "+D(n)+'="'+D(""+B[n])+'"'}}}E+=!C?" />":">"+C+"</"+A+">";return E};TinyMCE_Engine.prototype.createTag=function(E,A,B,C){var D=E.createElement(A);if(B){for(n in B){if(typeof (B[n])!="function"&&B[n]!=null){tinyMCE.setAttrib(D,n,B[n])}}}if(C){D.innerHTML=C}return D};TinyMCE_Engine.prototype.getElementByAttributeValue=function(D,C,A,B){return(D=this.getElementsByAttributeValue(D,C,A,B)).length==0?null:D[0]};TinyMCE_Engine.prototype.getElementsByAttributeValue=function(G,E,B,C){var D,A=G.getElementsByTagName(E),F=new Array();for(D=0;D<A.length;D++){if(tinyMCE.getAttrib(A[D],B).indexOf(C)!=-1){F[F.length]=A[D]}}return F};TinyMCE_Engine.prototype.isBlockElement=function(A){return A!=null&&A.nodeType==1&&this.blockRegExp.test(A.nodeName)};TinyMCE_Engine.prototype.getParentBlockElement=function(B,A){return this.getParentNode(B,function(C){return tinyMCE.isBlockElement(C)},A);return null};TinyMCE_Engine.prototype.insertAfter=function(B,A){if(A.nextSibling){A.parentNode.insertBefore(B,A.nextSibling)}else{A.parentNode.appendChild(B)}};TinyMCE_Engine.prototype.setInnerHTML=function(D,C){var B,A,E;if(tinyMCE.isGecko){C=C.replace(/<embed([^>]*)>/gi,"<tmpembed$1>");C=C.replace(/<em([^>]*)>/gi,"<i$1>");C=C.replace(/<tmpembed([^>]*)>/gi,"<embed$1>");C=C.replace(/<strong([^>]*)>/gi,"<b$1>");C=C.replace(/<\/strong>/gi,"</b>");C=C.replace(/<\/em>/gi,"</i>")}if(tinyMCE.isRealIE){C=C.replace(/\s\/>/g,">");C=C.replace(/<p([^>]*)>\u00A0?<\/p>/gi,'<p$1 mce_keep="true">&nbsp;</p>');C=C.replace(/<p([^>]*)>\s*&nbsp;\s*<\/p>/gi,'<p$1 mce_keep="true">&nbsp;</p>');C=C.replace(/<p([^>]*)>\s+<\/p>/gi,'<p$1 mce_keep="true">&nbsp;</p>');D.innerHTML=tinyMCE.uniqueTag+C;D.firstChild.removeNode(true);A=D.getElementsByTagName("p");for(B=A.length-1;B>=0;B--){E=A[B];if(E.nodeName=="P"&&!E.hasChildNodes()&&!E.mce_keep){E.parentNode.removeChild(E)}}}else{C=this.fixGeckoBaseHREFBug(1,D,C);D.innerHTML=C;this.fixGeckoBaseHREFBug(2,D,C)}};TinyMCE_Engine.prototype.getOuterHTML=function(A){if(tinyMCE.isIE){return A.outerHTML}var B=A.ownerDocument.createElement("body");B.appendChild(A.cloneNode(true));return B.innerHTML};TinyMCE_Engine.prototype.setOuterHTML=function(E,D,F){var F=typeof (F)=="undefined"?E.ownerDocument:F,C,A,B;if(tinyMCE.isIE&&E.nodeType==1){E.outerHTML=D}else{B=F.createElement("body");B.innerHTML=D;for(C=0,A=B.childNodes;C<A.length;C++){E.parentNode.insertBefore(A[C].cloneNode(true),E)}E.parentNode.removeChild(E)}};TinyMCE_Engine.prototype._getElementById=function(F,E){var D,B,A,C;if(typeof (E)=="undefined"){E=document}D=E.getElementById(F);if(!D){C=E.forms;for(B=0;B<C.length;B++){for(A=0;A<C[B].elements.length;A++){if(C[B].elements[A].name==F){D=C[B].elements[A];break}}}}return D};TinyMCE_Engine.prototype.getNodeTree=function(D,A,B,C){return this.selectNodes(D,function(E){return(!B||E.nodeType==B)&&(!C||E.nodeName==C)},A?A:new Array())};TinyMCE_Engine.prototype.getParentElement=function(F,A,E,D){var C=A?new RegExp("^("+A.toUpperCase().replace(/,/g,"|")+")$"):0,B;if(E&&typeof (E)=="string"){return this.getParentElement(F,A,function(G){return tinyMCE.getAttrib(G,E)!=""})}return this.getParentNode(F,function(G){return((G.nodeType==1&&!C)||(C&&C.test(G.nodeName)))&&(!E||E(G))},D)};TinyMCE_Engine.prototype.getParentNode=function(C,B,A){while(C){if(C==A){return null}if(B(C)){return C}C=C.parentNode}return null};TinyMCE_Engine.prototype.getAttrib=function(E,B,D){var A;if(typeof (D)=="undefined"){D=""}if(!E||E.nodeType!=1){return D}try{A=E.getAttribute(B,0)}catch(C){A=E.getAttribute(B,2)}if(B=="class"&&!A){A=E.className}if(tinyMCE.isGecko&&B=="src"&&E.src!=null&&E.src!=""){A=E.src}if(tinyMCE.isGecko&&B=="href"&&E.href!=null&&E.href!=""){A=E.href}if(B=="http-equiv"&&tinyMCE.isIE){A=E.httpEquiv}if(B=="style"&&!tinyMCE.isOpera){A=E.style.cssText}return(A&&A!="")?A:D};TinyMCE_Engine.prototype.setAttrib=function(C,B,D,A){if(typeof (D)=="number"&&D!=null){D=""+D}if(A){if(D==null){D=""}D=D.replace(/[^0-9%]/g,"")}if(B=="style"){C.style.cssText=D}if(B=="class"){C.className=D}if(D!=null&&D!=""&&D!=-1){C.setAttribute(B,D)}else{C.removeAttribute(B)}};TinyMCE_Engine.prototype.setStyleAttrib=function(B,C,A){B.style[C]=A;if(tinyMCE.isIE&&A==null||A==""){A=tinyMCE.serializeStyle(tinyMCE.parseStyle(B.style.cssText));B.style.cssText=A;B.setAttribute("style",A)}};TinyMCE_Engine.prototype.switchClass=function(B,C){var A;if(tinyMCE.switchClassCache[B]){A=tinyMCE.switchClassCache[B]}else{A=tinyMCE.switchClassCache[B]=document.getElementById(B)}if(A){if(tinyMCE.settings.button_tile_map&&A.className&&A.className.indexOf("mceTiledButton")==0){C="mceTiledButton "+C}A.className=C}};TinyMCE_Engine.prototype.getAbsPosition=function(D,C){var A=0,B=0;while(D&&D!=C){A+=D.offsetLeft;B+=D.offsetTop;D=D.offsetParent}return{absLeft:A,absTop:B}};TinyMCE_Engine.prototype.prevNode=function(C,D){var A=D.split(","),B;while((C=C.previousSibling)!=null){for(B=0;B<A.length;B++){if(C.nodeName==A[B]){return C}}}return null};TinyMCE_Engine.prototype.nextNode=function(C,D){var A=D.split(","),B;while((C=C.nextSibling)!=null){for(B=0;B<A.length;B++){if(C.nodeName==A[B]){return C}}}return null};TinyMCE_Engine.prototype.selectElements=function(G,D,F){var E,C=[],B,A;for(A=0,D=D.split(",");A<D.length;A++){for(E=0,B=G.getElementsByTagName(D[A]);E<B.length;E++){(!F||F(B[E]))&&C.push(B[E])}}return C};TinyMCE_Engine.prototype.selectNodes=function(D,C,A){var B;if(!A){A=new Array()}if(C(D)){A[A.length]=D}if(D.hasChildNodes()){for(B=0;B<D.childNodes.length;B++){tinyMCE.selectNodes(D.childNodes[B],C,A)}}return A};TinyMCE_Engine.prototype.addCSSClass=function(B,D,A){var C=this.removeCSSClass(B,D);return B.className=A?D+(C!=""?(" "+C):""):(C!=""?(C+" "):"")+D};TinyMCE_Engine.prototype.removeCSSClass=function(A,B){B=A.className.replace(new RegExp("(^|\\s+)"+B+"(\\s+|$)")," ");return A.className=B!=" "?B:""};TinyMCE_Engine.prototype.hasCSSClass=function(B,A){return new RegExp("\\b"+A+"\\b","g").test(B.className)};TinyMCE_Engine.prototype.renameElement=function(D,F,E){var C,B,A;E=typeof (E)=="undefined"?tinyMCE.selectedInstance.getDoc():E;if(D){C=E.createElement(F);A=D.attributes;for(B=A.length-1;B>-1;B--){if(A[B].specified&&A[B].nodeValue){C.setAttribute(A[B].nodeName.toLowerCase(),A[B].nodeValue)}}A=D.childNodes;for(B=0;B<A.length;B++){C.appendChild(A[B].cloneNode(true))}D.parentNode.replaceChild(C,D)}};TinyMCE_Engine.prototype.getViewPort=function(C){var D=C.document,B=D.compatMode=="CSS1Compat",A=D.body,E=D.documentElement;return{left:C.pageXOffset||(B?E.scrollLeft:A.scrollLeft),top:C.pageYOffset||(B?E.scrollTop:A.scrollTop),width:C.innerWidth||(B?E.clientWidth:A.clientWidth),height:C.innerHeight||(B?E.clientHeight:A.clientHeight)}};TinyMCE_Engine.prototype.getStyle=function(C,A,B){if(!C){return false}if(tinyMCE.isGecko&&C.ownerDocument.defaultView){try{return C.ownerDocument.defaultView.getComputedStyle(C,null).getPropertyValue(A)}catch(C){return null}}A=A.replace(/-(\D)/g,function(E,D){return D.toUpperCase()});if(C.currentStyle){return C.currentStyle[A]}return false};TinyMCE_Engine.prototype.parseURL=function(D){var F=new Array();if(D){var E,C;E=D.indexOf("://");if(E!=-1){F["protocol"]=D.substring(0,E);C=E+3}for(var A=C;A<D.length;A++){var B=D.charAt(A);if(B==":"){break}if(B=="/"){break}}E=A;F["host"]=D.substring(C,E);F["port"]="";C=E;if(D.charAt(E)==":"){E=D.indexOf("/",C);F["port"]=D.substring(C+1,E)}C=E;E=D.indexOf("?",C);if(E==-1){E=D.indexOf("#",C)}if(E==-1){E=D.length}F["path"]=D.substring(C,E);C=E;if(D.charAt(E)=="?"){E=D.indexOf("#");E=(E==-1)?D.length:E;F["query"]=D.substring(C+1,E)}C=E;if(D.charAt(E)=="#"){E=D.length;F["anchor"]=D.substring(C+1,E)}}return F};TinyMCE_Engine.prototype.serializeURL=function(A){var B="";if(A["protocol"]){B+=A["protocol"]+"://"}if(A["host"]){B+=A["host"]}if(A["port"]){B+=":"+A["port"]}if(A["path"]){B+=A["path"]}if(A["query"]){B+="?"+A["query"]}if(A["anchor"]){B+="#"+A["anchor"]}return B};TinyMCE_Engine.prototype.convertAbsoluteURLToRelativeURL=function(K,C){var B=this.parseURL(K);var J=this.parseURL(C);var A;var L;var H=0;var E="";var G=false;if(J.path==""){J.path="/"}else{G=true}K=B.path.substring(0,B.path.lastIndexOf("/"));A=K.split("/");L=J.path.split("/");if(A.length>=L.length){for(var F=0;F<A.length;F++){if(F>=L.length||A[F]!=L[F]){H=F+1;break}}}if(A.length<L.length){for(var F=0;F<L.length;F++){if(F>=A.length||A[F]!=L[F]){H=F+1;break}}}if(H==1){return J.path}for(var F=0;F<(A.length-(H-1));F++){E+="../"}for(var F=H-1;F<L.length;F++){if(F!=(H-1)){E+="/"+L[F]}else{E+=L[F]}}J.protocol=null;J.host=null;J.port=null;J.path=E==""&&G?"/":E;var D=B.path;var I;if((I=D.lastIndexOf("/"))!=-1){D=D.substring(I+1)}if(D==J.path&&J.anchor!=""){J.path=""}if(J.path==""&&!J.anchor){J.path=D!=""?D:"/"}return this.serializeURL(J)};TinyMCE_Engine.prototype.convertRelativeToAbsoluteURL=function(M,J){var E=this.parseURL(M),C,B;var K=this.parseURL(J);if(J==""||J.indexOf("://")!=-1||/^(mailto:|javascript:|#|\/)/.test(J)){return J}C=E["path"].split("/");B=K["path"].split("/");var H=new Array();for(var G=C.length-1;G>=0;G--){if(C[G].length==0){continue}H[H.length]=C[G]}C=H.reverse();var L=new Array();var N=0;for(var G=B.length-1;G>=0;G--){if(B[G].length==0||B[G]=="."){continue}if(B[G]==".."){N++;continue}if(N>0){N--;continue}L[L.length]=B[G]}B=L.reverse();var I=C.length-N;var A=(I<=0?"":"/")+C.slice(0,I).join("/")+"/"+B.join("/");var D="",F="";K.protocol=E.protocol;K.host=E.host;K.port=E.port;if(K.path.charAt(K.path.length-1)=="/"){A+="/"}K.path=A;return this.serializeURL(K)};TinyMCE_Engine.prototype.convertURL=function(A,F,H){var K=document.location.protocol;var L=document.location.hostname;var E=document.location.port;if(K=="file:"){return A}A=tinyMCE.regexpReplace(A,"(http|https):///","/");if(A.indexOf("mailto:")!=-1||A.indexOf("javascript:")!=-1||tinyMCE.regexpReplace(A,"[ \t\r\n+]|%20","").charAt(0)=="#"){return A}if(!tinyMCE.isIE&&!H&&A.indexOf("://")==-1&&A.charAt(0)!="/"){return tinyMCE.settings["base_href"]+A}if(H&&tinyMCE.getParam("relative_urls")){var G=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings["base_href"],A);if(G.charAt(0)=="/"){G=tinyMCE.settings["document_base_prefix"]+G}var D=tinyMCE.parseURL(G);var J=tinyMCE.parseURL(tinyMCE.settings["document_base_url"]);if(D["host"]==J["host"]&&(D["port"]==J["port"])){return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings["document_base_url"],G)}}if(!tinyMCE.getParam("relative_urls")){var D=tinyMCE.parseURL(A);var C=tinyMCE.parseURL(tinyMCE.settings["base_href"]);A=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings["base_href"],A);if(D["anchor"]&&D["path"]==C["path"]){return"#"+D["anchor"]}}if(tinyMCE.getParam("remove_script_host")){var B="",I="";if(E!=""){I=":"+E}B=K+"//"+L+I+"/";if(A.indexOf(B)==0){A=A.substring(B.length-1)}}return A};TinyMCE_Engine.prototype.convertAllRelativeURLs=function(A){var D,E,G,C,F,B;E=A.getElementsByTagName("img");for(D=0;D<E.length;D++){G=tinyMCE.getAttrib(E[D],"src");B=tinyMCE.getAttrib(E[D],"mce_src");if(B!=""){G=B}if(G!=""){G=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings["base_href"],G);E[D].setAttribute("src",G)}}E=A.getElementsByTagName("a");for(D=0;D<E.length;D++){C=tinyMCE.getAttrib(E[D],"href");F=tinyMCE.getAttrib(E[D],"mce_href");if(F!=""){C=F}if(C&&C!=""){C=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings["base_href"],C);E[D].setAttribute("href",C)}}};TinyMCE_Engine.prototype.clearArray=function(A){var B;for(B in A){A[B]=null}return A};TinyMCE_Engine.prototype.explode=function(E,C){var A=C.split(E),D=new Array(),B;for(B=0;B<A.length;B++){if(A[B]!=""){D[D.length]=A[B]}}return D};TinyMCE_Engine.prototype._setEventsEnabled=function(D,A){var H,G,F,C,E,B;var I=["onfocus","onblur","onclick","ondblclick","onmousedown","onmouseup","onmouseover","onmousemove","onmouseout","onkeypress","onkeydown","onkeydown","onkeyup"];H=tinyMCE.settings["event_elements"].split(",");for(F=0;F<H.length;F++){C=D.getElementsByTagName(H[F]);for(E=0;E<C.length;E++){B="";for(G=0;G<I.length;G++){if((B=tinyMCE.getAttrib(C[E],I[G]))!=""){B=tinyMCE.cleanupEventStr(""+B);if(!A){B="return true;"+B}else{B=B.replace(/^return true;/gi,"")}C[E].removeAttribute(I[G]);C[E].setAttribute(I[G],B)}}}}};TinyMCE_Engine.prototype._eventPatch=function(E){var F,B,D,C;if(typeof (tinyMCE)=="undefined"){return true}try{if(tinyMCE.selectedInstance){D=tinyMCE.selectedInstance.getWin();if(D&&D.event){C=D.event;if(!C.target){C.target=C.srcElement}TinyMCE_Engine.prototype.handleEvent(C);return }}for(F in tinyMCE.instances){B=tinyMCE.instances[F];if(!tinyMCE.isInstance(B)){continue}B.select();D=B.getWin();if(D&&D.event){C=D.event;if(!C.target){C.target=C.srcElement}TinyMCE_Engine.prototype.handleEvent(C);return }}}catch(A){}};TinyMCE_Engine.prototype.findEvent=function(B){var C,A;if(B){return B}for(C in tinyMCE.instances){A=tinyMCE.instances[C];if(tinyMCE.isInstance(A)&&A.getWin().event){return A.getWin().event}}return null};TinyMCE_Engine.prototype.unloadHandler=function(){tinyMCE.triggerSave(true,true)};TinyMCE_Engine.prototype.addEventHandlers=function(A){this.setEventHandlers(A,1)};TinyMCE_Engine.prototype.setEventHandlers=function(E,B){var G=E.getDoc(),H,C,A,D=B?tinyMCE.addEvent:tinyMCE.removeEvent;H=["keypress","keyup","keydown","click","mouseup","mousedown","controlselect","dblclick"];C=["keypress","keyup","keydown","click","mouseup","mousedown","focus","blur","dragdrop"];E.switchSettings();if(tinyMCE.isIE){for(A=0;A<H.length;A++){D(G,H[A],TinyMCE_Engine.prototype._eventPatch)}}else{for(A=0;A<C.length;A++){D(G,C[A],tinyMCE.handleEvent)}try{G.designMode="On"}catch(F){}}};TinyMCE_Engine.prototype.onMouseMove=function(){var B,A;if(tinyMCE.lastHover){A=tinyMCE.lastHover;if(A.className.indexOf("mceMenu")!=-1){tinyMCE._menuButtonEvent("out",A)}else{A.className=A.className}tinyMCE.lastHover=null}if(!tinyMCE.hasMouseMoved){B=tinyMCE.selectedInstance;if(B.isFocused){B.undoBookmark=B.selection.getBookmark();tinyMCE.hasMouseMoved=true}}};TinyMCE_Engine.prototype.cancelEvent=function(A){if(!A){return false}if(tinyMCE.isIE){A.returnValue=false;A.cancelBubble=true}else{A.preventDefault();A.stopPropagation&&A.stopPropagation()}return false};TinyMCE_Engine.prototype.addEvent=function(C,D,B){if(D!="unload"){function A(){var E;try{tinyMCE.removeEvent(C,D,B);tinyMCE.removeEvent(window,"unload",A);C=D=B=null}catch(E){}}tinyMCE.addEvent(window,"unload",A)}if(C.attachEvent){C.attachEvent("on"+D,B)}else{C.addEventListener(D,B,false)}};TinyMCE_Engine.prototype.removeEvent=function(B,C,A){if(B.detachEvent){B.detachEvent("on"+C,A)}else{B.removeEventListener(C,A,false)}};TinyMCE_Engine.prototype.addSelectAccessibility=function(C,B,A){if(!B._isAccessible){B.onkeydown=tinyMCE.accessibleEventHandler;B.onblur=tinyMCE.accessibleEventHandler;B._isAccessible=true;B._win=A}return false};TinyMCE_Engine.prototype.accessibleEventHandler=function(B){var A=this._win;B=tinyMCE.isIE?A.event:B;var C=tinyMCE.isIE?B.srcElement:B.target;if(B.type=="blur"){if(C.oldonchange){C.onchange=C.oldonchange;C.oldonchange=null}return true}if(C.nodeName=="SELECT"&&!C.oldonchange){C.oldonchange=C.onchange;C.onchange=null}if(B.keyCode==13||B.keyCode==32){C.onchange=C.oldonchange;C.onchange();C.oldonchange=null;tinyMCE.cancelEvent(B);return false}return true};TinyMCE_Engine.prototype._resetIframeHeight=function(){var A;if(tinyMCE.isRealIE){A=tinyMCE.selectedInstance.iframeElement;if(A._oldHeight){A.style.height=A._oldHeight;A.height=A._oldHeight}}};function TinyMCE_Selection(A){this.instance=A}TinyMCE_Selection.prototype={getSelectedHTML:function(){var C=this.instance;var D,B=this.getRng(),A;if(!B){return null}D=document.createElement("body");if(B.cloneContents){D.appendChild(B.cloneContents())}else{if(typeof (B.item)!="undefined"||typeof (B.htmlText)!="undefined"){D.innerHTML=B.item?B.item(0).outerHTML:B.htmlText}else{D.innerHTML=B.toString()}}A=tinyMCE._cleanupHTML(C,C.contentDocument,C.settings,D,D,false,true,false);return A},getSelectedText:function(){var D=this.instance;var E,C,B,A;if(tinyMCE.isIE){E=D.getDoc();if(E.selection.type=="Text"){C=E.selection.createRange();A=C.text}else{A=""}}else{B=this.getSel();if(B&&B.toString){A=B.toString()}else{A=""}}return A},getBookmark:function(L){var C=this.instance;var E=this.getRng();var S=C.getDoc(),Q=C.getBody();var N,K,G,P,B,M,R,A,F;var I,J,H,D=-999999999,O=C.getViewPort();J=O.left;H=O.top;if(tinyMCE.isSafari||tinyMCE.isOpera||L){return{rng:E,scrollX:J,scrollY:H}}if(tinyMCE.isIE){if(E.item){P=E.item(0);B=Q.getElementsByTagName(P.nodeName);for(M=0;M<B.length;M++){if(P==B[M]){N=M;break}}return{tag:P.nodeName,index:N,scrollX:J,scrollY:H}}else{I=S.body.createTextRange();I.moveToElementText(C.getBody());I.collapse(true);bp=Math.abs(I.move("character",D));I=E.duplicate();I.collapse(true);N=Math.abs(I.move("character",D));I=E.duplicate();I.collapse(false);K=Math.abs(I.move("character",D))-N;return{start:N-bp,length:K,scrollX:J,scrollY:H}}}if(tinyMCE.isGecko){G=this.getSel();P=this.getFocusElement();if(!G){return null}if(P&&P.nodeName=="IMG"){return{start:-1,end:-1,index:N,scrollX:J,scrollY:H}}if(G.anchorNode==G.focusNode&&G.anchorOffset==G.focusOffset){P=this._getPosText(Q,G.anchorNode,G.focusNode);if(!P){return{scrollX:J,scrollY:H}}return{start:P.start+G.anchorOffset,end:P.end+G.focusOffset,scrollX:J,scrollY:H}}else{P=this._getPosText(Q,E.startContainer,E.endContainer);if(!P){return{scrollX:J,scrollY:H}}return{start:P.start+E.startOffset,end:P.end+E.endOffset,scrollX:J,scrollY:H}}}return null},moveToBookmark:function(G){var E=this.instance;var A,B,D,I,J=E.getBody(),H;var K=E.getDoc();var F=E.getWin();var C=this.getSel();if(!G){return false}if(tinyMCE.isSafari){C.setBaseAndExtent(G.rng.startContainer,G.rng.startOffset,G.rng.endContainer,G.rng.endOffset);return true}if(tinyMCE.isRealIE){if(G.rng){try{G.rng.select()}catch(I){}return true}F.focus();if(G.tag){A=J.createControlRange();B=J.getElementsByTagName(G.tag);if(B.length>G.index){try{A.addElement(B[G.index])}catch(I){}}}else{try{if(G.start<0){return true}A=E.getSel().createRange();A.moveToElementText(E.getBody());A.collapse(true);A.moveStart("character",G.start);A.moveEnd("character",G.length)}catch(I){return true}}A.select();F.scrollTo(G.scrollX,G.scrollY);return true}if(tinyMCE.isGecko||tinyMCE.isOpera){if(!C){return false}if(G.rng){C.removeAllRanges();C.addRange(G.rng)}if(G.start!=-1&&G.end!=-1){try{H=this._getTextPos(J,G.start,G.end);A=K.createRange();A.setStart(H.startNode,H.startOffset);A.setEnd(H.endNode,H.endOffset);C.removeAllRanges();C.addRange(A);F.focus()}catch(I){}}F.scrollTo(G.scrollX,G.scrollY);return true}return false},_getPosText:function(C,F,B){var A=document.createTreeWalker(C,NodeFilter.SHOW_TEXT,null,false),G,D=0,E={};while((G=A.nextNode())!=null){if(G==F){E.start=D}if(G==B){E.end=D;return E}D+=G.nodeValue?G.nodeValue.length:0}return null},_getTextPos:function(C,D,B){var A=document.createTreeWalker(C,NodeFilter.SHOW_TEXT,null,false),G,E=0,F={};while((G=A.nextNode())!=null){E+=G.nodeValue?G.nodeValue.length:0;if(E>=D&&!F.startNode){F.startNode=G;F.startOffset=D-(E-G.nodeValue.length)}if(E>=B){F.endNode=G;F.endOffset=B-(E-G.nodeValue.length);return F}}return null},selectNode:function(D,I,G,H){var E=this.instance,C,A,B;if(!D){return }if(typeof (I)=="undefined"){I=true}if(typeof (G)=="undefined"){G=false}if(typeof (H)=="undefined"){H=true}if(E.settings.auto_resize){E.resizeToContent()}if(tinyMCE.isRealIE){A=E.getDoc().body.createTextRange();try{A.moveToElementText(D);if(I){A.collapse(H)}A.select()}catch(F){}}else{C=this.getSel();if(!C){return }if(tinyMCE.isSafari){C.setBaseAndExtent(D,0,D,D.innerText.length);if(I){if(H){C.collapseToStart()}else{C.collapseToEnd()}}this.scrollToNode(D);return }A=E.getDoc().createRange();if(G){B=tinyMCE.getNodeTree(D,new Array(),3);if(B.length>0){A.selectNodeContents(B[0])}else{A.selectNodeContents(D)}}else{A.selectNode(D)}if(I){if(!H&&D.nodeType==3){A.setStart(D,D.nodeValue.length);A.setEnd(D,D.nodeValue.length)}else{A.collapse(H)}}C.removeAllRanges();C.addRange(A)}this.scrollToNode(D);tinyMCE.selectedElement=null;if(D.nodeType==1){tinyMCE.selectedElement=D}},scrollToNode:function(D){var E=this.instance,A=E.getWin(),C=E.getViewPort(),H=tinyMCE.getAbsPosition(D),B,G,F;if(H.absLeft<C.left||H.absLeft>C.left+C.width||H.absTop<C.top||H.absTop>C.top+(C.height-25)){A.scrollTo(H.absLeft,H.absTop-C.height+25)}if(E.settings.auto_resize){F=E.getContainerWin();B=tinyMCE.getViewPort(F);G=this.getAbsPosition(D);if(G.absLeft<B.left||G.absLeft>B.left+B.width||G.absTop<B.top||G.absTop>B.top+B.height){F.scrollTo(G.absLeft,G.absTop-B.height+25)}}},getAbsPosition:function(C){var B=tinyMCE.getAbsPosition(C),A=tinyMCE.getAbsPosition(this.instance.iframeElement);return{absLeft:A.absLeft+B.absLeft,absTop:A.absTop+B.absTop}},getSel:function(){var A=this.instance;if(tinyMCE.isRealIE){return A.getDoc().selection}return A.contentWindow.getSelection()},getRng:function(){var A=this.getSel();if(A==null){return null}if(tinyMCE.isRealIE){return A.createRange()}if(tinyMCE.isSafari&&!A.getRangeAt){return""+window.getSelection()}if(A.rangeCount>0){return A.getRangeAt(0)}return null},isCollapsed:function(){var A=this.getRng();if(A.item){return false}return A.boundingWidth==0||this.getSel().isCollapsed},collapse:function(A){var C=this.getRng(),B=this.getSel();if(C.select){C.collapse(A);C.select()}else{if(A){B.collapseToStart()}else{B.collapseToEnd()}}},getFocusElement:function(){var C=this.instance,D,A,B,E;if(tinyMCE.isRealIE){D=C.getDoc();A=D.selection.createRange();E=A.item?A.item(0):A.parentElement()}else{if(!tinyMCE.isSafari&&C.isHidden()){return C.getBody()}B=this.getSel();A=this.getRng();if(!B||!A){return null}E=A.commonAncestorContainer;if(!A.collapsed){if(A.startContainer==A.endContainer){if(A.startOffset-A.endOffset<2){if(A.startContainer.hasChildNodes()){E=A.startContainer.childNodes[A.startOffset]}}}}E=tinyMCE.getParentElement(E)}return E}};function TinyMCE_UndoRedo(A){this.instance=A;this.undoLevels=new Array();this.undoIndex=0;this.typingUndoIndex=-1;this.undoRedo=true}TinyMCE_UndoRedo.prototype={add:function(C){var B,A,H,F=this.instance,E,D,G;if(C){this.undoLevels[this.undoLevels.length]=C;return true}if(this.typingUndoIndex!=-1){this.undoIndex=this.typingUndoIndex;if(tinyMCE.typingUndoIndex!=-1){tinyMCE.undoIndex=tinyMCE.typingUndoIndex}}H=tinyMCE.trim(F.getBody().innerHTML);if(this.undoLevels[this.undoIndex]&&H!=this.undoLevels[this.undoIndex].content){tinyMCE.dispatchCallback(F,"onchange_callback","onChange",F);A=tinyMCE.settings["custom_undo_redo_levels"];if(A!=-1&&this.undoLevels.length>A){for(E=0;E<this.undoLevels.length-1;E++){this.undoLevels[E]=this.undoLevels[E+1]}this.undoLevels.length--;this.undoIndex--}B=F.undoBookmark;if(!B){B=F.selection.getBookmark()}this.undoIndex++;this.undoLevels[this.undoIndex]={content:H,bookmark:B};D=tinyMCE.undoLevels;for(E=tinyMCE.undoIndex+1;E<D.length;E++){G=D[E].undoRedo;if(G.undoIndex==G.undoLevels.length-1){G.undoIndex--}G.undoLevels.length--}tinyMCE.undoLevels[tinyMCE.undoIndex++]=F;tinyMCE.undoLevels.length=tinyMCE.undoIndex;this.undoLevels.length=this.undoIndex+1;return true}return false},undo:function(){var A=this.instance;if(this.undoIndex>0){this.undoIndex--;tinyMCE.setInnerHTML(A.getBody(),this.undoLevels[this.undoIndex].content);A.repaint();if(A.settings.custom_undo_redo_restore_selection){A.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark)}}},redo:function(){var A=this.instance;tinyMCE.execCommand("mceEndTyping");if(this.undoIndex<(this.undoLevels.length-1)){this.undoIndex++;tinyMCE.setInnerHTML(A.getBody(),this.undoLevels[this.undoIndex].content);A.repaint();if(A.settings.custom_undo_redo_restore_selection){A.selection.moveToBookmark(this.undoLevels[this.undoIndex].bookmark)}}tinyMCE.triggerNodeChange()}};var TinyMCE_ForceParagraphs={_insertPara:function(E,U){var Y=E.getDoc(),P=E.getSel(),L=E.getBody(),H=E.contentWindow,K=P.getRangeAt(0);var D=Y.documentElement,Q="P",X,O,J,F;var B,T,A,X,R,O,I,V=tinyMCE.isOpera?E.selection.getBookmark():null;var C,G,W,N,S;function M(Z){function e(f){return f.replace(new RegExp("[ \t\r\n]+","g"),"").toLowerCase()==""}if(Z.getElementsByTagName("img").length>0){return false}if(Z.getElementsByTagName("table").length>0){return false}if(Z.getElementsByTagName("hr").length>0){return false}var a=tinyMCE.getNodeTree(Z,new Array(),3);for(var d=0;d<a.length;d++){if(!e(a[d].nodeValue)){return false}}return true}B=Y.createRange();B.setStart(P.anchorNode,P.anchorOffset);B.collapse(true);T=Y.createRange();T.setStart(P.focusNode,P.focusOffset);T.collapse(true);A=B.compareBoundaryPoints(B.START_TO_END,T)<0;X=A?P.anchorNode:P.focusNode;R=A?P.anchorOffset:P.focusOffset;O=A?P.focusNode:P.anchorNode;I=A?P.focusOffset:P.anchorOffset;X=X.nodeName=="BODY"?X.firstChild:X;O=O.nodeName=="BODY"?O.firstChild:O;J=E.getParentBlockElement(X);F=E.getParentBlockElement(O);if(J&&new RegExp("absolute|relative|static","gi").test(J.style.position)){J=null}if(F&&new RegExp("absolute|relative|static","gi").test(F.style.position)){F=null}if(J!=null){Q=J.nodeName;if(Q=="TD"||Q=="TABLE"||(Q=="DIV"&&new RegExp("left|right","gi").test(J.style.cssFloat))){Q="P"}}if(tinyMCE.getParentElement(J,"OL,UL",null,L)!=null){return false}if((J!=null&&J.nodeName=="TABLE")||(F!=null&&F.nodeName=="TABLE")){J=F=null}C=(J!=null&&J.nodeName==Q)?J.cloneNode(false):Y.createElement(Q);G=(F!=null&&F.nodeName==Q)?F.cloneNode(false):Y.createElement(Q);if(/^(H[1-6])$/.test(Q)){G=Y.createElement("p")}W=X;N=O;node=W;do{if(node==L||node.nodeType==9||tinyMCE.isBlockElement(node)){break}W=node}while((node=node.previousSibling?node.previousSibling:node.parentNode));node=N;do{if(node==L||node.nodeType==9||tinyMCE.isBlockElement(node)){break}N=node}while((node=node.nextSibling?node.nextSibling:node.parentNode));if(W.nodeName=="TD"){W=W.firstChild}if(N.nodeName=="TD"){N=N.lastChild}if(J==null){K.deleteContents();if(!tinyMCE.isSafari){P.removeAllRanges()}if(W!=D&&N!=D){B=K.cloneRange();if(W==L){B.setStart(W,0)}else{B.setStartBefore(W)}C.appendChild(B.cloneContents());if(N.parentNode.nodeName==Q){N=N.parentNode}K.setEndAfter(N);if(N.nodeName!="#text"&&N.nodeName!="BODY"){B.setEndAfter(N)}S=K.cloneContents();if(S.firstChild&&(S.firstChild.nodeName==Q||S.firstChild.nodeName=="BODY")){G.innerHTML=S.firstChild.innerHTML}else{G.appendChild(S)}if(M(C)){C.innerHTML="&nbsp;"}if(M(G)){G.innerHTML="&nbsp;"}K.deleteContents();T.deleteContents();B.deleteContents();if(tinyMCE.isOpera){C.normalize();B.insertNode(C);G.normalize();B.insertNode(G)}else{G.normalize();B.insertNode(G);C.normalize();B.insertNode(C)}}else{L.innerHTML="<"+Q+">&nbsp;</"+Q+"><"+Q+">&nbsp;</"+Q+">";G=L.childNodes[1]}E.selection.moveToBookmark(V);E.selection.selectNode(G,true,true);return true}if(W.nodeName==Q){B.setStart(W,0)}else{B.setStartBefore(W)}B.setEnd(X,R);C.appendChild(B.cloneContents());T.setEndAfter(N);T.setStart(O,I);S=T.cloneContents();if(S.firstChild&&S.firstChild.nodeName==Q){G.innerHTML=S.firstChild.innerHTML}else{G.appendChild(S)}if(M(C)){C.innerHTML="&nbsp;"}if(M(G)){G.innerHTML="&nbsp;"}K=Y.createRange();if(!W.previousSibling&&W.parentNode.nodeName.toUpperCase()==Q){K.setStartBefore(W.parentNode)}else{if(B.startContainer.nodeName.toUpperCase()==Q&&B.startOffset==0){K.setStartBefore(B.startContainer)}else{K.setStart(B.startContainer,B.startOffset)}}if(!N.nextSibling&&N.parentNode.nodeName.toUpperCase()==Q){K.setEndAfter(N.parentNode)}else{K.setEnd(T.endContainer,T.endOffset)}K.deleteContents();if(tinyMCE.isOpera){K.insertNode(C);K.insertNode(G)}else{K.insertNode(G);K.insertNode(C)}G.normalize();C.normalize();E.selection.moveToBookmark(V);E.selection.selectNode(G,true,true);return true},_handleBackSpace:function(D){var C=D.getRng(),E=C.startContainer,A,B=false;if(E&&E.nextSibling&&E.nextSibling.nodeName=="BR"&&E.parentNode.nodeName!="BODY"){A=E.nodeValue;if(A!=null&&C.startOffset==A.length){E.nextSibling.parentNode.removeChild(E.nextSibling)}}if(D.settings.auto_resize){D.resizeToContent()}return B}};function TinyMCE_Layer(B,A){this.id=B;this.blockerElement=null;this.events=false;this.element=null;this.blockMode=typeof (A)!="undefined"?A:true;this.doc=document}TinyMCE_Layer.prototype={moveRelativeTo:function(J,A){var H=this.getAbsPosition(J);var I=parseInt(J.offsetWidth);var C=parseInt(J.offsetHeight);var D=this.getElement();var E=parseInt(D.offsetWidth);var B=parseInt(D.offsetHeight);var G,F;switch(A){case"tl":G=H.absLeft;F=H.absTop;break;case"tr":G=H.absLeft+I;F=H.absTop;break;case"bl":G=H.absLeft;F=H.absTop+C;break;case"br":G=H.absLeft+I;F=H.absTop+C;break;case"cc":G=H.absLeft+(I/2)-(E/2);F=H.absTop+(C/2)-(B/2);break}this.moveTo(G,F)},moveBy:function(A,C){var B=this.getElement();this.moveTo(parseInt(B.style.left)+A,parseInt(B.style.top)+C)},moveTo:function(A,C){var B=this.getElement();B.style.left=A+"px";B.style.top=C+"px";this.updateBlocker()},resizeBy:function(A,B){var C=this.getElement();this.resizeTo(parseInt(C.style.width)+A,parseInt(C.style.height)+B)},resizeTo:function(A,B){var C=this.getElement();if(A!=null){C.style.width=A+"px"}if(B!=null){C.style.height=B+"px"}this.updateBlocker()},show:function(){var A=this.getElement();if(A){A.style.display="block";this.updateBlocker()}},hide:function(){var A=this.getElement();if(A){A.style.display="none";this.updateBlocker()}},isVisible:function(){return this.getElement().style.display=="block"},getElement:function(){if(!this.element){this.element=this.doc.getElementById(this.id)}return this.element},setBlockMode:function(A){this.blockMode=A},updateBlocker:function(){var E,B,A,F,C,D;B=this.getBlocker();if(B){if(this.blockMode){E=this.getElement();A=this.parseInt(E.style.left);F=this.parseInt(E.style.top);C=this.parseInt(E.offsetWidth);D=this.parseInt(E.offsetHeight);B.style.left=A+"px";B.style.top=F+"px";B.style.width=C+"px";B.style.height=D+"px";B.style.display=E.style.display}else{B.style.display="none"}}},getBlocker:function(){var B,A;if(!this.blockerElement&&this.blockMode){B=this.doc;A=B.getElementById(this.id+"_blocker");if(!A){A=B.createElement("iframe");A.setAttribute("id",this.id+"_blocker");A.style.cssText="display: none; position: absolute; left: 0; top: 0";A.src="javascript:false;";A.frameBorder="0";A.scrolling="no";B.body.appendChild(A)}this.blockerElement=A}return this.blockerElement},getAbsPosition:function(B){var A={absLeft:0,absTop:0};while(B){A.absLeft+=B.offsetLeft;A.absTop+=B.offsetTop;B=B.offsetParent}return A},create:function(F,E,C,A){var D=this.doc,B=D.createElement(F);B.setAttribute("id",this.id);if(E){B.className=E}if(!C){C=D.body}if(A){B.innerHTML=A}C.appendChild(B);return this.element=B},exists:function(){return this.doc.getElementById(this.id)!=null},parseInt:function(A){if(A==null||A==""){return 0}return parseInt(A)},remove:function(){var B=this.getElement(),A=this.getBlocker();if(B){B.parentNode.removeChild(B)}if(A){A.parentNode.removeChild(A)}}};function TinyMCE_Menu(){var A;if(typeof (tinyMCE.menuCounter)=="undefined"){tinyMCE.menuCounter=0}A="mc_menu_"+tinyMCE.menuCounter++;TinyMCE_Layer.call(this,A,true);this.id=A;this.items=new Array();this.needsUpdate=true}TinyMCE_Menu.prototype=tinyMCE.extend(TinyMCE_Layer.prototype,{init:function(A){var B;this.settings={separator_class:"mceMenuSeparator",title_class:"mceMenuTitle",disabled_class:"mceMenuDisabled",menu_class:"mceMenu",drop_menu:true};for(B in A){this.settings[B]=A[B]}this.create("div",this.settings.menu_class)},clear:function(){this.items=new Array()},addTitle:function(A){this.add({type:"title",text:A})},addDisabled:function(A){this.add({type:"disabled",text:A})},addSeparator:function(){this.add({type:"separator"})},addItem:function(A,B){this.add({text:A,js:B})},add:function(A){this.items[this.items.length]=A;this.needsUpdate=true},update:function(){var F=this.getElement(),E="",C,B,A=this.items,D=this.settings;if(this.settings.drop_menu){E+='<span class="mceMenuLine"></span>'}E+='<table border="0" cellpadding="0" cellspacing="0">';for(C=0;C<A.length;C++){B=tinyMCE.xmlEncode(A[C].text);c=A[C].class_name?' class="'+A[C].class_name+'"':"";switch(A[C].type){case"separator":E+='<tr class="'+D.separator_class+'"><td>';break;case"title":E+='<tr class="'+D.title_class+'"><td><span'+c+">"+B+"</span>";break;case"disabled":E+='<tr class="'+D.disabled_class+'"><td><span'+c+">"+B+"</span>";break;default:E+='<tr><td><a href="'+tinyMCE.xmlEncode(A[C].js)+'" onmousedown="'+tinyMCE.xmlEncode(A[C].js)+';return tinyMCE.cancelEvent(event);" onclick="return tinyMCE.cancelEvent(event);" onmouseup="return tinyMCE.cancelEvent(event);"><span'+c+">"+B+"</span></a>"}E+="</td></tr>"}E+="</table>";F.innerHTML=E;this.needsUpdate=false;this.updateBlocker()},show:function(){var A,B;if(tinyMCE.lastMenu==this){return }if(this.needsUpdate){this.update()}if(tinyMCE.lastMenu&&tinyMCE.lastMenu!=this){tinyMCE.lastMenu.hide()}TinyMCE_Layer.prototype.show.call(this);if(!tinyMCE.isOpera){}tinyMCE.lastMenu=this}});if(!Function.prototype.call){Function.prototype.call=function(){var a=arguments,s=a[0],i,as="",r,o;for(i=1;i<a.length;i++){as+=(i>1?",":"")+"a["+i+"]"}o=s._fu;s._fu=this;r=eval("s._fu("+as+")");s._fu=o;return r}}TinyMCE_Engine.prototype.debug=function(){var A="",C,D,B=tinyMCE.log.length;for(D=0,C=this.debug.arguments;D<C.length;D++){A+=C[D];if(D<C.length-1){A+=", "}}if(B<1000){tinyMCE.log[B]="[debug] "+A}}
