/**
 * 
 */

jQuery(document).ready(function() {
	
	var timerLeft = setTimeout("hideLeftContainer()", 1200);
	var timerRight = setTimeout("hideRightContainer()", 1200);
	
	//show left main menu
	jQuery("#avprojekte_link").hover(
		function () {
			clearTimeout(timerLeft);
			jQuery("#nav-mainmenu-left").slideDown();
		},
		function(){
			timerLeft = setTimeout("hideLeftContainer()", 1200);
		}
	);
	
	//show right main menu
	jQuery("#seminar_link").hover(
		function(){
			clearTimeout(timerRight);
			jQuery("#nav-mainmenu-right").slideDown();
		},
		function(){
			timerRight = setTimeout("hideRightContainer()", 1200);
		}
	);
	
	//show menu if mouse over
	jQuery("#nav-mainmenu-left-container").hover(
		function(){
			//clear timeout for showing the menu - stop hiding menu
			clearTimeout(timerLeft);
		},
		function(){
			timerLeft = setTimeout("hideLeftContainer()", 1200);
		}	
	);
	
	//show menu if mouseover
	jQuery("#nav-mainmenu-right-container").hover(
		function(){
			//clear timeout for showing the menu - stop hiding menu
			clearTimeout(timerRight);
		},
		function(){
			timerRight = setTimeout("hideRightContainer()", 1200);
		}	
	);
		
	
});

function hideLeftContainer(){
	jQuery("#nav-mainmenu-left").slideUp();
}

function hideRightContainer(){
	jQuery("#nav-mainmenu-right").slideUp();
}
