Are there javascript commands to determine the first and last fully visible line in an html-textarea?

A part of a very large file is loaded and shown in an textarea. When the user hits the page up or down button, the javascript should determine the last fully shown line with a line break visible in the textare, respectivly the first fully shown line visible, and which cursor position that last line break or first shown character is of the textareas text. Then I could determine what to do next (only scroll the textarea or load a new part of the very large file).