4 // Encapsulates access to the document object, so that we can
5 // fall back to alternate behaviour during command-line unit testing
7 var Browser = (function() {
10 function isDefined(obj) {
11 return !( typeof obj === 'undefined' || obj === null );
14 my.getElementById = function(id) {
15 if ( isDefined(document) ) {
16 var result = document.getElementById(id);
17 if ( isDefined(result) ) {
21 console.log('ERROR! Document element not found for ID:', id);
30 my.setOnMouseMove = function(handler) {
31 if ( typeof(document) === 'undefined' || document === null ) {
35 document.onmousemove = handler;