function SetEllipsis()
{
    var table = $get('funds_table');
    if (!table)
        return;

    var tds = table.getElementsByTagName("TD");
    for (var x = 0; x < tds.length; x++) {
        var cell = tds[x];
        if (cell.className.indexOf("ellipsis") == -1)
            continue;
            
        SetCellProps(cell, 110);
    }
}

function SetCellProps(cell, maxCellWidth)
{
    cell.style.whiteSpace = "nowrap";
    var child = cell;
    if (cell.childNodes.length == 1 && cell.firstChild.nodeValue != null) 
    {
         //Text staat rechtstreeks in de cell zonder attributen.
        var elem = document.createElement("span");
        var text = document.createTextNode(cell.firstChild.nodeValue);
        elem.appendChild(text);
        cell.firstChild.nodeValue = "";
        cell.appendChild(elem);
        //child = cell.firstChild
    }
    for (l=0;l < cell.childNodes.length; l++)
    {
        if (cell.childNodes[l].nodeName != "#text")
        {
            child = cell.childNodes[l].firstChild;
            break;
        }
    }

    y = 0

    var str = child.nodeValue;
    var str2;
    // Replace alle dubbelen spaties met enkele spaties (firefox probleem)
    while ((str2 = str.replace(/  /gi, " ")) != str)
        str = str2;
    // Trim de string (geen spaties voor/achter de string) (firefox probleem)
    str = str.replace(/^\s+/, ''); 
    str = str.replace(/\s+$/,'');

    child.parentNode.style.whiteSpace = "nowrap";
    child.parentNode.setAttribute("title", str);
    if (child.parentNode.offsetWidth > maxCellWidth)
    {
        do 
        {
            inhoud = (child.nodeValue).substr(0, child.nodeValue.length - 1);
            child.nodeValue = inhoud;
            if (inhoud.length <= 10)
                break;
        }
        while ((child.parentNode.offsetWidth > maxCellWidth - 20) )
        child.nodeValue += "...";
    }
}
