Index: /trunk/prototype/modules/attach_message/attach_message.css
===================================================================
--- /trunk/prototype/modules/attach_message/attach_message.css	(revision 5263)
+++ /trunk/prototype/modules/attach_message/attach_message.css	(revision 5278)
@@ -35,5 +35,5 @@
 #mailgrid-container {width:650px;/*height:240px;*/ margin:5px 5px 5px 0px; float:right; overflow:auto;}
 #mailpreview_container {margin:5px;padding:0px;height:200px;}
-#mailpreview_container .ui-tabs-panel {height:145px;overflow:auto;padding:5px;}
+#mailpreview_container .ui-tabs-panel {height:145px;overflow:auto;padding:0px;}
 /*#mailpreview_tabs { max-height: 20px; }*/
 #buttons-container {text-align: right;margin:5px;}
@@ -53,13 +53,15 @@
 .flagged { }
 
-/*#mailpreview_tabs {max-height: 15px; height: 15px; display: none; visibility: hidden;}*/
-.mailpreview-message-info {display: block; margin:0; padding: 0; width: 100%;height: 15px; font-weight: bolder; overflow:hidden;}
-
 #loading-content .image {width: 32px; height: 32px; background-image: url(images/loading.gif);}
 
-#mailpreview_container li .ui-icon-close { float: left; margin: 0.4em 0.2em 0 -0.2em; cursor: pointer; }
 #mailpreview_container .ui-tabs-nav { margin: 0; padding:0;  border-left:none; border-right: none; border-top: none; -moz-border-radius:0; -webkit-border-radius:0; border-radius:0;}
 #mailpreview_container .ui-tabs-nav li { padding:0; }
 #mailpreview_container .ui-tabs-nav li a { padding: 0.6em 0.4em 0.3em 0.6em; font-size: 11px;}
+#mailpreview_container .ui-tabs-nav li .ui-icon-close { float: left; margin: 0.4em 0.2em 0 -0.2em; cursor: pointer; }
+#mailpreview_container .ui-tabs-nav .preview-message-unselected { color:#993333; }
 
-#mailpreview_container .ui-tabs-nav .preview-message-unselected { color:#993333; }
+/*#mailpreview_tabs {max-height: 15px; height: 15px; display: none; visibility: hidden;}*/
+.mailpreview-message-info {display: block; margin:0; padding: 0; height: 15px; font-weight: bolder; overflow:hidden;}
+.mailpreview-message-info {padding:3px 3px 2px 3px;background-color:#CCC;font-size: 80%;-moz-border-radius-bottomleft:3px;-moz-border-radius-bottomright:3px;-webkit-border-radius-bottomleft:3px;-webkit-border-radius-bottomright:3px;radius-bottomleft:3px;radius-bottomright:3px;}
+.mailpreview-message-body {padding:5px;}
+
Index: /trunk/prototype/modules/attach_message/attach_message.js
===================================================================
--- /trunk/prototype/modules/attach_message/attach_message.js	(revision 5263)
+++ /trunk/prototype/modules/attach_message/attach_message.js	(revision 5278)
@@ -188,4 +188,6 @@
     return( data );
 }
+
+$mailpreview_tabs_label_length = 15;
 
 /* --- jQuery handlers --- */
@@ -343,5 +345,5 @@
 				}
 				
