Improvements to preventZoom function

The improvements in here are mostly for performance reasons:

### Reference length of form fields
Use a variable to track the length of the form fields rather than calculating it in every new iteration within the for-loop.
Apart from that I removed the first declaration of `var i` since there were two that both do `i = 0` otherwise.


### Zoom on focus function: move functions outside of loop
Remove creation of onfocus- and onblur-functions from for-loop since this is bad for performance. Instead just call a reference of these functions.
If functions are created within the loop each iteration will get its own function in memory. Calling a function reference has the same effect.