title: Autofocus form field in overlay
body: <p>This might be really simple, but after hours of searching, I haven't been able to figure it out.</p>
  
  <p>I need to autofocus on a form field inside an overlay, which is opened on a button click.</p>
  
  <p>I'm using the simple jQuery overlay code.</p>
  
  <pre><code>$(function() {
      $("a[rel]").overlay();
  });
  </code></pre>
  
  <p>The button's code is:</p>
  
  <pre><code>&lt;a rel="#popup"&gt;Button text&lt;/a&gt;
  </code></pre>
  
  <p>And (simplified) the overlay's HTML code is here:</p>
  
  <pre><code>&lt;div class="simple-overlay" id="popup"&gt;
      &lt;form method="post" class="form-class" action="form-action"  &gt;
          &lt;input class="text" id="email-field" type="text" name="email" value="" /&gt;
          &lt;input name="submit" class="submit" type="submit" value="Submit" tabindex="501" /&gt;
      &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Thanks in advance.</p>