	// WARNING: using this interface to load plugin
	// will _NOT_ work if plugins do not have the language
	// loaded by HTMLArea.

	// In other words, this function generates SCRIPT tags
	// that load the plugin and the language file, based on the
	// global variable HTMLArea.I18N.lang (defined in the lang file,
	// in our case "lang/en.js" loaded above).

	// If this lang file is not found the plugin will fail to
	// load correctly and nothing will work.

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

	function initEditor(txtArea) {

		editor = new HTMLArea(txtArea);

		editor.config.toolbar = [
			[ "fontname", "space",
			"fontsize", "space",
			"formatblock", "separator" ,
			"bold", "italic", "underline", "strikethrough", "separator",
			"subscript", "superscript", "separator",
			"copy", "cut", "paste", "space", "undo", "redo" ],
			[ "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
			"lefttoright", "righttoleft", "separator",
			"insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
			"forecolor", "hilitecolor", "separator",
			"inserthorizontalrule", "createlink", "insertimage", "inserttable", "htmlmode", "separator",
			"popupeditor", "separator", "showhelp", "about" ]
		];
		
		editor.config.statusBar = true;
		
		// comment the following two lines to see how customization works
		//editor.generate();
		//return false;

		// register the FullPage plugin
		editor.registerPlugin(FullPage);

		// register the SpellChecker plugin
		//editor.registerPlugin(TableOperations);

		// register the SpellChecker plugin
		//editor.registerPlugin(SpellChecker);

		// register the CSS plugin
		/*
		editor.registerPlugin(CSS, {
			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"
						}
			}
			]
		});
		*/

		// add a contextual menu
		editor.registerPlugin("ContextMenu");

		// load the stylesheet used by our CSS plugin configuration
		editor.config.pageStyle = "@import url(custom.css);";

		setTimeout(function() {
			editor.generate();
		}, 500);
		return false;
	}

