var d = new Date();
var theMonth = d.getMonth()+1;
var theYear = d.getFullYear();

function getCalendarMonth (action) {
	
	if (action == 'previous') {
		if (theMonth == 1) {
			theYear = theYear - 1;
			theMonth = 12;
		}
		else {
			theMonth = theMonth - 1;	
		}
	}
	else {
		if (theMonth == 12) {
			theYear = theYear + 1;
			theMonth = 1;
		}
		else {
			theMonth = theMonth + 1;	
		}
	}
	var aj = new Ajax.Updater('calendarUpdateContainer', 'ajaxStuff.php', {method: 'post', parameters: 'updateCalendar=1&year='+theYear+'&month='+theMonth});
}

function getEventDay(day,month,year) {
	if ($('newsPages') != null) $('newsPages').hide();
	var aj = new Ajax.Updater('eventsContainer', 'ajaxStuff.php', {method: 'post', parameters: 'eventCalendar=1&year='+year+'&month='+month+'&day='+day});
}
