title: Javascript method not defined
body: <p>Why does this not work when I move the code in the first script block (without the script tag itself) to an external javascript file. </p>
  
  <p>The idea is to call homead.load() from home page and load everything processed by homead_build();</p>
  
  <p>Error says <strong>'homead not defined</strong>' using Firefox Error console</p>
  
  <pre><code>&lt;div id="box"&gt;
  &lt;/div&gt;
  
  &lt;script type="text/javascript"&gt;
      var homead = {
          box_id: "box",
          width: "150px",
          load: function(){
          homead.homead_build();
          },
  
          homead_build: function(){
              var div = document.createElement('div');
              div.style.width = homead.width;
              div.style.height = '55px';
              div.style.border = 'solid 2px #000';
              var box = document.getElementById(homead.box_id);
              box.appendChild(div);
          }
      };
  &lt;/script&gt;
  
  &lt;script language="JavaScript" type="text/javascript"&gt;
  
     homead.load();
  &lt;/script&gt;
  </code></pre>