Do these two functions conflict with the textarea focus attribute??

PHP Code:
       <script language="Javascript1.2">
<!-- 
// load htmlarea
_editor_url "../htmlarea/";                     // URL to htmlarea files
var win_ie_ver parseFloat(navigator.appVersion.split("MSIE")[1]);
if (
navigator.userAgent.indexOf('Mac')        >= 0) { win_ie_ver 0; }
if (
navigator.userAgent.indexOf('Windows CE') >= 0) { win_ie_ver 0; }
if (
navigator.userAgent.indexOf('Opera')      >= 0) { win_ie_ver 0; }
if (
win_ie_ver >= 5.5) {
 
document.write('<scr' 'ipt src="' +_editor_url'editor.js"');
 
document.write(' language="Javascript1.2"></scr' 'ipt>');  
} else { 
document.write('<scr'+'ipt>function editor_generate() { return false; }</scr'+'ipt>'); }
// -->
</script>
<script language="JavaScript1.2">
<!--
function replaceText(text)
{
 if (document.guestbook.guest_comment.createTextRange && document.guestbook.guest_comment.caretPos) {
  var caretPos = document.guestbook.guest_comment.caretPos;
  caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == ' ' ? text + ' ' : text;
 }
 else document.guestbook.guest_comment.value += text;
 document.guestbook.guest_comment.focus(caretPos)
}
//-->
</script> 
because I keep getting this error when clicking on the emotion pic that I want

can't move focus to control because it is invisible, not enabled or a type that does not accept a focus

thanks for any help