// JavaScript Document<script type="text/javascript">

var editor = null;
  HTMLArea.loadPlugin("ContextMenu");
  HTMLArea.loadPlugin("TableOperations");
  HTMLArea.loadPlugin("TableOperations");
  
function initEditor() {
  	editor = new HTMLArea("msg_body");
	editor.registerPlugin(ContextMenu);
	editor.registerPlugin(TableOperations);
    editor.registerPlugin(TableOperations);

  var cfg = editor.config; // this is the default configuration
	
cfg.toolbar = [

[ "bold", "italic", "underline", "separator",
  "copy", "cut", "paste", "space", "undo", "redo", "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
  "insertorderedlist", "insertunorderedlist", "outdent", "indent"],
  ["strikethrough", "subscript", "superscript", "separator",
    "inserthorizontalrule", "createlink",  "removelink", "removetag", "separator", "insertimage", "inserttable", "htmlmode"],
  ["TO-table-prop", "separator", "TO-row-prop", "TO-row-insert-above", "TO-row-insert-under", "TO-row-delete", "TO-row-split", "separator", "TO-col-insert-before", "TO-col-insert-after", "TO-col-delete", "TO-col-split", "separator", "TO-cell-prop", "TO-cell-insert-before", "TO-cell-insert-after", "TO-cell-delete", "TO-cell-merge", "TO-cell-split"]
];

/*  cfg.pageStyle = "body { background-color: #ffffff; font-size: 12px; 	font-family:  Arial, Helvetica,  sans-serif;}"+
  "p {spacing: 0px; margin: 0px; border: 0px;}"+
  "table { font-size: 12px;}"+
  "a {color: #ff5f00;}";*/
	 cfg.pageStyle = "@import url(include/style.css);"+
	 "body { background-color: #ffffff;}"; 


  editor.generate();
}
function insertHTML() {
  var html = prompt("Enter some HTML code here");
  if (html) {
    editor.insertHTML(html);
  }
}

