I'm not positive, but I don't think you can append content using innerHTML. I think it wipes out everything that was previously there. Another way to accomplish what you're wanting is to try this:
Code:
var strContent = top.frames[0].document.getElementByID('chat').innerHTML + "new content";
top.frames[0].document.getElementByID('chat').innerHTML = strContent;