    ////////////////////////////////////////////////////////////////////////////
    // fn_trim.js
    String.prototype.trim = function() {
    	return this.replace(/^\s+|\s+$/g,"");
    }
    String.prototype.ltrim = function() {
    	return this.replace(/^\s+/,"");
    }
    String.prototype.rtrim = function() {
    	return this.replace(/\s+$/,"");
    }
    
    
    ////////////////////////////////////////////////////////////////////////////
    // fn_getPos.js
    function getPos(o) 
    {
        var res = [0, 0];
        
        if (o.offsetParent) 
            while (true) 
            {
                res[0] += o.offsetLeft;
                res[1] += o.offsetTop;
                if (!o.offsetParent) break;            
                o = o.offsetParent;
            }
        
        else if (o.x) 
            res[o.x, o.y];
            
        return res;
    }
    
    ////////////////////////////////////////////////////////////////////////////
    // fn_addFavorite.js
    function AddFavorite(linkObj,addUrl,addTitle)
    {
        if (document.all && !window.opera)
        {
            window.external.AddFavorite(addUrl,addTitle);
            return;
        }
        else if (window.opera && window.print)
        {
            linkObj.title = addTitle;
            return;
        }
        else if ((typeof window.sidebar == 'object') && (typeof window.sidebar.addPanel == 'function'))
        {
            if (window.confirm('Přidat oblíbenou stránku jako nový panel?'))
            {
                window.sidebar.addPanel(addTitle,addUrl,'');
                return;
            }
            else
                return;
        }
        window.alert('Po potvrzení stiskněte CTRL-D,\nstránka bude přidána k vašim oblíbeným odkazům.');
        return;
    } 
