Index: sandbox/2.4.1-3/expressoMail1_2/templates/default/main.css
===================================================================
--- sandbox/2.4.1-3/expressoMail1_2/templates/default/main.css	(revision 6335)
+++ sandbox/2.4.1-3/expressoMail1_2/templates/default/main.css	(revision 6358)
@@ -1264,5 +1264,5 @@
 	background-color: #96B3D3;
 	border-radius: 5px;
-	border: 1px solid black; 
+	border: 1px solid #201b41; 
 	display: inline-block;
 	cursor : pointer;
@@ -1273,12 +1273,19 @@
 }
 
+
 .box span{
 	font-family: Verdana, Arial, Helvetica, sans-serif;
 	font-size: 13px;
+	color : #201b41;
 	outline : none;
 }
 
 .invalid-email-box{
-	background-color: red;
+	background-color: #F08080;
+	border : 1px solid #540303 !important;
+}
+
+.invalid-email-box span{
+	color: #540303;
 }
 
@@ -1325,2 +1332,6 @@
 	background: url(images/linha.png) repeat-x 0 96% ;
 }
+
+.box-draggable-hover{
+	border : 1px solid #474747;
+}
Index: sandbox/2.4.1-3/expressoMail1_2/js/draw_api.js
===================================================================
--- sandbox/2.4.1-3/expressoMail1_2/js/draw_api.js	(revision 6335)
+++ sandbox/2.4.1-3/expressoMail1_2/js/draw_api.js	(revision 6358)
@@ -3534,6 +3534,6 @@
 		//PEGA TODO O CONTEUDO E SETA COMO SE FOSSE O EMAIL
 		case 1:
-			ContactBox.email = email;
-			ContactBox.valid = reSimpleEmail.test(email.toLowerCase());
+			ContactBox.email = $.trim(email);
+			ContactBox.valid = reSimpleEmail.test($.trim(email.toLowerCase()));
 			break;
 		//CORRIGI ERRO DE DIGITAÇÃO COMO ( huahua"<huhau@hauhau.com>) ou (hahahaha"huahua@email.com) ou ainda (hahahaha"huahua@ema  il.com)
@@ -3563,5 +3563,7 @@
 //EVENTO DOS INPUTS PARA - CC - CCO
 function input_keydowns(input, ID){
+	var f9 = false;
 	input.keydown(function(e){
+		f9 = false;
 		var reEmail = /^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[_a-z0-9-]+(\.[_a-z0-9-]+)+$/;
 		var reEmail2 = /<([^<]*)>[\s]*$/;
@@ -3589,4 +3591,5 @@
 		//BUSCA COM A TECLA F9
 		if((e.keyCode) == 120){
+			f9 = true;
 			emQuickSearch($(this).val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true);
 			e.preventDefault();
@@ -3661,9 +3664,23 @@
 	//AO SAIR DO FOCO MONTAGEM DA CAIXA DE EMAIL
 	.focusout(function(){
-		if($(input).val() != "")
-			draw_email_box(input.val(), input);
-		if(input.hasClass("box-input"))
-			input.remove();
-		input.val("");
+		if(!($(this).parents("tr:first").find("button").hasClass("ui-state-active") || f9 || $(".expressomail-qs-container").dialog("isOpen"))){
+			if($(input).val() != "")
+				draw_email_box(input.val(), input);
+			if(input.hasClass("box-input"))
+				input.remove();
+		}
+		input_search = $(input).val();
+		$(input).val("");
+	}).bind("paste", function(e){
+		$(this).trigger("keydown");
+		var pthis = $(this);
+		setTimeout(function() {
+			var str = pthis.val().replace(/[,;\t\n]/gi, ",");
+			str = str.split(",");
+			$.each(str, function(index, value){
+				draw_email_box(value, pthis);
+			});
+			pthis.val("");
+		}, 50);
 	});
 	//SE FOR EDIÇÃO DE EMAILS RECALCULA O INPUT E SETA O FOCO
@@ -3673,5 +3690,5 @@
 	}
 }
-
+var input_search = "";
 //EVENTOS DA CAIXA
 function box_actions(box){
@@ -3694,8 +3711,10 @@
 			case $.ui.keyCode.HOME:
 				//SELECIONO A PRIMEIRA CAIXA
+				e.preventDefault();
 				$(this).parents(".email-area").find("div:first").focus();
 				break;
 			case $.ui.keyCode.END:
 				//SELECIONO A ULTIMA CAIXA
+				e.preventDefault();
 				$(this).parents(".email-area").find("div:last").focus();
 				break;
@@ -3746,4 +3765,15 @@
 	}).focusout(function(){
 		$(this).removeClass("box-selected");
+	}).draggable({
+		revert: 'invalid',
+		helper : 'clone',
+		stack: "body",
+		containment : ".new-msg-head-data",
+		start: function(e, ui){
+			$(this).parent().droppable( "disable" );
+		},
+		stop : function(e, ui){
+			$(this).parent().droppable( "enable" );
+		}
 	});
 }
@@ -3769,4 +3799,14 @@
 		if(!$(e.target).parents(".email-area:first").length)
 			$(this).find("div").removeClass("box-selected");
+	}).droppable({
+		hoverClass: "box-draggable-hover",
+		accept : ".box",
+		drop : function(e, ui){
+			ui.draggable.parent().droppable( "enable" );
+			var haha = ui.draggable.clone();
+			box_actions(haha)
+			$(this).prepend(haha);
+			ui.draggable.remove();
+		}
 	});
 	
@@ -3832,5 +3872,9 @@
 				return false;
 			},
