/*
	FILE : ha_setup.js
	DATE : 2004.10.8.dave
	DESC : CONFIGURATION FOR THE HTML WYSIWYG
*/

// LOAD PLUGINS
HTMLArea.loadPlugin("TableOperations");
HTMLArea.loadPlugin("ContextMenu");

var editor = null;
function initEditor(id,w,h) 
{
	editor = new HTMLArea(id);

	var cfg = editor.config; // THIS IS THE DEFAULT CONFIGURATION
	
	if (typeof w == "undefined") cfg.width = "600"; else cfg.width = w; 
	if (typeof h == "undefined") cfg.height = "300"; else cfg.height =  h;

	cfg.toolbar = [
		[ "fontname", "space", "fontsize", "space", "bold", "italic", "underline", "separator",
		  "subscript", "superscript", "separator",
		  "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator"],
		[ "copy", "cut", "paste", "space", "undo", "redo", "separator",
		  "insertorderedlist", "insertunorderedlist", "separator",
		  "forecolor", "insertimage", "inserttable", "separator",
		  "inserthorizontalrule", "createlink", "htmlmode" ]
	];

	cfg.fontname = {
		"Times New Roman"	:	'times new roman,times,serif',
		"Arial"		 		:	'arial,helvetica,sans-serif',
		"Courier New"		:	'courier new,courier,monospace',
		"Georgia"			:	'georgia,times new roman,times,serif',
		"Tahoma"			:	'tahoma,arial,helvetica,sans-serif',
		"Verdana"			:	'verdana,arial,helvetica,sans-serif',
		"Impact"			:	'impact',
		"WingDings"			:	'wingdings'
	};

	cfg.fontsize = {
		"1 (8 pt)"	:	"1",
		"2 (10 pt)"	:	"2",
		"3 (12 pt)"	:	"3",
		"4 (14 pt)"	:	"4",
		"5 (18 pt)"	:	"5",
		"6 (24 pt)"	:	"6",
		"7 (36 pt)"	:	"7"
	};

	cfg.pageStyle = "body { font-size: 9pt; font-family: times new roman,times,serif; }";

	cfg.killWordOnPaste = true;
	
	// PLUGINS
	with (editor)
	{
		registerPlugin(TableOperations);
		registerPlugin(ContextMenu);
	}
	
	editor.generate();
	
	// CUSTOM STATUS BAR MESSAGE
	editor.addStatusBar('<div style="text-align:right;color:red;">Turn off any popup blocker(s)</div>');
	
	placeFocus();
	return false;
}