$(document).ready(function(){
	$('#header').mouseenter(function() {
		closeSubnavigations();
	});
	
	$('#content').mouseenter(function() {
		closeSubnavigations();
	});
	
	$('#site').mouseleave(function() {
		closeSubnavigations();
	});
	
	$('.navigation_button').mouseenter(function() {
		closeSubnavigations();
	});
	
	$('#navigation_calendar_button').unbind().mouseenter(function() {
		$('#subnavigation_calendar').slideDown('fast');
	});
	
	$('#subnavigation_calendar').find('a').each(function(index) {
		$(this).mouseenter(function() {
			$('#subnavigation_month').slideUp('fast');
		});
	});
	
	$('#calendar_monthview_button').unbind().mouseenter(function() {
		$('#subnavigation_month').slideDown('fast');
	});
});

function closeSubnavigations() {
	$('#subnavigation_calendar').slideUp('fast');
	$('#subnavigation_month').slideUp('fast');
}
