--- print.pages.inc	Wed Dec 30 14:34:07 2009
+++ print.pages.inc	Tue Jan 26 16:09:01 2010
@@ -223,7 +223,7 @@
   }
 
   $window_close = ($print_html_new_window && $print_html_windowclose) ? 'window.close();' : '';
-  $print['sendtoprinter'] = $print_html_sendtoprinter ? " onload='window.print();$window_close'" : '';
+  $print['sendtoprinter'] = $print_html_sendtoprinter ? "window.print();\r\n$window_close" : '';
 
   switch ($print_logo_options) {
     case 0: // none
--- print.tpl.php	Wed Dec 30 14:34:07 2009
+++ print.tpl.php	Tue Jan 26 16:13:15 2010
@@ -14,12 +14,19 @@
     <?php print $print['head']; ?>
     <title><?php print $print['title']; ?></title>
     <?php print $print['scripts']; ?>
+    <?php if ($print['sendtoprinter']) : ?>
+    <script type="text/javascript">
+    Drupal.behaviors.print = function(context) {
+      <?php print $print['sendtoprinter']; ?>
+    }
+    </script>
+    <?php endif; ?>
     <?php print $print['robots_meta']; ?>
     <?php print $print['base_href']; ?>
     <?php print $print['favicon']; ?>
     <?php print $print['css']; ?>
   </head>
-  <body<?php print $print['sendtoprinter']; ?>>
+  <body>
     <?php if (!empty($print['message'])) {
       print '<div class="print-message">'. $print['message'] .'</div><p />';
     } ?>
