I know how to figure out the top coordinate of an element relative to the top of the document. I can use one of the following:

- document.defaultView.getComputedStyle(document.getElementById(element_id), '').getPropertyValue('top')

- document.getElementById(element_id).offsetTop


But I want to know the top coordinate of an element relative to the top of the viewable area of the browser. Does anyone know how to do this (in IE, Opera, and Mozilla)?