added useful test cases and changed id of some html elements
refactoring js for jquery & jslint