
(function($) {
$.fullCalendar.availFeed = function(feedUrl, options) {
options = options || {};
var draggable = options.draggable || false;
return function(start, end, callback) {
$.getJSON(feedUrl + "?callback=?",
{
'start': $.fullCalendar.formatDate(start, 'c'),
'end': $.fullCalendar.formatDate(end, 'c')
},
function(data) {
var events = [];
if (data.feed.entry)
$.each(data.feed.entry, function(i, entry) {
events.push({
id: entry['id'],
url: entry['url'],
title: entry['title'],
start: $.fullCalendar.parseDate(entry['start']),
end: $.fullCalendar.parseDate(entry['end']),
location: entry['location'],
description: entry['description'],
showTime: true,
className: options.className,
draggable: draggable
});
});
callback(events);
});
}
}
	$.fullCalendar.memberFeeds = function(feedUrl, calendar) {
$.getJSON(feedUrl,  function(data){
 $.each(data, function(i,item){
var type = item.type.toLowerCase();
if (type == "gcal" || type == "holiday") {
var feed = $.fullCalendar.gcalFeed(item.value, {
draggable: false,
className: type
});
calendar.fullCalendar('addEventSource',feed);
}
else if (type == "ical") {
 }
else {
 }
});
});
}
		
})(jQuery);
