javascript magic for pagination under all tables