function TinyMCE() {this.majorVersion = "2";this.minorVersion = "0";this.releaseDate = "2005-12-01";this.instances = new Array();this.stickyClassesLookup = new Array();this.windowArgs = new Array();this.loadedFiles = new Array();this.configs = new Array();this.currentConfig = 0;this.eventHandlers = new Array();var ua = navigator.userAgent;this.isMSIE = (navigator.appName == "Microsoft Internet Explorer");this.isMSIE5 = this.isMSIE && (ua.indexOf('MSIE 5') != -1);this.isMSIE5_0 = this.isMSIE && (ua.indexOf('MSIE 5.0') != -1);this.isGecko = ua.indexOf('Gecko') != -1;this.isSafari = ua.indexOf('Safari') != -1;this.isOpera = ua.indexOf('Opera') != -1;this.isMac = ua.indexOf('Mac') != -1;this.isNS7 = ua.indexOf('Netscape/7') != -1;this.isNS71 = ua.indexOf('Netscape/7.1') != -1;this.dialogCounter = 0;if (this.isOpera) {this.isMSIE = true;this.isGecko = false;this.isSafari =  false;}this.idCounter = 0;};TinyMCE.prototype.defParam = function(key, def_val) {this.settings[key] = tinyMCE.getParam(key, def_val);};TinyMCE.prototype.init = function(settings) {var theme;this.settings = settings;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 || elements[i].src.indexOf("tiny_mce_gzip") != -1)) {var src = elements[i].src;tinyMCE.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.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.defParam("mode", "none");this.defParam("theme", "advanced");this.defParam("plugins", "", true);this.defParam("language", "en");this.defParam("docs_language", this.settings['language']);this.defParam("elements", "");this.defParam("textarea_trigger", "mce_editable");this.defParam("editor_selector", "");this.defParam("editor_deselector", "mceNoEditor");this.defParam("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[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=0|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[style|dir|class|align],-h2[style|dir|class|align],-h3[style|dir|class|align],-h4[style|dir|class|align],-h5[style|dir|class|align],-h6[style|dir|class|align],hr[class|style],font[face|size|style|id|class|dir|color]");this.defParam("extended_valid_elements", "");this.defParam("invalid_elements", "");this.defParam("encoding", "");this.defParam("urlconverter_callback", tinyMCE.getParam("urlconvertor_callback", "TinyMCE.prototype.convertURL"));this.defParam("save_callback", "");this.defParam("debug", false);this.defParam("force_br_newlines", false);this.defParam("force_p_newlines", true);this.defParam("add_form_submit_trigger", true);this.defParam("relative_urls", true);this.defParam("remove_script_host", true);this.defParam("focus_alert", true);this.defParam("document_base_url", this.documentURL);this.defParam("visual", true);this.defParam("visual_table_class", "mceVisualAid");this.defParam("setupcontent_callback", "");this.defParam("fix_content_duplication", true);this.defParam("custom_undo_redo", true);this.defParam("custom_undo_redo_levels", -1);this.defParam("custom_undo_redo_keyboard_shortcuts", true);this.defParam("verify_css_classes", false);this.defParam("verify_html", true);this.defParam("apply_source_formatting", false);this.defParam("directionality", "ltr");this.defParam("cleanup_on_startup", false);this.defParam("inline_styles", false);this.defParam("convert_newlines_to_brs", false);this.defParam("auto_reset_designmode", true);this.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,233,eacute,237,iacute,243,oacute,250,uacute,193,Aacute,225,aacute,201,Eacute,205,Iacute,211,Oacute,218,Uacute,221,Yacute,253,yacute");this.defParam("entity_encoding", "named");this.defParam("cleanup_callback", "");this.defParam("add_unload_trigger", true);this.defParam("ask", false);this.defParam("nowrap", false);this.defParam("auto_resize", false);this.defParam("auto_focus", false);this.defParam("cleanup", true);this.defParam("remove_linebreaks", true);this.defParam("button_tile_map", false);this.defParam("submit_patch", true);this.defParam("browsers", "msie,safari,gecko,opera");this.defParam("dialog_type", "window");this.defParam("accessibility_warnings", true);this.defParam("merge_styles_invalid_parents", "");this.defParam("force_hex_style_colors", true);this.defParam("trim_span_elements", true);this.defParam("convert_fonts_to_spans", false);this.defParam("doctype", '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">');this.defParam("font_size_classes", '');this.defParam("font_size_style_values", 'xx-small,x-small,small,medium,large,x-large,xx-large');this.defParam("event_elements", 'a,img');this.defParam("convert_urls", true);this.defParam("table_inline_editing", false);this.defParam("object_resizing", true);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;var baseHREF = tinyMCE.settings['document_base_url'];var h = document.location.href;var p = h.indexOf('://');if (p > 0 && document.location.protocol != "file:") {p = h.indexOf('/', p + 3);h = h.substring(0, p);if (baseHREF.indexOf('://') == -1)baseHREF = h + baseHREF;tinyMCE.settings['document_base_url'] = baseHREF;tinyMCE.settings['document_base_prefix'] = h;}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("^(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|blockquote|center|dl|dir|fieldset|form|noscript|noframes|menu|isindex)$", "i");this.posKeyCodes = new Array(13,45,36,35,33,34,37,38,39,40);this.uniqueURL = 'http://tinymce.moxiecode.cp/mce_temp_url';this.uniqueTag = '<div id="mceTMPElement" style="display: none">TMP</div>';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'] = '';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 + "/css/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 + "/css/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();if (this.configs.length == 0) {if (this.isSafari && this.getParam('safari_warning', true))alert("Safari support is very limited and should be considered experimental.\nSo there is no need to even submit bugreports on this early version.\nYou can disable this message by setting: safari_warning option to false");tinyMCE.addEvent(window, "load", TinyMCE.prototype.onLoad);if (tinyMCE.isMSIE) {if (tinyMCE.settings['add_unload_trigger']) {tinyMCE.addEvent(window, "unload", TinyMCE.prototype.unloadHandler);tinyMCE.addEvent(window.document, "beforeunload", TinyMCE.prototype.unloadHandler);}} else {if (tinyMCE.settings['add_unload_trigger'])tinyMCE.addEvent(window, "unload", function () {tinyMCE.triggerSave(true, true);});}}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 themePlugins = tinyMCE.getParam('plugins', '', true, ',');if (this.settings['plugins'] != '') {for (var i=0; i<themePlugins.length; i++)this.loadScript(tinyMCE.baseURL + '/plugins/' + themePlugins[i] + '/editor_plugin' + tinyMCE.srcMode + '.js');}settings['cleanup_entities'] = new Array();var entities = tinyMCE.getParam('entities', '', true, ',');for (var i=0; i<entities.length; i+=2)settings['cleanup_entities']['c' + entities[i]] = entities[i+1];settings['index'] = this.configs.length;this.configs[this.configs.length] = settings;};TinyMCE.prototype.loadScript = function(url) {for (var i=0; i<this.loadedFiles.length; i++) {if (this.loadedFiles[i] == url)return;}document.write('<sc'+'ript language="javascript" type="text/javascript" src="' + url + '"></script>');this.loadedFiles[this.loadedFiles.length] = url;};TinyMCE.prototype.loadCSS = function(url) {for (var i=0; i<this.loadedFiles.length; i++) {if (this.loadedFiles[i] == url)return;}document.write('<link href="' + url + '" rel="stylesheet" type="text/css" />');this.loadedFiles[this.loadedFiles.length] = url;};TinyMCE.prototype.importCSS = function(doc, css_file) {if (css_file == '')return;if (typeof(doc.createStyleSheet) == "undefined") {var elm = doc.createElement("link");elm.rel = "stylesheet";elm.href = css_file;if ((headArr = doc.getElementsByTagName("head")) != null && headArr.length > 0)headArr[0].appendChild(elm);} else
var styleSheet = doc.createStyleSheet(css_file);};TinyMCE.prototype.confirmAdd = function(e, settings) {var elm = tinyMCE.isMSIE ? event.srcElement : e.target;var elementId = elm.name ? elm.name : elm.id;tinyMCE.settings = settings;if (!elm.getAttribute('mce_noask') && confirm(tinyMCELang['lang_edit_confirm']))tinyMCE.addMCEControl(elm, elementId);elm.setAttribute('mce_noask', 'true');};TinyMCE.prototype.updateContent = function(form_element_name) {var formElement = document.getElementById(form_element_name);for (var n in tinyMCE.instances) {var inst = tinyMCE.instances[n];if (!tinyMCE.isInstance(inst))continue;inst.switchSettings();if (inst.formElement == formElement) {var doc = inst.getDoc();tinyMCE._setHTML(doc, inst.formElement.value);if (!tinyMCE.isMSIE)doc.body.innerHTML = tinyMCE._cleanupHTML(inst, doc, this.settings, doc.body, inst.visualAid);}}};TinyMCE.prototype.addMCEControl = function(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);};TinyMCE.prototype.triggerSave = function(skip_cleanup, skip_callback) {for (var n in tinyMCE.instances) {var inst = tinyMCE.instances[n];if (!tinyMCE.isInstance(inst))continue;inst.switchSettings();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);if (inst.settings['cleanup'] == false) {tinyMCE.handleVisualAid(inst.getBody(), true, false, inst);tinyMCE._setEventsEnabled(inst.getBody(), true);}tinyMCE._customCleanup(inst, "submit_content_dom", inst.contentWindow.document.body);var htm = skip_cleanup ? inst.getBody().innerHTML : tinyMCE._cleanupHTML(inst, inst.getDoc(), this.settings, inst.getBody(), this.visualAid, true);htm = tinyMCE._customCleanup(inst, "submit_content", htm);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");if (inst.formElement)inst.formElement.value = htm;}};TinyMCE.prototype._setEventsEnabled = function(node, state) {var events = new Array('onfocus','onblur','onclick','ondblclick',
'onmousedown','onmouseup','onmouseover','onmousemove',
'onmouseout','onkeypress','onkeydown','onkeydown','onkeyup');var evs = tinyMCE.settings['event_elements'].split(',');    for (var y=0; y<evs.length; y++){var elms = node.getElementsByTagName(evs[y]);for (var i=0; i<elms.length; i++) {var event = "";for (var x=0; x<events.length; x++) {if ((event = tinyMCE.getAttrib(elms[i], events[x])) != '') {event = tinyMCE.cleanupEventStr("" + event);if (!state)event = "return true;" + event;else
event = event.replace(/^return true;/gi, '');elms[i].removeAttribute(events[x]);elms[i].setAttribute(events[x], event);}}}}};TinyMCE.prototype.resetForm = function(form_index) {var formObj = document.forms[form_index];for (var n in tinyMCE.instances) {var inst = tinyMCE.instances[n];if (!tinyMCE.isInstance(inst))continue;inst.switchSettings();for (var i=0; i<formObj.elements.length; i++) {if (inst.formTargetElementId == formObj.elements[i].name)inst.getBody().innerHTML = inst.startContent;}}};TinyMCE.prototype.execInstanceCommand = function(editor_id, command, user_interface, value, focus) {var inst = tinyMCE.getInstanceById(editor_id);if (inst) {if (typeof(focus) == "undefined")focus = true;if (focus)inst.contentWindow.focus();inst.autoResetDesignMode();this.selectedElement = inst.getFocusElement();this.selectedInstance = inst;tinyMCE.execCommand(command, user_interface, value);if (tinyMCE.isMSIE && window.event != null)tinyMCE.cancelEvent(window.event);}};TinyMCE.prototype.execCommand = function(command, user_interface, value) {user_interface = user_interface ? user_interface : false;value = value ? value : null;if (tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();switch (command) {case 'mceHelp':var template = new Array();template['file']   = 'about.htm';template['width']  = 480;template['height'] = 380;tinyMCE.openWindow(template, {tinymce_version : tinyMCE.majorVersion + "." + tinyMCE.minorVersion,
tinymce_releasedate : tinyMCE.releaseDate,
inline : "yes"
});return;case 'mceFocus':var inst = tinyMCE.getInstanceById(value);if (inst)inst.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) {if (!tinyMCE.isInstance(tinyMCE.instances[n]))continue;try {tinyMCE.instances[n].getDoc().designMode = "on";} catch (e) {}}}return;}if (this.selectedInstance) {this.selectedInstance.execCommand(command, user_interface, value);} else if (tinyMCE.settings['focus_alert'])alert(tinyMCELang['lang_focus_alert']);};TinyMCE.prototype.eventPatch = function(editor_id) {if (typeof(tinyMCE) == "undefined")return true;for (var i=0; i<document.frames.length; i++) {try {if (document.frames[i].event) {var event = document.frames[i].event;if (!event.target)event.target = event.srcElement;TinyMCE.prototype.handleEvent(event);return;}} catch (ex) {}}};TinyMCE.prototype.unloadHandler = function() {tinyMCE.triggerSave(true, true);};TinyMCE.prototype.addEventHandlers = function(editor_id) {if (tinyMCE.isMSIE) {var doc = document.frames[editor_id].document;tinyMCE.addEvent(doc, "keypress", TinyMCE.prototype.eventPatch);tinyMCE.addEvent(doc, "keyup", TinyMCE.prototype.eventPatch);tinyMCE.addEvent(doc, "keydown", TinyMCE.prototype.eventPatch);tinyMCE.addEvent(doc, "mouseup", TinyMCE.prototype.eventPatch);tinyMCE.addEvent(doc, "click", TinyMCE.prototype.eventPatch);} else {var inst = tinyMCE.instances[editor_id];var doc = inst.getDoc();inst.switchSettings();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);tinyMCE.addEvent(doc, "blur", tinyMCE.handleEvent);eval('try { doc.designMode = "On"; } catch(e) {}');}};TinyMCE.prototype._createIFrame = function(replace_element) {var iframe = document.createElement("iframe");var id = replace_element.getAttribute("id");var aw, ah;aw = "" + tinyMCE.settings['area_width'];ah = "" + tinyMCE.settings['area_height'];if (aw.indexOf('%') == -1) {aw = parseInt(aw);aw = aw < 0 ? 300 : aw;aw = aw + "px";}if (ah.indexOf('%') == -1) {ah = parseInt(ah);ah = ah < 0 ? 240 : ah;ah = ah + "px";}iframe.setAttribute("id", id);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", aw);iframe.setAttribute("height", ah);iframe.setAttribute("allowtransparency", "true");if (tinyMCE.settings["auto_resize"])iframe.setAttribute("scrolling", "no");if (tinyMCE.isMSIE && !tinyMCE.isOpera)iframe.setAttribute("src", this.settings['default_document']);iframe.style.width = aw;iframe.style.height = ah;if (tinyMCE.isMSIE && !tinyMCE.isOpera)replace_element.outerHTML = iframe.outerHTML;else
replace_element.parentNode.replaceChild(iframe, replace_element);if (tinyMCE.isMSIE)return window.frames[id];else
return iframe;};TinyMCE.prototype.setupContent = function(editor_id) {var inst = tinyMCE.instances[editor_id];var doc = inst.getDoc();var head = doc.getElementsByTagName('head').item(0);var content = inst.startContent;tinyMCE.operaOpacityCounter = 100 * tinyMCE.idCounter;inst.switchSettings();if (!tinyMCE.isMSIE && 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.executeCallback('init_instance_callback', '_initInstance', 0, inst);if (tinyMCE.getParam("convert_fonts_to_spans"))inst.getDoc().body.setAttribute('id', 'mceSpanFonts');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;var 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.storeAwayURLs(content);content = tinyMCE._customCleanup(inst, "insert_to_editor", content);if (tinyMCE.isMSIE) {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 body = document.frames[editor_id].document.body;tinyMCE.addEvent(body, "beforepaste", TinyMCE.prototype.eventPatch);tinyMCE.addEvent(body, "beforecut", TinyMCE.prototype.eventPatch);body.editorId = editor_id;}content = tinyMCE.cleanupHTMLCode(content);if (!tinyMCE.isMSIE) {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 {content = tinyMCE.regexpReplace(content, "<strong", "<b", "gi");content = tinyMCE.regexpReplace(content, "<em(/?)>", "<i$1>", "gi");content = tinyMCE.regexpReplace(content, "<em ", "<i ", "gi");content = tinyMCE.regexpReplace(content, "</strong>", "</b>", "gi");content = tinyMCE.regexpReplace(content, "</em>", "</i>", "gi");tinyMCE.setInnerHTML(inst.getBody(), content);}inst.convertAllRelativeURLs();} 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);}var parentElm = document.getElementById(inst.editorId + '_parent');if (parentElm.lastChild.nodeName == "INPUT")inst.formElement = tinyMCE.isGecko ? parentElm.firstChild : parentElm.lastChild;else
inst.formElement = tinyMCE.isGecko ? parentElm.previousSibling : parentElm.nextSibling;tinyMCE.handleVisualAid(inst.getBody(), true, tinyMCE.settings['visual'], inst);tinyMCE.executeCallback('setupcontent_callback', '_setupContent', 0, editor_id, inst.getBody(), inst.getDoc());if (!tinyMCE.isMSIE)TinyMCE.prototype.addEventHandlers(editor_id);if (tinyMCE.isMSIE)tinyMCE.addEvent(inst.getBody(), "blur", TinyMCE.prototype.eventPatch);tinyMCE.selectedInstance = inst;tinyMCE.selectedElement = inst.contentWindow.document.body;if (!inst.isHidden())tinyMCE.triggerNodeChange(false, true);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.undoLevels[inst.undoLevels.length] = inst.startContent;tinyMCE.operaOpacityCounter = -1;};TinyMCE.prototype.cleanupHTMLCode = function(s) {s = s.replace(/<p \/>/gi, '<p>&nbsp;</p>');s = s.replace(/<p>\s*<\/p>/gi, '<p>&nbsp;</p>');s = s.replace(/<(h[1-6]|p|div|address|pre|form|table|li|ol|ul|td|b|em|strong|i|strike|u|span|a|ul|ol|li|blockquote)([a-z]*)([^\\|>]*?)\/>/gi, '<$1$2$3></$1$2>');s = s.replace(new RegExp('\\s+></', 'gi'), '></');s = s.replace(/<(img|br|hr)(.*?)><\/(img|br|hr)>/gi, '<$1$2 />');if (tinyMCE.isMSIE)s = s.replace(/<p><hr \/><\/p>/gi, "<hr>");s = s.replace(new RegExp('(href=\"?)(\\s*?#)', 'gi'), '$1' + tinyMCE.settings['document_base_url'] + "#");return s;};TinyMCE.prototype.storeAwayURLs = function(s) {s = s.replace(new RegExp('mce_src\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');s = s.replace(new RegExp('mce_href\\s*=\\s*\"[^ >\"]*\"', 'gi'), '');s = s.replace(new RegExp('src\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'src="$1" mce_src="$1"');s = s.replace(new RegExp('href\\s*=\\s*\"([^ >\"]*)\"', 'gi'), 'href="$1" mce_href="$1"');return s;};TinyMCE.prototype.cancelEvent = function(e) {if (tinyMCE.isMSIE) {e.returnValue = false;e.cancelBubble = true;} else
e.preventDefault();};TinyMCE.prototype.removeTinyMCEFormElements = function(form_obj) {if (typeof(form_obj) == "undefined" || form_obj == null)return;if (form_obj.nodeName != "FORM") {if (form_obj.form)form_obj = form_obj.form;else
form_obj = tinyMCE.getParentElement(form_obj, "form");}if (form_obj == null)return;for (var i=0; i<form_obj.elements.length; i++) {var elementId = form_obj.elements[i].name ? form_obj.elements[i].name : form_obj.elements[i].id;if (elementId.indexOf('mce_editor_') == 0)form_obj.elements[i].disabled = true;}};TinyMCE.prototype.accessibleEventHandler = function(e) {var win = this._win;e = tinyMCE.isMSIE ? win.event : e;var elm = tinyMCE.isMSIE ? e.srcElement : e.target;if (elm.nodeName == "SELECT" && !elm.oldonchange) {elm.oldonchange = elm.onchange;elm.onchange = null;}if (e.keyCode == 13 || e.keyCode == 32) {elm.onchange = elm.oldonchange;elm.onchange();elm.oldonchange = null;tinyMCE.cancelEvent(e);}};TinyMCE.prototype.addSelectAccessibility = function(e, select, win) {if (!select._isAccessible) {select.onkeydown = tinyMCE.accessibleEventHandler;select._isAccessible = true;select._win = win;}};TinyMCE.prototype.handleEvent = function(e) {if (typeof(tinyMCE) == "undefined")return true;switch (e.type) {case "blur":if (tinyMCE.selectedInstance)tinyMCE.selectedInstance.execCommand('mceEndTyping');return;case "submit":tinyMCE.removeTinyMCEFormElements(tinyMCE.isMSIE ? window.event.srcElement : e.target);tinyMCE.triggerSave();tinyMCE.isNotDirty = true;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 "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.selectedInstance)tinyMCE.selectedInstance.switchSettings();if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && e.keyCode == 13 && !e.shiftKey) {if (tinyMCE.selectedInstance._insertPara(e)) {tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.cancelEvent(e);return false;}}if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) {if (tinyMCE.selectedInstance._handleBackSpace(e.type)) {tinyMCE.execCommand("mceAddUndoLevel");tinyMCE.cancelEvent(e);return false;}}if (tinyMCE.isGecko && (e.ctrlKey && !e.altKey) && tinyMCE.settings['custom_undo_redo']) {if (tinyMCE.settings['custom_undo_redo_keyboard_shortcuts']) {if (e.charCode == 122) {tinyMCE.selectedInstance.execCommand("Undo");tinyMCE.cancelEvent(e);return false;}if (e.charCode == 121) {tinyMCE.selectedInstance.execCommand("Redo");tinyMCE.cancelEvent(e);return false;}}if (e.charCode == 98) {tinyMCE.selectedInstance.execCommand("Bold");tinyMCE.cancelEvent(e);return false;}if (e.charCode == 105) {tinyMCE.selectedInstance.execCommand("Italic");tinyMCE.cancelEvent(e);return false;}if (e.charCode == 117) {tinyMCE.selectedInstance.execCommand("Underline");tinyMCE.cancelEvent(e);return false;}if (e.charCode == 118) {tinyMCE.selectedInstance.execCommand("mceInsertContent", false, '<geckopastefix/>');}}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.execCommand("mceAddUndoLevel");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.selectedInstance)tinyMCE.selectedInstance.switchSettings();var inst = tinyMCE.selectedInstance;if (tinyMCE.isGecko && tinyMCE.settings['force_p_newlines'] && (e.keyCode == 8 || e.keyCode == 46) && !e.shiftKey) {if (tinyMCE.selectedInstance._handleBackSpace(e.type)) {tinyMCE.execCommand("mceAddUndoLevel");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'], tinyMCE.selectedInstance);if (tinyMCE.isMSIE && e.type == "keydown" && e.keyCode == 13)tinyMCE.enterKeyElement = tinyMCE.selectedInstance.getFocusElement();if (tinyMCE.isMSIE && e.type == "keyup" && e.keyCode == 13) {var elm = tinyMCE.enterKeyElement;if (elm) {var re = new RegExp('^HR|IMG|BR$','g');var dre = new RegExp('^H[1-6]$','g');if (!elm.hasChildNodes() && !re.test(elm.nodeName)) {if (dre.test(elm.nodeName))elm.innerHTML = "&nbsp;&nbsp;";else
elm.innerHTML = "&nbsp;";}}}var keys = tinyMCE.posKeyCodes;var posKey = false;for (var i=0; i<keys.length; i++) {if (keys[i] == e.keyCode) {posKey = true;break;}}if (tinyMCE.isMSIE && tinyMCE.settings['custom_undo_redo']) {var keys = new Array(8,46);for (var i=0; i<keys.length; i++) {if (keys[i] == e.keyCode) {if (e.type == "keyup")tinyMCE.triggerNodeChange(false);}}if (tinyMCE.settings['custom_undo_redo_keyboard_shortcuts']) {if (e.keyCode == 90 && (e.ctrlKey && !e.altKey) && e.type == "keydown") {tinyMCE.selectedInstance.execCommand("Undo");tinyMCE.triggerNodeChange(false);}if (e.keyCode == 89 && (e.ctrlKey && !e.altKey) && e.type == "keydown") {tinyMCE.selectedInstance.execCommand("Redo");tinyMCE.triggerNodeChange(false);}if ((e.keyCode == 90 || e.keyCode == 89) && (e.ctrlKey && !e.altKey)) {e.returnValue = false;e.cancelBubble = true;return false;}}}if ((e.keyCode == 90 || e.keyCode == 89) && (e.ctrlKey && !e.altKey))return true;if (e.keyCode == 17)return true;if (!posKey && e.type == "keyup")tinyMCE.execCommand("mceStartTyping");if (e.type == "keyup" && (posKey || e.ctrlKey))tinyMCE.execCommand("mceEndTyping");if (posKey && e.type == "keyup")tinyMCE.triggerNodeChange(false);if (tinyMCE.isMSIE && e.ctrlKey)window.setTimeout('tinyMCE.triggerNodeChange(false);', 1);break;case "mousedown":case "mouseup":case "click":case "focus":if (tinyMCE.selectedInstance)tinyMCE.selectedInstance.switchSettings();var targetBody = tinyMCE.getParentElement(e.target, "body");for (var instanceName in tinyMCE.instances) {if (!tinyMCE.isInstance(tinyMCE.instances[instanceName]))continue;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");break;}}if (tinyMCE.isSafari) {tinyMCE.selectedInstance.lastSafariSelection = tinyMCE.selectedInstance.getBookmark();tinyMCE.selectedInstance.lastSafariSelectedElement = tinyMCE.selectedElement;var lnk = tinyMCE.getParentElement(tinyMCE.selectedElement, "a");if (lnk && e.type == "mousedown") {lnk.setAttribute("mce_real_href", lnk.getAttribute("href"));lnk.setAttribute("href", "javascript:void(0);");}if (lnk && e.type == "click") {window.setTimeout(function() {lnk.setAttribute("href", lnk.getAttribute("mce_real_href"));lnk.removeAttribute("mce_real_href");}, 10);}}if (e.type != "focus")tinyMCE.selectedNode = null;tinyMCE.triggerNodeChange(false);tinyMCE.execCommand("mceEndTyping");if (e.type == "mouseup")tinyMCE.execCommand("mceAddUndoLevel");if (!tinyMCE.selectedInstance && e.target.editorId)tinyMCE.selectedInstance = tinyMCE.instances[e.target.editorId];return false;break;    }};TinyMCE.prototype.switchClass = function(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;}};TinyMCE.prototype.restoreAndSwitchClass = function(element, class_name) {if (element != null && !element.classLock) {this.restoreClass(element);this.switchClass(element, class_name);}};TinyMCE.prototype.switchClassSticky = function(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;if (tinyMCE.isOpera) {if (class_name == "mceButtonDisabled") {var suffix = "";if (!element.mceOldSrc)element.mceOldSrc = element.src;if (this.operaOpacityCounter > -1)suffix = '?rnd=' + this.operaOpacityCounter++;element.src = tinyMCE.baseURL + "/themes/" + tinyMCE.getParam("theme") + "/images/opacity.png" + suffix;element.style.backgroundImage = "url('" + element.mceOldSrc + "')";} else {if (element.mceOldSrc) {element.src = element.mceOldSrc;element.parentNode.style.backgroundImage = "";element.mceOldSrc = null;}}}}};TinyMCE.prototype.restoreClass = function(element) {if (element != null && element.oldClassName && !element.classLock) {element.className = element.oldClassName;element.oldClassName = null;}};TinyMCE.prototype.setClassLock = function(element, lock_state) {if (element != null)element.classLock = lock_state;};TinyMCE.prototype.addEvent = function(obj, name, handler) {if (tinyMCE.isMSIE) {obj.attachEvent("on" + name, handler);} else
obj.addEventListener(name, handler, false);};TinyMCE.prototype.submitPatch = function() {tinyMCE.removeTinyMCEFormElements(this);tinyMCE.triggerSave();this.mceOldSubmit();tinyMCE.isNotDirty = true;};TinyMCE.prototype.onLoad = function() {for (var c=0; c<tinyMCE.configs.length; c++) {tinyMCE.settings = tinyMCE.configs[c];var selector = tinyMCE.getParam("editor_selector");var deselector = tinyMCE.getParam("editor_deselector");var elementRefAr = new Array();if (document.forms && tinyMCE.settings['add_form_submit_trigger'] && !tinyMCE.submitTriggers) {for (var i=0; i<document.forms.length; i++) {var form = document.forms[i];tinyMCE.addEvent(form, "submit", TinyMCE.prototype.handleEvent);tinyMCE.addEvent(form, "reset", TinyMCE.prototype.handleEvent);tinyMCE.submitTriggers = true;if (tinyMCE.settings['submit_patch']) {try {form.mceOldSubmit = form.submit;form.submit = TinyMCE.prototype.submitPatch;} catch (e) {}}}}var mode = tinyMCE.settings['mode'];switch (mode) {case "exact":var elements = tinyMCE.getParam('elements', '', true, ',');for (var i=0; i<elements.length; i++) {var element = tinyMCE._getElementById(elements[i]);var trigger = element ? element.getAttribute(tinyMCE.settings['textarea_trigger']) : "";if (tinyMCE.getAttrib(element, "class").indexOf(deselector) != -1)continue;if (trigger == "false")continue;if (tinyMCE.settings['ask'] && element) {elementRefAr[elementRefAr.length] = element;continue;}if (element)tinyMCE.addMCEControl(element, elements[i]);else if (tinyMCE.settings['debug'])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++) {var elm = nodeList.item(i);var trigger = elm.getAttribute(tinyMCE.settings['textarea_trigger']);if (selector != '' && tinyMCE.getAttrib(elm, "class").indexOf(selector) == -1)continue;if (selector != '')trigger = selector != "" ? "true" : "";if (tinyMCE.getAttrib(elm, "class").indexOf(deselector) != -1)continue;if ((mode == "specific_textareas" && trigger == "true") || (mode == "textareas" && trigger != "false"))elementRefAr[elementRefAr.length] = elm;}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) {var settings = tinyMCE.settings;tinyMCE.addEvent(element, "focus", function (e) {window.setTimeout(function() {TinyMCE.prototype.confirmAdd(e, settings);}, 10);});} else {var settings = tinyMCE.settings;tinyMCE.addEvent(element, "focus", function () { TinyMCE.prototype.confirmAdd(null, settings); });}} 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);}tinyMCE.executeCallback('oninit', '_oninit', 0);}};TinyMCE.prototype.removeMCEControl = function(editor_id) {var inst = tinyMCE.getInstanceById(editor_id);if (inst) {inst.switchSettings();editor_id = inst.editorId;var html = tinyMCE.getContent(editor_id);var tmpInstances = new Array();for (var instanceName in tinyMCE.instances) {var instance = tinyMCE.instances[instanceName];if (!tinyMCE.isInstance(instance))continue;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 = inst.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);}}};TinyMCE.prototype._cleanupElementName = function(element_name, element) {var name = "";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, n=tinyMCE.cleanup_validElements[i][0].length; x<n; x++) {var elmMatch = tinyMCE.cleanup_validElements[i][0][x];if (elmMatch.charAt(0) == '+' || elmMatch.charAt(0) == '-')elmMatch = elmMatch.substring(1);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 (element_name.charAt(0) == '+' || element_name.charAt(0) == '-')name = element_name.substring(1);if (!tinyMCE.isMSIE) {if (name == "strong" && !tinyMCE.cleanup_on_save)element_name = "b";else if (name == "em" && !tinyMCE.cleanup_on_save)element_name = "i";}var elmData = new Object();elmData.element_name = element_name;elmData.valid_attribs = elementAttribs;return elmData;};TinyMCE.prototype._moveStyle = function(elm, style, attrib) {if (tinyMCE.cleanup_inline_styles) {var val = tinyMCE.getAttrib(elm, attrib);if (val != '') {val = '' + val;switch (attrib) {case "background":val = "url('" + val + "')";break;case "bordercolor":if (elm.style.borderStyle == '' || elm.style.borderStyle == 'none')elm.style.borderStyle = 'solid';break;case "border":case "width":case "height":if (attrib == "border" && elm.style.borderWidth > 0)return;if (val.indexOf('%') == -1)val += 'px';break;case "vspace":case "hspace":elm.style.marginTop = val + "px";elm.style.marginBottom = val + "px";elm.removeAttribute(attrib);return;case "align":if (elm.nodeName == "IMG") {if (tinyMCE.isMSIE)elm.style.styleFloat = val;else
elm.style.cssFloat = val;} else
elm.style.textAlign = val;elm.removeAttribute(attrib);return;}if (val != '') {eval('elm.style.' + style + ' = val;');elm.removeAttribute(attrib);}}} else {if (style == '')return;var val = eval('elm.style.' + style) == '' ? tinyMCE.getAttrib(elm, attrib) : eval('elm.style.' + style);val = val == null ? '' : '' + val;switch (attrib) {case "background":if (val.indexOf('url') == -1 && val != '')val = "url('" + val + "');";if (val != '') {elm.style.backgroundImage = val;elm.removeAttribute(attrib);}return;case "border":case "width":case "height":val = val.replace('px', '');break;case "align":if (tinyMCE.getAttrib(elm, 'align') == '') {if (elm.nodeName == "IMG") {if (tinyMCE.isMSIE && elm.style.styleFloat != '') {val = elm.style.styleFloat;style = 'styleFloat';} else if (tinyMCE.isGecko && elm.style.cssFloat != '') {val = elm.style.cssFloat;style = 'cssFloat';}}}break;}if (val != '') {elm.removeAttribute(attrib);elm.setAttribute(attrib, val);eval('elm.style.' + style + ' = "";');}}};TinyMCE.prototype._cleanupAttribute = function(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 (attribName.indexOf('moz_') != -1)return null;if (!tinyMCE.cleanup_on_save && (attribName == "mce_href" || attribName == "mce_src"))return {name : attribName, value : attribValue};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 (!verified)return false;} else
verified = true;switch (attribName) {case "size":if (tinyMCE.isMSIE5 && element_name == "font")attribValue = element_node.size;break;case "width":case "height":case "border":if (tinyMCE.isMSIE5)attribValue = eval("element_node." + attribName);break;case "shape":attribValue = attribValue.toLowerCase();break;case "cellspacing":if (tinyMCE.isMSIE5)attribValue = element_node.cellSpacing;break;case "cellpadding":if (tinyMCE.isMSIE5)attribValue = element_node.cellPadding;break;case "color":if (tinyMCE.isMSIE5 && element_name == "font")attribValue = element_node.color;break;case "class":if (tinyMCE.cleanup_on_save && attribValue.indexOf('mceItemAnchor') != -1)attribValue = attribValue.replace(/mceItem[a-z0-9]+/gi, '');if (element_name == "table" || element_name == "td" || element_name == "th") {if (tinyMCE.cleanup_visual_table_class != "")attribValue = tinyMCE.getVisualAidClass(attribValue, !tinyMCE.cleanup_on_save);}if (!tinyMCE._verifyClass(element_node) || attribValue == "")return null;break;case "onfocus":case "onblur":case "onclick":case "ondblclick":case "onmousedown":case "onmouseup":case "onmouseover":case "onmousemove":case "onmouseout":case "onkeypress":case "onkeydown":case "onkeydown":case "onkeyup":attribValue = tinyMCE.cleanupEventStr("" + attribValue);if (attribValue.indexOf('return false;') == 0)attribValue = attribValue.substring(14);break;case "style":attribValue = tinyMCE.serializeStyle(tinyMCE.parseStyle(tinyMCE.getAttrib(element_node, "style")));break;case "href":case "src":case "longdesc":attribValue = tinyMCE.getAttrib(element_node, attribName);var href = tinyMCE.getAttrib(element_node, "mce_href");if (attribName == "href" && href != "")attribValue = href;var src = tinyMCE.getAttrib(element_node, "mce_src");if (attribName == "src" && src != "")attribValue = src;if (!tinyMCE.cleanup_on_save)attribValue = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], attribValue);else if (tinyMCE.getParam('convert_urls'))attribValue = eval(tinyMCE.cleanup_urlconverter_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 "mce_href":case "mce_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;};TinyMCE.prototype.clearArray = function(ar) {for (var key in ar)ar[key] = null;};TinyMCE.prototype.isInstance = function(inst) {return inst != null && typeof(inst) == "object" && inst.isTinyMCEControl;};TinyMCE.prototype.parseStyle = function(str) {var ar = new Array();if (str == null)return ar;var st = str.split(';');tinyMCE.clearArray(ar);for (var i=0; i<st.length; i++) {if (st[i] == '')continue;var re = new RegExp('^\\s*([^:]*):\\s*(.*)\\s*$');var pa = st[i].replace(re, '$1||$2').split('||');if (pa.length == 2)ar[pa[0].toLowerCase()] = pa[1];}return ar;};TinyMCE.prototype.compressStyle = function(ar, pr, sf, res) {var box = new Array();box[0] = ar[pr + '-top' + sf];box[1] = ar[pr + '-left' + sf];box[2] = ar[pr + '-right' + sf];box[3] = ar[pr + '-bottom' + sf];for (var i=0; i<box.length; i++) {if (box[i] == null)return;for (var a=0; a<box.length; a++) {if (box[a] != box[i])return;}}ar[res] = box[0];ar[pr + '-top' + sf] = null;ar[pr + '-left' + sf] = null;ar[pr + '-right' + sf] = null;ar[pr + '-bottom' + sf] = null;};TinyMCE.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");for (var key in ar) {var val = ar[key];if (typeof(val) == 'function')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);if (val != "url('')")str += key.toLowerCase() + ": " + val + "; ";}}if (new RegExp('; $').test(str))str = str.substring(0, str.length - 2);return str;};TinyMCE.prototype.convertRGBToHex = function(s, k) {if (s.toLowerCase().indexOf('rgb') != -1) {var re = new RegExp("(.*?)rgb\\s*?\\(\\s*?([0-9]+).*?,\\s*?([0-9]+).*?,\\s*?([0-9]+).*?\\)(.*?)", "gi");var rgb = s.replace(re, "$1,$2,$3,$4,$5").split(',');if (rgb.length == 5) {r = parseInt(rgb[1]).toString(16);g = parseInt(rgb[2]).toString(16);b = parseInt(rgb[3]).toString(16);r = r.length == 1 ? '0' + r : r;g = g.length == 1 ? '0' + g : g;b = b.length == 1 ? '0' + b : b;s = "#" + r + g + b;if (k)s = rgb[0] + s + rgb[4];}}return s;};TinyMCE.prototype.convertHexToRGB = function(s) {if (s.indexOf('#') != -1) {s = s.replace(new RegExp('[^0-9A-F]', 'gi'), '');return "rgb(" + parseInt(s.substring(0, 2), 16) + "," + parseInt(s.substring(2, 4), 16) + "," + parseInt(s.substring(4, 6), 16) + ")";}return s;};TinyMCE.prototype._verifyClass = function(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;};TinyMCE.prototype.cleanupNode = function(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 = "";var openTag = false, nonEmptyTag = false;if (elementName != null && elementName.charAt(0) == '+') {elementName = elementName.substring(1);openTag = true;}if (elementName != null && elementName.charAt(0) == '-') {elementName = elementName.substring(1);nonEmptyTag = true;}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 (tinyMCE.cleanup_on_save) {if (node.nodeName == "A" && node.className == "mceItemAnchor") {if (node.hasChildNodes()) {for (var i=0; i<node.childNodes.length; i++)output += this.cleanupNode(node.childNodes[i]);}return '<a name="' + this.convertStringToXML(node.getAttribute("name")) + '"></a>' + output;}}var re = new RegExp("^(TABLE|TD|TR)$");if (re.test(node.nodeName)) {if ((node.nodeName != "TABLE" || tinyMCE.cleanup_inline_styles) && (width = tinyMCE.getAttrib(node, "width")) != '') {node.style.width = width.indexOf('%') != -1 ? width : width.replace(/[^0-9]/gi, '') + "px";node.removeAttribute("width");}if ((node.nodeName == "TABLE" && !tinyMCE.cleanup_inline_styles) && node.style.width != '') {tinyMCE.setAttrib(node, "width", node.style.width.replace('px',''));node.style.width = '';}if ((height = tinyMCE.getAttrib(node, "height")) != '') {height = "" + height;node.style.height = height.indexOf('%') != -1 ? height : height.replace(/[^0-9]/gi, '') + "px";node.removeAttribute("height");}}if (tinyMCE.cleanup_inline_styles) {var re = new RegExp("^(TABLE|TD|TR|IMG|HR)$");if (re.test(node.nodeName) && tinyMCE.getAttrib(node, "class").indexOf('mceItem') == -1) {tinyMCE._moveStyle(node, 'width', 'width');tinyMCE._moveStyle(node, 'height', 'height');tinyMCE._moveStyle(node, 'borderWidth', 'border');tinyMCE._moveStyle(node, '', 'vspace');tinyMCE._moveStyle(node, '', 'hspace');tinyMCE._moveStyle(node, 'textAlign', 'align');tinyMCE._moveStyle(node, 'backgroundColor', 'bgColor');tinyMCE._moveStyle(node, 'borderColor', 'borderColor');tinyMCE._moveStyle(node, 'backgroundImage', 'background');if (tinyMCE.isMSIE5)node.outerHTML = node.outerHTML;} else if (tinyMCE.isBlockElement(node))tinyMCE._moveStyle(node, 'textAlign', 'align');if (node.nodeName == "FONT")tinyMCE._moveStyle(node, 'color', 'color');}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 != null || attribForceValue != null) {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++);if (attribName == "class")attribValue = tinyMCE.getVisualAidClass(attribValue, tinyMCE.cleanup_on_save);node.setAttribute(attribName, attribValue);}}}if ((tinyMCE.isMSIE && !tinyMCE.isOpera) && elementName == "style")return "<style>" + node.innerHTML + "</style>";if (elementName == "table" && !node.hasChildNodes())return "";if (node.attributes.length > 0) {var lastAttrib = "";for (var i=0; i<node.attributes.length; i++) {if (node.attributes[i].specified) {if (tinyMCE.isOpera) {if (node.attributes[i].nodeName == lastAttrib)continue;lastAttrib = node.attributes[i].nodeName;}var attrib = tinyMCE._cleanupAttribute(elementValidAttribs, elementName, node.attributes[i], node);if (attrib && attrib.value != "")elementAttribs += " " + attrib.name + "=" + '"' + this.convertStringToXML("" + attrib.value) + '"';}}}if (tinyMCE.isMSIE && elementName == "table" && node.getAttribute("summary") != null && elementAttribs.indexOf('summary') == -1) {var summary = tinyMCE.getAttrib(node, 'summary');if (summary != '')elementAttribs += " summary=" + '"' + this.convertStringToXML(summary) + '"';}if (tinyMCE.isMSIE5 && /^(td|img|a)$/.test(elementName)) {var ma = new Array("scope", "longdesc", "hreflang", "charset", "type");for (var u=0; u<ma.length; u++) {if (node.getAttribute(ma[u]) != null) {var s = tinyMCE.getAttrib(node, ma[u]);if (s != '')elementAttribs += " " + ma[u] + "=" + '"' + this.convertStringToXML(s) + '"';}}}if (tinyMCE.isMSIE && elementName == "input") {if (node.type) {if (!elementAttribs.match(/ type=/g))elementAttribs += " type=" + '"' + node.type + '"';}if (node.value) {if (!elementAttribs.match(/ value=/g))elementAttribs += " value=" + '"' + node.value + '"';}}if ((elementName == "p" || elementName == "td") && (node.innerHTML == "" || node.innerHTML == "&nbsp;"))return "<" + elementName + elementAttribs + ">" + this.convertStringToXML(String.fromCharCode(160)) + "</" + elementName + ">";if (tinyMCE.isMSIE && elementName == "script")return "<" + elementName + elementAttribs + ">" + node.text + "</" + elementName + ">";if (node.hasChildNodes()) {if (!(elementName == "span" && elementAttribs == "" && tinyMCE.getParam("trim_span_elements"))) {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 == "span" && elementAttribs == "" && tinyMCE.getParam("trim_span_elements"))) {if (elementName == "p" && tinyMCE.cleanup_force_br_newlines)output += "</div><br />";else
output += "</" + elementName + ">";}} else {if (!nonEmptyTag) {if (openTag)output += "<" + elementName + elementAttribs + "></" + elementName + ">";else
output += "<" + elementName + elementAttribs + " />";}}return output;case 3:if (node.parentNode.nodeName == "SCRIPT" || node.parentNode.nodeName == "NOSCRIPT" || node.parentNode.nodeName == "STYLE")return node.nodeValue;return this.convertStringToXML(node.nodeValue);case 8:return "<!--" + node.nodeValue + "-->";default:return "[UNKNOWN NODETYPE " + node.nodeType + "]";}};TinyMCE.prototype.convertStringToXML = function(html_data) {    var output = "";for (var i=0; i<html_data.length; i++) {var chr = html_data.charCodeAt(i);if (tinyMCE.settings['entity_encoding'] == "numeric") {if (chr > 127)output += '&#' + chr + ";";else
output += String.fromCharCode(chr);continue;}if (tinyMCE.settings['entity_encoding'] == "raw") {output += String.fromCharCode(chr);continue;}if (typeof(tinyMCE.settings['cleanup_entities']["c" + chr]) != 'undefined' && tinyMCE.settings['cleanup_entities']["c" + chr] != '')output += '&' + tinyMCE.settings['cleanup_entities']["c" + chr] + ';';else
output += '' + String.fromCharCode(chr);    }    return output;};TinyMCE.prototype._getCleanupElementName = function(chunk) {var pos;if (chunk.charAt(0) == '+')chunk = chunk.substring(1);if (chunk.charAt(0) == '-')chunk = chunk.substring(1);if ((pos = chunk.indexOf('/')) != -1)chunk = chunk.substring(0, pos);if ((pos = chunk.indexOf('[')) != -1)chunk = chunk.substring(0, pos);return chunk;};TinyMCE.prototype._initCleanup = function() {var validElements = tinyMCE.settings["valid_elements"];validElements = validElements.split(',');var extendedValidElements = tinyMCE.settings["extended_valid_elements"];extendedValidElements = extendedValidElements.split(',');for (var i=0; i<extendedValidElements.length; i++) {var elementName = this._getCleanupElementName(extendedValidElements[i]);var skipAdd = false;for (var x=0; x<validElements.length; x++) {if (this._getCleanupElementName(validElements[x]) == elementName) {validElements[x] = extendedValidElements[i];skipAdd = true;break;}}if (!skipAdd)validElements[validElements.length] = extendedValidElements[i];}for (var i=0; i<validElements.length; i++) {var item = validElements[i];item = item.replace('[','|');item = item.replace(']','');var attribs = item.split('|');for (var x=0; x<attribs.length; x++)attribs[x] = attribs[x].toLowerCase();attribs[0] = attribs[0].split('/');for (var x=1; x<attribs.length; x++) {var attribName = attribs[x];var attribDefault = null;var attribForce = null;var attribMustBe = null;if ((pos = attribName.indexOf('=')) != -1) {attribDefault = attribName.substring(pos+1);attribName = attribName.substring(0, pos);}if ((pos = attribName.indexOf(':')) != -1) {attribForce = attribName.substring(pos+1);attribName = attribName.substring(0, pos);}if ((pos = attribName.indexOf('<')) != -1) {attribMustBe = attribName.substring(pos+1).split('?');attribName = attribName.substring(0, pos);}attribs[x] = new Array(attribName, attribDefault, attribForce, attribMustBe);}validElements[i] = attribs;}var invalidElements = tinyMCE.settings['invalid_elements'].split(',');for (var i=0; i<invalidElements.length; i++)invalidElements[i] = invalidElements[i].toLowerCase();tinyMCE.settings['cleanup_validElements'] = validElements;tinyMCE.settings['cleanup_invalidElements'] = invalidElements;};TinyMCE.prototype._cleanupHTML = function(inst, doc, config, element, visual, on_save) {if (!tinyMCE.settings['cleanup']) {tinyMCE.handleVisualAid(inst.getBody(), true, false, inst);var html = element.innerHTML;html = html.replace(new RegExp('(mce_href|mce_src)=".*?"', 'gi'), '');html = html.replace(/\s+>/gi, '>');return html;}if (on_save && tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertFontsToSpans(doc);tinyMCE._customCleanup(inst, on_save ? "get_from_editor_dom" : "insert_to_editor_dom", doc.body);var n = doc.getElementsByTagName("font");for (var i=0; i<n.length; i++) {var c = "";if ((c = tinyMCE.getAttrib(n[i], "bgcolor")) != "") {n[i].style.backgroundColor = c;tinyMCE.setAttrib(n[i], "bgcolor", "");}}tinyMCE.cleanup_validElements = tinyMCE.settings['cleanup_validElements'];tinyMCE.cleanup_invalidElements = tinyMCE.settings['cleanup_invalidElements'];tinyMCE.cleanup_verify_html = tinyMCE.settings['verify_html'];tinyMCE.cleanup_force_br_newlines = tinyMCE.settings['force_br_newlines'];tinyMCE.cleanup_urlconverter_callback = tinyMCE.settings['urlconverter_callback'];tinyMCE.cleanup_verify_css_classes = tinyMCE.settings['verify_css_classes'];tinyMCE.cleanup_visual_table_class = tinyMCE.settings['visual_table_class'];tinyMCE.cleanup_apply_source_formatting = tinyMCE.settings['apply_source_formatting'];tinyMCE.cleanup_inline_styles = tinyMCE.settings['inline_styles'];tinyMCE.cleanup_visual_aid = visual;tinyMCE.cleanup_on_save = on_save;tinyMCE.cleanup_idCount = 0;tinyMCE.cleanup_elementLookupTable = new Array();var startTime = new Date().getTime();if (tinyMCE.isMSIE) {var nodes = element.getElementsByTagName("hr");for (var i=0; i<nodes.length; i++) {if (nodes[i].id == "null")nodes[i].removeAttribute("id");}tinyMCE.setInnerHTML(element, tinyMCE.regexpReplace(element.innerHTML, '<p>[ \n\r]*<hr.*>[ \n\r]*</p>', '<hr />', 'gi'));tinyMCE.setInnerHTML(element, tinyMCE.regexpReplace(element.innerHTML, '<!([^-(DOCTYPE)]* )|<!/[^-]*>', '', 'gi'));}var html = this.cleanupNode(element);if (tinyMCE.settings['debug'])tinyMCE.debug("Cleanup process executed in: " + (new Date().getTime()-startTime) + " ms.");html = tinyMCE.regexpReplace(html, '<p><hr /></p>', '<hr />');html = tinyMCE.regexpReplace(html, '<p>&nbsp;</p><hr /><p>&nbsp;</p>', '<hr />');html = tinyMCE.regexpReplace(html, '<td>\\s*<br />\\s*</td>', '<td>&nbsp;</td>');html = tinyMCE.regexpReplace(html, '<p>\\s*<br />\\s*</p>', '<p>&nbsp;</p>');html = tinyMCE.regexpReplace(html, '<p>\\s*&nbsp;\\s*<br />\\s*&nbsp;\\s*</p>', '<p>&nbsp;</p>');html = tinyMCE.regexpReplace(html, '<p>\\s*&nbsp;\\s*<br />\\s*</p>', '<p>&nbsp;</p>');html = tinyMCE.regexpReplace(html, '<p>\\s*<br />\\s*&nbsp;\\s*</p>', '<p>&nbsp;</p>');html = html.replace(new RegExp('<a>(.*?)</a>', 'gi'), '$1');if (!tinyMCE.isMSIE)html = html.replace(new RegExp('<o:p _moz-userdefined="" />', 'g'), "");if (tinyMCE.settings['remove_linebreaks'])html = html.replace(new RegExp('\r|\n', 'g'), ' ');if (tinyMCE.getParam('apply_source_formatting')) {html = html.replace(new RegExp('<(p|div)([^>]*)>', 'g'), "\n<$1$2>\n");html = html.replace(new RegExp('<\/(p|div)([^>]*)>', 'g'), "\n</$1$2>\n");html = html.replace(new RegExp('<br />', 'g'), "<br />\n");}if (tinyMCE.settings['force_br_newlines']) {var re = new RegExp('<p>&nbsp;</p>', 'g');html = html.replace(re, "<br />");}if (tinyMCE.isGecko && tinyMCE.settings['remove_lt_gt']) {var re = new RegExp('&lt;&gt;', 'g');html = html.replace(re, "");}html = tinyMCE._customCleanup(inst, on_save ? "get_from_editor" : "insert_to_editor", html);var chk = tinyMCE.regexpReplace(html, "[ \t\r\n]", "").toLowerCase();if (chk == "<br/>" || chk == "<br>" || chk == "<p>&nbsp;</p>" || chk == "<p>&#160;</p>" || chk == "<p></p>")html = "";if (tinyMCE.settings["preformatted"])return "<pre>" + html + "</pre>";return html;};TinyMCE.prototype.insertLink = function(href, target, title, onclick, style_class) {tinyMCE.execCommand('mceBeginUndoLevel');if (this.selectedInstance && this.selectedElement && this.selectedElement.nodeName.toLowerCase() == "img") {var doc = this.selectedInstance.getDoc();var linkElement = tinyMCE.getParentElement(this.selectedElement, "a");var newLink = false;if (!linkElement) {linkElement = doc.createElement("a");newLink = true;}var mhref = href;var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, linkElement);");mhref = tinyMCE.getParam('convert_urls') ? href : mhref;tinyMCE.setAttrib(linkElement, 'href', thref);tinyMCE.setAttrib(linkElement, 'mce_href', mhref);tinyMCE.setAttrib(linkElement, 'target', target);tinyMCE.setAttrib(linkElement, 'title', title);        tinyMCE.setAttrib(linkElement, 'onclick', onclick);tinyMCE.setAttrib(linkElement, 'class', style_class);if (newLink) {linkElement.appendChild(this.selectedElement.cloneNode(true));this.selectedElement.parentNode.replaceChild(linkElement, this.selectedElement);}return;}if (!this.linkElement && this.selectedInstance) {if (tinyMCE.isSafari) {tinyMCE.execCommand("mceInsertContent", false, '<a href="' + tinyMCE.uniqueURL + '">' + this.selectedInstance.getSelectedHTML() + '</a>');} else
this.selectedInstance.contentDocument.execCommand("createlink", false, tinyMCE.uniqueURL);tinyMCE.linkElement = this.getElementByAttributeValue(this.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);var elementArray = this.getElementsByAttributeValue(this.selectedInstance.contentDocument.body, "a", "href", tinyMCE.uniqueURL);for (var i=0; i<elementArray.length; i++) {var mhref = href;var thref = eval(tinyMCE.settings['urlconverter_callback'] + "(href, elementArray[i]);");mhref = tinyMCE.getParam('convert_urls') ? href : mhref;tinyMCE.setAttrib(elementArray[i], 'href', thref);tinyMCE.setAttrib(elementArray[i], 'mce_href', mhref);tinyMCE.setAttrib(elementArray[i], 'target', target);tinyMCE.setAttrib(elementArray[i], 'title', title);            tinyMCE.setAttrib(elementArray[i], 'onclick', onclick);tinyMCE.setAttrib(elementArray[i], 'class', style_class);}tinyMCE.linkElement = elementArray[0];}if (this.linkElement) {var mhref = href;href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, this.linkElement);");mhref = tinyMCE.getParam('convert_urls') ? href : mhref;tinyMCE.setAttrib(this.linkElement, 'href', href);tinyMCE.setAttrib(this.linkElement, 'mce_href', mhref);tinyMCE.setAttrib(this.linkElement, 'target', target);tinyMCE.setAttrib(this.linkElement, 'title', title);        tinyMCE.setAttrib(this.linkElement, 'onclick', onclick);tinyMCE.setAttrib(this.linkElement, 'class', style_class);}tinyMCE.execCommand('mceEndUndoLevel');};TinyMCE.prototype.insertImage = function(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout) {tinyMCE.execCommand('mceBeginUndoLevel');if (src == "")return;if (!this.imgElement && tinyMCE.isSafari) {var html = "";html += '<img src="' + src + '" alt="' + alt + '"';html += ' border="' + border + '" hspace="' + hspace + '"';html += ' vspace="' + vspace + '" width="' + width + '"';html += ' height="' + height + '" align="' + align + '" title="' + title + '" onmouseover="' + onmouseover + '" onmouseout="' + onmouseout + '" />';tinyMCE.execCommand("mceInsertContent", false, html);} else {if (!this.imgElement && this.selectedInstance) {if (tinyMCE.isSafari)tinyMCE.execCommand("mceInsertContent", false, '<img src="' + tinyMCE.uniqueURL + '" />');else
this.selectedInstance.contentDocument.execCommand("insertimage", false, tinyMCE.uniqueURL);tinyMCE.imgElement = this.getElementByAttributeValue(this.selectedInstance.contentDocument.body, "img", "src", tinyMCE.uniqueURL);}}if (this.imgElement) {var needsRepaint = false;var msrc = src;src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, tinyMCE.imgElement);");if (tinyMCE.getParam('convert_urls'))msrc = src;if (onmouseover && onmouseover != "")onmouseover = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, tinyMCE.imgElement);") + "';";if (onmouseout && onmouseout != "")onmouseout = "this.src='" + eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, tinyMCE.imgElement);") + "';";if (typeof(title) == "undefined")title = alt;if (width != this.imgElement.getAttribute("width") || height != this.imgElement.getAttribute("height") || align != this.imgElement.getAttribute("align"))needsRepaint = true;tinyMCE.setAttrib(this.imgElement, 'src', src);tinyMCE.setAttrib(this.imgElement, 'mce_src', msrc);tinyMCE.setAttrib(this.imgElement, 'alt', alt);tinyMCE.setAttrib(this.imgElement, 'title', title);tinyMCE.setAttrib(this.imgElement, 'align', align);tinyMCE.setAttrib(this.imgElement, 'border', border, true);tinyMCE.setAttrib(this.imgElement, 'hspace', hspace, true);tinyMCE.setAttrib(this.imgElement, 'vspace', vspace, true);tinyMCE.setAttrib(this.imgElement, 'width', width, true);tinyMCE.setAttrib(this.imgElement, 'height', height, true);tinyMCE.setAttrib(this.imgElement, 'onmouseover', onmouseover);tinyMCE.setAttrib(this.imgElement, 'onmouseout', onmouseout);if (width && width != "")this.imgElement.style.pixelWidth = width;if (height && height != "")this.imgElement.style.pixelHeight = height;if (needsRepaint)tinyMCE.selectedInstance.repaint();}tinyMCE.execCommand('mceEndUndoLevel');};TinyMCE.prototype.getElementByAttributeValue = function(node, element_name, attrib, value) {var elements = this.getElementsByAttributeValue(node, element_name, attrib, value);if (elements.length == 0)return null;return elements[0];};TinyMCE.prototype.getElementsByAttributeValue = function(node, element_name, attrib, value) {var elements = new Array();if (node && node.nodeName.toLowerCase() == element_name) {if (node.getAttribute(attrib) && node.getAttribute(attrib).indexOf(value) != -1)elements[elements.length] = node;}if (node && node.hasChildNodes()) {for (var x=0, n=node.childNodes.length; x<n; x++) {var childElements = this.getElementsByAttributeValue(node.childNodes[x], element_name, attrib, value);for (var i=0, m=childElements.length; i<m; i++)elements[elements.length] = childElements[i];}}return elements;};TinyMCE.prototype.isBlockElement = function(node) {return node != null && node.nodeType == 1 && this.blockRegExp.test(node.nodeName);};TinyMCE.prototype.getParentBlockElement = function(node) {while (node) {if (this.blockRegExp.test(node.nodeName))return node;node = node.parentNode;}return null;};TinyMCE.prototype.getNodeTree = function(node, node_array, type, node_name) {if (typeof(type) == "undefined" || node.nodeType == type && (typeof(node_name) == "undefined" || node.nodeName == node_name))node_array[node_array.length] = node;if (node.hasChildNodes()) {for (var i=0; i<node.childNodes.length; i++)tinyMCE.getNodeTree(node.childNodes[i], node_array, type, node_name);}return node_array;};TinyMCE.prototype.getParentElement = function(node, names, attrib_name, attrib_value) {if (typeof(names) == "undefined") {if (node.nodeType == 1)return node;while ((node = node.parentNode) != null && node.nodeType != 1) ;return node;}var namesAr = names.split(',');if (node == null)return null;do {for (var i=0; i<namesAr.length; i++) {if (node.nodeName.toLowerCase() == namesAr[i].toLowerCase() || names == "*") {if (typeof(attrib_name) == "undefined")return node;else if (node.getAttribute(attrib_name)) {if (typeof(attrib_value) == "undefined") {if (node.getAttribute(attrib_name) != "")return node;} else if (node.getAttribute(attrib_name) == attrib_value)return node;}}}} while ((node = node.parentNode) != null);return null;};TinyMCE.prototype.convertURL = function(url, node, on_save) {var prot = document.location.protocol;var host = document.location.hostname;var port = document.location.port;if (prot == "file:")return url;url = tinyMCE.regexpReplace(url, '(http|https):///', '/');if (url.indexOf('mailto:') != -1 || url.indexOf('javascript:') != -1 || tinyMCE.regexpReplace(url,'[ \t\r\n\+]|%20','').charAt(0) == "#")return url;if (!tinyMCE.isMSIE && !on_save && url.indexOf("://") == -1 && url.charAt(0) != '/')return tinyMCE.settings['base_href'] + url;if (on_save && tinyMCE.getParam('relative_urls')) {var curl = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], url);if (curl.charAt(0) == '/')curl = tinyMCE.settings['document_base_prefix'] + curl;var urlParts = tinyMCE.parseURL(curl);var tmpUrlParts = tinyMCE.parseURL(tinyMCE.settings['document_base_url']);if (urlParts['host'] == tmpUrlParts['host'] && (urlParts['port'] == tmpUrlParts['port']))return tinyMCE.convertAbsoluteURLToRelativeURL(tinyMCE.settings['document_base_url'], curl);}if (!tinyMCE.getParam('relative_urls')) {var urlParts = tinyMCE.parseURL(url);var baseUrlParts = tinyMCE.parseURL(tinyMCE.settings['base_href']);url = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], url);if (urlParts['anchor'] && urlParts['path'] == baseUrlParts['path'])return "#" + urlParts['anchor'];}if (tinyMCE.getParam('remove_script_host')) {var start = "", portPart = "";if (port != "")portPart = ":" + port;start = prot + "//" + host + portPart + "/";if (url.indexOf(start) == 0)url = url.substring(start.length-1);}return url;};TinyMCE.prototype.parseURL = function(url_str) {var urlParts = new Array();if (url_str) {var pos, lastPos;pos = url_str.indexOf('://');if (pos != -1) {urlParts['protocol'] = url_str.substring(0, pos);lastPos = pos + 3;}for (var i=lastPos; i<url_str.length; i++) {var chr = url_str.charAt(i);if (chr == ':')break;if (chr == '/')break;}pos = i;urlParts['host'] = url_str.substring(lastPos, pos);urlParts['port'] = "";lastPos = pos;if (url_str.charAt(pos) == ':') {pos = url_str.indexOf('/', lastPos);urlParts['port'] = url_str.substring(lastPos+1, pos);}lastPos = pos;pos = url_str.indexOf('?', lastPos);if (pos == -1)pos = url_str.indexOf('#', lastPos);if (pos == -1)pos = url_str.length;urlParts['path'] = url_str.substring(lastPos, pos);lastPos = pos;if (url_str.charAt(pos) == '?') {pos = url_str.indexOf('#');pos = (pos == -1) ? url_str.length : pos;urlParts['query'] = url_str.substring(lastPos+1, pos);}lastPos = pos;if (url_str.charAt(pos) == '#') {pos = url_str.length;urlParts['anchor'] = url_str.substring(lastPos+1, pos);}}return urlParts;};TinyMCE.prototype.serializeURL = function(up) {var url = "";if (up['protocol'])url += up['protocol'] + "://";if (up['host'])url += up['host'];if (up['port'])url += ":" + up['port'];if (up['path'])url += up['path'];if (up['query'])url += "?" + up['query'];if (up['anchor'])url += "#" + up['anchor'];return url;};TinyMCE.prototype.convertAbsoluteURLToRelativeURL = function(base_url, url_to_relative) {var baseURL = this.parseURL(base_url);var targetURL = this.parseURL(url_to_relative);var strTok1;var strTok2;var breakPoint = 0;var outPath = "";var forceSlash = false;if (targetURL.path == "")targetURL.path = "/";else
forceSlash = true;base_url = baseURL.path.substring(0, baseURL.path.lastIndexOf('/'));strTok1 = base_url.split('/');strTok2 = targetURL.path.split('/');if (strTok1.length >= strTok2.length) {for (var i=0; i<strTok1.length; i++) {if (i >= strTok2.length || strTok1[i] != strTok2[i]) {breakPoint = i + 1;break;}}}if (strTok1.length < strTok2.length) {for (var i=0; i<strTok2.length; i++) {if (i >= strTok1.length || strTok1[i] != strTok2[i]) {breakPoint = i + 1;break;}}}if (breakPoint == 1)return targetURL.path;for (var i=0; i<(strTok1.length-(breakPoint-1)); i++)outPath += "../";for (var i=breakPoint-1; i<strTok2.length; i++) {if (i != (breakPoint-1))outPath += "/" + strTok2[i];else
outPath += strTok2[i];}targetURL.protocol = null;targetURL.host = null;targetURL.port = null;targetURL.path = outPath == "" && forceSlash ? "/" : outPath;var fileName = baseURL.path;var pos;if ((pos = fileName.lastIndexOf('/')) != -1)fileName = fileName.substring(pos + 1);if (fileName == targetURL.path && targetURL.anchor != "")targetURL.path = "";return this.serializeURL(targetURL);};TinyMCE.prototype.convertRelativeToAbsoluteURL = function(base_url, relative_url) {var baseURL = TinyMCE.prototype.parseURL(base_url);var relURL = TinyMCE.prototype.parseURL(relative_url);if (relative_url == "" || relative_url.charAt(0) == '/' || relative_url.indexOf('://') != -1 || relative_url.indexOf('mailto:') != -1 || relative_url.indexOf('javascript:') != -1)return relative_url;baseURLParts = baseURL['path'].split('/');relURLParts = relURL['path'].split('/');var newBaseURLParts = new Array();for (var i=baseURLParts.length-1; i>=0; i--) {if (baseURLParts[i].length == 0)continue;newBaseURLParts[newBaseURLParts.length] = baseURLParts[i];}baseURLParts = newBaseURLParts.reverse();var newRelURLParts = new Array();var numBack = 0;for (var i=relURLParts.length-1; i>=0; i--) {if (relURLParts[i].length == 0 || relURLParts[i] == ".")continue;if (relURLParts[i] == '..') {numBack++;continue;}if (numBack > 0) {numBack--;continue;}newRelURLParts[newRelURLParts.length] = relURLParts[i];}relURLParts = newRelURLParts.reverse();var len = baseURLParts.length-numBack;var absPath = (len <= 0 ? "" : "/") + baseURLParts.slice(0, len).join('/') + "/" + relURLParts.join('/');var start = "", end = "";relURL.protocol = baseURL.protocol;relURL.host = baseURL.host;relURL.port = baseURL.port;if (relURL.path.charAt(relURL.path.length-1) == "/")absPath += "/";relURL.path = absPath;return TinyMCE.prototype.serializeURL(relURL);};TinyMCE.prototype.getParam = function(name, default_value, strip_whitespace, split_chr) {var value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];if (value == "true" || value == "false")return (value == "true");if (strip_whitespace)value = tinyMCE.regexpReplace(value, "[ \t\r\n]", "");if (typeof(split_chr) != "undefined" && split_chr != null) {value = value.split(split_chr);var outArray = new Array();for (var i=0; i<value.length; i++) {if (value[i] && value[i] != "")outArray[outArray.length] = value[i];}value = outArray;}return value;};TinyMCE.prototype.getLang = function(name, default_value, parse_entities) {var value = (typeof(tinyMCELang[name]) == "undefined") ? default_value : tinyMCELang[name];if (parse_entities)value = tinyMCE.entityDecode(value);return value;};TinyMCE.prototype.entityDecode = function(s) {var e = document.createElement("div");e.innerHTML = s;return e.innerHTML;};TinyMCE.prototype.addToLang = function(prefix, ar) {for (var key in ar) {if (typeof(ar[key]) == 'function')continue;tinyMCELang[(key.indexOf('lang_') == -1 ? 'lang_' : '') + (prefix != '' ? (prefix + "_") : '') + key] = ar[key];}};TinyMCE.prototype.replaceVar = function(replace_haystack, replace_var, replace_str) {var re = new RegExp('{\\\$' + replace_var + '}', 'g');return replace_haystack.replace(re, replace_str);};TinyMCE.prototype.replaceVars = function(replace_haystack, replace_vars) {for (var key in replace_vars) {var value = replace_vars[key];if (typeof(value) == 'function')continue;replace_haystack = tinyMCE.replaceVar(replace_haystack, key, value);}return replace_haystack;};TinyMCE.prototype.triggerNodeChange = function(focus, setup_content) {if (tinyMCE.settings['handleNodeChangeCallback']) {if (tinyMCE.selectedInstance) {var inst = tinyMCE.selectedInstance;var editorId = inst.editorId;var elm = (typeof(setup_content) != "undefined" && setup_content) ? tinyMCE.selectedElement : inst.getFocusElement();var undoIndex = -1;var undoLevels = -1;var anySelection = false;var selectedText = inst.getSelectedText();inst.switchSettings();if (tinyMCE.settings["auto_resize"]) {var doc = inst.getDoc();inst.iframeElement.style.width = doc.body.offsetWidth + "px";inst.iframeElement.style.height = doc.body.offsetHeight + "px";}if (tinyMCE.selectedElement)anySelection = (tinyMCE.selectedElement.nodeName.toLowerCase() == "img") || (selectedText && selectedText.length > 0);if (tinyMCE.settings['custom_undo_redo']) {undoIndex = inst.undoIndex;undoLevels = inst.undoLevels.length;}tinyMCE.executeCallback('handleNodeChangeCallback', '_handleNodeChange', 0, editorId, elm, undoIndex, undoLevels, inst.visualAid, anySelection, setup_content);}}if (this.selectedInstance && (typeof(focus) == "undefined" || focus))this.selectedInstance.contentWindow.focus();};TinyMCE.prototype._customCleanup = function(inst, type, content) {var customCleanup = tinyMCE.settings['cleanup_callback'];if (customCleanup != "" && eval("typeof(" + customCleanup + ")") != "undefined")content = eval(customCleanup + "(type, content, inst);");var plugins = tinyMCE.getParam('plugins', '', true, ',');for (var i=0; i<plugins.length; i++) {if (eval("typeof(TinyMCE_" + plugins[i] +  "_cleanup)") != "undefined")content = eval("TinyMCE_" + plugins[i] +  "_cleanup(type, content, inst);");}return content;};TinyMCE.prototype.getContent = function(editor_id) {if (typeof(editor_id) != "undefined")tinyMCE.selectedInstance = tinyMCE.getInstanceById(editor_id);if (tinyMCE.selectedInstance) {var old = this.selectedInstance.getBody().innerHTML;var html = tinyMCE._cleanupHTML(this.selectedInstance, this.selectedInstance.getDoc(), tinyMCE.settings, this.selectedInstance.getBody(), false, true);tinyMCE.setInnerHTML(this.selectedInstance.getBody(), old);return html;}return null;};TinyMCE.prototype.setContent = function(html_content) {if (tinyMCE.selectedInstance) {tinyMCE.selectedInstance.execCommand('mceSetContent', false, html_content);tinyMCE.selectedInstance.repaint();}};TinyMCE.prototype.importThemeLanguagePack = function(name) {if (typeof(name) == "undefined")name = tinyMCE.settings['theme'];tinyMCE.loadScript(tinyMCE.baseURL + '/themes/' + name + '/langs/' + tinyMCE.settings['language'] + '.js');};TinyMCE.prototype.importPluginLanguagePack = function(name, valid_languages) {var lang = "en";valid_languages = valid_languages.split(',');for (var i=0; i<valid_languages.length; i++) {if (tinyMCE.settings['language'] == valid_languages[i])lang = tinyMCE.settings['language'];}tinyMCE.loadScript(tinyMCE.baseURL + '/plugins/' + name + '/langs/' + lang +  '.js');};TinyMCE.prototype.applyTemplate = function(html, args) {html = tinyMCE.replaceVar(html, "themeurl", tinyMCE.themeURL);if (typeof(args) != "undefined")html = tinyMCE.replaceVars(html, args);html = tinyMCE.replaceVars(html, tinyMCE.settings);html = tinyMCE.replaceVars(html, tinyMCELang);return html;};TinyMCE.prototype.openWindow = function(template, args) {var html, width, height, x, y, resizable, scrollbars, url;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.isMSIE)height += 40;else
height += 20;x = parseInt(screen.width / 2.0) - (width / 2.0);y = parseInt(screen.height / 2.0) - (height / 2.0);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.isMSIE && !tinyMCE.isOpera) && resizable != 'yes' && tinyMCE.settings["dialog_type"] == "modal") {            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();}}};TinyMCE.prototype.closeWindow = function(win) {win.close();};TinyMCE.prototype.getVisualAidClass = function(class_name, state) {var aidClass = tinyMCE.settings['visual_table_class'];if (typeof(state) == "undefined")state = tinyMCE.settings['visual'];var classNames = new Array();var ar = class_name.split(' ');for (var i=0; i<ar.length; i++) {if (ar[i] == aidClass)ar[i] = "";if (ar[i] != "")classNames[classNames.length] = ar[i];}if (state)classNames[classNames.length] = aidClass;var className = "";for (var i=0; i<classNames.length; i++) {if (i > 0)className += " ";className += classNames[i];}return className;};TinyMCE.prototype.handleVisualAid = function(el, deep, state, inst) {if (!el)return;var tableElement = null;switch (el.nodeName) {case "TABLE":var oldW = el.style.width;var oldH = el.style.height;var bo = tinyMCE.getAttrib(el, "border");bo = bo == "" || bo == "0" ? true : false;tinyMCE.setAttrib(el, "class", tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el, "class"), state && bo));el.style.width = oldW;el.style.height = oldH;for (var y=0; y<el.rows.length; y++) {for (var x=0; x<el.rows[y].cells.length; x++) {var cn = tinyMCE.getVisualAidClass(tinyMCE.getAttrib(el.rows[y].cells[x], "class"), state && bo);tinyMCE.setAttrib(el.rows[y].cells[x], "class", cn);}}break;case "A":var anchorName = tinyMCE.getAttrib(el, "name");if (anchorName != '' && state) {el.title = anchorName;el.className = 'mceItemAnchor';} else if (anchorName != '' && !state)el.className = '';break;}if (deep && el.hasChildNodes()) {for (var i=0; i<el.childNodes.length; i++)tinyMCE.handleVisualAid(el.childNodes[i], deep, state, inst);}};TinyMCE.prototype.getAttrib = function(elm, name, default_value) {if (typeof(default_value) == "undefined")default_value = "";if (!elm || elm.nodeType != 1)return default_value;var v = elm.getAttribute(name);if (name == "class" && !v)v = elm.className;if (tinyMCE.isGecko && name == "src" && elm.src != null && elm.src != "")v = elm.src;if (tinyMCE.isGecko && name == "href" && elm.href != null && elm.href != "")v = elm.href;if (name == "style" && !tinyMCE.isOpera)v = elm.style.cssText;return (v && v != "") ? v : default_value;};TinyMCE.prototype.setAttrib = function(element, name, value, fix_value) {if (typeof(value) == "number" && value != null)value = "" + value;if (fix_value) {if (value == null)value = "";var re = new RegExp('[^0-9%]', 'g');value = value.replace(re, '');}if (name == "style")element.style.cssText = value;if (name == "class")element.className = value;if (value != null && value != "" && value != -1)element.setAttribute(name, value);else
element.removeAttribute(name);};TinyMCE.prototype.setStyleAttrib = function(elm, name, value) {eval('elm.style.' + name + '=value;');if (tinyMCE.isMSIE && value == null || value == '') {var str = tinyMCE.serializeStyle(tinyMCE.parseStyle(elm.style.cssText));elm.style.cssText = str;elm.setAttribute("style", str);}};TinyMCE.prototype.convertSpansToFonts = function(doc) {var sizes = tinyMCE.getParam('font_size_style_values').replace(/\s+/, '').split(',');var h = doc.body.innerHTML;h = h.replace(/<span/gi, '<font');h = h.replace(/<\/span/gi, '</font');doc.body.innerHTML = h;var s = doc.getElementsByTagName("font");for (var i=0; i<s.length; i++) {var size = tinyMCE.trim(s[i].style.fontSize).toLowerCase();var fSize = 0;for (var x=0; x<sizes.length; x++) {if (sizes[x] == size) {fSize = x + 1;break;}}if (fSize > 0) {tinyMCE.setAttrib(s[i], 'size', fSize);s[i].style.fontSize = '';}var fFace = s[i].style.fontFamily;if (fFace != null && fFace != "") {tinyMCE.setAttrib(s[i], 'face', fFace);s[i].style.fontFamily = '';}var fColor = s[i].style.color;if (fColor != null && fColor != "") {tinyMCE.setAttrib(s[i], 'color', tinyMCE.convertRGBToHex(fColor));s[i].style.color = '';}}};TinyMCE.prototype.convertFontsToSpans = function(doc) {var sizes = tinyMCE.getParam('font_size_style_values').replace(/\s+/, '').split(',');var h = doc.body.innerHTML;h = h.replace(/<font/gi, '<span');h = h.replace(/<\/font/gi, '</span');doc.body.innerHTML = h;var fsClasses = tinyMCE.getParam('font_size_classes');if (fsClasses != '')fsClasses = fsClasses.replace(/\s+/, '').split(',');else
fsClasses = null;var s = doc.getElementsByTagName("span");for (var i=0; i<s.length; i++) {var fSize, fFace, fColor;fSize = tinyMCE.getAttrib(s[i], 'size');fFace = tinyMCE.getAttrib(s[i], 'face');fColor = tinyMCE.getAttrib(s[i], 'color');if (fSize != "") {fSize = parseInt(fSize);if (fSize > 0 && fSize < 8) {if (fsClasses != null)tinyMCE.setAttrib(s[i], 'class', fsClasses[fSize-1]);else
s[i].style.fontSize = sizes[fSize-1];}s[i].removeAttribute('size');}if (fFace != "") {s[i].style.fontFamily = fFace;s[i].removeAttribute('face');}if (fColor != "") {s[i].style.color = fColor;s[i].removeAttribute('color');}}};TinyMCE.prototype.setInnerHTML = function(e, h) {if (tinyMCE.isMSIE && !tinyMCE.isOpera) {e.innerHTML = tinyMCE.uniqueTag + h;e.firstChild.removeNode(true);} else {h = this.fixGeckoBaseHREFBug(1, e, h);e.innerHTML = h;this.fixGeckoBaseHREFBug(2, e, h);}};TinyMCE.prototype.fixGeckoBaseHREFBug = function(m, e, h) {if (tinyMCE.isGecko) {if (m == 1) {h = h.replace(/\ssrc=/gi, " xsrc=");h = h.replace(/\shref=/gi, " xhref=");return h;} else {if (h.indexOf(' xsrc') != -1) {var n = e.getElementsByTagName("img");for (var i=0; i<n.length; i++) {var xsrc = tinyMCE.getAttrib(n[i], "xsrc");if (xsrc != "") {n[i].src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xsrc);n[i].removeAttribute("xsrc");}}var n = e.getElementsByTagName("select");for (var i=0; i<n.length; i++) {var xsrc = tinyMCE.getAttrib(n[i], "xsrc");if (xsrc != "") {n[i].src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xsrc);n[i].removeAttribute("xsrc");}}var n = e.getElementsByTagName("iframe");for (var i=0; i<n.length; i++) {var xsrc = tinyMCE.getAttrib(n[i], "xsrc");if (xsrc != "") {n[i].src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xsrc);n[i].removeAttribute("xsrc");}}}if (h.indexOf(' xhref') != -1) {var n = e.getElementsByTagName("a");for (var i=0; i<n.length; i++) {var xhref = tinyMCE.getAttrib(n[i], "xhref");if (xhref != "") {n[i].href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], xhref);n[i].removeAttribute("xhref");}}}}}return h;};TinyMCE.prototype.getOuterHTML = function(e) {if (tinyMCE.isMSIE)return e.outerHTML;var d = e.ownerDocument.createElement("body");d.appendChild(e);return d.innerHTML;};TinyMCE.prototype.setOuterHTML = function(doc, e, h) {if (tinyMCE.isMSIE) {e.outerHTML = h;return;}var d = e.ownerDocument.createElement("body");d.innerHTML = h;e.parentNode.replaceChild(d.firstChild, e);};TinyMCE.prototype.insertAfter = function(nc, rc){if (rc.nextSibling)rc.parentNode.insertBefore(nc, rc.nextSibling);else
rc.parentNode.appendChild(nc);};TinyMCE.prototype.cleanupAnchors = function(doc) {var an = doc.getElementsByTagName("a");for (var i=0; i<an.length; i++) {if (tinyMCE.getAttrib(an[i], "name") != "") {var cn = an[i].childNodes;for (var x=cn.length-1; x>=0; x--)tinyMCE.insertAfter(cn[x], an[i]);}}};TinyMCE.prototype._setHTML = function(doc, html_content) {html_content = tinyMCE.cleanupHTMLCode(html_content);try {tinyMCE.setInnerHTML(doc.body, html_content);} catch (e) {if (this.isMSIE)doc.body.createTextRange().pasteHTML(html_content);}if (tinyMCE.isMSIE && tinyMCE.settings['fix_content_duplication']) {var paras = doc.getElementsByTagName("P");for (var i=0; i<paras.length; i++) {var node = paras[i];while ((node = node.parentNode) != null) {if (node.nodeName == "P")node.outerHTML = node.innerHTML;}}var html = doc.body.innerHTML;if (html.indexOf('="mso') != -1) {for (var i=0; i<doc.body.all.length; i++) {var el = doc.body.all[i];el.removeAttribute("className","",0);el.removeAttribute("style","",0);}html = doc.body.innerHTML;html = tinyMCE.regexpReplace(html, "<o:p><\/o:p>", "<br />");html = tinyMCE.regexpReplace(html, "<o:p>&nbsp;<\/o:p>", "");html = tinyMCE.regexpReplace(html, "<st1:.*?>", "");html = tinyMCE.regexpReplace(html, "<p><\/p>", "");html = tinyMCE.regexpReplace(html, "<p><\/p>\r\n<p><\/p>", "");html = tinyMCE.regexpReplace(html, "<p>&nbsp;<\/p>", "<br />");html = tinyMCE.regexpReplace(html, "<p>\s*(<p>\s*)?", "<p>");html = tinyMCE.regexpReplace(html, "<\/p>\s*(<\/p>\s*)?", "</p>");}tinyMCE.setInnerHTML(doc.body, html);}tinyMCE.cleanupAnchors(doc);if (tinyMCE.getParam("convert_fonts_to_spans"))tinyMCE.convertSpansToFonts(doc);};TinyMCE.prototype.getImageSrc = function(str) {var pos = -1;if (!str)return "";if ((pos = str.indexOf('this.src=')) != -1) {var src = str.substring(pos + 10);src = src.substring(0, src.indexOf('\''));return src;}return "";};TinyMCE.prototype._getElementById = function(element_id) {var elm = document.getElementById(element_id);if (!elm) {for (var j=0; j<document.forms.length; j++) {for (var k=0; k<document.forms[j].elements.length; k++) {if (document.forms[j].elements[k].name == element_id) {elm = document.forms[j].elements[k];break;}}}}return elm;};TinyMCE.prototype.getEditorId = function(form_element) {var inst = this.getInstanceById(form_element);if (!inst)return null;return inst.editorId;};TinyMCE.prototype.getInstanceById = function(editor_id) {var inst = this.instances[editor_id];if (!inst) {for (var n in tinyMCE.instances) {var instance = tinyMCE.instances[n];if (!tinyMCE.isInstance(instance))continue;if (instance.formTargetElementId == editor_id) {inst = instance;break;}}}return inst;};TinyMCE.prototype.queryInstanceCommandValue = function(editor_id, command) {var inst = tinyMCE.getInstanceById(editor_id);if (inst)return inst.queryCommandValue(command);return false;};TinyMCE.prototype.queryInstanceCommandState = function(editor_id, command) {var inst = tinyMCE.getInstanceById(editor_id);if (inst)return inst.queryCommandState(command);return null;};TinyMCE.prototype.setWindowArg = function(name, value) {this.windowArgs[name] = value;};TinyMCE.prototype.getWindowArg = function(name, default_value) {return (typeof(this.windowArgs[name]) == "undefined") ? default_value : this.windowArgs[name];};TinyMCE.prototype.getCSSClasses = function(editor_id, doc) {var output = new Array();if (typeof(tinyMCE.cssClasses) != "undefined")return tinyMCE.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 = tinyMCE.isMSIE ? doc.styleSheets : doc.styleSheets;if (styles && styles.length > 0) {for (var x=0; x<styles.length; x++) {var csses = null;eval("try {var csses = tinyMCE.isMSIE ? doc.styleSheets(" + x + ").rules : doc.styleSheets[" + 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++) {if (rules[c].indexOf(' ') != -1 || rules[c].indexOf(':') != -1 || rules[c].indexOf('mceItem') != -1)continue;if (rules[c] == "." + tinyMCE.settings['visual_table_class'])continue;if (rules[c].indexOf('.') != -1) {output[output.length] = rules[c].substring(rules[c].indexOf('.')+1);}}}}}}}if (output.length > 0)tinyMCE.cssClasses = output;return output;};TinyMCE.prototype.regexpReplace = function(in_str, reg_exp, replace_str, opts) {if (in_str == null)return in_str;if (typeof(opts) == "undefined")opts = 'g';var re = new RegExp(reg_exp, opts);return in_str.replace(re, replace_str);};TinyMCE.prototype.trim = function(str) {return str.replace(/^\s*|\s*$/g, "");};TinyMCE.prototype.cleanupEventStr = function(str) {str = "" + str;str = str.replace('function anonymous()\n{\n', '');str = str.replace('\n}', '');str = str.replace(/^return true;/gi, '');return str;};TinyMCE.prototype.getAbsPosition = function(node) {var pos = new Object();pos.absLeft = pos.absTop = 0;var parentNode = node;while (parentNode) {pos.absLeft += parentNode.offsetLeft;pos.absTop += parentNode.offsetTop;parentNode = parentNode.offsetParent;}return pos;};TinyMCE.prototype.getControlHTML = function(control_name) {var themePlugins = tinyMCE.getParam('plugins', '', true, ',');var templateFunction;for (var i=themePlugins.length; i>=0; i--) {templateFunction = 'TinyMCE_' + themePlugins[i] + "_getControlHTML";if (eval("typeof(" + templateFunction + ")") != 'undefined') {var html = eval(templateFunction + "('" + control_name + "');");if (html != "")return tinyMCE.replaceVar(html, "pluginurl", tinyMCE.baseURL + "/plugins/" + themePlugins[i]);}}return eval('TinyMCE_' + tinyMCE.settings['theme'] + "_getControlHTML" + "('" + control_name + "');");};TinyMCE.prototype._themeExecCommand = function(editor_id, element, command, user_interface, value) {var themePlugins = tinyMCE.getParam('plugins', '', true, ',');var templateFunction;for (var i=themePlugins.length; i>=0; i--) {templateFunction = 'TinyMCE_' + themePlugins[i] + "_execCommand";if (eval("typeof(" + templateFunction + ")") != 'undefined') {if (eval(templateFunction + "(editor_id, element, command, user_interface, value);"))return true;}}templateFunction = 'TinyMCE_' + tinyMCE.settings['theme'] + "_execCommand";if (eval("typeof(" + templateFunction + ")") != 'undefined')return eval(templateFunction + "(editor_id, element, command, user_interface, value);");return false;};TinyMCE.prototype._getThemeFunction = function(suffix, skip_plugins) {if (skip_plugins)return 'TinyMCE_' + tinyMCE.settings['theme'] + suffix;var themePlugins = tinyMCE.getParam('plugins', '', true, ',');var templateFunction;for (var i=themePlugins.length; i>=0; i--) {templateFunction = 'TinyMCE_' + themePlugins[i] + suffix;if (eval("typeof(" + templateFunction + ")") != 'undefined')return templateFunction;}return 'TinyMCE_' + tinyMCE.settings['theme'] + suffix;};TinyMCE.prototype.isFunc = function(func_name) {if (func_name == null || func_name == "")return false;return eval("typeof(" + func_name + ")") != "undefined";};TinyMCE.prototype.exec = function(func_name, args) {var str = func_name + '(';for (var i=3; i<args.length; i++) {str += 'args[' + i + ']';if (i < args.length-1)str += ',';}str += ');';return eval(str);};TinyMCE.prototype.executeCallback = function(param, suffix, mode) {switch (mode) {case 0:var state = false;var plugins = tinyMCE.getParam('plugins', '', true, ',');for (var i=0; i<plugins.length; i++) {var func = "TinyMCE_" + plugins[i] + suffix;if (tinyMCE.isFunc(func)) {tinyMCE.exec(func, this.executeCallback.arguments);state = true;}}var func = 'TinyMCE_' + tinyMCE.settings['theme'] + suffix;if (tinyMCE.isFunc(func)) {tinyMCE.exec(func, this.executeCallback.arguments);state = true;}var func = tinyMCE.getParam(param, '');if (tinyMCE.isFunc(func)) {tinyMCE.exec(func, this.executeCallback.arguments);state = true;}return state;case 1:var plugins = tinyMCE.getParam('plugins', '', true, ',');for (var i=0; i<plugins.length; i++) {var func = "TinyMCE_" + plugins[i] + suffix;if (tinyMCE.isFunc(func)) {if (tinyMCE.exec(func, this.executeCallback.arguments))return true;}}var func = 'TinyMCE_' + tinyMCE.settings['theme'] + suffix;if (tinyMCE.isFunc(func)) {if (tinyMCE.exec(func, this.executeCallback.arguments))return true;}var func = tinyMCE.getParam(param, '');if (tinyMCE.isFunc(func)) {if (tinyMCE.exec(func, this.executeCallback.arguments))return true;}return false;}};TinyMCE.prototype.debug = function() {var msg = "";var elm = document.getElementById("tinymce_debug");if (!elm) {var debugDiv = document.createElement("div");debugDiv.setAttribute("className", "debugger");debugDiv.className = "debugger";debugDiv.innerHTML = '\
Debug output:\
<textarea id="tinymce_debug" style="width: 100%; height: 300px" wrap="nowrap"></textarea>';document.body.appendChild(debugDiv);elm = document.getElementById("tinymce_debug");}var args = this.debug.arguments;for (var i=0; i<args.length; i++) {msg += args[i];if (i<args.length-1)msg += ', ';}elm.value += msg + "\n";};function TinyMCEControl(settings) {this.undoLevels = new Array();this.undoIndex = 0;this.typingUndoIndex = -1;this.undoRedo = true;this.isTinyMCEControl = true;this.settings = settings;this.settings['theme'] = tinyMCE.getParam("theme", "default");this.settings['width'] = tinyMCE.getParam("width", -1);this.settings['height'] = tinyMCE.getParam("height", -1);};TinyMCEControl.prototype.repaint = function() {if (tinyMCE.isMSIE && !tinyMCE.isOpera)return;try {this.getBody().style.display = 'none';this.getDoc().execCommand('selectall', false, null);this.getSel().collapseToStart();this.getBody().style.display = 'block';} catch (ex) {}};TinyMCEControl.prototype.switchSettings = function() {if (tinyMCE.configs.length > 1 && tinyMCE.currentConfig != this.settings['index']) {tinyMCE.settings = this.settings;tinyMCE.currentConfig = this.settings['index'];}};TinyMCEControl.prototype.convertAllRelativeURLs = function() {var body = this.getBody();var elms = body.getElementsByTagName("img");for (var i=0; i<elms.length; i++) {var src = tinyMCE.getAttrib(elms[i], 'src');var msrc = tinyMCE.getAttrib(elms[i], 'mce_src');if (msrc != "")src = msrc;if (src != "") {src = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], src);elms[i].setAttribute("src", src);}}var elms = body.getElementsByTagName("a");for (var i=0; i<elms.length; i++) {var href = tinyMCE.getAttrib(elms[i], 'href');var mhref = tinyMCE.getAttrib(elms[i], 'mce_href');if (mhref != "")href = mhref;if (href && href != "") {href = tinyMCE.convertRelativeToAbsoluteURL(tinyMCE.settings['base_href'], href);elms[i].setAttribute("href", href);}}};TinyMCEControl.prototype.getSelectedHTML = function() {if (tinyMCE.isSafari) {return this.getRng().toString();}var elm = document.createElement("body");if (tinyMCE.isGecko)elm.appendChild(this.getRng().cloneContents());else
elm.innerHTML = this.getRng().htmlText;return tinyMCE._cleanupHTML(this, this.contentDocument, this.settings, elm, this.visualAid);};TinyMCEControl.prototype.getBookmark = function() {var rng = this.getRng();if (tinyMCE.isSafari)return rng;if (tinyMCE.isMSIE)return rng;if (tinyMCE.isGecko)return rng.cloneRange();return null;};TinyMCEControl.prototype.moveToBookmark = function(bookmark) {if (tinyMCE.isSafari) {var sel = this.getSel().realSelection;sel.setBaseAndExtent(bookmark.startContainer, bookmark.startOffset, bookmark.endContainer, bookmark.endOffset);return true;}if (tinyMCE.isMSIE)return bookmark.select();if (tinyMCE.isGecko) {var rng = this.getDoc().createRange();var sel = this.getSel();rng.setStart(bookmark.startContainer, bookmark.startOffset);rng.setEnd(bookmark.endContainer, bookmark.endOffset);sel.removeAllRanges();sel.addRange(rng);return true;}return false;};TinyMCEControl.prototype.getSelectedText = function() {if (tinyMCE.isMSIE) {var doc = this.getDoc();if (doc.selection.type == "Text") {var rng = doc.selection.createRange();selectedText = rng.text;} else
selectedText = '';} else {var sel = this.getSel();if (sel && sel.toString)selectedText = sel.toString();else
selectedText = '';}return selectedText;};TinyMCEControl.prototype.selectNode = function(node, collapse, select_text_node, to_start) {if (!node)return;if (typeof(collapse) == "undefined")collapse = true;if (typeof(select_text_node) == "undefined")select_text_node = false;if (typeof(to_start) == "undefined")to_start = true;if (tinyMCE.isMSIE) {var rng = this.getBody().createTextRange();try {rng.moveToElementText(node);if (collapse)rng.collapse(to_start);rng.select();} catch (e) {}} else {var sel = this.getSel();if (!sel)return;if (tinyMCE.isSafari) {sel.realSelection.setBaseAndExtent(node, 0, node, node.innerText.length);if (collapse) {if (to_start)sel.realSelection.collapseToStart();else
sel.realSelection.collapseToEnd();}this.scrollToNode(node);return;}var rng = this.getDoc().createRange();if (select_text_node) {var nodes = tinyMCE.getNodeTree(node, new Array(), 3);if (nodes.length > 0)rng.selectNodeContents(nodes[0]);else
rng.selectNodeContents(node);} else
rng.selectNode(node);if (collapse) {if (!to_start && node.nodeType == 3) {rng.setStart(node, node.nodeValue.length);rng.setEnd(node, node.nodeValue.length);} else
rng.collapse(to_start);}sel.removeAllRanges();sel.addRange(rng);}this.scrollToNode(node);tinyMCE.selectedElement = null;if (node.nodeType == 1)tinyMCE.selectedElement = node;};TinyMCEControl.prototype.scrollToNode = function(node) {var pos = tinyMCE.getAbsPosition(node);var doc = this.getDoc();var scrollX = doc.body.scrollLeft + doc.documentElement.scrollLeft;var scrollY = doc.body.scrollTop + doc.documentElement.scrollTop;var height = tinyMCE.isMSIE ? document.getElementById(this.editorId).style.pixelHeight : this.targetElement.clientHeight;if (!tinyMCE.settings['auto_resize'] && !(pos.absTop > scrollY && pos.absTop < (scrollY - 25 + height)))this.contentWindow.scrollTo(pos.absLeft, pos.absTop - height + 25); 
};TinyMCEControl.prototype.getBody = function() {return this.getDoc().body;};TinyMCEControl.prototype.getDoc = function() {return this.contentWindow.document;};TinyMCEControl.prototype.getWin = function() {return this.contentWindow;};TinyMCEControl.prototype.getSel = function() {if (tinyMCE.isMSIE && !tinyMCE.isOpera)return this.getDoc().selection;var sel = this.contentWindow.getSelection();if (tinyMCE.isSafari && !sel.getRangeAt) {var newSel = new Object();var doc = this.getDoc();function getRangeAt(idx) {var rng = new Object();rng.startContainer = this.focusNode;rng.endContainer = this.anchorNode;rng.commonAncestorContainer = this.focusNode;rng.createContextualFragment = function (html) {if (html.charAt(0) == '<') {var elm = doc.createElement("div");elm.innerHTML = html;return elm.firstChild;}return doc.createTextNode("UNSUPPORTED, DUE TO LIMITATIONS IN SAFARI!");};rng.deleteContents = function () {doc.execCommand("Delete", false, "");};return rng;}newSel.focusNode = sel.baseNode;newSel.focusOffset = sel.baseOffset;newSel.anchorNode = sel.extentNode;newSel.anchorOffset = sel.extentOffset;newSel.getRangeAt = getRangeAt;newSel.text = "" + sel;newSel.realSelection = sel;newSel.toString = function () {return this.text;};return newSel;}return sel;};TinyMCEControl.prototype.getRng = function() {var sel = this.getSel();if (sel == null)return null;if (tinyMCE.isMSIE && !tinyMCE.isOpera)return sel.createRange();if (tinyMCE.isSafari) {var rng = this.getDoc().createRange();var sel = this.getSel().realSelection;rng.setStart(sel.baseNode, sel.baseOffset);rng.setEnd(sel.extentNode, sel.extentOffset);return rng;}return this.getSel().getRangeAt(0);};TinyMCEControl.prototype._insertPara = function(e) {function isEmpty(para) {function isEmptyHTML(html) {return html.replace(new RegExp('[ \t\r\n]+', 'g'), '').toLowerCase() == "";}if (para.getElementsByTagName("img").length > 0)return false;if (para.getElementsByTagName("table").length > 0)return false;if (para.getElementsByTagName("hr").length > 0)return false;var nodes = tinyMCE.getNodeTree(para, new Array(), 3);for (var i=0; i<nodes.length; i++) {if (!isEmptyHTML(nodes[i].nodeValue))return false;}return true;}var doc = this.getDoc();var sel = this.getSel();var win = this.contentWindow;var rng = sel.getRangeAt(0);var body = doc.body;var rootElm = doc.documentElement;var self = this;var blockName = "P";var rngBefore = doc.createRange();rngBefore.setStart(sel.anchorNode, sel.anchorOffset);rngBefore.collapse(true);var rngAfter = doc.createRange();rngAfter.setStart(sel.focusNode, sel.focusOffset);rngAfter.collapse(true);var direct = rngBefore.compareBoundaryPoints(rngBefore.START_TO_END, rngAfter) < 0;var startNode = direct ? sel.anchorNode : sel.focusNode;var startOffset = direct ? sel.anchorOffset : sel.focusOffset;var endNode = direct ? sel.focusNode : sel.anchorNode;var endOffset = direct ? sel.focusOffset : sel.anchorOffset;startNode = startNode.nodeName == "BODY" ? startNode.firstChild : startNode;endNode = endNode.nodeName == "BODY" ? endNode.firstChild : endNode;var startBlock = tinyMCE.getParentBlockElement(startNode);var endBlock = tinyMCE.getParentBlockElement(endNode);if (startBlock != null) {blockName = startBlock.nodeName;if (blockName == "TD" || blockName == "TABLE" || (blockName == "DIV" && new RegExp('left|right', 'gi').test(startBlock.style.cssFloat)))blockName = "P";}if (tinyMCE.getParentElement(startBlock, "OL,UL") != null)return false;if ((startBlock != null && startBlock.nodeName == "TABLE") || (endBlock != null && endBlock.nodeName == "TABLE"))startBlock = endBlock = null;var paraBefore = (startBlock != null && startBlock.nodeName == blockName) ? startBlock.cloneNode(false) : doc.createElement(blockName);var paraAfter = (endBlock != null && endBlock.nodeName == blockName) ? endBlock.cloneNode(false) : doc.createElement(blockName);if (/^(H[1-6])$/.test(blockName))paraAfter = doc.createElement("p");var startChop = startNode;var endChop = endNode;node = startChop;do {if (node == body || node.nodeType == 9 || tinyMCE.isBlockElement(node))break;startChop = node;} while ((node = node.previousSibling ? node.previousSibling : node.parentNode));node = endChop;do {if (node == body || node.nodeType == 9 || tinyMCE.isBlockElement(node))break;endChop = node;} while ((node = node.nextSibling ? node.nextSibling : node.parentNode));if (startChop.nodeName == "TD")startChop = startChop.firstChild;if (endChop.nodeName == "TD")endChop = endChop.lastChild;if (startBlock == null) {rng.deleteContents();sel.removeAllRanges();if (startChop != rootElm && endChop != rootElm) {rngBefore = rng.cloneRange();if (startChop == body)rngBefore.setStart(startChop, 0);else
rngBefore.setStartBefore(startChop);paraBefore.appendChild(rngBefore.cloneContents());if (endChop.parentNode.nodeName == blockName)endChop = endChop.parentNode;rng.setEndAfter(endChop);if (endChop.nodeName != "#text" && endChop.nodeName != "BODY")rngBefore.setEndAfter(endChop);var contents = rng.cloneContents();if (contents.firstChild && (contents.firstChild.nodeName == blockName || contents.firstChild.nodeName == "BODY"))paraAfter.innerHTML = contents.firstChild.innerHTML;else
paraAfter.appendChild(contents);if (isEmpty(paraBefore))paraBefore.innerHTML = "&nbsp;";if (isEmpty(paraAfter))paraAfter.innerHTML = "&nbsp;";rng.deleteContents();rngAfter.deleteContents();rngBefore.deleteContents();paraAfter.normalize();rngBefore.insertNode(paraAfter);paraBefore.normalize();rngBefore.insertNode(paraBefore);} else {body.innerHTML = "<" + blockName + ">&nbsp;</" + blockName + "><" + blockName + ">&nbsp;</" + blockName + ">";paraAfter = body.childNodes[1];}this.selectNode(paraAfter, true, true);return true;}if (startChop.nodeName == blockName)rngBefore.setStart(startChop, 0);else
rngBefore.setStartBefore(startChop);rngBefore.setEnd(startNode, startOffset);paraBefore.appendChild(rngBefore.cloneContents());rngAfter.setEndAfter(endChop);rngAfter.setStart(endNode, endOffset);var contents = rngAfter.cloneContents();if (contents.firstChild && contents.firstChild.nodeName == blockName) {paraAfter.innerHTML = contents.firstChild.innerHTML;} else
paraAfter.appendChild(contents);if (isEmpty(paraBefore))paraBefore.innerHTML = "&nbsp;";if (isEmpty(paraAfter))paraAfter.innerHTML = "&nbsp;";var rng = doc.createRange();if (!startChop.previousSibling && startChop.parentNode.nodeName.toUpperCase() == blockName) {rng.setStartBefore(startChop.parentNode);} else {if (rngBefore.startContainer.nodeName.toUpperCase() == blockName && rngBefore.startOffset == 0)rng.setStartBefore(rngBefore.startContainer);else
rng.setStart(rngBefore.startContainer, rngBefore.startOffset);}if (!endChop.nextSibling && endChop.parentNode.nodeName.toUpperCase() == blockName)rng.setEndAfter(endChop.parentNode);else
rng.setEnd(rngAfter.endContainer, rngAfter.endOffset);rng.deleteContents();rng.insertNode(paraAfter);rng.insertNode(paraBefore);paraAfter.normalize();paraBefore.normalize();this.selectNode(paraAfter, true, true);return true;};TinyMCEControl.prototype._handleBackSpace = function(evt_type) {var doc = this.getDoc();var sel = this.getSel();if (sel == null)return false;var rng = sel.getRangeAt(0);var node = rng.startContainer;var elm = node.nodeType == 3 ? node.parentNode : node;if (node == null)return;if (elm && elm.nodeName == "") {var para = doc.createElement("p");while (elm.firstChild)para.appendChild(elm.firstChild);elm.parentNode.insertBefore(para, elm);elm.parentNode.removeChild(elm);var rng = rng.cloneRange();rng.setStartBefore(node.nextSibling);rng.setEndAfter(node.nextSibling);rng.extractContents();this.selectNode(node.nextSibling, true, true);}var para = tinyMCE.getParentBlockElement(node);if (para != null && para.nodeName.toLowerCase() == 'p' && evt_type == "keypress") {var htm = para.innerHTML;var block = tinyMCE.getParentBlockElement(node);if (htm == "" || htm == "&nbsp;" || block.nodeName.toLowerCase() == "li") {var prevElm = para.previousSibling;while (prevElm != null && prevElm.nodeType != 1)prevElm = prevElm.previousSibling;if (prevElm == null)return false;var nodes = tinyMCE.getNodeTree(prevElm, new Array(), 3);var lastTextNode = nodes.length == 0 ? null : nodes[nodes.length-1];if (lastTextNode != null)this.selectNode(lastTextNode, true, false, false);para.parentNode.removeChild(para);return true;}}return false;};TinyMCEControl.prototype._insertSpace = function() {return true;};TinyMCEControl.prototype.autoResetDesignMode = function() {if (!tinyMCE.isMSIE && tinyMCE.settings['auto_reset_designmode'] && this.isHidden())eval('try { this.getDoc().designMode = "On"; } catch(e) {}');};TinyMCEControl.prototype.isHidden = function() {if (tinyMCE.isMSIE)return false;var sel = this.getSel();return (!sel || !sel.rangeCount || sel.rangeCount == 0);};TinyMCEControl.prototype.isDirty = function() {return this.startContent != tinyMCE.trim(this.getBody().innerHTML) && !tinyMCE.isNotDirty;};TinyMCEControl.prototype._mergeElements = function(scmd, pa, ch, override) {if (scmd == "removeformat") {pa.className = "";pa.style.cssText = "";ch.className = "";ch.style.cssText = "";return;}var st = tinyMCE.parseStyle(tinyMCE.getAttrib(pa, "style"));var stc = tinyMCE.parseStyle(tinyMCE.getAttrib(ch, "style"));var className = tinyMCE.getAttrib(pa, "class");className += " " + tinyMCE.getAttrib(ch, "class");if (override) {for (var n in st) {if (typeof(st[n]) == 'function')continue;stc[n] = st[n];}} else {for (var n in stc) {if (typeof(stc[n]) == 'function')continue;st[n] = stc[n];}}tinyMCE.setAttrib(pa, "style", tinyMCE.serializeStyle(st));tinyMCE.setAttrib(pa, "class", tinyMCE.trim(className));ch.className = "";ch.style.cssText = "";ch.removeAttribute("class");ch.removeAttribute("style");};TinyMCEControl.prototype.setUseCSS = function(b) {var doc = this.getDoc();try {doc.execCommand("useCSS", false, !b);} catch (ex) {}try {doc.execCommand("styleWithCSS", false, b);} catch (ex) {}if (!tinyMCE.getParam("table_inline_editing"))try {doc.execCommand('enableInlineTableEditing', false, "false");} catch (ex) {}if (!tinyMCE.getParam("object_resizing"))try {doc.execCommand('enableObjectResizing', false, "false");} catch (ex) {}};TinyMCEControl.prototype.execCommand = function(command, user_interface, value) {var doc = this.getDoc();var win = this.getWin();var focusElm = this.getFocusElement();if (this.lastSafariSelection && !new RegExp('mceStartTyping|mceEndTyping|mceBeginUndoLevel|mceEndUndoLevel|mceAddUndoLevel', 'gi').test(command)) {this.moveToBookmark(this.lastSafariSelection);tinyMCE.selectedElement = this.lastSafariSelectedElement;}if (!tinyMCE.isMSIE && !this.useCSS) {this.setUseCSS(false);this.useCSS = true;}this.contentDocument = doc;if (tinyMCE._themeExecCommand(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.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.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.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 "mceStoreSelection":this.selectionBookmark = this.getBookmark();return true;case "mceRestoreSelection":this.moveToBookmark(this.selectionBookmark);return true;case "InsertUnorderedList":case "InsertOrderedList":var tag = (command == "InsertUnorderedList") ? "ul" : "ol";if (tinyMCE.isSafari)this.execCommand("mceInsertContent", false, "<" + tag + "><li>&nbsp;</li><" + tag + ">");else
this.getDoc().execCommand(command, user_interface, value);tinyMCE.triggerNodeChange();break;case "Strikethrough":if (tinyMCE.isSafari)this.execCommand("mceInsertContent", false, "<strike>" + this.getSelectedHTML() + "</strike>");else
this.getDoc().execCommand(command, user_interface, value);tinyMCE.triggerNodeChange();break;case "mceSelectNode":this.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");if (elm)this.execCommand("mceRemoveNode", false, elm);} else
this.getDoc().execCommand("FormatBlock", false, value);tinyMCE.triggerNodeChange();break;case "mceRemoveNode":if (!value)value = tinyMCE.getParentElement(this.getFocusElement());if (tinyMCE.isMSIE) {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.selectNode(parentNode, false);tinyMCE.triggerNodeChange();tinyMCE.selectedNode = parentNode;return;}parentNode = parentNode.parentNode;}break;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.isMSIE) {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 || (/td|tr|tbody|table/ig.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 {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.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":this.getDoc().execCommand('forecolor', false, value);break;case "HiliteColor":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.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);tinyMCE._setHTML(doc, value);tinyMCE.setInnerHTML(doc.body, tinyMCE._cleanupHTML(this, doc, tinyMCE.settings, doc.body));this.convertAllRelativeURLs();tinyMCE.handleVisualAid(doc.body, true, this.visualAid, this);tinyMCE._setEventsEnabled(doc.body, false);return true;case "mceLink":var selectedText = "";if (tinyMCE.isMSIE) {var rng = doc.selection.createRange();selectedText = rng.text;} else
selectedText = this.getSel().toString();if (!tinyMCE.linkElement) {if ((tinyMCE.selectedElement.nodeName.toLowerCase() != "img") && (selectedText.length <= 0))return;}var href = "", target = "", title = "", onclick = "", action = "insert", style_class = "";if (tinyMCE.selectedElement.nodeName.toLowerCase() == "a")tinyMCE.linkElement = tinyMCE.selectedElement;if (tinyMCE.linkElement != null && tinyMCE.getAttrib(tinyMCE.linkElement, 'href') == "")tinyMCE.linkElement = null;if (tinyMCE.linkElement) {href = tinyMCE.getAttrib(tinyMCE.linkElement, 'href');target = tinyMCE.getAttrib(tinyMCE.linkElement, 'target');title = tinyMCE.getAttrib(tinyMCE.linkElement, 'title');                onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');style_class = tinyMCE.getAttrib(tinyMCE.linkElement, 'class');if (onclick == "")onclick = tinyMCE.getAttrib(tinyMCE.linkElement, 'onclick');onclick = tinyMCE.cleanupEventStr(onclick);href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");mceRealHref = tinyMCE.getAttrib(tinyMCE.linkElement, 'mce_href');if (mceRealHref != "") {href = mceRealHref;if (tinyMCE.getParam('convert_urls'))href = eval(tinyMCE.settings['urlconverter_callback'] + "(href, tinyMCE.linkElement, true);");}action = "update";}if (this.settings['insertlink_callback']) {var returnVal = eval(this.settings['insertlink_callback'] + "(href, target, title, onclick, action, style_class);");if (returnVal && returnVal['href'])tinyMCE.insertLink(returnVal['href'], returnVal['target'], returnVal['title'], returnVal['onclick'], returnVal['style_class']);} else {tinyMCE.openWindow(this.insertLinkTemplate, {href : href, target : target, title : title, onclick : onclick, action : action, className : style_class, inline : "yes"});}break;case "mceImage":var src = "", alt = "", border = "", hspace = "", vspace = "", width = "", height = "", align = "";var title = "", onmouseover = "", onmouseout = "", action = "insert";var img = tinyMCE.imgElement;if (tinyMCE.selectedElement != null && tinyMCE.selectedElement.nodeName.toLowerCase() == "img") {img = tinyMCE.selectedElement;tinyMCE.imgElement = img;}if (img) {if (tinyMCE.getAttrib(img, 'name').indexOf('mce_') == 0)return;src = tinyMCE.getAttrib(img, 'src');alt = tinyMCE.getAttrib(img, 'alt');if (alt == "")alt = tinyMCE.getAttrib(img, 'title');if (tinyMCE.isGecko) {var w = img.style.width;if (w != null && w != "")img.setAttribute("width", w);var h = img.style.height;if (h != null && h != "")img.setAttribute("height", h);}border = tinyMCE.getAttrib(img, 'border');hspace = tinyMCE.getAttrib(img, 'hspace');vspace = tinyMCE.getAttrib(img, 'vspace');width = tinyMCE.getAttrib(img, 'width');height = tinyMCE.getAttrib(img, 'height');align = tinyMCE.getAttrib(img, 'align');                onmouseover = tinyMCE.getAttrib(img, 'onmouseover');                onmouseout = tinyMCE.getAttrib(img, 'onmouseout');                title = tinyMCE.getAttrib(img, 'title');if (tinyMCE.isMSIE) {width = img.attributes['width'].specified ? width : "";height = img.attributes['height'].specified ? height : "";}onmouseover = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseover));onmouseout = tinyMCE.getImageSrc(tinyMCE.cleanupEventStr(onmouseout));src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");mceRealSrc = tinyMCE.getAttrib(img, 'mce_src');if (mceRealSrc != "") {src = mceRealSrc;if (tinyMCE.getParam('convert_urls'))src = eval(tinyMCE.settings['urlconverter_callback'] + "(src, img, true);");}if (onmouseover != "")onmouseover = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseover, img, true);");if (onmouseout != "")onmouseout = eval(tinyMCE.settings['urlconverter_callback'] + "(onmouseout, img, true);");action = "update";}if (this.settings['insertimage_callback']) {var returnVal = eval(this.settings['insertimage_callback'] + "(src, alt, border, hspace, vspace, width, height, align, title, onmouseover, onmouseout, action);");if (returnVal && returnVal['src'])tinyMCE.insertImage(returnVal['src'], returnVal['alt'], returnVal['border'], returnVal['hspace'], returnVal['vspace'], returnVal['width'], returnVal['height'], returnVal['align'], returnVal['title'], returnVal['onmouseover'], returnVal['onmouseout']);} else
tinyMCE.openWindow(this.insertImageTemplate, {src : src, alt : alt, border : border, hspace : hspace, vspace : vspace, width : width, height : height, align : align, title : title, onmouseover : onmouseover, onmouseout : onmouseout, action : action, inline : "yes"});break;case "mceCleanup":tinyMCE._setHTML(this.contentDocument, this.getBody().innerHTML);tinyMCE.setInnerHTML(this.getBody(), tinyMCE._cleanupHTML(this, this.contentDocument, this.settings, this.getBody(), this.visualAid));this.convertAllRelativeURLs();tinyMCE.handleVisualAid(this.getBody(), true, this.visualAid, this);tinyMCE._setEventsEnabled(this.getBody(), false);this.repaint();tinyMCE.triggerNodeChange();break;case "mceReplaceContent":this.getWin().focus();var selectedText = "";if (tinyMCE.isMSIE) {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("SetStyleInfo", 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.getDoc().body.scrollLeft + this.getDoc().documentElement.scrollLeft;var scrollY = this.getDoc().body.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":var insertHTMLFailed = false;this.getWin().focus();if (tinyMCE.isOpera && insertHTMLFailed) {this.getDoc().execCommand("insertimage", false, tinyMCE.uniqueURL);var ar = tinyMCE.getElementsByAttributeValue(this.getBody(), "img", "src", tinyMCE.uniqueURL);ar[0].outerHTML = value;return;}if (!tinyMCE.isMSIE) {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);} else {var rng = doc.selection.createRange();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.triggerNodeChange();break;case "mceStartTyping":if (tinyMCE.settings['custom_undo_redo'] && this.typingUndoIndex == -1) {this.typingUndoIndex = this.undoIndex;this.execCommand('mceAddUndoLevel');}break;case "mceEndTyping":if (tinyMCE.settings['custom_undo_redo'] && this.typingUndoIndex != -1) {this.execCommand('mceAddUndoLevel');this.typingUndoIndex = -1;}break;case "mceBeginUndoLevel":this.undoRedo = false;break;case "mceEndUndoLevel":this.undoRedo = true;this.execCommand('mceAddUndoLevel');break;case "mceAddUndoLevel":if (tinyMCE.settings['custom_undo_redo'] && this.undoRedo) {if (this.typingUndoIndex != -1) {this.undoIndex = this.typingUndoIndex;}var newHTML = tinyMCE.trim(this.getBody().innerHTML);if (newHTML != this.undoLevels[this.undoIndex]) {tinyMCE.executeCallback('onchange_callback', '_onchange', 0, this);var customUndoLevels = tinyMCE.settings['custom_undo_redo_levels'];if (customUndoLevels != -1 && this.undoLevels.length > customUndoLevels) {for (var i=0; i<this.undoLevels.length-1; i++) {this.undoLevels[i] = this.undoLevels[i+1];}this.undoLevels.length--;this.undoIndex--;}this.undoIndex++;this.undoLevels[this.undoIndex] = newHTML;this.undoLevels.length = this.undoIndex + 1;tinyMCE.triggerNodeChange(false);}}break;case "Undo":if (tinyMCE.settings['custom_undo_redo']) {tinyMCE.execCommand("mceEndTyping");if (this.undoIndex > 0) {this.undoIndex--;tinyMCE.setInnerHTML(this.getBody(), this.undoLevels[this.undoIndex]);this.repaint();}tinyMCE.triggerNodeChange();} else
this.getDoc().execCommand(command, user_interface, value);break;case "Redo":if (tinyMCE.settings['custom_undo_redo']) {tinyMCE.execCommand("mceEndTyping");if (this.undoIndex < (this.undoLevels.length-1)) {this.undoIndex++;tinyMCE.setInnerHTML(this.getBody(), this.undoLevels[this.undoIndex]);this.repaint();}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.isMSIE) {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":var text = this.getSelectedText();if (tinyMCE.isOpera) {this.getDoc().execCommand("RemoveFormat", false, null);return;}if (tinyMCE.isMSIE) {try {var rng = doc.selection.createRange();rng.execCommand("RemoveFormat", false, null);} catch (e) {}this.execCommand("SetStyleInfo", false, {command : "removeformat"});} else {this.getDoc().execCommand(command, user_interface, value);this.execCommand("SetStyleInfo", 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");};TinyMCEControl.prototype.queryCommandValue = function(command) {try {return this.getDoc().queryCommandValue(command);} catch (ex) {return null;}};TinyMCEControl.prototype.queryCommandState = function(command) {return this.getDoc().queryCommandState(command);};TinyMCEControl.prototype.onAdd = function(replace_element, form_element_name, target_document) {var targetDoc = target_document ? target_document : document;this.targetDoc = targetDoc;tinyMCE.themeURL = tinyMCE.baseURL + "/themes/" + this.settings['theme'];this.settings['themeurl'] = tinyMCE.themeURL;if (!replace_element) {alert("Error: Could not find the target element.");return false;}var templateFunction = tinyMCE._getThemeFunction('_getInsertLinkTemplate');if (eval("typeof(" + templateFunction + ")") != 'undefined')this.insertLinkTemplate = eval(templateFunction + '(this.settings);');var templateFunction = tinyMCE._getThemeFunction('_getInsertImageTemplate');if (eval("typeof(" + templateFunction + ")") != 'undefined')this.insertImageTemplate = eval(templateFunction + '(this.settings);');var templateFunction = tinyMCE._getThemeFunction('_getEditorTemplate');if (eval("typeof(" + templateFunction + ")") == 'undefined') {alert("Error: Could not find the template function: " + templateFunction);return false;}var editorTemplate = eval(templateFunction + '(this.settings, this.editorId);');var deltaWidth = editorTemplate['delta_width'] ? editorTemplate['delta_width'] : 0;var deltaHeight = editorTemplate['delta_height'] ? editorTemplate['delta_height'] : 0;var html = '<span id="' + this.editorId + '_parent">' + editorTemplate['html'];var templateFunction = tinyMCE._getThemeFunction('_handleNodeChange', true);if (eval("typeof(" + templateFunction + ")") != 'undefined')this.settings['handleNodeChangeCallback'] = templateFunction;html = tinyMCE.replaceVar(html, "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'] = replace_element.offsetWidth;if (this.settings['height'] == -1)this.settings['height'] = replace_element.offsetHeight;if (this.settings['width'] == 0)this.settings['width'] = replace_element.style.width;if (this.settings['height'] == 0)this.settings['height'] = replace_element.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'] += deltaWidth;this.settings['area_height'] += deltaHeight;if (("" + this.settings['width']).indexOf('%') != -1)this.settings['area_width'] = "100%";if (("" + this.settings['height']).indexOf('%') != -1)this.settings['area_height'] = "100%";if (("" + replace_element.style.width).indexOf('%') != -1) {this.settings['width'] = replace_element.style.width;this.settings['area_width'] = "100%";}if (("" + replace_element.style.height).indexOf('%') != -1) {this.settings['height'] = replace_element.style.height;this.settings['area_height'] = "100%";}html = tinyMCE.applyTemplate(html);this.settings['width'] = this.settings['old_width'];this.settings['height'] = this.settings['old_height'];this.visualAid = this.settings['visual'];this.formTargetElementId = form_element_name;if (replace_element.nodeName == "TEXTAREA" || replace_element.nodeName == "INPUT")this.startContent = replace_element.value;else
this.startContent = replace_element.innerHTML;if (replace_element.nodeName.toLowerCase() != "textarea") {this.oldTargetElement = replace_element.cloneNode(true);if (tinyMCE.settings['debug'])html += '<textarea wrap="off" id="' + form_element_name + '" name="' + form_element_name + '" cols="100" rows="15"></textarea>';else
html += '<input type="hidden" type="text" id="' + form_element_name + '" name="' + form_element_name + '" />';html += '</span>';if (!tinyMCE.isMSIE) {var rng = replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);var fragment = rng.createContextualFragment(html);replace_element.parentNode.replaceChild(fragment, replace_element);} else
replace_element.outerHTML = html;} else {html += '</span>';this.oldTargetElement = replace_element;if (!tinyMCE.settings['debug'])this.oldTargetElement.style.display = "none";if (!tinyMCE.isMSIE) {var rng = replace_element.ownerDocument.createRange();rng.setStartBefore(replace_element);var fragment = rng.createContextualFragment(html);if (tinyMCE.isGecko)tinyMCE.insertAfter(fragment, replace_element);else
replace_element.parentNode.insertBefore(fragment, replace_element);} else
replace_element.insertAdjacentHTML("beforeBegin", html);}var dynamicIFrame = false;var tElm = targetDoc.getElementById(this.editorId);if (!tinyMCE.isMSIE) {if (tElm && tElm.nodeName.toLowerCase() == "span") {tElm = tinyMCE._createIFrame(tElm);dynamicIFrame = true;}this.targetElement = tElm;this.iframeElement = tElm;this.contentDocument = tElm.contentDocument;this.contentWindow = tElm.contentWindow;} else {if (tElm && tElm.nodeName.toLowerCase() == "span")tElm = tinyMCE._createIFrame(tElm);else
tElm = targetDoc.frames[this.editorId];this.targetElement = tElm;this.iframeElement = targetDoc.getElementById(this.editorId);if (tinyMCE.isOpera) {this.contentDocument = this.iframeElement.contentDocument;this.contentWindow = this.iframeElement.contentWindow;dynamicIFrame = true;} else {this.contentDocument = tElm.window.document;this.contentWindow = tElm.window;}this.getDoc().designMode = "on";}var doc = this.contentDocument;if (dynamicIFrame) {var html = 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";doc.open();doc.write(html);doc.close();} catch (e) {this.getDoc().location.href = tinyMCE.baseURL + "/blank.htm";}}if (tinyMCE.isMSIE)window.setTimeout("TinyMCE.prototype.addEventHandlers('" + this.editorId + "');", 1);tinyMCE.setupContent(this.editorId, true);return true;};TinyMCEControl.prototype.getFocusElement = function() {if (tinyMCE.isMSIE && !tinyMCE.isOpera) {var doc = this.getDoc();var rng = doc.selection.createRange();var elm = rng.item ? rng.item(0) : rng.parentElement();} else {if (this.isHidden())return this.getBody();var sel = this.getSel();var rng = this.getRng();var elm = rng.commonAncestorContainer;if (!rng.collapsed) {if (rng.startContainer == rng.endContainer) {if (rng.startOffset - rng.endOffset < 2) {if (rng.startContainer.hasChildNodes())elm = rng.startContainer.childNodes[rng.startOffset];}}}elm = tinyMCE.getParentElement(elm);}return elm;};var tinyMCE = new TinyMCE();var tinyMCELang = new Array();


/* WP cancels all TinyMCE language and import handling */
TinyMCE.prototype.importThemeLanguagePack = function() {};
TinyMCE.prototype.importPluginLanguagePack = function() {};

TinyMCE.prototype.loadScript = function() {};
 tinyMCE.importThemeLanguagePack('advanced');var TinyMCE_advanced_autoImportCSSClasses=true;var TinyMCE_advanced_resizer=new Object();var TinyMCE_advanced_buttons=[['bold','{$lang_bold_img}','{$lang_bold_desc}','Bold'],['italic','{$lang_italic_img}','{$lang_italic_desc}','Italic'],['underline','{$lang_underline_img}','{$lang_underline_desc}','Underline'],['strikethrough','strikethrough.gif','{$lang_striketrough_desc}','Strikethrough'],['justifyleft','left.gif','{$lang_justifyleft_desc}','JustifyLeft'],['justifycenter','center.gif','{$lang_justifycenter_desc}','JustifyCenter'],['justifyright','right.gif','{$lang_justifyright_desc}','JustifyRight'],['justifyfull','full.gif','{$lang_justifyfull_desc}','JustifyFull'],['bullist','bullist.gif','{$lang_bullist_desc}','InsertUnorderedList'],['numlist','numlist.gif','{$lang_numlist_desc}','InsertOrderedList'],['outdent','outdent.gif','{$lang_outdent_desc}','Outdent'],['indent','indent.gif','{$lang_indent_desc}','Indent'],['cut','cut.gif','{$lang_cut_desc}','Cut'],['copy','copy.gif','{$lang_copy_desc}','Copy'],['paste','paste.gif','{$lang_paste_desc}','Paste'],['undo','undo.gif','{$lang_undo_desc}','Undo'],['redo','redo.gif','{$lang_redo_desc}','Redo'],['link','link.gif','{$lang_link_desc}','mceLink',true],['unlink','unlink.gif','{$lang_unlink_desc}','unlink'],['image','image.gif','{$lang_image_desc}','mceImage',true],['cleanup','cleanup.gif','{$lang_cleanup_desc}','mceCleanup'],['help','help.gif','{$lang_help_desc}','mceHelp'],['code','code.gif','{$lang_theme_code_desc}','mceCodeEditor'],['hr','hr.gif','{$lang_theme_hr_desc}','inserthorizontalrule'],['removeformat','removeformat.gif','{$lang_theme_removeformat_desc}','removeformat'],['sub','sub.gif','{$lang_theme_sub_desc}','subscript'],['sup','sup.gif','{$lang_theme_sup_desc}','superscript'],['forecolor','forecolor.gif','{$lang_theme_forecolor_desc}','mceForeColor',true],['backcolor','backcolor.gif','{$lang_theme_backcolor_desc}','mceBackColor',true],['charmap','charmap.gif','{$lang_theme_charmap_desc}','mceCharMap'],['visualaid','visualaid.gif','{$lang_theme_visualaid_desc}','mceToggleVisualAid'],['anchor','anchor.gif','{$lang_theme_anchor_desc}','mceInsertAnchor'],['newdocument','newdocument.gif','{$lang_newdocument_desc}','mceNewDocument']];function TinyMCE_advanced_getControlHTML(button_name){var buttonTileMap=new Array('anchor.gif','backcolor.gif','bullist.gif','center.gif','charmap.gif','cleanup.gif','code.gif','copy.gif','custom_1.gif','cut.gif','forecolor.gif','full.gif','help.gif','hr.gif','image.gif','indent.gif','left.gif','link.gif','numlist.gif','outdent.gif','paste.gif','redo.gif','removeformat.gif','right.gif','strikethrough.gif','sub.gif','sup.gif','undo.gif','unlink.gif','visualaid.gif');for(var i=0;i<TinyMCE_advanced_buttons.length;i++){var but=TinyMCE_advanced_buttons[i];if(but[0]==button_name){if(tinyMCE.settings['button_tile_map']){for(var x=0;!tinyMCE.isMSIE&&x<buttonTileMap.length;x++){if(buttonTileMap[x]==but[1]){var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\','+(but.length>4?but[4]:false)+(but.length>5?',\''+but[5]+'\'':'')+')';return '<a href="javascript:'+cmd+'" onclick="'+cmd+';return false;" onmousedown="return false;" target="_self"><img id="{$editor_id}_'+but[0]+'" src="{$themeurl}/images/spacer.gif" style="background-image:url({$themeurl}/images/buttons.gif); background-position: '+(0-(x*20))+'px 0px" title="'+but[2]+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';}}}var cmd='tinyMCE.execInstanceCommand(\'{$editor_id}\',\''+but[3]+'\','+(but.length>4?but[4]:false)+(but.length>5?',\''+but[5]+'\'':'')+')';return '<a href="javascript:'+cmd+'" onclick="'+cmd+';return false;" onmousedown="return false;" target="_self"><img id="{$editor_id}_'+but[0]+'" src="{$themeurl}/images/'+but[1]+'" title="'+but[2]+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';}}switch(button_name){case "formatselect":var html='<select id="{$editor_id}_formatSelect" name="{$editor_id}_formatSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FormatBlock\',false,this.options[this.selectedIndex].value);" class="mceSelectList">';var formats=tinyMCE.getParam("theme_advanced_blockformats","p,address,pre,h1,h2,h3,h4,h5,h6",true).split(',');var lookup=[['p','{$lang_theme_paragraph}'],['address','{$lang_theme_address}'],['pre','{$lang_theme_pre}'],['h1','{$lang_theme_h1}'],['h2','{$lang_theme_h2}'],['h3','{$lang_theme_h3}'],['h4','{$lang_theme_h4}'],['h5','{$lang_theme_h5}'],['h6','{$lang_theme_h6}']];html+='<option value="">{$lang_theme_block}</option>';for(var i=0;i<formats.length;i++){for(var x=0;x<lookup.length;x++){if(formats[i]==lookup[x][0]){html+='<option value="<'+lookup[x][0]+'>">'+lookup[x][1]+'</option>';}}}html+='</select>';return html;case "styleselect":return '<select id="{$editor_id}_styleSelect" onmousedown="TinyMCE_advanced_setupCSSClasses(\'{$editor_id}\');" name="{$editor_id}_styleSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceSetCSSClass\',false,this.options[this.selectedIndex].value);" class="mceSelectList">{$style_select_options}</select>';case "fontselect":var fontHTML='<select id="{$editor_id}_fontNameSelect" name="{$editor_id}_fontNameSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontName\',false,this.options[this.selectedIndex].value);" class="mceSelectList"><option value="">{$lang_theme_fontdefault}</option>';var iFonts='Arial=arial,helvetica,sans-serif;Courier New=courier new,courier,monospace;Georgia=georgia,times new roman,times,serif;Tahoma=tahoma,arial,helvetica,sans-serif;Times New Roman=times new roman,times,serif;Verdana=verdana,arial,helvetica,sans-serif;Impact=impact;WingDings=wingdings';var nFonts='Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sand;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats';var fonts=tinyMCE.getParam("theme_advanced_fonts",nFonts).split(';');for(var i=0;i<fonts.length;i++){if(fonts[i]!=''){var parts=fonts[i].split('=');fontHTML+='<option value="'+parts[1]+'">'+parts[0]+'</option>';}}fontHTML+='</select>';return fontHTML;case "fontsizeselect":return '<select id="{$editor_id}_fontSizeSelect" name="{$editor_id}_fontSizeSelect" onfocus="tinyMCE.addSelectAccessibility(event, this, window);" onchange="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'FontSize\',false,this.options[this.selectedIndex].value);" class="mceSelectList">\
<option value="0">{$lang_theme_font_size}</option>\
<option value="1">1 (8 pt)</option>\
<option value="2">2 (10 pt)</option>\
<option value="3">3 (12 pt)</option>\
<option value="4">4 (14 pt)</option>\
<option value="5">5 (18 pt)</option>\
<option value="6">6 (24 pt)</option>\
<option value="7">7 (36 pt)</option>\
</select>';case "|":case "separator":return '<img src="{$themeurl}/images/spacer.gif" width="1" height="15" class="mceSeparatorLine">';case "spacer":return '<img src="{$themeurl}/images/spacer.gif" width="1" height="15" border="0" class="mceSeparatorLine" style="vertical-align: middle" />';case "rowseparator":return '<br />';}return "";}function TinyMCE_advanced_execCommand(editor_id,element,command,user_interface,value){switch(command){case "mceForeColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=tinyMCE.getAttrib(elm,"color");if(inputColor=='')inputColor=elm.style.color;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"forecolor",input_color:inputColor});return true;case "mceBackColor":var template=new Array();var elm=tinyMCE.selectedInstance.getFocusElement();var inputColor=elm.style.backgroundColor;if(!inputColor)inputColor="#000000";template['file']='color_picker.htm';template['width']=220;template['height']=190;template['width']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_backcolor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes",command:"HiliteColor",input_color:inputColor});return true;case "mceColorPicker":if(user_interface){var template=new Array();var inputColor=value['document'].getElementById(value['element_id']).value;template['file']='color_picker.htm';template['width']=220;template['height']=190;template['close_previous']="no";template['width']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_colorpicker_delta_height',0);if(typeof(value['store_selection'])=="undefined")value['store_selection']=true;tinyMCE.lastColorPickerValue=value;tinyMCE.openWindow(template,{editor_id:editor_id,mce_store_selection:value['store_selection'],inline:"yes",command:"mceColorPicker",input_color:inputColor});}else{var savedVal=tinyMCE.lastColorPickerValue;var elm=savedVal['document'].getElementById(savedVal['element_id']);elm.value=value;eval('elm.onchange();');}return true;case "mceCodeEditor":var template=new Array();template['file']='source_editor.htm';template['width']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_width",500));template['height']=parseInt(tinyMCE.getParam("theme_advanced_source_editor_height",400));tinyMCE.openWindow(template,{editor_id:editor_id,resizable:"yes",scrollbars:"no",inline:"yes"});return true;case "mceCharMap":var template=new Array();template['file']='charmap.htm';template['width']=550+(tinyMCE.isOpera?40:0);template['height']=250;template['width']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_charmap_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case "mceInsertAnchor":var template=new Array();template['file']='anchor.htm';template['width']=320;template['height']=90+(tinyMCE.isNS7?30:0);template['width']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_width',0);template['height']+=tinyMCE.getLang('lang_theme_advanced_anchor_delta_height',0);tinyMCE.openWindow(template,{editor_id:editor_id,inline:"yes"});return true;case "mceNewDocument":if(confirm(tinyMCE.getLang('lang_newdocument')))tinyMCE.execInstanceCommand(editor_id,'mceSetContent',false,'');return true;}return false;}function TinyMCE_advanced_getEditorTemplate(settings,editorId){function removeFromArray(in_array,remove_array){var outArray=new Array();for(var i=0;i<in_array.length;i++){skip=false;for(var j=0;j<remove_array.length;j++){if(in_array[i]==remove_array[j]){skip=true;}}if(!skip){outArray[outArray.length]=in_array[i];}}return outArray;}function addToArray(in_array,add_array){for(var i=0;i<add_array.length;i++){in_array[in_array.length]=add_array[i];}return in_array;}var template=new Array();var deltaHeight=0;var resizing=tinyMCE.getParam("theme_advanced_resizing",false);var path=tinyMCE.getParam("theme_advanced_path",true);var statusbarHTML='<div id="{$editor_id}_path" class="mceStatusbarPathText" style="display: '+(path?"block":"none")+'">&nbsp;</div><div id="{$editor_id}_resize" class="mceStatusbarResize" style="display: '+(resizing?"block":"none")+'" onmousedown="TinyMCE_advanced_setResizing(event,\'{$editor_id}\',true);"></div><br style="clear: both" />';var layoutManager=tinyMCE.getParam("theme_advanced_layout_manager","SimpleLayout");var styleSelectHTML='<option value="">{$lang_theme_style_select}</option>';if(settings['theme_advanced_styles']){var stylesAr=settings['theme_advanced_styles'].split(';');for(var i=0;i<stylesAr.length;i++){var key,value;key=stylesAr[i].split('=')[0];value=stylesAr[i].split('=')[1];styleSelectHTML+='<option value="'+value+'">'+key+'</option>';}TinyMCE_advanced_autoImportCSSClasses=false;}switch(layoutManager){case "SimpleLayout":var toolbarHTML="";var toolbarLocation=tinyMCE.getParam("theme_advanced_toolbar_location","bottom");var toolbarAlign=tinyMCE.getParam("theme_advanced_toolbar_align","center");var pathLocation=tinyMCE.getParam("theme_advanced_path_location","none");var statusbarLocation=tinyMCE.getParam("theme_advanced_statusbar_location",pathLocation);var defVals={theme_advanced_buttons1:"bold,italic,underline,strikethrough,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,separator,outdent,indent,separator,undo,redo,separator,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,separator,sub,sup,separator,charmap"};for(var i=1;i<100;i++){var def=defVals["theme_advanced_buttons"+i];var buttons=tinyMCE.getParam("theme_advanced_buttons"+i,def==null?'':def,true,',');if(buttons.length==0)break;buttons=removeFromArray(buttons,tinyMCE.getParam("theme_advanced_disable","",true,','));buttons=addToArray(buttons,tinyMCE.getParam("theme_advanced_buttons"+i+"_add","",true,','));buttons=addToArray(tinyMCE.getParam("theme_advanced_buttons"+i+"_add_before","",true,','),buttons);for(var b=0;b<buttons.length;b++)toolbarHTML+=tinyMCE.getControlHTML(buttons[b]);if(buttons.length>0){toolbarHTML+="<br />";deltaHeight-=23;}}toolbarHTML+='<a href="#" accesskey="z" onfocus="tinyMCE.getInstanceById(\''+editorId+'\').getWin().focus();"></a>';template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';if(toolbarLocation=="top"){template['html']+='<tr><td class="mceToolbarTop" align="'+toolbarAlign+'" height="1" nowrap="nowrap">'+toolbarHTML+'</td></tr>';}if(statusbarLocation=="top"){template['html']+='<tr><td class="mceStatusbarTop" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=23;}template['html']+='<tr><td align="center"><span id="{$editor_id}"></span></td></tr>';if(toolbarLocation=="bottom"){template['html']+='<tr><td class="mceToolbarBottom" align="'+toolbarAlign+'" height="1">'+toolbarHTML+'</td></tr>';}if(toolbarLocation=="external"){var bod=document.body;var elm=document.createElement("div");toolbarHTML=tinyMCE.replaceVars(toolbarHTML,tinyMCE.settings);toolbarHTML=tinyMCE.replaceVars(toolbarHTML,tinyMCELang);toolbarHTML=tinyMCE.replaceVar(toolbarHTML,'style_select_options',styleSelectHTML);toolbarHTML=tinyMCE.replaceVar(toolbarHTML,"editor_id",editorId);toolbarHTML=tinyMCE.applyTemplate(toolbarHTML);elm.className="mceToolbarExternal";elm.id=editorId+"_toolbar";elm.innerHTML='<table width="100%" border="0" align="center"><tr><td align="center">'+toolbarHTML+'</td></tr></table>';bod.appendChild(elm);deltaHeight=0;tinyMCE.getInstanceById(editorId).toolbarElement=elm;}else{tinyMCE.getInstanceById(editorId).toolbarElement=null;}if(statusbarLocation=="bottom"){template['html']+='<tr><td class="mceStatusbarBottom" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=23;}template['html']+='</tbody></table>';break;case "RowLayout":template['html']='<table class="mceEditor" border="0" cellpadding="0" cellspacing="0" width="{$width}" height="{$height}" style="width:{$width}px;height:{$height}px"><tbody>';var containers=tinyMCE.getParam("theme_advanced_containers","",true,",");var defaultContainerCSS=tinyMCE.getParam("theme_advanced_containers_default_class","container");var defaultContainerAlign=tinyMCE.getParam("theme_advanced_containers_default_align","center");for(var i=0;i<containers.length;i++){if(containers[i]=="mceEditor"){template['html']+='<tr><td align="center" class="mceEditor_border">\
<span id="{$editor_id}"></span>\
</td></tr>';}else if(containers[i]=="mceElementpath"||containers[i]=="mceStatusbar"){var pathClass="mceStatusbar";if(i==containers.length-1){pathClass="mceStatusbarBottom";}else if(i==0){pathClass="mceStatusbar";}else{deltaHeight-=2;}template['html']+='<tr><td class="'+pathClass+'" height="1">'+statusbarHTML+'</td></tr>';deltaHeight-=22;}else{var curContainer=tinyMCE.getParam("theme_advanced_container_"+containers[i],"",true,',');var curContainerHTML="";var curAlign=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_align",defaultContainerAlign);var curCSS=tinyMCE.getParam("theme_advanced_container_"+containers[i]+"_class",defaultContainerCSS);for(var j=0;j<curContainer.length;j++){curContainerHTML+=tinyMCE.getControlHTML(curContainer[j]);}if(curContainer.length>0){curContainerHTML+="<br />";deltaHeight-=23;}template['html']+='<tr><td class="'+curCSS+'" align="'+curAlign+'" height="1">'+curContainerHTML+'</td></tr>';}}template['html']+='</tbody></table>';break;case "BorderLayout":break;case "CustomLayout":var customLayout=tinyMCE.getParam("theme_advanced_custom_layout","");if(customLayout!=""&&eval("typeof("+customLayout+")")!="undefined"){template=eval(customLayout+"(template);");}break;default:alert('UNDEFINED LAYOUT MANAGER! PLEASE CHECK YOUR TINYMCE CONFIG!');break;}template['html']+='<div id="{$editor_id}_resize_box" class="mceResizeBox"></div>';template['html']=tinyMCE.replaceVar(template['html'],'style_select_options',styleSelectHTML);template['delta_width']=0;template['delta_height']=deltaHeight;return template;}function TinyMCE_advanced_setResizing(e,editor_id,state){e=typeof(e)=="undefined"?window.event:e;var resizer=TinyMCE_advanced_resizer;var editorContainer=document.getElementById(editor_id+'_parent');var editorArea=document.getElementById(editor_id+'_parent').firstChild;var resizeBox=document.getElementById(editor_id+'_resize_box');var inst=tinyMCE.getInstanceById(editor_id);if(state){var width=editorArea.clientWidth;var height=editorArea.clientHeight;resizeBox.style.width=width+"px";resizeBox.style.height=height+"px";resizer.iframeWidth=inst.iframeElement.clientWidth;resizer.iframeHeight=inst.iframeElement.clientHeight;editorArea.style.display="none";resizeBox.style.display="block";if(!resizer.eventHandlers){if(tinyMCE.isMSIE)tinyMCE.addEvent(document,"mousemove",TinyMCE_advanced_resizeEventHandler);else tinyMCE.addEvent(window,"mousemove",TinyMCE_advanced_resizeEventHandler);tinyMCE.addEvent(document,"mouseup",TinyMCE_advanced_resizeEventHandler);resizer.eventHandlers=true;}resizer.resizing=true;resizer.downX=e.screenX;resizer.downY=e.screenY;resizer.width=parseInt(resizeBox.style.width);resizer.height=parseInt(resizeBox.style.height);resizer.editorId=editor_id;resizer.resizeBox=resizeBox;resizer.horizontal=tinyMCE.getParam("theme_advanced_resize_horizontal",true);}else{resizer.resizing=false;resizeBox.style.display="none";editorArea.style.display=tinyMCE.isMSIE?"block":"table";tinyMCE.execCommand('mceResetDesignMode');}}function TinyMCE_advanced_initInstance(inst){if(tinyMCE.getParam("theme_advanced_resizing",false)){if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var w=TinyMCE_advanced_getCookie("TinyMCE_"+inst.editorId+"_width");var h=TinyMCE_advanced_getCookie("TinyMCE_"+inst.editorId+"_height");TinyMCE_advanced_resizeTo(inst,w,h,tinyMCE.getParam("theme_advanced_resize_horizontal",true));}}}function TinyMCE_advanced_setCookie(name,value,expires,path,domain,secure){var curCookie=name+"="+escape(value)+((expires)?"; expires="+expires.toGMTString():"")+((path)?"; path="+escape(path):"")+((domain)?"; domain="+domain:"")+((secure)?"; secure":"");document.cookie=curCookie;}function TinyMCE_advanced_getCookie(name){var dc=document.cookie;var prefix=name+"=";var begin=dc.indexOf("; "+prefix);if(begin==-1){begin=dc.indexOf(prefix);if(begin!=0)return null;}else begin+=2;var end=document.cookie.indexOf(";",begin);if(end==-1)end=dc.length;return unescape(dc.substring(begin+prefix.length,end));}function TinyMCE_advanced_resizeTo(inst,w,h,set_w){var editorContainer=document.getElementById(inst.editorId+'_parent');var tableElm=editorContainer.firstChild;var iframe=inst.iframeElement;if(w==null||w=="null"){set_w=false;w=0;}if(h==null||h=="null")return;w=parseInt(w);h=parseInt(h);if(tinyMCE.isGecko){w+=2;h+=2;}var dx=w-tableElm.clientWidth;var dy=h-tableElm.clientHeight;if(set_w)tableElm.style.width=w+"px";tableElm.style.height=h+"px";iw=iframe.clientWidth+dx;ih=iframe.clientHeight+dy;if(tinyMCE.isGecko){iw-=2;ih-=2;}if(set_w)iframe.style.width=iw+"px";iframe.style.height=ih+"px";if(set_w){var tableBodyElm=tableElm.firstChild;var minIframeWidth=tableBodyElm.scrollWidth;if(inst.iframeElement.clientWidth<minIframeWidth){dx=minIframeWidth-inst.iframeElement.clientWidth;inst.iframeElement.style.width=(iw+dx)+"px";}}}function TinyMCE_advanced_resizeEventHandler(e){var resizer=TinyMCE_advanced_resizer;if(!resizer.resizing)return;e=typeof(e)=="undefined"?window.event:e;var dx=e.screenX-resizer.downX;var dy=e.screenY-resizer.downY;var resizeBox=resizer.resizeBox;var editorId=resizer.editorId;switch(e.type){case "mousemove":if(resizer.horizontal)resizeBox.style.width=(resizer.width+dx)+"px";resizeBox.style.height=(resizer.height+dy)+"px";break;case "mouseup":TinyMCE_advanced_setResizing(e,editorId,false);TinyMCE_advanced_resizeTo(tinyMCE.getInstanceById(editorId),resizer.width+dx,resizer.height+dy,resizer.horizontal);if(tinyMCE.getParam("theme_advanced_resizing_use_cookie",true)){var expires=new Date();expires.setTime(expires.getTime()+3600000*24*30);TinyMCE_advanced_setCookie("TinyMCE_"+editorId+"_width",""+(resizer.horizontal?resizer.width+dx:""),expires);TinyMCE_advanced_setCookie("TinyMCE_"+editorId+"_height",""+(resizer.height+dy),expires);}break;}}function TinyMCE_advanced_getInsertLinkTemplate(){var template=new Array();template['file']='link.htm';template['width']=330;template['height']=160;template['width']+=tinyMCE.getLang('lang_insert_link_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_link_delta_height',0);return template;};function TinyMCE_advanced_getInsertImageTemplate(){var template=new Array();template['file']='image.htm?src={$src}';template['width']=340;template['height']=165;template['width']+=tinyMCE.getLang('lang_insert_image_delta_width',0);template['height']+=tinyMCE.getLang('lang_insert_image_delta_height',0);return template;};function TinyMCE_advanced_handleNodeChange(editor_id,node,undo_index,undo_levels,visual_aid,any_selection,setup_content){function selectByValue(select_elm,value,first_index){first_index=typeof(first_index)=="undefined"?false:true;if(select_elm){for(var i=0;i<select_elm.options.length;i++){var ov=""+select_elm.options[i].value;if(first_index&&ov.toLowerCase().indexOf(value.toLowerCase())==0){select_elm.selectedIndex=i;return true;}if(ov==value){select_elm.selectedIndex=i;return true;}}}return false;};function getAttrib(elm,name){return elm.getAttribute(name)?elm.getAttribute(name):"";};if(node==null){return;}var pathElm=document.getElementById(editor_id+"_path");var inst=tinyMCE.getInstanceById(editor_id);var doc=inst.getDoc();if(pathElm){var parentNode=node;var path=new Array();while(parentNode!=null){if(parentNode.nodeName.toUpperCase()=="BODY"){break;}if(parentNode.nodeType==1){path[path.length]=parentNode;}parentNode=parentNode.parentNode;}var html="";for(var i=path.length-1;i>=0;i--){var nodeName=path[i].nodeName.toLowerCase();var nodeData="";if(nodeName=="b"){nodeName="strong";}if(nodeName=="i"){nodeName="em";}if(nodeName=="span"){var cn=tinyMCE.getAttrib(path[i],"class");if(cn!=""&&cn.indexOf('mceItem')==-1)nodeData+="class: "+cn+" ";var st=tinyMCE.getAttrib(path[i],"style");if(st!=""){st=tinyMCE.serializeStyle(tinyMCE.parseStyle(st));nodeData+="style: "+st+" ";}}if(nodeName=="font"){if(tinyMCE.getParam("convert_fonts_to_spans"))nodeName="span";var face=tinyMCE.getAttrib(path[i],"face");if(face!="")nodeData+="font: "+face+" ";var size=tinyMCE.getAttrib(path[i],"size");if(size!="")nodeData+="size: "+size+" ";var color=tinyMCE.getAttrib(path[i],"color");if(color!="")nodeData+="color: "+color+" ";}if(getAttrib(path[i],'id')!=""){nodeData+="id: "+path[i].getAttribute('id')+" ";}var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1)nodeData+="class: "+className+" ";if(getAttrib(path[i],'src')!=""){nodeData+="src: "+path[i].getAttribute('src')+" ";}if(getAttrib(path[i],'href')!=""){nodeData+="href: "+path[i].getAttribute('href')+" ";}if(nodeName=="img"&&tinyMCE.getAttrib(path[i],"class").indexOf('mceItemFlash')!=-1){nodeName="flash";nodeData="src: "+path[i].getAttribute('title');}if(nodeName=="a"&&(anchor=tinyMCE.getAttrib(path[i],"name"))!=""){nodeName="a";nodeName+="#"+anchor;nodeData="";}if(getAttrib(path[i],'name').indexOf("mce_")!=0){var className=tinyMCE.getVisualAidClass(tinyMCE.getAttrib(path[i],"class"),false);if(className!=""&&className.indexOf('mceItem')==-1){nodeName+="."+className;}}var cmd='tinyMCE.execInstanceCommand(\''+editor_id+'\',\'mceSelectNodeDepth\',false,\''+i+'\');';html+='<a title="'+nodeData+'" href="javascript:'+cmd+'" onclick="'+cmd+'return false;" onmousedown="return false;" target="_self" class="mcePathItem">'+nodeName+'</a>';if(i>0){html+=" &raquo; ";}}pathElm.innerHTML='<a href="#" accesskey="x"></a>'+tinyMCE.getLang('lang_theme_path')+": "+html+'&nbsp;';}tinyMCE.switchClassSticky(editor_id+'_justifyleft','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifyright','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifycenter','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_justifyfull','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_bold','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_italic','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_strikethrough','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_bullist','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_numlist','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_sub','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_sup','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_anchor','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_link','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_unlink','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_outdent','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_image','mceButtonNormal');tinyMCE.switchClassSticky(editor_id+'_hr','mceButtonNormal');if(node.nodeName=="A"&&tinyMCE.getAttrib(node,"class").indexOf('mceItemAnchor')!=-1)tinyMCE.switchClassSticky(editor_id+'_anchor','mceButtonSelected');var anchorLink=tinyMCE.getParentElement(node,"a","href");if(anchorLink||any_selection){tinyMCE.switchClassSticky(editor_id+'_link',anchorLink?'mceButtonSelected':'mceButtonNormal',false);tinyMCE.switchClassSticky(editor_id+'_unlink',anchorLink?'mceButtonSelected':'mceButtonNormal',false);}tinyMCE.switchClassSticky(editor_id+'_visualaid',visual_aid?'mceButtonSelected':'mceButtonNormal',false);if(undo_levels!=-1){tinyMCE.switchClassSticky(editor_id+'_undo','mceButtonDisabled',true);tinyMCE.switchClassSticky(editor_id+'_redo','mceButtonDisabled',true);}if(tinyMCE.getParentElement(node,"li,blockquote")){tinyMCE.switchClassSticky(editor_id+'_outdent','mceButtonNormal',false);}if(undo_index!=-1&&(undo_index<undo_levels-1&&undo_levels>0)){tinyMCE.switchClassSticky(editor_id+'_redo','mceButtonNormal',false);}if(undo_index!=-1&&(undo_index>0&&undo_levels>0)){tinyMCE.switchClassSticky(editor_id+'_undo','mceButtonNormal',false);}var selectElm=document.getElementById(editor_id+"_styleSelect");if(selectElm){TinyMCE_advanced_setupCSSClasses(editor_id);classNode=node;breakOut=false;var index=0;do{if(classNode&&classNode.className){for(var i=0;i<selectElm.options.length;i++){if(selectElm.options[i].value==classNode.className){index=i;breakOut=true;break;}}}}while(!breakOut&&classNode!=null&&(classNode=classNode.parentNode)!=null);selectElm.selectedIndex=index;}var selectElm=document.getElementById(editor_id+"_formatSelect");if(selectElm){var elm=tinyMCE.getParentElement(node,"p,div,h1,h2,h3,h4,h5,h6,pre,address");if(elm){selectByValue(selectElm,"<"+elm.nodeName.toLowerCase()+">");}else{selectByValue(selectElm,"");}}var selectElm=document.getElementById(editor_id+"_fontNameSelect");if(selectElm){if(!tinyMCE.isSafari&&!(tinyMCE.isMSIE&&!tinyMCE.isOpera)){var face=doc.queryCommandValue('FontName');face=face==null||face==""?"":face;selectByValue(selectElm,face,face!="");}else{var elm=tinyMCE.getParentElement(node,"font","face");if(elm){var family=tinyMCE.getAttrib(elm,"face");if(family=='')family=''+elm.style.fontFamily;if(!selectByValue(selectElm,family,family!=""))selectByValue(selectElm,"");}else selectByValue(selectElm,"");}}var selectElm=document.getElementById(editor_id+"_fontSizeSelect");if(selectElm){if(!tinyMCE.isSafari&&!tinyMCE.isOpera){var size=doc.queryCommandValue('FontSize');selectByValue(selectElm,size==null||size==""?"0":size);}else{var elm=tinyMCE.getParentElement(node,"font","size");if(elm){var size=tinyMCE.getAttrib(elm,"size");if(size==''){var sizes=new Array('','8px','10px','12px','14px','18px','24px','36px');size=''+elm.style.fontSize;for(var i=0;i<sizes.length;i++){if((''+sizes[i])==size){size=i;break;}}}if(!selectByValue(selectElm,size))selectByValue(selectElm,"");}else selectByValue(selectElm,"0");}}alignNode=node;breakOut=false;do{if(!alignNode.getAttribute||!alignNode.getAttribute('align')){continue;}switch(alignNode.getAttribute('align').toLowerCase()){case "left":tinyMCE.switchClassSticky(editor_id+'_justifyleft','mceButtonSelected');breakOut=true;break;case "right":tinyMCE.switchClassSticky(editor_id+'_justifyright','mceButtonSelected');breakOut=true;break;case "middle":case "center":tinyMCE.switchClassSticky(editor_id+'_justifycenter','mceButtonSelected');breakOut=true;break;case "justify":tinyMCE.switchClassSticky(editor_id+'_justifyfull','mceButtonSelected');breakOut=true;break;}}while(!breakOut&&(alignNode=alignNode.parentNode)!=null);var div=tinyMCE.getParentElement(node,"div");if(div&&div.style.textAlign=="center")tinyMCE.switchClassSticky(editor_id+'_justifycenter','mceButtonSelected');if(!setup_content){var ar=new Array("Bold","_bold","Italic","_italic","Strikethrough","_strikethrough","superscript","_sup","subscript","_sub");for(var i=0;i<ar.length;i+=2){if(doc.queryCommandState(ar[i]))tinyMCE.switchClassSticky(editor_id+ar[i+1],'mceButtonSelected');}if(doc.queryCommandState("Underline")&&(node.parentNode==null||node.parentNode.nodeName!="A")){tinyMCE.switchClassSticky(editor_id+'_underline','mceButtonSelected');}}do{switch(node.nodeName){case "UL":tinyMCE.switchClassSticky(editor_id+'_bullist','mceButtonSelected');break;case "OL":tinyMCE.switchClassSticky(editor_id+'_numlist','mceButtonSelected');break;case "HR":tinyMCE.switchClassSticky(editor_id+'_hr','mceButtonSelected');break;case "IMG":if(getAttrib(node,'name').indexOf('mce_')!=0){tinyMCE.switchClassSticky(editor_id+'_image','mceButtonSelected');}break;}}while((node=node.parentNode)!=null);};function TinyMCE_advanced_setupCSSClasses(editor_id){if(!TinyMCE_advanced_autoImportCSSClasses){return;}var selectElm=document.getElementById(editor_id+'_styleSelect');if(selectElm&&selectElm.getAttribute('cssImported')!='true'){var csses=tinyMCE.getCSSClasses(editor_id);if(csses&&selectElm){for(var i=0;i<csses.length;i++){selectElm.options[selectElm.length]=new Option(csses[i],csses[i]);}}if(csses!=null&&csses.length>0){selectElm.setAttribute('cssImported','true');}}};// UK lang variables

tinyMCE.addToLang('',{
theme_style_select : '-- Styles --',
theme_code_desc : 'Edit HTML Source (Alt+e)',
theme_code_title : 'HTML Source Editor',
theme_code_wordwrap : 'Word wrap',
theme_sub_desc : 'Subscript',
theme_sup_desc : 'Superscript',
theme_hr_desc : 'Insert horizontal ruler',
theme_removeformat_desc : 'Remove formatting',
theme_custom1_desc : 'Your custom description here',
insert_image_border : 'Border',
insert_image_dimensions : 'Dimensions',
insert_image_vspace : 'Vertical space',
insert_image_hspace : 'Horizontal space',
insert_image_align : 'Alignment',
insert_image_align_default : '-- Not set --',
insert_image_align_baseline : 'Baseline',
insert_image_align_top : 'Top',
insert_image_align_middle : 'Middle',
insert_image_align_bottom : 'Bottom',
insert_image_align_texttop : 'TextTop',
insert_image_align_absmiddle : 'Absolute Middle',
insert_image_align_absbottom : 'Absolute Bottom',
insert_image_align_left : 'Left',
insert_image_align_right : 'Right',
theme_font_size : '-- Font size --',
theme_fontdefault : '-- Font family --',
theme_block : '-- Format --',
theme_paragraph : 'Paragraph',
theme_div : 'Div',
theme_address : 'Address',
theme_pre : 'Preformatted',
theme_h1 : 'Heading 1',
theme_h2 : 'Heading 2',
theme_h3 : 'Heading 3',
theme_h4 : 'Heading 4',
theme_h5 : 'Heading 5',
theme_h6 : 'Heading 6',
theme_colorpicker_title : 'Select a color',
theme_colorpicker_apply : 'Apply',
theme_forecolor_desc : 'Select text color',
theme_backcolor_desc : 'Select background color',
theme_charmap_title : 'Select custom character',
theme_charmap_desc : 'Insert custom character',
theme_visualaid_desc : 'Toggle guidelines/invisible elements',
insert_anchor_title : 'Insert/edit anchor',
insert_anchor_name : 'Anchor name',
theme_anchor_desc : 'Insert/edit anchor',
theme_insert_link_titlefield : 'Title',
theme_clipboard_msg : 'Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?',
theme_path : 'Path',
cut_desc : 'Cut',
copy_desc : 'Copy',
paste_desc : 'Paste',
link_list : 'Link list',
image_list : 'Image list',
browse : 'Browse',
image_props_desc : 'Image properties',
newdocument_desc : 'New document',
class_name : 'Class',
newdocument : 'Are you sure you want clear all contents?',
about_title : 'About TinyMCE',
about : 'About',
license : 'License',
plugins : 'Plugins',
plugin : 'Plugin',
author : 'Author',
version : 'Version',
loaded_plugins : 'Loaded plugins',
help : 'Help',
not_set : '-- Not set --',
close : 'Close',
toolbar_focus : 'Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X'
});
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>TinyMCE License (LGPL)</title>
<link href="css/screen.css" rel="stylesheet" type="text/css" />
</head>
<body>

<div class="header">
	<h1>TinyMCE License (LGPL)</h1>
</div>

<div class="content">
<p>
Visit the <a href="faq.html">FAQ</a> for general answers surrounding TinyMCE. Or visit <a href="http://www.fsf.org" target="_blank">http://www.fsf.org</a> for more information about Open-Source licenses.
</p>
<pre>
		  GNU LIBRARY GENERAL PUBLIC LICENSE
		       Version 2, June 1991

 Copyright (C) 1991 Free Software Foundation, Inc.
 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 Everyone is permitted to copy and distribute verbatim copies
 of this license document, but changing it is not allowed.

[This is the first released version of the library GPL.  It is
 numbered 2 because it goes with version 2 of the ordinary GPL.]

			    Preamble

  The licenses for most software are designed to take away your
freedom to share and change it.  By contrast, the GNU General Public
Licenses are intended to guarantee your freedom to share and change
free software--to make sure the software is free for all its users.

  This license, the Library General Public License, applies to some
specially designated Free Software Foundation software, and to any
other libraries whose authors decide to use it.  You can use it for
your libraries, too.

  When we speak of free software, we are referring to freedom, not
price.  Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.

  To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if
you distribute copies of the library, or if you modify it.

  For example, if you distribute copies of the library, whether gratis
or for a fee, you must give the recipients all the rights that we gave
you.  You must make sure that they, too, receive or can get the source
code.  If you link a program with the library, you must provide
complete object files to the recipients so that they can relink them
with the library, after making changes to the library and recompiling
it.  And you must show them these terms so they know their rights.

  Our method of protecting your rights has two steps: (1) copyright
the library, and (2) offer you this license which gives you legal
permission to copy, distribute and/or modify the library.

  Also, for each distributor's protection, we want to make certain
that everyone understands that there is no warranty for this free
library.  If the library is modified by someone else and passed on, we
want its recipients to know that what they have is not the original
version, so that any problems introduced by others will not reflect on
the original authors' reputations.
.
  Finally, any free program is threatened constantly by software
patents.  We wish to avoid the danger that companies distributing free
software will individually obtain patent licenses, thus in effect
transforming the program into proprietary software.  To prevent this,
we have made it clear that any patent must be licensed for everyone's
free use or not licensed at all.

  Most GNU software, including some libraries, is covered by the ordinary
GNU General Public License, which was designed for utility programs.  This
license, the GNU Library General Public License, applies to certain
designated libraries.  This license is quite different from the ordinary
one; be sure to read it in full, and don't assume that anything in it is
the same as in the ordinary license.

  The reason we have a separate public license for some libraries is that
they blur the distinction we usually make between modifying or adding to a
program and simply using it.  Linking a program with a library, without
changing the library, is in some sense simply using the library, and is
analogous to running a utility program or application program.  However, in
a textual and legal sense, the linked executable is a combined work, a
derivative of the original library, and the ordinary General Public License
treats it as such.

  Because of this blurred distinction, using the ordinary General
Public License for libraries did not effectively promote software
sharing, because most developers did not use the libraries.  We
concluded that weaker conditions might promote sharing better.

  However, unrestricted linking of non-free programs would deprive the
users of those programs of all benefit from the free status of the
libraries themselves.  This Library General Public License is intended to
permit developers of non-free programs to use free libraries, while
preserving your freedom as a user of such programs to change the free
libraries that are incorporated in them.  (We have not seen how to achieve
this as regards changes in header files, but we have achieved it as regards
changes in the actual functions of the Library.)  The hope is that this
will lead to faster development of free libraries.

  The precise terms and conditions for copying, distribution and
modification follow.  Pay close attention to the difference between a
"work based on the library" and a "work that uses the library".  The
former contains code derived from the library, while the latter only
works together with the library.

  Note that it is possible for a library to be covered by the ordinary
General Public License rather than by this special one.
.
		  GNU LIBRARY GENERAL PUBLIC LICENSE
   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION

  0. This License Agreement applies to any software library which
contains a notice placed by the copyright holder or other authorized
party saying it may be distributed under the terms of this Library
General Public License (also called "this License").  Each licensee is
addressed as "you".

  A "library" means a collection of software functions and/or data
prepared so as to be conveniently linked with application programs
(which use some of those functions and data) to form executables.

  The "Library", below, refers to any such software library or work
which has been distributed under these terms.  A "work based on the
Library" means either the Library or any derivative work under
copyright law: that is to say, a work containing the Library or a
portion of it, either verbatim or with modifications and/or translated
straightforwardly into another language.  (Hereinafter, translation is
included without limitation in the term "modification".)

  "Source code" for a work means the preferred form of the work for
making modifications to it.  For a library, complete source code means
all the source code for all modules it contains, plus any associated
interface definition files, plus the scripts used to control compilation
and installation of the library.

  Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope.  The act of
running a program using the Library is not restricted, and output from
such a program is covered only if its contents constitute a work based
on the Library (independent of the use of the Library in a tool for
writing it).  Whether that is true depends on what the Library does
and what the program that uses the Library does.
  
  1. You may copy and distribute verbatim copies of the Library's
complete source code as you receive it, in any medium, provided that
you conspicuously and appropriately publish on each copy an
appropriate copyright notice and disclaimer of warranty; keep intact
all the notices that refer to this License and to the absence of any
warranty; and distribute a copy of this License along with the
Library.

  You may charge a fee for the physical act of transferring a copy,
and you may at your option offer warranty protection in exchange for a
fee.
.
  2. You may modify your copy or copies of the Library or any portion
of it, thus forming a work based on the Library, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:

    a) The modified work must itself be a software library.

    b) You must cause the files modified to carry prominent notices
    stating that you changed the files and the date of any change.

    c) You must cause the whole of the work to be licensed at no
    charge to all third parties under the terms of this License.

    d) If a facility in the modified Library refers to a function or a
    table of data to be supplied by an application program that uses
    the facility, other than as an argument passed when the facility
    is invoked, then you must make a good faith effort to ensure that,
    in the event an application does not supply such function or
    table, the facility still operates, and performs whatever part of
    its purpose remains meaningful.

    (For example, a function in a library to compute square roots has
    a purpose that is entirely well-defined independent of the
    application.  Therefore, Subsection 2d requires that any
    application-supplied function or table used by this function must
    be optional: if the application does not supply it, the square
    root function must still compute square roots.)

These requirements apply to the modified work as a whole.  If
identifiable sections of that work are not derived from the Library,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works.  But when you
distribute the same sections as part of a whole which is a work based
on the Library, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote
it.

Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Library.

In addition, mere aggregation of another work not based on the Library
with the Library (or with a work based on the Library) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.

  3. You may opt to apply the terms of the ordinary GNU General Public
License instead of this License to a given copy of the Library.  To do
this, you must alter all the notices that refer to this License, so
that they refer to the ordinary GNU General Public License, version 2,
instead of to this License.  (If a newer version than version 2 of the
ordinary GNU General Public License has appeared, then you can specify
that version instead if you wish.)  Do not make any other change in
these notices.
.
  Once this change is made in a given copy, it is irreversible for
that copy, so the ordinary GNU General Public License applies to all
subsequent copies and derivative works made from that copy.

  This option is useful when you wish to copy part of the code of
the Library into a program that is not a library.

  4. You may copy and distribute the Library (or a portion or
derivative of it, under Section 2) in object code or executable form
under the terms of Sections 1 and 2 above provided that you accompany
it with the complete corresponding machine-readable source code, which
must be distributed under the terms of Sections 1 and 2 above on a
medium customarily used for software interchange.

  If distribution of object code is made by offering access to copy
from a designated place, then offering equivalent access to copy the
source code from the same place satisfies the requirement to
distribute the source code, even though third parties are not
compelled to copy the source along with the object code.

  5. A program that contains no derivative of any portion of the
Library, but is designed to work with the Library by being compiled or
linked with it, is called a "work that uses the Library".  Such a
work, in isolation, is not a derivative work of the Library, and
therefore falls outside the scope of this License.

  However, linking a "work that uses the Library" with the Library
creates an executable that is a derivative of the Library (because it
contains portions of the Library), rather than a "work that uses the
library".  The executable is therefore covered by this License.
Section 6 states terms for distribution of such executables.

  When a "work that uses the Library" uses material from a header file
that is part of the Library, the object code for the work may be a
derivative work of the Library even though the source code is not.
Whether this is true is especially significant if the work can be
linked without the Library, or if the work is itself a library.  The
threshold for this to be true is not precisely defined by law.

  If such an object file uses only numerical parameters, data
structure layouts and accessors, and small macros and small inline
functions (ten lines or less in length), then the use of the object
file is unrestricted, regardless of whether it is legally a derivative
work.  (Executables containing this object code plus portions of the
Library will still fall under Section 6.)

  Otherwise, if the work is a derivative of the Library, you may
distribute the object code for the work under the terms of Section 6.
Any executables containing that work also fall under Section 6,
whether or not they are linked directly with the Library itself.
.
  6. As an exception to the Sections above, you may also compile or
link a "work that uses the Library" with the Library to produce a
work containing portions of the Library, and distribute that work
under terms of your choice, provided that the terms permit
modification of the work for the customer's own use and reverse
engineering for debugging such modifications.

  You must give prominent notice with each copy of the work that the
Library is used in it and that the Library and its use are covered by
this License.  You must supply a copy of this License.  If the work
during execution displays copyright notices, you must include the
copyright notice for the Library among them, as well as a reference
directing the user to the copy of this License.  Also, you must do one
of these things:

    a) Accompany the work with the complete corresponding
    machine-readable source code for the Library including whatever
    changes were used in the work (which must be distributed under
    Sections 1 and 2 above); and, if the work is an executable linked
    with the Library, with the complete machine-readable "work that
    uses the Library", as object code and/or source code, so that the
    user can modify the Library and then relink to produce a modified
    executable containing the modified Library.  (It is understood
    that the user who changes the contents of definitions files in the
    Library will not necessarily be able to recompile the application
    to use the modified definitions.)

    b) Accompany the work with a written offer, valid for at
    least three years, to give the same user the materials
    specified in Subsection 6a, above, for a charge no more
    than the cost of performing this distribution.

    c) If distribution of the work is made by offering access to copy
    from a designated place, offer equivalent access to copy the above
    specified materials from the same place.

    d) Verify that the user has already received a copy of these
    materials or that you have already sent this user a copy.

  For an executable, the required form of the "work that uses the
Library" must include any data and utility programs needed for
reproducing the executable from it.  However, as a special exception,
the source code distributed need not include anything that is normally
distributed (in either source or binary form) with the major
components (compiler, kernel, and so on) of the operating system on
which the executable runs, unless that component itself accompanies
the executable.

  It may happen that this requirement contradicts the license
restrictions of other proprietary libraries that do not normally
accompany the operating system.  Such a contradiction means you cannot
use both them and the Library together in an executable that you
distribute.
.
  7. You may place library facilities that are a work based on the
Library side-by-side in a single library together with other library
facilities not covered by this License, and distribute such a combined
library, provided that the separate distribution of the work based on
the Library and of the other library facilities is otherwise
permitted, and provided that you do these two things:

    a) Accompany the combined library with a copy of the same work
    based on the Library, uncombined with any other library
    facilities.  This must be distributed under the terms of the
    Sections above.

    b) Give prominent notice with the combined library of the fact
    that part of it is a work based on the Library, and explaining
    where to find the accompanying uncombined form of the same work.

  8. You may not copy, modify, sublicense, link with, or distribute
the Library except as expressly provided under this License.  Any
attempt otherwise to copy, modify, sublicense, link with, or
distribute the Library is void, and will automatically terminate your
rights under this License.  However, parties who have received copies,
or rights, from you under this License will not have their licenses
terminated so long as such parties remain in full compliance.

  9. You are not required to accept this License, since you have not
signed it.  However, nothing else grants you permission to modify or
distribute the Library or its derivative works.  These actions are
prohibited by law if you do not accept this License.  Therefore, by
modifying or distributing the Library (or any work based on the
Library), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Library or works based on it.

  10. Each time you redistribute the Library (or any work based on the
Library), the recipient automatically receives a license from the
original licensor to copy, distribute, link with or modify the Library
subject to these terms and conditions.  You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
.
  11. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License.  If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Library at all.  For example, if a patent
license would not permit royalty-free redistribution of the Library by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Library.

If any portion of this section is held invalid or unenforceable under any
particular circumstance, the balance of the section is intended to apply,
and the section as a whole is intended to apply in other circumstances.

It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system which is
implemented by public license practices.  Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.

This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.

  12. If the distribution and/or use of the Library is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Library under this License may add
an explicit geographical distribution limitation excluding those countries,
so that distribution is permitted only in or among countries not thus
excluded.  In such case, this License incorporates the limitation as if
written in the body of this License.

  13. The Free Software Foundation may publish revised and/or new
versions of the Library General Public License from time to time.
Such new versions will be similar in spirit to the present version,
but may differ in detail to address new problems or concerns.

Each version is given a distinguishing version number.  If the Library
specifies a version number of this License which applies to it and
"any later version", you have the option of following the terms and
conditions either of that version or of any later version published by
the Free Software Foundation.  If the Library does not specify a
license version number, you may choose any version ever published by
the Free Software Foundation.
.
  14. If you wish to incorporate parts of the Library into other free
programs whose distribution conditions are incompatible with these,
write to the author to ask for permission.  For software which is
copyrighted by the Free Software Foundation, write to the Free
Software Foundation; we sometimes make exceptions for this.  Our
decision will be guided by the two goals of preserving the free status
of all derivatives of our free software and of promoting the sharing
and reuse of software generally.

			    NO WARRANTY

  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.

  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
DAMAGES.

		     END OF TERMS AND CONDITIONS
</pre>
</div>

<div class="footer">
	<div class="helpindexlink"><a href="index.html">Index</a></div>
	<div class="copyright">Copyright &copy; 2005 Moxiecode Systems AB</div>
	<br style="clear: both" />
</div>

</body>
</html>
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('wordpress', '');

function TinyMCE_wordpress_initInstance(inst) {
	if (!tinyMCE.settings['wordpress_skip_plugin_css'])
		tinyMCE.importCSS(inst.getDoc(), tinyMCE.baseURL + "/plugins/wordpress/wordpress.css");
}

function TinyMCE_wordpress_getControlHTML(control_name) {
	switch (control_name) {
		case "wordpress":
			var titleMore = tinyMCE.getLang('lang_wordpress_more_button');
			var titlePage = tinyMCE.getLang('lang_wordpress_page_button');
			var titleHelp = tinyMCE.getLang('lang_wordpress_help_button');
			var buttons = '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\')" target="_self" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');return false;"><img id="{$editor_id}_wordpress_more" src="{$pluginurl}/images/more.gif" title="'+titleMore+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
			// Add this to the buttons var to put the Page button into the toolbar.
			// '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\')" target="_self" onclick="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpresspage\');return false;"><img id="{$editor_id}_wordpress_page" src="{$pluginurl}/images/page.gif" title="'+titlePage+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
			return buttons;
	}

	return '';
}

function TinyMCE_wordpress_parseAttributes(attribute_string) {
	var attributeName = "";
	var attributeValue = "";
	var withInName;
	var withInValue;
	var attributes = new Array();
	var whiteSpaceRegExp = new RegExp('^[ \n\r\t]+', 'g');
	var titleText = tinyMCE.getLang('lang_wordpress_more');
	var titleTextPage = tinyMCE.getLang('lang_wordpress_page');

	if (attribute_string == null || attribute_string.length < 2)
		return null;

	withInName = withInValue = false;

	for (var i=0; i<attribute_string.length; i++) {
		var chr = attribute_string.charAt(i);

		if ((chr == '"' || chr == "'") && !withInValue)
			withInValue = true;
		else if ((chr == '"' || chr == "'") && withInValue) {
			withInValue = false;

			var pos = attributeName.lastIndexOf(' ');
			if (pos != -1)
				attributeName = attributeName.substring(pos+1);

			attributes[attributeName.toLowerCase()] = attributeValue.substring(1).toLowerCase();

			attributeName = "";
			attributeValue = "";
		} else if (!whiteSpaceRegExp.test(chr) && !withInName && !withInValue)
			withInName = true;

		if (chr == '=' && withInName)
			withInName = false;

		if (withInName)
			attributeName += chr;

		if (withInValue)
			attributeValue += chr;
	}

	return attributes;
}

function TinyMCE_wordpress_execCommand(editor_id, element, command, user_interface, value) {
	var inst = tinyMCE.getInstanceById(editor_id);
	var focusElm = inst.getFocusElement();
	var doc = inst.getDoc();

	function getAttrib(elm, name) {
		return elm.getAttribute(name) ? elm.getAttribute(name) : "";
	}

	// Handle commands
	switch (command) {
			case "mcewordpressmore":
				var flag = "";
				var template = new Array();
				var altMore = tinyMCE.getLang('lang_wordpress_more_alt');

				// Is selection a image
				if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") {
					flag = getAttrib(focusElm, 'class');
	
					if (flag != 'mce_plugin_wordpress_more') // Not a wordpress
						return true;
	
					action = "update";
				}
	
				html = ''
					+ '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '
					+ ' width="100%" height="10px" '
					+ 'alt="'+altMore+'" title="'+altMore+'" class="mce_plugin_wordpress_more" name="mce_plugin_wordpress_more" />';
				tinyMCE.execCommand("mceInsertContent",true,html);
				tinyMCE.selectedInstance.repaint();
				return true;
			case "mcewordpresspage":
				var flag = "";
				var template = new Array();
				var altPage = tinyMCE.getLang('lang_wordpress_more_alt');
	
				// Is selection a image
				if (focusElm != null && focusElm.nodeName.toLowerCase() == "img") {
					flag = getAttrib(focusElm, 'name');
	
					if (flag != 'mce_plugin_wordpress_page') // Not a wordpress
						return true;
	
					action = "update";
				}
	
				html = ''
					+ '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" '
					+ ' width="100%" height="10px" '
					+ 'alt="'+altPage+'" title="'+altPage+'" class="mce_plugin_wordpress_page" name="mce_plugin_wordpress_page" />';
				tinyMCE.execCommand("mceInsertContent",true,html);
				tinyMCE.selectedInstance.repaint();
				return true;
	}

	// Pass to next handler in chain
	return false;
}

function TinyMCE_wordpress_cleanup(type, content) {
	switch (type) {
	
		case "insert_to_editor":
			var startPos = 0;
			var altMore = tinyMCE.getLang('lang_wordpress_more_alt');
			var altPage = tinyMCE.getLang('lang_wordpress_page_alt');

			// Parse all <!--more--> tags and replace them with images
			while ((startPos = content.indexOf('<!--more-->', startPos)) != -1) {
				// Insert image
				var contentAfter = content.substring(startPos + 11);
				content = content.substring(0, startPos);
				content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ';
				content += ' width="100%" height="10px" ';
				content += 'alt="'+altMore+'" title="'+altMore+'" class="mce_plugin_wordpress_more" />';
				content += contentAfter;

				startPos++;
			}
			var startPos = 0;

			// Parse all <!--page--> tags and replace them with images
			while ((startPos = content.indexOf('<!--nextpage-->', startPos)) != -1) {
				// Insert image
				var contentAfter = content.substring(startPos + 15);
				content = content.substring(0, startPos);
				content += '<img src="' + (tinyMCE.getParam("theme_href") + "/images/spacer.gif") + '" ';
				content += ' width="100%" height="10px" ';
				content += 'alt="'+altPage+'" title="'+altPage+'" class="mce_plugin_wordpress_page" />';
				content += contentAfter;

				startPos++;
			}

			// It's supposed to be WYSIWYG, right?
			content = content.replace(new RegExp('&', 'g'), '&amp;');

			break;

		case "get_from_editor":
			// Parse all img tags and replace them with <!--more-->
			var startPos = -1;
			while ((startPos = content.indexOf('<img', startPos+1)) != -1) {
				var endPos = content.indexOf('/>', startPos);
				var attribs = TinyMCE_wordpress_parseAttributes(content.substring(startPos + 4, endPos));

				if (attribs['class'] == "mce_plugin_wordpress_more") {
					endPos += 2;
	
					var embedHTML = '<!--more-->';
	
					// Insert embed/object chunk
					chunkBefore = content.substring(0, startPos);
					chunkAfter = content.substring(endPos);
					content = chunkBefore + embedHTML + chunkAfter;
				}
				if (attribs['class'] == "mce_plugin_wordpress_page") {
					endPos += 2;
	
					var embedHTML = '<!--nextpage-->';
	
					// Insert embed/object chunk
					chunkBefore = content.substring(0, startPos);
					chunkAfter = content.substring(endPos);
					content = chunkBefore + embedHTML + chunkAfter;
				}
			}

			// If it says & in the WYSIWYG editor, it should say &amp; in the html.
			content = content.replace(new RegExp('&', 'g'), '&amp;');
			content = content.replace(new RegExp('&amp;nbsp;', 'g'), '&nbsp;');

			// Remove anonymous, empty paragraphs.
			content = content.replace(new RegExp('<p>(\\s|&nbsp;)*</p>', 'mg'), '');

			// Handle table badness.
			content = content.replace(new RegExp('<(table( [^>]*)?)>.*?<((tr|thead)( [^>]*)?)>', 'mg'), '<$1><$3>');
			content = content.replace(new RegExp('<(tr|thead|tfoot)>.*?<((td|th)( [^>]*)?)>', 'mg'), '<$1><$2>');
			content = content.replace(new RegExp('</(td|th)>.*?<(td( [^>]*)?|th( [^>]*)?|/tr|/thead|/tfoot)>', 'mg'), '</$1><$2>');
			content = content.replace(new RegExp('</tr>.*?<(tr|/table)>', 'mg'), '</tr><$1>');
			content = content.replace(new RegExp('<(/?(table|tbody|tr|th|td)[^>]*)>(\\s*|(<br ?/?>)*)*', 'g'), '<$1>');

			// Pretty it up for the source editor.
			var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\\d|pre|p';
			content = content.replace(new RegExp('\\s*</('+blocklist+')>\\s*', 'mg'), '</$1>\n');
			content = content.replace(new RegExp('\\s*<(('+blocklist+')[^>]*)>\\s*', 'mg'), '\n<$1>');
			content = content.replace(new RegExp('<((li|/?tr|/?thead|/?tfoot)( [^>]*)?)>', 'g'), '\t<$1>');
			content = content.replace(new RegExp('<((td|th)( [^>]*)?)>', 'g'), '\t\t<$1>');
			content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'mg'), '<br />\n');
			content = content.replace(new RegExp('^\\s*', ''), '');
			content = content.replace(new RegExp('\\s*$', ''), '');
			
			break;
	}

	// Pass through to next handler in chain
	return content;
}

