Gave the javascript code it's own file, bubbles.js, and moved it out of the html file.