pager javascript