Index: /sandbox/2.4.2-expresso2/expressoMail1_2/js/main.js
===================================================================
--- /sandbox/2.4.2-expresso2/expressoMail1_2/js/main.js	(revision 6822)
+++ /sandbox/2.4.2-expresso2/expressoMail1_2/js/main.js	(revision 6841)
@@ -672,14 +672,18 @@
 						},
 						helper: function(event){
-								if($(this).find("input:checkbox").attr("checked") != "checked"){
-									$(this).find("input:checkbox").trigger('click');
-									$(this).addClass("selected_msg");
-								}
-								if($("#table_box").find("tr input:checked").length > 1)
-									return $("<tr><td>"+DataLayer.render('../prototype/modules/mail/templates/draggin_box.ejs', {texto : (($("#table_box").find("tr input:checked")).length+" mensagens selecionadas"), type: "messages"})+"</td></tr>");
-								if(	$(this).find(".td_msg_subject").text().length > 18 )
-									return $("<tr><td>"+DataLayer.render('../prototype/modules/mail/templates/draggin_box.ejs', {texto : $(this).find(".td_msg_subject").text().substring(0,18) + "...", type: "messages"})+"</td></tr>");
-								else
-									return $("<tr><td>"+DataLayer.render('../prototype/modules/mail/templates/draggin_box.ejs', {texto : $(this).find(".td_msg_subject").text(), type: "messages"})+"</td></tr>");
+							$(this).addClass("selected_msg").find("input:checkbox").attr("checked", true);
+							updateSelectedMsgs($(this).find("input:checkbox").is(':checked'),$(this).attr("id"));
+							if ( $("#tbody_box .selected_shortcut_msg").length > 1) {
+								$("#tbody_box .selected_shortcut_msg").addClass("selected_msg").find('.checkbox').attr('checked',true);
+								$.each( $(".selected_shortcut_msg"), function(index, value){
+					            	updateSelectedMsgs($(value).find(":checkbox").is(':checked'),$(value).attr("id"));
+						        });
+							}
+							if($("#table_box").find("tr input:checked").length > 1)
+								return $("<tr><td>"+DataLayer.render('../prototype/modules/mail/templates/draggin_box.ejs', {texto : (totalSelected()+" mensagens selecionadas"), type: "messages"})+"</td></tr>");
+							if(	$(this).find(".td_msg_subject").text().length > 18 )
+								return $("<tr><td>"+DataLayer.render('../prototype/modules/mail/templates/draggin_box.ejs', {texto : $(this).find(".td_msg_subject").text().substring(0,18) + "...", type: "messages"})+"</td></tr>");
+							else
+								return $("<tr><td>"+DataLayer.render('../prototype/modules/mail/templates/draggin_box.ejs', {texto : $(this).find(".td_msg_subject").text(), type: "messages"})+"</td></tr>");
 						},
 						iframeFix: true,
@@ -689,7 +693,10 @@
 						containment: "#divAppbox"
 					}).bind("contextmenu", function(){
-						if($(this).find("input:checkbox").attr("checked") != "checked"){
-							$(this).find("input:checkbox").trigger('click');
-							$(this).addClass("selected_msg");
+						if (!(($(event.target).find('img').length > 0) && ($(event.target).hasClass('td-label')))){
+							if($(this).find("input:checkbox").attr("checked") != "checked"){
+								$(this).find("input:checkbox").trigger('click');
+								$(this).addClass("selected_msg");
+							}
+							updateSelectedMsgs($(this).find("input:checkbox").is(':checked'),$(this).attr("id"));
 						}
 					});
@@ -814,12 +821,7 @@
  		         
  		        if (!archive && (parseInt(preferences.save_deleted_msg)) && (folder != userTrashFolder)){ 
-                    var msgs = new Array();
-                    var i = 0;
-                    $.each(selectedMessages, function(index, value){
-                        if(value)
-                            msgs[i++] = index;
-                    });
-                    msgs_number = msgs.join();
- 		            move_msgs2(folder, msgs_number, border_ID, userTrashFolder,special_folders['Trash'],show_success_msg ); 
+                    if(currentTab == 0)
+						msgs_number = get_selected_messages();
+ 		            move_msgs2(folder, ""+msgs_number, border_ID, userTrashFolder,special_folders['Trash'],show_success_msg ); 
 				return;
 	}
@@ -892,6 +894,6 @@
 	}
 
