Added some JS for the main paige. Stuff almost works properly.