separated scripts

moved scripts out of the footer snippet and into their own .js file