add:  if (needScroll) w.scrollTo (0, w.document.height); 
context: function addHistory (source, obj){    if (!source.messages)    {        source.messages = document.createElement ("html:table");        source.messages.setAttribute ("class", "chat-view");        source.messages.setAttribute ("cellpadding", "0");        source.messages.setAttribute ("cellspacing", "0");        source.messages.setAttribute ("type", source.TYPE);        source.messages.setAttribute ("width", "100%");                switch (source.TYPE)        {            case "IRCChanUser":            case "IRCUser":                source.messages.setAttribute ("nick", source.nick);                break;            case "IRCNetwork":            case "IRCChannel":            case "IRCClient":                source.messages.setAttribute ("name", source.name);                break;            default:                dd ("** 'source' has INVALID TYPE in addHistory **");                break;        }           }    if (client.PRINT_DIRECTION == 1)    {        source.messages.appendChild (obj);        window.frames[0].scrollTo(0, 100000);    }    else        source.messages.insertBefore (obj, source.messages.firstChild);        if (source.MAX_MESSAGES)    {        if (typeof source.messageCount != "number")            source.messageCount = 1;        else            source.messageCount++;        if (source.messageCount > source.MAX_MESSAGES)            if (client.PRINT_DIRECTION == 1)                source.messages.removeChild (source.messages.firstChild);            else                source.messages.removeChild (source.messages.lastChild);    }    }
meta: 1567	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1567/34b013589b29a686cc1a854c9e410aa3d16a70ac/static.js/buggy/xul/content/static.js