docs: function (div, options) {
          
          // If only one argument is provided, check if it is an object.
          if(arguments.length === 1 && typeof div === "object") {
              options = div;
              div = options && options.div;
          }
  
          // Simple-type defaults are set in class definition. 
          //  Now set complex-type defaults 
          this.tileSize = new OpenLayers.Size(OpenLayers.Map.TILE_WIDTH,
                                              OpenLayers.Map.TILE_HEIGHT);
          
          this.paddingForPopups = new OpenLayers.Bounds(15, 15, 15, 15);
  
          this.theme = OpenLayers._getScriptLocation() + 
                               'theme/default/style.css'; 
  
          // backup original options
          this.options = OpenLayers.Util.extend({}, options);
  
          // now override default options 
          OpenLayers.Util.extend(this, options);
          
          var projCode = this.projection instanceof OpenLayers.Projection ?
              this.projection.projCode : this.projection;
          OpenLayers.Util.applyDefaults(this, OpenLayers.Projection.defaults[projCode]);
          
          // allow extents and center to be arrays
          if (this.maxExtent && !(this.maxExtent instanceof OpenLayers.Bounds)) {
              this.maxExtent = new OpenLayers.Bounds(this.maxExtent);
          }
          if (this.minExtent && !(this.minExtent instanceof OpenLayers.Bounds)) {
              this.minExtent = new OpenLayers.Bounds(this.minExtent);
          }
          if (this.restrictedExtent && !(this.restrictedExtent instanceof OpenLayers.Bounds)) {
              this.restrictedExtent = new OpenLayers.Bounds(this.restrictedExtent);
          }
          if (this.center && !(this.center instanceof OpenLayers.LonLat)) {
              this.center = new OpenLayers.LonLat(this.center);
          }
  
          // initialize layers array
          this.layers = [];
  
          this.id = OpenLayers.Util.createUniqueID("OpenLayers.Map_");
  
          this.div = OpenLayers.Util.getElement(div);
          if(!this.div) {
              this.div = document.createElement("div");
              this.div.style.height = "1px";
              this.div.style.width = "1px";
          }
          
          OpenLayers.Element.addClass(this.div, 'olMap');
  
          // the viewPortDiv is the outermost div we modify
          var id = this.id + "_OpenLayers_ViewPort";
          this.viewPortDiv = OpenLayers.Util.createDiv(id, null, null, null,
                                                       "relative", null,
                                                       "hidden");
          this.viewPortDiv.style.width = "100%";
          this.viewPortDiv.style.height = "100%";
          this.viewPortDiv.className = "olMapViewport";
          this.div.appendChild(this.viewPortDiv);
  
          this.events = new OpenLayers.Events(
              this, this.viewPortDiv, null, this.fallThrough, 
              {includeXY: true}
          );
          
          if (OpenLayers.TileManager && this.tileManager !== null) {
              if (!(this.tileManager instanceof OpenLayers.TileManager)) {
                  this.tileManager = new OpenLayers.TileManager(this.tileManager);
              }
              this.tileManager.addMap(this);
          }
  
          // the layerContainerDiv is the one that holds all the layers
          id = this.id + "_OpenLayers_Container";
          this.layerContainerDiv = OpenLayers.Util.createDiv(id);
          this.layerContainerDiv.style.zIndex=this.Z_INDEX_BASE['Popup']-1;
          this.layerContainerOriginPx = {x: 0, y: 0};
          this.applyTransform();
          
          this.viewPortDiv.appendChild(this.layerContainerDiv);
  
          this.updateSize();
          if(this.eventListeners instanceof Object) {
              this.events.on(this.eventListeners);
          }
  
          if (this.autoUpdateSize === true) {
              // updateSize on catching the window's resize
              // Note that this is ok, as updateSize() does nothing if the 
              // map's size has not actually changed.
              this.updateSizeDestroy = OpenLayers.Function.bind(this.updateSize, 
                  this);
              OpenLayers.Event.observe(window, 'resize',
                              this.updateSizeDestroy);
          }
          
          // only append link stylesheet if the theme property is set
          if(this.theme) {
              // check existing links for equivalent url
              var addNode = true;
              var nodes = document.getElementsByTagName('link');
              for(var i=0, len=nodes.length; i<len; ++i) {
                  if(OpenLayers.Util.isEquivalentUrl(nodes.item(i).href,
                                                     this.theme)) {
                      addNode = false;
                      break;
                  }
              }
              // only add a new node if one with an equivalent url hasn't already
              // been added
              if(addNode) {
                  var cssNode = document.createElement('link');
                  cssNode.setAttribute('rel', 'stylesheet');
                  cssNode.setAttribute('type', 'text/css');
                  cssNode.setAttribute('href', this.theme);
                  document.getElementsByTagName('head')[0].appendChild(cssNode);
              }
          }
          
          if (this.controls == null) { // default controls
              this.controls = [];
              if (OpenLayers.Control != null) { // running full or lite?
                  // Navigation or TouchNavigation depending on what is in build
                  if (OpenLayers.Control.Navigation) {
                      this.controls.push(new OpenLayers.Control.Navigation());
                  } else if (OpenLayers.Control.TouchNavigation) {
                      this.controls.push(new OpenLayers.Control.TouchNavigation());
                  }
                  if (OpenLayers.Control.Zoom) {
                      this.controls.push(new OpenLayers.Control.Zoom());
                  } else if (OpenLayers.Control.PanZoom) {
                      this.controls.push(new OpenLayers.Control.PanZoom());
                  }
  
                  if (OpenLayers.Control.ArgParser) {
                      this.controls.push(new OpenLayers.Control.ArgParser());
                  }
                  if (OpenLayers.Control.Attribution) {
                      this.controls.push(new OpenLayers.Control.Attribution());
                  }
              }
          }
  
          for(var i=0, len=this.controls.length; i<len; i++) {
              this.addControlToMap(this.controls[i]);
          }
  
          this.popups = [];
  
          this.unloadDestroy = OpenLayers.Function.bind(this.destroy, this);
          
  
          // always call map.destroy()
          OpenLayers.Event.observe(window, 'unload', this.unloadDestroy);
          
          // add any initial layers
          if (options && options.layers) {
              /** 
               * If you have set options.center, the map center property will be
               * set at this point.  However, since setCenter has not been called,
               * addLayers gets confused.  So we delete the map center in this 
               * case.  Because the check below uses options.center, it will
               * be properly set below.
               */
              delete this.center;
              delete this.zoom;
              this.addLayers(options.layers);
              // set center (and optionally zoom)
              if (options.center && !this.getCenter()) {
                  // zoom can be undefined here
                  this.setCenter(options.center, options.zoom);
              }
          }
  
          if (this.panMethod) {
              this.panTween = new OpenLayers.Tween(this.panMethod);
          }
          if (this.zoomMethod && this.applyTransform.transform) {
              this.zoomTween = new OpenLayers.Tween(this.zoomMethod);
          }
      }