Index: trunk/expressoMail1_2/js/mail_archiver.js
===================================================================
--- trunk/expressoMail1_2/js/mail_archiver.js	(revision 8067)
+++ trunk/expressoMail1_2/js/mail_archiver.js	(revision 8112)
@@ -427,14 +427,18 @@
            
                 var fcaption = "";
-                
-                if(destination_folder.substr(0,5) == 'local'){
-                    expresso_mail_archive.folder_destination = destination_folder.replace("local_messages_","");
-                }
-                else{
-                    expresso_mail_archive.folder_destination = destination_folder;
-                }
+
+                // tratado o caso do id da pasta vir com local_messages_ ou messages_
+                var local_folder_id = destination_folder;
+                if(local_folder_id){
+                    if(local_folder_id.substr(0,5) == 'local'){
+                        local_folder_id = local_folder_id.replace("local_messages_","");
+                    } else if(local_folder_id.substr(0,8) == 'messages'){
+                        local_folder_id = local_folder_id.replace("messages_","");
+                    }
+                }      
+
                 
                 if(!expresso_mail_archive.archivefolder){
-                    expresso_mail_archive.getFolderInfo(expresso_mail_archive.folder_destination);
+                    expresso_mail_archive.getFolderInfo(local_folder_id);
                     if(typeof(expresso_mail_archive.folder) != "undefined"){
                         //window.alert('folder.path -> ' + expresso_mail_archive.folder.path);
@@ -599,5 +603,16 @@
                 expresso_mail_archive.unarchivecounter = 0;
                 expresso_mail_archive.unarchive_error_counter=0;
-                expresso_mail_archive.getFolderInfo(folder.replace("local_messages_",""));
+
+                // tratado o caso do id da pasta vir com local_messages_ ou messages_
+                var local_folder_id = folder;      
+                if(local_folder_id){
+                    if(local_folder_id.substr(0,5) == 'local'){
+                        local_folder_id = local_folder_id.replace("local_messages_","");
+                    } else if(local_folder_id.substr(0,8) == 'messages'){
+                        local_folder_id = local_folder_id.replace("messages_","");
+                    }
+                } 
+
+                expresso_mail_archive.getFolderInfo(local_folder_id);
                 expresso_mail_archive.unarchievefolder = expresso_mail_archive.folder.name;
                 (new_folder != null)?expresso_mail_archive.unarchievenewfolder = new_folder:expresso_mail_archive.unarchievenewfolder='INBOX';
@@ -792,5 +807,16 @@
                 expresso_mail_archive.unarchivecounter = 0;
                 expresso_mail_archive.unarchive_error_counter=0;
-                expresso_mail_archive.getFolderInfo(folder.replace("local_messages_",""));
+
+                // tratado o caso do id da pasta vir com local_messages_ ou messages_
+                var local_folder_id = folder;      
+                if(local_folder_id){
+                    if(local_folder_id.substr(0,5) == 'local'){
+                        local_folder_id = local_folder_id.replace("local_messages_","");
+                    } else if(local_folder_id.substr(0,8) == 'messages'){
+                        local_folder_id = local_folder_id.replace("messages_","");
+                    }
+                } 
+
+                expresso_mail_archive.getFolderInfo(local_folder_id);
                 expresso_mail_archive.unarchievefolder = expresso_mail_archive.folder.name;
                 (new_folder != null)?expresso_mail_archive.unarchievenewfolder = new_folder:expresso_mail_archive.unarchievenewfolder='INBOX';
@@ -1047,7 +1073,15 @@
     expresso_mail_archive.message_list = new Array();
 
-    expresso_mail_archive.currentfolder = folder.replace("local_messages_","");
-
-    expresso_mail_archive.listMessages(expresso_mail_archive.currentfolder);
+    // tratado o caso do id da pasta vir com local_messages_ ou messages_
+    var local_folder_id = folder;      
+    if(local_folder_id){
+        if(local_folder_id.substr(0,5) == 'local'){
+            local_folder_id = local_folder_id.replace("local_messages_","");
+        } else if(local_folder_id.substr(0,8) == 'messages'){
+            local_folder_id = local_folder_id.replace("messages_","");
+        }
+    } 
+
+    expresso_mail_archive.listMessages(local_folder_id);
 
     // This is necessary 'couse we can get a delete operation while an unarchive operation
@@ -1157,7 +1191,27 @@
         expresso_mail_archive.message_list = new Array();  
 
-        expresso_mail_archive.getFolderInfo(expresso_mail_archive.currentfolder);
-        expresso_mail_archive.getFolderInfo(expresso_mail_archive.folder_destination);
-        expresso_mail_archive.listMessages(expresso_mail_archive.currentfolder); 
+        // tratado o caso do id da pasta vir com local_messages_ ou messages_
+        var local_folder_id = expresso_mail_archive.currentfolder;      
+        if(local_folder_id){
+            if(local_folder_id.substr(0,5) == 'local'){
+                local_folder_id = local_folder_id.replace("local_messages_","");
+            } else if(local_folder_id.substr(0,8) == 'messages'){
+                local_folder_id = local_folder_id.replace("messages_","");
+            }
+        } 
+
+        // tratado o caso do id da pasta vir com local_messages_ ou messages_
+        var local_folder_id_destination = expresso_mail_archive.folder_destination;
+        if(local_folder_id_destination){
+            if(local_folder_id_destination.substr(0,5) == 'local'){
+                local_folder_id_destination = local_folder_id_destination.replace("local_messages_","");
+            } else if(local_folder_id_destination.substr(0,8) == 'messages'){
+                local_folder_id_destination = local_folder_id_destination.replace("messages_","");
+            }
+        }
+
+        expresso_mail_archive.getFolderInfo(local_folder_id);
+        expresso_mail_archive.getFolderInfo(local_folder_id_destination);
+        expresso_mail_archive.listMessages(local_folder_id); 
               
         expresso_mail_archive.resetObject();
@@ -1495,6 +1549,17 @@
 MailArchiver.prototype.deleteAllMessages = function(folderId){
     try{
+
+        // tratado o caso do id da pasta vir com local_messages_ ou messages_
+        var local_folder_id = folderid;
+        if(local_folder_id){
+            if(local_folder_id.substr(0,5) == 'local'){
+                local_folder_id = local_folder_id.replace("local_messages_","");
+            } else if(local_folder_id.substr(0,8) == 'messages'){
+                local_folder_id = local_folder_id.replace("messages_","");
+            }
+        }
+        
         var objfolder = new Object();
-        objfolder.folder = folderId;
+        objfolder.folder = local_folder_id;
 
         var query_data = expresso_mail_archive.queryconfig.query(objfolder);
@@ -1534,10 +1599,22 @@
             folderid = this.currentfolder;    
         }
+
+        // tratado o caso do id da pasta vir com local_messages_ ou messages_
+        var local_folder_id = folderid;
+        if(local_folder_id){
+            if(local_folder_id.substr(0,5) == 'local'){
+                local_folder_id = local_folder_id.replace("local_messages_","");
+            } else if(local_folder_id.substr(0,8) == 'messages'){
+                local_folder_id = local_folder_id.replace("messages_","");
+            }
+        }
+        
         var objfolder = new Object();
-        objfolder.folder = folderid;
+        objfolder.folder = local_folder_id;
         //var testing_data_xml = '<?xml version="1.0" encoding="UTF-8"?><query lowerIndex="0" upperIndex="50"><folder id="'+folderid+'"/><order asc="date"/><order desc="subject"/></query>';
         //var testing_data_json_mapped = '{"query":{"@lowerIndex":"0", "@upperIndex":"50", "folder":[{"@id":"'+folderid+'"}], "order":[{"@asc":"date", "@desc":"subject"}]}}';
         var query_data = expresso_mail_archive.queryconfig.query(objfolder);
-        expresso_mail_archive.getFolderInfo(folderid);
+
+        expresso_mail_archive.getFolderInfo(local_folder_id);
         expresso_mail_archive.currentfolder = folderid;
         
Index: trunk/expressoMail1_2/js/abas.js
===================================================================
--- trunk/expressoMail1_2/js/abas.js	(revision 8063)
+++ trunk/expressoMail1_2/js/abas.js	(revision 8112)
@@ -333,5 +333,5 @@
                         //accept: ".draggin_mail",
                         drop : function(event, ui){
-                            $(this).css("border", "");
+                            $(this).css("border", "0");
                             if($(this).parent().attr('id') == undefined){
                                 var folder_to = 'INBOX';
Index: trunk/expressoMail1_2/js/main.js
===================================================================
--- trunk/expressoMail1_2/js/main.js	(revision 8109)
+++ trunk/expressoMail1_2/js/main.js	(revision 8112)
@@ -1611,5 +1611,6 @@
                 //expresso_mail_archive.moveMessages(new_folder.substr(6), msgs_number);
                 expresso_mail_archive.moveMessages(new_folder.replace('local_messages_', ''), msgs_number);
-                delete_border(border_ID);
+                if(currentTab != 0)
+                	delete_border(border_ID);
             }
             else{
@@ -4885,5 +4886,4 @@
 											var local_folder = input_hidden.attr("value"); //recupera a pasta selecionada
 											if(local_folder.indexOf("local_") == 0){ //verifica se a pasta selecionada é uma pasta local
-
 												var fdata = local_folder.substr(15, local_folder.length); //recupera somente a estrutura da pasta ou o id
 												expresso_mail_archive.getFolderInfo(fdata); //recuperar a estrutura da pasta, 
Index: trunk/expressoMail1_2/js/messages_controller.js
===================================================================
--- trunk/expressoMail1_2/js/messages_controller.js	(revision 8097)
+++ trunk/expressoMail1_2/js/messages_controller.js	(revision 8112)
@@ -12,5 +12,14 @@
         if(this.is_local_folder(folder)) {
             //MAILARCHIVER-01
-            var baseFolder = folder.replace('local_messages_', '');
+            // tratado o caso do id da pasta vir com local_messages_ ou messages_
+            var baseFolder = folder;
+            if(baseFolder){
+                if(baseFolder.substr(0,5) == 'local'){
+                    baseFolder = baseFolder.replace("local_messages_","");
+                } else if(baseFolder.substr(0,8) == 'messages'){
+                    baseFolder = baseFolder.replace("messages_","");
+                }  
+            }   
+
             var tree_name;
             var drawinginfo = {};
Index: trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- trunk/expressoMail1_2/js/draw_api.js	(revision 8099)
+++ trunk/expressoMail1_2/js/draw_api.js	(revision 8112)
@@ -1669,5 +1669,5 @@
 							//accept: ".draggin_mail",
 							drop : function(event, ui){
-								$(this).css("border", "");
+								$(this).css("border", "0");
 								if($(this).parent().attr('id') == undefined){
 									var folder_to = 'INBOX';
