function init(){
	$('#calendar .next a').click(function(){
		$.get($(this).attr('href'), function(data){
			$('#calendar').html(data);
			init();
		});
		$('.events').hide();
		return false;
	});

	$('#calendar .prev a').click(function(){
		$.get($(this).attr('href'), function(data){
			$('#calendar').html(data);
			init();
		});
		$('.events').hide();
		return false;
	});

	$('.day').hover(
		function(){
			var el = $('.'+$(this).attr('id'));
			var o = $(this).offset();
			$('.events').hide();
			if (el.css('display')=='block')
				el.hide();
			else
			{
				var h = el.innerHeight();
				el.css('top', ( o.top - h  + 30 ) +'px').css('left', (o.left + 15)+'px').show();
			}
		}
	);

	$('.events').hover(
		function(){ return true; },
		function(){
			$(this).hide();
		}
	);
}

$(function(){

	$.get("call.php", function(data){
		$('#calendar').html(data);
		init();
	});

});


function Aktivieren(n) {
 			document.getElementById('stoerertext'+n).style.visibility = "visible";
			}
function stoerershow() {
		timeout = setTimeout("Aktivieren(1)",2000);
		}

