var Calendar = {
	getMonth: function(newDate) {
		if (typeof newDate != "undefined") {
			window.location.hash = "#"+newDate;
			var param = newDate + "/";
		} else {
			var param = "";
		}
		$.get(gRoot + "gigs/calendar/" + param, {}, function(response) {
			if (!response.success) {
				alert(response.error);
				return;
			}
			$("#calendar_wrapper").html(response.HTML);
			Cufon.replace('#calendar h2');
		}, "json");
	}
}

$(document).ready(function() {
	if (window.location.hash) {
		Calendar.getMonth(window.location.hash.substr(1));
	} else {
		Calendar.getMonth();
	}
});
