code: function ev_canvas(ev) {
          if(!root.is('.blocked')) {
              if(ev.layerX || ev.layerX == 0) { // Firefox
                  ev._x = ev.layerX;
                  ev._y = ev.layerY;
              } else if(ev.offsetX || ev.offsetX == 0) { // Opera
                  ev._x = ev.offsetX;
                  ev._y = ev.offsetY;
              }
  
              // Call the event handler of the tool.
              var func = tool[ev.type];
              if(func) {
                  func(ev);
              }
          }
      }
docs: The general-purpose event handler. This function just determines the mouse position relative to the canvas element.