rem: tbi.setAttribute ("onclick", "onTBIClick('" + id + "')");  
add:  tbi.addEventListener("click", onTBIClickTempHandler, false);  
context: function getTBForObject (source, create){    var name;    if (!source)    {        dd ("** UNDEFINED  passed to getTBForObject **");        dd (getStackTrace());        return;    }        create = (typeof create != "undefined") ? Boolean(create) : false;    switch (source.TYPE)    {        case "IRCChanUser":        case "IRCUser":            name = source.nick;            break;                    case "IRCNetwork":        case "IRCChannel":        case "IRCClient":            name = source.name;            break;        default:            dd ("** INVALID OBJECT passed to getTBForObject **");            return;    }    var tb, id = "tb[" + name + "]";    var matches = 1;    for (var i in client.viewsArray)    {        if (client.viewsArray[i].source == source)            tb = client.viewsArray[i].tb;        else            if (client.viewsArray[i].tb.id == id)                id = "tb[" + name + "<" + (++matches) + ">]";    }    if (!tb && create) /* not found, create one */    {        var views = document.getElementById ("views-tbar");        var tbi = document.createElement ("toolbaritem");        tbi.setAttribute ("onclick", "onTBIClick('" + id + "')");            tb = document.createElement ("titledbutton");        tb.setAttribute ("class", "activity-button");        tb.setAttribute ("id", id);        client.viewsArray.push ({source: source, tb: tb});        tb.setAttribute ("viewKey", client.viewsArray.length - 1);        if (matches > 1)            tb.setAttribute ("value", name + "<" + matches + ">");        else            tb.setAttribute ("value", name);        tbi.appendChild (tb);        views.appendChild (tbi);    }    return tb;    }
meta: 1567	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1567/6e101bce1928d1d64e107552578522c465248a2a/static.js/buggy/xul/content/static.js