Index: trunk/prototype/modules/attach_message/attach_message.css
===================================================================
--- trunk/prototype/modules/attach_message/attach_message.css	(revision 5136)
+++ trunk/prototype/modules/attach_message/attach_message.css	(revision 5188)
@@ -37,11 +37,15 @@
 #selected_messages_number { }
 
-.flags{}
-.Recent {background-image:url(images/email.png); display:inline-block; width:16px;height:16px; }
-.Unseen { }
-.Answered { }
-.Draft { }
-.Deleted { }
-.Flagged { }
+.flags{display:inline-block; width:16px;height:16px;}
+/* 
+	TO-DO : COLOCAR NOVAS IMAGENS após o images/ ..
+*/
+.recent {background-image:url(images/.png);}
+.unseen {background-image:url(images/.png);}
+.seen {background-image:url(images/.png);}
+.answered {background-image:url(images/.png);}
+.draft {background-image:url(images/.png);}
+.deleted { }
+.flagged { }
 
 mailpreview-tabs {max-height: 15px; height: 15px; display: none; visibility: hidden;}
Index: trunk/prototype/modules/attach_message/attach_message.js
===================================================================
--- trunk/prototype/modules/attach_message/attach_message.js	(revision 5172)
+++ trunk/prototype/modules/attach_message/attach_message.js	(revision 5188)
@@ -1,3 +1,2 @@
-
 // $.storage = new $.store();
 
@@ -104,11 +103,25 @@
 }
 
-flags2Class = function(cellvalue) {
+flags2Class = function(cellvalue, options, rowObject) {
+	var classes = '';
+	
+	if(cellvalue ==""){
+		classes += '<span class="flags seen" title="seen"> </span>';
+		return classes;
+	}
 	var flags_enum = cellvalue.split(',');
-	var classes = '';
+	
 	for (var i=0; i<flags_enum.length; i++){
-		classes += '<span class="icon-'+flags_enum[i].toLowerCase()+'"> </span>';
-	}
+		classes += '<span class="flags '+flags_enum[i].toLowerCase()+'" title="'+flags_enum[i].toLowerCase()+'"> </span>';
+	}
+	
 	return classes;
+}
+
+NormaliseFrom = function(cellvalue, options, rowObject) {
+	//alert(dump(rowObject));
+	if(rowObject['flags'].indexOf("Draft") >=  0)
+		return get_lang(special_folders["Drafts"]);
+	return cellvalue;	
 }
 
@@ -279,5 +292,5 @@
 		})
 		.find('span:first-child');
-
+		$('span.folder.inbox').addClass('selected');
 		selectedFolder = {
 			id: firstFolder.parent().attr('id'), 
@@ -298,9 +311,9 @@
 			colModel:[
 				{name:'msg_number',index:'msg_number', width:45, hidden:true, sortable:false},
-				{name:'flags',index:'msg_number', width:40, sortable:false, formatter:flags2Class},
-				{name:'from.name',index:'msg_number', width:130, sortable:false},
-				{name:'subject',index:'subject', width:250, sortable:false},
+				{name:'flags',index:'msg_number',edittype: 'image', width:40, sortable:false, formatter:flags2Class},
+				{name:'from.name',index:'msg_number', width:130, sortable:false, formatter:NormaliseFrom},
+				{name:'subject',index:'subject', width:245, sortable:false},
 				{name:'timestamp',index:'timestamp', width:65, align:"center", sortable:false, formatter:date2Time},
-				{name:'size',index:'size', width:50, align:"right", sortable:false, formatter:bytes2Size}
+				{name:'size',index:'size', width:55, align:"right", sortable:false, formatter:bytes2Size}
 			],
 			jsonReader : {
@@ -330,7 +343,7 @@
 						layout: 'h&aacute; {d<}{dn} {dl} {d>}{h<}{hn} {hl} {h>}{m<}{mn} {ml} {m>}{s<}{sn} {sl}{s>}', 
 						description: ' atr&aacute;s'
-					});
+					});					
 				});
-
+				
 				// reconstrói a seleção das mensagens mesmo depois da mudança de pasta
 				if (selectedMessages[selectedFolder.id]) {
@@ -347,5 +360,5 @@
 			},
 			onSelectRow: function (id, selected) {
-				if (selected) {	
+				if (selected) {
 					var message = false;
 					for (var i=0; i<lastLoadedMessages.length; i++){
@@ -361,5 +374,11 @@
 							
 						selectedMessages[selectedFolder.id][message.msg_number] = true;
-						$('#mailpreview-container').removeClass('empty-conteiner').html(onceOpenedMessages[selectedFolder.id][message.msg_number].body);
+						$('#mailpreview-container').removeClass('empty-conteiner').unblock()
+						.find('.message')
+						.html(onceOpenedMessages[selectedFolder.id][message.msg_number].body).end()
+						.find('#mailpreview-message-info').html(onceOpenedMessages[selectedFolder.id][message.msg_number].subject)
+						//$('#mailpreview-container').removeClass('empty-conteiner').html(onceOpenedMessages[selectedFolder.id][message.msg_number].body);
+						
+						selectedMessagesCount();
 					} else {
 						jQuery('#mailpreview-container').block({  
@@ -381,5 +400,5 @@
 
 						var offlineCase = "";
-					  
+						
 						if( !selectedFolder.id.indexOf( 'local_messages/' ) )
 						    offlineCase = ":offline";
@@ -388,15 +407,13 @@
 							selectedMessages[selectedFolder.id] = {};
 						selectedMessages[selectedFolder.id][message.msg_number] = true;
-						
 						$.ajax({
 							accepts: 'text/html',
-							url: BASE_PATH + 'REST.php'+offlineCase+'?q=folder/'+selectedFolder.id.replace('/', '.')+'/message/'+id,
+							url: BASE_PATH + 'REST.php'+offlineCase+'?q=folder/'+selectedFolder.id.replace(dashes, '.')+'/message/'+id,
 							dataType: 'json',
-							success: function( mail_preview ){
+							success: function( mail_preview ){								
 								if (!onceOpenedMessages[selectedFolder.id])
 									onceOpenedMessages[selectedFolder.id] = {};
-									
 								onceOpenedMessages[selectedFolder.id][message.msg_number] = jQuery.extend(true, message, mail_preview);
-						
+
 								$('#mailpreview-container').removeClass('empty-conteiner').unblock()
 								.find('.message')
@@ -409,7 +426,10 @@
 					}
 				} else {
+					$('#mailpreview-container').addClass('empty-conteiner').unblock()
+					.find('.message')
+					.html("selecione uma mensagem para pre-visualizar").end()
+					.find('#mailpreview-message-info').html("");
 					selectedMessages[selectedFolder.id][id] = false;
 				}
-				selectedMessagesCount();
 			},
 			caption: '<span class="'+selectedFolder.class+'">'+selectedFolder.name+'</span>'
