Made page change function in JS. Still needs more work.