title: Unable to get value of the property 'offsetWidth' : object is null or undefined error
body: <p>I am developing a page that is basically being set up as a table with three rows. The the top row is the header, the middle row is the main part of the page, and the bottom row is the navigation. Each button in the navigation row fires off a javascript function which using the innerHTML value of the middle row and places the necessary html to show the contents of the page.
  On the main page I have:</p>
  
  <pre><code>&lt;script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=MY_KEY&amp;sensor=false"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>In the head section I have:</p>
  
  <pre><code>var myOptions = {center: new google.maps.LatLng(-34.397, 150.644), zoom: 8, mapTypeId: google.maps.MapTypeId.ROADMAP };
  </code></pre>
  
  <p>In the body section so that it runs right away and then in the function that is called by the MAP Button I have:</p>
  
  <pre><code>var mapString;
  var w = document.getElementById("mainwindow");
  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  mapString = '&lt;table width="1024" cellpadding="0" cellspacing="0"&gt;&lt;tr&gt;';
  mapString += '&lt;td&gt; &lt;div id="map_canvas" width="1024" height="350"&gt;&lt;/div&gt;&lt;/td&gt;';
  mapString += '&lt;/tr&gt;&lt;/table&gt;';
  w.innerHTML = mapString;
  </code></pre>
  
  <p>Now when I press the Map button I get the error:</p>
  
  <pre><code>Unable to get value of the property 'offsetWidth': object is null or undefined
  main.js Line 29
  Code 0 char:1385
  URI: http://maps.gstatic.com/intl/en_us/mapfiles/api-2/3/2/main.js
  </code></pre>
  
  <p>Not sure what this error is trying to tell me. Any help would be greatly appreciated.</p>