Javascript Scope of Variables (Infamous Loop Problem) http://stackoverflow.com/questions/500431/javascript-variable-scope http://zsoltfabok.com/blog/2012/08/javascript-foreach/ http://robertnyman.com/2008/10/09/explaining-javascript-scope-and-closures/ http://madebyknight.com/javascript-scope/