The keycode for the back button is 33 and the forward button is 34.
I found out by using the tool at the bottom of this page:
http://www.quirksmode.org/js/keys.html
All you would need to do is capture those key events [s]and stop them from doing their normal function[/s] which can easily be done using javascript/jquery.
Edit: I can't seem to find a way to stop the buttons from scrolling the page, so you need to make sure the page doesn't go over the window, or just don't worry about it scrolling if it doesn't effect what you're trying to do.