//	rich editor js
	var ua = navigator.userAgent.toLowerCase();
	var isIE = ((ua.indexOf("msie") != -1) && (ua.indexOf("opera") == -1) && (ua.indexOf("webtv") == -1)); 
	var rng = null;
	var flvPlayerCode = '<script src="/htm-webaxy/flowplayer/flowplayer-3.0.0-rc5.min.js"></script><script src="/htm-webaxy/flowplayer/webaxySetup.js"></script>';
	var postEditorsCode = '<script>webaxyHiddenProperties = "'+rte_lang.webaxyHiddenProperties+'";</script><script src="/htm-webaxy/editor/postEditors.js"></script>';

	var editor_min_width = 753;
	var editor_def_height = 320;
	var editor_msg = "";
	// ===== EDITOR CODE (full) ===========
	var editor_code = "";
	editor_code += '<div class="bg_editor">';
	editor_code += '<table cellPadding="0" cellspacing="0" style="direction:'+rte_lang.direction+';">';
	editor_code += '<tr id="EDITOR_NAME rteMenu1">';
	editor_code += '<td class="rte_td" style="color:#000000;" >';
	editor_code += 'EDITOR_TITLE ';
	editor_code += '<input type="radio" name="type EDITOR_NAME" id="type0 EDITOR_NAME" value="div_editor EDITOR_NAME" onclick="setCellType(this);" EDITOR_TYPE0><label for="type0 EDITOR_NAME">'+rte_lang.editor+'</label> &nbsp; ';
	editor_code += '<input type="radio" name="type EDITOR_NAME" id="type1 EDITOR_NAME" value="div_text EDITOR_NAME"    onclick="setCellType(this);" EDITOR_TYPE1><label for="type1 EDITOR_NAME">'+rte_lang.text+'</label> &nbsp; ';
	editor_code += '<input type="checkbox" name="lockEditor EDITOR_NAME" id="lockEditor EDITOR_NAME" value="1" onclick="lockEditor(this);"><label for="lockEditor EDITOR_NAME">'+rte_lang.lockEditor+'</label> &nbsp; ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/clear.png" id="clean EDITOR_NAME" title="'+rte_lang.alt_clear_styles+'" class="rte_buttons" onclick="cleanAll(\'EDITOR_NAME\');" style="cursor:pointer">&nbsp; ';
	editor_code += '</td>';
	editor_code += '</tr>';
	
	editor_code += '<tr>';
	editor_code += '<td style="padding:0px 0px 0px 0px;">';
	
	editor_code += '<div id="cell EDITOR_NAME">';
	editor_code += '<div id="div_editor EDITOR_NAME">';
	editor_code += '<table cellpadding="0" cellspacing="0" >';
	editor_code += '<tr>';
	editor_code += '<td class="rte_td">';
	
	editor_code += '<table cellpadding="0" cellspacing="0" id="EDITOR_NAME rteMenu2">';
	editor_code += '<tr>';
	editor_code += '<td class="rte_td">';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/fgcolor.png"     title="'+rte_lang.alt_color+'"                    class="rte_buttons" onclick="setRange(\'EDITOR_NAME\'); window.frames[\'colorPicker\'].getColor(30, document.body.scrollTop+event.clientY+20, \'\', \'setColor(\\\'EDITOR_NAME\\\',\\\'forecolor\\\',%%color%%) \', \' '+rte_lang.alt_color+' \'); moveCP(30,event.clientY);"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/bgfcolor.png"    title="'+rte_lang.alt_hilite+'"  class="rte_buttons" onclick="setRange(\'EDITOR_NAME\'); window.frames[\'colorPicker\'].getColor(30, document.body.scrollTop+event.clientY+20, \'\', \'setColor(\\\'EDITOR_NAME\\\',\\\'hilitecolor\\\',%%color%%) \', \' '+rte_lang.alt_hilite+' \'); moveCP(30,event.clientY);"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif">';
	editor_code += '<select onchange="if (this.value) setCssFontSize(\'EDITOR_NAME\',this.value);  this.selectedIndex=0;">';
	editor_code += '<option value="">'+rte_lang.font_size+'</option><option value="8px">8</option><option value="10px">10</option><option value="11px">11</option><option value="12px">12</option><option value="13px">13</option><option value="14px">14</option><option value="15px">15</option><option value="16px">16</option><option value="18px">18</option><option value="20px">20</option><option value="22px">22</option><option value="24px">24</option><option value="26px">26</option><option value="28px">28</option><option value="30px">30</option><option value="36px">36</option><option value="45px">45</option><option value="60px">60</option><option value="70px">70</option><option value="80px">80</option><option value="100px">100</option><option value="110px">110</option><option value="120px">120</option><option value="140px">140</option><option value="150px">150</option>';
	editor_code += '</select> ';
	editor_code += '<select onchange="if (this.value) RTEdo(\'EDITOR_NAME\',\'fontname\',this.value); this.selectedIndex=0;">';
	editor_code += '<option value="">'+rte_lang.font_face;
	for (f=0;f<rte_lang.fonts.length;f++) {
		editor_code += '<option value="'+rte_lang.fonts[f].toLowerCase()+'">'+rte_lang.fonts[f]+'';
	}
	editor_code += '</select>';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif">';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/b.png" title="'+rte_lang.alt_bold+'"        class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'bold\',\'\');"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/i.png"  title="'+rte_lang.alt_italic+'"       class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'italic\',\'\');"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/u.png" title="'+rte_lang.alt_under+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'underline\',\'\');"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif">';
	
	editor_code += '<table cellpadding="0" cellspacing="0" border="0" style="direction:ltr; display:inline; margin:0px;" >';
	editor_code += '<tr>';
	editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-left.png"      title="'+rte_lang.alt_align_left+'"      class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifyleft\',\'\');"></td>';
	editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-center.png"  title="'+rte_lang.alt_align_center+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifycenter\',\'\');"></td>';
	editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-right.png"     title="'+rte_lang.alt_align_right+'"   class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifyright\',\'\');"></td>';
	editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-full.png"       title="'+rte_lang.alt_align_just+'"     class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifyfull\',\'\');"></td>';
	editor_code += '</tr>';
	editor_code += '</table>';
	
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif">';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/list123.png" title="'+rte_lang.alt_list_n+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'insertorderedlist\',\'\');"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/list.png"      title="'+rte_lang.alt_list_b+'"    class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'insertunorderedlist\',\'\');"> ';
	editor_code += ' <img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/undo.png" title="'+rte_lang.alt_undo+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'undo\',\'\');"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/redo.png" title="'+rte_lang.alt_redo+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'redo\',\'\');"> ';
	
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif">';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/link.png"  title="'+rte_lang.alt_link+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'link\',event.clientX+300,event.clientY)"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/img.png" title="'+rte_lang.alt_insert_image+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'img\',event.clientX+300,event.clientY)"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/flv.png" title="'+rte_lang.alt_insert_flv+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'flv\',event.clientX+300,event.clientY)"> ';
	//editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/code.png" title="'+rte_lang.alt_insert_code+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'code\',event.clientX+400,event.clientY)"> ';
	
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/addObject.png" title="'+rte_lang.add+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'addMenu\',event.clientX+400,event.clientY)"> ';
	
	//editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/contact.png" title="'+rte_lang.add_contact+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'contact\',event.clientX+300,event.clientY)"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/table.png" title="'+rte_lang.alt_insert_table+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'table\',event.clientX+300,event.clientY)"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/tdbgcolor.png" title="'+rte_lang.alt_table_cell+'" class="rte_buttons" onclick="setRange(\'EDITOR_NAME\'); window.frames[\'colorPicker\'].getColor(30, document.body.scrollTop+event.clientY+20, \'\', \'setBgcolor(\\\'EDITOR_NAME\\\',%%color%%) \', \' '+rte_lang.alt_table_cell+' \'); moveCP(30,event.clientY);"> ';
	editor_code += '</td>';
	editor_code += '</tr>';
	editor_code += '</table>';
	
	editor_code += '</td>';
	editor_code += '</tr>';
	editor_code += '<tr>';
	editor_code += '<td style="background-color:#ffffff;">';
	editor_code += '<input type="hidden" name="style EDITOR_NAME" id="style EDITOR_NAME" value="EDITOR_CSS">';
	editor_code += '<iframe id="editor EDITOR_NAME" name="editor EDITOR_NAME" src="'+rte_lang.htm_webaxy+'/editor/blank.htm" frameborder="0" scrolling="auto" style=" height:EDITOR_HEIGHT; width:EDITOR_WIDTH;"></iframe>';
	editor_code += '</td></tr>';
	
	editor_code += '<tr>';
	editor_code += '<td class="rte_td">';
	
	editor_code += '<table cellpadding="0" cellspacing="0" border="0" id="EDITOR_NAME rteMenu3" style="width:100%">';
	editor_code += '<tr>';
	editor_code += '<td class="rte_td" style="width:30%"><img src="'+rte_lang.htm_webaxy+'/editor/buttons/enlarge.png" title="'+rte_lang.alt_enlarge+'"  class="rte_buttons" onclick="enlargeRTE(\'EDITOR_NAME\')"></td>';
	editor_code += '<td class="rte_td">';
	
		editor_code += '<div>';

	editor_code += '<b>'+rte_lang.cell+':</b> ';
	editor_code += ' <img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	editor_code += '<table cellpadding="0" cellspacing="0" border="0" style="direction:ltr;display:inline;">';
	editor_code += '<tr>';
	editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/ltr.png" title="'+rte_lang.alt_ltr+'"  class="rte_buttons" onclick="addStyle(\'EDITOR_NAME\',\'direction\',\'ltr\')"></td>';
	editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/rtl.png" title="'+rte_lang.alt_rtl+'" class="rte_buttons" onclick="addStyle(\'EDITOR_NAME\',\'direction\',\'rtl\')"></td>';
	editor_code += '</tr>';
	editor_code += '</table>';

	editor_code += ' <img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/font.png"  title="'+rte_lang.insert_fontProperties+'"             class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'fontProperties\',event.clientX,event.clientY - 300)"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/fgcolor.png"  title="'+rte_lang.alt_cell_font_color+'"             class="rte_buttons" onclick="window.frames[\'colorPicker\'].getColor(30,document.body.scrollTop+event.clientY+20, getStyle(\'EDITOR_NAME\',\'color\'), \'addStyle(\\\'EDITOR_NAME\\\',\\\'color\\\',%%color%%) \', \' '+rte_lang.alt_cell_font_color+' \'); moveCP(event.clientX,event.clientY - 300);"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/bgcolor.png" title="'+rte_lang.alt_cell_bgcolor+'"   class="rte_buttons" onclick="window.frames[\'colorPicker\'].getColor(30, document.body.scrollTop+event.clientY+20, getStyle(\'EDITOR_NAME\',\'background-color\'), \'addStyle(\\\'EDITOR_NAME\\\',\\\'background-color\\\',%%color%%) \', \' '+rte_lang.alt_cell_bgcolor+' \'); moveCP(event.clientX,event.clientY - 300);"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/bgimg.png"   title="'+rte_lang.alt_cel_bgimg+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'bgimg\',event.clientX,event.clientY - 300)"> ';
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif">';
	
	editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/border.png" title="'+rte_lang.alt_border_padding+'"  class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'cell\',event.clientX,event.clientY - 300)">';
	editor_code += ' <img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	//editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/clear.png" title="'+rte_lang.alt_clear_styles+'" class="rte_buttons" onclick="cleanAll(\'EDITOR_NAME\');"> ';
	//editor_code += ' <img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	
	editor_code += '<span id="setFrameColor0 EDITOR_NAME">';
	editor_code += rte_lang.alt_show_bgcolor; 
	editor_code += '</span> ';
	editor_code += '<span id="setFrameColor1 EDITOR_NAME">';
	editor_code += '<table style="display:inline; border:1px solid #000000;" cellpadding="0" cellspacing="0" border="0" title="'+rte_lang.alt_show_bgcolor+'">';
	editor_code += '<tr>';
	editor_code += '<td style="background-color:#ffffff;    width:8px;height:8px; cursor:pointer;" onclick="setFrameColor(\'EDITOR_NAME\',this.style.backgroundColor);"></td>';
	editor_code += '<td style="background-color:#dddddd;width:8px;height:8px; cursor:pointer;" onclick="setFrameColor(\'EDITOR_NAME\',this.style.backgroundColor);"></td>';
	editor_code += '<td style="background-color:#888888;width:8px;height:8px; cursor:pointer;" onclick="setFrameColor(\'EDITOR_NAME\',this.style.backgroundColor);"></td>';
	editor_code += '</tr></table>';
	editor_code += '</span>';
	editor_code += '</td>';
	editor_code += '</tr>';
	
	
	editor_code += '</table>';
		editor_code += '</div>';
		
	editor_code += '</td>';
	editor_code += '</tr>';
	editor_code += '</table>';
	editor_code += '</div>'; // editor end
	
	editor_code += '<div id="div_text EDITOR_NAME" style="display:none;">';
	editor_code += '<table border="0" cellpadding="0" cellspacing="0"><tr><td style="direction:ltr;">';
	editor_code += '<textarea id="EDITOR_NAME" name="EDITOR_NAME" wrap="virtual"  style="direction:ltr; height:EDITOR_HEIGHT; width:EDITOR_WIDTH;"></textarea>';
	editor_code += '</td>';
	editor_code += '</tr>';
	editor_code += '</table>';
	editor_code += '</div>';// text end
	
	editor_code += '</div>'; // cell end
	editor_code += '</td>';
	editor_code += '</tr>';
	editor_code += '</table>';
	// ====== FULL NARROW CODE =============
	var editor_code_narrow = "";
	editor_code_narrow += '<table cellPadding="0" cellspacing="0" style="direction:'+rte_lang.direction+'; ">';
	editor_code_narrow += '<tr id="EDITOR_NAME rteMenu1">';
	editor_code_narrow += '<td class="rte_td">';
	editor_code_narrow += 'EDITOR_TITLE ';
	editor_code_narrow += '<input type="radio" name="type EDITOR_NAME" id="type0 EDITOR_NAME" value="div_editor EDITOR_NAME" onclick="setCellType(this);" EDITOR_TYPE0><label for="type0 EDITOR_NAME">'+rte_lang.editor+'</label> &nbsp; ';
	editor_code_narrow += '<input type="radio" name="type EDITOR_NAME" id="type1 EDITOR_NAME" value="div_text EDITOR_NAME"    onclick="setCellType(this);" EDITOR_TYPE1><label for="type1 EDITOR_NAME">'+rte_lang.text+'</label> &nbsp; ';
	editor_code_narrow += '<input type="checkbox" name="lockEditor EDITOR_NAME" id="lockEditor EDITOR_NAME" value="1" onclick="lockEditor(this);"><label for="lockEditor EDITOR_NAME">'+rte_lang.lockEditor+'</label> &nbsp; ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/clear.png" id="clean EDITOR_NAME" title="'+rte_lang.alt_clear_styles+'" class="rte_buttons" onclick="cleanAll(\'EDITOR_NAME\');"> &nbsp; ';
	// editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/enlarge.png" title="'+rte_lang.alt_enlarge+'"  class="rte_buttons" onclick="enlargeRTE(\'EDITOR_NAME\')">';
	editor_code_narrow += '</td>';
	editor_code_narrow += '</tr>';
	
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td style="padding:0px 0px 0px 0px;">';
	
	editor_code_narrow += '<div id="cell EDITOR_NAME">';
	editor_code_narrow += '<div id="div_editor EDITOR_NAME" class="bg_editor">';
	editor_code_narrow += '<table cellpadding="0" cellspacing="0">';
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td class="rte_td">';
	
	editor_code_narrow += '<table cellpadding="0" cellspacing="0" id="EDITOR_NAME rteMenu2">';
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td class="rte_td">';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/fgcolor.png"     title="'+rte_lang.alt_color+'"                    class="rte_buttons" onclick="setRange(\'EDITOR_NAME\'); window.frames[\'colorPicker\'].getColor(30, document.body.scrollTop+event.clientY+20, \'\', \'setColor(\\\'EDITOR_NAME\\\',\\\'forecolor\\\',%%color%%) \', \' '+rte_lang.alt_color+' \'); moveCP(30,event.clientY);"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/bgfcolor.png"    title="'+rte_lang.alt_hilite+'"  class="rte_buttons" onclick="setRange(\'EDITOR_NAME\'); window.frames[\'colorPicker\'].getColor(30, document.body.scrollTop+event.clientY+20, \'\', \'setColor(\\\'EDITOR_NAME\\\',\\\'hilitecolor\\\',%%color%%) \', \' '+rte_lang.alt_hilite+' \'); moveCP(30,event.clientY);"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif">';
	editor_code_narrow += '<select onchange="if (this.value) setCssFontSize(\'EDITOR_NAME\',this.value);  this.selectedIndex=0;">';
	editor_code_narrow += '<option value="">'+rte_lang.font_size+'</option><option value="8px">8</option><option value="10px">10</option><option value="11px">11</option><option value="12px">12</option><option value="13px">13</option><option value="14px">14</option><option value="15px">15</option><option value="16px">16</option><option value="18px">18</option><option value="20px">20</option><option value="22px">22</option><option value="24px">24</option><option value="26px">26</option><option value="28px">28</option><option value="30px">30</option><option value="36px">36</option><option value="45px">45</option><option value="60px">60</option><option value="70px">70</option><option value="80px">80</option><option value="100px">100</option><option value="110px">110</option><option value="120px">120</option><option value="140px">140</option><option value="150px">150</option>';
	editor_code_narrow += '</select> ';
	editor_code_narrow += '<select onchange="if (this.value) RTEdo(\'EDITOR_NAME\',\'fontname\',this.value); this.selectedIndex=0;">';
	editor_code_narrow += '<option value="">'+rte_lang.font_face;
	for (f=0;f<rte_lang.fonts.length;f++) {
		editor_code_narrow += '<option value="'+rte_lang.fonts[f].toLowerCase()+'">'+rte_lang.fonts[f]+'';
	}
	editor_code_narrow += '</select>';
	editor_code_narrow += '</td>';
	
	editor_code_narrow += '</tr>';
	
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td class="rte_td">';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/b.png" title="'+rte_lang.alt_bold+'"        class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'bold\',\'\');"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/i.png"  title="'+rte_lang.alt_italic+'"       class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'italic\',\'\');"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/u.png" title="'+rte_lang.alt_under+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'underline\',\'\');"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	
	editor_code_narrow += '<table cellpadding="0" cellspacing="0" border="0" style="direction:ltr; display:inline; margin:0px;" >';
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-left.png"      title="'+rte_lang.alt_align_left+'"      class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifyleft\',\'\');"></td>';
	editor_code_narrow += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-center.png"  title="'+rte_lang.alt_align_center+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifycenter\',\'\');"></td>';
	editor_code_narrow += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-right.png"     title="'+rte_lang.alt_align_right+'"   class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifyright\',\'\');"></td>';
	editor_code_narrow += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-full.png"       title="'+rte_lang.alt_align_just+'"     class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifyfull\',\'\');"></td>';
	editor_code_narrow += '</tr>';
	editor_code_narrow += '</table>';
	editor_code_narrow += '</td>';
	editor_code_narrow += '</tr>';
	
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td class="rte_td">';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/list123.png" title="'+rte_lang.alt_list_n+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'insertorderedlist\',\'\');"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/list.png"      title="'+rte_lang.alt_list_b+'"    class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'insertunorderedlist\',\'\');"> ';
	editor_code_narrow += ' <img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/undo.png" title="'+rte_lang.alt_undo+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'undo\',\'\');"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/redo.png" title="'+rte_lang.alt_redo+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'redo\',\'\');"> ';
	editor_code_narrow += '</td>';
	editor_code_narrow += '</tr>';
	
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td class="rte_td">';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/link.png"  title="'+rte_lang.alt_link+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'link\',event.clientX+300,event.clientY)"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/img.png" title="'+rte_lang.alt_insert_image+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'img\',event.clientX+300,event.clientY)"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/flv.png" title="'+rte_lang.alt_insert_flv+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'flv\',event.clientX+300,event.clientY)"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/contact.png" title="'+rte_lang.add_contact+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'contact\',event.clientX+300,event.clientY)"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/table.png" title="'+rte_lang.alt_insert_table+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'table\',event.clientX+300,event.clientY)"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/tdbgcolor.png" title="'+rte_lang.alt_table_cell+'" class="rte_buttons" onclick="setRange(\'EDITOR_NAME\'); window.frames[\'colorPicker\'].getColor(30, document.body.scrollTop+event.clientY+20, \'\', \'setBgcolor(\\\'EDITOR_NAME\\\',%%color%%) \', \' '+rte_lang.alt_table_cell+' \'); moveCP(30,event.clientY);"> ';
	editor_code_narrow += '</td>';
	editor_code_narrow += '</tr>';
	editor_code_narrow += '</table>';
	
	editor_code_narrow += '</td>';
	editor_code_narrow += '</tr>';
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td style="background-color:#ffffff;">';
	editor_code_narrow += '<input type="hidden" name="style EDITOR_NAME" id="style EDITOR_NAME" value="EDITOR_CSS">';
	editor_code_narrow += '<iframe id="editor EDITOR_NAME" name="editor EDITOR_NAME" src="'+rte_lang.htm_webaxy+'/editor/blank.htm" frameborder="0" scrolling="auto" style=" height:EDITOR_HEIGHT; width:EDITOR_WIDTH; "></iframe>';
	editor_code_narrow += '</td></tr>';
	
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td class="rte_td">';
	
	editor_code_narrow += '<table cellpadding="0" cellspacing="0" id="EDITOR_NAME rteMenu3">';
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td class="rte_td" style="width:20%">&nbsp;</td>';
	editor_code_narrow += '<td class="rte_td">';
	//editor_code_narrow += '<b>'+rte_lang.cell+':</b> ';

	editor_code_narrow += '<table cellpadding="0" cellspacing="0" border="0" style="direction:ltr; display:inline;">';
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/ltr.png" title="'+rte_lang.alt_ltr+'"  class="rte_buttons" onclick="addStyle(\'EDITOR_NAME\',\'direction\',\'ltr\')"></td>';
	editor_code_narrow += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/rtl.png" title="'+rte_lang.alt_rtl+'" class="rte_buttons" onclick="addStyle(\'EDITOR_NAME\',\'direction\',\'rtl\')"></td>';
	editor_code_narrow += '</tr>';
	editor_code_narrow += '</table>';
	editor_code_narrow += ' <img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/font.png"  title="'+rte_lang.insert_fontProperties+'"             class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'fontProperties\',event.clientX,event.clientY - 300)"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/fgcolor.png"  title="'+rte_lang.alt_cell_font_color+'"             class="rte_buttons" onclick="window.frames[\'colorPicker\'].getColor(30,document.body.scrollTop+event.clientY+20, getStyle(\'EDITOR_NAME\',\'color\'), \'addStyle(\\\'EDITOR_NAME\\\',\\\'color\\\',%%color%%) \', \' '+rte_lang.alt_cell_font_color+' \'); moveCP(event.clientX,event.clientY - 300);"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/bgcolor.png" title="'+rte_lang.alt_cell_bgcolor+'"   class="rte_buttons" onclick="window.frames[\'colorPicker\'].getColor(30, document.body.scrollTop+event.clientY+20, getStyle(\'EDITOR_NAME\',\'background-color\'), \'addStyle(\\\'EDITOR_NAME\\\',\\\'background-color\\\',%%color%%) \', \' '+rte_lang.alt_cell_bgcolor+' \'); moveCP(event.clientX,event.clientY - 300);"> ';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/bgimg.png"   title="'+rte_lang.alt_cel_bgimg+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'bgimg\',event.clientX,event.clientY - 300)"> ';
	editor_code_narrow += '</td>';
	editor_code_narrow += '</tr>';
	
	editor_code_narrow += '<tr>';
	editor_code_narrow += '<td></td>';
	editor_code_narrow += '<td class="rte_td">';
	editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/border.png" title="'+rte_lang.alt_border_padding+'"  class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'cell\',event.clientX,event.clientY - 300)">';
	editor_code_narrow += ' <img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	//editor_code_narrow += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/clear.png" title="'+rte_lang.alt_clear_styles+'" class="rte_buttons" onclick="cleanAll(\'EDITOR_NAME\');"> ';
	//editor_code_narrow += ' <img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	
	editor_code_narrow += '<span id="setFrameColor0 EDITOR_NAME">';
	editor_code_narrow += rte_lang.alt_show_bgcolor; 
	editor_code_narrow += '</span>';
	editor_code_narrow += '<span id="setFrameColor1 EDITOR_NAME">';
	editor_code_narrow += '<table style="width:26px; margin:0px 3px 0px 3px; border:solid 1px #000000; display:inline; " cellpadding="0" cellspacing="0" border="0" title="'+rte_lang.alt_show_bgcolor+'"><tr><td style="background-color:#ffffff;width:8px;height:8px;cursor:pointer;" onclick="setFrameColor(\'EDITOR_NAME\',this.style.backgroundColor);"></td><td style="background-color:#dddddd;width:8px;height:8px;cursor:pointer" onclick="setFrameColor(\'EDITOR_NAME\',this.style.backgroundColor);"></td><td style="background-color:#888888;width:8px;height:8px;cursor:pointer;" onclick="setFrameColor(\'EDITOR_NAME\',this.style.backgroundColor);"></td></tr></table>';
	editor_code_narrow += '</span>';
	editor_code_narrow += '</td>';
	editor_code_narrow += '</tr>';
	editor_code_narrow += '</table>';
	
	editor_code_narrow += '</td>';
	editor_code_narrow += '</tr>';
	editor_code_narrow += '</table>';
	editor_code_narrow += '</div>'; // editor end
	
	editor_code_narrow += '<div id="div_text EDITOR_NAME" style="display:none;">';
	editor_code_narrow += '<table border="0" cellpadding="0" cellspacing="0"><tr><td style="direction:ltr;">';
	editor_code_narrow += '<textarea id="EDITOR_NAME" name="EDITOR_NAME" wrap="virtual"  style="direction:ltr; height:EDITOR_HEIGHT; width:EDITOR_WIDTH;"></textarea>';
	editor_code_narrow += '</td>';
	editor_code_narrow += '</tr>';
	editor_code_narrow += '</table>';
	editor_code_narrow += '</div>';// text end
	
	editor_code_narrow += '</div>'; // cell end
	editor_code_narrow += '</td>';
	editor_code_narrow += '</tr>';
	editor_code_narrow += '</table>';
	// ===== THIN CODE  ===========
	var thin_editor_code = "";
	thin_editor_code += '<table cellPadding="0" cellspacing="0" style="direction:'+rte_lang.direction+'; >';
	thin_editor_code += '<tr id="EDITOR_NAME rteMenu1">';
	thin_editor_code += '<td class="rte_td" style="color:#000000;background-color:#c0c0c0; padding:1px 0px 1px 0px;" >';
	thin_editor_code += 'EDITOR_TITLE';
	thin_editor_code += '<div style="display:none">';
	thin_editor_code += '<input type="radio" name="type EDITOR_NAME" id="type0 EDITOR_NAME" value="div_editor EDITOR_NAME" onclick="setCellType(this);" EDITOR_TYPE0><label for="type0 EDITOR_NAME">'+rte_lang.editor+'</label> &nbsp; ';
	thin_editor_code += '<input type="radio" name="type EDITOR_NAME" id="type1 EDITOR_NAME" value="div_text EDITOR_NAME"    onclick="setCellType(this);" EDITOR_TYPE1><label for="type1 EDITOR_NAME">'+rte_lang.text+'</label> &nbsp; ';
	thin_editor_code += '<input type="checkbox" name="lockEditor EDITOR_NAME" id="lockEditor EDITOR_NAME" value="1" onclick="lockEditor(this);"><label for="lockEditor EDITOR_NAME">'+rte_lang.lockEditor+'</label> &nbsp; ';
	thin_editor_code += '</div>';
	thin_editor_code += '</td>';
	thin_editor_code += '</tr>';
	
	thin_editor_code += '<tr>';
	thin_editor_code += '<td style="padding:0px 0px 0px 0px;">';
	
	thin_editor_code += '<div id="cell EDITOR_NAME">';
	thin_editor_code += '<div id="div_editor EDITOR_NAME" class="bg_editor">';
	thin_editor_code += '<table cellpadding="0" cellspacing="0">';
	thin_editor_code += '<tr>';
	thin_editor_code += '<td class="rte_td">';
	
	thin_editor_code += '<table cellpadding="0" cellspacing="0" id="EDITOR_NAME rteMenu2">';
	thin_editor_code += '<tr>';
	thin_editor_code += '<td class="rte_td">';
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/fgcolor.png"     title="'+rte_lang.alt_color+'"                    class="rte_buttons" onclick="setRange(\'EDITOR_NAME\'); window.frames[\'colorPicker\'].getColor(30, document.body.scrollTop+event.clientY+20, \'\', \'setColor(\\\'EDITOR_NAME\\\',\\\'forecolor\\\',%%color%%) \', \' '+rte_lang.alt_color+' \'); moveCP(30,event.clientY);"> ';
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/bgfcolor.png"    title="'+rte_lang.alt_hilite+'"  class="rte_buttons" onclick="setRange(\'EDITOR_NAME\'); window.frames[\'colorPicker\'].getColor(30, document.body.scrollTop+event.clientY+20, \'\', \'setColor(\\\'EDITOR_NAME\\\',\\\'hilitecolor\\\',%%color%%) \', \' '+rte_lang.alt_hilite+' \'); moveCP(30,event.clientY);"> ';
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif">';
	thin_editor_code += '<select onchange="if (this.value) setCssFontSize(\'EDITOR_NAME\',this.value);  this.selectedIndex=0;">';
	thin_editor_code += '<option value="">'+rte_lang.font_size+'</option><option value="8px">8</option><option value="10px">10</option><option value="11px">11</option><option value="12px">12</option><option value="13px">13</option><option value="14px">14</option><option value="15px">15</option><option value="16px">16</option><option value="18px">18</option><option value="20px">20</option><option value="22px">22</option><option value="24px">24</option><option value="26px">26</option><option value="28px">28</option><option value="30px">30</option><option value="36px">36</option><option value="45px">45</option><option value="60px">60</option><option value="70px">70</option><option value="80px">80</option><option value="100px">100</option><option value="110px">110</option><option value="120px">120</option><option value="140px">140</option><option value="150px">150</option>';
	thin_editor_code += '</select> ';
	thin_editor_code += '<select onchange="if (this.value) RTEdo(\'EDITOR_NAME\',\'fontname\',this.value); this.selectedIndex=0;">';
	thin_editor_code += '<option value="">'+rte_lang.font_face;
	for (f=0;f<rte_lang.fonts.length;f++) {
		thin_editor_code += '<option value="'+rte_lang.fonts[f].toLowerCase()+'">'+rte_lang.fonts[f]+'';
	}
	thin_editor_code += '</select>';
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/b.png" title="'+rte_lang.alt_bold+'"        class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'bold\',\'\');"> ';
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/i.png"  title="'+rte_lang.alt_italic+'"       class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'italic\',\'\');"> ';
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/u.png" title="'+rte_lang.alt_under+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'underline\',\'\');"> ';
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	
	thin_editor_code += '<table cellpadding="0" cellspacing="0" border="0" style="direction:ltr; display:inline; margin:0px;" >';
	thin_editor_code += '<tr>';
	thin_editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-left.png"      title="'+rte_lang.alt_align_left+'"      class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifyleft\',\'\');"></td>';
	thin_editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-center.png"  title="'+rte_lang.alt_align_center+'" class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifycenter\',\'\');"></td>';
	thin_editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/align-right.png"     title="'+rte_lang.alt_align_right+'"   class="rte_buttons" onclick="RTEdo(\'EDITOR_NAME\',\'justifyright\',\'\');"></td>';
	thin_editor_code += '</tr>';
	thin_editor_code += '</table>';
	
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/link.png"  title="'+rte_lang.alt_link+'" class="rte_buttons" onclick="openAdd(\'EDITOR_NAME\',\'link\',event.clientX+300,event.clientY)"> ';
	
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif"> ';
	thin_editor_code += '<table cellpadding="0" cellspacing="0" border="0" style="direction:ltr; display:inline;">';
	thin_editor_code += '<tr>';
	thin_editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/ltr.png" title="'+rte_lang.alt_ltr+'"  class="rte_buttons" onclick="addStyle(\'EDITOR_NAME\',\'direction\',\'ltr\')"></td>';
	thin_editor_code += '<td><img src="'+rte_lang.htm_webaxy+'/editor/buttons/rtl.png" title="'+rte_lang.alt_rtl+'" class="rte_buttons" onclick="addStyle(\'EDITOR_NAME\',\'direction\',\'rtl\')"></td>';
	thin_editor_code += '</tr>';
	thin_editor_code += '</table>';
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/sep.gif">';
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/clear.png" title="'+rte_lang.alt_clear_styles+'" class="rte_buttons" onclick="cleanAll(\'EDITOR_NAME\');"> ';
	thin_editor_code += '<img src="'+rte_lang.htm_webaxy+'/editor/buttons/enlarge.png" title="'+rte_lang.alt_enlarge+'"  class="rte_buttons" onclick="enlargeRTE(\'EDITOR_NAME\')">';
	
	
	thin_editor_code += '</td>';
	thin_editor_code += '</tr>';
	thin_editor_code += '</table>';
	
	thin_editor_code += '</td>';
	thin_editor_code += '</tr>';
	thin_editor_code += '<tr>';
	thin_editor_code += '<td style="background-color:#ffffff;">';
	thin_editor_code += '<input type="hidden" name="style EDITOR_NAME" id="style EDITOR_NAME" value="EDITOR_CSS">';
	thin_editor_code += '<iframe id="editor EDITOR_NAME" name="editor EDITOR_NAME" src="'+rte_lang.htm_webaxy+'/editor/blank.htm" frameborder="0" scrolling="auto" style=" height:EDITOR_HEIGHT; width:EDITOR_WIDTH;"></iframe>';
	thin_editor_code += '</td></tr>';

	thin_editor_code += '</table>';
	thin_editor_code += '</div>'; // editor end
    thin_editor_code += '</div>';
	thin_editor_code += '<div id="div_text EDITOR_NAME" style="display:none;">';
	thin_editor_code += '<table border="0" cellpadding="0" cellspacing="0"><tr><td style="direction:ltr;">';
	thin_editor_code += '<textarea id="EDITOR_NAME" name="EDITOR_NAME" wrap="virtual"  style="direction:ltr; height:EDITOR_HEIGHT; width:EDITOR_WIDTH;"></textarea>';
	thin_editor_code += '</td>';
	thin_editor_code += '</tr>';
	thin_editor_code += '</table>';
	thin_editor_code += '</div>';// text end
	
	thin_editor_code += '</div>'; // cell end
	thin_editor_code += '</td>';
	thin_editor_code += '</tr>';
	thin_editor_code += '</table>';
	// ===== BLANK CODE  ===========
	var blank_editor_code = "";
	
	blank_editor_code += '<table style="direction:'+rte_lang.direction+'; " cellpadding="0" cellspacing="0">';
	blank_editor_code += '<tr><td class="rte_td" style="background-color:#c0c0c0;color:#000000;">EDITOR_TITLE';
	blank_editor_code += '<div  style="display:none;">';
	blank_editor_code += '<input type="radio" name="type EDITOR_NAME" value="div_editor EDITOR_NAME" onclick="setCellType(this);" EDITOR_TYPE0><a href="javascript:void(0)" style="color:#000000; text-decoration:none;" onclick="this.previousSibling.click(); return false;"> '+rte_lang.editor+'</a> &nbsp; ';
	blank_editor_code += '<input type="radio" name="type EDITOR_NAME" value="div_text EDITOR_NAME"    onclick="setCellType(this);" EDITOR_TYPE1><a href="javascript:void(0)" style="color:#000000; text-decoration:none;" onclick="this.previousSibling.click(); return false;"> '+rte_lang.text+'</a> &nbsp; ';
	blank_editor_code += '</div>';
	blank_editor_code += '</td></tr>';
	blank_editor_code += '<tr><td style="padding:0px 0px 0px 0px;">';
	
	blank_editor_code += '<div id="cell EDITOR_NAME">';
	blank_editor_code += '<div id="div_editor EDITOR_NAME" class="bg_editor">';
	blank_editor_code += '<table bgcolor="#dadada" cellpadding="0" cellspacing="0">';
	
	
	blank_editor_code += '<tr>';
	blank_editor_code += '<td style="background-color:#ffffff;">';
	blank_editor_code += '<input type="hidden" name="style EDITOR_NAME" id="style EDITOR_NAME" value="EDITOR_CSS">';
	blank_editor_code += '<iframe id="editor EDITOR_NAME" name="editor EDITOR_NAME" src="'+rte_lang.htm_webaxy+'/editor/blank.htm" frameborder="0" scrolling="auto" style=" height:EDITOR_HEIGHT; width:EDITOR_WIDTH;"></iframe>';
	blank_editor_code += '</td></tr>';
	
	blank_editor_code += '</table>';
	blank_editor_code += '</div>';
	
	blank_editor_code += '<div id="div_text EDITOR_NAME" style="display:none;">';
	blank_editor_code += '<textarea id="EDITOR_NAME" name="EDITOR_NAME" wrap="virtual"></textarea>';
	blank_editor_code += '</div>';
	blank_editor_code += '</div>';
	blank_editor_code += '</td></tr>';
	blank_editor_code += '</table>';
//===================================================================
//  
//  name: do 
//  
//===================================================================
function extraButtonsCode(code,extraButtons) {
	extraButtons = ","+extraButtons+",";
	if (extraButtons.indexOf(",contact,") == -1) {
		code = code.replace(/<img [^>]+contact.png[^>]+>/,"");
	}
	
	return code;

}
	
//===================================================================
//  
//  createEditor: create HTML editor from textarea field
//  
//===================================================================
function createEditor(field,ftitle,ftype,editor_type,ewidth,extraButtons) {
	if (!ftitle) {
		ftitle="";
	}
	if (!ewidth) {
		ewidth = 0;
	}
	if (!editor_type) {
		editor_type="full";
	}
	var code = "";
	if (editor_type=="full") {
		var actualWidth = editor_min_width;
		if ((parseInt(field.style.width) > 0) && (field.style.width.search(/p[xt]$/i) != -1)) {
			actualWidth = parseInt(field.style.width);
		}
		else if ((field.style.width == "100%") && (field.parentNode.clientWidth > 0)) {
			actualWidth = field.parentNode.clientWidth;
		}
		else if (field.clientWidth > 0) {
			actualWidth = field.clientWidth;
		}
		
		if (actualWidth < 300) {
			code = editor_code_narrow;
			editor_min_width = actualWidth;
		}
		else {
			code = editor_code;
		}
	}
	else if (editor_type=="thin") {
		ftype = "editor";
		code = thin_editor_code;
		editor_min_width = 450;
	} 
	else if (editor_type=="blank") {
		ftype = "editor";
		code = blank_editor_code;
		editor_min_width = 450;
	} 
	if (!extraButtons) {
		extraButtons ="";
	}
	code = extraButtonsCode(code,extraButtons);
	var originalValue = field.getAttribute("originalValue");
	if (!originalValue) {
		originalValue = field.defaultValue;
	}
	field.value = originalValue;
	
	var fname = field.name;
	var meta_re = /<\!\-\-\sRTE\s(.+)\sRTE -->/;
	field.value.search(meta_re);
	var meta = RegExp.$1;
	field.value = field.value.replace(meta_re,"");
	
	var css = "";
	var lockEditorValue = 0;
	
	if (meta) {		// value contains meta comment
		meta.search(/css=([^&]+)/);
		css = RegExp.$1;	
		if (!css) {
			css = "";
		}	
		
		
		if (meta.search(/ftype=([^&]+)/) != -1) {
			ftype = RegExp.$1;
		}
		if (!ftype) {
			ftype = "editor";
		}
		
		if (meta.search(/lockEditor=([^&]+)/) != -1) {
			lockEditorValue = RegExp.$1;
		}
	}
	else if (field.value != "") {
		css = "";
		if (!ftype) {
			ftype = "text";
		}
	}
	else {
		css = "";	
		if (!ftype) {
			ftype = "editor";
		}
	}
	
	var cssPairs = css.split(/\s*\;\s*/);
	var cssKeys = ",";
	for (var p=0; p<cssPairs.length; p++) {
		if (cssPairs[p].search(/([^:]+):/) != -1) {
			cssKeys += RegExp.$1 + ",";
		}
	}
	cssKeys = cssKeys.toLowerCase();
	
	css += ";";		
	if ((cssKeys.search(/,background\-color,/) == -1) && field.style.backgroundColor) {
		css += "background-color:"+field.style.backgroundColor+";";
	}
	if ((cssKeys.search(/,color,/) == -1) && field.style.color) {
		css += "color:"+field.style.color+";";
	}
	
	css = css.replace(/^[; ]+/,"");	
	css = css.replace(/;+/,";");	
	css = css.replace(/;+$/,"");	
		
	if (field.value.search(/<iframe/i) != -1) {
		ftype = "text";
	}	
			
	if (!field.id) {
		field.id = fname;
	}
	if (ftitle.search(/\S/) != -1) {
		ftitle = "&nbsp;"+ftitle+"&nbsp;";
	}
	code = code.replace(/EDITOR_TITLE/g,ftitle);
	code = code.replace(/EDITOR_NAME/g,fname);
	//code = code.replace(/EDITOR_VALUE/g,field.value);
	
	var hgt = editor_def_height;
	if (parseInt(field.style.height) > 0) {
		hgt = parseInt(field.style.height);
	}
	else if (field.clientHeight > 0) {
		hgt = field.clientHeight;
	}
	
	code = code.replace(/EDITOR_HEIGHT/g,hgt+"px");
	
	if (!ewidth && (parseInt(field.style.width) > editor_min_width)) {
		ewidth = parseInt(field.style.width);
	}
	if (!ewidth) {
		ewidth = field.clientWidth;
	}
	if (ewidth < editor_min_width) {
		ewidth = editor_min_width;
	}
	
	code = code.replace(/EDITOR_WIDTH/g,ewidth+"px");
	if (ftype=="text") {
		code = code.replace(/EDITOR_TYPE1/g,'checked');
	}
	else {
		code = code.replace(/EDITOR_TYPE0/g,'checked');
	}
	code = code.replace(/EDITOR_TYPE\d/g,'');	
	code = code.replace(/EDITOR_CSS/g,css);	
	
	var editor = document.createElement("span");
	editor.innerHTML = code;
	
	var field_form = field.form;
	field.parentNode.replaceChild(editor,field);
	
	var rte_ta = document.getElementById(fname);
	rte_ta.setAttribute("editor_type",editor_type);
	rte_ta.setAttribute("originalValue",originalValue);
	var rte_rad = document.getElementsByName('type '+fname);
	var rte_css = document.getElementById('style '+fname);
	var lockEditorField = document.getElementById('lockEditor '+fname);
	
	rte_ta.value = field.value;
	if (ftype != "text") {
		copyData(fname,"editor "+fname);
	}
	
	if (rte_ta.form == null) {		// FF
		if (isIE) {
			rte_ta.form = field_form;
		}
		else {
			field_form.appendChild(rte_rad[0]);
			field_form.appendChild(rte_rad[1]);
			field_form.appendChild(rte_css);
			field_form.appendChild(rte_ta);
			if (lockEditorField) {
				field_form.appendChild(lockEditorField);
			}
		}
	}
	if (lockEditorField && (lockEditorValue == 1)) {
		lockEditorField.checked = true;
		if (isIE) {
			//copyData(fname,"editor "+fname);
			setTimeout("lockEditor('"+lockEditorField.id+"')",200);
		}
		else {
			//copyData(fname,"editor "+fname);
			lockEditor(lockEditorField);
		}
	}
	return;
}	

//-----------------------------------------------------------------------------------	
function initRTE(fname) {
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none initRTE");
		return;
	}
	var lockEditorField = document.getElementById("lockEditor "+fname);
	if (lockEditorField && lockEditorField.checked) {
		return;
	}
	
	if (!ifr.document) {
		alert("initRTE Error: no document on "+fname);
		return;
	}
	
	ifr.document.designMode = "On";
	if (isIE) {	
		try {
		  ifr.document.body.contentEditable = true;
		  //document.getElementById("editor "+fname).contentDocument.designMode="on";
		}
		catch(e) {}
	}
}		
//===================================================================
//  
//  initEditors: Init all editors
//  
//===================================================================

function initEditors(fname0) {
	var ifrs = document.getElementsByTagName("iframe");
	if (!ifrs) {
		return;
	}
	var fname = "";
	var ta = null;
	var rad = null;
	var css = null;
	for (i=0;i<ifrs.length;i++) {
		if (ifrs[i].id.indexOf("editor ") != 0) {
			continue;
		}
		fname = ifrs[i].id.slice(7);
		
		if (fname0 && ('editor '+fname != fname0) && (fname != fname0)) {
			continue;
		}
		ta = document.getElementById(fname);
		ta.value = ta.value.replace(flvPlayerCode,"");	// remove video code if exists
		ta.value = ta.value.replace(postEditorsCode,"");	// remove postEditorsCode code if exists
		// set iframe height
		if (parseInt(ifrs[i].style.height) < 100) {// need to change dimensions
			
			var iframeTable = ifrs[i].parentNode;
			while (iframeTable && iframeTable.tagName && (iframeTable.tagName != "TABLE")) {
				iframeTable = iframeTable.parentNode;
			}
			var cell_div = document.getElementById("cell "+fname);

		}
		initRTE(fname);
		
	
		rad = ta.form.elements["type "+fname];
		css = ta.form.elements["style "+fname];
		
		css.value = defaultCss(css.value);
		css.defaultValue = css.value;
		
		
		setStyle(fname,css.value);
		
		if (rad[1].checked == false) {
			copyData(ta,ifrs[i]);
		}
		var ortext = "self.setTimeout('resetEditors()',500);";
		
		if (!ta.form.onreset) {
			ta.form.onreset = new Function(ortext);
		}
		else if (ta.form.onreset.toString().indexOf(ortext)==-1) {
			var orbody = ta.form.onreset.toString();
			orbody = orbody.replace(/\{/,"{ "+ortext+" \n");
			ta.form.onreset = new Function(orbody);
		}
		
		var ostext = "submitEditors();";
		if (!ta.form.onsubmit) {
			ta.form.onsubmit = new Function(ostext);
		}
		else if (ta.form.onsubmit.toString().indexOf(ostext)==-1) {
			var osbody = ta.form.onsubmit.toString();
			osbody = osbody.replace(/\{/,"{ "+ostext+" \n");
				
			osbody = osbody.replace(/\s/mg," ").replace(/^\s*function [^\{]+\{(.+)\}\s*$/,"$1");
			ta.form.onsubmit = new Function(osbody);
		}
		
		for (r=0;r<rad.length;r++) {
			if (rad[r].checked) {
				setCellType(rad[r]);
				break;
			}
		}
	}	
	
	self.setTimeout('hideRTEComments(); editor_msg = "initEditors done" ',2000);
}
//===================================================================
//  
//  hideRTEComments: hide all RTE comments from page. comment= <!-- RTE css=...&ftype=...&lockEditor=... RTE --> 
//  
//===================================================================
function hideRTEComments() {
	var ifrs = document.getElementsByTagName("iframe");
	if (!ifrs) {
		return;
	}
	for (i=0;i<ifrs.length;i++) {
		if (ifrs[i].id.indexOf("editor ") != 0) {
			continue;
		}
		var ta = document.getElementById(ifrs[i].id.slice(7));
		if (ta) {
			ta.value = ta.value.replace(/<\!\-\- RTE[^>]+>/g,"");
			ta.value = ta.value.replace(flvPlayerCode,"");
			ta.value = ta.value.replace(postEditorsCode,"");
		}
	}
}

//===================================================================
//  
//  submitEditors: make all editors ready to submit (copy innerHTML to textarea field)
//  
//===================================================================
function submitEditors(tool) {
	if (!tool) {
		tool = self.location.href;
	}
	var ifrs = document.getElementsByTagName("iframe");
	if (!ifrs) {
		return;
	}
	var fname = "";
	var ta = null;
	var last_ta = null;
	var rad = null;
	var meta = "";
	//var hasFLV = "";
	
	
	for (i=0;i<ifrs.length;i++) {
		if (ifrs[i].id.indexOf("editor ") != 0) {
			continue;
		}
		
		fname = ifrs[i].id.slice(7);
		
		ta = document.getElementById(fname);
		rad = ta.form.elements["type "+fname];
		css = ta.form.elements["style "+fname];
		var lockEditorField = document.getElementById("lockEditor "+fname);
		meta = '<!-- RTE css='+css.value+'&ftype='+(rad[0].checked ? "editor" : "text")+'&lockEditor='+((lockEditorField && lockEditorField.checked) ? "1" : "0")+' RTE -->';
		ta.value = ta.value.replace(/<\!\-\- RTE[^>]+>/g,"");
		if (rad[0].checked) {
			copyData(ifrs[i],ta);
			ta.value = ta.value.replace(/&nbsp;$/,'');// for blank value in IE
			if ((ta.value.search(/\S/) == -1) && (css.value.search(/background\-?image\s*\:\s*[^;]/i) != -1) && (css.value.search(/background\-?image\s*\:\s*none/i) == -1)) {	// background image with no text
				ta.value = "<p><br></p>";
			}
			if (ta.value.search(/\S/) != -1) {
				ta.value=meta+ta.value;
			}
		}
		else {
			if (ta.value.search(/\S/) != -1) {
				ta.value=meta+ta.value;
			}
		}
		ta.value = ta.value.replace(/http\S+\/editor\/blank\.htm\#/ig,"#");  // internal references
		ta.value = ta.value.replace(flvPlayerCode,"");
		ta.value = ta.value.replace(postEditorsCode,"");
		
		if (ta.value.search(/\S/) != -1) {// not empty editor
			last_ta = ta;
		}
		//alert(ta.value);
	}	
	if (last_ta) {
		if ((tool.search(/dhtmlnews\.pl/) == -1) && (tool.search(/mig\-forum\.pl/) == -1)) {
			last_ta.value += postEditorsCode; // insert postEditorsCode to last editor code
		}
	}
	self.setTimeout("hideRTEComments()",500);
}	
//-----------------------------------------------------------------------------------	
function RTEdo(fname,command,val) {
	if (command != "createlink") {
		setRange(fname);
	}
	
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none RTEdo");
		return;
	}
	try {
		ifr.self.focus();
		if (isIE) {
			if (!rng) {
				rng = ifr.document.selection.createRange().duplicate();
				rng.fname = fname;
			}
			rng.select();
			
			if ((rng.htmlText == undefined) || (rng.htmlText == "")) {		// no selection
				if (command == 'fontsize') {
					rng.collapse(false);
					rng = null;
					return;
				}
			}
		}
		else {
			if ((rng.toString() == undefined) || (rng.toString() == "")) {		// no selection
				if (command == 'fontsize') {
					rng.collapse(false);
					rng = null;
					return;
				}
			}
			
		}
	  	ifr.self.document.execCommand(command, false, val);
	} 
	catch(e) {
		//alert(command+" not suppotred");
	}
	try {
		ifr.focus();
	}
	catch(e) {}
}

//-----------------------------------------------------------------------------------

function setColor(fname,command,color) {
	if (isIE) {
		if (command == "hilitecolor") {
			command = "backcolor";
		}
		rng.select();
	}
	
	RTEdo(fname, command, color);
}


//-----------------------------------------------------------------------------------
function setRange(fname) {
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none setRange");
		return;
	}
	rng = null;
	//function to store range of current selection
	if (isIE) {
		ifr.focus();
		var selection = ifr.document.selection; 
		if (selection != null) {
			try {
				rng = selection.createRange().duplicate();
			}
			catch(e) {
				rng = selection.createRange();
			}
			if (rng.htmlText) {
				while (rng.htmlText.search(/^\s*<br\/?\s*>/i) != -1) {
					rng.moveStart('character',1);
				}
				while (rng.htmlText.search(/\s*<br\/?\s*>$/i) != -1) {
					rng.moveEnd('character',-1);
				}
			}
			
		}
	} 
	else {
		var selection = ifr.getSelection();
		if (selection) {
			rng = selection.getRangeAt(selection.rangeCount - 1).cloneRange();
		}
	}
	
	if (rng) {
		rng.fname = fname;
	}
	return rng;
}

//-----------------------------------------------------------------------------------
function getSelectedObject(fname,act) {
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none getSelectedObject");
		return;
	}
	if (!act) {
		act = "";
	}
	
	//setRange(fname);
	var ob0 = null;
	if (isIE) {
		if (rng.htmlText == undefined) {	// control (selection is an object like image)
			ob0 = rng.item(0);
		}
		else {		// text node
			if (act == "node") {
				ob0 = rng.parentElement();
			}
			else {
				ob0 = rng.htmlText;
			}
		}
	} 
	else {
		var container = rng.startContainer;
      	var pos = rng.startOffset;
      	if ((container.nodeType == 3) || (container.childNodes[pos].tagName=="BR")) { // text
      		if (act == "node") {
      			ob0 = container.parentNode;
      		}
      		else {
      			ob0 = rng.toString();
      		}
      	}
      	else {
      		ob0 = container.childNodes[pos];
      	}
	}
	
	
	return ob0;
}
//-----------------------------------------------------------------------------------
function collapseRange(fname) {
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none collapseRange");
		return;
	}
	//function to collapse range of current selection
	try {
		rng.collapse(true);
	}
	catch (e) {	
		rng = null;
	}
	if (!isIE) {
		var selection = ifr.getSelection();
		if (selection) {
			selection.getRangeAt(selection.rangeCount - 1).collapse(true);
		}
	}
	
}
//-----------------------------------------------------------------------------------
function setCssFontSize(fname,font_size) {
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none setCssFontSize");
		return;
	}
	RTEdo(fname,'fontsize',1);
	
	var fonts = ifr.document.getElementsByTagName("font");
	if (!fonts || (fonts.length==0)) {		// no font tags
		if (ifr.document.body.innerHTML != "") {
			return;
		}
		var foo = ifr.document.createElement("font");
		foo.size = 1;
		insertNode(fname,foo);
		fonts = ifr.document.getElementsByTagName("font");
		//insertCode(fname,'<font size="1"></font>');
		if (isIE) {
			var ctr = "create";
			ctr += "Text" + "Range()";
			eval("rng = ifr.document.body."+ctr);
			rng.fname = fname;
			rng.select();
		}
		else {
			return;
			//rng = document.createRange();
			//rng.selectNode(fonts[0]);
		}
			
	}
	
	for (f=0;f<fonts.length;f++) {
		if (fonts[f].size==1) {
			fonts[f].style.fontSize = font_size;
			fonts[f].size=3;
		}
		else if (!fonts[f].size && fonts[f].style.fontSize) {		// pasted from ms-word
			fonts[f].style.fontSize = font_size;
			fonts[f].size=3;
		}
		/*
		if (	fonts[f].style.fontSize) {
			fonts[f].removeAttribute("size");
			alert('ok');
		}
		*/
	}
}


//-----------------------------------------------------------------------------------
function insertCode(fname,code) {
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none insertCode");
		return;
	}
	
	if (rng && rng.fname && (rng.fname!=fname)) {
		rng = null;
	}
	
	ifr.focus();
	if (isIE) {
		if (!rng) {
			rng = ifr.document.selection.createRange();
		}


		
		try {
			rng.select();
		}
		catch(e) {}
		if (!rng.pasteHTML) {
			rng.execCommand("delete",false,null);
			rng = ifr.document.selection.createRange();
			try {
				rng.select();
			}
			catch(e) {}
		}	
		
		rng.pasteHTML(code);
		rng.collapse(false);
		
	} 
	else {
		if (code != "") {
			ifr.document.execCommand('inserthtml', false, code);
		}
	}
	rng = null;
}

//-----------------------------------------------------------------------------------
function insertNode(fname,node) {
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none insertNode");
		return;
	}
	
	insertCode(fname,'<span id="temp_span_element"></span>');
	var span_element = ifr.document.getElementById("temp_span_element");
	span_element.parentNode.replaceChild(node,span_element);
	
		
}

//-----------------------------------------------------------------------------------
function cleanAll(fname) {
	
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none cleanAll");
		return;
	}
	var css = document.getElementById("style "+fname);
	var pairs = css.value.split(/\s*;\s*/);
	if (pairs) {
		for (var p=0;p<pairs.length;p++) {
			if (pairs[p].indexOf(":")==-1) {
				continue;
			}
			key_data = pairs[p].split(/:/);
			k = cssKey2JS(key_data[0]);
			
			try {
				eval('ifr.document.body.style.'+k+' = "" ');
			}
			catch(e) {
				//alert('Error on '+	k);
			}
		}
	}
	css.value = "";
	if (css.value.search(/font\-?family/i) == -1) {
		css.value = "font-family:inherit;"+css.value;
	}
	if (css.value.search(/direction/i) == -1) {
		css.value = "direction:"+rte_lang.direction+";"+css.value;
	}
	if (css.value.search(/background\-color/i) == -1) {
		css.value = "background-color:transparent;"+css.value;
	}
	if ((css.value.search(/^color/i) == -1) && (css.value.search(/[^a-zA-Z0-9_\-]color/i) == -1)) {
		css.value = "color:#000000;"+css.value;
	}
	css.defaultValue = css.value;
	setStyle(fname,css.value);
	
	var ta = document.getElementById(fname);
	var ftype = "editor";
	try {
		ftype = document.getElementById("type1 "+fname).checked ? "text" : "editor";
	}
	catch(e) {}
	
	if (ftype == "text") {
		var page = ta.value;
		page = page.replace(/<\?xml[^>]*>/ig,"");
		page = page.replace(/<\/?o:[^>]*>/ig,"");
		page = page.replace(/<\/?v:[^>]*>/ig,"");
		page = page.replace(/<![^>]*>/ig,"");
		page = page.replace(/(\r?\n)+/ig,"\n");
		
		page = page.replace(/class=[^> ]+/ig,"");
		page = page.replace(/lang=[^> ]+/ig,"");
		page = page.replace(/style=\"[^>\"]*\"/ig,"");
		page = page.replace(/style=\'[^>\']*\'/ig,"");
		
		page = page.replace(/<table /ig,'<table  class="rte_table" ');
		page = page.replace(/<td/ig,'<td class="rte_td" ');
		
		ta.value = page;
	}
	else {
		var page = ifr.document.body.innerHTML;
		page = page.replace(/<\?xml[^>]*>/ig,"");
		page = page.replace(/<\/?o:[^>]*>/ig,"");
		page = page.replace(/<\/?v:[^>]*>/ig,"");
		page = page.replace(/<![^>]*>/ig,"");
		page = page.replace(/(\r?\n)+/ig,"\n");
		
		page = page.replace(/class=[^> ]+/ig,"");
		page = page.replace(/lang=[^> ]+/ig,"");
		page = page.replace(/style=\"[^>\"]*\"/ig,"");
		
		page = page.replace(/<table /ig,'<table  class="rte_table" ');
		page = page.replace(/<td/ig,'<td class="rte_td" ');
		
		ifr.document.body.innerHTML = page;
	}
	
}
	//=============================================================================
	// Function Name: Name
	// Function Parameter: <Parameter Name>:<parameter description>
	// Function Parameter: 
	// Function Description: <description>
	// Function Results: <return value if any>
	//=============================================================================
	function enlargeRTE(fname) {
		var ifr = window.frames["editor "+fname];
		if (!ifr) {
			alert("none enlargeRTE");
			return;
		}
		var bodyElement = ifr.document.body;
  		var myHeight = parseInt(bodyElement.scrollHeight);
  		if ((myHeight == 0) && ifr.document.documentElement && ifr.document.documentElement.scrollHeight) {
  			bodyElement = ifr.document.documentElement;
  			myHeight = parseInt(bodyElement.scrollHeight);
  		}
  		
  		var ifrHeight = parseInt(ifr.frameElement.style.height);
  		var ta = document.getElementById(fname);
  		if (ifrHeight < myHeight) {
  			ifr.frameElement.style.height = (myHeight+5) + "px";
  			ta.style.height = (myHeight+5) + "px";
  		}
  		else {
  			ifr.frameElement.style.height = (ifrHeight+50) + "px";
  			ta.style.height = (ifrHeight+50) + "px";
  		}
	}


//-----------------------------------------------------------------------------------
function addStyle(fname,field,val) {
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none addStyle");
		return;
	}
	// alert(field+":"+val);
	var css = document.getElementById("style "+fname);
	var pairs = css.value.split(/\s*;\s*/);
	if (pairs) {
		for (var p=0;p<pairs.length;p++) {
			re = new RegExp("^"+field+":","i");
			if (pairs[p].search(re) == 0) {
				pairs[p] = "";
				break;
			}
		}
		css.value = pairs.join(";");
	}
	if (val.search(/\S/) != -1) {
		css.value += ";"+field+":"+val+";";
	}
	css.value = css.value.replace(/^;+/,"");
	css.value = css.value.replace(/;;+/g,";");
	setStyle(fname,css.value);
	
}
	
//-----------------------------------------------------------------------------------
function getStyle(fname,field) {
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none getStyle");
		return;
	}
	var css = document.getElementById("style "+fname);
	var pairs = css.value.split(/\s*;\s*/);
	var re = null;
	if (pairs) {
		for (var p=0;p<pairs.length;p++) {
			re = new RegExp("^"+field+":","i");
			if (pairs[p].search(re) == 0) {
				pairs[p].search(/:(.*)/);
				return RegExp.$1;
			}
		}
	}
	return "";
}
	
//-----------------------------------------------------------------------------------
function setStyle(fname,css) {
	//alert(css);
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none setStyle");
		return;
	}
	
	if (css.indexOf(":") == -1) {
		css = "color:#000000;background-color:transparent;"
	}
	
	if (!ifr.document || !ifr.document.body) {
		setTimeout(" setStyle('"+fname+"','"+css+"')",50);	// loop until loaded
		return;
	}
	
	var pairs = css.split(/\s*;\s*/);
	if (!pairs) {
		return;
	}
	
	var k = null;
	var v = null;
	for (var p=0;p<pairs.length;p++) {
		if (pairs[p].search(/:/) < 1) {
			continue;
		}
		pairs[p].search(/([^:]+):(.*)/);
		k = RegExp.$1;
		v = RegExp.$2;
	//	k = k.replace(/^\s+/,"");
//		k = k.replace(\s+$/,"");

// replaceing field name background-color => backgroundColor
		k = cssKey2JS(k);
		
		
		try {
			eval('ifr.document.body.style.'+k+' = "'+v+'" ');
		}
		catch(e) {
			//alert('Error on '+	k);
		}
	}
	var icolor = ifr.document.body.style.color;
	if (!icolor) {
		icolor = "#000000";
	}
	else {
		icolor = icolor.toLowerCase();
	}
	var ibgcolor = ifr.document.body.style.backgroundColor;
	if (!ibgcolor) {
		ibgcolor = "transparent";
	}
	else {
		ibgcolor = ibgcolor.toLowerCase();
	}
	
	var td0 = document.getElementById("setFrameColor0 "+fname);
	var td1 = document.getElementById("setFrameColor1 "+fname);
	
	if (ibgcolor == "transparent") { // need to change show bgcolor
		
		if (isBright(icolor)) {
			setFrameColor(fname,"#888888");
		}
		if (td0) {
			td0.style.display = "inline";
		}
		if (td1) {
			td1.style.display = "inline";
		}
	}
	else {
		if (td0) {
			td0.style.display = "none";
		}
		if (td1) {
			td1.style.display = "none";
		}
	}
	
}	

//-----------------------------------------------------------------------------------	
function setCellType(radio) {
	var fname = radio.name.slice(5);
	var maindiv = document.getElementById("cell "+fname);
	if (!maindiv) {
		return;
	}
	
	var val = radio.value;
	var editor_div = document.getElementById("div_editor "+fname);
	var editor_ifr = document.getElementById("editor "+fname);
	var ta_div = document.getElementById("div_text "+fname);
	var ta = document.getElementById(fname);
	
	var first = false;
	if (!maindiv.lastChecked) {
		first = true;
		maindiv.lastChecked = val;
	}
	if (val.indexOf("div_editor")==0) {
		editor_div.style.display = "";
		ta_div.style.display = "none";
	}
	else {
		editor_div.style.display = "none";
		ta_div.style.display = "";
	}
	
	
	if (!first && (val == maindiv.lastChecked)) {
		return;
	}
	
	if (first || (maindiv.lastChecked.indexOf('div_text') == 0)) {		// if lastCheck is textarea - copy value to iframe
		copyData(ta,editor_ifr);
	}
	else if (maindiv.lastChecked.indexOf('div_editor') == 0) {			// if lastCheck is editor - copy to textarea
		copyData(editor_ifr,ta);
	}
	
	maindiv.lastChecked = val;
}

//-----------------------------------------------------------------------------------
function copyData(src_obj,target_obj) {
	if ((typeof src_obj) == "string") {
		src_obj = document.getElementById(src_obj);
	}
	if ((typeof target_obj) == "string") {
		target_obj = document.getElementById(target_obj);
	}
	
	if (src_obj.tagName.toLowerCase()=="iframe") {
		
		var ifr = window.frames[src_obj.id];
		if (!ifr) {
			alert("none copyData");
			return;
		}
		
		target_obj.value = "";
		if (ifr.document.body) {
			target_obj.value = clearEmptyTags(ifr.document.body.innerHTML);
		}
		
		if ((target_obj.value.search(/^\s*<p>\&nbsp\;<\/p>\s*$/i) != -1) || (target_obj.value.search(/^\s*<p>\s*<\/p>\s*$/i) != -1) || (target_obj.value.search(/^\s*<br>\s*$/i) != -1)) {
			target_obj.value = "";
		}
	}
	
	else {		// src is textarea 
		var ifr = window.frames[target_obj.id];
		if (!ifr) {
			alert("none copyData2");
			return;
		}
		if (!ifr.document.body) {	// loop until loaded
			setTimeout("copyData('" + src_obj.id + "' , '" + target_obj.id +"') ",50);
			return;
		}
		
		var val = src_obj.value;
		
		if (val.search(/<[a-zA-Z]/) == -1) {		// plain text value
			val = val.replace(/\s*\n/g,"<br>");
		}
		else {
			var code_img_src = "/htm-webaxy/editor/buttons/scode.gif";
			var codeSpanRe = /(<span\s[^>]*name=[\'\"]?codeSpan[\'\"]?[^>]*>(\s|\S)*?<\/span>)/i;		// not greedy *?
			while (val.search(codeSpanRe) != -1) {
				codeSpan = RegExp.$1;
				
				code_title = "";
				if (	codeSpan.search(/^<span[^>]*\scode_title=([^\"\' >]+)/i) != -1) {
					code_title = RegExp.$1;
				}
				else if (codeSpan.search(/^<span[^>]*\scode_title=\"([^\"]+)\"/i) != -1) {
					code_title = RegExp.$1;
				}
				code_title = code_title.replace(/\"/g,"``");
				
				code_type = "";
				if (	codeSpan.search(/^<span[^>]*\scode_type=([^\"\' >]+)/i) != -1) {
					code_type = RegExp.$1;
				}
				else if (codeSpan.search(/^<span[^>]*\scode_type=\"([^\"]+)\"/i) != -1) {
					code_type = RegExp.$1;
				}
				code_type = code_type.replace(/\"/g,"``");
				
				codeSpan.search(/<span[^>]*>((\s|\S)*)<\/span>/i);
				code_src = encodeURIComponent(RegExp.$1);
				
				codeImage = "<img src=\""+code_img_src+"\" name=\"codeImage\" title=\""+code_title+"\" code_type=\""+code_type+"\" code_src=\""+code_src+"\">";
				
				val = val.replace(codeSpanRe,codeImage);
			}
			// external
			var codeTags = new Array("script","style","link");
			for (var c=0;c<codeTags.length;c++) {
				var codeRe0 = new RegExp("(<"+codeTags[c]+"[^>]*\/>)","i");		// match <link ..... />  
				while (val.search(codeRe0) != -1) {
					code_src = encodeURIComponent(RegExp.$1);
					code_title = codeTags[c]+" "+c;
					code_type = "external";
					codeImage = "<img src=\""+code_img_src+"\" name=\"codeImage\" title=\""+code_title+"\" code_type=\""+code_type+"\" code_src=\""+code_src+"\">";			
					val = val.replace(codeRe0,codeImage);
				}
				var codeRe1 = new RegExp("(<"+codeTags[c]+"[^>]*>(\\s|\\S)*?<\/"+codeTags[c]+"\\s*>)","i");		// not greedy *?
				while (val.search(codeRe1) != -1) {
					code_src = encodeURIComponent(RegExp.$1);
					code_title = codeTags[c]+" "+c;
					code_type = "external";
					codeImage = "<img src=\""+code_img_src+"\" name=\"codeImage\" title=\""+code_title+"\" code_type=\""+code_type+"\" code_src=\""+code_src+"\">";			
					val = val.replace(codeRe1,codeImage);
				}
				
			}
		}
		
		/* fix url("...") problem */
		var re = /(:\s*url\s*\(\"[^\)]+\"\s*\))/i;
		while (val.search(re) != -1) {
			var urlMatch = RegExp.$1.replace(/\"/g,"");
			val = val.replace(re,urlMatch);
		}
		
		ifr.document.body.innerHTML = val;
		
		
	}
	
}
//----------------------------------------------------------------------------
function openAdd(fname,act,x,y) {
	x = x - 500;
	if (x < 0) {
		x = 10;
	}
	y = y - 0;	// convert to number
	if (self.innerHeight) { // Everyone but IE
			y += window.pageYOffset;
	} 
	else if (document.documentElement && document.documentElement.clientHeight && document.documentElement.scrollTop) { // IE6 Strict
			y += document.documentElement.scrollTop;
	} 
	else if (document.body) { // Other IE, such as IE7
			y += document.body.scrollTop;
	}
	y += 20;
	
	setRange(fname); 
	var adc = document.getElementById("addcode");
	adc.style.visibility = "visible";
		
	adc.style.left = x + 'px';
	adc.style.top = y+'px';// + document.body.scrollTop;
	adc.style.zIndex = 3000;
	
	frames['addcode'].selectDiv(fname,act);
}
		
//----------------------------------------------------------------------------
function closeAdd() {
	var adc = document.getElementById("addcode");
	adc.style.visibility = "hidden";
	adc.style.left = "0px";
	adc.style.top = "0px";
	adc.style.zIndex = -1;
}
//----------------------------------------------------------------------------
function setBgcolor(fname,color) {
	collapseRange(fname);
	insertCode(fname,"<span id=\"here\"></span>");
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none setBgcolor");
		return;
	}
	var here = ifr.document.getElementById("here");
	par = here.parentNode;
	par.removeChild(here);
	var pasMax=10;
	while( (par.tagName.toLowerCase() != "td") && (par.tagName.toLowerCase() != "body") && (pasMax > 0) ){
		par = par.parentNode;
		while(!par.nodeType){par = par.parentNode;}
		pasMax--;
	}
	if (par.tagName.toLowerCase() == "td") {
		par.style.backgroundColor = color;
	}
	
	if (!isIE) {
		Refresh(fname);
	}
}
//===================================================================
//  
//  resizeEditor: change size of editor 
//  
//===================================================================
function resizeEditor(fname,width,height,border) {
	if (width && ((typeof(width) == 'string' && width.indexOf("%") == -1) || typeof(width) == 'number')) {
		width = parseInt(width)+5;
		width += "px";
	}
	if (!width || (width < 0)) {
		width = 0;
	}
	
	height = parseInt(height)+5;
	if (!height || (height < 0)) {
		height = 0;
	}
	var editorIframe = document.getElementById("editor "+fname);
	try {
		if (border) {
				borderA = border.split(' ');
				editorIframe.style.borderStyle = borderA[0];
				editorIframe.style.borderWidth = borderA[1];
				editorIframe.style.borderColor = borderA[2];			
		}
		//editorIframe.style.border = border ? border : "";
		var ta = document.getElementById(fname);
		var cell_div = document.getElementById("cell "+fname);
		
		if (width) {
			editorIframe.style.width = width;
			editorIframe.contentWindow.document.body.style.margin = "0px";
			//ta.style.width = width;
			//cell_div.style.width = (parseInt(width) + 20) + "px";
		}
		if (height) {
			editorIframe.style.height = height + "px";
			editorIframe.contentWindow.document.body.style.margin = "0px";
			ta.style.height = (height + 20) + "px";
			cell_div.style.height = (height + 110) + "px";
		}
	} catch (e) {}
}

//------------------------------------------------------------------------------
function Refresh(fname) {  // in firefox we need to refresh the code of the page (bug bypass)
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none Refresh");
		return;
	}
	var pos = ifr.document.body.scrollTop;
	var inner = ifr.document.body.innerHTML;
	ifr.focus();
	ifr.document.execCommand('selectall',false,null);
	ifr.document.execCommand('delete',false,null);

	insertCode(fname,inner);
	// keep old scroll position 
	ifr.scrollTo(0,pos);
	ifr.parent.focus();
}

//===================================================================
//  
//  clearEmptyTags: delete empty tags from html code
//  
//===================================================================
function clearEmptyTags(html) {
	while ((html.search(/<font[^>]*><\/font>/i) != -1) || (html.search(/<p><\/p>/i) != -1) || (html.search(/<p [^>]*><\/p>/i) != -1) || (html.search(/<span[^>]*><\/span>/i) != -1)) {
		html = html.replace(/<font[^>]*><\/font>/ig,"");
		html = html.replace(/<p><\/p>/ig,"");
		html = html.replace(/<p [^>]*><\/p>/ig,"");
		html = html.replace(/<span[^>]*><\/span>/ig,"");
	}
	
	while ((html.search(/^\s*<p>/i) != -1) && (html.search(/<\/p>\s*$/i) != -1)) {
		html = html.replace(/^\s*<p>/i,"");
		html = html.replace(/<\/p>\s*$/i,"");
	}	
	html = html.replace(/<br>[\r\n]*/ig,"<br>\n");
	// codes handling
	var codeImageRe = /(<img\s+[^>]*name=[\'\"]?codeImage[\'\"]?[^>]*>)/i;
	while (html.search(codeImageRe) != -1) {
		codeImage = RegExp.$1;
		
		code_title = "";
		if (	codeImage.search(/\stitle=([^\"\' >]+)/i) != -1) {
			code_title = RegExp.$1;
		}
		else if (codeImage.search(/\stitle=\"([^\"]+)\"/i) != -1) {
			code_title = RegExp.$1;
		}
		code_title = code_title.replace(/\"/g,"``");
		
		code_type = "";
		if (	codeImage.search(/\scode_type=([^\"\' >]+)/i) != -1) {
			code_type = RegExp.$1;
		}
		else if (codeImage.search(/\scode_type=\"([^\"]+)\"/i) != -1) {
			code_type = RegExp.$1;
		}
		code_type = code_type.replace(/\"/g,"``");
		
		code_src = "";
		if (	codeImage.search(/\scode_src=([^\"\' >]+)/i) != -1) {
			code_src = RegExp.$1;
		}
		else if (codeImage.search(/\scode_src=\"([^\"]+)\"/i) != -1) {
			code_src = RegExp.$1;
		}
		code_src = decodeURIComponent(code_src);
		
		if (code_type == "external") {
			codeSpan = code_src;
		}
		else {
			codeSpan = "<span name=\"codeSpan\" code_title=\""+code_title+"\" code_type=\""+code_type+"\">"+code_src+"</span>";
		}
		html = html.replace(codeImageRe,codeSpan);
	}
	
	return html;
}	

//===================================================================
//  
//  setVisibilityRTE: hide or show RTE (visibility is optional)
//  
//===================================================================
function setVisibilityRTE(fname,visibility) {
	
	var maindiv = document.getElementById("cell "+fname);
	var table = maindiv.parentNode.parentNode.parentNode.parentNode;
	var editorDiv = document.getElementById("editor "+fname);
	if (!visibility) {
		visibility = (maindiv.style.visibility=="hidden") ? "visible" : "hidden";
	}
	if (visibility==maindiv.style.visibility) {
		return;
	}
	if (visibility=="hidden") {
		maindiv.style.visibility = "hidden";
		maindiv.setAttribute("real_height",maindiv.style.height);
		maindiv.style.height = 0;
		table.style.visibility = "hidden";
		
	}
	else {
		table.style.visibility = "visible";
		maindiv.style.visibility = "visible";
		maindiv.style.height = maindiv.getAttribute("real_height");
		editorDiv.style.height = editorDiv.parentNode.clientHeight;
		
	}
		
}	
//===================================================================
//  
//  resetEditors: reset all editors 
//  
//===================================================================
function resetEditors() {
	
	var ifrs = document.getElementsByTagName("iframe");
	if (!ifrs) {
		return;
	}
	
	var fname = "";
	var ta = null;
	var rad = null;
	var css = null;
	for (i=0;i<ifrs.length;i++) {
		if (ifrs[i].id.indexOf("editor ") != 0) {
			continue;
		}
		fname = ifrs[i].id.slice(7);
		var field = document.getElementById(fname);
		field.value = field.value.replace(flvPlayerCode,"");	// remove video code if exists
		field.value = field.value.replace(postEditorsCode,"");	// remove postEditorsCode code if exists
	
		var rad = field.form.elements["type "+fname];
		var css = field.form.elements["style "+fname];
		css.value = "";
		var lockEditorField = document.getElementById("lockEditor "+fname);
		var lockEditorValue = 0;
		var ftype = "editor";
		//**
		var meta_re = /<\!\-\-\sRTE\s(.+)\sRTE -->/;
		if (	field.value.search(meta_re) != -1) {
			var meta = RegExp.$1;
			field.value = field.value.replace(meta_re,"");
			if (meta.search(/css=([^&]+)/) != -1) {
				css.value = RegExp.$1;	
			}
			else {
				css.value = "";
			}	
			
			
			if (meta.search(/ftype=([^&]+)/) != -1) {
				ftype = RegExp.$1;
			}
			
			if (meta.search(/lockEditor=([^&]+)/) != -1) {
				lockEditorValue = RegExp.$1;
			}
		}
		//**
		
		
		css.value = defaultCss(css.value);
		css.defaultValue = css.value;
		
		setStyle(fname,css.value);
		copyData(field,ifrs[i]);
		
		if (field.value.search(/<iframe/i) != -1) {
			ftype = "text";
		}	
		if (ftype == "text") {
			rad[1].checked = true;
		}
		else {
			rad[0].checked = true;
		}
		for (r=0;r<rad.length;r++) {
			if (rad[r].checked) {
				setCellType(rad[r]);
			}
		}
		
		if (lockEditorField && (lockEditorValue == 1)) {
			lockEditorField.checked = true;
			if (isIE) {
				setTimeout("lockEditor('"+lockEditorField.id+"')",200);
			}
			else {
				lockEditor(lockEditorField);
			}
		}
	}	
}
//===================================================================
//  
//  name: do 
//  
//===================================================================
function defaultCss(cssValue) {
	cssValue = cssValue.replace(/\s*:\s*/g,":");
	var cssPairs = cssValue.split(/\s*\;\s*/);
	var cssKeys = ",";
	for (var p=0; p<cssPairs.length; p++) {
		if (cssPairs[p].search(/([^:]+):/) != -1) {
			cssKeys += RegExp.$1 + ",";
		}
	}
	cssKeys = cssKeys.toLowerCase();
	
	if (cssKeys.search(/,font\-family,/) == -1) {
		cssValue = "font-family:inherit;"+cssValue;
	}
	if (cssKeys.search(/,direction,/) == -1) {
		cssValue = "direction:"+rte_lang.direction+";"+cssValue;
	}
	if (cssKeys.search(/,background\-color,/) == -1) {
		cssValue = "background-color:transparent;"+cssValue;
	}
	if (cssKeys.search(/,background\-image,/) == -1) {
		cssValue = "background-image:;"+cssValue;
	}
	if (cssKeys.search(/,color,/) == -1) {
		cssValue = "color:#000000;"+cssValue;
	}
	return cssValue;
}

//===================================================================
//  
//  setFrameColor: set show background-color 
//  
//===================================================================
function setFrameColor(fname,color) {
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none setFrameColor");
		return;
	}
	ifr.document.body.style.backgroundColor = color;
}
//===================================================================
//  
//  isBright: true if color is bright 
//  
//===================================================================
function isBright(color) {
	var limit = "";
	var RR = "";
	var GG = "";
	var BB = "";
	if (color.toLowerCase().search(/rgb\((\d+)\s*,\s*(\d+)\s*,\s*(\d+)/) != -1) {	// FF rgb(12, 45, 225)
		limit = 238;
		RR = RegExp.$1 - 0;
		GG = RegExp.$2 - 0;
		BB = RegExp.$3 - 0;
	}
	else if (color.toLowerCase().replace(/[^0-9a-f]+/g,"").search(/^([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/) != -1) {	// IE (#fe33ed)
		limit = "ee";
		RR = RegExp.$1;
		GG = RegExp.$2;
		BB = RegExp.$3;
	}
	else {
		return false;
	}
	//alert("RR="+RR+" GG="+GG+" BB="+BB);
	var count = 0;
	if (limit <= RR) {
		count++;
	}
	if (limit <= GG) {
		count++;
	}

	if (limit <= BB) {
		count++;
	}
	return (count > 1);	
	
		
}
//===================================================================
//  
//  hideRteMenu: hide menus 
//  
//===================================================================
function hideRteMenu(fname,menu) {
	if (!menu) {
		menu = "all";
	}
	var menu1 = document.getElementById(fname+" rteMenu1");
	var menu2 = document.getElementById(fname+" rteMenu2");
	var menu3 = document.getElementById(fname+" rteMenu3");
	
	if (menu1 && ((menu == "all") || (menu == 1))) {
		menu1.style.display = "none";
	}
	if (menu2 && ((menu == "all") || (menu == 2))) {
		menu2.style.display = "none";
	}
	if (menu3 && ((menu == "all") || (menu == 3))) {
		menu3.style.display = "none";
	}
}

//===================================================================
//  
//  mySleep: wait until time 
//  
//===================================================================
function mySleep(stopTime) {
	var D = new Date();
	if (stopTime <= 60) {
		stopTime = D.getTime() + stopTime * 1000;
	}
	while (D.getTime() < stopTime) {
		D = new Date();
	}
}
//===================================================================
//  
//  cssKey2JS: convert css key to javascript key background-color ==> backgroundColor 
//  
//===================================================================
function cssKey2JS(key) {
	key = key.toLowerCase();
	if (key.search(/\-([a-z])/) != -1) {
		var uc = RegExp.$1.toUpperCase();
		key = key.replace(/\-[a-z]/,uc);
	}
	return key;
}
//===================================================================
//  
//  moveCP: put colorPicker iframe in position  
//  
//===================================================================
function moveCP(x,y) {
	var cp = document.getElementById('colorPicker');
	//alert('ready?');
	x = x - 500;
	if (x < 0) {
		x = 10;
	}
	y = y - 0;	// convert to number
	if (self.innerHeight) { // Everyone but IE
			y += window.pageYOffset;
	} 
	else if (document.documentElement && document.documentElement.clientHeight && document.documentElement.scrollTop) { // IE6 Strict
			y += document.documentElement.scrollTop;
	} 
	else if (document.body) { // Other IE, such as IE7
			y += document.body.scrollTop;
	}
	y += 20;
	
	cp.style.left = x + 'px';
	cp.style.top = y+'px';// + document.body.scrollTop;
	if (!cp.style.zIndex || (cp.style.zIndex < 1)) {
		cp.style.zIndex = 1;
	}
}
//===================================================================
//  
//  lockEditor: click on "lock ediror" button 
//  
//===================================================================
function lockEditor(cb) {
	if (typeof cb == "string") {
		cb = document.getElementById(cb);
	}
	if (cb.checked == false) {
		if (!confirm(rte_lang.confirm_unlockEditor)) {
			cb.checked = true;
			return;
		}
	}
	var fname = cb.name.replace("lockEditor ","");
	var rte_rad = document.getElementsByName('type '+fname);
	
	
	var ifr = window.frames["editor "+fname];
	if (!ifr) {
		alert("none lockEditor");
		return;
	}
	var ta = document.getElementById(fname);
	
	var cleanButton = document.getElementById('clean '+fname);
	if (cleanButton) {
		cleanButton.style.display = (cb.checked ? "none" : "");
	}
	
	if (rte_rad[0].checked) {
		rte_rad[0].disabled = false;
		rte_rad[1].disabled = cb.checked;
		
		copyData("editor "+fname,fname);
		ifr.document.designMode = (cb.checked ? "Off" : "On");
		
		if (isIE) {	
			initEditors(fname);
			try {
			  ifr.document.body.contentEditable = !cb.checked;
			  //document.getElementById("editor "+fname).contentDocument.designMode="on";
			}
			catch(e) {}
		}
		
		var menu1 = document.getElementById(fname+" rteMenu1");
		var menu2 = document.getElementById(fname+" rteMenu2");
		var menu3 = document.getElementById(fname+" rteMenu3");
		
//		if (menu1) {
//			menu1.style.display = "none";
//		}
		if (menu2) {
			menu2.style.visibility = (cb.checked ? "hidden" : "visible");
		}
		if (menu3) {
			menu3.style.visibility = (cb.checked ? "hidden" : "visible");
		}
	}
	else {
		rte_rad[0].disabled = cb.checked;
		rte_rad[1].disabled = false;
		
		if (cb.checked) {
			ta.onfocus = new Function("this.blur()");
			ta.contentEditable = false;
		}
		else {
			ta.onfocus = new Function("void(0);");
			ta.contentEditable = true;
		}
	}
}

