On a lot of pages you see a Print link, which then opens the print window. This can be achieved very easy:
If you put the print() command into the onload event of the body tag, the print command will fire automatically. This is handy if you want to format your page differently for print than for the browser.
I’ve built a little live example here.