Ran the javascript though jslint and corrected all the identified issues.