title: window.onload and getelementbyid returns null
body: <p>I have a problem with my JS-onload function.
  The getElementById()-function returns NULL every time, but the div exists.
  I cannot see the bug...</p>
  
  <p>Here is the HTML-code:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;&lt;/title&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;link rel="stylesheet" media="screen" href="styles/screen.css" /&gt;
      &lt;script type="text/javascript" src="scripts/browser.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="scripts/style.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="scripts/state.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div id="header"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>And the js-file which triggers the bug:</p>
  
  <pre><code>function onLoad() {
  var element;
  
  Browser.detect();
  alert('Engine: ' + Browser.browser);
  
  for (var i = 0; i &lt; Style.configs.length; i++) {
      for (var c = 0; c &lt; Style.configs[i].setup.length; c++) {
          if (Browser.browser == Style.configs[i].setup[c].engine) {
              element = document.getElementById(Style.configs[i].setup[c].size.flag);
              element.style.height = Style.configs[i].setup[c].size;
              break;
          }
          else if (Style.configs[i].setup[c].engine == "Default") {
              element = document.getElementById(Style.configs[i].setup[c].size.flag);
              element.style.height = Style.configs[i].setup[c].size;
              return;
          }
      }
  }
  }
  
  window.onload = onLoad;
  </code></pre>
  
  <p>And at last, the style.js-file:</p>
  
  <pre><code>var Style = {
  configs : [
      {
          flag : "header",
          setup : [
              {
                  engine : "Gecko",
                  size : 37
              },
              {
                  engine : "Default",
                  size : 38
              }
          ] 
      }
  ]
  };
  </code></pre>