title: Cannot read property 'length' of null - using css display block (select/onchange)
body: <p>I'm using Google Charts, and the charts are visible by using a select menu:</p>
  
  <pre><code>&lt;select id="form_frame1" name="frame1" onchange="getChart(this);"&gt;
     &lt;option value="area_chart_google" &gt;Area Chart&lt;/option&gt;
     &lt;option value="area_chart_2" selected="selected"&gt;Stacked Chart&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>
  
  <p>My getChart function is:</p>
  
  <pre><code>function getChart(selection) {
   if (selection.value == "area_chart_2") {
      document.getElementById('area_chart_2').style.display = 'block';
      document.getElementById('area_chart_google').style.display = 'none';
  }
  
   else {   
      document.getElementById('area_chart_2').style.display = 'none';
      document.getElementById('area_chart_google').style.display = 'block';
     }
  }
  </code></pre>
  
  <p><strong>Is working OK when using Display: 'block' by default (area_chart_google)</strong>. The problem is that once I hide (none) the chart (area_chart_google) and then I display it (block) I get this error:</p>
  
  <pre><code>In Firebug: google-visualization-errors-all-1 
  In Chrome: Cannot read property 'length' of null
  In Safari: 'null' is not an object
  </code></pre>
  
  <p>This is my HTML (Script is inside the body, I'm using JSAPI on the header):</p>
  
  <pre><code>&lt;div id="area_chart_google" class="area-chart"&gt;&lt;/div&gt;
  &lt;script type="text/javascript"&gt;
    google.load("visualization", "1", {packages:["corechart"]});
    google.setOnLoadCallback(drawChart);
    function drawChart() {
      var data = new google.visualization.DataTable();
      data.addColumn('string', 'Header');
      data.addColumn('number', '');
      data.addColumn('number', '');
      data.addRows([
        ['Monday',300,43],
        ['Tuesday',250,545],
        ['Wednesday',122,78],
        ['Thursday',348,92],
        ['Friday',23,61],
        ['Saturday',39,93]
      ]);
      var options = {
        title: '',
        hAxis: {title: '',  titleTextStyle: {color: '#efed22'}},
        backgroundColor: '#efede9',
        legend: 'none'
      };
      var chart = new google.visualization.AreaChart(document.getElementById('area_chart_google'));
      chart.draw(data, options);
    }
  &lt;/script&gt;
  </code></pre>