onload is a property if window objects, not body elements, despite what the HTML attribute might lead you to believe. This is the reference:
printwindow.onload
However, in this context you can't pass it a string of JavaScript - you need to hand it a function. So, the full script like would look like this
printwindow.onload=function(){self.print();}
Now, putting it all together
try it
HOWEVER! This will not work for you for the URL "www.google.com". The browser security model prevents parent windows from accessing the window objects of child windows, UNLESS they both reside @ the same domain name.