function TinyMCE_wordpress_handleNodeChange(editor_id, node, undo_index, undo_levels, visual_aid, any_selection) {
	function getAttrib(elm, name) {
		return elm.getAttribute(name) ? elm.getAttribute(name) : "";
	}

	tinyMCE.switchClassSticky(editor_id + '_wordpress_more', 'mceButtonNormal');
	tinyMCE.switchClassSticky(editor_id + '_wordpress_page', 'mceButtonNormal');

	if (node == null)
		return;

	do {
		if (node.nodeName.toLowerCase() == "img" && getAttrib(node, 'class').indexOf('mce_plugin_wordpress_more') == 0)
			tinyMCE.switchClassSticky(editor_id + '_wordpress_more', 'mceButtonSelected');
		if (node.nodeName.toLowerCase() == "img" && getAttrib(node, 'class').indexOf('mce_plugin_wordpress_page') == 0)
			tinyMCE.switchClassSticky(editor_id + '_wordpress_page', 'mceButtonSelected');
	} while ((node = node.parentNode));

	return true;
}

function wp_save_callback(el, content, body) {
	// We have a TON of cleanup to do.

	// Mark </p> if it has any attributes.
	content = content.replace(new RegExp('(<p[^>]+>.*?)</p>', 'mg'), '$1</p#>');

	// Decode the ampersands of time.
	content = content.replace(new RegExp('&amp;', 'g'), '&');

	// Get it ready for wpautop.
	content = content.replace(new RegExp('[\\s]*<p>[\\s]*', 'mgi'), '');
	content = content.replace(new RegExp('[\\s]*</p>[\\s]*', 'mgi'), '\n\n');
	content = content.replace(new RegExp('\\n\\s*\\n\\s*\\n*', 'mgi'), '\n\n');
	content = content.replace(new RegExp('\\s*<br ?/?>\\s*', 'gi'), '\n');

	// Fix some block element newline issues
	var blocklist = 'blockquote|ul|ol|li|table|thead|tr|th|td|div|h\\d|pre';
	content = content.replace(new RegExp('\\s*<(('+blocklist+') ?[^>]*)\\s*>', 'mg'), '\n<$1>');
	content = content.replace(new RegExp('\\s*</('+blocklist+')>\\s*', 'mg'), '</$1>\n');
	content = content.replace(new RegExp('<li>', 'g'), '\t<li>');

	// Unmark special paragraph closing tags
	content = content.replace(new RegExp('</p#>', 'g'), '</p>\n');
	content = content.replace(new RegExp('\\s*(<p[^>]+>.*</p>)', 'mg'), '\n$1');

	// Trim any whitespace
	content = content.replace(new RegExp('^\\s*', ''), '');
	content = content.replace(new RegExp('\\s*$', ''), '');

	// Hope.
	return content;

}
// EN lang variables

