title: How does google move the search box to the top while typing?
body: <p>Go to <a href="http://google.com" rel="nofollow">google</a> type something and it will relocate the search box to the top, and load a results page without hitting search or enter.  The results page is black at first then as typing continues it loads results. I'm assuming this uses ajax, but does it load a new html page or somehow change the home page?</p>
  
  <p>HTML:</p>
  
  <pre><code>   &lt;div id="top_panel" class="main fluid"&gt;
          &lt;nav id="topNav" class="fluid"&gt;
              &lt;ul class="fluid fluidList navSystem"&gt;
                  &lt;li class="fluid navItem web"&gt;&lt;a href="index.html" class="web"&gt;Web&lt;/a&gt;&lt;/li&gt;
                  &lt;li class="fluid navItem photos"&gt;&lt;a href="#"&gt;Photos&lt;/a&gt;&lt;/li&gt;
              &lt;/ul&gt; &lt;!-- END .navSystem --&gt;
          &lt;/nav&gt; &lt;!-- END #topNav --&gt;
      &lt;/div&gt; &lt;!-- END #top_panel --&gt;
  </code></pre>
  
  <p>AJAX:</p>
  
  <pre><code>&lt;script&gt;
  function keypress() {
      var xmlhttp;
      if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari
          xmlhttp=new XMLHttpRequest();
      } else {// code for IE6, IE5
          xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
      xmlhttp.onreadystatechange=function() {
          if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200) {
              document.getElementById("top_panel").removeClass("main").addClass("results");
          }
      }
      xmlhttp.send();
  
  }
  &lt;/script&gt;
  </code></pre>