Call the JavaScript openPageNext / openPagePrev functions to simplify directional handling.