Index: /sandbox/2.4.2-expresso2/library/ckeditor/plugins/expresso/plugin.js
===================================================================
--- /sandbox/2.4.2-expresso2/library/ckeditor/plugins/expresso/plugin.js	(revision 6410)
+++ /sandbox/2.4.2-expresso2/library/ckeditor/plugins/expresso/plugin.js	(revision 6776)
@@ -132,23 +132,19 @@
 				}, 5000);
 			}
-
+            fileUploadMSG.find(' .attachments-list').show();
 			$.each(data.files, function (index, file) {	
 				var attach = {};
 				attach.fullFileName = file.name;
 				attach.fileName = file.name;
-				if(file.name.length > 10)
-					attach.fileName = file.name.substr(0, 18) + "..." + file.name.substr(file.name.length-9, file.name.length);
+				if(file.name.length > 20)
+					attach.fileName = file.name.substr(0, 17) + "..." + file.name.substr(file.name.length-9, file.name.length);
 				attach.fileSize = formatBytes(file.size);
 				if(maxAttachmentSize && file.size > maxAttachmentSize)
 					attach.error = 'Tamanho de arquivo nao permitido!!'
-								
+				else
+                    attach.error = true;
 				var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));	
 
-				upload.find('.button.close').button({
-					icons: {
-						primary: "ui-icon-close"
-					},
-					text: false
-				}).click(function(){
+				upload.find('.att-box-delete').click(function(){
 					var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
 			
@@ -165,9 +161,40 @@
                     $('.attachments-list').find('input[value="'+idAttach+'"]').remove();
                     delAttachment(ID, idAttach);
-					$(this).parent().remove();
+					$(this).parent().qtip("destroy");
+                    $(this).parent().remove();
+                    if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){
+                        fileUploadMSG.find(' .attachments-list').hide();
+                    }
 				});
                                 
             fileUploadMSG.find('.attachments-list').append(upload);
-
+            fileUploadMSG.find('.attachments-list .att-box:last').qtip({
+                content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}),
+                position: {
+                    corner: {
+                        tooltip: 'bottomMiddle',
+                        target: 'topMiddle'
+                    },
+                    adjust: {
+                       resize: true,
+                       scroll: true
+                    }
+                },
+                show: {
+                    when: 'mouseover', // Don't specify a show event
+                    ready: false // Show the tooltip when ready
+                },
+                hide: 'mouseout', // Don't specify a hide event
+                style: {
+                    border: {
+                        width: 1,
+                        radius: 5
+                    },
+                    padding: 3, 
+                    textAlign: 'left',
+                    tip: true, // Give it a speech bubble tip with automatic corner detection
+                    name: (typeof(attach.error) == 'boolean' ? 'light' : 'red') // Style it according to the preset 'cream' style
+                }
+            });
 			if(!maxAttachmentSize || file.size < maxAttachmentSize){
 				if(data.fileInput){
@@ -186,28 +213,58 @@
 		},
 		done: function(e, data){
-			if(!!data.result && data.result != "[]"){
-				var newAttach = data.result;
-				if(!newAttach.mailAttachment.error){
-					if(newAttach.rollback !== false)
-					{
-						fileUploadMSG.find('.in-progress:first').parents('p').append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>').find('.status-upload').addClass('ui-icon ui-icon-check');
-						addAttachment(ID,newAttach['mailAttachment'][0][0].id);
-						var content_body  = RichTextEditor.getData('body_'+ID);
-						var rex = new RegExp('<img src="" [^\/>]*\/>', 'i'); 
-						var newImg = '<img src="../prototype/getArchive.php?mailAttachment='+newAttach['mailAttachment'][0][0].id+'" />'; 
-						content_body = content_body.replace(rex,newImg); 
-						RichTextEditor.setData('body_'+ID,content_body); 
-					}
-					else
-						fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');   
+            var attach_box = fileUploadMSG.find('.att-box-loading:first').parents('.att-box');
+            var attach = {
+                fullFileName : attach_box.find(".att-box-fullfilename").text(),
+                fileSize : attach_box.find(".att-box-filesize").text(),
+                OK : true,
+                error : false
+            };
+            if(!!data.result && data.result != "[]" ){
+                var newAttach = data.result;                             
+                if(!newAttach.mailAttachment.error || newAttach.rollback !== false){
+					attach_box.append('<input type="hidden" name="fileId[]" value="'+newAttach['mailAttachment'][0][0].id+'"/>');
+					addAttachment(ID,newAttach['mailAttachment'][0][0].id);
+					var content_body  = RichTextEditor.getData('body_'+ID);
+					var rex = new RegExp('<img src="" [^\/>]*\/>', 'i'); 
+					var newImg = '<img src="../prototype/getArchive.php?mailAttachment='+newAttach['mailAttachment'][0][0].id+'" />'; 
+					content_body = content_body.replace(rex,newImg); 
+					RichTextEditor.setData('body_'+ID,content_body); 
 				}else{
-					fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append(newAttach.mailAttachment.error).addClass('message-attach-error');   
-				}
-			}else 
-			{
-            	fileUploadMSG.find('.in-progress:first').parents('p').find('.status-upload').append('Erro ao fazer upload!').addClass('message-attach-error');   
-			}
-			fileUploadMSG.find('.in-progress:first').remove();
-                    
+					attach_box.addClass('invalid-email-box');
+                    attach.error = newAttach.mailAttachment.error ? newAttach.mailAttachment.error : 'Erro ao anexar...';
+                }
+			}else {
+                attach_box.addClass('invalid-email-box');
+                attach.error = 'Erro ao anexar...';
+            }
+            attach_box.qtip("destroy").qtip({
+                content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}),
+                position: {
+                    corner: {
+                        tooltip: 'bottomMiddle',
+                        target: 'topMiddle'
+                    },
+                    adjust: {
+                       resize: true,
+                       scroll: true
+                    }
+                },
+                show: {
+                    when: 'mouseover', // Don't specify a show event
+                    ready: false // Show the tooltip when ready
+                },
+                hide: 'mouseout', // Don't specify a hide event
+                style: {
+                    border: {
+                        width: 1,
+                        radius: 5
+                    },
+                    padding: 3, 
+                    textAlign: 'left',
+                    tip: true, // Give it a speech bubble tip with automatic corner detection
+                    name: (attach.error == false ? 'blue' : 'red')// Style it according to the preset 'cream' style
+                }
+            });
+            fileUploadMSG.find(' .att-box-loading:first').remove();
 		}
 	});
