Some JSLint sruggle

i.e. http://jslinterrors.com/dont-make-functions-within-a-loop/