Javascript used for AJAX, UI and Pagination