refactored javascript
Merge pull request #105 from JustAboutJeff/refactor_js

refactored javascript