You will need to use a regexp to extract just the number you want out of the page location. There's a decent VBScript RegExp tester at
http://www.regular-expressions.info/...ptexample.html (you have to use IE in order to use it for some reason) and there is a javascript regexp tester at
http://www.regular-expressions.info/...ptexample.html
Once you extract the number from the page location, then you can easily use mathematical expressions to add and subtract 1 from that number, and re-write the links.