Did you add the use strict line to your text before posting so you wouldn't get yelled at? Because there is no way that this code will run under use strict with 40 odd undeclared variables.
UPDATE: In fact this is the same code you posted last week without the use strict line. Aristotle nicely replied with a well written revision that compiles under strict and fixes a lot of the glaring propblems, which you have apparently ignored.
Now you post the same bad code, with a use strict thrown in just for our benefit and expect us to fix it again. I would suggest that you go back and apply the changes that Aristotle and others took time out to show you instead of wasting your own and everybody elses time.