Ok, imagine that some page on your site is
If you include a timestamp in all of your links, eg.
<script>
time = new Date(); // get current time
document.write('<a href="
time+'>some page</a>');
</script>
then you can compare the passed-in time with the current time, and if larger than some predefined time limit, do whatever you need to do when the back button is pressed, eg.
<script>
var t; var re;
t = ""+document.location+""; // url passed in
re = /(.*?)t=/i; // make a regular expression matching until the equal sign
t = t.replace(re, ""

; // replace it with nothing, leaving the time remaining
if ((time - t)>10000) // if page is more than 10 sec old
{ do_something(); } // the back button was pressed; do something
</script>
That should be sufficient for your needs. BTW, doing a non-greedy match by using the ? breaks the script in IE 5.0. That is a bug in the browser. Updating to IE 5.5 fixes that bug.
Sincerely,
Tom Anderson
CEO, Order amid Chaos, Inc.