$(document).ready(function(){

     $.Lightbox.construct({
         "show_linkback":    false
     });

	jQuery('#panorama').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		timeout: 10000,
		speed: 2000
	});

    $( "#datepicker" ).datepicker({
			showButtonPanel: true,
			changeMonth: true,
			changeYear: true,
            showOtherMonths: true,
			selectOtherMonths: true,
            onChangeMonthYear: function(year, month, inst) { loadEvents(month, year); }
    });

    $( ".folders" ).tabs({
        collapsible: true,
        selected: -1,
        ajaxOptions: {
            error: function( xhr, status, index, anchor ) {
                $( anchor.hash ).html(
                "Error loading album." );
            }
        }
    });

	$( "#team" ).accordion({
			collapsible: true
    });

    loadEvents(0,0);
});

function loadEvents(month, year) {
    $.get('ajax/events.php', { month: month, year: year }, function(data) {
        $('#events').html(data);
    });
}

