refactored to separate js from redmine code
verification using jshint applied