rem: tb.addEventListener("click", onTBIClickTempHandler, false); 
add: tb.setAttribute ("onclick", "onTBIClick('" + id + "');");   
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;            break;        }        else            if (client.viewsArray[i].tb.getAttribute("id") == id)                id = "tb[" + name + "<" + (++matches) + ">]";    }    if (!tb && create) /* not found, create one */    {        var views = document.getElementById ("views-tbar-inner");        tb = document.createElement ("menubutton");        tb.addEventListener("click", onTBIClickTempHandler, false);                var aclass = (client.ICONS_IN_TOOLBAR) ?            "activity-button-image" : "activity-button-text";                tb.setAttribute ("class", "menubutton " + aclass);        tb.setAttribute ("id", id);        tb.setAttribute ("state", "normal");        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);        views.appendChild (tb);    }    return tb;    }
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/c833d164ca81bc00ed4826803b6aebeae408c202/static.js/buggy/extensions/irc/xul/content/static.js