-	if (msgs_number == 'selected')
-		msgs_number = get_selected_messages();
+	msgs_number = get_selected_messages();
+
 	if (msgs_number.length > 0 || parseInt(msgs_number) > 0)
 		cExecute ("$this.imap_functions.delete_msgs&folder="+folder+"&msgs_number="+msgs_number+"&border_ID="+border_ID+"&sort_box_type="+sort_box_type+"&search_box_type="+search_box_type+"&sort_box_reverse="+sort_box_reverse, handler_delete_msgs);
@@ -1056,6 +1058,6 @@
 			params += "&new_folder="+url_encode(new_folder);
 			params += "&new_folder_name="+url_encode(new_folder_name);
-		cExecute ("$this.imap_functions.move_search_messages", handler_move_search_msgs, params);
-	}
+			cExecute ("$this.imap_functions.move_search_messages", handler_move_search_msgs, params);
+		}
 	}
 	else
@@ -1228,7 +1230,6 @@
 	} catch (e) {} 
 
-	if (msgs_number == 'selected'){
+	if(currentTab == 0)
 		msgs_number = get_selected_messages();
-		}
 
 	if(openTab.type[currentTab] == 1){
@@ -1252,5 +1253,5 @@
 				url: 'controller.php?' + $.param( {action: '$this.imap_functions.move_messages',
 								    folder: folder,
-								    msgs_number: msgs_number,
+								    msgs_number: ""+msgs_number,
 								    border_ID: border_ID,
 								    sort_box_type: sort_box_type,
@@ -1265,5 +1266,13 @@
 				success: function( data ){
 				    data = connector.unserialize( data );
-				    
+				    $.each(msgs_number, function(index, value){
+				    	delete selectedPagingMsgs[value];
+				    });
+				    totalFolderMsgs -= totalSelected();
+
+				    //TESTE
+				    selectAllFolderMsgs();
+           			$('.select-link').unbind('click');
+
 				    if( data )
 					handler_move_msgs( data );
@@ -1613,5 +1622,5 @@
 }
 
-function get_selected_messages(){
+/*function get_selected_messages(){
 	var main;
 	try{
@@ -1657,9 +1666,9 @@
 
  		         
- 		        /* Verifica se está na tela de pesquisa. */ 
+ 		        /* Verifica se está na tela de pesquisa. */ /*
  		        if(selected_messages.indexOf("_") != -1) 
  		        { 
  		                results_search_messages = selected_messages; 
- 		                /* Retira a informação da aba */ 
+ 		                /* Retira a informação da aba */ /*
  		                selected_messages = selected_messages.substring(0,selected_messages.indexOf("_"));
 	}
@@ -1677,5 +1686,5 @@
 			return selected_messages_by_shortcuts;
 		}*/
-		/*Se houver mais de uma mensagem selecionada por atalho*/
+		/*Se houver mais de uma mensagem selecionada por atalho*//*
 		if (array_selected_messages_by_shortcuts.length > 1){
 			if (selected_messages == "")
@@ -1689,4 +1698,12 @@
 	else
 		return selected_messages;
+}*/
+function get_selected_messages(){
+	var selected = new Array();
+	$.each(selectedPagingMsgs, function(index, value){
+		if(value)
+			selected.push(index);
+	});
+	return ""+selected;
 }
 
@@ -3160,5 +3177,8 @@
 			  success: function( data ){
 			      data = connector.unserialize( data );
-			      
+
+			      selectAllFolderMsgs();
+			      $('.select-link').unbind('click');
+
 			      if( data )
 				  handler_set_messages_flag( data );
@@ -3675,4 +3695,8 @@
 		msgs_number = get_selected_messages();
 
+	//TODO: REFATORAR O CÓDIGO PARA EVITAR recodificação
+	if(currentTab == 0)
+		msgs_number = get_selected_messages();
+
 	if (parseInt(msgs_number) > 0 || msgs_number.length > 0)
 		cExecute ("$this.imap_functions.spam&folder="+folder+"&spam=false"+"&msgs_number="+msgs_number+"&border_ID="+border_ID+"&sort_box_type="+sort_box_type+"&sort_box_reverse="+sort_box_reverse+"&reuse_border="+border_ID+"&new_folder="+new_folder+"&new_folder_name="+new_folder_name+"&get_previous_msg="+0+"&cyrus_delimiter="+cyrus_delimiter, handler_move_msgs);
@@ -3712,4 +3736,8 @@
 		return;
 	}else if(msgs_number == 'selected')
+		msgs_number = get_selected_messages();
+
+	//TODO: REFATORAR O CÓDIGO PARA EVITAR recodificação
+	if(currentTab == 0)
 		msgs_number = get_selected_messages();
 
Index: /sandbox/2.4.2-expresso2/expressoMail1_2/js/shortcut.js
===================================================================
--- /sandbox/2.4.2-expresso2/expressoMail1_2/js/shortcut.js	(revision 6823)
+++ /sandbox/2.4.2-expresso2/expressoMail1_2/js/shortcut.js	(revision 6841)
@@ -273,5 +273,5 @@
         delete_border(get_msg_id(), 'false');
 },{'disable_in_input':false});
-/*
+
 shortcut.add("I",function(){print_all();},{'disable_in_input':true});
 shortcut.add("E",function(e){ if(e.preventDefault) e.preventDefault(); else event.returnValue = false; exec_msg_action('forward');},{'disable_in_input':true});
@@ -280,5 +280,5 @@
 shortcut.add("O",function(e){ if(e.preventDefault) e.preventDefault(); else event.returnValue = false; show_head_option();},{'disable_in_input':true});
 shortcut.add("M",function(e){ if(e.preventDefault) e.preventDefault(); else event.returnValue = false; show_address_full();},{'disable_in_input':true});
-*/
+
 shortcut.add("Delete",function(){
 
@@ -319,6 +319,6 @@
 ,{'disable_in_input':true});
 
-//shortcut.add("Ctrl+Up",function(){exec_msg_action('previous');/*select_msg('null', 'up');*/},{'disable_in_input':true});
-//shortcut.add("Ctrl+Down",function(){exec_msg_action('next');/*select_msg('null', 'down');*/},{'disable_in_input':true});
+shortcut.add("Ctrl+Up",function(){exec_msg_action('previous');/*select_msg('null', 'up');*/},{'disable_in_input':true});
+shortcut.add("Ctrl+Down",function(){exec_msg_action('next');/*select_msg('null', 'down');*/},{'disable_in_input':true});
 
 if (is_ie || is_webkit)
Index: /sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js
===================================================================
--- /sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js	(revision 6837)
+++ /sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js	(revision 6841)
@@ -523,4 +523,5 @@
 		var handler_draw_box = function(data)
 		{
+
 			if(!verify_session(data))
 				return;
@@ -1496,10 +1497,15 @@
 				//helper: 'clone',
  				helper: function(event){
-					$(this).find("input:checkbox").attr("checked", true);
+					$(this).addClass("selected_msg").find("input:checkbox").attr("checked", true);
+					updateSelectedMsgs($(this).find("input:checkbox").is(':checked'),$(this).attr("id"));
 					if ( $("#tbody_box .selected_shortcut_msg").length > 1) {
-						$("#tbody_box .selected_shortcut_msg").find('.checkbox').attr('checked',true);
+						$("#tbody_box .selected_shortcut_msg").addClass("selected_msg").find('.checkbox').attr('checked',true);
+						$.each( $(".selected_shortcut_msg"), function(index, value){
+			            	updateSelectedMsgs($(value).find(":checkbox").is(':checked'),$(value).attr("id"));
+				        });
 					}
+					
 					if($("#table_box").find("tr input:checked").length > 1 )
-						return $("<tr><td>"+DataLayer.render('../prototype/modules/mail/templates/draggin_box.ejs', {texto : (($("#table_box").find("tr input:checked")).length+" mensagens selecionadas"), type: "messages"})+"</td></tr>");				
+						return $("<tr><td>"+DataLayer.render('../prototype/modules/mail/templates/draggin_box.ejs', {texto : (totalSelected()+" mensagens selecionadas"), type: "messages"})+"</td></tr>");				
 					if(	$(this).find(".td_msg_subject").text().length > 18 )
 						return $("<tr><td>"+DataLayer.render('../prototype/modules/mail/templates/draggin_box.ejs', {texto : $(this).find(".td_msg_subject").text().substring(0,18) + "...", type: "messages"})+"</td></tr>");
@@ -1513,10 +1519,11 @@
 				containment: "#divAppbox"
 			}).bind('contextmenu',function(event){
-					if (!(($(event.target).find('img').length > 0) && ($(event.target).hasClass('td-label')))){
-						if($(this).find("input:checkbox").attr("checked") != "checked"){
-							$(this).find("input:checkbox").trigger('click');
-							$(this).addClass("selected_msg");
-						}
+				if (!(($(event.target).find('img').length > 0) && ($(event.target).hasClass('td-label')))){
+					if($(this).find("input:checkbox").attr("checked") != "checked"){
+						$(this).find("input:checkbox").trigger('click');
+						$(this).addClass("selected_msg");
 					}
+					updateSelectedMsgs($(this).find("input:checkbox").is(':checked'),$(this).attr("id"));
+				}
 			});
 	}
