Moved inline JS into js/main.js