Reverted back to using separate global js var

I suspect this is what caused opera mini issue

Change-Id: I112eb8dc4974e9e98852c218778f72bb9fd30d2f