Index: trunk/expressoMail1_2/js/search.js
===================================================================
--- trunk/expressoMail1_2/js/search.js	(revision 1294)
+++ trunk/expressoMail1_2/js/search.js	(revision 1330)
@@ -334,4 +334,6 @@
 				aux[0] = nw_array[i].substr(0, nw_array[i].indexOf('--'));
 				nw_array[i] = nw_array[i].substr(nw_array[i].indexOf('--')+2);
+				aux[3] = nw_array[i].substr(0, nw_array[i].indexOf('--'));
+				nw_array[i] = nw_array[i].substr(nw_array[i].indexOf('--')+2);
 				aux[1] = nw_array[i].substr(0, nw_array[i].indexOf('--'));
 				aux[2] = nw_array[i].substr(nw_array[i].indexOf('--')+2);
@@ -341,12 +343,16 @@
 			{
 				var aux = nw_array[i].split("--");
-			}
-
-			var mailbox = aux[0];
-			var uid_msg = aux[6];
+				aux.splice(4,0,aux[1]);
+				var mailbox = aux.shift();
+				aux.splice(0,1,mailbox);
+			}
+			
+			var mailbox_name = aux[0];
+			var mailbox_id = aux[3];
+			var uid_msg = aux[7];
 			var subject = aux[2];
 			tr.id = uid_msg;
-			tr.setAttribute('name',mailbox);
-			if (aux[5].match("U"))
+			tr.setAttribute('name',mailbox_id);
+			if (aux[6].match("U"))
 				add_className(tr,'tr_msg_unread');
 			add_className(tr, i%2 != 0 ? 'tr_msg_read2' : 'tr_msg_read');
@@ -364,7 +370,7 @@
 				{
 					td.style.width = "2%";
-					if (aux[5].match('T'))
+					if (aux[6].match('T'))
 					{
-						attachNum = parseInt(aux[5].substr(aux[5].indexOf('T')+1));
+						attachNum = parseInt(aux[6].substr(aux[6].indexOf('T')+1));
 						td1 = "<img src='templates/"+template+"/images/clip.gif' title='"+attachNum +' '+ get_lang('attachment(s)')+"'>";
 					}
@@ -376,8 +382,8 @@
 					td.style.width = "1%";
 					td.id = "td_message_answered_"+uid_msg;
-					if (aux[5].match('X'))
+					if (aux[6].match('X'))
 						td1 = '<img src=templates/'+template+'/images/forwarded.gif title=Forwarded>';
 					else
-						if (aux[5].match('A'))
+						if (aux[6].match('A'))
 							td1 = '<img src=templates/'+template+'/images/answered.gif>';
 						else
@@ -388,5 +394,5 @@
 					td.style.width = "1%";
 					td.id = "td_message_important_"+uid_msg;
-					if (aux[5].match("F"))
+					if (aux[6].match("F"))
 					{
 						add_className(tr, 'flagged_msg');
@@ -404,5 +410,5 @@
 				if (j == 5)
 				{
-					td.style.width = "14%";
+					td.style.width = "20%";
 					td.onclick = _onclick;
 					var nm_box = aux[0].split(cyrus_delimiter);
@@ -412,7 +418,18 @@
 					td.style.color = "#42795b";
 					td.style.fontWeight = "bold";
-
-					if(td1 == "INBOX"){
-						var td1  = get_lang("Inbox");
+					if(proxy_mensagens.is_local_folder(td1)) {
+						var td1 = this.aux_local_folder_display(td1);
+						aux[2] = tr.name = aux[0]; // precisa trocar pelo nome real no banco do gears.
+					} else {
+						if(td1 == "INBOX"){
+							var td1  = get_lang("Inbox");
+						} 
+						else if (nm_box[0] == 'user') 
+							if (nm_box.length > 1) 
+								var td1 = nm_box[1] + '/' + lang_folder(td1);
+							else 
+								var td1 = td1;
+						else 
+							var td1 = lang_folder(td1);
 					}
 
@@ -423,6 +440,6 @@
 				if( j == 6)
 				{
-					if (aux[1].length > 29)
-						aux[1] = aux[1].substr(0,29) + "...";
+					if (aux[2].length > 29)
+						aux[2] = aux[2].substr(0,29) + "...";
 					td.style.width = "20%";
 					td.onclick = _onclick;
@@ -436,5 +453,5 @@
 					if (! subject_encode)
 						aux[2] = get_lang("no subject") + "...";
-					if (aux[2].length > 70)
+					if (aux[2] > 70)
 						aux[2] = aux[2].substr(0,70) + "...";
 					td.style.width = "35%";
@@ -442,5 +459,5 @@
                                         td.setAttribute("NoWrap","true");
                                         td.style.overflow = "hidden";
-					var td1  = aux[2];
+					var td1  = subject;
 
 				}
@@ -450,5 +467,5 @@
 					td.align = "center";
 					td.onclick = _onclick;
-					var td1  = aux[3];
+					var td1  = aux[4];
 				}
 				if( j == 9)
@@ -457,11 +474,11 @@
 					td.align = "center";
 					td.onclick = _onclick;
-					var td1  = aux[4];
+					var td1  = aux[5];
 				}
 				if (j == 10)
 				{
-					if (aux[5].match("U"))
+					if (aux[6].match("U"))
 						add_className(tr, 'tr_msg_unread');
-					if (aux[5].match("F"))
+					if (aux[7].match("F"))
 						add_className(tr, 'flagged_msg');
 					var td1 = '';
@@ -472,5 +489,5 @@
 			aux.splice(0,(aux.length));
 
-		_dragArea.makeDragged(tr, uid_msg, subject, true, mailbox);
+		_dragArea.makeDragged(tr, uid_msg, subject, true, mailbox_id);
 		tbody.appendChild(tr);
 		}
@@ -507,5 +524,5 @@
 		tr_element.className = "message_header";
 		td_element0 = document.createElement("TD");
-		td_element0.setAttribute("width", "1%");
+		td_element0.setAttribute("width", "6%");
 		chk_box_element = document.createElement("INPUT");
 		chk_box_element.id  = "chk_box_select_all_messages";
@@ -641,5 +658,5 @@
 	}
 
-	searchE.prototype.open_msg = function(mailbox, uid_msg, subject){
+	searchE.prototype.open_msg = function(mailbox_id, uid_msg, subject){
 		var handler_get_msg = function(data){
 			if(Element("border_id_" + uid_msg + "_r")){alert(get_lang("This message is already opened!"));}
@@ -647,5 +664,5 @@
 			//set_msg_as_read(msgs_to_set[i], false);
 		}
-		proxy_mensagens.get_msg(uid_msg,mailbox,false,handler_get_msg);
+		proxy_mensagens.get_msg(uid_msg,mailbox_id,false,handler_get_msg);
 		/*var args   = "$this.imap_functions.get_info_msg";
 		var params = "msg_number=" + uid_msg + "&msg_folder=" + mailbox;
