Index: /trunk/prototype/modules/calendar/js/calendar.codecs.js
===================================================================
--- /trunk/prototype/modules/calendar/js/calendar.codecs.js	(revision 5376)
+++ /trunk/prototype/modules/calendar/js/calendar.codecs.js	(revision 5381)
@@ -177,5 +177,5 @@
 //DataLayer.poll( "schedulable" );
 
-DataLayer.listen( "schedulable", function( status ){
+DataLayer.listen( "schedulable", function( status, updateData){
   
     if( status === 'serverclient' ){
@@ -193,5 +193,5 @@
 				pageselectCallback("", 0);
 		});
-    }
+    }	
 });
 
Index: /trunk/prototype/modules/calendar/js/helpers.js
===================================================================
--- /trunk/prototype/modules/calendar/js/helpers.js	(revision 5376)
+++ /trunk/prototype/modules/calendar/js/helpers.js	(revision 5381)
@@ -214,4 +214,6 @@
 										canDiscardEventDialog = true;
 										UI.dialogs.addEvent.dialog('close');
+									}else{
+										zebraDiscardEventDialog = false;
 									}
 									
@@ -243,14 +245,5 @@
 	    var tabs = UI.dialogs.addEvent.children('.content').tabs();
 		var calendar = DataLayer.get('calendar', objEvent.calendar);
-		
-
-		UI.dialogs.addEvent.find(':input').change(function(event){
-			if (event.keyCode != '27' && event.keyCode != '13')
-				canDiscardEventDialog = false;
-		}).keydown(function(event){
-			if (event.keyCode != '27' && event.keyCode != '13')
-				canDiscardEventDialog = false;
-		});
-		
+				
 		if (calendar.timezone != objEvent.timezone){
 			UI.dialogs.addEvent.find('.calendar-addevent-details-txt-timezone').find('option[value="'+objEvent.timezone+'"]').attr('selected','selected').trigger('change');
@@ -275,4 +268,7 @@
 			}
 		});
+		
+		/*Seleciona a agenda padrão para criação de um evento*/
+		UI.dialogs.addEvent.find('option[value="'+User.preferences.defaultCalendar+'"]').attr('selected','selected').trigger('change');
 		
 		/*Adicionar alarms padrões, quando alterado a agenda do usuário*/		
@@ -497,5 +493,5 @@
 						var isValidMail = newAttendeeEmail.match(/^[\w!#$%&'*+\/=?^`{|}~-]+(\.[\w!#$%&'*+\/=?^`{|}~-]+)*@(([\w-]+\.)+[A-Za-z]{2,6}|\[\d{1,3}(\.\d{1,3}){3}\])$/);
 						if (!isValidMail) {
-							currentTip.find('.messages').removeClass('hidden').find('.message label').append('Email inválido.');
+							currentTip.find('.messages').removeClass('hidden').find('.message label').html('Email inválido.');
 							return false;
 						}
@@ -770,4 +766,12 @@
 			});
 		});
+		UI.dialogs.addEvent.find(':input').change(function(event){
+			if (event.keyCode != '27' && event.keyCode != '13')
+				canDiscardEventDialog = false;
+		}).keydown(function(event){
+			if (event.keyCode != '27' && event.keyCode != '13')
+				canDiscardEventDialog = false;
+		});
+		
 		UI.dialogs.addEvent.dialog('open');
 	});