if (navigator.userAgent.indexOf('Mac OS') != -1) {
// Mac OS browsers use Ctrl to hit accesskeys
	var metaKey = 'Ctrl';
}
else {
	var metaKey = 'Alt';
}

tinyMCE.addToLang('',{
wordpress_more_button : 'Split post with More tag (' + metaKey + '-t)',
wordpress_page_button : 'Split post with Page tag',
wordpress_more_alt : 'More...',
wordpress_page_alt : '...page...'
});
/* Import plugin specific language pack */
 tinyMCE.importPluginLanguagePack('autosave','en,sv,cs,he,no,hu,de,da,ru,ru_KOI8-R,ru_UTF-8,fi,cy,es,is,pl');function TinyMCE_autosave_getInfo(){return{longname:'Auto save',author:'Moxiecode Systems',authorurl:'http://tinymce.moxiecode.com',infourl:'http://tinymce.moxiecode.com/tinymce/docs/plugin_autosave.html',version:tinyMCE.majorVersion+"."+tinyMCE.minorVersion};};function TinyMCE_autosave_beforeUnloadHandler(){var msg=tinyMCE.getLang("lang_autosave_unload_msg");var anyDirty=false;for(var n in tinyMCE.instances){var inst=tinyMCE.instances[n];if(!tinyMCE.isInstance(inst))continue;if(inst.isDirty())return msg;}return;}window.onbeforeunload=TinyMCE_autosave_beforeUnloadHandler;// EN lang variables

