$(document).ready(function() {
	/*--- lightbox ---*/

	$('a[rel*=lightbox]').lightBox({
		imageLoading: '/images/lightbox-ico-loading.gif',
		imageBtnClose: '/images/lightbox-btn-close.gif',
		imageBtnPrev: '/images/lightbox-btn-prev.gif',
		imageBtnNext: '/images/lightbox-btn-next.gif'
	});

	/*--- END lightbox ---*/
	
	//$("body").initAnchorScroller({textTop: 'top', textBottom: 'bottom', textHome: 'home', textPrint: 'print'}); // anchor scroller
});


jQuery(document).ready(function() {

	/* --- calendar --- */

	function initCalendar() {
		// advance a month
		jQuery("#cal-next-month").click(function(e) {
			var cName = jQuery("#cal-next-month").attr("class");
			var y = cName.substr(6,4);
			var m = cName.substr(10,2);
			jQuery("#calendar-response").load("/util/ajaxresponse.php", { 'func': 'outputCalendar', 'y': y, 'm': m, 'eventsStrId':'68_ger' }, function() {
				initCalendar();
			});
			e.preventDefault();
		});

		// backtrack a month
		jQuery("#cal-prev-month").click(function(e) {
			var cName = jQuery("#cal-prev-month").attr("class");
			var y = cName.substr(6,4);
			var m = cName.substr(10,2);
			jQuery("#calendar-response").load("/util/ajaxresponse.php", { 'func': 'outputCalendar', 'y': y, 'm': m, 'eventsStrId':'68_ger'}, function() {
				initCalendar();
			});
			e.preventDefault();
		});
	}

	/* --- END calendar --- */
   initCalendar(); // initialize the calendar
});
