Possible Duplicate:
Is there a way to catch the back button event in javascript?
How can I detect a back or forth button click?
e.g.
if(back_button_clicked)
{
alert('back button was clicked');
}
else if(forward_button_clicked)
{
alert('forwardbutton was clicked');
}
As I want to run some special functions when the user does this.