@@ -1058,5 +1062,5 @@
 function remove_calendar(){
 	/* Pode ser assim $('.cal-list-options-btn.ui-state-active').attr('class').replace(/[a-zA-Z-]+/g, ''); */
-	$.Zebra_Dialog('Todos os eventos desta agenda serão apagados. Deseja prosseguir com a operação ?', {
+	$.Zebra_Dialog('Todos os eventos desta agenda serão removidos. Deseja prosseguir com a operação?', {
 		'type':     'question',
 		'overlay_opacity': '0.5',
@@ -1217,5 +1221,5 @@
 				$('.my-calendars .status-list').toggleClass("ui-icon-triangle-1-e");
 	    });
-
+		
 	    $(".signed-calendars a.title-signed-calendars").click(function() {
 			$(".signed-calendars ul.signed-list-calendars").toggleClass( "hidden");
@@ -1273,34 +1277,24 @@
 
 function paginatorSearch(currentView){
-	if(parseInt($(currentView+' [name = results]').val()) > 25){
-		$(currentView+' .header-paginator .fc-header-left .fc-button.fc-button-next .fc-button-inner').hover(
-				function(){
-					$(this).addClass('fc-state-hover');
-				},
-				function(){
-					$(this).removeClass('fc-state-hover');
-			}).mousedown(function(){
-				$(this).addClass('fc-state-down');
-			}).mouseup(function(){
-				$(this).removeClass('fc-state-down');
-				$('.events-list.events-list-win.active').removeClass('active');
-				pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($('[name = page_index]').val())) +1));
-			});
-		}
-		if(parseInt($(currentView+' [name = page_index]').val()) > 0){
-			$(currentView+' .header-paginator .fc-header-left .fc-button.fc-button-prev .fc-button-inner').hover(
-				function(){
-					$(this).addClass('fc-state-hover');
-				},
-				function(){
-					$(this).removeClass('fc-state-hover');
-			}).mousedown(function(){
-				$(this).addClass('fc-state-down');
-			}).mouseup(function(){
-				$(this).removeClass('fc-state-down');
-				$('.events-list.events-list-win.active').removeClass('active');
-				pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($('[name = page_index]').val())) -1));
-			});
-		}			
+	$(currentView+' .header-paginator .fc-header-left .fc-button').hover(
+			function(){
+				$(this).addClass('fc-state-hover');
+			},
+			function(){
+				$(this).removeClass('fc-state-hover');
+		}).mousedown(function(){
+			$(this).addClass('fc-state-down');
+		}).mouseup(function(){
+			$(this).removeClass('fc-state-down');
+			$('.events-list.events-list-win.active').removeClass('active');
+			var paginator = $(this).attr('class');
+			if(paginator.indexOf('next') > 0){
+				if(parseInt($(currentView+' [name = results]').val()) > 25)
+					pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($(currentView+' [name = page_index]').val())) +1));
+			}else{
+				if(parseInt($(currentView+' [name = page_index]').val()) > 0)
+					pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($(currentView+' [name = page_index]').val())) -1));
+			}
+		});
 }
 
@@ -1337,5 +1331,6 @@
 			$(currentView+' .events-list.events-list-win.active .header-paginator .fc-header-right .fc-button-'+((view == 'day' || view == 'week') ? 'agenda'+view : view )).addClass('fc-state-active');
 		$(currentView+' .events-list.events-list-win.active .header-paginator .fc-header-right').addClass('list-right');
