Inside Technique : Scroll Tricks
  I found this masterpiece in the code of the third page of a discussion on scrolling
http://www.escriptzone.com/
Back
  Script Details:
BROWSER SUPPORT: IE4, IE5
Title: Scroll Tricks
Author: Scott Isaacs
Date: unknown
© 1997-98
InsideDHTML.com,
LLC. All rights reserved.
  Description: This article explores how to take advantage of the
Internet Explorer4.0 scroll properties through a simple example.
We display the "Top of Page" link in the lower-right corner
of the screen whenever the user is not at the top of the document.
Web Site: http://www.escriptzone.com/

I decided to make my portrait the background for the link,
and the computer did not approve, so we compromised.
Netscape does not understand the code, ignores it.

In this example, we explore how to add the Top of Page link to the lower-right corner of the screen. To accomplish this, we need to take advantage of CSS Positioning and two Dynamic HTML events, onscroll and onresize.

If you are running Internet Explorer 4.0, scroll the page down a little. Once the scrollbar moves from the top of the document a link is displayed in the lower-right hand corner. In all other browsers, the link is displayed at the end of the page.

We created this by trapping the onresize and onscroll event. Each time the document resizes or scrolls, if the vertical scrollbar is not at the top of the document, we calculate the lower-right hand corner position of the client area and display the link. The code I am using has two parts. The first is placed before the <BODY> label.
Curiously, Scott Isaacs did not use the <HEAD>,</HEAD> labels:
<STYLE>
<!--
#pageTop {position: absolute; visibility: hidden; background: lightgrey; border: 1px black solid}
-->
</STYLE>
<STYLE TYPE="text/javascript">
<!-- Required for netscape 4.0
ids.pageTop.position = "static"
// -->
</STYLE>
<SCRIPT>
<!--
// Check if IE4
var ie4 = (document.all != null)

function doPageTop() {
var el = document.all.pageTop
if (document.body.scrollTop>0){

var rightEdge = document.body.clientWidth - el.offsetWidth + document.body.scrollLeft
var topEdge = document.body.clientHeight - el.offsetHeight + document.body.scrollTop
el.style.pixelTop = topEdge
el.style.pixelLeft = rightEdge
el.style.visibility = "visible"
} else
el.style.visiblity = "hidden"
}

if (ie4) {
window.onscroll = doPageTop
window.onresize = doPageTop
}
// -->
</SCRIPT>
<A NAME="top"></A>
<BODY BGCOLOR=white>

This is the second part. Place it at the end of your page
<TABLE ID=pageTop><TR><TD NOWRAP>
<A HREF="#top">Top of Page </TD></TR></TABLE>
</BODY>
</HTML>


I like to go too many steps forward.
The portrait is background for the inner table.

<TABLE ID=pageTop><TR><TD NOWRAP>
<TABLE BACKGROUND="ej.jpg" width=117 height=150>
<TR><TD NOWRAP>
</TD></TR></TABLE>
<A HREF="#top">Top of Page </A></TD></TR></TABLE>
Top of Page