merge var declarations
explicitly convert strings to numbers
use window.location.hash instead of regexp
remove unnecessary hack