code: function() {
          // the div might have moved on the page, also
          var newSize = this.getCurrentSize();
          if (newSize && !isNaN(newSize.h) && !isNaN(newSize.w)) {
              this.events.clearMouseCache();
              var oldSize = this.getSize();
              if (oldSize == null) {
                  this.size = oldSize = newSize;
              }
              if (!newSize.equals(oldSize)) {
                  
                  // store the new size
                  this.size = newSize;
      
                  //notify layers of mapresize
                  for(var i=0, len=this.layers.length; i<len; i++) {
                      this.layers[i].onMapResize();                
                  }
      
                  var center = this.getCachedCenter();
      
                  if (this.baseLayer != null && center != null) {
                      var zoom = this.getZoom();
                      this.zoom = null;
                      this.setCenter(center, zoom);
                  }
      
              }
          }
          this.events.triggerEvent("updatesize");
      }
docs: APIMethod: updateSize
  This function should be called by any external code which dynamically
  changes the size of the map div (because mozilla wont let us catch
  the "onresize" for an element)