tinyMCE.addToLang('',{
autosave_unload_msg : 'The changes you made will be lost if you navigate away from this page.'
});
/* Import plugin specific language pack */
tinyMCE.importPluginLanguagePack('wphelp', '');

function TinyMCE_wphelp_getControlHTML(control_name) {
	switch (control_name) {
		case "wphelp":
			var titleHelp = tinyMCE.getLang('lang_help_button_title');
			var buttons = '<a href="javascript:tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceWordPressHelp\')" target="_self" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceWordPressHelp\');return false;"><img id="{$editor_id}_help" src="{$pluginurl}/images/help.gif" title="'+titleHelp+'" width="20" height="20" class="mceButtonNormal" onmouseover="tinyMCE.switchClass(this,\'mceButtonOver\');" onmouseout="tinyMCE.restoreClass(this);" onmousedown="tinyMCE.restoreAndSwitchClass(this,\'mceButtonDown\');" /></a>';
			var hiddenControls = '<div class="zerosize">'
			+ '<input type="button" accesskey="b" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Bold\',false);" />'
			+ '<input type="button" accesskey="i" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Italic\',false);" />'
			+ '<input type="button" accesskey="d" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Strikethrough\',false);" />'
			+ '<input type="button" accesskey="l" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'InsertUnorderedList\',false);" />'
			+ '<input type="button" accesskey="o" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'InsertOrderedList\',false);" />'
			+ '<input type="button" accesskey="w" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Outdent\',false);" />'
			+ '<input type="button" accesskey="q" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Indent\',false);" />'
			+ '<input type="button" accesskey="f" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyLeft\',false);" />'
			+ '<input type="button" accesskey="c" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyCenter\',false);" />'
			+ '<input type="button" accesskey="r" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'JustifyRight\',false);" />'
			+ '<input type="button" accesskey="a" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceLink\',true);" />'
			+ '<input type="button" accesskey="s" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'unlink\',false);" />'
			+ '<input type="button" accesskey="m" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceImage\',true);" />'
			+ '<input type="button" accesskey="t" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mcewordpressmore\');" />'
			+ '<input type="button" accesskey="u" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Undo\',false);" />'
			+ '<input type="button" accesskey="y" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'Redo\',false);" />'
			+ '<input type="button" accesskey="e" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceCodeEditor\',false);" />'
			+ '<input type="button" accesskey="h" onclick="tinyMCE.execInstanceCommand(\'{$editor_id}\',\'mceWordPressHelp\',false);" />'
			+ '</div>';
			return buttons+hiddenControls;
    }

    return "";
}

