Adding ajax pagination

same here, you must check not to go overboard with number of pages since you have $numberOfPages variable...