Moved index page JavaScript to separate file