var active_rich = null;window.onerror = no_error;function parse_context_ie5(){var mode;var sel;var r;var td;var form;	eval('mode = '+active_rich.name+'_rich_mode;'); if(!mode) return;	sel = active_rich.document.selection;	r = sel.createRange();	if(sel.type == 'Control'){ switch(r(0).tagName){ case 'TABLE': show_dialog("CreateTable"); break; case 'IMG': show_dialog("CreateImage"); break; case 'OBJECT': show_dialog("CreateFlash"); break; case 'INPUT': switch(r(0).type.toUpperCase()){ case 'HIDDEN': show_dialog("CreateHidden"); break; case 'TEXT': case 'PASSWORD': show_dialog("CreateText"); break; case 'BUTTON': case 'RESET': case 'SUBMIT': show_dialog("CreateButton"); break; case 'CHECKBOX': show_dialog("CreateCheckBox"); break; case 'RADIO': show_dialog("CreateRadio"); break; default: break; } break; case 'TEXTAREA': show_dialog("CreateTextArea"); break; case 'SELECT': show_dialog("CreateSelect"); break; default: break; }	}else{ if(r.parentElement){ td = get_previous_object(r.parentElement(),'TD'); if(td != null) show_table_dialog(null, false, tab); form = get_previous_object(r.parentElement(),'FORM'); if(form != null) show_dialog("CreateForm"); }	}	change_toolbar_state(); }function do_action(action,value){var mode;var sel;var r;var is_control;var found;var button_object;	if (is_editable_regs() && !inside_editable_reg() && action != 'FullScreen') return;	eval('mode = '+active_rich.name+'_rich_mode;'); if (!is_editable_regs()) active_rich.focus(); re_hide_lists(); re_hide_context(); if (rich_popup) rich_popup.hide();	button_object = get_button_object(action);	if(!active_button(button_object)){ return;	} sel = active_rich.document.selection;	r = sel.createRange();	if(sel.type == 'Control') is_control = true;	else is_control = false;	found = true;	switch(action){ case 'Cut': case 'Copy': case 'Undo': case 'Redo': break; case 'Paste': eval('var clean_paste = '+active_rich.name+'_clean_paste;'); if (mode && clean_paste) { do_action('PasteWord'); found = false; } break; case 'Bold': case 'Italic': case 'Underline': case 'Strikethrough': case 'SuperScript': case 'SubScript': case 'JustifyFull': case 'InsertOrderedList': case 'InsertUnorderedList': case 'Outdent': case 'Indent': case 'InsertHorizontalRule': case 'RemoveFormat': if(is_control) found = false; break; case 'JustifyLeft': case 'JustifyCenter': case 'JustifyRight': break; case 'FormatBlock': case 'FontName': if(is_control) found = false; break; case 'FontSize': if(is_control) found = false; else { if (value == 3) { var fobj = null; if (r.parentElement) { fobj = get_previous_object(r.parentElement(),'FONT'); } if (fobj && (r.htmlText == "" || fobj.outerHTML == r.htmlText)) { fobj.setAttribute('size', 3); } else r.pasteHTML("<font size=3>" + r.htmlText + "</font>"); found = false; } if (value == "") value = 3; } break; case 'ClassName': set_class(value); found = false; break; case 'ForeColor': case 'BackColor': if(is_control){ found = false; break; } var cur_color = active_rich.document.queryCommandValue(action); if (String(cur_color).indexOf('#') < 0) cur_color = dec2hex(cur_color); value = pick_color(null, cur_color); break; case 'InsertRow': if(is_control) break; var ins_to = insert_to('insert_row'); if (ins_to != null) insert_row(ins_to); found = false; break; case 'DeleteRow': if(is_control) break; delete_row(); found = false; break; case 'InsertColumn': if(is_control) break; var ins_to = insert_to('insert_column'); if (ins_to != null) insert_column(ins_to); found = false; break; case 'DeleteColumn': if(is_control) break; delete_column(); found = false; break; case 'PasteWord': paste_word(); found = false; break; case 'SwitchBorders': switch_borders(true); found = false; break; case 'InsertChar': if(is_control) break; insert_char(); found = false; break; case 'InsertCell': if(is_control) break; insert_cell(); found = false; break; case 'DeleteCell': if(is_control) break; delete_cell(); found = false; break; case 'MergeCells': found = false; if(is_control) break; merge_cells(); break; case 'MergeCellsDown': found = false; if(is_control) break; merge_cells_down(); break; case 'SplitCell': found = false; if(is_control) break; split_cell(); break; case 'SplitCellDown': found = false; if(is_control) break; merge_cells_down(true); break; case 'FullScreen': full_screen(get_editor_name(button_object)); found = false; break; case 'InsertSnippet': if(value) insert_snippet(value); found = false; break; case 'AbsolutePosition': active_rich.document.execCommand("2D-Position", false, true); break; case 'SpellCheck': if (openspell) { eval("var textarea = document.all['"+active_rich.name+"_area_id']"); var content = get_rich(textarea.name); content = re_convert_script_tags(content, false); textarea.value = content; openspell(rich_path+'spelling/', textarea.id); } found = false; break; default: found = false; break;	}	if (found) active_rich.document.execCommand(action, false, value);	if (action == 'Paste' || action == 'PasteWord') { re_set_image_resize_handlers();	}	change_toolbar_state(); }function mouse_down(down){var element;var mode;var name;var obj;	element = window.event.srcElement;	if(element && element.tagName=='IMG'){ name = get_editor_name(element); eval('mode = '+name+'_rich_mode;'); if(!active_button(element)){ eval('obj = '+name+'_id;'); if(obj) obj.focus(); return; } if(down){ element.className = 're_mouse_down'; }else{ element.className = 're_mouse_up'; }	}}function mouse_over(over){var element;var name;var mode;var obj;var id_name;var acrion_name;var old_active_rich;var button_name;var changing_button;var mode_name;	element = window.event.srcElement;	if(element && element.tagName=='IMG'){ name = get_editor_name(element); eval('mode = '+name+'_rich_mode;'); eval('obj = '+name+'_id;'); if(!obj) return; if(!active_button(element)) return; if(over){ element.className = 're_mouse_over'; }else{ id_name = String(element.id); action_name = id_name.substring(0,id_name.length-name.length-1); if(action_name == 'SwitchBorders' || action_name == 'FullScreen' || action_name == 'AbsolutePosition'){ if(action_name == 'SwitchBorders') mode_name = 'border'; else if (action_name == 'AbsolutePosition') mode_name = 'abspos'; else mode_name = 'full_screen'; eval('border_mode = '+obj.name+'_rich_'+mode_name+'_mode;'); old_active_rich = active_rich; active_rich = obj; set_state(action_name, border_mode); active_rich = old_active_rich; }else{ button_name = (id_name.split('_'))[0]; if(button_name == 'Bold' || button_name == 'Italic' || button_name == 'Underline'|| button_name == 'Strikethrough' || button_name == 'SuperScript' || button_name == 'SubScript' || button_name == 'JustifyLeft' || button_name == 'JustifyCenter' || button_name == 'JustifyRight' || button_name == 'JustifyFull' || button_name == 'InsertOrderedList' || button_name == 'InsertUnorderedList'){ changing_button = true; }else{ changing_button = false; } if(!changing_button || !obj.document.queryCommandValue(action_name)){ element.className = 're_mouse_out'; }else{ element.className = 're_mouse_down'; } } }	}}function change_mode(){var mode;var active_mode;var border_mode;var i;var text;var button_id_parts;var button_name;var editror_name;var full_screen_mode;	eval('mode = '+active_rich.name+'_rich_mode;'); eval('active_mode = '+active_rich.name+'_rich_active_mode;'); eval('border_mode = '+active_rich.name+'_rich_border_mode;'); eval('full_screen_mode = '+active_rich.name+'_rich_full_screen_mode;');	text = get_rich_content(active_rich, true);	if(mode){ active_rich.document.body.runtimeStyle.fontFamily = 'Courier'; active_rich.document.body.runtimeStyle.fontSize = '12px'; active_rich.document.body.runtimeStyle.bgColor = '#FFFFFF'; active_rich.document.body.runtimeStyle.color = '#000000'; active_rich.document.body.runtimeStyle.background = '#FFFFFF'; for(i=0;i<document.images.length;i++){ button_id_parts = document.images(i).id.match(/([^_]+)_(.+)$/); if(button_id_parts){ button_name = button_id_parts[1]; editor_name = button_id_parts[2]; if(editor_name == active_rich.name){ if(button_name != 'Cut' && button_name != 'Copy' && button_name != 'Paste' && button_name != 'Help' && button_name != 'Preview' && button_name != 'Find' && button_name != 'Save'){ show_button(button_name, false); } } } } show_select('FormatBlock', false); show_select('FontName', false); show_select('FontSize', false); show_select('ClassName', false); eval(active_rich.name+'_rich_mode = false;');	}else{ active_rich.document.body.runtimeStyle.cssText = ""; for(i=0;i<document.images.length;i++){ button_id_parts = document.images(i).id.match(/([^_]+)_(.+)$/); if(button_id_parts){ button_name = button_id_parts[1]; editor_name = button_id_parts[2]; if(editor_name == active_rich.name){ show_button(button_name, true); } } } set_state('SwitchBorders', border_mode); set_state('FullScreen', full_screen_mode); show_select('FormatBlock', true); show_select('FontName', true); show_select('FontSize', true); show_select('ClassName', true); eval(active_rich.name+'_rich_mode = true;');	}	set_rich_content(active_rich, text); if(active_mode || mode){ show_button('FullScreen', full_screen_mode || document.all.rich_fs_iframe.style.display!='');	}	set_state('FullScreen', full_screen_mode);	if(active_mode) change_toolbar_state(); active_rich.focus();}function change_toolbar_state(what){var mode;var active_mode;var full_screen_mode;	eval('active_mode = '+active_rich.name+'_rich_active_mode;'); eval('mode = '+active_rich.name+'_rich_mode;'); eval('full_screen_mode = '+active_rich.name+'_rich_full_screen_mode;');	set_state('FullScreen', full_screen_mode); if(!mode){ if(active_mode){ show_clipboard_buttons(); } return;	}	var sel = active_rich.document.selection;	var r = sel.createRange();	if(!what || what == "ClassName") set_style("ClassName", get_class());	if (sel.type != 'Control') { if(!what || what == "FontName") set_style("FontName", String(active_rich.document.queryCommandValue('FontName')).toLowerCase()); if(!what || what == "FontSize") set_style("FontSize", active_rich.document.queryCommandValue('FontSize')); if(!what || what == "Bold") set_state("Bold", active_rich.document.queryCommandValue('Bold')); if(!what || what == "Italic") set_state("Italic", active_rich.document.queryCommandValue('Italic')); if(!what || what == "Underline") set_state("Underline", active_rich.document.queryCommandValue('Underline')); if(!what || what == "Strikethrough") set_state("Strikethrough", active_rich.document.queryCommandValue('Strikethrough')); if(!what || what == "SuperScript") set_state("SuperScript", active_rich.document.queryCommandValue('SuperScript')); if(!what || what == "SubScript") set_state("SubScript", active_rich.document.queryCommandValue('SubScript')); if(!what || what == "JustifyLeft") set_state("JustifyLeft", active_rich.document.queryCommandValue('JustifyLeft')); if(!what || what == "JustifyCenter") set_state("JustifyCenter", active_rich.document.queryCommandValue('JustifyCenter')); if(!what || what == "JustifyRight") set_state("JustifyRight", active_rich.document.queryCommandValue('JustifyRight')); if(!what || what == "JustifyFull") set_state("JustifyFull", active_rich.document.queryCommandValue('JustifyFull')); if(!what || what == "InsertOrderedList")	set_state("InsertOrderedList", active_rich.document.queryCommandValue('InsertOrderedList')); if(!what || what == "InsertUnorderedList")	set_state("InsertUnorderedList", active_rich.document.queryCommandValue('InsertUnorderedList'));	} eval('var abspos_mode = '+active_rich.name+'_rich_abspos_mode;');	var is_abs = false;	if (sel.type == 'Control') { if (r(0).style.position == 'absolute') is_abs = true;	} else { if(!what || what == "FormatBlock") set_style("FormatBlock", get_font_block(r.parentElement()));	}	if(active_mode){ show_active_buttons();	}	if (is_abs || !active_mode) set_state('AbsolutePosition', is_abs);	eval(active_rich.name+'_rich_abspos_mode = is_abs;');}function set_state(what, value){var element; eval('element = document.all.'+what+'_'+active_rich.name+';');	if(element){ if(value){ element.className = 're_mouse_down'; }else{ element.className = 're_mouse_out'; }	}}function set_style(what, value){var element;var param = null; param = String(value).match(/Heading (.+)/);	if(param) value = '<H'+param[1]+'>';	if(value == 'Normal') value = '<P>';	if(value == 'Formatted') value = '<PRE>'; eval('element = document.all.'+what+'_'+active_rich.name+';');	if(element) element.value = value;}function pick_color(name, color){	if(!name) var name = active_rich.name; return showModalDialog(rich_path+"pick_color"+rich_dialog_ext+"?lang="+eval(name+"_lang")+"&110903t", color, "dialogWidth:445px; dialogHeight:140px; status:no; scroll:no; help:no");}function show_dialog(action, object){var mode;var sel;var r;var is_control;var attrib;var parameters;var link_text;var element;var link;var i;var param;var outerHTML = '';var text_class;var element_type;var button_object;var tab;	if (is_editable_regs() && !inside_editable_reg() && !(action == 'Help' || action == 'Preview' || action == 'Save')) return;	eval('mode = '+active_rich.name+'_rich_mode;'); if (!is_editable_regs()) active_rich.focus(); if(rich_popup) rich_popup.hide(); if(!mode && !(action == 'Help' || action == 'Preview' || action == 'Find' || action == 'Save')) return; sel = active_rich.document.selection;	r = sel.createRange();	if(sel.type == 'Control') { is_control = true; if(r.commonParentElement) element = r.commonParentElement(); else return;	} else is_control = false;	switch(action){ case "CreateTable": if (is_control) { if (element.tagName != 'TABLE') break; show_table_dialog(null, 2); } else show_table_dialog(null, true); break; case "EditTable": if (is_control) { show_dialog("CreateTable"); break; } else { if(r.parentElement && get_previous_object(r.parentElement(), 'TABLE')) show_table_dialog(); } break; case "EditRow": tab = 'tr'; case "EditCell": if (r.parentElement && get_previous_object(r.parentElement(), 'TD')) { if (!tab) tab = 'td'; show_table_dialog(null, false, tab); } break; case "CreateImage": if(is_control && element.tagName != 'IMG') break; show_image_dialog(""); break; case "CreateFlash": if(is_control && element.tagName != 'OBJECT') break; show_flash_dialog(""); break; case "CreateVideo": if(is_control && element.tagName != 'EMBED') break; show_video_dialog(""); break; case "CreateLink": if(r.parentElement){ link = get_previous_object(r.parentElement(),'A'); }else{ if(r.commonParentElement){ link = get_previous_object(r.commonParentElement(),'A'); }else link = null; } if (!link && !is_control && sel.type != 'Text') break; if(!link && !is_control){ link_text = r.htmlText; if(link_text.match(/<\/?A/i)) break; } if (!link || link.innerHTML != "") show_link_dialog(""); break; case "CreateAnchor": if (r.parentElement) { link = get_previous_object(r.parentElement(),'A'); if (link && link.href != '') break; } if (r.htmlText == "" || link || is_control && element.tagName == 'A' && element.href=='') show_object_dialog('anchor'); break; case "EditLink": attrib = get_link(object); parameters = show_link_dialog(attrib); if(parameters) edit_object(object, parameters); break; case "Help": var name = active_rich.name; var lang = eval(name+"_lang"); window.open(rich_path+"lang/help_"+lang+rich_dialog_ext+"?lang="+lang,"re_help_"+lang, "toolbar=0,scrollbars=yes,resizable=yes"); break; case "Preview": var pre_window; var editor_content; var name = active_rich.name; eval('page_mode = '+name+'_rich_page_mode;'); eval('var rich_css = '+name+'_rich_css;'); editor_content = get_rich_content(active_rich); try { pre_window = window.open('', '', 'toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,titlebar=1'); pre_window.document.write(editor_content); pre_window.document.close(); }catch (e) {} for (i in rich_css) { pre_window.document.createStyleSheet(rich_css[i]); } break; case "Find": var lang = eval(active_rich.name+"_lang"); showModelessDialog(rich_path+"dialog_find"+rich_dialog_ext+"?lang="+lang+"&browser=&t", active_rich, "dialogWidth:190px; dialogHeight:70px; scroll:no; status:no; help:no;"); break; case "CreateForm": if(!is_control){ show_form_dialog(null, "form"); } break; case "CreateHidden": if(is_control && (element.tagName != 'INPUT' || element.type.toUpperCase() != 'HIDDEN')){ break; } show_form_dialog(null, "hidden"); break; case "CreateText": if(is_control && (element.tagName != 'INPUT' || element.type.toUpperCase() != 'TEXT' && element.type.toUpperCase() != 'PASSWORD')){ break; } show_form_dialog(null, "text"); break; case "CreateTextArea": if(is_control && element.tagName != 'TEXTAREA') break; show_form_dialog(null, "textarea"); break; case "CreateButton": if(is_control && (element.tagName != 'INPUT' || element.type.toUpperCase() != 'BUTTON' && element.type.toUpperCase() != 'RESET' && element.type.toUpperCase() != 'SUBMIT')) break; show_form_dialog(null, "button"); break; case "CreateCheckBox": case "CreateRadio": if(action == 'CreateCheckBox'){ element_type = 'checkbox'; action = 'EditCheckBox'; }else{ element_type = 'radio'; action = 'EditRadio'; } if(is_control && (element.tagName != 'INPUT' || element.type.toUpperCase() != element_type.toUpperCase())){ break; } show_form_dialog(null, element_type); break; case "CreateSelect": if (is_control && element.tagName != 'SELECT') break; show_form_dialog(null, "select"); break; case "InsertSnippet": if(!is_control && r.parentElement){ show_form_dialog(null, "snippet"); } break; case "PageProperties": show_page_dialog(); break; default: break;	}}function get_previous_object(obj,tag_name) { if(obj){ if(obj.className == "re_editor") return null; if(obj.tagName != tag_name){ obj = get_previous_object(obj.parentNode, tag_name); } } return(obj);}var re_font_blocks = 'P,H1,H2,H3,H4,H5,H6,PRE,';function get_font_block(obj) {	if(obj){ if(obj.className == "re_editor" || !obj.tagName) return '<P>'; var tag_name = obj.tagName.toUpperCase(); if(re_font_blocks.indexOf(tag_name + ',') < 0 || tag_name == 'P'){ return get_font_block(obj.parentNode); } return('<' + tag_name + '>');	}	return('<P>');}function insert_row(ins_to){var range;var tr;var table;var row;var i;var curr_colspan;	range = active_rich.document.selection.createRange();	tr = get_previous_object(range.parentElement(),'TR');	table = get_previous_object(tr,'TABLE');	if(table != null){ eval('var border_mode = '+active_rich.name+'_rich_border_mode;'); row = table.insertRow(tr.rowIndex+ins_to); for(i=0;i<tr.cells.length;i++){ var cell = row.insertCell(i); if (border_mode) cell.runtimeStyle.border = '1px dashed #CCCCCC'; var attr = new Array('width', 'height', 'vAlign', 'bgColor'); var j; for (j in attr) { var attr_value = eval('tr.cells(i).getAttribute("'+attr[j]+'")'); eval('if(attr_value) cell.setAttribute("'+attr[j]+'", attr_value)'); } curr_colspan = tr.cells(i).colSpan; if(curr_colspan > 1){ cell.colSpan = curr_colspan; } }	}}function delete_row(){var range;var tr;var table;	range = active_rich.document.selection.createRange();	tr = get_previous_object(range.parentElement(),'TR');	table = get_previous_object(tr,'TABLE');	if(table != null){ if(table.rows.length <= 1){ table.removeNode(true); }else{ table.deleteRow(tr.rowIndex); }	}}function insert_column(ins_to){var range;var td;var table;var i;var curr_rowspan;var cell_index;var rowspan_index;var curr_index;	range = active_rich.document.selection.createRange();	td = get_previous_object(range.parentElement(),'TD');	table = get_previous_object(td,'TABLE');	if(table != null){ curr_index = td.cellIndex; for(i=0;i<table.rows.length;i++){ if(curr_index+ins_to > table.rows(i).cells.length){ cell_index = table.rows(i).cells.length; }else{ cell_index = curr_index+ins_to; } if(curr_index < table.rows(i).cells.length){ rowspan_index = curr_index; }else{ rowspan_index = table.rows(i).cells.length-1; } var j = -1; var attr = new Array('width', 'height', 'vAlign', 'bgColor'); if (rowspan_index<0) curr_rowspan = 1; else { var tr = table.rows(i).cells(rowspan_index); curr_rowspan = tr.rowSpan; for (j in attr) { eval('var '+attr[j]+'=tr.getAttribute("'+attr[j]+'")'); } } var cell = table.rows(i).insertCell(cell_index); eval('var border_mode = '+active_rich.name+'_rich_border_mode;'); if (border_mode) cell.runtimeStyle.border = '1px dashed #CCCCCC'; if(j != -1){ for (j in attr) { eval('if('+attr[j]+') cell.setAttribute("'+attr[j]+'", '+attr[j]+')'); } } if(curr_rowspan > 1){ cell.rowSpan = curr_rowspan; i += curr_rowspan-1; } }	}}function delete_column(){var range;var td;var table;var i;var tr;var cell_index;	range = active_rich.document.selection.createRange();	td = get_previous_object(range.parentElement(),'TD');	table = get_previous_object(td,'TABLE');	if (table != null) { cell_index = td.cellIndex; for (i=0;i<table.rows.length;i++) { tr = table.rows(i); if (tr.cells.length<=1) { tr.removeNode(true); i--; } else { if (cell_index < tr.cells.length) { if (tr.cells(cell_index).rowSpan>1) { i+=tr.cells(cell_index).rowSpan-1; } tr.deleteCell(cell_index); } } } if (table.rows.length == 0) { table.removeNode(true); }	}}function insert_cell(){var range;var td;var tr; range = active_rich.document.selection.createRange(); td = get_previous_object(range.parentElement(),'TD'); tr = get_previous_object(td,'TR'); if(tr != null){ var cell = tr.insertCell(td.cellIndex+1);	eval('var border_mode = '+active_rich.name+'_rich_border_mode;');	if (border_mode) cell.runtimeStyle.border = '1px dashed #CCCCCC'; }}function delete_cell(){var range;var td;var table;var tr; range = active_rich.document.selection.createRange(); td = get_previous_object(range.parentElement(),'TD'); tr = get_previous_object(range.parentElement(),'TR'); table = get_previous_object(td,'TABLE'); if(table != null){ if(tr.cells.length<=1){ table.deleteRow(tr.rowIndex); if(table.rows.length == 0){ table.removeNode(true); } }else{ tr.deleteCell(td.cellIndex); } }}function merge_cells(){ var range;var td;var tr;var next_td; range = active_rich.document.selection.createRange(); td = get_previous_object(range.parentElement(),'TD'); tr = get_previous_object(range.parentElement(),'TR'); if(tr != null && td.cellIndex < tr.cells.length-1){ next_td = tr.cells(td.cellIndex+1); td.innerHTML += next_td.innerHTML; td.colSpan += next_td.colSpan; tr.deleteCell(td.cellIndex+1); } } function split_cell(){var range;var td;var tr;	range = active_rich.document.selection.createRange();	td = get_previous_object(range.parentElement(),'TD');	tr = get_previous_object(range.parentElement(),'TR'); if(tr != null && td.colSpan > 1){ td.colSpan--; var cell = tr.insertCell(td.cellIndex+1); cell.rowSpan = td.rowSpan; eval('var border_mode = '+active_rich.name+'_rich_border_mode;'); if (border_mode) cell.runtimeStyle.border = '1px dashed #CCCCCC';	}} function merge_cells_down(split_cell){ var next_td;var range = active_rich.document.selection.createRange();var td = get_previous_object(range.parentElement(),'TD');var tr = get_previous_object(range.parentElement(),'TR');var table = get_previous_object(td,'TABLE'); if (!(tr != null && (td.rowSpan > 1 && split_cell || tr.rowIndex+td.rowSpan < table.rows.length && !split_cell))) return;	var split_inc = split_cell?1:0; var i;	var real_cell = 0;	var real_cell2 = 0;	for (i=0; i<tr.cells.length&&i<td.cellIndex; i++) { real_cell += tr.cells(i).colSpan; var inc = tr.cells(i).rowSpan-td.rowSpan+split_inc; real_cell2 += inc>0?tr.cells(i).colSpan:0;	}	var tr2 = table.rows(tr.rowIndex+td.rowSpan-split_inc);	if (!tr2) return;	var tr2_cells = tr2.cells; for (i=0; i<tr2_cells.length; i++) { if (real_cell2 >= real_cell) break; real_cell2 += tr2_cells(i).colSpan;	}	if (!split_cell) { try { var td2 = tr2_cells(i); } catch(e){ return; } if (!td2) return; td.innerHTML += td2.innerHTML; td.rowSpan += td2.rowSpan; tr2.deleteCell(i);	} else { td.rowSpan--; try { var cell = tr2.insertCell(i); } catch(e){ return; } if (!cell) return; cell.colSpan = td.colSpan; eval('var border_mode = '+active_rich.name+'_rich_border_mode;'); if (border_mode) cell.runtimeStyle.border = '1px dashed #CCCCCC';	}} function show_table_dialog(attrib, create_mode, tab){	return show_object_dialog('table', attrib, null, create_mode, tab);}function show_image_dialog(attrib, name){	return show_object_dialog('image', attrib, name);}function show_flash_dialog(attrib, name){	return show_object_dialog('flash', attrib, name);}function show_video_dialog(attrib, name){	return show_object_dialog('video', attrib, name);}function show_link_dialog(attrib, name){	return show_object_dialog('link', attrib, name);}function show_page_dialog(attrib){	return show_object_dialog('page', attrib);}function show_object_dialog(object, attrib, name, create_mode, tab){var w;var h;	if(!object) return;	if(!name) var name = active_rich.name; if (create_mode) var do_create = create_mode; else var do_create = '';	if (tab) var tab_code = '&tab='+tab; else var tab_code = '';	switch(object){ case 'table': w = 500; h = 520; break; case 'image': w = 410; h = 440; break; case 'flash': case 'video': w = 410; h = 440; break; case 'link': w = 410; h = 440; break; case 'page': w = 350; h = 430; break; case 'anchor': w = 200; h = 100; break; default: return;	} if (!attrib) { var attrib = new Array();	} attrib['parent_win'] = window;	var files_path = eval(name+"_files_path");var files_url = eval(name+"_files_url");	if (typeof(files_path) == 'object') { var i; for (i in files_path) { var first_path = files_path[i]; var first_url = files_url[i]; break; }	} else { var first_path = files_path; var first_url = files_url;	}	return showModalDialog(rich_path+"dialog_"+object+rich_dialog_ext+"?files_path="+first_path+"&files_url="+first_url+"&lang="+eval(name+"_lang")+"&name="+name+"&do_create="+do_create+"&re_ext="+rich_dialog_ext+tab_code+"&"+rich_sess_param+"&110903lqiwommmmmwamqjmm", attrib, "dialogWidth:"+w+"px; dialogHeight:"+h+"px; status:no; scroll:no; help:no");}function show_form_dialog(attrib, action){var w;var h;	switch(action){ case 'form': w = 331; h = 170; break; case 'text': w = 243; h = 305; break; case 'textarea': w = 250; h = 295; break; case 'button': w = 253; h = 210; break; case 'hidden': w = 300; h = 170; break; case 'checkbox': w = 253; h = 215; break; case 'radio': w = 253; h = 215; break; case 'snippet': w = 305; h = 343; break; default: w = 200; h = 200; break;	} if (!attrib) { var attrib = new Array();	} attrib['parent_win'] = window;	return showModalDialog(rich_path+"dialog_form"+rich_dialog_ext+"?action="+action+"&browser=&lang="+eval(active_rich.name+"_lang")+"&110903y", attrib, "dialogWidth:"+w+"px; dialogHeight:"+h+"px; status:no; scroll:no; help:no");}function save_in_textarea_all(){var i;var name;var text;	for(i=0;i<document.all.length;i++){ if(document.all(i).className == 're_editor'){ name = document.all(i).name; eval('var ed_regs = '+name+'_editable_regions;'); if (ed_regs) { eval('var divs = '+name+'_id.document.body.getElementsByTagName("DIV");'); var div_length = divs.length; for (var j=0; j<div_length; j++) { if (divs[j].id == "re_editable_region") { divs[j].removeNode(false); j--; div_length--; } } } eval("text=get_rich_content("+name+"_id)"); eval("document.all['"+name+"_area_id'].value=text"); }	}}function set_stylesheet_rules(){var rule_values = new Array();var rule_found = false;var sheets;var sheets_num;var i,j,k;var rules;var rules_num;var rule_value;var rule_found;var rules_select;var option;var old_rule_value;	sheets = active_rich.document.styleSheets;	sheets_num = sheets.length; eval('rules_select = document.all.ClassName_'+active_rich.name+';');	if (!rules_select) return; if(sheets_num > 0){ for(i=0;i<sheets_num;i++){ rules = sheets(i).rules; rules_num = rules.length; for(j=0;j<rules_num;j++){ rule_value = rules(j).selectorText; rule_value = (rule_value.split(' '))[0]; if(rule_value.indexOf(".") >= 0){ if(rule_value.indexOf(":") >= 0){ rule_value = rule_value.substring(rule_value.indexOf(".")+1,rule_value.indexOf(":")); }else{ if(rule_value.indexOf(".") == 0){ rule_value = rule_value.substring(1,rule_value.length); }else{ if(rule_value.indexOf(".") > 0){ rule_value = rule_value.substring(rule_value.indexOf(".")+1,rule_value.length); } } } for(k=0;k<rule_values.length;k++){ if(rule_value == rule_values[k]){ rule_found = true; break; } } if(rule_found != true){ rule_values[rule_values.length] = rule_value; } rule_found = false; } } } if(rules_select){ var sindx = rules_select.selectedIndex; if (sindx > 0) old_rule_value = rules_select[rules_select.selectedIndex].value; while(rules_select.options[1] != null){ rules_select.options[1].removeNode(true); } for(i=0;i<rule_values.length;i++){ if(rule_values[i] != ''){ option = document.createElement("option"); option.value = rule_values[i]; option.text = rule_values[i]; rules_select.add(option); } } if (sindx > 0) rules_select.value = old_rule_value; } } else { while(rules_select.options[1] != null){ rules_select.options[1].removeNode(true);	} }}function set_class(rule_value){var sel = active_rich.document.selection;var range = sel.createRange();var is_set;var object;var parentTagName;	if(sel.type == "Control"){ object = range.commonParentElement();	}else{ if(range.parentElement != null){ parentTagName = range.parentElement().tagName.toUpperCase(); if(range.htmlText == ""){ object = range.parentElement(); }else{ if(parentTagName=="SPAN" || parentTagName=="A"){ object = range.parentElement(); }else{ if(rule_value != ""){ try{ range.pasteHTML("<span class=" + rule_value + ">" + range.htmlText + "</span>"); }catch(error){ } } is_set = true } } if(rule_value == "" && parentTagName == "SPAN"){ object.removeNode(false); is_set = true; } }	}	if(object != null && is_set != true && object.tagName != 'BODY'){ object.className = rule_value;	}}function get_class(){var sel = active_rich.document.selection;var range = sel.createRange();var object = null;	if(sel.type == "Control"){ object = range.commonParentElement();	}else{ object = range.parentElement();	}	if(object != null){ if(object.className == "re_editor") return ""; while(object.className == ""){ object = object.parentElement; if(object == null) return ""; } return object.className;	}	return "";}function clean_code(code) { code = re_fix_word_lists(code); code = code.replace(/&nbsp;/gi, ""); code = code.replace(/<\\?\??xml[^>]*>/gi, ""); code = code.replace(/<\/?\w+:[^>]*>/gi, ""); code = code.replace(/<p([^>])*>(&nbsp;|\s)*<\/p>/gi,""); code = code.replace(/<\/?span[^>]*>/gi,""); code = code.replace(/<([\w]+) class=([^ |>]*)([^>]*)/gi, "<$1$3"); code = code.replace(/<([^>]+) style="([^"]*)"([^>]*)/gi, "<$1$3"); code = code.replace(/<!--([^>]*)-->/g, "");	return code}function paste_word(){var sel = active_rich.document.selection.createRange();var temp_obj; if(sel.parentElement){ temp_obj = rich_temp_iframe; temp_obj.focus(); temp_obj.document.execCommand("SelectAll"); temp_obj.document.execCommand("Paste"); sel.pasteHTML(clean_code(temp_obj.document.body.innerHTML)); } eval('var border_mode = '+active_rich.name+'_rich_border_mode;');	set_borders(border_mode);	if(!is_editable_regs()) active_rich.focus(); }function re_fix_word_lists(code) {var list_mark = "tab-stops: list";var i;var div_obj = document.createElement("div"); div_obj.innerHTML = code;var is_over = false;var bull = String.fromCharCode(8226);var middot = String.fromCharCode(183);while (!is_over) {	is_over = true;	var p_tags = div_obj.getElementsByTagName("p");	var re = new RegExp(middot+'|'+bull, 'gi');	for (i=0; i<p_tags.length; i++) { var p = p_tags[i]; if (p.style && p.style.cssText.indexOf(list_mark) > 0 || re.test(p.innerHTML)) { is_over = false; var ul = document.createElement("ul"); var li = document.createElement("li"); var inner_html = p.innerHTML; inner_html = inner_html.replace(re, ''); li.innerHTML = inner_html; ul.appendChild(li); var next_p = p.nextSibling; while (next_p) { if (next_p.nodeType != 1) { next_p = next_p.nextSibling; continue; } if (next_p.style && next_p.style.cssText.indexOf(list_mark) > 0 || re.test(next_p.innerHTML)) { var next_p_temp = next_p.nextSibling; var li = document.createElement("li"); var inner_html = next_p.innerHTML; inner_html = inner_html.replace(re, ''); li.innerHTML = inner_html; next_p.parentNode.removeChild(next_p); ul.appendChild(li); next_p = next_p_temp; } else { break; } } p.parentNode.replaceChild(ul, p); }	}}	return div_obj.innerHTML;}function set_borders(border_mode){var tables = active_rich.document.body.getElementsByTagName("TABLE");var forms = active_rich.document.body.getElementsByTagName("FORM");var anchors = active_rich.document.body.getElementsByTagName("A");var page_mode;var i,j,k;var width;var height;var rows;var cells;	eval('page_mode = '+active_rich.name+'_rich_page_mode;'); for(i=0;i<tables.length;i++){ if(border_mode){ tables[i].runtimeStyle.border = '1px dashed #CCCCCC'; }else{ width = tables[i].style.width; height = tables[i].style.height; var abspos = tables[i].style.position; var top = null; var left = null; if (abspos == 'absolute') { top = tables[i].style.top; left = tables[i].style.left; } tables[i].runtimeStyle.cssText = ''; if(width) tables[i].style.width = width; if(height) tables[i].style.height = height; if (abspos == 'absolute') { tables[i].style.position = abspos; tables[i].style.top = top; tables[i].style.left = left; } } rows = tables[i].rows; for(j=0;j<rows.length;j++){ cells = rows[j].cells; for(k=0;k<cells.length;k++){ if(border_mode){ cells[k].runtimeStyle.border = '1px dashed #CCCCCC'; }else{ cells[k].runtimeStyle.cssText = ''; } } }	} for(i=0;i<forms.length;i++){ if(border_mode){ forms[i].runtimeStyle.border = '1px dotted #FF0000'; }else{ forms[i].runtimeStyle.cssText = ''; }	}	if(!page_mode){	}else{	} for(i=0;i<anchors.length;i++){ if(border_mode){ if (anchors[i].href == "") { anchors[i].runtimeStyle.width = '20px'; anchors[i].runtimeStyle.height = '20px'; anchors[i].runtimeStyle.backgroundRepeat = 'no-repeat'; anchors[i].runtimeStyle.backgroundImage = 'url('+rich_path+'images/anchor.gif)'; } }else{ anchors[i].runtimeStyle.cssText = ""; }	}	var divs = active_rich.document.body.getElementsByTagName("DIV");	for (i=0;i<divs.length;i++) { if (divs[i].id == 're_editable_region') { if(border_mode) divs[i].runtimeStyle.border = "1px solid #00FF00"; else divs[i].runtimeStyle.cssText = ''; }	}}function switch_borders(change){var border_mode; eval('border_mode = '+active_rich.name+'_rich_border_mode;');	if(change){ border_mode = border_mode==true?false:true; set_state('SwitchBorders', border_mode); eval(active_rich.name+'_rich_border_mode = border_mode;');	}	set_borders(border_mode);}function insert_char(){	showModalDialog(rich_path+"dialog_char"+rich_dialog_ext+"?lang="+eval(active_rich.name+"_lang")+"&110903v", window, "dialogWidth:450px; dialogHeight:300px; status:no; scroll:no; help:no");}function color_source(code){	var parameter = /=("[^\"]*"|'[^\']*'|[^\"\'\s\&]*)(\s|&gt;)/gi;	code = code.replace(parameter,"=<font color=#0000F0>$1</font>$2");	var html_tag = /(&lt;([^&]*)&gt;)/gi;	code = code.replace(html_tag,"<font color=\"#000080\">$1</font>");	var img_tag = /<font color=\"#000080\">(&lt;IMG([^&]*)&gt;)<\/font>/gi;	code = code.replace(img_tag,"<font color=\"#800080\">$1</font>");	var table_tag = /<font color=\"#000080\">(&lt;[\/]?(table|tbody|th|tr|td){1}([^&]*)&gt;)<\/font>/gi;	code = code.replace(table_tag,"<font color=\"#008080\">$1</font>");	var link_tag = /<font color=\"#000080\">(&lt;[\/]?a([^&]*)&gt;)<\/font>/gi;	code = code.replace(link_tag,"<font color=\"#008000\">$1</font>");	var object_tag = /<font color=\"#000080\">(&lt;[\/]?object([^&]*)&gt;)<\/font>/gi;	code = code.replace(object_tag,"<font color=\"#808000\">$1</font>");	var param_tag = /<font color=\"#000080\">(&lt;[\/]?param([^&]*)&gt;)<\/font>/gi;	code = code.replace(param_tag,"<font color=\"#B00000\">$1</font>");	var comment_tag = /(&lt;\!--([^&]*)&gt;)/gi;	code = code.replace(comment_tag,"<font color=#808080>$1</font>");	var form_tag = /(&lt;[\/]?(form|input|textarea|select)([^&]*)&gt;)/gi;	code = code.replace(form_tag,"<font color=#FF8000>$1</font>");	var script_tag = /(&lt;[\/]?script([^&]*)&gt;)/gi;	code = code.replace(script_tag,"<font color=#800000>$1</font>");	return code;}function show_button(what, show){var element; eval('element = document.all.'+what+'_'+active_rich.name+';');	if(!element) return; if(show){ element.className = '';	}else{ element.className = 're_mouse_over'; element.className = 're_img_off';	}}function show_select(what, show){var element;	eval('element = document.all.'+what+'_'+active_rich.name);	if(!element) return; element.disabled=!show;}function get_editor_name(element){var pos;var button_id_parts;	if(!element) return '';	button_id_parts = element.id.match(/([^_]+)_(.+)$/);	if(button_id_parts) return button_id_parts[2];	return '';}function show_active_buttons(){var sel;var range;var is_control;var i;var text_button = Array('Bold', 'Italic', 'Underline', 'Strikethrough', 'SuperScript', 'SubScript', 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyFull', 'InsertOrderedList', 'InsertUnorderedList', 'Indent', 'Outdent', 'RemoveFormat', 'ForeColor', 'BackColor', 'PasteWord', 'InsertChar');var button_length = text_button.length;var text_select = Array('FormatBlock', 'FontName', 'FontSize');var select_length = text_select.length;var td;var tr;var table;var table_button = Array('EditTable', 'InsertRow', 'DeleteRow', 'InsertColumn', 'DeleteColumn', 'InsertCell', 'DeleteCell');var table_length = table_button.length;var form_button = Array('CreateText', 'CreateTextArea', 'CreateButton', 'CreateSelect', 'CreateHidden', 'CreateCheckBox', 'CreateRadio');var form_length = form_button.length;var visible;var element;var create_table = false;var create_image = false;var create_flash = false;var create_video = false;var create_textfield = false;var create_textarea = false;var create_button = false;var create_select = false;var create_hidden = false;var create_checkbox = false;var create_radio = false;var prev_is_control;var full_screen_mode;	if(!active_rich) return;	sel = active_rich.document.selection;	range = sel.createRange();	if(sel.type == 'Control') is_control = true; else is_control = false; eval('prev_is_control = '+active_rich.name+'_prev_is_control;'); eval(active_rich.name+'_prev_is_control = '+is_control+';');	if(!is_control){ show_button('CreateLink', range.htmlText&&sel.type=='Text'?true:false); td = get_previous_object(range.parentElement(),'TD'); tr = get_previous_object(td,'TR'); table = get_previous_object(tr,'TABLE'); for(i=0;i<table_length;i++){ show_button(table_button[i], td?true:false); } visible = tr && td.cellIndex<tr.cells.length-1; show_button('MergeCells', visible); visible = tr && td.colSpan > 1; show_button('SplitCell', visible); show_button('MergeCellsDown',table&&tr.rowIndex+td.rowSpan<table.rows.length); show_button('SplitCellDown', td && td.rowSpan > 1); if(prev_is_control != is_control){ show_button('CreateTable', true); show_button('CreateImage', true); show_button('CreateFlash', true); show_button('CreateVideo', true); show_button('InsertHorizontalRule', true); show_button('CreateForm', true); show_button('InsertSnippet', true); show_button('AbsolutePosition', false); for(i=0;i<form_length;i++){ show_button(form_button[i], true); } }	}else{ for(i=0;i<table_length;i++){ show_button(table_button[i], false); } show_button('MergeCells', false); show_button('SplitCell', false); show_button('MergeCellsDown', false); show_button('SplitCellDown', false); element = range.commonParentElement(); if(element){ switch(element.tagName){ case 'TABLE': create_table = true; break; case 'IMG': create_image = true; break; case 'OBJECT': create_flash = true; break; case 'EMBED': create_video = true; break; case 'INPUT': switch(element.type.toUpperCase()){ case 'HIDDEN': create_hidden = true; break; case 'TEXT': case 'PASSWORD': create_textfield = true; break; case 'BUTTON': case 'RESET': case 'SUBMIT': create_button = true; break; case 'CHECKBOX': create_checkbox = true; break; case 'RADIO': create_radio = true; break; default: break; } break; case 'TEXTAREA': create_textarea = true; break; case 'SELECT': create_select = true; break; default: break; } show_button('CreateTable', create_table); show_button('CreateImage', create_image); show_button('CreateFlash', create_flash); show_button('CreateVideo', create_video); show_button('CreateLink', true); show_button('InsertHorizontalRule', false); show_button('InsertSnippet', false); show_button('AbsolutePosition', true); show_button('CreateForm', false); show_button('CreateHidden', create_hidden); show_button('CreateText', create_textfield); show_button('CreateTextArea', create_textarea); show_button('CreateButton', create_button); show_button('CreateSelect', create_select); show_button('CreateCheckBox', create_checkbox); show_button('CreateRadio', create_radio); }	} if(prev_is_control != is_control){ for(i=0;i<button_length;i++){ show_button(text_button[i], !is_control); } for(i=0;i<select_length;i++){ show_select(text_select[i], !is_control); }	} show_clipboard_buttons(); visible = active_rich.document.queryCommandEnabled('Undo');	show_button('Undo', visible);	visible = active_rich.document.queryCommandEnabled('Redo');	show_button('Redo', visible); eval('full_screen_mode = '+active_rich.name+'_rich_full_screen_mode;');	if (!full_screen_mode && document.all.rich_fs_iframe.style.display == '') { show_button('FullScreen', false);	}}function show_clipboard_buttons(){var cut_copy_visible;var paste_visible;var success = true;	if(!active_rich) return; try{ cut_copy_visible = active_rich.document.queryCommandEnabled('Cut'); paste_visible = active_rich.document.queryCommandEnabled('Paste');	}catch(error){ cut_copy_visible = false; paste_visible = false; success = false;	}	if(success){ show_button('Copy', cut_copy_visible); show_button('Cut', cut_copy_visible); show_button('Paste', paste_visible); show_button('PasteWord', paste_visible);	}}function active_button(element){	if(element && element.className != 're_img_off') return true;	return false;}function get_button_object(what){var obj; eval('obj = document.all.'+what+'_'+active_rich.name+';');	return obj;}var re_prev_scrollx = 0;var re_prev_scrolly = 0;function full_screen(editor_name){var full_screen_mode;var i;var obj;var table_name = editor_name+'_table_id';var div_name = editor_name+'_div_id'; eval('full_screen_mode = '+active_rich.name+'_rich_full_screen_mode;');	if(!active_button(get_button_object('FullScreen')) || (!full_screen_mode && document.all.rich_fs_iframe.style.display == '')){ return;	}	full_screen_mode = full_screen_mode==true?false:true;	set_state('FullScreen', full_screen_mode);	eval(active_rich.name+'_rich_full_screen_mode = full_screen_mode;');	if(full_screen_mode){ re_prev_scrollx = get_scrollx(); re_prev_scrolly = get_scrolly(); document.getElementById(div_name).runtimeStyle.position = "Absolute"; document.getElementById(div_name).runtimeStyle.zIndex = "999"; document.getElementById(div_name).runtimeStyle.posTop = 0; document.getElementById(div_name).runtimeStyle.posLeft = 0; document.getElementById(div_name).runtimeStyle.width = document.body.clientWidth - 0; document.getElementById(div_name).runtimeStyle.height = document.body.offsetHeight - 4; document.getElementById(table_name).runtimeStyle.position = "Absolute"; document.getElementById(table_name).runtimeStyle.zIndex = "999"; document.getElementById(table_name).runtimeStyle.posTop = 0; document.getElementById(table_name).runtimeStyle.posLeft = 0; document.getElementById(table_name).runtimeStyle.width = document.body.clientWidth - 0; document.getElementById(table_name).runtimeStyle.height = document.body.offsetHeight - 4; document.all.rich_fs_iframe.style.display = ''; document.getElementById('rich_fs_iframe').runtimeStyle.position = "Absolute"; document.getElementById('rich_fs_iframe').runtimeStyle.zIndex = "998"; document.getElementById('rich_fs_iframe').runtimeStyle.posTop = 0; document.getElementById('rich_fs_iframe').runtimeStyle.posLeft = 0; document.getElementById('rich_fs_iframe').runtimeStyle.width = document.body.clientWidth - 0; document.getElementById('rich_fs_iframe').runtimeStyle.height = document.body.offsetHeight - 4; window.scrollTo(0, 0);	}else{ document.getElementById(table_name).runtimeStyle.cssText = ""; document.getElementById(div_name).runtimeStyle.cssText = ""; document.all.rich_fs_iframe.style.display = 'none'; setTimeout('re_restore_scroll();', 10);	}	active_rich.focus();}function re_restore_scroll(){	window.scrollTo(re_prev_scrollx, re_prev_scrolly);}function get_scrollx(){	if (document.documentElement && document.documentElement.scrollLeft) { return document.documentElement.scrollLeft;	} else if (document.body) return document.body.scrollLeft; return 0;}function get_scrolly() {	if (document.documentElement && document.documentElement.scrollTop) { return document.documentElement.scrollTop;	} else if (document.body) return document.body.scrollTop;	return 0;}function parse_context(x, y){var i;var innerHTML = '';var event;var sel;var range;var mode;var element;var td;var tr;var link_name;var flag = false;var flag2 = false;var do_hr = false;var width = 0;var height = 4;var td_height = 20;var hr_height = 4;var char_width = 8;var max_chars = 0;var chars;var lang;	if (is_editable_regs() && !inside_editable_reg()) return;	if(!rich_popup) return;	sel = active_rich.document.selection;	range = sel.createRange();	eval('mode = '+active_rich.name+'_rich_mode;'); eval('lang = '+active_rich.name+'_lang;'); eval('var dir = '+active_rich.name+'_rich_dir;'); eval('var mb = '+active_rich.name+'_rich_mb;'); if (mb != '') char_width = 14;	eval('var rich_cx = rich_cx_'+lang);	eval('var rich_cx_item = rich_cx_item_'+lang);	eval('var rich_cx_name = rich_cx_name_'+lang);	eval('var rich_cx_image = rich_cx_image_'+lang);	eval('var rich_cx_length = rich_cx_length_'+lang); try{ if(active_rich.document.queryCommandEnabled('Cut')){ if(get_button_object('Cut')){ innerHTML += get_popup_menu_item(rich_cx['CUT'], 'Cut', 'cut'); max_chars=Math.max(max_chars, rich_cx['CUT'].length); height += td_height; } if(get_button_object('Copy')){ innerHTML += get_popup_menu_item(rich_cx['COPY'], 'Copy', 'copy'); max_chars=Math.max(max_chars, rich_cx['COPY'].length); height += td_height; } do_hr = true; } if(active_rich.document.queryCommandEnabled('Paste')){ if(get_button_object('Paste')){ innerHTML += get_popup_menu_item(rich_cx['PASTE'], 'Paste', 'paste'); max_chars=Math.max(max_chars, rich_cx['PASTE'].length); height += td_height; } if(range.parentElement && get_button_object('PasteWord')){ innerHTML += get_popup_menu_item(rich_cx['PASTEWORD'], 'PasteWord', 'paste_word'); max_chars=Math.max(max_chars, rich_cx['PASTEWORD'].length); height += td_height; } do_hr = true; }	}catch(error){	}	if(mode){ if(sel.type != 'Control'){ var link = get_previous_object(range.parentElement(),'A'); var do_image = get_button_object('CreateImage'); var do_link = (link || sel.type == 'Text' && !String(range.htmlText).match(/<\/?A/i)) && get_button_object('CreateLink'); var do_table = get_button_object('CreateTable'); var do_flash = get_button_object('CreateFlash'); var do_form = get_previous_object(range.parentElement(),'FORM') && get_button_object('CreateForm'); if(do_image || do_link || do_table || do_flash || do_form){ if(do_hr){ innerHTML += get_popup_menu_item('<HR>'); height += hr_height; } do_hr = true; } if(do_image){ innerHTML += get_popup_menu_item(rich_cx['ADDIMAGE'], 'CreateImage', 'image', null, true); max_chars=Math.max(max_chars, rich_cx['ADDIMAGE'].length); height += td_height; } if(do_link){ if(link){ link_name = rich_cx['EDITLINK']; chars = rich_cx['EDITLINK'].length; }else{ link_name = rich_cx['ADDLINK']; chars = rich_cx['ADDLINK'].length; } innerHTML += get_popup_menu_item(link_name, 'CreateLink', 'link', null, true); max_chars=Math.max(max_chars, chars); height += td_height; } if(do_flash){ innerHTML += get_popup_menu_item(rich_cx['ADDFLASH'], 'CreateFlash', 'flash', null, true); max_chars=Math.max(max_chars, rich_cx['ADDFLASH'].length); height += td_height; } if(do_form){ innerHTML += get_popup_menu_item(rich_cx['EDITFORM'], 'CreateForm', 'form', null, true); max_chars=Math.max(max_chars, rich_cx['EDITFORM'].length); height += td_height; } if(do_table){ innerHTML += get_popup_menu_item(rich_cx['ADDTABLE'], 'CreateTable', 'table', null, true); max_chars=Math.max(max_chars, rich_cx['ADDTABLE'].length); height += td_height; td = get_previous_object(range.parentElement(),'TD'); tr = get_previous_object(td,'TR'); table = get_previous_object(td,'TABLE'); if(td){ innerHTML += get_popup_menu_item(rich_cx['TABLE'][0], 'EditTable', 'table_prop', null, true); max_chars=Math.max(max_chars, rich_cx['TABLE'][0].length); height += td_height; innerHTML += get_popup_menu_item(rich_cx['EDITROW'], 'EditRow', 'row_prop', null, true); max_chars=Math.max(max_chars, rich_cx['EDITROW'].length); height += td_height; innerHTML += get_popup_menu_item(rich_cx['EDITCELL'], 'EditCell', 'cell_prop', null, true); max_chars=Math.max(max_chars, rich_cx['EDITCELL'].length); height += td_height; for(i=0;i<rich_cx_length;i++){ if(get_button_object(rich_cx_item[i])){ if(i<=3 && do_hr && !flag2){ innerHTML += get_popup_menu_item('<HR>'); height += hr_height; flag2 = true; } if(i>3 && do_hr && !flag){ innerHTML += get_popup_menu_item('<HR>'); height += hr_height; flag = true; } innerHTML += get_popup_menu_item(rich_cx_name[i], rich_cx_item[i], rich_cx_image[i]); max_chars=Math.max(max_chars, rich_cx_name[i].length); height += td_height; do_hr = true; } } } if(tr && td.cellIndex<tr.cells.length-1 && get_button_object('MergeCells')){ if(!flag){ innerHTML += get_popup_menu_item('<HR>'); height += hr_height; flag = true; } innerHTML += get_popup_menu_item(rich_cx['MERGE'], 'MergeCells', 'mergecells'); max_chars=Math.max(max_chars, rich_cx['MERGE'].length); height += td_height; } if(tr && td.colSpan > 1 && get_button_object('SplitCell')){ if(!flag){ innerHTML += get_popup_menu_item('<HR>'); height += hr_height; } innerHTML += get_popup_menu_item(rich_cx['SPLIT'], 'SplitCell', 'splitcell'); max_chars=Math.max(max_chars, rich_cx['SPLIT'].length); height += td_height; } if(table && tr.rowIndex+td.rowSpan<table.rows.length && get_button_object('MergeCellsDown')){ if(!flag){ innerHTML += get_popup_menu_item('<HR>'); height += hr_height; flag = true; } innerHTML += get_popup_menu_item(rich_cx['MERGEDOWN'], 'MergeCellsDown', 'mergecellsdown'); max_chars=Math.max(max_chars, rich_cx['MERGEDOWN'].length); height += td_height; } if(td && td.rowSpan > 1 && get_button_object('SplitCellDown')){ if(!flag){ innerHTML += get_popup_menu_item('<HR>'); height += hr_height; } innerHTML += get_popup_menu_item(rich_cx['SPLITDOWN'], 'SplitCellDown', 'splitcelldown'); max_chars=Math.max(max_chars, rich_cx['SPLITDOWN'].length); height += td_height; } } }else{ if(get_button_object('CreateLink')){ if(do_hr){ innerHTML += get_popup_menu_item('<HR>'); height += hr_height; } var link = get_previous_object(range.commonParentElement(),'A'); var action = 'CreateLink'; if(link){ if (link.href == "") { link_name = rich_cx['EDITANCHOR']; action = 'CreateAnchor'; } else link_name = rich_cx['EDITLINK']; }else link_name = rich_cx['ADDLINK']; innerHTML += get_popup_menu_item(link_name, action, 'link', null, true); max_chars=Math.max(max_chars, link_name.length); height += td_height; do_hr = true; } element = range.commonParentElement(); var tag_name = element.tagName; if(tag_name == 'INPUT') tag_name = element.type.toUpperCase(); if(rich_cx[tag_name] && get_button_object(rich_cx[tag_name][1])){ if(do_hr){ innerHTML += get_popup_menu_item('<HR>'); height += hr_height; } innerHTML += get_popup_menu_item(rich_cx[tag_name][0], rich_cx[tag_name][1], rich_cx[tag_name][2], null, true); max_chars=Math.max(max_chars, rich_cx[tag_name][0].length); height += td_height; do_hr = true; } }	} if(innerHTML != ''){ innerHTML = get_popup_menu_body(innerHTML); active_rich.frameWindow = active_rich; event = active_rich.frameWindow.event; width = max_chars*char_width+40; rich_popup.document.body.innerHTML = innerHTML; rich_popup.document.body.dir = dir; rich_popup.show(event.clientX, event.clientY, width, height, active_rich.document.body);	}}function get_popup_menu_item(name, action, img_name, value, is_dialog){var code = '';	code += '<tr>';	if(name != '<HR>'){ code += '<td id="rich_cx_'+action+'" onclick="eval(\'var active_mode = parent.\'+parent.active_rich.name+\'_rich_active_mode;\'); if(active_mode) parent.show_active_buttons(); parent.re_hide_context(); parent.'; if(is_dialog){ code += 'show_dialog(\''+action+'\')'; }else{ code += 'do_action(\''+action+'\''; if(value != null) code += ',\''+value+'\''; code += '); if(parent.rich_popup) parent.rich_popup.hide();'; } code += '" style="cursor:hand; font-family:Courier; font-size:13px;"'; code += ' onmouseover="parent.context_over(this, true);"'; code += ' onmouseout="parent.context_over(this);">';	}else{ code += '<td>';	}	code += '<nobr>';	if(img_name){ code += '<img src="'+rich_path+'images/'+img_name+'.gif" width="20" height="20" alt="'+name+'" align="absmiddle" hspace="4">';	}else{ code += '<img src="'+rich_path+'images/space.gif" width="20" height="1" hspace="4">';	}	if(name != '<HR>'){ code += name;	}else{ code += '<br><img src="'+rich_path+'images/space.gif" width="100%" height="1" style="BACKGROUND-COLOR: buttonshadow"><br>'; code += '<img src="'+rich_path+'images/space.gif" width="100%" height="1" style="BACKGROUND-COLOR: buttonhighlight"><br>';	}	code += '<img src="'+rich_path+'images/space.gif" width="8" height="1"></nobr>';	code += '</td></tr>';	return code;}function get_popup_menu_body(innerHTML){var code = '';	code += '<table cellspacing="0" cellpadding="0" border="0" style="BORDER-LEFT: 1px solid buttonface; BORDER-RIGHT: 1px solid black; BORDER-TOP: 1px solid buttonface; BORDER-BOTTOM: 1px solid black;" bgcolor="buttonface" width="100%" height="100%">';	code += '<tr><td>';	code += '<table id="popup_table" cellspacing="0" cellpadding="0" border="0" style="BORDER-LEFT: 1px solid buttonhighlight; BORDER-RIGHT: 1px solid buttonshadow; BORDER-TOP: 1px solid buttonhighlight; BORDER-BOTTOM: 1px solid buttonshadow;" bgcolor="buttonface" width="100%" height="100%">';	code += innerHTML;	code += '</table>';	code += '</td></tr>';	code += '</table>';	return code;}function context_over(obj, over){	if(over){ obj.style.backgroundColor = 'Highlight'; obj.style.color = 'HighlightText';	}else{ obj.style.backgroundColor = ''; obj.style.color = '';	}}function insert_snippet(value){var selection = active_rich.document.selection;var range;var snippets;var border_mode;	if(selection) range = selection.createRange();	if(value && range && range.parentElement){ var s_parts = value.match(/^([^_]*)_([0-9]+)$/); if(!s_parts) return; var s_group = s_parts[1]; var s_value = s_parts[2]; eval('snippets = '+active_rich.name+'_snippets;'); if(snippets && snippets[s_group] && snippets[s_group][s_value] && snippets[s_group][s_value][1]){ range.pasteHTML(snippets[s_group][s_value][1]); eval('border_mode = '+active_rich.name+'_rich_border_mode;'); set_borders(border_mode); }	}}function add_handlers(editor){	if(rich_msie_version < 5.5){ editor.document.oncontextmenu = function(){ re_hide_lists(); active_rich=editor; parse_context_ie5(); return false; };	}else{ editor.document.oncontextmenu = function(){ var e = editor.event; re_hide_lists(); active_rich=editor; re_hide_context(); change_toolbar_state(); parse_context(e.clientX, e.clientY); return false; };	}	editor.document.onkeyup = function(){ var key_code = active_rich.event.keyCode; active_rich=editor; if (key_code > 36 && key_code < 41 || key_code == 8 || key_code == 13) { change_toolbar_state(); } eval('var mode = '+active_rich.name+'_rich_mode;'); if (mode && (editor.event.ctrlKey && key_code == 86 || editor.event.shiftKey && key_code == 45)) { re_upload(); return false; }	};	editor.document.onclick = function(){ re_hide_lists(); active_rich=editor; if(!is_editable_regs()) active_rich.focus(); else { var a_obj = get_previous_object(active_rich.frameWindow.event.srcElement, 'A'); if (a_obj) { return false; } } change_toolbar_state();	};	editor.document.onselectionchange = function(){ active_rich=editor; active_rich.document.execCommand("2D-Position", false, true);	};	editor.document.onmouseup = function(){ re_hide_lists(); active_rich = editor; re_hide_context(); active_rich.frameWindow = active_rich; if(active_rich.frameWindow.event.button != 2){ change_toolbar_state(); }	};	document.onclick = function(){	var obj = window.event.srcElement; if (obj.tagName == 'SELECT' && obj.className == 're_text') return; re_hide_lists(); re_hide_context();	};	eval('var br_on_enter = '+active_rich.name+'_br_on_enter;'); editor.document.onkeydown = function(){ if (is_editable_regs() && !inside_editable_reg()) return false; if (editor.event.keyCode == 9) return false; eval('var mode = '+active_rich.name+'_rich_mode;'); if (mode && (editor.event.ctrlKey && editor.event.keyCode == 86 || editor.event.shiftKey && editor.event.keyCode == 45)) { eval('var clean_paste = '+active_rich.name+'_clean_paste;'); if (clean_paste) { do_action('PasteWord'); return false; } } if (br_on_enter || !mode) { active_rich = editor; var sel = active_rich.document.selection; if (sel.type == 'Control') return; if (active_rich.event.keyCode == 13) { var r = sel.createRange(); if (!active_rich.event.shiftKey || !mode) { r.pasteHTML("<BR>"); r.select(); r.collapse(false); return false; } else { if (active_rich.document.queryCommandValue('InsertOrderedList') || active_rich.document.queryCommandValue('InsertUnorderedList')) { var li = r.parentElement?get_previous_object(r.parentElement(),'LI'):null; if (li && li.innerHTML == '') { active_rich.document.execCommand("Outdent", false); } else { r.pasteHTML("<li></li>"); r.moveStart("character", -1); r.collapse(true); r.select(); } } else { r.pasteHTML("<P>&nbsp;</P>"); r.moveStart("character", -1); r.moveStart("character", 1); r.collapse(true); r.select(); } return false; } } } else return true; var e = active_rich.event; if (e.ctrlKey && e.keyCode == 85 && typeof(re_upload_remote_resources) == 'function') { var files_path = eval(active_rich.name+"_files_path"); if (typeof(files_path) == 'object') { if (re_upload_path_index && !e.altKey) { re_upload_remote_resources(re_upload_path_index); } else { var w = 200; var h = 100; var attrib = new Array(); attrib['parent_win'] = window; showModalDialog(rich_path+"dialog_upload"+rich_dialog_ext+"?browser=&lang="+eval(active_rich.name+"_lang")+"&"+rich_sess_param+"&110903lqmmmmm", attrib, "dialogWidth:"+w+"px; dialogHeight:"+h+"px; status:no; scroll:no; help:no"); } } else { re_upload_remote_resources(); } return false; }	};	editor.document.body.ondrop = function(){ active_rich = editor; setTimeout('re_upload();', 5);	}; re_set_image_resize_handlers(editor);}function del_base_url(text, urls_only){	var re_text = rich_base_url;	var new_text = "";	if (urls_only) { re_text = '((src|href|background)="?)' + re_text; new_text = "$1";	}var re = new RegExp(re_text, 'gi');	RegExp.multiline = true;	return text.replace(re, new_text);}function get_rich_content(editor, dont_restore_borders) {	if (!editor) return '';var mode;var editor_content;var page_mode;var border_mode;var name;var abs_path;var old_active_rich = active_rich;	active_rich = editor;	eval('mode = '+active_rich.name+'_rich_mode;'); name = active_rich.name; eval('page_mode = '+name+'_rich_page_mode;'); eval('border_mode = '+active_rich.name+'_rich_border_mode;'); eval('abs_path = '+active_rich.name+'_rich_absolute_path;');var xhtml_mode = get_xhtml_mode(); if (xhtml_mode) { eval('var doc_lang = '+active_rich.name+'_rich_doc_lang;'); eval('var doc_charset = '+active_rich.name+'_rich_doc_charset;');	}	if(!mode){ editor_content = active_rich.document.body.innerText;	}else{ re_remove_image_resize_attrs(editor); if(border_mode){ set_borders(false); } if(!page_mode){ if (xhtml_mode) editor_content = get_xhtml(active_rich.document.body, doc_lang, doc_charset); else editor_content = active_rich.document.body.innerHTML; }else{ if (xhtml_mode) editor_content = get_xhtml(active_rich.document, doc_lang, doc_charset); else editor_content = active_rich.document.documentElement.outerHTML; editor_content = delete_default_stylesheets(editor_content); } var loc = String(document.location).replace('&', '&amp;').replace('?', '\\?'); loc = loc.split('#'); loc[0] = String(loc[0]).replace(/([\(\)\[\]])/g, '\\$1'); var re = new RegExp(loc[0]+'#', 'gi'); RegExp.multiline = true; editor_content = editor_content.replace(re, '#'); var re = new RegExp('&amp;', 'gi'); editor_content = editor_content.replace(re, '&'); editor_content = editor_content.replace(/&#13;&#10;/g, '\n'); editor_content = re_convert_script_tags(editor_content, true);/* editor_content = editor_content.replace(/<!--re_php_tag_open/g, '<?php'); editor_content = editor_content.replace(/re_php_tag_close-->/g, '?>'); editor_content = editor_content.replace(/<!--re_asp_tag_open/g, '<%'); editor_content = editor_content.replace(/re_asp_tag_close-->/g, '%>');*/ editor_content = format_content(editor_content); if(!abs_path) editor_content = del_base_url(editor_content, 1); if(border_mode && !dont_restore_borders){ set_borders(true); }	}	active_rich = old_active_rich;	return editor_content;}function re_convert_script_tags(content, to_tags) {	if (to_tags) { content = content.replace(/<!--re_php_tag_open/g, '<?php'); content = content.replace(/re_php_tag_close-->/g, '?>'); content = content.replace(/<!--re_asp_tag_open/g, '<%'); content = content.replace(/re_asp_tag_close-->/g, '%>');	} else { content = content.replace(/<\?php/gi, '<!--re_php_tag_open'); content = content.replace(/\?>/g, 're_php_tag_close-->'); content = content.replace(/<%/g, '<!--re_asp_tag_open'); content = content.replace(/%>/g, 're_asp_tag_close-->');	}	return content;}function set_default_stylesheets(){var i; eval('var rich_css = '+active_rich.name+'_rich_css;'); for (i in rich_css) { active_rich.document.createStyleSheet(rich_css[i]);	}}function delete_default_stylesheets(editor_content){var i;var name = active_rich.name;var xhtml_mode = get_xhtml_mode();eval('var rich_css = '+name+'_rich_css;');	if (xhtml_mode) var ch = " /"; else var ch = ""; for (i in rich_css) { if (!xhtml_mode) var re = new RegExp('<link href="'+rich_css[i]+'" rel=stylesheet>','gi'); var re2 = new RegExp('<link href="'+rich_css[i]+'" rel="stylesheet"'+ch+'>','gi'); RegExp.multiline = true; editor_content=editor_content.replace(re2,''); if (xhtml_mode) { var re2 = new RegExp('<link style="" href="'+rich_css[i]+'" rel="stylesheet"'+ch+'>','gi'); RegExp.multiline = true; editor_content=editor_content.replace(re2,''); } if (!xhtml_mode) editor_content=editor_content.replace(re,'');	}	return editor_content;}function get_rich(name) {	if (!name) return '';	return get_rich_content(get_editor_id(name));}function set_rich(name, content) {	if (!name) return;	return set_rich_content(get_editor_id(name), content);}function get_editor_id(name) {	var ar_pos = name.indexOf("[");	var id = '';	if (ar_pos > 0) { var ar_end_pos; ar_end_pos = name.length-1; id = name.substring(ar_pos+1, ar_end_pos); name = name.substring(0, ar_pos); var parts = id.split(']['); if (parts) { id = parts.join('_') } else id = '';	}	eval('var editor = '+name+'_ed'+id+'_id;'); return editor;}function set_rich_content(editor, content) {	if (!editor) return;var mode;var page_mode;var border_mode;var old_active_rich = active_rich;	active_rich = editor;	eval('mode = '+active_rich.name+'_rich_mode;'); var name = active_rich.name; eval('page_mode = '+name+'_rich_page_mode;'); eval('border_mode = '+active_rich.name+'_rich_border_mode;');	if (!mode) { active_rich.document.body.innerText = content; active_rich.document.body.innerHTML = color_source(active_rich.document.body.innerHTML);	} else { content = re_convert_script_tags(content, false);/* content = content.replace(/<\?php/gi, '<!--re_php_tag_open'); content = content.replace(/\?>/g, 're_php_tag_close-->'); content = content.replace(/<%/g, '<!--re_asp_tag_open'); content = content.replace(/%>/g, 're_asp_tag_close-->');*/ if (!page_mode) { content = '<body>'+content+'</body>'; } active_rich.document.write(content); active_rich.document.close(); add_handlers(active_rich); set_default_stylesheets(); if(border_mode) { set_borders(true); } set_stylesheet_rules();	} active_rich = old_active_rich;	return true;}function get_xhtml_mode(){ eval('var xhtml_mode = '+active_rich.name+'_rich_xhtml_mode;');	try { var is_xhtml = get_xhtml?true:false;	} catch(e) { var is_xhtml = false;	}	return xhtml_mode&&is_xhtml?true:false;}function dec2hex(num) {var i;var hex_num = '';	for (i=1;i<=3;i++) { var cur_pair = num&0xff; var d1 = cur_pair>>4; var d2 = cur_pair&0x0f; hex_num += d1.toString(16)+d2.toString(16); num = num>>8;	}	return '#'+hex_num;}function insert_to(action) {var range = active_rich.document.selection.createRange();	if (!get_previous_object(range.parentElement(),'TABLE')) return null;	var lang = eval(active_rich.name+"_lang");	var ins_data = showModalDialog(rich_path+"dialog_adv_table"+rich_dialog_ext+"?lang="+lang+"&action="+action+"&browser=&e", null, "dialogWidth:190px; dialogHeight:70px; scroll:no; status:no; help:no;");	if (ins_data) return parseInt((String(ins_data[0]).split('='))[1]);	return null;}function re_show_list(sel_obj, h2content){var i;var obj = document.getElementById(sel_obj.id + '_iframe');	re_hide_context();	if (obj.style.display == '') { obj.style.display = 'none'; return;	}	re_hide_lists();	var obj_doc = eval(obj.id+'.document'); var parts = String(obj.id).split('_');	var type = parts[0];	var style_text = '';	if (type == 'ClassName') { var styles = active_rich.document.styleSheets; var sheets_num = styles.length; for (i=0; i<sheets_num; i++) { style_text += styles[i].cssText; }	}var content = '<html>'+'<head><style type="text/css">'+style_text+'.re_list_over{background-color:Highlight;color:HighlightText}.re_list_out{background-color:#ffffff;color:#000000}</style></head>'+'<body topmargin=0 leftmargin=0 rightmargin=0 bottommargin=0 style="border: 1px solid #000000; background:#ffffff">'+'<div id="content_div" style="overflow:hidden; width:100%;">'+'<table border="0" style="cursor:hand" cellspacing="0" width="100%">';	var sel_len = sel_obj.options.length;	var sel_opt = sel_obj.options;	if (!sel_len) return;	for (i=0;i<sel_len;i++) { content += '<tr><td onClick="parent.do_action(\''+type+'\', \''+sel_opt[i].value+'\');" onmouseover="this.className = \'re_list_over\'" onmouseout="this.className=\'re_list_out\'">'; switch (type) { case 'FormatBlock': content += '<nobr>'+sel_opt[i].value+sel_opt[i].text+'</nobr>'; break; case 'FontName': content += '<nobr><font face="'+sel_opt[i].value+'">'+sel_opt[i].text+'</font></nobr>'; break; case 'FontSize': content += '&nbsp;&nbsp;&nbsp;&nbsp;<font size="'+sel_opt[i].value+'">'+sel_opt[i].text+'</font>&nbsp;&nbsp;&nbsp;&nbsp;'; break; case 'ClassName': content += '<nobr><span class="'+sel_opt[i].value+'">'+(sel_opt[i].text!=''?sel_opt[i].text:'&nbsp;')+'</span></nobr>'; break; default: break; } content += '</td></tr>';	}	content += '</table>'+'</div>'+'</body></html>';	obj_doc.open();	obj_doc.write(content);	obj_doc.close();var sel_pos = get_element_pos(sel_obj);	obj.style.left = sel_pos[0] + 2 + 'px';	obj.style.top = sel_pos[1] + sel_obj.offsetHeight + 2 + 'px';	obj.style.display = "";	var new_height = obj_doc.getElementById('content_div').offsetHeight; if (h2content || new_height < obj.getAttribute('ini_height')) { obj.height = new_height+2;	} else obj.height = obj.getAttribute('ini_height');}function get_element_pos(obj){var pos = Array(0,0);	while (obj) { if (obj.currentStyle.position == 'absolute') break; pos[0] += obj.offsetLeft; pos[1] += obj.offsetTop; obj = obj.offsetParent;	}	return pos;}function re_hide_lists(){var iframes = document.body.getElementsByTagName("IFRAME");var i;	for (i=0; i<iframes.length; i++) { var obj = iframes[i]; if (obj.className == 're_list_iframe') if (obj.style.display == '') { obj.style.display = 'none'; var list_id = String(obj.id).replace(/_iframe$/,''); var list = document.getElementById(list_id); list.disabled = false; }	}}function show_editable_regs(editor){	if (!editor) editor = active_rich;var divs = editor.document.body.getElementsByTagName("DIV");var div_length = divs.length;	for (var i=0; i<div_length; i++) { if (divs[i].id == "re_editable_region") { divs[i].contentEditable = true; divs[i].designMode = true; }	}}function is_editable_regs(){	eval('var ed_regs = '+active_rich.name+'_editable_regions;');	return ed_regs;}function inside_editable_reg(){	if(rich_msie_version < 5.5) return false;var sel = active_rich.document.selection;var r = sel.createRange();	if (sel.type == 'Control') is_control = true; else is_control = false;	var obj;	if (is_control) obj = r.commonParentElement(); else obj = r.parentElement();	while (obj && obj.id != 're_editable_region') obj = obj.parentNode;	if (obj) return true;	return false;}function format_content(code){var i;var xhtml_mode = get_xhtml_mode();var need_nl_before = /\<(div|p|table|tbody|thead|tr|td|th|title|script|comment|li|meta|h1|h2|h3|h4|h5|h6|hr|ul|ol|option|link|pre)[^\>]*\>/gi;var need_nl_after = /\<\/(div|p|table|tbody|thead|tr|td|th|title|script|comment|li|meta|h1|h2|h3|h4|h5|h6|hr|ul|ol|option|link|br|pre)[^\>]*\>/gi;var need_nl_both = /\<[\/]?(style|head|body|html)[^\>]*\>/gi;	eval('var indent_char = '+active_rich.name+'_indent;');var indent_inc = new RegExp();	indent_inc.compile("^\<(head|table|tbody|thead|tr|ul|ol)[^\>]*\>", "i");var indent_dec = new RegExp();	indent_dec.compile("^\<\/(head|table|tbody|thead|tr|ul|ol)[^\>]*\>", "i");var nl = /\s*[\r\n]+\s*/g;	code = code.replace(need_nl_before, "\n$&");	code = code.replace(need_nl_after, "$&\n");	code = code.replace(need_nl_both, "\n$&\n");	var code_lines = code.split(nl);	var new_code = "";	var indent = "";	var no_indent = false;	for (i=0; i<code_lines.length; i++) { if (code_lines[i] == "") continue; if (new_code != "") new_code += "\n"; if (indent_dec.exec(code_lines[i])) indent = indent.replace(indent_char, ""); var new_line = code_lines[i]; if (typeof(fix_entities) == "function" && !xhtml_mode) new_line = fix_entities(new_line); if (!no_indent) new_code += indent; new_code += new_line; var low_line = new_line.toLowerCase(); var k = low_line.lastIndexOf("<textarea"); var k2 = low_line.lastIndexOf("</textarea"); if (k > 0 && (k2 < 0 || k > k2)) no_indent = true; if (!no_indent && low_line.match(/\<pre/i)) no_indent = true; if (k2 > 0 && (k < 0 || k2 > k)) no_indent = false; if (no_indent && low_line.match(/\<\/pre/i)) no_indent = false; if (indent_inc.exec(code_lines[i]) && !no_indent) indent += indent_char;	}	return new_code;}function re_focus(name) {	active_rich = get_editor_id(name);	active_rich.focus();}function paste_html(text) {var r = active_rich.document.selection.createRange();	r.pasteHTML(text);}function re_get_window_size(){var width = document.body.clientWidth;var height = document.body.offsetHeight;	return Array(width, height);}function re_hide_context(){var cx_div = document.getElementById('re_context_div_id');	cx_div.style.display = 'none';}function re_set_image_resize_handlers(editor) {	if (!editor) editor = active_rich;var onresizestart = function() {var e = active_rich.event;	if (e.ctrlKey) return; var src_obj = e.srcElement; src_obj.setAttribute('xwidth', src_obj.style.width);	src_obj.setAttribute('xheight', src_obj.style.height);};var onresize = function() {var e = active_rich.event;	if (e.ctrlKey) return; var src_obj = e.srcElement;	var old_width = parseInt(src_obj.getAttribute('xwidth'));var old_height = parseInt(src_obj.getAttribute('xheight'));var new_width = parseInt(src_obj.style.width);var new_height = parseInt(src_obj.style.height);	if (old_width != new_width) { src_obj.style.height = parseInt(old_height/old_width*new_width)+'px';	} else { src_obj.style.width = parseInt(old_width/old_height*new_height)+'px';	}	return false;};var imgs = editor.document.body.getElementsByTagName('IMG');var i;	for (i=0; i<imgs.length; i++) { imgs[i].onresizestart = onresizestart; imgs[i].onresizeend = onresize;	}}function re_remove_image_resize_attrs(editor) {	if (!editor) editor = active_rich;var imgs = editor.document.body.getElementsByTagName('IMG');var i;	for (i=0; i<imgs.length; i++) { imgs[i].removeAttribute('xwidth'); imgs[i].removeAttribute('xheight');	}}function re_upload() {	if (typeof(re_upload_remote_resources) == 'function') { eval('var auto_upload = '+active_rich.name+'_auto_upload;'); if (auto_upload) re_upload_remote_resources(re_upload_path_index);	}}function no_error(){	return true;}