refactored out inline javascript.

_because we must._