i had the need to get the visible window width & height. (to ensure an element won't be positioned outside this range)
getting these values depends heaviliy on the browser you are using.
so i added two attributes to Position, which get initialized on Position.prepare (in most cases you need this you will call Position.prepare anyway, because you need also scrollX/Y, resp. deltaX/Y)
maybe that is also useful for others and makes it into prototype.js
!!! i haven't (couln't) test it on Safari.
var Position = {
// ...
prepare: function() {
// ...
this.visibleWidth =
(window.opera) ? document.body.clientWidth || document.documentElement.clientWidth || window.innerWidth
: document.documentElement.clientWidth || window.innerWidth || document.body.clientWidth;
this.visibleHeight =
(window.opera) ? document.body.clientHeight || document.documentElement.clientHeight || window.innerHeight
: document.documentElement.clientHeight || window.innerHeight || document.body.clientHeight;
// ...