title: randomly getting OpenLayers.Layer.OSM.Mapnik is not a constructor
body: <p>I have a small popup window that I am loading on user click of a link on the page. But about half the time, I am getting "OpenLayers.Layer.OSM.Mapnik is not a constructor" in the console.log of firebug. If I close the popup (which is a jqueryui dialog) and then click the link again, it likely won't error. But if I close it and open it again I get the error again. It's very strange.</p>
  
  <p>If I completely refresh the page, I get the error on the first click but close and then I get the map.</p>
  
  <p>Is there some secret to loading the map in a smaller window that I am missing? I don't get the error in the full screen version of the map on a different page...</p>
  
  <p>Here's the code that loads the map:</p>
  
  <pre><code>var map = undefined,
  popup = undefined;
  
  function initialize (){
      var center_lat = "39.828175";
      var center_long = "-98.579500";
          OpenLayers.ImgPath = "/images/openlayers/";
      map = new OpenLayers.Map ("map", {
          controls:[
              new OpenLayers.Control.Navigation(),
              new OpenLayers.Control.PanZoomBar()],
          });
      var scalebar = new OpenLayers.Control.ScaleBar({displaySystem: "english",align: "right"});// this is an external library that is loaded as a js file and works great on the full screen map too....
      map.addControl(scalebar);
  
      layerMapnik = new OpenLayers.Layer.OSM.Mapnik("Open Street Maps");
      map.addLayer(layerMapnik);
      lonLat = OLL(center_long, center_lat);
      map.setCenter (lonLat, 13);
  }
  </code></pre>