<script language="javascript"> <!-- script for Rich Text Box --> function initRTE(){ if (navigator.appName.indexOf("Netscape")>-1){ var textArea = document.getElementById('RTBEditordesc'); var textAreaWidth = parseInt(textArea.offsetWidth); var textAreaHeight = parseInt(textArea.offsetHeight); textArea.style.display = 'none'; var iframe = document.createElement('iframe'); iframe.setAttribute('id', 'RTBEditordesc'); textArea.parentNode.insertBefore(iframe, textArea); iframe.style.width = textAreaWidth + 'px'; iframe.style.height= textAreaHeight + 'px'; iframe.style.border = '#A5ACB2 1px solid'; var editor = document.getElementById('RTBEditordesc').contentWindow.document; var iframeContent; iframeContent = '<html>\n'; iframeContent += '<head>\n'; iframeContent += '<style>html, body{border:0px;background-color:#FFFFFF;}\ntd{border:1px dotted #CCCCCC;}\n</style>\n'; iframeContent += '<body leftmargin="1" topmargin="1" marginwidth="1" marginheight="1">\n'; if (textArea.value !=''){ iframeContent += textArea.innerHTML;} iframeContent += '</body>\n'; iframeContent += '</html>'; editor.open(); editor.write(iframeContent); editor.close(); editor.designMode = 'on'; //textArea.style.visibility='hidden'; //window.onunload = function(){ //document.all("RTBHiddenDesc").value = document.getElementById("RTBEditordesc").innerHTML; //alert(document.all("RTBHiddenDesc").value); } } function fncSubmit(form, strToControl){ if (navigator.appName.indexOf("Netscape")>-1){ var textArea = document.getElementById('RTBEditordesc').contentWindow.document; document.all("RTBHiddenDesc").value = textArea.body.innerHTML; } else { var textArea = document.getElementById("RTBEditordesc") document.all("RTBHiddenDesc").value = textArea.innerHTML; } form.submit(); } // For EmotIcon Menu var isViewEmotIconMenu = false; function doInit() { for (i=0; i<document.all.length; i++) document.all(i).unselectable = "on"; RTBEditordesc.unselectable = "off"; RTBEditordesc.focus(); } var isHTMLMode = false; var bShow = false; var sPersistValue; // button over effect function button_over(eButton) { eButton.style.backgroundColor = "#B5BDD6"; eButton.style.borderColor = "darkblue darkblue darkblue darkblue"; } // go back to normal function button_out(eButton) { eButton.style.backgroundColor = ""; eButton.style.borderColor = ""; } // button down effect function button_down(eButton) { eButton.style.backgroundColor = "#8494B5"; eButton.style.borderColor = "darkblue darkblue darkblue darkblue"; } // back to normal function button_up(eButton) { eButton.style.backgroundColor = "#B5BDD6"; eButton.style.borderColor = "darkblue darkblue darkblue darkblue"; eButton = null; } // Resets Style to default after selection function EditorOnStyle(select) { cmdExec("formatBlock", select[select.selectedIndex].value); select.selectedIndex = 0; } // Resets Font to default after selection function EditorOnFont(select) { cmdExec("fontname", select[select.selectedIndex].value); select.selectedIndex = 0; } // Resets Size to default after selection function EditorOnSize(select) { cmdExec("fontsize", select[select.selectedIndex].value); select.selectedIndex = 0; } // execute command and enter the HTML in the RTB function cmdExec(cmd,opt) { if (navigator.appName.indexOf("Netscape")>(-1)){ document.getElementById('RTBEditordesc').contentWindow.focus(); document.getElementById('RTBEditordesc').contentWindow.document.execCommand(cmd,bShow,opt); if (cmd=='createLink') { insertLink = prompt('Hyperlink','http://'); alert(insertLink); document.getElementById('RTBEditordesc').contentWindow.focus(); document.getElementById('RTBEditordesc').contentWindow.document.execCommand('CreateLink', false, insertLink); } } else { RTBEditordesc.focus(); RTBEditordesc.document.execCommand(cmd,bShow,opt); } bShow=false; } // Insert Horizontal Rule function insertRuler() { cmdExec("InsertHorizontalRule",""); } </script>