-			autoFocus: true
+			autoFocus: true,
+			open : function(){
+				if($(this).val() == "")
+					$(this).autocomplete( "close" )
+			}
 		})
 		
@@ -3867,5 +3911,5 @@
 	//FUNÇÃO DOS BOTÕES PARA - CC - CCO
 	div.parents("tr:first").find("button").button().click(function(){
-		emQuickSearch($(this).parents("tr:first").find("input").val(), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true);
+		emQuickSearch(($(this).parents("tr:first").find("input").val() ? $(this).parents("tr:first").find("input").val() : input_search), "."+$(this).parents("tr:first").attr('class').split("-")[0], ID, undefined, true);
 	});
 }
Index: sandbox/2.4.1-3/expressoMail1_2/js/QuickCatalogSearch.js
===================================================================
--- sandbox/2.4.1-3/expressoMail1_2/js/QuickCatalogSearch.js	(revision 5911)
+++ sandbox/2.4.1-3/expressoMail1_2/js/QuickCatalogSearch.js	(revision 6358)
@@ -254,6 +254,11 @@
 			var signal = "+";
 			var btnClass = "add";
-			var emailList = content.find(field_).val();
-			var emails_adicionados = emailList.split(",");
+			emails_adicionados = "";
+			var emailList = content.find(field_).filter("input").parent().find("div input");
+			//	var array = content.find(".to-tr").find(".box");
+			$.each(emailList, function(index, value){
+				emails_adicionados += $(value).val() + ",";
+			});
+			emails_adicionados = emails_adicionados.split(",");
 			for(aux=0; aux<emails_adicionados.length -1; aux++) {
 				if(emails_adicionados[aux].match(/<([^<]*)>[\s]*$/)){
@@ -583,5 +588,4 @@
 		var nome = $(contact).clone().find('.name').text();
 		var email = $(contact).clone().find('.email').text();
-		
 		if(email == get_lang("No mail")){
 			alert(get_lang("It is not possible to add this contact as a recipient because it does not have email"));
@@ -590,39 +594,16 @@
 			return;
 		}
-		
 		verifyEmails(email, divs);
-		
-		final_contact = "\""+nome +"\" <"+email+">, ";
-		
-		var emailList      = content.find(field_).val();
-		//remove os caracteres da busca
-		emailList = emailList.substr(0,emailList.lastIndexOf(',')+1); 
-		
-        if (emailList[0] != '"' && emailList.indexOf(",") < 0)
-			emailList = emailList.substr(end_);
-        if(emailList.lastIndexOf(",") > 0){
-		if(emailList.substr(emailList.length-1, emailList.length) == "," || emailList.substr(emailList.length-2, 1) == ","){
-			emailList = emailList.substr(0, emailList.lastIndexOf(",") + 1);
-        	} else {
-			emailList = emailList.substr(0, emailList.lastIndexOf("") + 1);		
-			final_contact = ","+final_contact;
-		}
-	}
+		final_contact = "\""+nome +"\" <"+email+">";
 
-		final_contact = final_contact.replace(/\/n/, "");
-		new_emailList = emailList + final_contact;    
-        content.find(field_).val(new_emailList);
-		
-		content.find(field_).trigger("update");
-		
+		final_contact = final_contact.replace(/\/n/, "");  
+		draw_email_box(final_contact, $(field_).filter("input"));
 		button.onclick = function(){
 			remove_contact_field(document.getElementById(divs).innerHTML, button, divs);
 		};
 		var div = document.getElementById(divs);
-		
 		div.ondblclick = function(){
 			remove_contact_field(div.innerHTML, button, divs);
 		};
-		
 		button.innerHTML = '<span class="ui-button-text" style="">x</span>';
     }
@@ -634,43 +615,21 @@
 	function remove_contact_field(contact, button, divs) {
 		var email = $(contact).clone().find('.email').text();
-		var exist = false;
-		
-		var emailList = content.find(field_).val();
-		var emails_adicionados = emailList.split(",");
-		
-		verifyEmails(email, divs);
-		
-		for(i=0; i<emails_adicionados.length -1; i++) {
-
-			if(emails_adicionados[i].match(/<([^<]*)>[\s]*$/)){
-				if(emails_adicionados[i].match(/<([^<]*)>[\s]*$/)[1].toLowerCase() == email.toLowerCase()) {
-					emails_adicionados[i] = "%";
-					exist = true;
-				}
-			}else{
-				if(emails_adicionados[i].toLowerCase() == email.toLowerCase()) {
-					emails_adicionados[i] = "%";
-					exist = true;
-				}
-			}
-		}
-		
-		if (exist == false) 
-			return false;
-		var novos_contatos = emails_adicionados.join(",");  
-		novos_contatos = novos_contatos.replace(/%,/g, "");
-		content.find(field_).val(novos_contatos);
-		
+		var array = content.find(field_).parent().find("div input");
+		$.each(array, function(index, value){
+			var validated_email = $(value).val();
+			if(validated_email.match(/<([^<]*)>[\s]*$/)){
+				if(validated_email.match(/<([^<]*)>[\s]*$/)[1].toLowerCase() == email.toLowerCase()) {
+					$(value).parent().remove();
+				}
+			}
+		});
+	
 		button.onclick = function(){
 			add_contact_field(document.getElementById(divs).innerHTML, button, divs);
 		};
-		
 		var div = document.getElementById(divs);
-		
 		div.ondblclick = function(){
 			add_contact_field(div.innerHTML, button, divs);
 		};
-		
-		content.find(field_).trigger("update");
 		button.innerHTML = '<span class="ui-button-text" style="">+</span>';
 	}
