title: Position an object with findPos quirksmode
body: <p>I'm trying to position a <code>div</code> with the written method <code>findPos()</code> but I don't know how to start out. Google did not help me so much.</p>
  
  <p><strong>findPos</strong>:</p>
  
  <pre><code>function findPos(obj) {
      var curleft = curtop = 0;
  
      if (obj.offsetParent) {
          do {
              curleft += obj.offsetLeft;
              curtop += obj.offsetTop;
          } while (obj = obj.offsetParent);
  
          return [curleft, curtop];
      }
  }
  </code></pre>
  
  <p><strong>My code</strong>:</p>
  
  <pre><code>fname.onfocus = function() {
  
      tooltip("Insert name", fname);
  }
  
  function tooltip(text, form) {
  
      var div = document.createElement("div");
      div.className = "tool";
      var info = document.createTextNode(text);
      div.appendChild(info);
      form.parentNode.insertBefore(div, form.nextSibling);
  }
  </code></pre>
  
  <p>Any ideas?</p>