// Google Calendar ****************************
document.addEventListener('DOMContentLoaded', function() {
	var calendarEl = document.getElementById('calendarGoogle');

	var calendar = new FullCalendar.Calendar(calendarEl, {

		plugins: [ 'interaction', 'dayGrid', 'list', 'googleCalendar' ],

		header: {
			left: 'prev,next today',
			center: 'title',
			right: 'dayGridMonth,listYear'
		},

		displayEventTime: false, // don't show the time column in list view

		// THIS KEY WON'T WORK IN PRODUCTION!!!
		// To make your own Google API key, follow the directions here:
		// http://fullcalendar.io/docs/google_calendar/
		googleCalendarApiKey: 'AIzaSyDcnW6WejpTOCffshGDDb4neIrXVUA1EAE',

		// US Holidays
		events: 'en.usa#holiday@group.v.calendar.google.com',

		eventClick: function(arg) {
			// opens events in a popup window
			window.open(arg.event.url, 'google-calendar-event', 'width=700,height=600');

			arg.jsEvent.preventDefault() // don't navigate in main tab
		},

	});

	calendar.render();
});