function editable()
{
var xx = document.getElementById("yourmessage");
xx.designMode="on";

xx.focus();
document.execCommand("Bold", false, null);
xx.focus();

var tr;
function colorIt() {
   mouseX=event.x;
   mouseY=event.y;
   tr=document.body.createTextRange();
   tr.moveToPoint(mouseX, mouseY);
   tr.expand("word");
   tr.execCommand("ForeColor",false,"red");
}
document.onclick=colorIt;

var tr = document.selection.createRange();
tr.execCommand("Bold",false,null);
}

function editorCommand()
{

    var temp = document.selection.createRange()
    if ((event.type!="select") || (temp.text!=""))
      el._selection= temp
  }

  // Apply formatting to the text selection
  function format(cmd) {
    if (document.all.editor._selection!=null) {
      document.all.editor._selection.select()
      if (arguments[1]==null)
        document.all.editor._selection.execCommand(cmd)
      else 
        document.all.editor._selection.execCommand(cmd,true,arguments[1])
      document.all.editor._selection.select()
    }

}
