Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 14447)
+++ wp-includes/post.php	(working copy)
@@ -26,6 +26,7 @@
 		'hierarchical' => false,
 		'rewrite' => false,
 		'query_var' => false,
+		'attachment' => true,
 		'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions' ),
 	) );
 
@@ -40,6 +41,7 @@
 		'hierarchical' => true,
 		'rewrite' => false,
 		'query_var' => false,
+		'attachment' => true,
 		'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'page-attributes', 'custom-fields', 'comments', 'revisions' ),
 	) );
 
@@ -795,6 +797,7 @@
  * supports - An alias for calling add_post_type_support() directly. See add_post_type_support() for Documentation. Defaults to none.
  * register_meta_box_cb - Provide a callback function that will be called when setting up the meta boxes for the edit form.  Do remove_meta_box() and add_meta_box() calls in the callback.
  * taxonomies - An array of taxonomy identifiers that will be registered for the post type.  Default is no taxonomies. Taxonomies can be registered later with register_taxonomy() or register_taxonomy_for_object_type().
+ * attachment - Whether to add attachments to this post type. Defaults to false.
  *
  * @package WordPress
  * @subpackage Post
@@ -811,7 +814,7 @@
 		$wp_post_types = array();
 
 	// Args prefixed with an underscore are reserved for internal use.
-	$defaults = array('label' => false, 'singular_label' => false, 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 'permalink_epmask' => EP_PERMALINK, 'can_export' => true );
+	$defaults = array('label' => false, 'singular_label' => false, 'description' => '', 'publicly_queryable' => null, 'exclude_from_search' => null, '_builtin' => false, '_edit_link' => 'post.php?post=%d', 'capability_type' => 'post', 'hierarchical' => false, 'public' => false, 'rewrite' => true, 'query_var' => true, 'supports' => array(), 'register_meta_box_cb' => null, 'taxonomies' => array(), 'show_ui' => null, 'menu_position' => null, 'menu_icon' => null, 'permalink_epmask' => EP_PERMALINK, 'can_export' => true, 'attachment' => false );
 	$args = wp_parse_args($args, $defaults);
 	$args = (object) $args;
Index: wp-admin/admin-ajax.php
===================================================================
--- wp-admin/admin-ajax.php	(revision 14447)
+++ wp-admin/admin-ajax.php	(working copy)
@@ -1253,7 +1253,12 @@
 	if ( empty($_POST['ps']) )
 		exit;
 
-	$what = isset($_POST['pages']) ? 'page' : 'post';
+	if(!empty($_POST['post_type']) && in_array($_POST['post_type'], get_post_types(array('attachment' => true)))) {
+		$what = $_POST['post_type'];
+	} else {
+		$what = 'post';
+	}
+
 	$s = stripslashes($_POST['ps']);
 	preg_match_all('/".*?("|$)|((?<=[\\s",+])|^)[^\\s",+]+/', $s, $matches);
 	$search_terms = array_map('_search_terms_tidy', $matches[0]);
@@ -1271,7 +1276,7 @@
 	$posts = $wpdb->get_results( "SELECT ID, post_title, post_status, post_date FROM $wpdb->posts WHERE post_type = '$what' AND post_status IN ('draft', 'publish') AND ($search) ORDER BY post_date_gmt DESC LIMIT 50" );
 
 	if ( ! $posts )
-		exit( __('No posts found.') );
+		exit( __('No '. $what .' found.') );
 
 	$html = '<table class="widefat" cellspacing="0"><thead><tr><th class="found-radio"><br /></th><th>'.__('Title').'</th><th>'.__('Date').'</th><th>'.__('Status').'</th></tr></thead><tbody>';
 	foreach ( $posts as $post ) {
Index: wp-admin/includes/template.php
===================================================================
--- wp-admin/includes/template.php	(revision 14447)
+++ wp-admin/includes/template.php	(working copy)
@@ -3284,10 +3284,16 @@
 				<input type="text" id="find-posts-input" name="ps" value="" />
 				<input type="button" onclick="findPosts.send();" value="<?php esc_attr_e( 'Search' ); ?>" class="button" /><br />
 
-				<input type="radio" name="find-posts-what" id="find-posts-posts" checked="checked" value="posts" />
-				<label for="find-posts-posts"><?php _e( 'Posts' ); ?></label>
-				<input type="radio" name="find-posts-what" id="find-posts-pages" value="pages" />
-				<label for="find-posts-pages"><?php _e( 'Pages' ); ?></label>
+				<?php
+				$selected = 'checked="checked" ';
+				$post_types = get_post_types(array('attachment' => true), 'objects');
+				foreach ($post_types AS $post) {
+				?>
+				<input type="radio" name="find-posts-what" id="find-posts-<?php echo $post->name; ?>" value="<?php echo $post->name; ?>" <?php echo $selected?>/>
+				<label for="find-posts-<?php echo $post->name; ?>"><?php echo $post->label; ?></label>
+				<?php
+					$selected = '';
+				} ?>
 			</div>
 			<div id="find-posts-response"></div>
 		</div>
Index: wp-admin/js/media.dev.js
===================================================================
--- wp-admin/js/media.dev.js	(revision 14447)
+++ wp-admin/js/media.dev.js	(working copy)
@@ -31,11 +31,10 @@
 				_ajax_nonce: $('#_ajax_nonce').val()
 			};
 
-			if ( $('#find-posts-pages').is(':checked') ) {
-				post['pages'] = 1;
-			} else {
-				post['posts'] = 1;
-			}
+			var selectedItem;
+			$("input[@name='itemSelect[]']:checked").each(function() { selectedItem = $(this).val() });
+			post['post_type'] = selectedItem;
+
 			$.ajax({
 				type : 'POST',
 				url : ajaxurl,