Have an "onload" function. The script would look at the document's referrer. If the documents are named in a logical way, for example "page1", "page2", then you can do a substr on the name, get the number, and tell which direction you came from.
If you're running fullscreen, then what back button are you pressing? If you have built your own navigation buttons, then you can handle this with a querystring variable.
Reputation Points: 227
Solved Threads: 37
Made Her Cry
Offline 1,697 posts
since Dec 2004