[#8449] fix broken javascript in IE7

http://www.redmine.org/issues/13811

Fix errors mentioned by JSHint.
https://github.com/opf/openproject/pull/1405

https://github.com/opf/openproject/pull/1414#issuecomment-44976775