Index: /trunk/expressoMail1_2/js/search.js
===================================================================
--- /trunk/expressoMail1_2/js/search.js	(revision 5867)
+++ /trunk/expressoMail1_2/js/search.js	(revision 5882)
@@ -541,17 +541,12 @@
 				$(td).click(function(event, ui){	
 					var messageClickedId = $(this).attr('id').match(/td_message_followup_search_([\d]+)/)[1];
-					if(current_folder == mailbox){
-						$('#td_message_followup_' + messageClickedId + ', ' + 
-						'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-						.html('<img alt="Carregando" title="Carregando" style="margin-left:-3px; margin-top:-4px; width:13px; height:13px;" src="../prototype/modules/mail/img/ajax-loader.gif" />');
+					
+					var followupColor = $('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css('backgroundColor');
+					
+					$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+					.html('<img alt="Carregando" title="Carregando" style="margin-left:-3px; margin-top:-4px; width:13px; height:13px;" src="../prototype/modules/mail/img/ajax-loader.gif" />');	
 						
-						$('#td_message_followup_' + messageClickedId + ', ' + 
-						'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "transparent");
-					}else{
-						$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-						.html('<img alt="Carregando" title="Carregando" style="margin-left:-3px; margin-top:-4px; width:13px; height:13px;" src="../prototype/modules/mail/img/ajax-loader.gif" />');	
-						
-						$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "transparent");
-					}		
+					$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "transparent");
+		
 					/**TODO Alterar após melhorias no filtro da camada javascript*/
 					DataLayer.remove('followupflagged', false);
@@ -578,15 +573,11 @@
 						aux.followupflagged.id = DataLayer.put('followupflagged', aux.followupflagged);
 						DataLayer.commit(false, false, function(){
+							$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+							.html('<img src="../prototype/modules/mail/img/flagEditor.png">');
+							
 							if(current_folder == mailbox){
 								$('#td_message_followup_' + messageClickedId + ', ' + 
-								'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-								.html('<img src="../prototype/modules/mail/img/flagEditor.png">');
-								
-								$('#td_message_followup_' + messageClickedId + ', ' + 
 								'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", aux.followupflagged.backgroundColor).attr('title', get_lang('Follow up'));	
-							}else{
-								$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-								.html('<img src="../prototype/modules/mail/img/flagEditor.png">');
-								
+							}else{								
 								$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", aux.followupflagged.backgroundColor).attr('title', get_lang('Follow up'));		
 							}	
@@ -607,10 +598,9 @@
 						DataLayer.remove('followupflagged', flagged[0].id );
 						DataLayer.commit(false, false, function(){
+							$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+							.html('<img src="../prototype/modules/mail/img/flagEditor.png">');
 							if(current_folder == mailbox){
 								updateCacheFollowupflag(messageClickedId, mailbox, false);
-								$('#td_message_followup_' + messageClickedId + ', ' + 
-								'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-								.html('<img src="../prototype/modules/mail/img/flagEditor.png">');
-								
+							
 								$('#td_message_followup_' + messageClickedId + ', ' + 
 								  'tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", '#CCC').attr('title', '');;
@@ -621,6 +611,4 @@
 							}else{
 								updateCacheFollowupflag(messageClickedId, mailbox, false);
-								$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
-								.html('<img src="../prototype/modules/mail/img/flagEditor.png">');
 								
 								$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", '#CCC').attr('title', '');;
@@ -632,4 +620,7 @@
 
 					} else {
+						$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+						.html('<img src="../prototype/modules/mail/img/flagEditor.png">');
+						$('tr[role="'+messageClickedId+'_'+mailbox+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", followupColor);
 						$(this).parents('[role="'+messageClickedId+'_'+mailbox+'"]').attr('class', 'selected_msg').find(':checkbox').trigger('click');
 						configureFollowupflag();
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 5867)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 5882)
@@ -1655,4 +1655,6 @@
 			var messageClickedId = $(this).attr('id').match(/td_message_followup_([\d]+)/)[1];
 			
+			var followupColor = $('#td_message_followup_' + messageClickedId).find(".flag-edited").css('backgroundColor');
+			
 			$('#td_message_followup_' + messageClickedId + ', ' + 
 			'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
@@ -1661,4 +1663,6 @@
 			$('#td_message_followup_' + messageClickedId + ', ' + 
 			'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", "transparent");
+			
+
 			/**
 				* Hack:
@@ -1722,4 +1726,9 @@
 
 			} else {
+				$('#td_message_followup_' + messageClickedId + ', ' + 
+				'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited")
+				.html('<img src="../prototype/modules/mail/img/flagEditor.png">');
+				$('#td_message_followup_' + messageClickedId + ', ' + 
+				'tr[role="'+messageClickedId+'_'+msg_folder+'"] #td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", followupColor);
 				$(tr_element).addClass('selected_msg').find(':checkbox').trigger('click');
 				configureFollowupflag();
