rem: source.messages.removeChild (source.messages.lastChild); 
add: if (client.PRINT_DIRECTION == 1) source.messages.removeChild (source.messages.firstChild); else source.messages.removeChild (source.messages.lastChild); 
context: function addHistory (source, obj){    if (!source.messages)    {        source.messages = document.createElement ("span");        source.messages.setAttribute ("class", "chat-view");        source.messages.setAttribute ("type", source.TYPE);                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);    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)            source.messages.removeChild (source.messages.lastChild);    }    }
meta: 1567	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/1567/82b4c0b132d428bad29ff823b9b9353dae156f50/test3-static.js/clean/xul/tests/test3-static.js