$(document).ready(function() {
	
	var fontcookie = $.cookie('fontsize');
	var fontcookie2 = $.cookie('fontweight');
	if (fontcookie) {
		$('body').css('font-size',fontcookie);
	}
	if (fontcookie2) {
		$('#navigation ul li a').css('font-weight',fontcookie2);
	}
	
	$('a#font-size-up').click(function() {
		var fontsize = parseInt($('body').css('font-size'));
		fontsize++;
		$('body').css('font-size',fontsize+'px');
		if(fontsize > 12) {
			var fontweight = 'normal';
			$('#navigation ul li a').css('font-weight',fontweight);
		}
		$.cookie('fontsize',fontsize+'px', { expires: 7, path: '/' });
		$.cookie('fontweight',fontweight, { expires: 7, path: '/' });
		return (false);
	});
	
	$('a#font-size-down').click(function() {
		var fontsize = parseInt($('body').css('font-size'));
		fontsize--;
		$('body').css('font-size',fontsize+'px');
		if(fontsize <= 12) {
			var fontweight = 'bold';
			$('#navigation ul li a').css('font-weight',fontweight);
		}
		$.cookie('fontsize',fontsize+'px', { expires: 7, path: '/'});
		$.cookie('fontweight',fontweight, { expires: 7, path: '/'});
		return (false);
	});
	
	$('a#top').click(function() {
//		var href = $(this).attr('href');
		$.scrollTo( '#content', 800 );
		return(false);
	});
	
	// Kalenderlayer
	$('div.calender-events').hide();
	$('table.kalender a.termin').bind('mouseover', 
		function() {
			$('div.calender-events').hide();
			$(this).next('div.calender-events').show();
	});
	$('div.calender-events').bind('mouseleave', 
		function() {
			$(this).hide();
	});
	
	
});
