Index: sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js
===================================================================
--- sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js	(revision 6795)
+++ sandbox/2.4.2-expresso2/expressoMail1_2/js/draw_api.js	(revision 6796)
@@ -4534,9 +4534,10 @@
 		},	
 		add: function (e, data) {
+            var jqXHR;
 			if(!maxAttachmentSize || data.files[0].size < maxAttachmentSize || is_ie) {
 				setTimeout(function() {
                     $('#attDisposition'+ID).val('attachment');
-					data.submit();
-				}, 3000);
+					jqXHR = data.submit();
+				}, 100);
 			}
 			fileUploadMSG.find(' .attachments-list').show();
@@ -4562,4 +4563,7 @@
 						fileUploadMSG.find(' .attachments-list').hide();
 					}
+                    if(jqXHR){
+                        jqXHR.abort();
+                    }
 				});
                    
@@ -4593,5 +4597,9 @@
 						name: (typeof(attach.error) == 'boolean' ? 'light' : 'red') // Style it according to the preset 'cream' style
 					}
-                });
+                })/*.progressbar({
+                    value : 1
+                })*/;
+
+                fileUploadMSG.find('.attachments-list .att-box:last').css('width', fileUploadMSG.find('.attachments-list .att-box:last div:first').css('width'));
 
 				if(!maxAttachmentSize || file.size < maxAttachmentSize){
@@ -4652,7 +4660,15 @@
                     name: (attach.error == false ? 'blue' : 'red')// Style it according to the preset 'cream' style
                 }
+            });/*
+            fileUploadMSG.find(".att-box-loading:first").parents(".att-box").removeAttr("style").progressbar("destroy").find("div:first").removeAttr("style");
+            */
+            fileUploadMSG.find('.att-box-loading:first').remove();
+		}/*,
+        progress : function(e, data){
+            var progress = parseInt(data.loaded / data.total * 100, 10);
+            fileUploadMSG.find('.att-box-loading:first').parents(".att-box:first").progressbar({
+                value : progress
             });
-            fileUploadMSG.find(' .att-box-loading:first').remove();
-		}
+        }*/
 	}).css({
 		"height" : "20px", 
@@ -4672,89 +4688,85 @@
 			close:function(event, ui) {event.stopPropagation();},
 			autoOpen:false
+	});
+	jQuery.getScript("../prototype/modules/attach_message/attach_message.js", function(){
+		jQuery('#message-attach-dialog').dialog('open');
+		jQuery('#message-attach-attach-btn').unbind('click');
+		jQuery('#message-attach-attach-btn').click(function(event){
+			jQuery.each(selectedMessages, function(folder_name, messages) {
+				jQuery.each(selectedMessages[folder_name], function(message_number, message) { 
+					if (message) {
+						fileUploadMSG.find(' .attachments-list').show();	
+						var att = new Object();
+						att.folder = folder_name;
+						att.uid = message_number;
+						att.type = 'imapMSG';
+						att.name = Base64.encode(onceOpenedMessages[folder_name][message_number].subject + '.eml');
+						var idATT = JSON.stringify(att);
+						addAttachment( ID , idATT);                        
+						var attach = {};
+						attach.fileName = onceOpenedMessages[folder_name][message_number].subject + '.eml';
+						attach.fullFileName = onceOpenedMessages[folder_name][message_number].subject + '.eml';
+						if(attach.fileName.length > 20)
+							attach.fileName = attach.fileName.substr(0, 17) + "... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
+
+						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}));
+						upload.find('.att-box-loading').remove();
+						upload.append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>');
+						
+						upload.find('.att-box-delete').click(function(){
+							var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
+							fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove();
+							delAttachment(ID,idAttach); 
+							$(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);
+
+						upload.find('.att-box-loading').remove();
+
+						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: 5, 
+								textAlign: 'center',
+								tip: true, // Give it a speech bubble tip with automatic corner detection
+								name: 'blue' // Style it according to the preset 'cream' style
+							}
+		                });
+					}
+				});
+			});
+			jQuery('#message-attach-dialog').dialog('close');
 		});
-		
-		
-		jQuery.getScript("../prototype/modules/attach_message/attach_message.js", function(){
-			jQuery('#message-attach-dialog').dialog('open');
-			jQuery('#message-attach-attach-btn').unbind('click');
-			jQuery('#message-attach-attach-btn').click(function(event){
-				jQuery.each(selectedMessages, function(folder_name, messages) {
-					jQuery.each(selectedMessages[folder_name], function(message_number, message) { 
-						if (message) {
-							fileUploadMSG.find(' .attachments-list').show();	
-							var att = new Object();
-							att.folder = folder_name;
-							att.uid = message_number;
-							att.type = 'imapMSG';
-							att.name = Base64.encode(onceOpenedMessages[folder_name][message_number].subject + '.eml');
-							var idATT = JSON.stringify(att);
-							addAttachment( ID , idATT);                        
-							var attach = {};
-							attach.fileName = onceOpenedMessages[folder_name][message_number].subject + '.eml';
-							attach.fullFileName = onceOpenedMessages[folder_name][message_number].subject + '.eml';
-							if(attach.fileName.length > 20)
-								attach.fileName = attach.fileName.substr(0, 17) + "... " + attach.fileName.substr(attach.fileName.length-9, attach.fileName.length);
-
-							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}));
-							upload.find('.att-box-loading').remove();
-							upload.append('<input type="hidden" name="fileId[]" value=\''+idATT+'\'/>');
-							
-							upload.find('.att-box-delete').click(function(){
-								var idAttach = $(this).parent().find('input[name="fileId[]"]').val();
-								fileUploadMSG.find(' .attachments-list').find('input[value="'+idAttach+'"]').remove();
-								delAttachment(ID,idAttach); 
-								$(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); 
-
-							upload.find('.att-box-loading').remove();
-
-							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: 5, 
-									textAlign: 'center',
-									tip: true, // Give it a speech bubble tip with automatic corner detection
-									name: 'blue' // Style it according to the preset 'cream' style
-								}
-			                });
-						}
-					});
-				});
-				
-				jQuery('#message-attach-dialog').dialog('close');
-				
-			});
-			jQuery('#message-attach-cancel-btn').click(function(event){
-				jQuery('#message-attach-dialog').dialog('close');
-			});			
-		});
+		jQuery('#message-attach-cancel-btn').click(function(event){
+			jQuery('#message-attach-dialog').dialog('close');
+		});			
+	});
 	});
 	$(document).bind('drop dragover', function (e) {
