/**
 * $RCSfile: tiny_mce.js,v $
 * $Revision: 1.191 $
 * $Date: 2005/03/06 20:51:38 $
 *
 * @author Moxiecode
 * @copyright Copyright © 2004, Moxiecode Systems AB, All rights reserved.
 */
 function TinyMCE(){this.instances=new Array();this.stickyClassesLookup=new Array();this.windowArgs=new Array();this.isMSIE=(navigator.appName=="Microsoft Internet Explorer");this.isMSIE5=this.isMSIE&&(navigator.userAgent.indexOf('MSIE 5')!=-1);this.isMSIE5_0=this.isMSIE&&(navigator.userAgent.indexOf('MSIE 5.0')!=-1);this.isGecko=navigator.userAgent.indexOf('Gecko')!=-1;this.idCounter=0;this.init=TinyMCE_init;this.addMCEControl=TinyMCE_addMCEControl;this.triggerSave=TinyMCE_triggerSave;this._convertOnClick=TinyMCE__convertOnClick;this.resetForm=TinyMCE_resetForm;this.execCommand=TinyMCE_execCommand;this.execInstanceCommand=TinyMCE_execInstanceCommand;this._createIFrame=TinyMCE__createIFrame;this.handleEvent=TinyMCE_handleEvent;this.setupContent=TinyMCE_setupContent;this.switchClass=TinyMCE_switchClass;this.restoreAndSwitchClass=TinyMCE_restoreAndSwitchClass;this.switchClassSticky=TinyMCE_switchClassSticky;this.restoreClass=TinyMCE_restoreClass;this.setClassLock=TinyMCE_setClassLock;this.addEvent=TinyMCE_addEvent;this.onLoad=TinyMCE_onLoad;this.removeMCEControl=TinyMCE_removeMCEControl;this._initCleanup=TinyMCE__initCleanup;this._cleanupHTML=TinyMCE__cleanupHTML;this._cleanupAttribute=TinyMCE__cleanupAttribute;this._fixInlineStyles=TinyMCE__fixInlineStyles;this._cleanupElementName=TinyMCE__cleanupElementName;this._verifyClass=TinyMCE__verifyClass;this.cleanupNode=TinyMCE_cleanupNode;this.convertStringToXML=TinyMCE_convertStringToXML;this.insertLink=TinyMCE_insertLink;this.insertImage=TinyMCE_insertImage;this.getElementByAttributeValue=TinyMCE_getElementByAttributeValue;this.getElementsByAttributeValue=TinyMCE_getElementsByAttributeValue;this.isBlockElement=TinyMCE_isBlockElement;this.getParentBlockElement=TinyMCE_getParentBlockElement;this.getNodeTree=TinyMCE_getNodeTree;this.getParentElement=TinyMCE_getParentElement;this.getParam=TinyMCE_getParam;this.getLang=TinyMCE_getLang;this.replaceVar=TinyMCE_replaceVar;this.replaceVars=TinyMCE_replaceVars;this.triggerNodeChange=TinyMCE_triggerNodeChange;this.parseURL=TinyMCE_parseURL;this.convertAbsoluteURLToRelativeURL=TinyMCE_convertAbsoluteURLToRelativeURL;this.convertRelativeToAbsoluteURL=TinyMCE_convertRelativeToAbsoluteURL;this.updateContent=TinyMCE_updateContent;this._customCleanup=TinyMCE__customCleanup;this.getContent=TinyMCE_getContent;this.setContent=TinyMCE_setContent;this.importThemeLanguagePack=TinyMCE_importThemeLanguagePack;this.importPluginLanguagePack=TinyMCE_importPluginLanguagePack;this.applyTemplate=TinyMCE_applyTemplate;this.openWindow=TinyMCE_openWindow;this.handleVisualAid=TinyMCE_handleVisualAid;this.setAttrib=TinyMCE_setAttrib;this.getAttrib=TinyMCE_getAttrib;this._getThemeFunction=TinyMCE__getThemeFunction;this._themeExecCommand=TinyMCE__themeExecCommand;this.getControlHTML=TinyMCE_getControlHTML;this._setHTML=TinyMCE__setHTML;this._getElementById=TinyMCE__getElementById;this.getInstanceById=TinyMCE_getInstanceById;this.getEditorId=TinyMCE_getEditorId;this.queryInstanceCommandValue=TinyMCE_queryInstanceCommandValue;this.queryInstanceCommandState=TinyMCE_queryInstanceCommandState;this.getWindowArg=TinyMCE_getWindowArg;this.setWindowArg=TinyMCE_setWindowArg;this.getCSSClasses=TinyMCE_getCSSClasses;this.regexpReplace=TinyMCE_regexpReplace;this.cleanupEventStr=TinyMCE_cleanupEventStr;this.getAbsPosition=TinyMCE_getAbsPosition;this.openFileBrowser=TinyMCE_openFileBrowser;}function TinyMCE_init(settings){var theme,srcMode;this.settings=settings;function defParam(key,def_val){settings[key]=tinyMCE.getParam(key,def_val);}if(typeof(document.execCommand)=='undefined')return;if(!tinyMCE.baseURL){var elements=document.getElementsByTagName('script');for(var i=0;i<elements.length;i++){if(elements[i].src&&(elements[i].src.indexOf("tiny_mce.js")!=-1||elements[i].src.indexOf("tiny_mce_src.js")!=-1)){var src=elements[i].src;srcMode=(src.indexOf('_src')!=-1)?'_src':'';src=src.substring(0,src.lastIndexOf('/'));tinyMCE.baseURL=src;break;}}}this.documentBasePath=document.location.href;if(this.documentBasePath.indexOf('?')!=-1)this.documentBasePath=this.documentBasePath.substring(0,this.documentBasePath.indexOf('?'));this.documentBasePath=this.documentBasePath.substring(0,this.documentBasePath.lastIndexOf('/'));if(tinyMCE.baseURL.indexOf('://')==-1&&tinyMCE.baseURL.charAt(0)!='/'){tinyMCE.baseURL=this.documentBasePath+"/"+tinyMCE.baseURL;}defParam("mode","none");defParam("theme","default");defParam("plugins","",true);defParam("language","en");defParam("docs_language",this.settings['language']);defParam("elements","");defParam("textarea_trigger","mce_editable");defParam("valid_elements","a[name|href|target|title],strong/b[class],em/i[class],strike[class],u[class],p[class|align],ol,ul,li,br,img[class|src|border=0|alt|title|hspace|vspace|width|height|align],sub,sup,blockquote[dir|style],table[border=0|cellspacing|cellpadding|width|height|class|align],tr[class|rowspan|width|height|align|valign],td[class|colspan|rowspan|width|height|align|valign],div[class|align],span[class|align],pre[class|align],address[class|align],h1[class|align],h2[class|align],h3[class|align],h4[class|align],h5[class|align],h6[class|align],hr");defParam("extended_valid_elements","");defParam("invalid_elements","");defParam("encoding","");defParam("urlconvertor_callback","TinyMCE_convertURL");defParam("save_callback","");defParam("debug",false);defParam("force_br_newlines",false);defParam("force_p_newlines",true);defParam("add_form_submit_trigger",true);defParam("relative_urls",true);defParam("remove_script_host",true);defParam("focus_alert",true);defParam("document_base_url",""+document.location.href);defParam("visual",true);defParam("visual_table_style","border: 1px dashed #BBBBBB");defParam("setupcontent_callback","");defParam("fix_content_duplication",true);defParam("custom_undo_redo",true);defParam("custom_undo_redo_levels",-1);defParam("custom_undo_redo_keyboard_shortcuts",true);defParam("verify_css_classes",false);defParam("trim_span_elements",true);defParam("verify_html",true);defParam("apply_source_formatting",false);defParam("directionality","ltr");defParam("auto_cleanup_word",false);defParam("cleanup_on_startup",false);defParam("inline_styles",false);defParam("convert_newlines_to_brs",false);defParam("auto_reset_designmode",false);defParam("entities","160,nbsp,38,amp,34,quot,162,cent,8364,euro,163,pound,165,yen,169,copy,174,reg,8482,trade,8240,permil,181,micro,183,middot,8226,bull,8230,hellip,8242,prime,8243,Prime,167,sect,182,para,223,szlig,8249,lsaquo,8250,rsaquo,171,laquo,187,raquo,8216,lsquo,8217,rsquo,8220,ldquo,8221,rdquo,8218,sbquo,8222,bdquo,60,lt,62,gt,8804,le,8805,ge,8211,ndash,8212,mdash,175,macr,8254,oline,164,curren,166,brvbar,168,uml,161,iexcl,191,iquest,710,circ,732,tilde,176,deg,8722,minus,177,plusmn,247,divide,8260,frasl,215,times,185,sup1,178,sup2,179,sup3,188,frac14,189,frac12,190,frac34,402,fnof,8747,int,8721,sum,8734,infin,8730,radic,8764,sim,8773,cong,8776,asymp,8800,ne,8801,equiv,8712,isin,8713,notin,8715,ni,8719,prod,8743,and,8744,or,172,not,8745,cap,8746,cup,8706,part,8704,forall,8707,exist,8709,empty,8711,nabla,8727,lowast,8733,prop,8736,ang,180,acute,184,cedil,170,ordf,186,ordm,8224,dagger,8225,Dagger,192,Agrave,194,Acirc,195,Atilde,196,Auml,197,Aring,198,AElig,199,Ccedil,200,Egrave,202,Ecirc,203,Euml,204,Igrave,206,Icirc,207,Iuml,208,ETH,209,Ntilde,210,Ograve,212,Ocirc,213,Otilde,214,Ouml,216,Oslash,338,OElig,217,Ugrave,219,Ucirc,220,Uuml,376,Yuml,222,THORN,224,agrave,226,acirc,227,atilde,228,auml,229,aring,230,aelig,231,ccedil,232,egrave,234,ecirc,235,euml,236,igrave,238,icirc,239,iuml,240,eth,241,ntilde,242,ograve,244,ocirc,245,otilde,246,ouml,248,oslash,339,oelig,249,ugrave,251,ucirc,252,uuml,254,thorn,255,yuml,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,8501,alefsym,982,piv,8476,real,977,thetasym,978,upsih,8472,weierp,8465,image,8592,larr,8593,uarr,8594,rarr,8595,darr,8596,harr,8629,crarr,8656,lArr,8657,uArr,8658,rArr,8659,dArr,8660,hArr,8756,there4,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,8194,ensp,8195,emsp,8201,thinsp,8204,zwnj,8205,zwj,8206,lrm,8207,rlm,173,shy");defParam("cleanup_callback","");defParam("add_unload_trigger",true);defParam("ask",false);defParam("nowrap",false);defParam("auto_resize",false);defParam("auto_focus",false);var baseHREF=tinyMCE.settings['document_base_url'];if(baseHREF.indexOf('?')!=-1)baseHREF=baseHREF.substring(0,baseHREF.indexOf('?'));this.settings['base_href']=baseHREF.substring(0,baseHREF.lastIndexOf('/'))+"/";theme=this.settings['theme'];this.blockRegExp=new RegExp("^(h1|h2|h3|h4|h5|h6|p|div|address|pre|form|table|li|ol|ul|td)$","i");this.settings['theme_href']=tinyMCE.baseURL+"/themes/"+theme;if(!tinyMCE.isMSIE)this.settings['force_br_newlines']=false;if(tinyMCE.getParam("content_css",false)){var cssPath=tinyMCE.getParam("content_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['content_css']=this.documentBasePath+"/"+cssPath;else this.settings['content_css']=cssPath;}else this.settings['content_css']=tinyMCE.baseURL+"/themes/"+theme+"/editor_content.css";if(tinyMCE.getParam("popups_css",false)){var cssPath=tinyMCE.getParam("popups_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['popups_css']=this.documentBasePath+"/"+cssPath;else this.settings['popups_css']=cssPath;}else this.settings['popups_css']=tinyMCE.baseURL+"/themes/"+theme+"/editor_popup.css";if(tinyMCE.getParam("editor_css",false)){var cssPath=tinyMCE.getParam("editor_css","");if(cssPath.indexOf('://')==-1&&cssPath.charAt(0)!='/')this.settings['editor_css']=this.documentBasePath+"/"+cssPath;else this.settings['editor_css']=cssPath;}else this.settings['editor_css']=tinyMCE.baseURL+"/themes/"+theme+"/editor_ui.css";if(tinyMCE.settings['debug']){var msg="Debug: \n";msg+="baseURL: "+this.baseURL+"\n";msg+="documentBasePath: "+this.documentBasePath+"\n";msg+="content_css: "+this.settings['content_css']+"\n";msg+="popups_css: "+this.settings['popups_css']+"\n";msg+="editor_css: "+this.settings['editor_css']+"\n";alert(msg);}this._initCleanup();tinyMCE.addEvent(window,"load",TinyMCE_onLoad);document.write('<sc'+'ript language="javascript" type="text/javascript" src="'+tinyMCE.baseURL+'/themes/'+this.settings['theme']+'/editor_template'+srcMode+'.js"></script>');document.write('<sc'+'ript language="javascript" type="text/javascript" src="'+tinyMCE.baseURL+'/langs/'+this.settings['language']+'.js"></script>');document.write('<link href="'+this.settings['editor_css']+'" rel="stylesheet" type="text/css">');var themePlugins=tinyMCE.getParam('plugins','',true,',');if(this.settings['plugins']!=''){for(var i=0;i<themePlugins.length;i++)document.write('<sc'+'ript language="javascript" type="text/javascript" src="'+tinyMCE.baseURL+'/plugins/'+themePlugins[i]+'/editor_plugin'+srcMode+'.js"></script>');}}function TinyMCE_confirmAdd(e){var elm=tinyMCE.isMSIE?event.srcElement:e.target;var elementId=elm.name?elm.name:elm.id;if(!elm.getAttribute('mce_noask')&&confirm(tinyMCELang['lang_edit_confirm']))tinyMCE.addMCEControl(elm,elementId);elm.setAttribute('mce_noask','true');}function TinyMCE_updateContent(form_element_name){var formElement=document.getElementById(form_element_name);for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(inst.formElement==formElement){var doc=inst.getDoc();tinyMCE._setHTML(doc,inst.formElement.value);if(!tinyMCE.isMSIE)doc.body.innerHTML=tinyMCE._cleanupHTML(doc,this.settings,doc.body,inst.visualAid);}}}function TinyMCE_addMCEControl(replace_element,form_element_name,target_document){var id="mce_editor_"+tinyMCE.idCounter++;var inst=new TinyMCEControl(tinyMCE.settings);inst.editorId=id;this.instances[id]=inst;inst.onAdd(replace_element,form_element_name,target_document);}function TinyMCE_triggerSave(skip_cleanup,skip_callback){for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];tinyMCE.settings['preformatted']=false;if(typeof(skip_cleanup)=="undefined")skip_cleanup=false;if(typeof(skip_callback)=="undefined")skip_callback=false;tinyMCE._setHTML(inst.getDoc(),inst.getBody().innerHTML);var htm=skip_cleanup?inst.getBody().innerHTML:tinyMCE._cleanupHTML(inst.getDoc(),this.settings,inst.getBody(),this.visualAid,true);if(tinyMCE.settings["encoding"]=="xml"||tinyMCE.settings["encoding"]=="html")htm=tinyMCE.convertStringToXML(htm);if(!skip_callback&&tinyMCE.settings['save_callback']!="")var content=eval(tinyMCE.settings['save_callback']+"(inst.formTargetElementId,htm,inst.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");inst.formElement.value=htm;}}function TinyMCE__convertOnClick(node){if(tinyMCE.isMSIE5)return;var elms=node.getElementsByTagName("a");for(var i=0;i<elms.length;i++){var onclick=elms[i].getAttribute('onclick');if(onclick&&onclick!=""){elms[i].removeAttribute("onclick");elms[i].setAttribute("mce_onclick",tinyMCE.cleanupEventStr(""+onclick));elms[i].onclick=null;}}}function TinyMCE_resetForm(form_index){var formObj=document.forms[form_index];for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];for(var i=0;i<formObj.elements.length;i++){if(inst.formTargetElementId==formObj.elements[i].name){inst.getBody().innerHTML=formObj.elements[i].value;return;}}}}function TinyMCE_execInstanceCommand(editor_id,command,user_interface,value,focus){var mceControl=tinyMCE.getInstanceById(editor_id);if(mceControl){if(typeof(focus)=="undefined")focus=true;if(focus)mceControl.contentWindow.focus();mceControl.autoResetDesignMode();this.selectedElement=mceControl.getFocusElement();this.selectedInstance=mceControl;tinyMCE.execCommand(command,user_interface,value);}}function TinyMCE_execCommand(command,user_interface,value){user_interface=user_interface?user_interface:false;value=value?value:null;switch(command){case 'mceHelp':window.open(tinyMCE.themeURL+"/docs/"+this.settings['docs_language']+"/index.htm","mceHelp","menubar=yes,toolbar=yes,scrollbars=yes,left=20,top=20,width=550,height=600");return;case 'mceFocus':var mceControl=tinyMCE.getInstanceById(value);if(mceControl)mceControl.contentWindow.focus();return;case "mceAddControl":case "mceAddEditor":tinyMCE.addMCEControl(tinyMCE._getElementById(value),value);return;case "mceAddFrameControl":tinyMCE.addMCEControl(tinyMCE._getElementById(value),value['element'],value['document']);return;case "mceRemoveControl":case "mceRemoveEditor":tinyMCE.removeMCEControl(value);return;case "mceResetDesignMode":if(!tinyMCE.isMSIE){for(var n in tinyMCE.instances)tinyMCE.instances[n].getDoc().designMode="on";}return;}if(this.selectedInstance)this.selectedInstance.execCommand(command,user_interface,value);else if(tinyMCE.settings['focus_alert'])alert(tinyMCELang['lang_focus_alert']);}function TinyMCE_addEventHandlers(editor_id){if(tinyMCE.isMSIE){var doc=document.frames[editor_id].document;var patchFunc=function(){var event=document.frames[editor_id].event;event.target=event.srcElement;event.target.editor_id=editor_id;TinyMCE_handleEvent(event);};doc.onkeypress=patchFunc;doc.onkeyup=patchFunc;doc.onkeydown=patchFunc;if(tinyMCE.settings['add_unload_trigger']){tinyMCE.addEvent(window,"unload",function(){tinyMCE.triggerSave(true,true);});tinyMCE.addEvent(window,"beforeunload",function(){tinyMCE.triggerSave(true,true);});}doc.onmouseup=patchFunc;doc.onclick=patchFunc;}else{var instance=tinyMCE.instances[editor_id];var doc=instance.getDoc();doc.editor_id=editor_id;tinyMCE.addEvent(doc,"keypress",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"keypress",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"keydown",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"keyup",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"click",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"mouseup",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"mousedown",tinyMCE.handleEvent);tinyMCE.addEvent(doc,"focus",tinyMCE.handleEvent);if(tinyMCE.settings['add_unload_trigger'])tinyMCE.addEvent(window,"unload",function(){tinyMCE.triggerSave(true,true);});eval('try { doc.designMode = "On"; } catch(e) {}');}}function TinyMCE__createIFrame(replace_element){var iframe=document.createElement("iframe");var id=replace_element.getAttribute("id");iframe.setAttribute("id",id);iframe.setAttribute("className","mceEditorArea");iframe.setAttribute("border","0");iframe.setAttribute("frameBorder","0");iframe.setAttribute("marginWidth","0");iframe.setAttribute("marginHeight","0");iframe.setAttribute("leftMargin","0");iframe.setAttribute("topMargin","0");iframe.setAttribute("width",tinyMCE.settings['area_width']);iframe.setAttribute("height",tinyMCE.settings['area_height']);if(tinyMCE.settings["auto_resize"])iframe.setAttribute("scrolling","no");if(tinyMCE.isMSIE)iframe.setAttribute("src",this.settings['default_document']);iframe.style.width=tinyMCE.settings['area_width'];iframe.style.height=tinyMCE.settings['area_height'];if(tinyMCE.isMSIE)replace_element.outerHTML=iframe.outerHTML;else replace_element.parentNode.replaceChild(iframe,replace_element);if(tinyMCE.isMSIE)return window.frames[id];else return iframe;}function TinyMCE_setupContent(editor_id){var inst=tinyMCE.instances[editor_id];var doc=inst.getDoc();var head=doc.getElementsByTagName('head').item(0);var content=inst.startContent;if(!tinyMCE.isMSIE&&doc.title!="blank_page"){doc.location.href=tinyMCE.baseURL+"/blank.htm";window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",1000);return;}if(!head){window.setTimeout("tinyMCE.setupContent('"+editor_id+"');",10);return;}if(tinyMCE.settings['nowrap'])doc.body.style.whiteSpace="nowrap";doc.body.dir=this.settings['directionality'];doc.editorId=editor_id;if(!tinyMCE.isMSIE)doc.documentElement.editorId=editor_id;base=doc.createElement("base");base.setAttribute('href',tinyMCE.settings['base_href']);head.appendChild(base);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._customCleanup("insert_to_editor",content);if(tinyMCE.isMSIE){var styleSheet=document.frames[editor_id].document.createStyleSheet(inst.settings['content_css']);window.setInterval('try{tinyMCE.getCSSClasses(document.frames["'+editor_id+'"].document, "'+editor_id+'");}catch(e){}',500);if(tinyMCE.settings["force_br_newlines"])document.frames[editor_id].document.styleSheets[0].addRule("p","margin: 0px;");var patchFunc=function(){var event=document.frames[editor_id].event;event.target=document.frames[editor_id].document;TinyMCE_handleEvent(event);};var body=document.frames[editor_id].document.body;body.onbeforepaste=patchFunc;body.onbeforecut=patchFunc;body.onpaste=patchFunc;body.editorId=editor_id;}else{var cssImporter=doc.createElement("link");cssImporter.rel="stylesheet";cssImporter.href=inst.settings['content_css'];if(headArr=doc.getElementsByTagName("head"));headArr[0].appendChild(cssImporter);}if(!tinyMCE.isMSIE){var contentElement=inst.getDoc().createElement("body");var doc=inst.getDoc();contentElement.innerHTML=content;if(tinyMCE.settings['force_p_newlines'])content=content.replace(new RegExp('&lt;&gt;','g'),"");if(tinyMCE.settings['cleanup_on_startup'])inst.getBody().innerHTML=tinyMCE._cleanupHTML(doc,this.settings,contentElement);else{content=tinyMCE.regexpReplace(content,"<strong","<b","gi");content=tinyMCE.regexpReplace(content,"<em","<i","gi");content=tinyMCE.regexpReplace(content,"</strong>","</b>","gi");content=tinyMCE.regexpReplace(content,"</em>","</i>","gi");inst.getBody().innerHTML=contentElement.innerHTML;}inst.convertAllRelativeURLs();}else{if(tinyMCE.settings['cleanup_on_startup']){tinyMCE._setHTML(inst.getDoc(),content);eval('try {inst.getBody().innerHTML = tinyMCE._cleanupHTML(inst.contentDocument, this.settings, inst.getBody());} catch(e) {}');}else inst.getBody().innerHTML=content;}tinyMCE._convertOnClick(inst.getBody());var parentElm=document.getElementById(inst.editorId+'_parent');if(parentElm.lastChild.nodeName.toLowerCase()=="input")inst.formElement=parentElm.lastChild;else inst.formElement=parentElm.nextSibling;tinyMCE.handleVisualAid(inst.getBody(),true,tinyMCE.settings['visual']);inst.executeCallback('setupcontent_callback','_setupContent',0,editor_id,inst.getBody(),inst.getDoc());if(!tinyMCE.isMSIE)TinyMCE_addEventHandlers(editor_id);tinyMCE.selectedInstance=inst;tinyMCE.selectedElement=inst.contentWindow.document.body;tinyMCE.triggerNodeChange(false,true);}function TinyMCE_handleEvent(e){switch(e.type){case "submit":var formObj=tinyMCE.isMSIE?window.event.srcElement:e.target;for(var i=0;i<formObj.elements.length;i++){var elementId=formObj.elements[i].name?formObj.elements[i].name:formObj.elements[i].id;if(elementId.indexOf('mce_editor_')==0)formObj.elements[i].disabled=true;}tinyMCE.triggerSave();return;case "reset":var formObj=tinyMCE.isMSIE?window.event.srcElement:e.target;for(var i=0;i<document.forms.length;i++){if(document.forms[i]==formObj)window.setTimeout('TinyMCE_resetForm('+i+');',10);}return;case "paste":if(tinyMCE.settings['auto_cleanup_word'])window.setTimeout("tinyMCE.execInstanceCommand('"+e.target.editorId+"', 'mceCleanupWord', false, null);",1);break;case "beforecut":case "beforepaste":if(tinyMCE.selectedInstance)tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");break;case "keypress":if(e.target.editorId){tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];}else{if(e.target.ownerDocument.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.ownerDocument.editorId];}if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&e.keyCode==13&&!e.shiftKey){if(tinyMCE.selectedInstance._insertPara(e)){e.preventDefault();return false;}}if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(tinyMCE.selectedInstance._handleBackSpace(e.type)){e.preventDefault();return false;}}if(!tinyMCE.isMSIE&&e.ctrlKey&&tinyMCE.settings['custom_undo_redo']){if(e.charCode==120||e.charCode==118){tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");return;}if(tinyMCE.settings['custom_undo_redo_keyboard_shortcuts']){if(e.charCode==122){tinyMCE.selectedInstance.execCommand("Undo");e.preventDefault();return false;}if(e.charCode==121){tinyMCE.selectedInstance.execCommand("Redo");e.preventDefault();return false;}}if(e.charCode==98){tinyMCE.selectedInstance.execCommand("Bold");e.preventDefault();return false;}if(e.charCode==105){tinyMCE.selectedInstance.execCommand("Italic");e.preventDefault();return false;}if(e.charCode==117){tinyMCE.selectedInstance.execCommand("Underline");e.preventDefault();return false;}}if(tinyMCE.settings['custom_undo_redo']){var keys=new Array(13,45,36,35,33,34,37,38,39,40);var posKey=false;for(var i=0;i<keys.length;i++){if(keys[i]==e.keyCode){tinyMCE.selectedInstance.typing=false;posKey=true;break;}}if(!tinyMCE.selectedInstance.typing&&!posKey){tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");tinyMCE.selectedInstance.typing=true;}}if(tinyMCE.isMSIE&&tinyMCE.settings['force_br_newlines']&&e.keyCode==13){if(e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];if(tinyMCE.selectedInstance){var sel=tinyMCE.selectedInstance.getDoc().selection;var rng=sel.createRange();if(tinyMCE.getParentElement(rng.parentElement(),"li")!=null)return false;e.returnValue=false;e.cancelBubble=true;rng.pasteHTML("<br />");rng.collapse(false);rng.select();tinyMCE.triggerNodeChange(false);return false;}}if(e.keyCode==8||e.keyCode==46){tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(e.target,"a");tinyMCE.imgElement=tinyMCE.getParentElement(e.target,"img");tinyMCE.triggerNodeChange(false);}return false;break;case "keyup":case "keydown":if(e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];else return;if(tinyMCE.isGecko&&tinyMCE.settings['force_p_newlines']&&(e.keyCode==8||e.keyCode==46)&&!e.shiftKey){if(tinyMCE.selectedInstance._handleBackSpace(e.type)){e.preventDefault();return false;}}tinyMCE.selectedElement=null;tinyMCE.selectedNode=null;var elm=tinyMCE.selectedInstance.getFocusElement();tinyMCE.linkElement=tinyMCE.getParentElement(elm,"a");tinyMCE.imgElement=tinyMCE.getParentElement(elm,"img");tinyMCE.selectedElement=elm;if(tinyMCE.isGecko&&e.type=="keyup"&&e.keyCode==9)tinyMCE.handleVisualAid(tinyMCE.selectedInstance.getBody(),true,tinyMCE.settings['visual']);if(tinyMCE.isGecko&&tinyMCE.settings['document_base_url']!=""+document.location.href&&e.type=="keyup"&&e.ctrlKey&&e.keyCode==86)tinyMCE.selectedInstance.fixBrokenURLs();if(tinyMCE.isMSIE&&tinyMCE.settings['custom_undo_redo']){var keys=new Array(13,45,36,35,33,34,37,38,39,40);var posKey=false;for(var i=0;i<keys.length;i++){if(keys[i]==e.keyCode){tinyMCE.selectedInstance.typing=false;posKey=true;break;}}if(!tinyMCE.selectedInstance.typing&&!posKey&&(e.keyCode<16||e.keyCode>18&&e.keyCode!=255)){tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");tinyMCE.selectedInstance.typing=true;tinyMCE.triggerNodeChange(false);}if(posKey&&e.type=="keyup")tinyMCE.triggerNodeChange(false);var ctrlKeys=new Array(66,73,85,86,88);var keys=new Array(8,46);for(var i=0;i<keys.length;i++){if((ctrlKeys[i]==e.keyCode&&e.ctrlKey)||keys[i]==e.keyCode){tinyMCE.selectedInstance.execCommand("mceAddUndoLevel");tinyMCE.triggerNodeChange(false);return true;}}if(tinyMCE.settings['custom_undo_redo_keyboard_shortcuts']){if(e.keyCode==90&&e.ctrlKey&&e.type=="keydown"){tinyMCE.selectedInstance.execCommand("Undo");tinyMCE.triggerNodeChange(false);e.returnValue=false;e.cancelBubble=true;return false;}if(e.keyCode==89&&e.ctrlKey&&e.type=="keydown"){tinyMCE.selectedInstance.execCommand("Redo");tinyMCE.triggerNodeChange(false);e.returnValue=false;e.cancelBubble=true;return false;}}}var keys=new Array(13,45,36,35,33,34,37,38,39,40);var posKey=false;for(var i=0;i<keys.length;i++){if(keys[i]==e.keyCode){posKey=true;break;}}if(posKey&&e.type=="keyup")tinyMCE.triggerNodeChange(false);break;case "mousedown":case "mouseup":case "click":case "focus":var targetBody=tinyMCE.getParentElement(e.target,"body");for(var instanceName in tinyMCE.instances){var inst=tinyMCE.instances[instanceName];inst.autoResetDesignMode();if(inst.getBody()==targetBody){tinyMCE.selectedInstance=inst;tinyMCE.selectedElement=e.target;tinyMCE.linkElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"a");tinyMCE.imgElement=tinyMCE.getParentElement(tinyMCE.selectedElement,"img");tinyMCE.selectedInstance.typing=false;break;}}if(e.type!="focus")tinyMCE.selectedNode=null;tinyMCE.triggerNodeChange(false);if(!tinyMCE.selectedInstance&&e.target.editorId)tinyMCE.selectedInstance=tinyMCE.instances[e.target.editorId];if(e.target.nodeName.toLowerCase()=="a"&&e.type=="click"&&e.altKey){var evalCode=""+tinyMCE.cleanupEventStr(e.target.getAttribute("mce_onclick"));eval(evalCode.replace('return false;',''));}if(tinyMCE.isGecko&&tinyMCE.settings['document_base_url']!=""+document.location.href)window.setTimeout('tinyMCE.getInstanceById("'+inst.editorId+'").fixBrokenURLs();',10);return false;break;}}function TinyMCE_switchClass(element,class_name,lock_state){var lockChanged=false;if(typeof(lock_state)!="undefined"&&element!=null){element.classLock=lock_state;lockChanged=true;}if(element!=null&&(lockChanged||!element.classLock)){element.oldClassName=element.className;element.className=class_name;}}function TinyMCE_restoreAndSwitchClass(element,class_name){if(element!=null&&!element.classLock){this.restoreClass(element);this.switchClass(element,class_name);}}function TinyMCE_switchClassSticky(element_name,class_name,lock_state){var element,lockChanged=false;if(!this.stickyClassesLookup[element_name])this.stickyClassesLookup[element_name]=document.getElementById(element_name);element=this.stickyClassesLookup[element_name];if(typeof(lock_state)!="undefined"&&element!=null){element.classLock=lock_state;lockChanged=true;}if(element!=null&&(lockChanged||!element.classLock)){element.className=class_name;element.oldClassName=class_name;}}function TinyMCE_restoreClass(element){if(element!=null&&element.oldClassName&&!element.classLock){element.className=element.oldClassName;element.oldClassName=null;}}function TinyMCE_setClassLock(element,lock_state){if(element!=null)element.classLock=lock_state;}function TinyMCE_addEvent(obj,name,handler){if(tinyMCE.isMSIE)obj.attachEvent("on"+name,handler);else obj.addEventListener(name,handler,false);}function TinyMCE_onLoad(){var elementRefAr=new Array();if(document.forms&&tinyMCE.settings['add_form_submit_trigger']){for(var i=0;i<document.forms.length;i++){var form=document.forms[i];tinyMCE.addEvent(form,"submit",TinyMCE_handleEvent);tinyMCE.addEvent(form,"reset",TinyMCE_handleEvent);}}switch(tinyMCE.settings['mode']){case "exact":var elements=tinyMCE.getParam('elements','',true,',');for(var i=0;i<elements.length;i++){var element=tinyMCE._getElementById(elements[i]);if(tinyMCE.settings['ask']&&element){elementRefAr[elementRefAr.length]=element;continue;}if(element)tinyMCE.addMCEControl(element,elements[i]);else alert("Error: Could not find element by id or name: "+elements[i]);}break;case "specific_textareas":case "textareas":var nodeList=document.getElementsByTagName("textarea");for(var i=0;i<nodeList.length;i++){if(tinyMCE.settings['mode']!="specific_textareas"||nodeList.item(i).getAttribute(tinyMCE.settings['textarea_trigger'])=="true")elementRefAr[elementRefAr.length]=nodeList.item(i);}break;}for(var i=0;i<elementRefAr.length;i++){var element=elementRefAr[i];var elementId=element.name?element.name:element.id;if(tinyMCE.settings['ask']){if(tinyMCE.isGecko)tinyMCE.addEvent(element,"focus",function(e){window.setTimeout(function(){TinyMCE_confirmAdd(e);},10);});else tinyMCE.addEvent(element,"focus",TinyMCE_confirmAdd);}else tinyMCE.addMCEControl(element,elementId);}if(tinyMCE.settings['auto_focus']){window.setTimeout(function(){var inst=tinyMCE.getInstanceById(tinyMCE.settings['auto_focus']);inst.selectNode(inst.getBody(),true,true);inst.contentWindow.focus();},10);}if(tinyMCE.settings['oninit'])eval(tinyMCE.settings['oninit']);}function TinyMCE_removeMCEControl(editor_id){var mceControl=tinyMCE.getInstanceById(editor_id);if(mceControl){editor_id=mceControl.editorId;var html=tinyMCE.getContent(editor_id);var tmpInstances=new Array();for(var instanceName in tinyMCE.instances){var instance=tinyMCE.instances[instanceName];if(instanceName!=editor_id)tmpInstances[instanceName]=instance;}tinyMCE.instances=tmpInstances;tinyMCE.selectedElement=null;tinyMCE.selectedInstance=null;var replaceElement=document.getElementById(editor_id+"_parent");var oldTargetElement=mceControl.oldTargetElement;var targetName=oldTargetElement.nodeName.toLowerCase();if(targetName=="textarea"||targetName=="input"){replaceElement.parentNode.removeChild(replaceElement);oldTargetElement.style.display="inline";oldTargetElement.value=html;}else{oldTargetElement.innerHTML=html;replaceElement.parentNode.insertBefore(oldTargetElement,replaceElement);replaceElement.parentNode.removeChild(replaceElement);}}}function TinyMCE__cleanupElementName(element_name,element){element_name=element_name.toLowerCase();if(element_name=="body")return null;if(tinyMCE.cleanup_verify_html){for(var i=0;i<tinyMCE.cleanup_invalidElements.length;i++){if(tinyMCE.cleanup_invalidElements[i]==element_name)return null;}var validElement=false;var elementAttribs=null;for(var i=0;i<tinyMCE.cleanup_validElements.length&&!elementAttribs;i++){for(var x=0;x<tinyMCE.cleanup_validElements[i][0].length;x++){var elmMatch=tinyMCE.cleanup_validElements[i][0][x];if(elmMatch.match(new RegExp('\\*|\\?|\\+','g'))!=null){elmMatch=elmMatch.replace(new RegExp('\\?','g'),'(\\S?)');elmMatch=elmMatch.replace(new RegExp('\\+','g'),'(\\S+)');elmMatch=elmMatch.replace(new RegExp('\\*','g'),'(\\S*)');elmMatch="^"+elmMatch+"$";if(element_name.match(new RegExp(elmMatch,'g'))){elementAttribs=tinyMCE.cleanup_validElements[i];validElement=true;break;}}if(element_name==elmMatch){elementAttribs=tinyMCE.cleanup_validElements[i];validElement=true;element_name=elementAttribs[0][0];break;}}}if(!validElement)return null;}if(!tinyMCE.isMSIE){if(element_name=="strong"&&!tinyMCE.cleanup_on_save)element_name="b";else if(element_name=="em"&&!tinyMCE.cleanup_on_save)element_name="i";}if(tinyMCE.isMSIE){if(element_name=="table"){var attribValue=element.style.pixelWidth==0?element.getAttribute("width"):element.style.pixelWidth;element.setAttribute("width",attribValue);attribValue=element.style.pixelHeight==0?element.getAttribute("height"):element.style.pixelHeight;element.setAttribute("height",attribValue);}}var elmData=new Object();elmData.element_name=element_name;elmData.valid_attribs=elementAttribs;return elmData;}function TinyMCE__fixInlineStyles(elm){if(elm.nodeName.toLowerCase()!="table"){var value;value=tinyMCE.isMSIE?elm.width:elm.getAttribute("width");if(value&&value!=""){if(typeof(value)!="string"||!value.indexOf("%"))value+="px";elm.style.width=value;}value=tinyMCE.isMSIE?elm.height:elm.getAttribute("height");if(value&&value!=""){if(typeof(value)!="string"||!value.indexOf("%"))value+="px";elm.style.height=value;}value=tinyMCE.isMSIE?elm.border:elm.getAttribute("border");if(value&&value!="")elm.style.borderWidth=value+"px";}value=elm.getAttribute("align");if(value&&value!=""){if(elm.nodeName.toLowerCase()=="img"){if(tinyMCE.isMSIE)elm.style.styleFloat=value;else elm.style.cssFloat=value;}else elm.style.textAlign=value;}value=elm.getAttribute("vspace");if(value&&value!="")elm.style.marginTop=value+"px";value=elm.getAttribute("hspace");if(value&&value!="")elm.style.marginBottom=value+"px";}function TinyMCE__cleanupAttribute(valid_attributes,element_name,attribute_node,element_node){var attribName=attribute_node.nodeName.toLowerCase();var attribValue=attribute_node.nodeValue;var attribMustBeValue=null;var verified=false;if(tinyMCE.cleanup_inline_styles&&element_name!="table"&&element_name!="td"){if(attribName=="width"||attribName=="height"||attribName=="border"||attribName=="align"||attribName=="valign"||attribName=="hspace"||attribName=="vspace")return null;}if(attribName.indexOf('moz_')!=-1)return null;if(!tinyMCE.isMSIE&&(attribName=="mce_real_href"||attribName=="mce_real_src")){if(!tinyMCE.cleanup_on_save){var attrib=new Object();attrib.name=attribName;attrib.value=attribValue;return attrib;}else return null;}if(attribName=="mce_onclick")verified=true;if(tinyMCE.cleanup_verify_html&&!verified){for(var i=1;i<valid_attributes.length;i++){var attribMatch=valid_attributes[i][0];var re=null;if(attribMatch.match(new RegExp('\\*|\\?|\\+','g'))!=null){attribMatch=attribMatch.replace(new RegExp('\\?','g'),'(\\S?)');attribMatch=attribMatch.replace(new RegExp('\\+','g'),'(\\S+)');attribMatch=attribMatch.replace(new RegExp('\\*','g'),'(\\S*)');attribMatch="^"+attribMatch+"$";re=new RegExp(attribMatch,'g');}if((re&&attribName.match(re)!=null)||attribName==attribMatch){verified=true;attribMustBeValue=valid_attributes[i][3];break;}}if((element_name=="table"||element_name=="td")&&attribName=="style")verified=true;if(!verified)return false;}else verified=true;switch(attribName){case "size":if(tinyMCE.isMSIE5&&element_name=="font")attribValue=element_node.size;break;case "color":if(tinyMCE.isMSIE5&&element_name=="font")attribValue=element_node.color;break;case "width":if(tinyMCE.isMSIE)attribValue=element_node.width;break;case "height":if(tinyMCE.isMSIE)attribValue=element_node.height;break;case "border":if(tinyMCE.isMSIE)attribValue=element_node.border;break;case "class":if(!tinyMCE._verifyClass(element_node))return null;break;case "style":if(element_name=="table"||element_name=="td"){if(tinyMCE.cleanup_visual_table_style!=""){var tableElement=element_node;if(element_name=="td")tableElement=tinyMCE.getParentElement(tableElement,"table");if(tableElement&&tableElement.getAttribute("border")==0){if(tinyMCE.cleanup_visual_aid)attribValue=tinyMCE.cleanup_visual_table_style;else return null;}}}else attribValue=element_node.style.cssText.toLowerCase();if(tinyMCE.isMSIE){var border=element_node.style.border;var bt=element_node.style.borderTop;var bl=element_node.style.borderLeft;var br=element_node.style.borderRight;var bb=element_node.style.borderBottom;if(border!=""&&(bt==border&&bl==border&&br==border&&bb==border)){attribValue=tinyMCE.regexpReplace(attribValue,'border-top: '+border+'?; ?','');attribValue=tinyMCE.regexpReplace(attribValue,'border-left: '+border+'?; ?','');attribValue=tinyMCE.regexpReplace(attribValue,'border-right: '+border+'?; ?','');attribValue=tinyMCE.regexpReplace(attribValue,'border-bottom: '+border+'?;( ?)','border: '+border+';$1');}}break;case "onclick":case "mce_onclick":if(tinyMCE.isMSIE5)break;if(tinyMCE.cleanup_on_save){if(element_node.getAttribute("mce_onclick")){attribName="onclick";attribValue=""+element_node.getAttribute("mce_onclick");}}else{if(attribName=="onclick"&&!tinyMCE.cleanup_on_save)return null;}break;case "href":case "src":if(!tinyMCE.isMSIE&&attribName=="href"&&element_node.getAttribute("mce_real_href"))attribValue=element_node.getAttribute("mce_real_href");if(!tinyMCE.isMSIE&&attribName=="src"&&element_node.getAttribute("mce_real_src"))attribValue=element_node.getAttribute("mce_real_src");if(tinyMCE.isGecko&&!tinyMCE.settings['relative_urls'])attribValue=tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'],attribValue);attribValue=eval(tinyMCE.cleanup_urlconvertor_callback+"(attribValue, element_node, tinyMCE.cleanup_on_save);");break;case "colspan":case "rowspan":if(attribValue=="1")return null;break;case "_moz-userdefined":case "editorid":case "editor_id":case "mce_real_href":case "mce_real_src":return null;}if(attribMustBeValue!=null){var isCorrect=false;for(var i=0;i<attribMustBeValue.length;i++){if(attribValue==attribMustBeValue[i]){isCorrect=true;break;}}if(!isCorrect)return null;}var attrib=new Object();attrib.name=attribName;attrib.value=attribValue;return attrib;}function TinyMCE__verifyClass(node){if(tinyMCE.isGecko){var className=node.getAttribute('class');if(!className)return false;}if(tinyMCE.isMSIE)var className=node.getAttribute('className');if(tinyMCE.cleanup_verify_css_classes&&tinyMCE.cleanup_on_save){var csses=tinyMCE.getCSSClasses();nonDefinedCSS=true;for(var c=0;c<csses.length;c++){if(csses[c]==className){nonDefinedCSS=false;break;}}if(nonDefinedCSS&&className.indexOf('mce_')!=0){node.removeAttribute('className');node.removeAttribute('class');return false;}}return true;}function TinyMCE_cleanupNode(node){var output="";switch(node.nodeType){case 1:var elementData=tinyMCE._cleanupElementName(node.nodeName,node);var elementName=elementData?elementData.element_name:null;var elementValidAttribs=elementData?elementData.valid_attribs:null;var elementAttribs="";if(tinyMCE.isMSIE&&tinyMCE.settings['fix_content_duplication']){var lookup=tinyMCE.cleanup_elementLookupTable;for(var i=0;i<lookup.length;i++){if(lookup[i]==node)return output;}lookup[lookup.length]=node;}if(!elementName){if(node.hasChildNodes()){for(var i=0;i<node.childNodes.length;i++)output+=this.cleanupNode(node.childNodes[i]);}return output;}if(node.style&&(node.style.cssText.indexOf('mso-')!=-1&&tinyMCE.settings['auto_cleanup_word'])||node.style.cssText==""){node.style.cssText="";node.removeAttribute("style");}if(tinyMCE.cleanup_inline_styles)tinyMCE._fixInlineStyles(node);if(elementValidAttribs){for(var a=1;a<elementValidAttribs.length;a++){var attribName,attribDefaultValue,attribForceValue,attribValue;attribName=elementValidAttribs[a][0];attribDefaultValue=elementValidAttribs[a][1];attribForceValue=elementValidAttribs[a][2];if(attribDefaultValue||attribForceValue){var attribValue=node.getAttribute(attribName);if(node.getAttribute(attribName)==null||node.getAttribute(attribName)=="")attribValue=attribDefaultValue;attribValue=attribForceValue?attribForceValue:attribValue;if(attribValue=="{$uid}")attribValue="uid_"+(tinyMCE.cleanup_idCount++);node.setAttribute(attribName,attribValue);}}}if(elementName=="span"&&tinyMCE.cleanup_trim_span_elements){var re=new RegExp('^[ \t]+','g');var onlyWhiteSpace=true;for(var a=0;a<node.childNodes.length;a++){var tmpNode=node.childNodes[a];if((tmpNode.nodeType==3&&!tmpNode.nodeValue.match(re))||tmpNode.nodeName.toLowerCase()!="span"){onlyWhiteSpace=false;break;}}tinyMCE._verifyClass(node);var numAttribs=0;for(var i=0;i<node.attributes.length;i++){if(node.attributes[i].specified)numAttribs++;}if(onlyWhiteSpace||numAttribs==0){if(node.hasChildNodes()){for(var i=0;i<node.childNodes.length;i++)output+=this.cleanupNode(node.childNodes[i]);}return output;}}if(elementName=="table"||elementName=="td"){if(tinyMCE.cleanup_visual_table_style!=""){var tableElement=node;if(elementName=="td")tableElement=tinyMCE.getParentElement(tableElement,"table");if(tableElement&&tableElement.getAttribute("border")==0){if(tinyMCE.cleanup_visual_aid)elementAttribs+=" style="+'"'+tinyMCE.cleanup_visual_table_style+'"';}}}if(elementName=="table"&&!node.hasChildNodes())return "";if(node.attributes.length>0){for(var i=0;i<node.attributes.length;i++){if(node.attributes[i].specified){var attrib=tinyMCE._cleanupAttribute(elementValidAttribs,elementName,node.attributes[i],node);if(attrib)elementAttribs+=" "+attrib.name+"="+'"'+attrib.value+'"';}}}if(tinyMCE.isMSIE&&elementName=="input"){if(node.type)elementAttribs+=" type="+'"'+node.type+'"';if(node.value)elementAttribs+=" value="+'"'+node.value+'"';}if((elementName=="p"||elementName=="td")&&(node.innerHTML==""||node.innerHTML=="&nbsp;"))return "<"+elementName+elementAttribs+">&nbsp;</"+elementName+">";if(tinyMCE.isMSIE&&elementName=="script")return "<"+elementName+elementAttribs+">"+node.text+"</"+elementName+">";if(node.hasChildNodes()){if(elementName=="p"&&tinyMCE.cleanup_force_br_newlines)output+="<div"+elementAttribs+">";else output+="<"+elementName+elementAttribs+">";for(var i=0;i<node.childNodes.length;i++)output+=this.cleanupNode(node.childNodes[i]);if(elementName=="p"&&tinyMCE.cleanup_force_br_newlines)output+="</div><br />";else output+="</"+elementName+">";}else{if(elementName=="a")output+="<"+elementName+elementAttribs+"></"+elementName+">";else{output+="<"+elementName+elementAttribs+" />";}}return output;case 3:if(node.parentNode.nodeName.toLowerCase()=="script")return node.nodeValue;return this.convertStringToXML(node.nodeValue);case 8:return "
