title: onLoad focus() event within jquerytools overlay effect
body: <p>I'm using the overlay jquery from here:</p>
  
  <p><a href="http://flowplayer.org/tools/overlay/index.html" rel="nofollow">http://flowplayer.org/tools/overlay/index.html</a></p>
  
  <p>Within my overlay I have a search box like this:</p>
  
  <pre><code>&lt;div class="simple_overlay" id="asearch"&gt;
  
      &lt;div id="searchbox"&gt;
      &lt;form id="amazonsearch" style='float:left;'&gt;
          &lt;input class="title" id="amazon-terms" style="width:400px;font-size:2em;"&gt;
          &lt;button class="sexybutton sexysimple sexygreen"&gt;Search&lt;/button&gt;
  
      &lt;/form&gt;
  
      &lt;div id="amazon-results"&gt;&lt;/div&gt;
  
      &lt;/div&gt;&lt;!--seachbox--&gt;
  
  &lt;/div&gt;&lt;!--Overlay--&gt;
  </code></pre>
  
  <p>What I want to happen is when you load the overlay the search box within the overlay gains focus so you can start typing into it. I thought that this would work:</p>
  
  <pre><code>$("a[rel]").overlay({
  
  onLoad: function() {
  $('#amazon-terms').focus(); 
  }
  
  });
  </code></pre>
  
  <p>But that doesn't seem to do anything. I know the event is firing because this works:</p>
  
  <pre><code>$("a[rel]").overlay({
  
  onLoad: function() {
  alert('popup opened') 
  }
  
  });
  </code></pre>
  
  <p>However, when this alert fires the overlay has not yet appeared on the screen so I wonder if that is part of the problem? According to the docs onLoad should fire "when the overlay has completely been displayed" (<a href="http://flowplayer.org/tools/overlay/index.html#effects_list" rel="nofollow">ref</a>)</p>
  
  <p>Any help appreciated! :)</p>
  
  <p>Thanks</p>
  
  <p>Tom</p>
  
  <p><strong>EDIT</strong> This code does what I want it to but I'm none the wiser as to why this works when the code above doesn't....</p>
  
  <pre><code>var triggers = $("a[rel]").overlay({
  closeOnClick: false,
  onLoad: function() {
  $('input').focus();
  }
  });
  </code></pre>