-		$(currentView+' .header-paginator .fc-header-right .fc-button-agendaday').hover(
+		
+		$(currentView+' .header-paginator .fc-header-right .fc-button').hover(
 				function(){
 					$(this).addClass('fc-state-hover');
@@ -1347,48 +1342,17 @@
 				$(this).addClass('fc-state-active');
 			}).mouseup(function(){
-				pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'day');
-			});
-			
-		$(currentView+' .header-paginator .fc-header-right .fc-button-agendaweek').hover(
-				function(){
-					$(this).addClass('fc-state-hover');
-				},
-				function(){
-					$(this).removeClass('fc-state-hover');
-			}).mousedown(function(){
-				$(currentView+' .events-list.events-list-win.active .header-paginator .fc-header-right .fc-button').removeClass('fc-state-active')
-				$(this).addClass('fc-state-active');
-			}).mouseup(function(){
-				pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'week');
-			});	
-			
-		$(currentView+' .header-paginator .fc-header-right .fc-button-month').hover(
-				function(){
-					$(this).addClass('fc-state-hover');
-				},
-				function(){
-					$(this).removeClass('fc-state-hover');
-			}).mousedown(function(){
-				$(currentView+' .events-list.events-list-win.active .header-paginator .fc-header-right .fc-button').removeClass('fc-state-active')
-				$(this).addClass('fc-state-active');
-			}).mouseup(function(){
-				pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'month');
-			});
-			
-		$(currentView+' .header-paginator .fc-header-right .fc-button-year').hover(
-				function(){
-					$(this).addClass('fc-state-hover');
-				},
-				function(){
-					$(this).removeClass('fc-state-hover');
-			}).mousedown(function(){
-				$(currentView+' .events-list.events-list-win.active .header-paginator .fc-header-right .fc-button').removeClass('fc-state-active')
-				$(this).addClass('fc-state-active');
-			}).mouseup(function(){
-				pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'year');
-			});
-		
-		
-		$(currentView+' .header-paginator .fc-header-left .fc-button.fc-button-next .fc-button-inner').hover(
+				var goView = $(this).attr('class');
+				if(goView.indexOf('agendaDay') > 0)
+					pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'day');
+				else if(goView.indexOf('month') > 0)
+					pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'month');
+				else if(goView.indexOf('year') > 0)
+					pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'year');
+				else if(goView.indexOf('agendaWeek') > 0)
+					pageselectCallback($(currentView+' [name = keyword]').val(), 0, '', 'week');
+
+			});
+
+		$(currentView+' .header-paginator .fc-header-left .fc-button').hover(
 				function(){
 					$(this).addClass('fc-state-hover');
@@ -1400,19 +1364,10 @@
 			}).mouseup(function(){
 				$(this).removeClass('fc-state-down');
-				pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($('[name = page_index]').val())) +1), '', view);
-			});
-		
-			$(currentView+' .header-paginator .fc-header-left .fc-button.fc-button-prev .fc-button-inner').hover(
-				function(){
-					$(this).addClass('fc-state-hover');
-				},
-				function(){
-					$(this).removeClass('fc-state-hover');
-			}).mousedown(function(){
-				$(this).addClass('fc-state-down');
-			}).mouseup(function(){
-				$(this).removeClass('fc-state-down');
-				pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($('[name = page_index]').val())) -1), '', view);
-			});	
+				var paginator = $(this).attr('class');
+				if(paginator.indexOf('next') > 0)
+					pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($('[name = page_index]').val())) +1), '', view);
+				else
+					pageselectCallback($(currentView+' [name = keyword]').val(), ((parseInt($('[name = page_index]').val())) -1), '', view);
+				});	
 }
 
