function showsmileys(obj)
   {
   smileys.style.left = obj.offsetLeft+obj.offsetWidth/3;
   smileys.style.top = obj.offsetTop+obj.offsetHeight/3;
   smileys.style.display='';
   smileys.style.visibility='visible';
   }

function color(obj,text)
   {
   var colortable = document.getElementById('colortable');
   colortable.style.left = obj.offsetLeft+obj.offsetWidth/3;
   colortable.style.top = obj.offsetTop+obj.offsetHeight/3;
   colortable.instext=text;
   colortable.style.display='';
   colortable.style.visibility='visible';
   }

function HTMLEncode(text)
   {
   text = text.replace(/&/g, "&amp;");
   text = text.replace(/"/g, "&quot;");
   text = text.replace(/</g, "&lt;");
   text = text.replace(/>/g, "&gt;");
   text = text.replace(/'/g, "&#146;");
   return text;
   }

function SetPos(Obj)
   {
   if (Obj.createTextRange) Obj.caretPos = document.selection.createRange().duplicate();
   }

function ReplaceText(textarea, text)
   {
   if (textarea.createTextRange && textarea.caretPos)
      {
      var caretPos = textarea.caretPos;
      caretPos.text = text;
      }
   else textarea.value += text;
   textarea.focus(caretPos);
   }

function AddText(textarea, text, text2)
   {
   if (textarea.createTextRange && textarea.caretPos)
      {
      var caretPos = textarea.caretPos;
      caretPos.text = text + caretPos.text + text2;
      }
   else {textarea.value += text; textarea.value += text2;}
   textarea.focus(caretPos);
   }

function doaction(act, id)
   {
   document.all.action.value = act;
   document.all.aid.value = id;
   document.all.form.submit();
   }

function smile(ico)
   {
   document.all.text.value = document.all.text.value + ico;
   }

function picture(width, height, pic_src)
   {
   if (self.screen)
      {
      wndwidth = screen.width;
      wndheight = screen.height;
      var left=wndwidth/2-width/2;
      var top=wndheight/2-height/2;
      }
   else if (self.java)
      {
      var jkit = java.awt.Toolkit.getDefaultToolkit();
      var scrsize = jkit.getScreenSize();
      wndwidth = scrsize.width;
      wndheight = scrsize.height;
      var left=wndwidth/2-width/2;
      var top=wndheight/2-height/2;
      }
   else
      {
      var left=0;
      var top=0;
      }
    online=window.open("","_blank","toolbar=0,location=0,status=0,menubar=0,top=" + top + ",left=" + left + ",scrollbars=0,resizable=0,width=" + width + ",height=" + height);
    online.document.writeln("<html><head><title>Picture</title></head><body bgcolor='#F5F5F5' topmargin=0 leftmargin=0 marginwidth=0 marginheight=0><img src='" + pic_src + "' hspace=0 vspace=0 border=0 width=" + width + " height=" + height + "></body></html>");
    }


