--- compose.php.orig	2008-07-08 05:15:23.000000000 -0700
+++ compose.php	2008-07-08 05:24:00.000000000 -0700
@@ -1120,58 +1120,6 @@
         showComposeButtonRow();
     }
 
-    /* why this distinction? */
-    if ($compose_new_win == '1') {
-        echo '   <tr>' . "\n" .
-            '      <td bgcolor="' . $color[0] . '" colspan="2" align="center">' . "\n" .
-            '         <textarea name="body" id="body" rows="' . (int)$editor_height .
-            '" cols="' . (int)$editor_size . '" wrap="virtual"' . $onfocus . '>';
-    }
-    else {
-        echo '   <tr>' . "\n" .
-            '      <td bgcolor="' . $color[4] . '" colspan="2">' . "\n" .
-            '         &nbsp;&nbsp;<textarea name="body" id="body" rows="' . (int)$editor_height .
-            '" cols="' . (int)$editor_size . '" wrap="virtual"' . $onfocus . '>';
-    }
-
-    if ($use_signature == true && $newmail == true && !isset($from_htmladdr_search)) {
-        $signature = $idents[$identity]['signature'];
-
-        if ($sig_first == '1') {
-            if ($default_charset == 'iso-2022-jp') {
-                echo "\n\n".($prefix_sig==true? "-- \n":'').mb_convert_encoding($signature, 'EUC-JP');
-            } else {
-                echo "\n\n".($prefix_sig==true? "-- \n":'').decodeHeader($signature,false,false,true);
-            }
-            echo "\n\n".htmlspecialchars(decodeHeader($body,false,false,true));
-        }
-        else {
-            echo "\n\n".htmlspecialchars(decodeHeader($body,false,false,true));
-            if ($default_charset == 'iso-2022-jp') {
-                echo "\n\n".($prefix_sig==true? "-- \n":'').mb_convert_encoding($signature, 'EUC-JP');
-            }else{
-                echo "\n\n".($prefix_sig==true? "-- \n":'').decodeHeader($signature,false,false,true);
-            }
-        }
-    } else {
-        echo htmlspecialchars(decodeHeader($body,false,false,true));
-    }
-    echo '</textarea><br />' . "\n" .
-        '      </td>' . "\n" .
-        '   </tr>' . "\n";
-
-
-    if ($location_of_buttons == 'bottom') {
-        showComposeButtonRow();
-    } else {
-        echo '   <tr>' . "\n" .
-            html_tag( 'td', '', 'right', '', 'colspan="2"' ) . "\n" .
-            '         ' . addSubmit(_("Send"), 'send').
-            '         &nbsp;&nbsp;&nbsp;&nbsp;<br /><br />' . "\n" .
-            '      </td>' . "\n" .
-            '   </tr>' . "\n";
-    }
-
     // composeMessage can be empty when coming from a restored session
     if (is_object($composeMessage) && $composeMessage->entities) 
         $attach_array = $composeMessage->entities;
@@ -1258,6 +1206,59 @@
             '   </tr>' . "\n";
     } // End of file_uploads if-block
     /* End of attachment code */
+
+    /* why this distinction? */
+    if ($compose_new_win == '1') {
+        echo '   <tr>' . "\n" .
+            '      <td bgcolor="' . $color[0] . '" colspan="2" align="center">' . "\n" .
+            '         <textarea name="body" id="body" rows="' . (int)$editor_height .
+            '" cols="' . (int)$editor_size . '" wrap="virtual"' . $onfocus . '>';
+    }
+    else {
+        echo '   <tr>' . "\n" .
+            '      <td bgcolor="' . $color[4] . '" colspan="2">' . "\n" .
+            '         &nbsp;&nbsp;<textarea name="body" id="body" rows="' . (int)$editor_height .
+            '" cols="' . (int)$editor_size . '" wrap="virtual"' . $onfocus . '>';
+    }
+
+    if ($use_signature == true && $newmail == true && !isset($from_htmladdr_search)) {
+        $signature = $idents[$identity]['signature'];
+
+        if ($sig_first == '1') {
+            if ($default_charset == 'iso-2022-jp') {
+                echo "\n\n".($prefix_sig==true? "-- \n":'').mb_convert_encoding($signature, 'EUC-JP');
+            } else {
+                echo "\n\n".($prefix_sig==true? "-- \n":'').decodeHeader($signature,false,false,true);
+            }
+            echo "\n\n".htmlspecialchars(decodeHeader($body,false,false,true));
+        }
+        else {
+            echo "\n\n".htmlspecialchars(decodeHeader($body,false,false,true));
+            if ($default_charset == 'iso-2022-jp') {
+                echo "\n\n".($prefix_sig==true? "-- \n":'').mb_convert_encoding($signature, 'EUC-JP');
+            }else{
+                echo "\n\n".($prefix_sig==true? "-- \n":'').decodeHeader($signature,false,false,true);
+            }
+        }
+    } else {
+        echo htmlspecialchars(decodeHeader($body,false,false,true));
+    }
+    echo '</textarea><br />' . "\n" .
+        '      </td>' . "\n" .
+        '   </tr>' . "\n";
+
+
+    if ($location_of_buttons == 'bottom') {
+        showComposeButtonRow();
+    } else {
+        echo '   <tr>' . "\n" .
+            html_tag( 'td', '', 'right', '', 'colspan="2"' ) . "\n" .
+            '         ' . addSubmit(_("Send"), 'send').
+            '         &nbsp;&nbsp;&nbsp;&nbsp;<br /><br />' . "\n" .
+            '      </td>' . "\n" .
+            '   </tr>' . "\n";
+    }
+
     echo '</table>' . "\n" .
         addHidden('username', $username).
         addHidden('smaction', $action).
