 HTMLArea.loadPlugin("TableOperations");
 HTMLArea.loadPlugin("SpellChecker");
 HTMLArea.loadPlugin("ContextMenu");
 HTMLArea.loadPlugin("CSS");
 HTMLArea.loadPlugin("FullPage");
 var editorHasFocus=true;
 var editor=null;

	var css_plugin_args = {
	  combos : [
		{ label: "Syntax",
					 // menu text       // CSS class
		  options: { "None"           : "",
					 "Code" : "code",
					 "String" : "string",
					 "Comment" : "comment",
					 "Variable name" : "variable-name",
					 "Type" : "type",
					 "Reference" : "reference",
					 "Preprocessor" : "preprocessor",
					 "Keyword" : "keyword",
					 "Function name" : "function-name",
					 "Html tag" : "html-tag",
					 "Html italic" : "html-helper-italic",
					 "Warning" : "warning",
					 "Html bold" : "html-helper-bold"
				   },
		  context: "pre"
		},
		{ label: "Info",
		  options: { "None"           : "",
					 "Quote"          : "quote",
					 "Highlight"      : "highlight",
					 "Deprecated"     : "deprecated"
				   }
		}
	  ]
	};

function editor_gen(editor){
  editor.registerPlugin("TableOperations");
  editor.registerPlugin("SpellChecker");
  editor.registerPlugin("ContextMenu");
  editor.registerPlugin("CSS", css_plugin_args);
  editor.config.pageStyle = "@import url(htmlarea.css);";
  setTimeout(function() {
          editor.generate();
		  editor.focusEditor();
        }, 500);
  return false;
}

function initEditor(control_name) { 
  editor=new HTMLArea(control_name);
  editor_gen(editor);
 }

