reverting popup positioning updates from pull request #30

includes optimizations per jslint