Index: /sandbox/2.4.2-expresso2/expressoMail1_2/js/main.js
===================================================================
--- /sandbox/2.4.2-expresso2/expressoMail1_2/js/main.js	(revision 6762)
+++ /sandbox/2.4.2-expresso2/expressoMail1_2/js/main.js	(revision 6776)
@@ -814,5 +814,12 @@
  		         
  		        if (!archive && (parseInt(preferences.save_deleted_msg)) && (folder != userTrashFolder)){ 
- 		                move_msgs2(folder, msgs_number, border_ID, userTrashFolder,special_folders['Trash'],show_success_msg ); 
+                    var msgs = new Array();
+                    var i = 0;
+                    $.each(selectedMessages, function(index, value){
+                        if(value)
+                            msgs[i++] = index;
+                    });
+                    msgs_number = msgs.join();
+ 		            move_msgs2(folder, msgs_number, border_ID, userTrashFolder,special_folders['Trash'],show_success_msg ); 
 				return;
 	}
@@ -2163,21 +2170,16 @@
 				    var attach = {};
 				    attach.fileName =  attachments[i].text.substring(0, attachments[i].text.lastIndexOf('('));
-
-				    if(attach.fileName.length > 45)
-					attach.fileName = attach.fileName.substr(0, 32) + " ... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
+                    attach.fullFileName = attach.fileName;
+				    if(attach.fileName.length > 20)
+					attach.fileName = attach.fileName.substr(0, 17) + " ... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
 
 				    attach.fileSize =  attachments[i].text.substring(( attachments[i].text.lastIndexOf('(')+1), attachments[i].text.lastIndexOf(')'));
 
+                    attach.error = false;
+                    fileUploadMSG.find(' .attachments-list').show();
 				    var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
-				    upload.find('.status-upload').remove();
-				    upload.find('.in-progress').remove(); 
 				    upload.append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>');
