var now = new Date();
var curMonth = now.getMonth()+1;
var curYear = now.getYear();
var divName = 'calendarGrid';

if( curYear < 2000 ) { 
	curYear = curYear + 1900; 
}
	
function getCalendar() {
	new Ajax('http://www.virginiasymphony.org/Concerts/concertCalendar.php?month='+curMonth+'&year='+curYear, { 
		method: 'get',
		update: $(divName),
		onComplete: addTips
	} ).request();
}

function getMonth( direction ) {
	if( direction == "prev" ) {
		if( curMonth == 1 ) {
			curMonth = 12;
			curYear--;
		} else {
			curMonth--;
		}
	} else {
		if( curMonth == 12 ) {
			curMonth = 1;
			curYear++;
		} else {
			curMonth++;
		}
	}
	getCalendar( );
}

function addTips() {
        var myTips = new Tips( $$('.calTips'), {
                maxTitleChars: 50,
                className: 'homeTipsContent'
        } );
}


window.addEvent('load', function() { getCalendar(); } );
