Is there some reason to declare all the variables at the top of the function?   Some jshint setting?   I would just declare them where they are actually defined, for example

```
var anim = function () { 
...
```
I realize this might be a religious issue but I thought for most of our code we are doing it the opposite way from what you've done.