JavaScript Functionality

added a bunch of JavaScript Functionality