parseInt should always have a radix.
Fixing semicolons.
Adding curly braces around if blocks.
Adding missing "var" statements
Removing an unused and undeclared var.
Using === instead of ==
Using scientific notation.
Removing an empty else block.
JS vars have function scope, not block scope.