Index: /trunk/expressoMail1_2/js/mail_archiver.js
===================================================================
--- /trunk/expressoMail1_2/js/mail_archiver.js	(revision 7459)
+++ /trunk/expressoMail1_2/js/mail_archiver.js	(revision 7468)
@@ -171,4 +171,5 @@
     this.selectedfolder = null;
     this.allmessagesbyfolder = new Array();
+    this.allcompletemessagesbyfolder = new Array();
     this.isArchiveOperation = false; //Se estiver em andamento uma operaÃ§Ã£o de arquivamento/desarquivamento.
     //Contadores da aba de listagem de mensagem
@@ -644,8 +645,8 @@
         //Both XDomainRequest and XMLHttpRequest L2 supports onload event
         UnarchiveReqHandler.handler.onload = function(){            
-            for (var w=0; w < expresso_mail_archive.messageslisted.length; w++){
+            for (var w=0; w < expresso_mail_archive.allcompletemessagesbyfolder.length; w++){
                                 
-                if(expresso_mail_archive.messageslisted[w]["msg_number"] == expresso_mail_archive.message_list[expresso_mail_archive.unarchivecounter]){
-                    var timestamp = expresso_mail_archive.messageslisted[w]["timestamp"];
+                if(expresso_mail_archive.allcompletemessagesbyfolder[w]["msg_number"] == expresso_mail_archive.message_list[expresso_mail_archive.unarchivecounter]){
+                    var timestamp = expresso_mail_archive.allcompletemessagesbyfolder[w]["timestamp"];
                     
                     //Get local tagged message data
@@ -653,12 +654,12 @@
                     
                     //Forwarded is special one: marks as "answered" and "draft"
-                    if(expresso_mail_archive.messageslisted[w]["Forwarded"]){
-                        if(expresso_mail_archive.messageslisted[w]["Forwarded"] == 'F')
+                    if(expresso_mail_archive.allcompletemessagesbyfolder[w]["Forwarded"]){
+                        if(expresso_mail_archive.allcompletemessagesbyfolder[w]["Forwarded"] == 'F')
                             flags += 'A:X'+':';                                  
                     }
                     else{
                         //Answered tag
-                        if(expresso_mail_archive.messageslisted[w]["Answered"])
-                            if(expresso_mail_archive.messageslisted[w]["Answered"] == 'A')
+                        if(expresso_mail_archive.allcompletemessagesbyfolder[w]["Answered"])
+                            if(expresso_mail_archive.allcompletemessagesbyfolder[w]["Answered"] == 'A')
                                 flags += 'A'+':';
                             else
@@ -668,6 +669,6 @@
 
                         //Draft tag
-                        if(expresso_mail_archive.messageslisted[w]["Draft"])
-                            if(expresso_mail_archive.messageslisted[w]["Draft"] == 'X')
+                        if(expresso_mail_archive.allcompletemessagesbyfolder[w]["Draft"])
+                            if(expresso_mail_archive.allcompletemessagesbyfolder[w]["Draft"] == 'X')
                                 flags += 'D'+':';                    
                             else
@@ -678,6 +679,6 @@
                     
                     //Flagged tag
-                    if(expresso_mail_archive.messageslisted[w]["Flagged"])
-                        if(expresso_mail_archive.messageslisted[w]["Flagged"] == 'F')
+                    if(expresso_mail_archive.allcompletemessagesbyfolder[w]["Flagged"])
+                        if(expresso_mail_archive.allcompletemessagesbyfolder[w]["Flagged"] == 'F')
                             flags += 'F'+':';                                        
                         else
@@ -687,6 +688,6 @@
                     
                     //Unseen tag
-                    if(expresso_mail_archive.messageslisted[w]["Unseen"])
-                        if(expresso_mail_archive.messageslisted[w]["Unseen"] == 'U')
+                    if(expresso_mail_archive.allcompletemessagesbyfolder[w]["Unseen"])
+                        if(expresso_mail_archive.allcompletemessagesbyfolder[w]["Unseen"] == 'U')
                             flags += 'U';     
                         else
@@ -710,12 +711,4 @@
             "&flags="       + flags +
             "&id="          + id;
-
-            //Decrementa valor total de nÃ£o lidas/total de mensagens na aba de listagem de mensagens
-            if(flags.indexOf("U") != -1){
-                expresso_mail_archive.tot_unseen_msgs_tab -= 1;
-                Element('new_m').innerHTML = '<font color="RED">'+expresso_mail_archive.tot_unseen_msgs_tab+'</font>';
-            }
-            expresso_mail_archive.tot_msgs_tab -= 1;
-            Element("tot_m").innerHTML = expresso_mail_archive.tot_msgs_tab; //folder_num_msgs;
 
             var handler_unarchive = function(data){
@@ -1411,5 +1404,4 @@
         else
             var query_messages = '{"query":{"folder":[{"@id":"'+folderid+'"}], "tags":[{"@contains":"'+searchType+'"}], "order":[{"@asc":"date"}]}}';
-        console.log(query_messages);
         ArchiveServices.listMessages(expresso_mail_archive.listAllMessagesByFolderOperationOK, expresso_mail_archive.listAllMessagesByFolderOperationFailure, expresso_mail_archive.session.id, query_messages);
     }
@@ -1422,14 +1414,19 @@
 MailArchiver.prototype.listAllMessagesByFolderOperationOK = function(returnService){
     var msglist = new Array();
+    var msglistcomplete = new Array();
     for(var i=0; i< returnService.getReturn().length; i++){
+        //Array montado apenas com ids para tratamento de seleÃ§Ã£o de mensagens independente de paginaÃ§Ã£o
         msglist.push(returnService.getReturn()[i]._id);
+        //Incremento de contadores para atualizaÃ§Ã£o da aba de listagem
         if(returnService.getReturn()[i]._tags.indexOf("unseen") != -1){
             expresso_mail_archive.tot_unseen_msgs_tab++;
         }
         expresso_mail_archive.tot_msgs_tab++;
-        //console.log(returnService.getReturn()[i]);
-    }
-    //console.log(msglist);
+        //Array montado para operaÃ§Ã£o de desarquivamento
+        var ExpSerialized = expresso_mail_archive.pattern.toExpressoHeader(returnService.getReturn()[i]);
+        msglistcomplete.push(connector.unserialize(ExpSerialized));
+    }
     expresso_mail_archive.allmessagesbyfolder = msglist;
+    expresso_mail_archive.allcompletemessagesbyfolder = msglistcomplete;
 }
 
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 7455)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 7468)
@@ -208,5 +208,4 @@
                         //tree_folders.getNodeById("local_disabled").alter({caption:get_lang('List_Folders')});
                                                 
-                       //expresso_mail_archive.getFoldersList('FERNANDAO22', "");
                        var drawinginfo = {treeObject: tree_folders, treeName: 'tree_folders'};
                        expresso_mail_archive.drawdata = drawinginfo;
