code refactor, created a local jquery reference, fixed a problem with mispaging on a null previous or next url