rem: tb.selected = true; tb.setAttribute ("state", "current"); 
add: tb.parentNode.selectedItem = tb; tb.setAttribute("state", "current"); 
context: function setCurrentObject (obj){    function clearList()    {        client.rdf.Unassert (client.rdf.resNullChan, client.rdf.resChanUser,                             client.rdf.resNullUser, true);    };    if (!ASSERT(obj.messages, "INVALID OBJECT passed to setCurrentObject **"))        return;    if ("currentObject" in client && client.currentObject == obj)        return;    var tb, userList;    userList = document.getElementById("user-list");    if ("currentObject" in client && client.currentObject)    {        var co = client.currentObject;        // Save any nicknames selected        if (client.currentObject.TYPE == "IRCChannel")            co.userlistSelection = getSelectedNicknames(userList);        tb = getTabForObject(co);    }    if (tb)    {        tb.selected = false;        tb.setAttribute ("state", "normal");    }    /* Unselect currently selected users.     * If the splitter's collapsed, the userlist *isn't* visible, but we'll not     * get told when it becomes visible, so update it even if it's only the     * splitter visible. */    if (isVisible("user-list-box") || isVisible("main-splitter"))    {        /* Remove currently selected items before this tree gets rerooted,         * because it seems to remember the selections for eternity if not. */        if (userList.view && userList.view.selection)            userList.view.selection.select(-1);        if (obj.TYPE == "IRCChannel")        {            client.rdf.setTreeRoot("user-list", obj.getGraphResource());            reSortUserlist(userList);            // Restore any selections previously made            if (("userlistSelection" in obj) && obj.userlistSelection)                setSelectedNicknames(userList, obj.userlistSelection);        }        else        {            var rdf = client.rdf;            rdf.setTreeRoot("user-list", rdf.resNullChan);            rdf.Assert (rdf.resNullChan, rdf.resChanUser, rdf.resNullUser,                        true);            setTimeout(clearList, 100);        }    }    client.currentObject = obj;    tb = dispatch("create-tab-for-view", { view: obj });    if (tb)    {        tb.selected = true;        tb.setAttribute ("state", "current");    }    var vk = Number(tb.getAttribute("viewKey"));    delete client.activityList[vk];    client.deck.selectedIndex = vk;    // Style userlist and the like:    updateAppMotif(obj.prefs["motif.current"]);    updateTitle();    updateProgress();    updateSecurityIcon();    scrollDown(obj.frame, false);    // Input area should have the same direction as the output area    if (("frame" in client.currentObject) &&        client.currentObject.frame &&        getContentDocument(client.currentObject.frame) &&        ("body" in getContentDocument(client.currentObject.frame)) &&        getContentDocument(client.currentObject.frame).body)    {        var contentArea = getContentDocument(client.currentObject.frame).body;        client.input.setAttribute("dir", contentArea.getAttribute("dir"));    }    client.input.focus();}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/8395/9d294603852f8613f0dcfa90cf724239cbf57947/static.js/buggy/extensions/irc/xul/content/static.js