updated JS wasn't merged on pull request #13

some small refactoring of JS
moving file into proper location in themes