Javascript scoping is really odd. The declaration of a local variable works like you would expect it to, but there are times that a declared variable sticks out above the scope where it was declared.