Index: /trunk/prototype/modules/mail/js/foldertree.js
===================================================================
--- /trunk/prototype/modules/mail/js/foldertree.js	(revision 7430)
+++ /trunk/prototype/modules/mail/js/foldertree.js	(revision 7450)
@@ -540,8 +540,36 @@
                         event.stopPropagation();
 
+                    var ok = false;
+                    var makeChildren = function(auxNameFolder, father){
+                        if(auxNameFolder.length == 0) return true;
+
+
+                        if(auxNameFolder[0] == ""){
+                            auxNameFolder.shift();
+                            makeChildren(auxNameFolder, father);
+                            return true;
+                        }
+                        if(ok == false)
+                            expresso_mail_archive.createFolder((father ? father : "inbox"), auxNameFolder[0]);
+                        
+                        expresso_mail_archive.getFoldersList(father);
+
+                        for(var ii =0; ii<expresso_mail_archive.folders.length; ii++){
+                            if(auxNameFolder[0] == expresso_mail_archive.folders[ii].name){
+                                 auxNameFolder.shift();
+                                 save = expresso_mail_archive.folders;
+                                 expresso_mail_archive.createFolder(expresso_mail_archive.folders[ii].id, auxNameFolder[0]);
+                                 expresso_mail_archive.folders = save; 
+                                 ok = true;
+                                 makeChildren(auxNameFolder, expresso_mail_archive.folders[ii].id);
+                                 return true;
+                            }
+                        }
+                    }
+
 
                         if(event.keyCode == 13){
 
-                            if($(this).parent().parent().parent().find("input[type=hidden]").val() == "localFolder"){
+                            if($(this).parents("li").find("input[type=hidden]").val() == "localFolder"){
 
                                  $(".new_folder").parent().addClass("folders-loading");
@@ -550,5 +578,14 @@
                                  var folder = (folderName != "" ? folderName : get_lang("New Folder"));
 
-                                 create_new_local_folder((selected_li.attr('id') ? selected_li.attr('id') : "inbox") , folder);
+                                 if(folderName.indexOf("/") != -1){
+                                    auxNameFolder = folderName.split("/");
+                                    var father = typeof(selected_li.attr('id')) != "undefined" ? selected_li.attr('id').split("_")[2] : "home";
+
+                                    makeChildren(auxNameFolder, father);
+                                 } else {
+                                     var folder = (folderName != "" ? folderName : get_lang("New Folder"));
+                                     create_new_local_folder((selected_li.attr('id') ? selected_li.attr('id') : "inbox") , folder);
+                                 }
+
                                  cExecute("$this.imap_functions.get_folders_list&onload=true", update_menu);
                             } else {
Index: /trunk/expressoMail1_2/js/mail_archiver.js
===================================================================
--- /trunk/expressoMail1_2/js/mail_archiver.js	(revision 7449)
+++ /trunk/expressoMail1_2/js/mail_archiver.js	(revision 7450)
@@ -1172,4 +1172,7 @@
 //createFolder operation
 MailArchiver.prototype.createFolder = function(parentFolder, folderName){
+    if(typeof(folderName) == "undefined"){
+        return false;
+    }
     
     try{
@@ -1211,8 +1214,8 @@
     write_msg(get_lang("The local folder \"%1\" was successfully removed", expresso_mail_archive.drawdata.folderName));
     connector.purgeCache();
-    ttreeBox.name_folder = "root";
-    ttreeBox.update_folder();
+    //ttreeBox.name_folder = "root";
+    //ttreeBox.update_folder();
     draw_tree_local_folders();
-    ttreeBox.update_folder();	
+    //ttreeBox.update_folder();	
 }
 
Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 7449)
+++ /trunk/expressoMail1_2/js/main.js	(revision 7450)
@@ -4879,9 +4879,6 @@
 function create_new_local_folder(parentFolderId, name){
 
-    if(typeof(parentFolderId) == "string"){
         parentFolderId = parentFolderId.split("_");
         var parentName = parentFolderId[2];
-    }
-    
 
     expresso_mail_archive.createFolder(parentName, name);
