Moved variable 'el' declaration into inner scope

Moving the `var el` declaration into the function scope where it is used makes for more readable (understandable) code.

It might also help the JS code generators when optimizing the code (haven't tested that, though).