Changed javascript to hide next and previous links in case they are not
required, first and last page.
Merge remote-tracking branch 'github/master'