google search box : understanding the semantics/structure of the search element [migrated]

the input area of the Google's searchbox looks like this:

enter image description here

It has :

  1. a input type="text", where the user types.
  2. a hidden div
  3. another input type="text" which shows the inline suggestion
  4. another input type="text"

Overall all this structure is related to autocompletion it seems. But I can't understand the functionality for 2 and 4, as they don't seem to change with different searches, 4 looks like 3 with added transforms.

Can somebody help with figuring this out?