Index: branches/2.2/expressoMail1_2/templates/default/main.css
===================================================================
--- branches/2.2/expressoMail1_2/templates/default/main.css	(revision 3019)
+++ branches/2.2/expressoMail1_2/templates/default/main.css	(revision 3021)
@@ -160,9 +160,9 @@
 
 .table_message{
-	background-image: url(../../../phpgwapi/templates/default/images/fundo_topo.png);
+	background-image: url(../../../phpgwapi/templates/default/images/fundo_msg.png);
 	padding: 1px;
 	cursor: default;
 	border-width: 1px 1px 1px 1px;
-	border-spacing: 0px 1px;
+	border-spacing: 0px 0px;
 	border-style: outset outset outset outset;
 	border-color: gray gray gray gray;
@@ -413,4 +413,20 @@
 	padding-right: 0 !important;
 }
+
+.reply_options {
+	cursor: pointer;
+        color: white;
+	white-space: nowrap;
+	font-weight: bold;
+}
+
+.reply_options_active {
+	 cursor: pointer;
+         white-space: nowrap;
+	 color: yellow;
+	 text-decoration: underline;
+         font-weight: bold !important;
+}
+
 
 .em_sidebox_menu {
Index: branches/2.2/expressoMail1_2/setup/phpgw_pt-br.lang
===================================================================
--- branches/2.2/expressoMail1_2/setup/phpgw_pt-br.lang	(revision 1965)
+++ branches/2.2/expressoMail1_2/setup/phpgw_pt-br.lang	(revision 3021)
@@ -185,4 +185,6 @@
 Groups	expressoMail1_2	pt-br	Grupos
 Hide menu folders?	expressoMail1_2	pt-br	Ocultar menu das pastas?
+Hide details	expressoMail1_2	pt-br	Ocultar detalhes
+Show details	expressoMail1_2	pt-br	Mostrar detalhes
 Hide options	expressoMail1_2	pt-br	Ocultar opções
 Hide Search	expressoMail1_2	pt-br	Ocultar Pesquisa
Index: branches/2.2/expressoMail1_2/js/draw_api.js
===================================================================
--- branches/2.2/expressoMail1_2/js/draw_api.js	(revision 3018)
+++ branches/2.2/expressoMail1_2/js/draw_api.js	(revision 3021)
@@ -1303,15 +1303,12 @@
 	option_hide_more.onclick = function(){
 		if (this.value == 'more_options'){
-			this.innerHTML = "<b><u>"+get_lang('Options')+"</u></b>";
+			this.innerHTML = "<b><u>"+get_lang('Hide details')+"</u></b>";
 			this.value = 'hide_options';
 			Element('table_message_others_options_'+ID).style.display = '';
-			Element('tr_other_options_'+ID).style.display = '';
-			
 		}
 		else{
-			this.innerHTML = get_lang('Options');
+			this.innerHTML = get_lang('Show details');
 			this.value = 'more_options';
 			Element('table_message_others_options_'+ID).style.display = 'none';
-			Element('tr_other_options_'+ID).style.display = 'none';			
 		}
 		resizeWindow();
@@ -1320,11 +1317,15 @@
 	option_mark.align = "left";
 	option_mark.width = "50%";
-	var option_mark_as_unseen = '<span class="message_options" onclick="set_messages_flag(\'unseen\','+folder_id+');write_msg(\''+get_lang('Message marked as ')+get_lang("Unseen")+'.\');">'+get_lang("Unseen")+'</span>, ';
-	var option_mark_as_important = '<span class="message_options" onclick="set_messages_flag(\'flagged\','+folder_id+');write_msg(\''+get_lang('Message marked as ')+get_lang("Important")+'.\');">'+get_lang("Important")+'</span>, ';
-	var option_mark_as_normal = '<span class="message_options" onclick="set_messages_flag(\'unflagged\','+folder_id+');write_msg(\''+get_lang('Message marked as ')+get_lang("Normal")+'.\');">'+get_lang("Normal")+'</span>';
-	option_mark.innerHTML = option_mark_as_unseen+option_mark_as_important+option_mark_as_normal;
-	option_hide_more.innerHTML = get_lang('Options');
+      var option_mark_as = '<span>'+get_lang("Mark as")+'</span>: ';
+      var option_mark_as_unseen = '<span class="message_options" onclick="changeLinkState(this,\'seen\'); set_messages_flag(\'unseen\','+folder_id+'); write_msg(\''+get_lang('Message marked as ')+get_lang("Unseen")+'.\');">'+get_lang("Unseen")+'</span>, '; 
+
+      if (info_msg.Flagged == "F") 
+              var option_mark_important = '<span class="message_options" onclick="changeLinkState(this,\'important\'); set_messages_flag(\'unflagged\','+folder_id+');write_msg(\''+get_lang('Message marked as ')+get_lang("Normal")+'.\');">'+get_lang("Normal")+'</span>'; 
+      else 
+              var option_mark_important = '<span class="message_options" onclick="changeLinkState(this,\'normal\');set_messages_flag(\'flagged\','+folder_id+');write_msg(\''+get_lang('Message marked as ')+get_lang("Important")+'.\');">'+get_lang("Important")+'</span>'; 
+      option_mark.innerHTML = option_mark_as+option_mark_as_unseen+option_mark_important; 
+	option_hide_more.innerHTML = get_lang('Show details');
 	options.appendChild(option_hide_more);
-	
+
 	var space0 = document.createElement("SPAN");
 	space0.innerHTML = '&nbsp;|&nbsp;';
@@ -1351,12 +1352,38 @@
 	option_reply.innerHTML = get_lang('Reply');
 	options.appendChild(space2);
+
+	var option_reply_options = document.createElement('IMG');
+	option_reply_options.id = 'msg_opt_reply_options_'+ID;
+	option_reply_options.src = '../expressoMail1_2/templates/default/images/down.png';
+	option_reply_options.value = 'show';
+
+	option_reply_options.onmouseover = function(){
+		option_reply_options.src= '../expressoMail1_2/templates/default/images/over.png';
+	};
+	option_reply_options.onmouseout = function(){
+		if (this.value == 'show')
+		{
+			option_reply_options.src= '../expressoMail1_2/templates/default/images/down.png';
+		}
+		else
+		{
+			option_reply_options.src= '../expressoMail1_2/templates/default/images/pressed.png';
+		}
+	};
+	option_reply_options.onclick = function(){
+		if (this.value != 'hide'){
+			this.value = 'hide';
+			option_reply_options.src= '../expressoMail1_2/templates/default/images/pressed.png';
+			Element('tr_other_options_'+ID).style.display = '';
+
+		}
+		else{
+			this.value = 'show';
+			option_reply_options.src= '../expressoMail1_2/templates/default/images/down.png';
+			Element('tr_other_options_'+ID).style.display = 'none';
+		}
+	};
+	options.appendChild(option_reply_options);
 	options.appendChild(option_reply);
-	var option_delete = document.createElement("SPAN");
-	option_delete.id = 'msg_opt_delete_'+ID;
-	option_delete.className = 'message_options';
-	option_delete.onclick = function(){proxy_mensagens.delete_msgs(info_msg.msg_folder, info_msg.msg_number, ID);};
-	option_delete.innerHTML = get_lang('Delete');
-	options.appendChild(space3);
-	options.appendChild(option_delete);
 	
 	tr.appendChild(td);
@@ -1377,16 +1404,14 @@
 	var div_other_options = document.createElement("DIV");
 
-	var option_mark_as						= '<span>'+get_lang("Mark as")+'</span>: ';
-	var option_mark_as_unseen				= '<span class="message_options" onclick="proxy_mensagens.proxy_set_messages_flag(\'unseen\','+info_msg.msg_number+');write_msg(\''+get_lang('Message marked as ')+get_lang("Unseen")+'.\');">'+get_lang("Unseen")+'</span>, ';
+	var option_mark_as_unseen = '<span class="message_options" onclick="proxy_mensagens.proxy_set_messages_flag(\'unseen\','+info_msg.msg_number+');write_msg(\''+get_lang('Message marked as ')+get_lang("Unseen")+'.\');">'+get_lang("Unseen")+'</span>, ';
 	var option_mark_as_important			= '<span class="message_options" onclick="proxy_mensagens.proxy_set_messages_flag(\'flagged\','+info_msg.msg_number+');write_msg(\''+get_lang('Message marked as ')+get_lang("Important")+'.\');">'+get_lang("Important")+'</span>, ';
 	var option_mark_as_normal				= '<span class="message_options" onclick="proxy_mensagens.proxy_set_messages_flag(\'unflagged\','+info_msg.msg_number+');write_msg(\''+get_lang('Message marked as ')+get_lang("Normal")+'.\');">'+get_lang("Normal")+'</span> | ';
 	
-	var option_move							= '<span class="message_options" onclick=wfolders.makeWindow("'+ID+'","move_to");>'+get_lang("Move")+'</span> | ';
-	var option_reply_to_all					= '<span onmouseover="this.className=\'message_options_active\'" onmouseout="this.className=\'message_options\'" class="message_options" onclick=new_message("reply_to_all_with_history","'+ID+'");>'+get_lang("Reply to all")+'</span> | ';
-	var option_reply_without_history		= '<span onmouseover="this.className=\'message_options_active\'" onmouseout="this.className=\'message_options\'" class="message_options" onclick=new_message("reply_without_history","'+ID+'");>'+get_lang("Reply without history")+'</span> | ';
-	var option_reply_to_all_without_history	= '<span onmouseover="this.className=\'message_options_active\'" onmouseout="this.className=\'message_options\'" class="message_options" onclick=new_message("reply_to_all_without_history","'+ID+'");>'+get_lang("Reply to all without history")+'</span> |';
-	var option_source_msg = '<span class="message_options" onclick=proxy_mensagens.proxy_source_msg("'+ID+'","'+url_encode(info_msg.msg_folder)+'");>'+get_lang("Message Font")+'</span> </div>';		
-
-	div_other_options.innerHTML = option_reply_to_all + option_reply_without_history + option_reply_to_all_without_history + option_source_msg;
+	var option_move	= '<span class="message_options" onclick=wfolders.makeWindow("'+ID+'","move_to");>'+get_lang("Move")+'</span> | ';
+	var option_reply_to_all = '<span onmouseover="this.className=\'reply_options_active\'" onmouseout="this.className=\'reply_options\'" class="reply_options" onclick=new_message("reply_to_all_with_history","'+ID+'");>'+get_lang("Reply to all")+'</span> | ';
+	var option_reply_without_history = '<span onmouseover="this.className=\'reply_options_active\'" onmouseout="this.className=\'reply_options\'" class="reply_options" onclick=new_message("reply_without_history","'+ID+'");>'+get_lang("Reply without history")+'</span> | ';
+	var option_reply_to_all_without_history	= '<span onmouseover="this.className=\'reply_options_active\'" onmouseout="this.className=\'reply_options\'" class="reply_options" onclick=new_message("reply_to_all_without_history","'+ID+'");>'+get_lang("Reply to all without history")+'</span>';
+
+	div_other_options.innerHTML = option_reply_to_all + option_reply_without_history + option_reply_to_all_without_history;
 	if (use_spam_filter) {
 		if(info_msg.msg_folder == 'INBOX'+cyrus_delimiter+'Spam')
@@ -1395,8 +1420,9 @@
 			div_other_options.innerHTML += ' | <span class="message_options" onclick="spam(\''+info_msg.msg_folder+'\', '+info_msg.msg_number+',\'null\')";>'+get_lang("Mark as Spam")+'</span>';	
 	}
-		
+	td_other_options.align = 'right';
+	td_other_options.style.paddingTop = '3px';
 	td_other_options.appendChild(div_other_options);
-	//td_other_options.innerHTML = option_print + option_reply_to_all + option_source_msg;
-	
+
+
 	tr_other_options.appendChild(td_other_options);
 	tbody_message_options.appendChild(tr_other_options);
@@ -1469,7 +1495,6 @@
 		options.width = "1%";
 		options.setAttribute("noWrap","true");
-		var option_edit	  = '<span class="message_options" onclick="new_message(\'edit\',\''+ID+'\');">'+get_lang('Edit')+'</span> | ';
-		var option_print = '<span class="message_options" onclick="print_msg(\''+info_msg.msg_folder+'\',\''+info_msg.msg_number+'\',\''+ID+'\');">'+get_lang('Print')+'</span> | ';
-		var option_delete = '<span class="message_options" onclick="proxy_mensagens.delete_msgs(\''+info_msg.msg_folder+'\',\''+info_msg.msg_number+'\',\''+ID+'\');">'+get_lang('Delete')+'</span> | ';		
+		var option_edit	  = ' | <span class="message_options" onclick="new_message(\'edit\',\''+ID+'\');">'+get_lang('Edit')+'</span>';
+		var option_print = ' | <span class="message_options" onclick="print_msg(\''+info_msg.msg_folder+'\',\''+info_msg.msg_number+'\',\''+ID+'\');">'+get_lang('Print')+'</span>';
 		var option_hide_more = document.createElement("SPAN");
 		option_hide_more.className = 'message_options';
@@ -1477,5 +1502,5 @@
 		option_hide_more.value = 'more_options';
 		option_hide_more.id = 'option_hide_more_'+ID;
-		option_hide_more.innerHTML = get_lang('Options');
+		option_hide_more.innerHTML = get_lang('Show details');
 		option_hide_more.onclick = function(){
 			var _height = Element("div_message_scroll_"+ID).style.height;
@@ -1483,5 +1508,5 @@
 			var _offset = 35;
 			if (this.value == 'more_options'){
-				this.innerHTML = "<b><u>"+get_lang('Options')+"</u></b>";
+				this.innerHTML = "<b><u>"+get_lang('Hide details')+"</u></b>";
 				this.value = 'hide_options';
 				Element("div_message_scroll_"+ID).style.height = (_height - _offset)+"px";
@@ -1489,5 +1514,5 @@
 			}
 			else{
-				this.innerHTML = get_lang('Options');
+				this.innerHTML = get_lang('Show details');
 				this.value = 'more_options';
 				Element("div_message_scroll_"+ID).style.height = (_height + _offset)+"px";
@@ -1495,6 +1520,8 @@
 			}
 		};
-		options.innerHTML = option_edit + option_print + option_delete;
 		options.appendChild(option_hide_more);
+		options_actions = document.createElement('SPAN');
+		options_actions.innerHTML = option_edit + option_print;
+		options.appendChild(options_actions);
 		tr.appendChild(td);
 		tr.appendChild(options);
@@ -1986,5 +2013,35 @@
 	//////////////////////////////////////////////////////////////////////////////////////////////////////
 }
-
+function changeLinkState(el,state){ 
+	el.innerHTML = get_lang(state); 
+	switch (state){ 
+		case 'important': 
+			{ 
+				el.onclick = function(){changeLinkState(el,'normal');set_messages_flag('unflagged',currentTab.substr(0,currentTab.indexOf("_r"))); write_msg(get_lang('Message marked as ')+get_lang("Normal"))} 
+				break; 
+			} 
+		case 'normal': 
+			{ 
+				el.onclick = function(){  changeLinkState(el,'important');set_messages_flag('flagged',currentTab.substr(0,currentTab.indexOf("_r")));write_msg(get_lang('Message marked as ')+get_lang("Important"))} 
+				break; 
+			} 
+		case 'unseen': 
+			{ 
+				el.onclick = function(){  changeLinkState(el,'seen');set_messages_flag('unseen',currentTab.substr(0,currentTab.indexOf("_r")));write_msg(get_lang('Message marked as ')+get_lang("unseen"))} 
+				break; 
+
+			} 
+		case 'seen': 
+			{ 
+				el.onclick = function(){  changeLinkState(el,'unseen');set_messages_flag('seen',currentTab.substr(0,currentTab.indexOf("_r")));write_msg(get_lang('Message marked as ')+get_lang("seen"))} 
+				break; 
+
+			} 
+		default: 
+			{ 
+				break; 
+			} 
+	} 
+} 
 function draw_new_message(border_ID){
 	var ID = create_border("",border_ID);
