Index: /trunk/prototype/modules/mail/js/label.js
===================================================================
--- /trunk/prototype/modules/mail/js/label.js	(revision 5563)
+++ /trunk/prototype/modules/mail/js/label.js	(revision 5564)
@@ -16,4 +16,6 @@
 	winElement.find(".preview-label-inner").text($(this).text());
 }
+
+
 function editLabel(){	
 	var conteudoSpan = $(this).parent().find(".text-list").text();
@@ -29,6 +31,5 @@
 			$(span).html($(".label-list").find(".edit-value-list").val())
 			.parent().find('.edit').removeClass("hidden").parents("li").click(configureLabel).trigger("click");
-			winElement.find(".buttons .save-label").click(save_editLabel());	
-			winElement.find(".buttons .save-label").trigger("click");
+			save_editLabel();
 			
 		}else if( event.keyCode == 27){
@@ -46,4 +47,34 @@
 	event.stopImmediatePropagation();
 }
+
+function colors_suggestions(){
+	return [
+				{name:'Padrão', border:'#3366cc', font:'#ffffff', background:'#3366cc'},
+				{name:'Coala', border:'#123456', font:'#ffffff', background:'#385c80'},
+				{name:'Tomate', border:'#d5130b', font:'#111111', background:'#e36d76'},
+				{name:'Limão', border:'#32ed21', font:'#1f3f1c', background:'#b2f1ac'},
+				{name:'Alto contraste', border:'#000000', font:'#ffffff', background:'#222222'}
+			]		
+}
+function rgb2hex(rgb){
+ rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
+ return "#" +
+  ("0" + parseInt(rgb[1],10).toString(16)).slice(-2) +
+  ("0" + parseInt(rgb[2],10).toString(16)).slice(-2) +
+  ("0" + parseInt(rgb[3],10).toString(16)).slice(-2);
+}
+
+function confirmDelete(id){
+	$.Zebra_Dialog('<strong>Deseja excluir esse marcador?</strong>', {
+		'type':     'question',
+		'title':    'Atenção',
+		'buttons': ['Sim','Não'],	
+		'onClose':  function(caption) {
+			if(caption == 'Sim'){
+				delete_label(id);
+			}
+		}
+	});	
+}			
 function save_editLabel(){
 		$(".save-label").button("disable");
@@ -139,33 +170,4 @@
 
 }
