var Calendar = {
	init: function() {
		// attach a listener to the next and previous links
		prev = $("#calendar th a.previous")
		prev_href = prev.attr("href").split("/")
		prev.click(function(){
			Calendar.get(prev_href.pop(), prev_href.pop())
			return false;
		});
		
		next = $("#calendar th a.next")
		next_href = next.attr("href").split("/")
 		next.click(function(){
			Calendar.get(next_href.pop(), next_href.pop())
			return false;
		});
		
		// console.log(prev_month + " " + prev_year);
		// console.log(next_month + " " + next_year);
	},
	
	get: function(month, year) {
		uri = "/pages/availability/"+year+"/"+month+".json";
		$.getJSON(uri, function(response){
			console.log(response);
		});
	},
	
	render: function() {
		return;
	}
};

$(function(){
	if (!$().piroBox)
		return false;
		
	$().piroBox({
		my_speed: 300,
		bg_alpha: 0.5,
		radius: 4,
		scrollImage: false,
		slideShow: true,
		slideSpeed: 3,
		pirobox_next: 'piro_next',
		pirobox_prev: 'piro_prev',
		close_all: '.piro_close'
	});
});