why not have this as it's own javascript file and then have application.js handle it?