@@ -1508,5 +1463,15 @@
 					$(this).siblings("div.details-event-list").toggleClass("hidden")
 					.find('.button.delete').click(function(){
-						DataLayer.remove('schedulable', $(this).siblings('[name="eventid"]').val());
+						var eventId = $(this).siblings('[name="eventid"]').val();
+						$.Zebra_Dialog('Tem certeza que deseja excluir o evento?', {
+							'type':     'question',
+							'overlay_opacity': '0.5',
+							'buttons':  ['Sim', 'Não'],
+							'onClose':  function(clicked) {
+								if(clicked == 'Sim'){
+									DataLayer.remove('schedulable', eventId);
+								}
+							}
+						});
 					})
 					.end().find('.button.edit').click(function(){				
@@ -1533,5 +1498,5 @@
 }
 
-function show_modal_import_export(tab) {
+function show_modal_import_export(tab, calendarId) {
     DataLayer.render( 'templates/import_export.ejs', {calendars: Calendar.calendars, owner: User.me.id}, function( html ){
 
@@ -1554,8 +1519,10 @@
         UI.dialogs.importCalendar.find('.button').button();
 
+		tabsImportExport.find('option[value="'+calendarId+'"]').attr('selected','selected').trigger('change');
+		
+		
         UI.dialogs.importCalendar.find(".menu-import-event")        
-	    .children(".import").click(function(){
-	      
-			$('.import-event-form', UI.dialogs.importCalendar).submit();
+	    .children(".import").click(function(data){
+			$('.import-event-form', UI.dialogs.importCalendar).submit();			
 			UI.dialogs.importCalendar.dialog("close");
 			/**
Index: /trunk/prototype/modules/calendar/index.php
===================================================================
--- /trunk/prototype/modules/calendar/index.php	(revision 5358)
+++ /trunk/prototype/modules/calendar/index.php	(revision 5381)
@@ -214,6 +214,5 @@
 		$('.ui-datepicker-title .ui-datepicker-month').live('click',function(){
 			$tabs.tabs("select", "#calendar");
-			var currentDate = $.fullCalendar.formatDate($('#calendar').fullCalendar('getDate'), "yyyy-MM-dd").split('-');
-			$('#calendar').fullCalendar('gotoDate',$('.ui-datepicker-title .ui-datepicker-year').html(), Date.getMonthNumberFromName($('.ui-datepicker-title .ui-datepicker-month').html()),currentDate[2]);
+			$('#calendar').fullCalendar('gotoDate',$(this).siblings('span').html(), Date.getMonthNumberFromName($(this).html() == 'Março' ? 'Mar' : $(this).html()),'01');
  			$('#calendar').fullCalendar( 'changeView', 'month');
 		});
@@ -221,6 +220,5 @@
 		$('.ui-datepicker-title .ui-datepicker-year').live('click',function(){
 			$tabs.tabs("select", "#calendar");
-			var currentDate = $.fullCalendar.formatDate($('#calendar').fullCalendar('getDate'), "yyyy-MM-dd").split('-');
-			$('#calendar').fullCalendar('gotoDate',$('.ui-datepicker-title .ui-datepicker-year').html(), Date.getMonthNumberFromName($('.ui-datepicker-title .ui-datepicker-month').html()), currentDate[2]);
+			$('#calendar').fullCalendar('gotoDate',$(this).html(), '0', '01');
 			$('.fc-button-year').click();
 		});
@@ -278,8 +276,20 @@
       -----------------------------------------------------------------*/
 		$(".button.add.add-event").click(function(event){
+			var startEvent = new Date(); 
+			if(startEvent.toString('mm') < 30)
+				startEvent.add({minutes: 30 - parseInt(startEvent.toString('mm'))});
+			else
+				startEvent.add({hours: 1, minutes: '-'+startEvent.toString('mm')});
+			var endEvent = function(date){
+				if(!!User.preferences.defaultCalendar){
+					return Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration != "" ? 
+						(parseInt(date.getTime()) + Calendar.signatureOf[User.preferences.defaultCalendar].calendar.defaultDuration * 60000) 
+						: (User.preferences.defaultDuration * 60000);
+				}else
+					return parseInt(date.getTime()) + (User.preferences.defaultDuration * 60000);
+			};	
 			eventDetails({ 
-				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)
+				startTime: startEvent.getTime(),
+				endTime: endEvent(startEvent)
 			}, true );
 		});
@@ -309,5 +319,5 @@
 			month: 'MMMM yyyy',                             
 			week: "dd[ yyyy] { 'a'[ MMM] dd 'de' MMMM '-' yyyy}", 
-			day: 'dddd,  dd MMM , yyyy'
+			day: 'dddd,  dd MMM, yyyy'
 		},
 		columnFormat:{
@@ -317,5 +327,5 @@
 		},
 		monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho', 'Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro' ], 
-		monthNamesShort: ['Jan','Fev','Mar','Abr','Maio','Jun','Jul','Ago','Set','Out','Nov','Dez'],
+		monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'],
 		dayNames: [ 'Domingo', 'Segunda', 'Terça', 'Quarta', 'Quinta', 'Sexta', 'Sábado'],
 		dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
Index: /trunk/prototype/modules/calendar/templates/calendar_list.ejs
===================================================================
--- /trunk/prototype/modules/calendar/templates/calendar_list.ejs	(revision 5341)
+++ /trunk/prototype/modules/calendar/templates/calendar_list.ejs	(revision 5381)
@@ -29,6 +29,6 @@
 							<ul>
 								<li><a href="#" onclick="add_tab_configure_calendar(<%= agendas_usuario[i].id%>);">Configurações</a></li>
-								<li><a href="#" onclick="show_modal_import_export(0);">Importar</a></li>
-								<li><a href="#" onclick="show_modal_import_export(1);">Exportar</a></li>
+								<li><a href="#" onclick="show_modal_import_export(0, <%= agendas_usuario[i].id%>);">Importar</a></li>
+								<li><a href="#" onclick="show_modal_import_export(1, <%= agendas_usuario[i].id%>);">Exportar</a></li>
                                 <li><a href="#" onclick="remove_calendar();">Remover agenda</a></li>
 							</ul>
