rendered paste bodyfunction toggle_scroll() { if (scrolling) { scrolling = false; clearTimeout(scroll_timer); } else { scrolling = true; scroll_chat(20); }}function scroll_chat(n) { var cd = document.getElementById('chat_div'); var scroll_max = cd.scrollHeight - cd.clientHeight; var scroll_pos = cd.scrollTop; scroll_pos += n; if (scroll_pos > scroll_max) { scroll_pos = scroll_max; } else if (scroll_pos < 0) { scroll_pos = 0; } cd.scrollTop = scroll_pos; scroll_timer = setTimeout('scroll_chat('+n+')', 50);}