function TinyMCE_wphelp_execCommand(editor_id, element, command, user_interface, value) {

	// Handle commands
	switch (command) {
		case "mceWordPressHelp":
			var template = new Array();

			template['file']   = tinyMCE.baseURL + '/wp-mce-help.php';
			template['width']  = 480;
			template['height'] = 380;

			args = {
				resizable : 'yes',
				scrollbars : 'yes'
			};

			tinyMCE.openWindow(template, args);
			return true;
	}

	// Pass to next handler in chain
	return false;
}
// EN lang variables

tinyMCE.addToLang('',{
help_button_title : 'Help (Alt+h)'
});

initArray = {
	mode : "specific_textareas",
	textarea_trigger : "title",
	width : "100%",
	theme : "advanced",
	theme_advanced_buttons1 : "bold,italic,strikethrough,separator,bullist,numlist,outdent,indent,separator,justifyleft,justifycenter,justifyright,separator,link,unlink,image,wordpress,separator,undo,redo,code,wphelp",
	theme_advanced_buttons2 : "",
	theme_advanced_buttons3 : "",
	theme_advanced_toolbar_location : "top",
	theme_advanced_toolbar_align : "left",
	theme_advanced_path_location : "bottom",
	theme_advanced_resizing : true,
	browsers : "msie,gecko,opera",
	dialog_type : "modal",
	theme_advanced_resize_horizontal : false,
	entity_encoding : "raw",
	relative_urls : false,
	remove_script_host : false,
	force_p_newlines : true,
	force_br_newlines : false,
	convert_newlines_to_brs : false,
	remove_linebreaks : true,
	save_callback : "wp_save_callback",
	document_base_url : "http://g14productions.com/blog/",
	valid_elements : "-a[id|href|title|rel],-strong/b,-em/i,-strike,-del,-u,p[class|align|dir],-ol,-ul,-li,br,img[class|src|alt|title|width|height|align],-sub,-sup,-blockquote[dir],-table[border|cellspacing|cellpadding|width|height|class|align|dir],thead[class|rowspan|width|height|align|valign|dir],tr[class|rowspan|width|height|align|valign|dir],th[dir|class|colspan|rowspan|width|height|align|valign|scope],td[dir|class|colspan|rowspan|width|height|align|valign],-div[dir|class|align],-span[class|align],-pre[class],-code[class],-address,-h1[class|align|dir],-h2[class|align|dir],-h3[class|align|dir],-h4[class|align|dir],-h5[class|align|dir],-h6[class|align|dir],hr",
	plugins : "wordpress,autosave,wphelp"
};


tinyMCE.init(initArray);

