Index: wp-admin/includes/ajax-actions.php
===================================================================
--- wp-admin/includes/ajax-actions.php	(revision 21247)
+++ wp-admin/includes/ajax-actions.php	(working copy)
@@ -475,9 +475,11 @@
 }
 
 function wp_ajax_trash_post( $action ) {
-	if ( empty( $action ) )
+	$id = isset( $_POST['id'] ) ? (int)$_POST['id'] : 0;
+	if ( empty( $action ) && 'attachment' == get_post_type( $id ) )
+		$action = 'trash-attachment';
+	elseif ( empty( $action ) )
 		$action = 'trash-post';
-	$id = isset( $_POST['id'] ) ? (int) $_POST['id'] : 0;
 
 	check_ajax_referer( "{$action}_$id" );
 	if ( !current_user_can( 'delete_post', $id ) )
@@ -486,7 +488,7 @@
 	if ( !get_post( $id ) )
 		wp_die( 1 );
 
-	if ( 'trash-post' == $action )
+	if ( 'trash-post' == $action || 'trash-attachment' == $action )
 		$done = wp_trash_post( $id );
 	else
 		$done = wp_untrash_post( $id );
Index: wp-admin/includes/media.php
===================================================================
--- wp-admin/includes/media.php	(revision 21247)
+++ wp-admin/includes/media.php	(working copy)
@@ -1159,9 +1159,7 @@
 	if ( $send )
 		$send = get_submit_button( __( 'Insert into Post' ), 'button', "send[$attachment_id]", false );
 	if ( $delete && current_user_can( 'delete_post', $attachment_id ) ) {
-		if ( !EMPTY_TRASH_DAYS ) {
-			$delete = "<a href='" . wp_nonce_url( "post.php?action=delete&amp;post=$attachment_id", 'delete-attachment_' . $attachment_id ) . "' id='del[$attachment_id]' class='delete'>" . __( 'Delete Permanently' ) . '</a>';
-		} elseif ( !MEDIA_TRASH ) {
+		if ( !MEDIA_TRASH ) {
 			$delete = "<a href='#' class='del-link' onclick=\"document.getElementById('del_attachment_$attachment_id').style.display='block';return false;\">" . __( 'Delete' ) . "</a>
 			 <div id='del_attachment_$attachment_id' class='del-attachment' style='display:none;'><p>" . sprintf( __( 'You are about to delete <strong>%s</strong>.' ), $filename ) . "</p>
 			 <a href='" . wp_nonce_url( "post.php?action=delete&amp;post=$attachment_id", 'delete-attachment_' . $attachment_id ) . "' id='del[$attachment_id]' class='button'>" . __( 'Continue' ) . "</a>
