proper use of 'var' to avoid running conditions
Merge pull request #271 from tiefpunkt/clean_js

Proper use of 'var' to avoid running conditions