//-------------------------------------------- get object by its ID
function obj(object)
{
	return document.getElementById(object);
};


//-------------------------------------------- attach new function to page "onload"
function addLoadEvent(func) 
{
    var oldonload = window.onload;
    if (typeof window.onload != 'function')
	{
        window.onload = func;
    } 
	else 
	{
        window.onload = function()
		{
			oldonload();
			func;
        };
    };
};

//-------------------------------------------- focus object by its tabindex (must be defined!)
function FocusObjectByTabIndex(nr)
{
	obj = document.getElementsByTagName("*");
	for (i=0; i < obj.length; i++)
	{
		if (obj[i].tabIndex == nr)
		{
			obj[i].focus();
			break;
		};
	};
};


function InitializeFCKEditor(sBasePath, obj_id)
{
	var oFCKeditor = new FCKeditor(obj_id);
	oFCKeditor.ToolbarSet = "Aleks";
	oFCKeditor.BasePath	= sBasePath;
	if (obj('txt') != null) 
	{
		oFCKeditor.Height = "400";
		oFCKeditor.ReplaceTextarea();
	};
};




