For the unenlightened like myself,
JavaScript basically has two scopes
for variables: global and local.
Variables assigned outside of a
function are global, and variables
assigned inside of a function, using
the var keyword, are local (not rocket
surgery). However, if you leave the
var keyword off, it assigns a global
variable, regardless of where it’s
declared.
From: http://opensoul.org/2008/9/4/the-importance-of-var-in-javascript