-				    upload.find('.button.close').button({
-					    icons: {
-						    primary: "ui-icon-close"
-					    },
-					    text: false
-
-				    }).click(function(){
+                    upload.find(".att-box-loading").remove();
+				    upload.find('.att-box-delete').click(function(){
 					    var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
 					    var content_body = RichTextEditor.getData('body_'+new_border_ID);
@@ -2195,8 +2197,40 @@
 					    fileUploadMSG.find('.attachments-list').find('input[value="'+idAttach+'"]');
 					    delAttachment(new_border_ID,idAttach); 
-					    $(this).parent().remove();
+					    $(this).parent().qtip("destroy");
+                        $(this).parent().remove();
+                        if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){
+                            fileUploadMSG.find(' .attachments-list').hide();
+                        }
 				    });
 
 				    fileUploadMSG.find('.attachments-list').append(upload);
+                    fileUploadMSG.find('.attachments-list .att-box:last').qtip({
+                        content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}),
+                        position: {
+                            corner: {
+                                tooltip: 'bottomMiddle',
+                                target: 'topMiddle'
+                            },
+                            adjust: {
+                               resize: true,
+                               scroll: true
+                            }
+                        },
+                        show: {
+                            when: 'mouseover', // Don't specify a show event
+                            ready: false // Show the tooltip when ready
+                        },
+                        hide: 'mouseout', // Don't specify a hide event
+                        style: {
+                            border: {
+                                width: 1,
+                                radius: 5
+                            },
+                            padding: 3, 
+                            textAlign: 'left',
+                            tip: true, // Give it a speech bubble tip with automatic corner detection
+                            name: 'blue' // Style it according to the preset 'cream' style
+                        }
+                    });
 				}
 				else
@@ -2221,22 +2255,16 @@
 				    var attach = {};
 				    attach.fileName =  arrayAttachmentsA[i].text.substring(0, arrayAttachmentsA[i].text.lastIndexOf('('));
-
-				    if(attach.fileName.length > 45)
-					attach.fileName = attach.fileName.substr(0, 32) + " ... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
+                    attach.fullFileName = attach.fileName;
+				    if(attach.fileName.length > 20)
+					attach.fileName = attach.fileName.substr(0, 17) + " ... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
 
 				    attach.fileSize =  arrayAttachmentsA[i].text.substring(( arrayAttachmentsA[i].text.lastIndexOf('(')+1), arrayAttachmentsA[i].text.lastIndexOf(')'));
-
+                    attach.error = false;
+                    fileUploadMSG.find(' .attachments-list').show();
 				    var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
-				    upload.find('.status-upload').remove();
-				    upload.find('.in-progress').remove(); 
+				    upload.find('.att-box-loading').remove(); 
 				    upload.append('<input type="hidden" name="fileId[]" value=\''+arrayAttachments[i]+'\'/>');
-				    upload.find('.button.close').button({
-					    icons: {
-						    primary: "ui-icon-close"
-					    },
-					    text: false
-
-				    }).click(function(){
-					    var idAttach = $(this).parent().parent().find('input[name="fileId[]"]').val();
+				    upload.find('.att-box-delete').click(function(){
+					    var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
 					    var content_body = RichTextEditor.getData('body_'+new_border_ID);
 					    var imagens = content_body.match(/<img[^>]*>/g);
@@ -2253,9 +2281,40 @@
 					    fileUploadMSG.find('.attachments-list').find('input[value="'+idAttach+'"]');
 					    delAttachment(new_border_ID,idAttach); 
-					    $(this).parent().remove();
+					    $(this).parent().qtip("destroy");
+                        $(this).parent().remove();
+                        if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){
+                            fileUploadMSG.find(' .attachments-list').hide();
+                        }
 				    });
 
 				    fileUploadMSG.find('.attachments-list').append(upload);
-
+                    fileUploadMSG.find('.attachments-list .att-box:last').qtip({
+                        content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}),
+                        position: {
+                            corner: {
+                                tooltip: 'bottomMiddle',
+                                target: 'topMiddle'
+                            },
+                            adjust: {
+                               resize: true,
+                               scroll: true
+                            }
+                        },
+                        show: {
+                            when: 'mouseover', // Don't specify a show event
+                            ready: false // Show the tooltip when ready
+                        },
+                        hide: 'mouseout', // Don't specify a hide event
+                        style: {
+                            border: {
+                                width: 1,
+                                radius: 5
+                            },
+                            padding: 3, 
+                            textAlign: 'left',
+                            tip: true, // Give it a speech bubble tip with automatic corner detection
+                            name: 'blue' // Style it according to the preset 'cream' style
+                        }
+                    });
 			}
 
@@ -2275,5 +2334,5 @@
             if((attachments[i].tagName=="SPAN") || (attachments[i].tagName=="IMG") || ((attachments[i].href.indexOf("javascript:download_local_attachment")==-1)&&(attachments[i].href.indexOf("javascript:download_attachments")==-1)))
                     continue;
-
+                fileUploadMSG.find(' .attachments-list').show();
                 var arrayAtt = attachments[i].href.replace("javascript:download_attachments(", "").replace(")", "").split(',');                                 
                 var att = new Object();
