Fixed: zoom bug when Diva.js viewer is not full window

viewerXOffset calculation was incorrect upon resizing the window. viewerXOffset should always be relative to the window.

This fixes part of issue 162 (the zooming errors). Still working on the integrated page layout resizing issue.

Refs #162
Fixed: global variables

These variables were polluting the global namespace because they are were previously declared. Silently making undeclared variables global is an example a bad feature of Javascript.