Small fix on encrypt javascript funcion to improve firefox compatibility

Yesterday I was trying openpaperwallet, but I wasn't able to encrypt the keys using firefox however I had no trouble with chrome, so I debugged and it happened to be a small annoyance with a simple solution:
Function declarations inside blocks are not standard, they do not behave well in every browser. However, if you change the declaration for an expression(i.e var encrypt = function(index)), it works OK. Of course this means that this function wont be available until runtime, so the outer encrypt call must be placed after the expression.

Thats all. It works for me.