title: Resize and repositon div using javascript
body: <p>I'm trying to do a simple resize and reposition of a div element that shows a ajax loading image.  The content it loads can change size, so I want the div element to resize to be the size of the parent, which in this case is a table dimension with the id "thEngineCategories".</p>
  
  <pre><code>function resize_divProgress() {
      var control = document.getElementById('thEngineCategories');
      var div = document.getElementById('divProgress');
  
      div.style.left = control.offsetLeft + 'px';
      div.style.top = control.offsetTop + 'px';
      div.style.width = control.offsetWidth + 'px';
      div.style.height = control.offsetHeight + 'px';
  }
  </code></pre>
  
  <p>The following is the javascript I have and it errors on </p>
  
  <pre><code>div.style.left = control.offsetLeft + 'px';
  </code></pre>
  
  <p>saying "div.style is undefined".  Whats wrong here?</p>
  
  <p>The div in html is as follows:</p>
  
  <pre><code>&lt;div class="overlay" id="divProgress"&gt;
  </code></pre>
  
  <p>The js function is called as follows:</p>
  
  <pre><code>&lt;th id="thEngineCategories" onmouseover="resize_divProgress()" &gt;
  </code></pre>
  
  <p>The CSS is:</p>
  
  <pre><code>.overlay
  {
      border: black 1px solid;
      padding: 5px;
      z-index: 100;
      width: 300px;
      position: absolute;
      background-color: #fff;
      -moz-opacity: 0.75;
      opacity: 0.75;
      filter: alpha(opacity=75);
      font-family: Tahoma;
      font-size: 11px;
      font-weight: bold;
      text-align: center;
  }
  </code></pre>
  
  <p>Is there a better way to handle what I'm trying to do?</p>