Scrolling Chat Box

Ok -I’ve got a chat box (htmlText field) complete with scrollbar etc and it gets populated by php every time a user enters text. What I want is to have it trim the 1st entry off once the last entry reaches a certain number (to keep the box from being extremely high after about 5 mins with 20 users). At the moment the box auto scrolls to the bottom each time a new entry comes in with … chat_txt.scroll = chat_txt.maxscroll;… and that keeps the users happy since they don’t need to scroll anything. I just assume that having a text field with over 8000 lines of text has got to be consuming resources somewhere? lol
Any help greatly appreciated - ideally i’d like to have the equivalent of two screens worth of text before it starts throwing old lines out from the top.
P.S The field has a style sheet associated with it so I cant use settextformat properties - just to make it difficult - lol