code: function(point, res) {
          return new OpenLayers.Pixel(
             Math.max(Math.floor((point.x - this.tileOrigin.lon) / (this.tileSize.w * res)),0),
             Math.max(Math.floor((this.tileOrigin.lat - point.y) / (this.tileSize.h * res)),0)
          );
      }
docs: Method: getContainingTileCoords
  Calculates the x/y pixel corresponding to the position of the tile
  that contains the given point and for the for the given resolution.
  
  Parameters:
  point - {<OpenLayers.Geometry.Point>}
  res - {Float} The resolution for which to compute the extent.
  
  Returns:
  {<OpenLayers.Pixel>} The x/y pixel corresponding to the position
  of the upper left tile for the given resolution.