<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<!--[if IE]><base href="<% 
String baseURL = request.getRequestURL().toString().replace("/l2s/calendar/index.jsp", "/");
out.print(baseURL); %>"></base><![endif]-->
<!--[if !IE]>--><base href="../.." /><!--<![endif]-->
<link rel='stylesheet' type='text/css' href='l2s/calendar/themes/<% String theme = request.getParameter("theme"); if(theme == null || theme.equals("")) { out.print("cupertino"); }  else { out.print(theme); } %>/theme.css' />
<link rel='stylesheet' type='text/css' href='l2s/calendar/fullcalendar/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='l2s/calendar/fullcalendar/fullcalendar.print.css' media='print' />
<link rel='stylesheet' type='text/css' href='l2s/calendar/qtip/jquery.qtip.min.css' />
<script type="text/javascript" src="l2s/commons/core.js"></script>
<script type='text/javascript' src='l2s/calendar/jquery/jquery.js'></script>
<script type='text/javascript' src='l2s/calendar/jquery/jquery-ui.js'></script>
<script type='text/javascript' src='l2s/calendar/jquery/moment.min.js'></script>
<script type='text/javascript' src='l2s/calendar/fullcalendar/fullcalendar.js'></script>

<script type='text/javascript' src='l2s/calendar/qtip/jquery.qtip.min.js'></script>
<script type='text/javascript' src='l2s/calendar/qtip/imagesloaded.pkg.min.js'></script>

<script type='text/javascript' src='l2s/calendar/calendar.js.jsp'></script>

<script type='text/javascript'>
	$(document).ready(function() {
		var date = new Date();
		var d = date.getDate();
		var m = date.getMonth();
		var y = date.getFullYear();
		currentAspectRatio = 710 / (561 - 50);;
		$('#calendar').fullCalendar({
			slotMinutes: <% 
			    Object slotInterval = request.getSession().getAttribute("l2sCalendar_SlotMinutes"); 
				request.getSession().removeAttribute("l2sCalendar_SlotMinutes");
			    if(slotInterval == null || "".equals(slotInterval)) { 
				  out.print("60"); 
				}  else { 
				  out.print(String.valueOf(slotInterval)); 
				} %>,
			theme: true,
			hiddenDays: [0, 6],
			firstHour: 8,
			minTime: getURLParam('minTime') ? getTimeParam('minTime') : 0,
			maxTime: getURLParam('maxTime') ? getTimeParam('maxTime') : 24,
			axisFormat: 'HH:mm',
	        defaultView: _calendarConvertDescriptionToView('week'),
			<% String height = request.getParameter("height"); if(height == null || height.equals("")) { out.print("aspectRatio: currentAspectRatio"); }  else { out.print("height: " + height); } %>,
			/*header: {
				left: 'prev,next today',
				center: 'title',
				right: 'month,agendaWeek,agendaDay'
			},*/
			header: {
				left: '',
				center: '',
				right: ''
			},
			columnFormat: {
				month: 'ddd',
				week: 'ddd',
				day: 'dddd'
			},
			timeFormat: {
                 agenda: 'H:mm{ - H:mm}',
                 '': 'H(:mm)' 
            },
			allDayText: CALENDAR_PT_BR_allDayText,
			monthNames: CALENDAR_PT_BR_monthNames,
			monthNamesShort: CALENDAR_PT_BR_monthNamesShort,
			dayNames: CALENDAR_PT_BR_dayNames,
			dayNamesShort: CALENDAR_PT_BR_dayNamesShort,
			buttonText: {
				prev: '&nbsp;&#9668;&nbsp;',
				next: '&nbsp;&#9658;&nbsp;',
				prevYear: '&nbsp;&lt;&lt;&nbsp;',
				nextYear: '&nbsp;&gt;&gt;&nbsp;',
				today: CALENDAR_PT_BR_today,
				month: CALENDAR_PT_BR_month,
				week: CALENDAR_PT_BR_week,
				day: CALENDAR_PT_BR_day
			},
			editable: false,
			events: function (start, end, timezone, callback) { 
			          var onGetData = getURLParam('onGetData');
			          var events = callFlow(onGetData, [start, end, null]); 
					  var evtArray = eval(events);
					  _calendarSetEvents(evtArray);
					  callback(evtArray);
					},
			dayClick: _calendarOnDayClick,
			eventClick: _calendarOnEventClick,
			eventResize: _calendarOnEventChange,
			eventDrop: _calendarEventDrop,
			eventRender: function(event, element) {
				if(event.description) {
					element.qtip({
						content: event.description,
						style: { 
						name: 'light'
						},
						position: {
							corner: {
								target: 'bottomMiddle',
								tooltip: 'bottomMiddle'
							}	
						}
					});
				}
			},
			refresh: function () {
				$('#calendar').fullCalendar('refetchEvents');
			}
		});
	});
</script>
<style type='text/css'>
	body {
		margin-top: 0px;
		text-align: center;
		font-size: 14px;
		font-family: "Lucida Grande",Helvetica,Arial,Verdana,sans-serif;
		}

	#calendar {
		width: 100%;
		margin: 0 auto;
		}
	.fc-toolbar {
		display: none !important;
		height: 0px;
	}
</style>
</head>
<body>

<div id='calendar'></div>
<script type='text/javascript'>
document._calendar = {
  refresh: function () {
    $('#calendar').fullCalendar('refetchEvents');
  },
  
  gotoDate: function (date) {
    alert('Não permitido.');
  },
  
  changeView: function (format) {
    alert('Não permitido.');
  }
}
</script>
</body>
</html>