var g=document.getElementById("g");g.src="https://foobar.withgoogle.com/"+window.location.search
All that bit of code is doing is ensuring the frame on the page gets passed the query string the outer page had.
E.g. https://www.google.com/foobar/?hello -> https://foobar.withgoogle.com/?hello