-function colors_suggestions(){
-	return [
-				{name:'Padrão', border:'#3366cc', font:'#ffffff', background:'#3366cc'},
-				{name:'Coala', border:'#123456', font:'#ffffff', background:'#385c80'},
-				{name:'Tomate', border:'#d5130b', font:'#111111', background:'#e36d76'},
-				{name:'Limão', border:'#32ed21', font:'#1f3f1c', background:'#b2f1ac'},
-				{name:'Alto contraste', border:'#000000', font:'#ffffff', background:'#222222'}
-			]		
-}
-function rgb2hex(rgb){
- rgb = rgb.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/);
- return "#" +
-  ("0" + parseInt(rgb[1],10).toString(16)).slice(-2) +
-  ("0" + parseInt(rgb[2],10).toString(16)).slice(-2) +
-  ("0" + parseInt(rgb[3],10).toString(16)).slice(-2);
-}
-
-function confirmDelete(id){
-	$.Zebra_Dialog('<strong>Deseja excluir esse marcador?</strong>', {
-		'type':     'question',
-		'title':    'Atenção',
-		'buttons': ['Sim','Não'],	
-		'onClose':  function(caption) {
-			if(caption == 'Sim'){
-				delete_label(id);
-			}
-		}
-	});	
-}			
 function delete_label(id){
 	$(".label-list li").each(function () {
@@ -428,5 +430,7 @@
 		
 	//salvar/criar marcador
-	winElement.find(".buttons .save-label").click(save_editLabel());	
+	winElement.find(".buttons .save-label").click(function(){
+		save_editLabel();
+	});	
 	//desfazer marcador
 	winElement.find(".buttons .undo-label").click(function(event){
Index: /trunk/prototype/modules/mail/js/followupflag.js
===================================================================
--- /trunk/prototype/modules/mail/js/followupflag.js	(revision 5554)
+++ /trunk/prototype/modules/mail/js/followupflag.js	(revision 5564)
@@ -362,11 +362,14 @@
 			var messageNumber   = selectedMessageIds[i];
 			if(onceOpenedHeadersMessages[folder_name][messageNumber]['followupflagged']){
-				var flag_id = onceOpenedHeadersMessages[folder_name][messageNumber]['followupflagged'].id;
-				DataLayer.remove('followupflagged', flag_id);
-				$('#td_message_followup_' + messageNumber + ', ' + 
-				  '#td_message_followup_search_' + messageNumber).find(".flag-edited").css("background", '#CCC');
-				$('#td_message_followup_' + messageNumber + ', ' + 
-					'#td_message_followup_search_' + messageNumber).find(".flag-edited")
-					.find("img").attr("src", "../prototype/modules/mail/img/flagEditor.png").css("margin-left","0");
+				if(onceOpenedHeadersMessages[folder_name][messageNumber]['followupflagged'].id){
+					var flag_id = onceOpenedHeadersMessages[folder_name][messageNumber]['followupflagged'].id;
+					DataLayer.remove('followupflagged', flag_id);
+					$('#td_message_followup_' + messageNumber + ', ' + 
+					  '#td_message_followup_search_' + messageNumber).find(".flag-edited").css("background", '#CCC');
+					$('#td_message_followup_' + messageNumber + ', ' + 
+						'#td_message_followup_search_' + messageNumber).find(".flag-edited")
+						.find("img").attr("src", "../prototype/modules/mail/img/flagEditor.png").css("margin-left","0");
+					onceOpenedHeadersMessages[folder_name][messageNumber]['followupflagged'] = undefined;
+				}
 			}
 		}
Index: /trunk/expressoMail1_2/js/search.js
===================================================================
--- /trunk/expressoMail1_2/js/search.js	(revision 5549)
+++ /trunk/expressoMail1_2/js/search.js	(revision 5564)
@@ -533,5 +533,4 @@
 				td.id = "td_message_followup_search_"+uid_msg;
 				td.setAttribute("class","search-result-item");
-				//td1 = "<img src ='../prototype/modules/mail/img/flagDefault.png' title='"+get_lang('Followup')+"'>";
 				td1 = '<div class="flag-edited" style="width:9px;height:6px;"><img src="../prototype/modules/mail/img/flagEditor.png"></div>';
 						
@@ -558,5 +557,4 @@
 						$('#td_message_followup_' + messageClickedId + ', ' + 
 						'#td_message_followup_search_' + messageClickedId).find(".flag-edited").css("background", aux.followupflagged.backgroundColor);						
-						//$(this).find(".flag-edited").css("background", aux.followupflagged.backgroundColor);
 						aux.followupflagged.id = DataLayer.put('followupflagged', aux.followupflagged);
 						
@@ -799,10 +797,4 @@
 			return;
 
-		//////////////////////////////////////////////////////////////////////
-		/**
-		 * Get the labels aplyed to the messages and saves the information 
-		 * into message array 
-		 */
-
 		var msg_folder = get_current_folder(); 
 		var messageNumbers = new Array();
@@ -813,44 +805,4 @@
 		}
 		
-
-		// var labeleds = DataLayer.get('labeled', {
-				// filter: ['AND', ['IN', 'messageNumber', messageNumbers], ['=', 'folderName', messageFolders]],
-				// criteria: {deepness: 2}
-		// });
-
-		// if(labeleds) {
-			// for (var i=0; i<data.length; i++) {
-				// for (var j=0; j<labeleds.length; j++) {
-					// if (labeleds[j].messageNumber == data[i].uid) {
-						// if (!data[i].labels)
-							// data[i].labels = {};
-						// data[i].labels[labeleds[j].label.id] = labeleds[j].label;
-					// }
-				// }
-			// }
-		// }
-
-		/**
-		 * Get the followupflags aplyed to the messages and saves the information 
-		 * into message array 
-		 */
-		 
-		// var followupflaggeds = DataLayer.get('followupflagged', {
-				// filter: ['AND', ['IN', 'messageNumber', messageNumbers], ['=', 'folderName', messageFolders]],
-				// criteria: {deepness: 2}
-			// });
-
-		// if(followupflaggeds) {
-			// for (var i=0; i<data.length; i++) {
-				// for (var j=0; j<followupflaggeds.length; j++) {
-					// if (followupflaggeds[j].messageNumber == data[i].uid) {
-						// if (!data[i].followupflagged)
-							// data[i].followupflagged = {};
-						// data[i].followupflagged = followupflaggeds[j];
-					// }
-				// }
-			// }
-		// }
-		/////////////////////////////////////////////////////////////////////////
 	
 		var cont = parseInt(0);
