xinha_editors = null;
xinha_init    = null;
xinha_config  = null;
xinha_plugins = null;

// This contains the names of textareas we will make into Xinha editors
xinha_init = xinha_init ? xinha_init : function()
{
  xinha_editors = xinha_editors ? xinha_editors :
  [
    'content'
  ];

  xinha_plugins = xinha_plugins ? xinha_plugins :
  [
			'CharacterMap',
			'SuperClean',
			'ExtendedFileManager'

  ];
  
         // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
         if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;

	xinha_config = xinha_config ? xinha_config() : new Xinha.Config();
   
	xinha_config.toolbar =
  [
    ["popupeditor","linebreak","htmlmode","undo","redo"],
    ["linebreak","formatblock","fontsize","bold","italic","underline","strikethrough","forecolor","subscript","superscript"],
    ["linebreak","justifyleft","justifycenter","justifyright","justifyfull", "createlink"],
    ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
    ["separator","inserthorizontalrule","inserttable"],
  ];
	xinha_config.formatblock =
		{
			"&mdash; format &mdash;"  : "",
			"Nagłówek duży": "h3",
			"Nagłówek mały": "h4",
			"Normalny tekst"   : "p"
		};
	xinha_config.fontsize =
	{
	  "— rozmiar —": "",
	  "1 (8 pt)" : "1",
	  "2 (10 pt)": "2",
	  "3 (12 pt)": "3",
	  "4 (14 pt)": "4",
	  "5 (18 pt)": "5",
	};

   // To adjust the styling inside the editor, we can load an external stylesheet like this
   // NOTE : YOU MUST GIVE AN ABSOLUTE URL
  
	xinha_config.pageStyleSheets = [ _editor_url + "examples/full_example.css" ];

	xinha_editors   = Xinha.makeEditors(xinha_editors, xinha_config, xinha_plugins);

	Xinha.startEditors(xinha_editors);
}

Xinha._addEvent(window,'load', xinha_init); // this executes the xinha_init function on page load 
                                            // and does not interfere with window.onload properties set by other scripts

