AFAIK you won't be able to access the history from JavaScript. It will be a security hole and most of the browsers won't allow that. Probably there might be a workaround in IE by using ActiveX.
Found this entry which might be useful to you
window.history
There is a next property.
Returns the URL of the next item in
the session history
This property is not available to web
content and is not supported by other
browsers.
For security reasons the History
object doesn't allow the
non-privileged code to access the URLs
of other pages in the session history,
but it does allow it to navigate the
session history.
There is no way to clear the session
history or to disable the back/forward
navigation from unprivileged code. The
closest available solution is the
location.replace() method, which
replaces the current item of the
session history with the provided URL.