Adds missing $document variable

- The $document variable should have been included with commit
  681fd0f.  Without it getRelativeMousePosition generates errors.