pagination js file

A common js file to do pagination