-formatMenuBar($aMailbox, $passed_id, $passed_ent_id, $message,false);
-formatEnvheader($aMailbox, $passed_id, $passed_ent_id, $message, $color, $FirstTimeSee);
-echo '<table width="100%" cellpadding="0" cellspacing="0" align="center" border="0">';
-echo ' <tr><td>';
-echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center" border="0" bgcolor="'.$color[9].'">';
-echo ' <tr><td>';
-echo ' <table width="100%" cellpadding="3" cellspacing="0" align="center" border="0">';
-echo ' <tr bgcolor="'.$color[4].'"><td>';
-// echo ' <table cellpadding="1" cellspacing="5" align="left" border="0">';
-echo html_tag( 'table' ,'' , 'left', '', 'width="100%" cellpadding="1" cellspacing="5" border="0"' );
-echo ' <tr>' . html_tag( 'td', '<br />'. $messagebody."\n", 'left')
- . '</tr>';
-echo ' </table>';
-echo ' </td></tr>';
-echo ' </table></td></tr>';
-echo ' </table>';
-echo ' </td></tr>';
-
-echo '<tr><td height="5" colspan="2" bgcolor="'.
- $color[4].'"></td></tr>'."\n";
-
-$attachmentsdisplay = formatAttachments($message,$ent_ar,$mailbox, $passed_id);
-if ($attachmentsdisplay) {
- echo ' </table>';
- echo ' <table width="100%" cellpadding="1" cellspacing="0" align="center"'.' border="0" bgcolor="'.$color[9].'">';
- echo ' <tr><td>';
- echo ' <table width="100%" cellpadding="0" cellspacing="0" align="center" border="0" bgcolor="'.$color[4].'">';
- echo ' <tr>' . html_tag( 'td', '', 'left', $color[9] );
- echo ' <b>' . _("Attachments") . ':</b>';
- echo ' </td></tr>';
- echo ' <tr><td>';
- echo ' <table width="100%" cellpadding="2" cellspacing="2" align="center"'.' border="0" bgcolor="'.$color[0].'"><tr><td>';
- echo $attachmentsdisplay;
- echo ' </td></tr></table>';
- echo ' </td></tr></table>';
- echo ' </td></tr>';
- echo '<tr><td height="5" colspan="2" bgcolor="'.
- $color[4].'"></td></tr>';
+
+/* this is the non-javascript version of printer friendly */
+if ( sqgetGlobalVar('print', $print, SQ_GET) ) {
+ $oTemplate->display('read_message_print.tpl');
+} else {
+ formatMenubar($aMailbox, $passed_id, $passed_ent_id, $message,false);