Index: sandbox/2.5.1-expresso1/prototype/modules/mail/templates/attachment_search.ejs
===================================================================
--- sandbox/2.5.1-expresso1/prototype/modules/mail/templates/attachment_search.ejs	(revision 7895)
+++ sandbox/2.5.1-expresso1/prototype/modules/mail/templates/attachment_search.ejs	(revision 7895)
@@ -0,0 +1,6 @@
+<div class="attach-message-search-div" style="position: absolute;right: 0px;top: 50%;margin: -10px 0 0 0;padding: 1px;height: 18px;">
+	<fieldset class="attach-message-search-field ui-corner-all" style="border: 0;margin: -10px 0 0 0;padding: 1px;height: 18px;position: relative;top: 50%;">
+		<span class="ui-icon ui-icon-search" style="position: absolute;right: 6px;top: 10%;"></span>
+		<input class="attach-message-search-input" type="text" style="border-radius: 5px;border-right-color: white;border-right: 20px solid white;border-bottom: 1px solid white;border-top: 1px solid white;">
+	</fieldset>
+</div>
Index: sandbox/2.5.1-expresso1/prototype/modules/attach_message/attach_message.js
===================================================================
--- sandbox/2.5.1-expresso1/prototype/modules/attach_message/attach_message.js	(revision 7894)
+++ sandbox/2.5.1-expresso1/prototype/modules/attach_message/attach_message.js	(revision 7895)
@@ -465,4 +465,5 @@
 				  id: "0"
 			},
+			hidegrid:false,
 			rowNum:10,
 			rowList:[10,25,50],
@@ -659,4 +660,9 @@
 		});
 		//.jqGrid('navGrid','#message_attacher_grid_pager',{edit:false,add:false,del:false});
+
+		var search_messages = function(param){
+
+		}
+
 		var title = [get_lang("First page"), get_lang("Prev page"), get_lang("Next page"), get_lang("Last page")];
 		$("#first_message_attacher_grid_pager").attr("title",title[0]);
@@ -664,4 +670,11 @@
 		$("#next_message_attacher_grid_pager").attr("title",title[2]);
 		$("#last_message_attacher_grid_pager").attr("title",title[3]);
+		$("#mailgrid-container .ui-jqgrid-titlebar")
+		.append( DataLayer.render("../prototype/modules/mail/templates/attachment_search.ejs") ).find(".ui-jqgrid-titlebar-close").hide()
+		.end().find(".attach-message-search-input").Watermark("Pesquisa...").keydown(function(e){
+			if($.ui.keyCode.ENTER == e.keyCode){
+				search_messages($(this).val());
+			}
+		});
 	}
 });
Index: sandbox/2.5.1-expresso1/expressoMail1_2/js/draw_api.js
===================================================================
--- sandbox/2.5.1-expresso1/expressoMail1_2/js/draw_api.js	(revision 7800)
+++ sandbox/2.5.1-expresso1/expressoMail1_2/js/draw_api.js	(revision 7895)
@@ -5135,91 +5135,92 @@
             },
 			autoOpen:false
