Index: trunk/prototype/modules/mail/css/label.css
===================================================================
--- trunk/prototype/modules/mail/css/label.css	(revision 5713)
+++ trunk/prototype/modules/mail/css/label.css	(revision 5866)
@@ -124,2 +124,8 @@
 
 .configure-zebra-dialog {z-index:1007 !important;}
+
+span.removeLabeled {margin:0 5px 0 5px;font-weight: bold; float:right;}
+span.removeLabeled:hover {color: #CCC;}
+
+span.removeLabeledMsg {margin:0 5px 0 5px;font-weight: bold;}
+span.removeLabeledMsg:hover {cursor: pointer;}
Index: trunk/expressoMail1_2/setup/phpgw_pt-br.lang
===================================================================
--- trunk/expressoMail1_2/setup/phpgw_pt-br.lang	(revision 5862)
+++ trunk/expressoMail1_2/setup/phpgw_pt-br.lang	(revision 5866)
@@ -874,2 +874,3 @@
 Do you want to display date in format numerical?	expressoMail1_2	pt-br	Você deseja exibir a data no formato numérico?
 at	expressoMail1_2	pt-br	às
+Remove Label	expressoMail1_2	pt-br	Desmarcar 
Index: trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- trunk/expressoMail1_2/js/draw_api.js	(revision 5861)
+++ trunk/expressoMail1_2/js/draw_api.js	(revision 5866)
@@ -2982,37 +2982,55 @@
 	
 	
-	
-	var labels = DataLayer.get("labeled", {filter: [
-			'AND',
-				['=', 'folderName', current_folder], 
-				['=','messageNumber',folder_id]], 
-			criteria : {deepness: 2}} );
-	
-	if(labels.length != 0){
-		var tr8 = document.createElement("TR");
-		tr8.className = "tr_message_header";
-		var td8 = document.createElement("TD");
-		td8.innerHTML = get_lang("Labels: ");
-		var markers = document.createElement("TD");
-		markers.id = "markers_"+ID;
-		
-		for(var i=0; i<labels.length; i++){
-			fontColor = labels[i].label.fontColor;
-			borderColor = labels[i].label.borderColor;
-			backgroundColor = labels[i].label.backgroundColor;
-			nameLabel = labels[i].label.name;
-			markers.innerHTML+= "<div  style='width: 150px; height: 15px; background:"+backgroundColor+"; float: left; -webkit-border-radius: 3px; -moz-border-radius: 3px; margin:0 0 1px 1px; border: 1px solid "+borderColor+"'><span style='color: "+fontColor+"; margin: 5px;'>"+nameLabel+"</a></div>";
+	var update_labeleds_msg = function(){
+		//TODO Mudar quando API abstrair atualizações no cache
+		DataLayer.remove('labeled', false);
+		DataLayer.get('labeled');
+		var labels = DataLayer.get("labeled", {filter: [
+				'AND',
+					['=', 'folderName', current_folder], 
+					['=','messageNumber',folder_id]], 
+				criteria : {deepness: 2}} );
+		
+		if(labels.length != 0){
+			var tr8 = document.createElement("TR");
+			tr8.className = "tr_message_header";
+			var td8 = document.createElement("TD");
+			td8.innerHTML = get_lang("Labels: ");
+			var markers = document.createElement("TD");
+			markers.id = "markers_"+ID;
 			
-		}
-		
-		markers.className = "header_message_field";
-		tr8.appendChild(td8);
-		tr8.appendChild(markers);
-		tbody_message_others_options.appendChild(tr8);
-	}
-	
-	
-	
-	
+			for(var i=0; i<labels.length; i++){
+				fontColor = labels[i].label.fontColor;
+				borderColor = labels[i].label.borderColor;
+				backgroundColor = labels[i].label.backgroundColor;
+				nameLabel = labels[i].label.name;
+				id = labels[i].id;
+				markers.innerHTML+= "<div  style='height: 15px; background:"+backgroundColor+"; float: left; -webkit-border-radius: 3px; -moz-border-radius: 3px; margin:0 0 1px 1px; border: 1px solid "+borderColor+"'><span style='color: "+fontColor+"; margin: 5px;'>"+nameLabel+"</span><span class='removeLabeledMsg' id='"+id+"' title='"+get_lang("Remove Label")+"'>x</span></div>";
+				
+			}
+			$(markers).find('span.removeLabeledMsg').click(function(event){
+				var id_labeled = $(event.target).attr("id");
+				//TODO Mudar quando API abstrair atualizações no cache
+				DataLayer.remove('labeled', false);
+				DataLayer.get('labeled');
+				DataLayer.remove('labeled', id_labeled);
+				DataLayer.commit(false, false, function(){
+					var index_folder = id_labeled.lastIndexOf('/');
+					var folder_name = id_labeled.slice(0,index_folder);
+					var index_number = id_labeled.lastIndexOf('#');
+					var msg_number = id_labeled.slice(index_folder + 1,index_number);
+					updateLabelsColumn({msg_number:msg_number, boxname:folder_name, labels:false});
+					update_labeleds_msg();
+					tbody_message_others_options.removeChild(tr8);
+				});
+				
+			});
+			markers.className = "header_message_field";
+			tr8.appendChild(td8);
+			tr8.appendChild(markers);
+			tbody_message_others_options.appendChild(tr8);
+		}
+	}
+	update_labeleds_msg();
 	
 	
Index: trunk/expressoMail1_2/js/doiMenuData.js
===================================================================
--- trunk/expressoMail1_2/js/doiMenuData.js	(revision 5740)
+++ trunk/expressoMail1_2/js/doiMenuData.js	(revision 5866)
@@ -249,7 +249,23 @@
 		}
 	}
-	 if(current_folder == msg_folder || !current_folder){
+	var menuItensLabel = {};
+	for(index in menuItems){
+		menuItensLabel[index] = {type: "label", customName: menuItems[index].name, id: msg_folder+"/"+msg_number+"#"+index};		
+	}
+	$.contextMenu.types.label = function(item, opt, root) {
+        $('<span>'+item.customName+'</span><span class="removeLabeled" title="'+get_lang("Remove Label")+'">x</span>')
+            .appendTo(this);
+		$(this).find('span.removeLabeled').click(function(){
+			//TODO Mudar quando API abstrair atualizaÃ§Ãµes no cache
+			DataLayer.remove('labeled', false);
+			DataLayer.get('labeled');
+			DataLayer.remove('labeled', item.id);
+			DataLayer.commit(false, false, function(){
+				updateLabelsColumn({msg_number:msg_number, boxname:msg_folder, labels:false});
+			});
+		});
+	};
+	if(current_folder == msg_folder || !current_folder){
 		$.contextMenu( 'destroy', '#td_message_labels_' + msg_number +', tr[role="'+msg_number+'_'+msg_folder+'"] #td_message_labels_search_' + msg_number);
-
 		$.contextMenu({
 			selector: '#td_message_labels_' + msg_number +', tr[role="'+msg_number+'_'+msg_folder+'"] #td_message_labels_search_' + msg_number,
@@ -259,7 +275,6 @@
 			callback: function(key, options) {
 				//TODO - default actions
-
 			},
-			items: menuItems
+			items: menuItensLabel
 		});
 	}else{
@@ -273,7 +288,6 @@
 			callback: function(key, options) {
 				//TODO - default actions
-
 			},
-			items: menuItems
+			items: menuItensLabel 
 		});	
 	}