-				var tabPanelTemplateId    = 'mailpreview_tab_' + selectedFolder.id.replace('/', '_') + '_' + message.msg_number;
+				var tabPanelTemplateId = 'mailpreview_tab_' + selectedFolder.id.replace('/', '_') + '_' + message.msg_number;
 				
 				if (selected) {				
@@ -353,9 +355,9 @@
 						$('#mailpreview-container').unblock();						
 
-						/**
-						 * TODO: limitar o tamanho da string de título da tab 
-						 */
 						var tabPanelTemplateLabel = onceOpenedMessages[selectedFolder.id][message.msg_number].subject;
-						if ($('#' + tabPanelTemplateId).length == 0) {								
+						if (tabPanelTemplateLabel.length > $mailpreview_tabs_label_length + 3)
+							tabPanelTemplateLabel = tabPanelTemplateLabel.substring(0, $mailpreview_tabs_label_length) + '...';
+						
+						if (!$('#' + tabPanelTemplateId).length) {								
 							$mailpreview_tabs.tabs("add", '#' + tabPanelTemplateId, tabPanelTemplateLabel)
 							.find('.message.empty-container').hide().end()
@@ -403,10 +405,10 @@
 
 								$('#mailpreview_container').unblock();
-								
-								/**
-								 * TODO: limitar o tamanho da string de título da tab 
-								 */
+
 								var tabPanelTemplateLabel = onceOpenedMessages[selectedFolder.id][message.msg_number].subject;
-								if ($('#' + tabPanelTemplateId).length == 0) {								
+								if (tabPanelTemplateLabel.length > $mailpreview_tabs_label_length + 3)
+									tabPanelTemplateLabel = tabPanelTemplateLabel.substring(0, $mailpreview_tabs_label_length) + '...';
+						
+								if (!$('#' + tabPanelTemplateId).length) {								
 									$mailpreview_tabs.tabs("add", '#' + tabPanelTemplateId, tabPanelTemplateLabel)
 									.find('.message.empty-container').hide().end()
@@ -417,5 +419,6 @@
 											onceOpenedMessages[selectedFolder.id][message.msg_number].subject + 
 										'</div>'
-									);
+									)
+									.find('[class^="ExpressoCssWrapper"]').addClass("mailpreview-message-body");
 								} else {
 									$mailpreview_tabs.tabs('select', '#' + tabPanelTemplateId)
@@ -429,5 +432,7 @@
 				} else {
 					/**
-					 * if you wants to remove tab on unselect message
+					 * if you wants to remove tab on unselect message,
+					 * but still needs to uselect message on remove tab.
+					 * 
 					 */
 					/*
@@ -448,5 +453,5 @@
 var $mailpreview_tabs = $( "#mailpreview_container").tabs({
 	tabTemplate: "<li><a href='#{href}'>#{label}</a> <span class='ui-icon ui-icon-close'> Fechar </span></li>",
-	panelTemplate: '<div class="message mailpreview-message-body"></div>',
+	panelTemplate: '<div class="message mailpreview-message"></div>',
 	add: function( event, ui ) {
 		$mailpreview_tabs.tabs('select', '#' + ui.panel.id);
@@ -458,8 +463,8 @@
 		if (!$mailpreview_tabs.tabs("length") && !$('#mailpreview_tabs_default_empty').length) {
 			/**
-			 * TODO: internacionalizar a string 'Nenhuma mensagem selecionada'
+			 * TODO: internacionalizar a string 'Nenhuma aba'
 			 */
-			$mailpreview_tabs.tabs('add', '#mailpreview_tabs_default_empty', 'Nenhuma mensagem selecionada')
-			.find('#mailpreview_tabs_default_empty').removeClass('mailpreview-message-body').addClass('empty-container')
+			$mailpreview_tabs.tabs('add', '#mailpreview_tabs_default_empty', 'Nenhuma aba')
+			.find('#mailpreview_tabs_default_empty').removeClass('mailpreview-message').addClass('empty-container')
 			.html('<span class="message">' + get_lang('select a message to preview') + '</span>').end()
 			.find('.ui-tabs-nav li:first .ui-icon-close').remove();
Index: /trunk/prototype/modules/attach_message/attach_message.ejs
===================================================================
--- /trunk/prototype/modules/attach_message/attach_message.ejs	(revision 5263)
+++ /trunk/prototype/modules/attach_message/attach_message.ejs	(revision 5278)
@@ -9,5 +9,5 @@
 	<div id="mailpreview_container">
 		<ul id="mailpreview_tabs">
-			<li><a href="#mailpreview_tabs_default_empty">Nenhuma mensagem selecionada</a></li>
+			<li><a href="#mailpreview_tabs_default_empty">Nenhuma aba</a></li>
 		</ul>
 		<div id="mailpreview_tabs_default_empty" class="empty-container"><span class="message" ><%=get_lang('select a message to preview')%></span></div>
