$(document).ready(function() {
  $('#calendar').fullCalendar({
    events: $.fullCalendar.gcalFeed(
      "http://www.google.com/calendar/feeds/sportypeople.net_snfnk4u8rd04lpg9r0697doma8%40group.calendar.google.com/public/basic"
    ),
    defaultView: 'basicWeek',
    header: {right: 'basicWeek,month today prev,next'},
    firstDay: 1,
    timeFormat: "H:mm",
    columnFormat: "ddd d/M",
    eventClick: function(event, element) {
      return false;
    },
    eventRender: function(calEvent, element) {
      var tipContent = "<strong>" +
			$.fullCalendar.formatDate(calEvent.start,"H:mm") + " - " +
			$.fullCalendar.formatDate(calEvent.end,"H:mm") + "</strong><br/>" +
			calEvent.title;
			if (typeof calEvent.location != 'undefined') {
				tipContent +=  '<br/>' + calEvent.location;
			}
			if (typeof calEvent.description != 'undefined') {
				tipContent +=  '<br/>' + calEvent.description;
			}
      
			$(element).qtip({
				content: tipContent,
				position: {
					corner: {
						target: 'leftMiddle',
						tooltip: 'rightMiddle'
					}
				},
				border: {
					radius: 4,
					width: 3
				},
				style: {
					name: 'light',
					tip: 'rightMiddle',
					border: {width: 3, radius: 6},
				},
        hide: {delay: 333, fixed: true}
			});
    }
  })
});
