var editor = null;
function initEditor() 
{
editor = new HTMLArea("tresc_form"); //your form id

var cfg = editor.config; // this is the default configuration


//// SETTINGS /////


////// new buttons ////////

//new window size function

if (screen.width > 800)
{
var l = 340;
var t = 200;
var lh = 120;
var th = 60;
}
else
{
var l = 210;
var t = 120;
var lh = 70;
var th = 50;
}


//upload image
cfg.registerButton("uploadimage", "Zapisz obrazek na serwer", "htmlarea/images/up_image.gif", false,
    function(upload) 
    {
    window.open('htmlarea/popups/upload_image.php', 'upload' ,'left='+l+', top='+t+', width=300 , height=200','menubar=no');
    } );

//help
cfg.registerButton("help", "Pomoc", "htmlarea/images/ed_help.gif", false,
    function(help) 
    {
    window.open('htmlarea/popups/help.html', 'help' ,'left='+lh+', top='+th+', width=600 , height=600','menubar=no');
    } );

//button bullet
cfg.registerButton("bullet", "Wstaw kropkę", "htmlarea/images/ed_bullet.gif", false,
    function(editor) 
    {
    editor.insertHTML("&bull; "); 
    } );

//akapit
cfg.registerButton("akapit", "Wstaw akapit", "htmlarea/images/ed_akapit.gif", false,
    function(editor) 
    {
    editor.insertHTML("&nbsp;&nbsp;&nbsp;&nbsp; "); 
    } );

// set your toolbar
cfg.toolbar = [
 		[ "fontname", "space",
		  "fontsize", "space", "space",
		  "bold", "italic", "underline", "separator",
		  "subscript", "superscript", "separator",
		  "copy", "cut", "paste","separator", "undo", "redo"],

		[  "justifyleft", "justifycenter", "justifyright", "justifyfull", "separator",
		  "insertorderedlist", "insertunorderedlist", "outdent", "indent", "separator",
		  "forecolor", "hilitecolor", "separator",
		  "akapit","inserthorizontalrule", "createlink","inserttable", "separator", "insertimage", "uploadimage","separator", "htmlmode", "separator",
		   "help", "about" ]
];


// Editor style
cfg.pageStyle = "body {background-color: #EEEEEE; font-family: Verdana; font-size:13px; }";


// generate editor
  editor.generate();
}

