TRUNK-3818 - updated Javascript to make it a little more efficient
Merge pull request #436 from tonybeing/master

TRUNK-3818 - updated Javascript to make it a little more efficient