@@ -2287,41 +2346,70 @@
 
                 var attach = {};
+
                 attach.fileName =  attachments[i].text.substring(0, attachments[i].text.lastIndexOf('('));
-
-                if(attach.fileName.length > 45)
-                    attach.fileName = attach.fileName.substr(0, 32) + " ... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
+                attach.fullFileName = attach.fileName;
+
+                if(attach.fileName.length > 20)
+                    attach.fileName = attach.fileName.substr(0, 17) + " ... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
 
                 attach.fileSize =  attachments[i].text.substring(( attachments[i].text.lastIndexOf('(')+1), attachments[i].text.lastIndexOf(')'));
+                attach.error = false;
 
                 var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
-                upload.find('.status-upload').remove();
-                upload.find('.in-progress').remove(); 
-                upload.find('.button.close').button({
-                        icons: {
-                                primary: "ui-icon-close"
+                upload.find('.att-box-loading').remove(); 
+                upload.find('.att-box-delete').click(function(){
+                    var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
+                    var content_body = RichTextEditor.getData('body_'+new_border_ID);
+                    var imagens = content_body.match(/<img[^>]*>/g);
+                    var att = JSON.parse(idAttach);
+                    if(imagens != null)
+                    {   
+                        for (var x = 0; x < imagens.length; x++)
+                            if(imagens[x].indexOf('src="./inc/get_archive.php?msgFolder='+att.folder+'&amp;msgNumber='+att.uid+'&amp;indexPart='+att.part) !== -1)
+                                content_body = content_body.replace(imagens[x],'');
+
+                         RichTextEditor.setData('body_'+new_border_ID,content_body);    
+                    }       
+
+                    fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]');
+                    delAttachment(new_border_ID,idAttach); 
+                    $(this).parent().qtip("destroy");
+                    $(this).parent().remove();
+                    if(!fileUploadMSG.find(' .attachments-list').find(".att-box").length){
+                        fileUploadMSG.find(' .attachments-list').hide();
+                    }
+                });	
+
+
+                upload.append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>');
+                fileUploadMSG.find('.attachments-list').append(upload);
+                fileUploadMSG.find('.attachments-list .att-box:last').qtip({
+                    content: DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist_tooltip.ejs", {attach : attach}),
+                    position: {
+                        corner: {
+                            tooltip: 'bottomMiddle',
+                            target: 'topMiddle'
                         },
-                        text: false
-                }).click(function(){
-                        var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
-                        var content_body = RichTextEditor.getData('body_'+new_border_ID);
-                        var imagens = content_body.match(/<img[^>]*>/g);
-                        var att = JSON.parse(idAttach);
-                        if(imagens != null)
-                        {   
-                            for (var x = 0; x < imagens.length; x++)
-                                if(imagens[x].indexOf('src="./inc/get_archive.php?msgFolder='+att.folder+'&amp;msgNumber='+att.uid+'&amp;indexPart='+att.part) !== -1)
-                                    content_body = content_body.replace(imagens[x],'');
-
-                             RichTextEditor.setData('body_'+new_border_ID,content_body);    
-                        }       
-
-                        fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]');
-                        delAttachment(new_border_ID,idAttach); 
-                        $(this).parent().remove();
-                });	
-
-
-                upload.find("p").append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>');
-                fileUploadMSG.find('.attachments-list').append(upload);
+                        adjust: {
+                           resize: true,
+                           scroll: true
+                        }
+                    },
+                    show: {
+                        when: 'mouseover', // Don't specify a show event
+                        ready: false // Show the tooltip when ready
+                    },
+                    hide: 'mouseout', // Don't specify a hide event
+                    style: {
+                        border: {
+                            width: 1,
+                            radius: 5
+                        },
+                        padding: 3, 
+                        textAlign: 'left',
+                        tip: true, // Give it a speech bubble tip with automatic corner detection
+                        name: 'blue' // Style it according to the preset 'cream' style
+                    }
+                });
 
     }	                
Index: /sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js
===================================================================
--- /sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js	(revision 6772)
+++ /sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js	(revision 6776)
@@ -4665,5 +4665,6 @@
 								attach.fileName = attach.fileName.substr(0, 17) + "... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
 
-							attach.error = "";
+							attach.error = false;
+                            attach.OK = true;
 							attach.fileSize = formatBytes(onceOpenedMessages[folder_name][message_number].size);
 							var upload = $(DataLayer.render("../prototype/modules/mail/templates/attachment_add_itemlist.ejs", {file : attach}));
