Index: sandbox/2.4.2-expresso2/expressoMail1_2/js/common_functions.js
===================================================================
--- sandbox/2.4.2-expresso2/expressoMail1_2/js/common_functions.js	(revision 6778)
+++ sandbox/2.4.2-expresso2/expressoMail1_2/js/common_functions.js	(revision 6787)
@@ -1120,11 +1120,4 @@
 	var main_list = main.childNodes;
 	var len_main_list = main_list.length;
-	var totalSelected = function(){
-		var total = 0;
-		for(var obj in selectedPagingMsgs)
-			if (selectedPagingMsgs[obj] == true)
-				total++;
-		return total;
-	};
 	var folder = get_current_folder().split(cyrus_delimiter);
 	folder = folder.indexOf('INBOX') != -1 ? get_lang(folder[folder.length - 1]) : folder ;
Index: sandbox/2.4.2-expresso2/expressoMail1_2/js/messages_controller.js
===================================================================
--- sandbox/2.4.2-expresso2/expressoMail1_2/js/messages_controller.js	(revision 6778)
+++ sandbox/2.4.2-expresso2/expressoMail1_2/js/messages_controller.js	(revision 6787)
@@ -39,35 +39,4 @@
 				    if( data )
 						call_back( data );
-						
-					$.ajax({			
-						url: "controller.php?" + $.param( {action: "$this.imap_functions.get_range_msgs3", 
-							folder: folder,
-							 msg_range_begin: "0",
-							 msg_range_end: "0", 					
-							sort_box_type: "SORTARRIVAL", 
-							search_box_type: "ALL",
-							sort_box_reverse: "1"
-							}),
-						success: function(data){
-							data = connector.unserialize(data);
-							if(data){
-								var _data = {};
-								$.each(data,function(index,value){
-									if (data[index] && data[index].msg_number){
-										_data[data[index].msg_number] = data[index].msg_number;
-									}
-								});
-								populateSelectedMsgs(_data);
-								_data = {};
-							
-							}
-						},
-						beforeSend: function( jqXHR, settings ){
-							connector.showProgressBar();
-						},
-						complete: function( jqXHR, settings ){
-							connector.hideProgressBar();
-						}
-					});
 			      },
 				  beforeSend: function( jqXHR, settings ){
Index: sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js
===================================================================
--- sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js	(revision 6778)
+++ sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js	(revision 6787)
@@ -533,4 +533,34 @@
 			return true;
 		}
+		$.ajax({			
+			url: "controller.php?" + $.param( {action: "$this.imap_functions.get_range_msgs3", 
+				folder: folder,
+				 msg_range_begin: "0",
+				 msg_range_end: "0", 					
+				sort_box_type: "SORTARRIVAL", 
+				search_box_type: "ALL",
+				sort_box_reverse: "1"
+				}),
+			success: function(data){
+				data = connector.unserialize(data);
+				if(data){
+					var _data = {};
+					$.each(data,function(index,value){
+						if (data[index] && data[index].msg_number){
+							_data[data[index].msg_number] = data[index].msg_number;
+						}
+					});
+					populateSelectedMsgs(_data);
+					_data = {};
+				
+				}
+			},
+			beforeSend: function( jqXHR, settings ){
+				connector.showProgressBar();
+			},
+			complete: function( jqXHR, settings ){
+				connector.hideProgressBar();
+			}
+		});
 		proxy_mensagens.messages_list(current_folder,1,preferences.max_email_per_page,sort_box_type,search_box_type,sort_box_reverse,preferences.preview_msg_subject,preferences.preview_msg_tip,handler_draw_box);
 		var  handler_populateSelectedMsgs = function(data){
@@ -1044,4 +1074,12 @@
 }
 
+function totalSelected(){
+	var total = 0;
+	for(var obj in selectedPagingMsgs)
+		if (selectedPagingMsgs[obj] == true)
+			total++;
+	return total;
+};
+
 /*Atualiza o array de mensagens selecionadas*/
 function updateSelectedMsgs(selected,msg_number){	
@@ -1049,11 +1087,4 @@
 	folder = folder.indexOf('INBOX') != -1 ? get_lang(folder[folder.length - 1]) : folder ;
 	var div = $('.select-all-messages');
-	var totalSelected = function(){
-		var total = 0;
-		for(var obj in selectedPagingMsgs)
-			if (selectedPagingMsgs[obj] == true)
-				total++;
-		return total;
-	};
 	/*Seleciona as mensagens ao navegar pelas páginas*/
 	if (allMsgsSelected && msg_number == undefined){
@@ -4878,4 +4909,5 @@
 		add_className(all_messages[begin], 'selected_msg');
 		Element(_tab_prefix + "check_box_message_" + _msg_id).checked = true;
+		updateSelectedMsgs(true,_msg_id);
 	}
 }
