Index: /trunk/prototype/modules/calendar/js/helpers.js
===================================================================
--- /trunk/prototype/modules/calendar/js/helpers.js	(revision 5387)
+++ /trunk/prototype/modules/calendar/js/helpers.js	(revision 5389)
@@ -162,6 +162,9 @@
 }
 */
-function eventDetails( objEvent, decoded )
+function eventDetails( objEvent, decoded, path)
 {
+	if(path == undefined)
+		path = "";
+		
 	if( !decoded )
 	    objEvent = DataLayer.decode( "schedulable:calendar", objEvent );
@@ -184,5 +187,5 @@
 	zebraDiscardEventDialog = false;
 	
-	DataLayer.render( 'templates/event_add.ejs', {event:objEvent}, function( html ){	
+	var html = DataLayer.render( path+'templates/event_add.ejs', {event:objEvent});	
 		
 		if (!UI.dialogs.addEvent) {
@@ -280,5 +283,5 @@
 				calendarSelected.useAlarmDefault = 1;
 				if(calendarSelected.defaultAlarms != ""){
-					var li_attach = DataLayer.render('templates/alarms_add_itemlist.ejs', {alarm:calendarSelected});
+					var li_attach = DataLayer.render(path+'templates/alarms_add_itemlist.ejs', {alarm:calendarSelected});
 						jQuery('.event-alarms-list').append(li_attach).find('.button.remove').button({text:false, icons:{primary:'ui-icon-close'}}).click(function(el) {
 							if( $(this).parent().remove().find('li').is(':empty') )	{
@@ -300,5 +303,5 @@
 				calendarSelected.useAlarmDefault = 1;
 				if(calendarSelected.defaultAlarms != ""){
-					var li_attach = DataLayer.render('templates/alarms_add_itemlist.ejs', {alarm:calendarSelected});
+					var li_attach = DataLayer.render(path+'templates/alarms_add_itemlist.ejs', {alarm:calendarSelected});
 						jQuery('.event-alarms-list').append(li_attach).find('.button.remove').button({text:false, icons:{primary:'ui-icon-close'}}).click(function(el) {
 							var id;
@@ -407,5 +410,5 @@
 
 	    UI.dialogs.addEvent.find('.button-add-alarms').click(function(){
-			var li_attach = DataLayer.render('templates/alarms_add_itemlist.ejs', {});
+			var li_attach = DataLayer.render(path+'templates/alarms_add_itemlist.ejs', {});
 
 			jQuery('.event-alarms-list').append(li_attach).find('.button.remove').button({text:false, icons:{primary:'ui-icon-close'}}).click(function(el) {
@@ -428,5 +431,5 @@
 //	    });
 	    
-	    DataLayer.render( 'templates/attendee_add.ejs', {event:objEvent}, function( attendeeHtml ){
+		var attendeeHtml = DataLayer.render( path+'templates/attendee_add.ejs', {event:objEvent});
 	
 			// load template of attendees
@@ -573,5 +576,5 @@
 								hide: false,
 								content: {
-									text: $('<div></div>').html( DataLayer.render( 'templates/attendee_quick_edit.ejs', {attendee:{name:newAttendeeName, mail:newAttendeeEmail}} ) ), 
+									text: $('<div></div>').html( DataLayer.render( path+'templates/attendee_quick_edit.ejs', {attendee:{name:newAttendeeName, mail:newAttendeeEmail}} ) ), 
 									title: {
 										text:'Detalhes do participante', 
@@ -612,5 +615,5 @@
 							user[0].id =  DataLayer.put('participant', {user: user[0].id, isExternal: isExternal});
 							blkAddAtendee.find('dd.attendee-list ul.attendee-list').append(
-								DataLayer.render('templates/participants_add_itemlist.ejs', user)
+								DataLayer.render(path+'templates/participants_add_itemlist.ejs', user)
 							)
 							.find('.button.close').addClass('small').button({text:false, icons:{primary:'ui-icon-close'}}).click(function() {
@@ -634,5 +637,5 @@
 						 
 						blkAddAtendee.find('dd.attendee-list ul.attendee-list').append(
-							DataLayer.render('templates/participants_add_itemlist.ejs', [{id:newAttendeeId, name: newAttendeeName, mail: newAttendeeEmail, isExternal: 1}])
+							DataLayer.render(path+'templates/participants_add_itemlist.ejs', [{id:newAttendeeId, name: newAttendeeName, mail: newAttendeeEmail, isExternal: 1}])
 						).find('.button.close').addClass('small').button({text:false, icons:{primary:'ui-icon-close'}}).click(function() {
 							DataLayer.remove('participant', $(this).parent().find('[type=checkbox]').val());
@@ -651,5 +654,5 @@
 							hide: false,
 							content: {
-								text: $('<div></div>').html( DataLayer.render( 'templates/attendee_quick_edit.ejs', {attendee:{name:newAttendeeName, mail:newAttendeeEmail}} ) ), 
+								text: $('<div></div>').html( DataLayer.render( path+'templates/attendee_quick_edit.ejs', {attendee:{name:newAttendeeName, mail:newAttendeeEmail}} ) ), 
 								title: {
 									text:'Detalhes do participante', 
@@ -700,5 +703,5 @@
 						result[i].enabled = (blkAddAtendee.find('dd.attendee-list ul.attendee-list label.mail[title="' +  result[i].mail + '"]').length) ? false : true;
 											
-					blkAddAtendee.find('ul.search-result-list').append(DataLayer.render( 'templates/participants_search_itemlist.ejs', result));
+					blkAddAtendee.find('ul.search-result-list').append(DataLayer.render( path+'templates/participants_search_itemlist.ejs', result));
 
 					blkAddAtendee.find('ul.search-result-list li').click(function(event, ui){
@@ -707,5 +710,5 @@
 							newAttendeeId = DataLayer.put('participant', {user: old_item.find('.id').html(), isExternal: 0});
 							blkAddAtendee.find('dd.attendee-list ul.attendee-list')
-							.append(DataLayer.render('templates/participants_add_itemlist.ejs', [{id: newAttendeeId, name: old_item.find('.name').html(), mail: old_item.find('.mail').html(), isExternal: 0}]))
+							.append(DataLayer.render(path+'templates/participants_add_itemlist.ejs', [{id: newAttendeeId, name: old_item.find('.name').html(), mail: old_item.find('.mail').html(), isExternal: 0}]))
 							.find('.button').addClass('small').button({text:false, icons: {primary:'ui-icon-close'}}).click(function () {
 								$(this).parent().remove();
@@ -765,5 +768,4 @@
 				}
 			});
-		});
 		UI.dialogs.addEvent.find(':input').change(function(event){
 			if (event.keyCode != '27' && event.keyCode != '13')
@@ -775,7 +777,4 @@
 		
 		UI.dialogs.addEvent.dialog('open');
-	});
-	
-	
 }
 
Index: /trunk/expressoMail1_2/index.php
===================================================================
--- /trunk/expressoMail1_2/index.php	(revision 5385)
+++ /trunk/expressoMail1_2/index.php	(revision 5389)
@@ -12,4 +12,5 @@
 	$_SESSION['phpgw_info']['expressomail']['user'] = $GLOBALS['phpgw_info']['user'];
 	$GLOBALS['phpgw']->css->validate_file('expressoMail1_2/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . '/main.css');
+	//$GLOBALS['phpgw']->css->validate_file('expressoMail1_2/templates/' . $GLOBALS['phpgw_info']['server']['template_set'] . '/expressoMail_reset.css');
 	$GLOBALS['phpgw']->css->validate_file('phpgwapi/js/dftree/dftree.css');
 	echo $GLOBALS['phpgw']->css->get_css();
@@ -17,11 +18,44 @@
 	echo "<script src='js/modal/modal.js'></script>";
 	//jquery and Editor 
- 	        echo "  <script src='../library/jquery/jquery.js' language='javascript'></script> 
+ 	        echo "  <link rel='Stylesheet' type='text/css' href='templates/default/expressoMail_reset.css' />
+					<script type='text/javascript' src='../prototype/app/plugins/jquery/jquery.min.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/jquery/jquery-ui.min.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/jquery/jquery-ui.custom.min.js'></script>
 					<script src='../prototype/app/plugins/json2/json2.js' language='javascript'></script>
 					<script src='../prototype/app/plugins/ejs/ejs.js' language='javascript'></script>
 					<script src='../prototype/app/plugins/store/jquery.store.js' language='javascript'></script>
 					<script src='../prototype/app/datalayer.js' language='javascript'></script>					
+					<script type='text/javascript' src='../prototype/app/plugins/scrollto/jquery.scrollTo.js'></script>
+					<script language='javascript'>DataLayer.dispatchPath = '../prototype/';</script>					
  	                <script src='../library/ckeditor/ckeditor.js' language='javascript'></script> 
  	                <script src='../library/ckeditor/adapters/jquery.js' language='javascript'></script> 
+					<link rel='Stylesheet' type='text/css' href='../prototype/app/plugins/jquery/jquery-ui.css' />					
+					<link rel='Stylesheet' type='text/css' href='../prototype/app/plugins/jquery/jquery-ui.custom.css' />
+					<script type='text/javascript' src='../library/timepicker/jquery-ui-timepicker-addon.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/jquery/i18n/jquery.ui.datepicker-pt-BR.js'></script>
+					<link rel='Stylesheet' type='text/css' href='../library/timepicker/jquery-ui-timepicker-addon.css' />
+					<link rel='stylesheet' type='text/css' href='../prototype/app/plugins/zebradialog/css/zebra_dialog.css'></link>
+					<script type='text/javascript' src='../prototype/app/plugins/zebradialog/javascript/zebra_dialog.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/datejs/date-pt-BR.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/datejs/sugarpak.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/datejs/parser.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/dateFormat/dateFormat.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/watermark/jquery.watermarkinput.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/mask/jquery.maskedinput.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/alphanumeric/jquery.alphanumeric.js'></script>
+					<script>
+					$.ajax({
+						url: '../prototype/modules/calendar/index.php',
+						async: false,
+						success: function(){
+						}
+					});
+					</script>
+					<script type='text/javascript' src='../library/timepicker/localization/jquery-ui-timepicker-pt-BR.js'></script>
+					<script type='text/javascript' src='../prototype/modules/calendar/js/calendar.codecs.js'></script>
+					<script type='text/javascript' src='../prototype/modules/calendar/js/helpers.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/encoder/encoder.js'></script>
+					<script type='text/javascript' src='../prototype/app/plugins/qtip/jquery.qtip-1.0.0-rc3.min.js'></script>
+					<script language='javascript'>var CalendarBkp = Calendar;</script>
                 <script src='js/rich_text_editor.js' type='text/javascript'></script>
                 <script src='js/base64.js' type='text/javascript'></script>";
@@ -38,4 +72,6 @@
 	echo '<script type="text/javascript" src="../phpgwapi/js/wz_dragdrop/wz_dragdrop.js?'.$update_version.'"></script>
 		<script type="text/javascript" src="../phpgwapi/js/dJSWin/dJSWin.js?'.$update_version.'"></script>';
+	echo "<script language='javascript'>Calendar = $.extend(CalendarBkp, Calendar);</script>";
+		
 
 	echo '
@@ -306,4 +342,6 @@
 
 <link rel="stylesheet" href="../prototype/modules/attach_message/attach_message.css" type="text/css" />
+<link rel='stylesheet' type='text/css' href='../prototype/modules/calendar/css/layout.css' />
+<link rel='stylesheet' type='text/css' href='../prototype/modules/calendar/css/style.css' />
 
 </body>
Index: /trunk/expressoMail1_2/templates/default/config.tpl
===================================================================
--- /trunk/expressoMail1_2/templates/default/config.tpl	(revision 5359)
+++ /trunk/expressoMail1_2/templates/default/config.tpl	(revision 5389)
@@ -118,5 +118,5 @@
 	</tr>
 	<tr bgcolor="{row_off}"> 
- 	    <td>{lang_New_agenda}</td> 
+ 	    <td>{lang_Allow_importing_and_creating_events_directly_on_ExpressoCalendar_module_(new)}</td> 
  	    <td> 
 		   <select name="newsettings[new_agenda]"> 
Index: /trunk/expressoMail1_2/templates/default/expressoMail_reset.css
===================================================================
--- /trunk/expressoMail1_2/templates/default/expressoMail_reset.css	(revision 5389)
+++ /trunk/expressoMail1_2/templates/default/expressoMail_reset.css	(revision 5389)
@@ -0,0 +1,208 @@
+/*
+ * Este arquivo limpa o estilo para a nova agenda, .new-event-win.active sobrescrevendo o código CSS
+ * do Expresso.
+ * Deve ser removido quando o módulo Calendar não integrar mais a versão 2.x
+ */
+
+/* Eric Meyer's Reset Reloaded based
+ * http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
+ */
+
+.new-event-win.active applet, .new-event-win.active object, .new-event-win.active iframe, .new-event-win.active fieldset, .new-event-win.active div
+.new-event-win.active h1, .new-event-win.active h2, .new-event-win.active h3, .new-event-win.active h4, .new-event-win.active h5, .new-event-win.active h6, .new-event-win.active p, .new-event-win.active blockquote, .new-event-win.active pre,
+.new-event-win.active abbr, .new-event-win.active acronym, .new-event-win.active address, .new-event-win.active big, .new-event-win.active cite, .new-event-win.active code,
+.new-event-win.active del, .new-event-win.active dfn, .new-event-win.active em, .new-event-win.active font, .new-event-win.active img, .new-event-win.active ins, .new-event-win.active kbd, .new-event-win.active q, .new-event-win.active s, .new-event-win.active samp,
+.new-event-win.active small, .new-event-win.active strike, .new-event-win.active strong, .new-event-win.active sub, .new-event-win.active sup, .new-event-win.active tt, .new-event-win.active var,
+.new-event-win.active ol, .new-event-win.active ul,
+.new-event-win.active form, .new-event-win.active label, .new-event-win.active select,
+.new-event-win.active table, .new-event-win.active caption, .new-event-win.active tbody, .new-event-win.active tfoot, .new-event-win.active thead, .new-event-win.active tr, .new-event-win.active th, .new-event-win.active td {
+	margin: 0;
+	padding: 0;
+	border: 0;
+	outline: 0;
+	font-weight: inherit;
+	font-style: inherit;
+	/*font-size: 100%;*/
+	/*font-family: inherit;*/
+	/*vertical-align: baseline;*/
+/*	font-family: Arial,Helvetica,sans-serif;*/
+}
+
+.new-event-win.active:focus {
+	outline: 0;
+}
+.new-event-win.active body {
+	line-height: 1;
+	color: black;
+	background: white;
+}
+.new-event-win.active ol, .new-event-win.active ul {
+	list-style: none;
+	list-style-image : none;
+	padding-left : 5px;
+}
+
+.new-event-win.active table {
+	border-collapse: separate;
+	border-spacing: 0;
+}
+.new-event-win.active caption, .new-event-win.active th, .new-event-win.active td {
+	/*text-align: left;*/
+	font-weight: normal;
+}
+.new-event-win.active blockquote:before, .new-event-win.active blockquote:after,
+.new-event-win.active q:before, .new-event-win.active q:after {
+	content: "";
+}
+.new-event-win.active blockquote, .new-event-win.active q {
+	quotes: "" "";
+}
+
+
+.new-event-win.active select {
+    border: 1px solid #CFCFCF;
+    border-color: #CFCFCF;
+    color: #555;
+    background-color: #FFF;
+}
+.new-event-win.active a:link, .new-event-win.active a:visited {
+    color: #2E6E9E;
+}
+
+.new-event-win.active  dd, .new-event-win.active  dl, .new-event-win.active  dt{
+	margin: 0;
+}
+/* azul.css */
+/*body { background-color: #e9e9e9; }*/
+
+/*a:link,
+a:visited
+{ color: #000066; }*/
+
+/*a:hover,
+a:active
+{ color: #ff9933; }*/
+
+.new-event-win.active #divAppbox{
+	overflow-x: auto;
+	overflow-y: scroll;
+}
+
+.new-event-win.active select
+{ border-color: #CFCFCF; color: #555; padding-left:0px;}
+
+.qtip-wrapper fieldset{
+	padding: 0;
+	border: 0;
+}
+/*#divAppbox
+{ background: #fff url( ../images/bgBlockContent.jpg ) repeat-x; border-color: #9c9c9c; }
+
+#divAppboxHeader
+{ background: url( ../images/bgAppTitle.png ); border-color: #9c9c9c; color: #006; text-shadow: 0.2em 0.2em 3px #999; }
+
+#divAppIconBar
+{ background: #fff url( ../images/background-icon-bar.png ) repeat-x; border-top-color: #9c9c9c; }
+
+#divAppTextBar
+{ background-color: #fff; }
+
+#divGenTime
+{ color: #f00; }
+
+#divMain
+{ background: #fff; border-color: #7e7e7e; }
+
+#divPoweredBy
+{ background: #fff; color: #999; }
+
+#divSideboxContainer
+{ background: #fff; }
+
+#extraIcons
+{ background: #eee; border-color: #7e7e7e; }
+
+#links_bar,
+#user_info
+{ color: #fff; }
+
+#tdAppbox
+{ background-color: #fff; }
+
+#tdSidebox
+{ background: #fff; }*/
+
+/*.conteudo
+{ border-color: #4A79B1; color: #003; }
+
+.divSideboxHeader
+{ background: #416faa; color: #fff; }
+
+.extraIconsRow
+{ border-top-color: #ddd; }
+
+.greyLine
+{ border-top-color: #7e7e7e; }
+
+.grid_email_class
+{ border-bottom-color: #cfcfcf; }
+
+.image-menu
+{ background: url( ../../../../phpgwapi/templates/default/images/folder_bg.png ); }
+
+.last_menu
+{ border-bottom-color: #4a79b1; }
+
+.logo_expresso
+{ background: url( ../../../../phpgwapi/templates/default/images/logo_expresso.jpg ) no-repeat 0 3px; }
+
+.menu
+{ background: #c8d7ea; border-color: #f4f7fc; border-bottom-color: #4a79b1; }
+
+.menu-sel
+{ background-color: #f7f7f7; border-color: #4a79b1; color: #00f; }
+
+.menu-degrade
+{ background-image: url( ../../../../phpgwapi/templates/default/images/degrade.png ); }
+
+.navbar_but
+{ background-image: url(../../../../phpgwapi/templates/default/images/back_app.png); }
+
+.navbar_butOver
+{ background-image: url( ../../../../phpgwapi/templates/default/images/back_app_over.png ); }
+
+.navbar_butOut
+{ background-image: url( ../../../../phpgwapi/templates/default/images/back_app_out.png ); }
+
+.tblHeadApp
+{ border-color: #9c9c9c; }
+
+.textSidebox
+{ border-top-color: #aaa; }
+
+.toolbar
+{ background-image: url( ../../../../phpgwapi/templates/default/images/fundo_topo.png ); }
+
+.linha0,
+.tr_msg_read
+{ color: #3f3f3f; background: #fff; }
+
+.linha1,
+.tr_msg_read2
+{ color: #3f3f3f; background: #f4f8fb; }
+
+table.inboxElements th,
+.table_elements_tr_header,
+.info_tr_header,
+.message_header
+{
+	background: #abc6e1;
+}
+
+.prefTable
+{
+	background-color: #f4f8fb;
+	margin: 0px 0px 10px 0px ;
+	border: 1px solid #D3DCE3;
+	border-top: 0px;
+}*/
Index: /trunk/expressoMail1_2/templates/default/index.tpl
===================================================================
--- /trunk/expressoMail1_2/templates/default/index.tpl	(revision 5346)
+++ /trunk/expressoMail1_2/templates/default/index.tpl	(revision 5389)
@@ -203,5 +203,5 @@
 	</p>
 </div>
-<div id="create-event-dialog" title="Criar Evento" style="display:none">
+<div id="sandbox" class="expresso-calendar-container hidden">
 </div>
 <!-- END list -->
Index: /trunk/expressoMail1_2/js/main.js
===================================================================
--- /trunk/expressoMail1_2/js/main.js	(revision 5385)
+++ /trunk/expressoMail1_2/js/main.js	(revision 5389)
@@ -1370,6 +1370,6 @@
 		data.cco = data.cco.replace(/&gt;/gi,">");
 	}
-	if (document.getElementById("subject_" + border_ID))
-		data.subject = document.getElementById("subject_" + border_ID).innerHTML;
+	if ($("#subject_" + border_ID))
+		data.subject = $("#subject_" + border_ID).text();
 	if(data.subject == get_lang("(no subject)   "))
 		data.subject = '';
Index: /trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- /trunk/expressoMail1_2/js/draw_api.js	(revision 5370)
+++ /trunk/expressoMail1_2/js/draw_api.js	(revision 5389)
@@ -2450,5 +2450,4 @@
 	to_values.type = "HIDDEN";
 	to_values.value = info_msg.toaddress2; //Veio do IMAP, sem images nem links.
-
 	// Salva a pasta da mensagem
 	var input_current_folder = document.createElement('input');
@@ -2600,4 +2599,144 @@
 	subject.innerHTML = info_msg.subject;
 	subject.className = "header_message_field";
+	var new_event_logo = document.createElement("IMG");
+	new_event_logo.title = "Criar evento a partir deste email";
+	new_event_logo.alt = "Criar evento a partir deste email";
+	new_event_logo.src = "./templates/default/images/calendar_add.png";
+	new_event_logo.style.cursor = "pointer";
+	new_event_logo.style.marginLeft = "5px";
+	new_event_logo.onclick = function(){
+		DataLayer.dispatchPath = "../prototype/";
+		var path = "../prototype/modules/calendar/";
+		eventDetails({ 
+				summary : $("#subject_"+ID).text(),
+				description : $("#body_" + ID).text(),
+				startTime: $.now(),
+				endTime:!!User.preferences.defaultCalendar ? Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration != "" ? ($.now() + Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration * 60000) : (User.preferences.defaultDuration * 60000)
+				: $.now() + (User.preferences.defaultDuration * 60000)
+		}, true, path);
+		$(".new-event-win").find('input.time').timepicker({ 
+			closeText: 'Ok',
+			hourGrid: 4,
+			minuteGrid: 10,
+			//ampm : ((User.preferences.hourFormat.length > 5) ? true: false),
+			timeFormat: "hh:mm tt",
+			onSelect: function (selectedDateTime){
+				if(!(User.preferences.hourFormat.length == 5))
+					$(this).val(selectedDateTime.replace(/[\.]/gi, ""));								
+			},
+			onClose : function (selectedDateTime){
+				if(!(User.preferences.hourFormat.length == 5))
+					$(this).val(selectedDateTime.replace(/[\.]/gi, ""));
+			}
+		});
+		var emails = $("#to_values_"+ID).val();
+		emails = emails.split(",");
+		var blkAddAtendee = UI.dialogs.addEvent.find('#calendar_addevent_details6');
+		var onShowToolTip = function(arg0) {
+			$('.qtip-active .button.close').button({
+				icons: {primary: "ui-icon-close"},
+				text: false
+			});
+			$('.qtip-active .button').button()
+			.filter('.save').click(function(event, ui) {
+				if (saveContact()) {						
+					lastEditAttendeeToolTip.qtip("destroy");
+				} else {
+					return false;
+				}
+			}).end()
+			.filter('.cancel').click(function(event, ui) {
+				lastEditAttendeeToolTip.qtip("destroy");
+			})
+
+			/** 
+			 * Trata o ENTER no campo da tooltip, equivalente a salvar 
+			 * o novo convidado.
+			 */
+			$('.qtip-active input').keydown(function(event) {
+				if (event.keyCode == '13') {						
+					if (saveContact()) {						
+						lastEditAttendeeToolTip.qtip("destroy");
+					}
+
+					lastEditAttendeeToolTip.qtip("destroy");
+					event.preventDefault();
+				}
+			})
+			.filter('[name="name"]').Watermark("informe o nome do contato").end()
+			.filter('[name="mail"]').Watermark("informe o email do contato");
+		}
+				
+		$.each(emails, function(index, value) { 
+			var decoded =  Encoder.htmlDecode(value);
+			var newAttendeeName = "";
+			if(decoded.match(/<([^<]*)>[\s]*$/)){
+				var user = DataLayer.get('user', ["=", "mail", decoded.match(/<([^<]*)>[\s]*$/)[1].toLowerCase()], true);
+				if(!(!!user)){
+					newAttendeeName = decoded.match(/"([^"]*)"/)[1];
+					var newAttendeeEmail = decoded.match(/<([^<]*)>[\s]*$/)[1];
+				}
+			}
+			else{
+				var user = DataLayer.get('user', ["=", "mail", decoded], true);
+				if(!(!!user)){
+					var newAttendeeEmail = decoded;
+				}
+			}
+				
+			var isExternal = (!!user && !(!!user.isExternal)) ? 0 : 1;
+			var add = false;
+			if(user){
+				if(!(blkAddAtendee.find('label.mail[title="' + user[0].mail + '"]').length)){
+					user[0].id =  DataLayer.put('participant', {user: user[0].id, isExternal: isExternal});
+					blkAddAtendee.find('dd.attendee-list ul.attendee-list').append(
+						DataLayer.render(path+'templates/participants_add_itemlist.ejs', user)
+					)
+					.find('.button.close').addClass('small').button({text:false, icons:{primary:'ui-icon-close'}}).click(function() {
+						DataLayer.remove('participant', $(this).parent().find('[type=checkbox]').val());
+						$(this).parent().remove();
+					}).end()
+					.scrollTo('max');
+					add = true;
+				}
+			}else{
+				userId = DataLayer.put('user', {name: newAttendeeName, mail: newAttendeeEmail, isExternal: isExternal});
+				newAttendeeId = DataLayer.put('participant', {user: userId, isExternal: isExternal});
+				
+				blkAddAtendee.find('dd.attendee-list ul.attendee-list').append(
+					DataLayer.render(path+'templates/participants_add_itemlist.ejs', [{id:newAttendeeId, name: newAttendeeName, mail: newAttendeeEmail, isExternal: 1}])
+				).find('.button.close').addClass('small').button({text:false, icons:{primary:'ui-icon-close'}}).click(function() {
+					DataLayer.remove('participant', $(this).parent().find('[type=checkbox]').val());
+					$(this).parent().remove();
+				}).end()
+				.scrollTo('max');
+				add = true;
+			}
+			if(add){
+				lastEditAttendeeToolTip = blkAddAtendee.find('dd.attendee-list li:last');
+				lastEditAttendeeToolTip.qtip({
+					show: {ready: false, solo: true, when: {event: 'click'}},
+					hide: false,
+					content: {
+						text: $('<div></div>').html( DataLayer.render( path+'templates/attendee_quick_edit.ejs', {attendee:{name:(newAttendeeName ? newAttendeeName : user[0].name), mail:(newAttendeeEmail ? newAttendeeEmail : user[0].mail)}} ) ), 
+						title: {
+							text:'Detalhes do participante', 
+							button: '<a class="button close" href="#">close</a>'
+						}
+					},
+					style: {name: 'blue', tip: {corner: 'leftMiddle'}, border: {width: 4, radius: 8}, width: {min: 230, max:230}},
+					position: {
+						corner: {
+							target: 'rightMiddle',
+							tooltip: 'leftMiddle'
+						},
+						adjust: {x:0, y:0}
+					}
+				});
+				lastEditAttendeeToolTip.qtip("api").onShow = onShowToolTip;
+			}
+		});						
+	}
+	subject.appendChild(new_event_logo);
 	tr5.appendChild(td5);
 	tr5.appendChild(subject);