-	});
-	jQuery.getScript("../prototype/modules/attach_message/attach_message.js", function(){
-		jQuery('#message-attach-dialog').dialog('open');
-		jQuery('#message-attach-attach-btn').unbind('click');
-		jQuery('#message-attach-attach-btn').click(function(event){
-			jQuery.each(selectedMessages, function(folder_name, messages) {
-				jQuery.each(selectedMessages[folder_name], function(message_number, message) { 
-					if (message) {
-						fileUploadMSG.find(' .attachments-list').show();	
-						var att = new Object();
-						att.folder = folder_name;
-						att.uid = message_number;
-						att.type = 'imapMSG';
-						att.name = Base64.encode(onceOpenedMessages[folder_name][message_number].subject + '.eml');
-						var idATT = JSON.stringify(att);
-						addAttachment( ID , idATT);                        
-						var attach = {};
-						attach.fileName = onceOpenedMessages[folder_name][message_number].subject + '.eml';
-						attach.fullFileName = onceOpenedMessages[folder_name][message_number].subject + '.eml';
-						if(attach.fileName.length > 20)
-							attach.fileName = attach.fileName.substr(0, 17) + "... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
-
-						attach.error = false;
-                        attach.OK = true;
-						attach.fileSize = formatBytes(onceOpenedMessages[folder_name][message_number].size);
-						var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
-						$("#content_id_"+currentTab+" .save").button("enable");
-                        upload.find('.att-box-loading').remove();
-						upload.append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>');
-						
-						upload.find('.att-box-delete').click(function(){
-                            $("#content_id_"+currentTab+" .save").button("enable");
-							var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
-							fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove();
-							delAttachment(ID,idAttach); 
-							$(this).parent().qtip("destroy");
-							$(this).parent().remove();
-							if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){
-								fileUploadMSG.find(' .attachments-list').hide();
-							}
-						});	
-							
-						fileUploadMSG.find('.attachments-list').append(upload);
-
-						upload.find('.att-box-loading').remove();
-
-						fileUploadMSG.find('.attachments-list .att-box:last').qtip({
-		                	content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}),
-							position: {
-								corner: {
-									tooltip: 'bottomMiddle',
-									target: 'topMiddle'
-								},
-								adjust: {
-					               resize: true,
-					               scroll: true
-					            }
-							},
-							show: {
-								when: 'mouseover', // Don't specify a show event
-								ready: false // Show the tooltip when ready
-							},
-							hide: 'mouseout', // Don't specify a hide event
-							style: {
-								border: {
-									width: 1,
-									radius: 5
-								},
-								width: {
-									 min: 75,
-									 max : 1000
-								},
-								padding: 5, 
-								textAlign: 'center',
-								tip: true, // Give it a speech bubble tip with automatic corner detection
-								name: 'blue' // Style it according to the preset 'cream' style
-							}
-		                });
-					}
-				});
-			});
-			jQuery('#message-attach-dialog').dialog('close');
-		});
-		jQuery('#message-attach-cancel-btn').click(function(event){
-			jQuery('#message-attach-dialog').dialog('close');
-		});			
-	});
+	    });
+        
+    	jQuery.getScript("../prototype/modules/attach_message/attach_message.js", function(){
+    		jQuery('#message-attach-dialog').dialog('open');
+    		jQuery('#message-attach-attach-btn').unbind('click');
+    		jQuery('#message-attach-attach-btn').click(function(event){
+    			jQuery.each(selectedMessages, function(folder_name, messages) {
+    				jQuery.each(selectedMessages[folder_name], function(message_number, message) { 
+    					if (message) {
+    						fileUploadMSG.find(' .attachments-list').show();	
+    						var att = new Object();
+    						att.folder = folder_name;
+    						att.uid = message_number;
+    						att.type = 'imapMSG';
+    						att.name = Base64.encode(onceOpenedMessages[folder_name][message_number].subject + '.eml');
+    						var idATT = JSON.stringify(att);
+    						addAttachment( ID , idATT);                        
+    						var attach = {};
+    						attach.fileName = onceOpenedMessages[folder_name][message_number].subject + '.eml';
+    						attach.fullFileName = onceOpenedMessages[folder_name][message_number].subject + '.eml';
+    						if(attach.fileName.length > 20)
+    							attach.fileName = attach.fileName.substr(0, 17) + "... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
+
+    						attach.error = false;
+                            attach.OK = true;
+    						attach.fileSize = formatBytes(onceOpenedMessages[folder_name][message_number].size);
+    						var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
+    						$("#content_id_"+currentTab+" .save").button("enable");
+                            upload.find('.att-box-loading').remove();
+    						upload.append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>');
+    						
+    						upload.find('.att-box-delete').click(function(){
+                                $("#content_id_"+currentTab+" .save").button("enable");
+    							var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
+    							fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove();
+    							delAttachment(ID,idAttach); 
+    							$(this).parent().qtip("destroy");
+    							$(this).parent().remove();
+    							if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){
+    								fileUploadMSG.find(' .attachments-list').hide();
+    							}
+    						});	
+    							
+    						fileUploadMSG.find('.attachments-list').append(upload);
+
+    						upload.find('.att-box-loading').remove();
+
+    						fileUploadMSG.find('.attachments-list .att-box:last').qtip({
+    		                	content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}),
+    							position: {
+    								corner: {
+    									tooltip: 'bottomMiddle',
+    									target: 'topMiddle'
+    								},
+    								adjust: {
+    					               resize: true,
+    					               scroll: true
+    					            }
+    							},
+    							show: {
+    								when: 'mouseover', // Don't specify a show event
+    								ready: false // Show the tooltip when ready
+    							},
+    							hide: 'mouseout', // Don't specify a hide event
+    							style: {
+    								border: {
+    									width: 1,
+    									radius: 5
+    								},
+    								width: {
+    									 min: 75,
+    									 max : 1000
+    								},
+    								padding: 5, 
+    								textAlign: 'center',
+    								tip: true, // Give it a speech bubble tip with automatic corner detection
+    								name: 'blue' // Style it according to the preset 'cream' style
+    							}
+    		                });
+    					}
+    				});
+    			});
+    			jQuery('#message-attach-dialog').dialog('close');
+    		});
+    		jQuery('#message-attach-cancel-btn').click(function(event){
+    			jQuery('#message-attach-dialog').dialog('close');
+    		});			
+    	});
 	});
 	$(document).bind('drop dragover', function (e) {
