How do I make a function that can print a specific frame, or a specific layer, or the complete page???

I perfer to do it in javascript.

If this is possible, can the print be done without any dialog from the OS???

/Smirre