Fix inline javascript in pagination
Created by: birdsarah
Update pagination javascript to fix bug, remove from inline and optimize:
- added as seperate file so that js is cached
- only run the code once per page even if there are multiple pagination areas
- fixed bug where only first include of pagination was functional