function inViewport(el, e) {
    var rect = el.getBoundingClientRect();
    var x = e.clientX;
    var y = e.clientY;
    return x >= rect.left + el.clientLeft &&
           x < rect.left + el.clientLeft + el.clientWidth &&
           y >= rect.top + el.clientTop &&
           y < rect.top + el.clientTop + el.clientHeight;
  }
Whether a mouse event is inside the element viewport. This will return
false if the mouseevent was generated over a border or a scrollbar.
@param {!HTMLElement} el The element to test the event with.
@param {!Event} e The mouse event.
@param {boolean} Whether the mouse event was inside the viewport.