$(document).ready(function(){
	$('#hauptnavigation li').each(function(){
		var current = $(this);
		var zufall = Math.round(Math.random()*2000);
		current.css({marginTop: "-200px"});
		setTimeout(function(){current.animate({marginTop: 0},zufall+2000,"easeOutElastic");},300);
		var title = current.find('.nav_symbol').html();
		current.append('<p class="popup_up"><span>'+title+'</span><p>');
	});
	$('#metanavigation li').each(function(){
		var current = $(this);
		var zufall = Math.round(Math.random()*2000);
		current.css({marginBottom: "-200px"});
		setTimeout(function(){current.animate({marginBottom: 0},zufall+2000,"easeOutElastic");},700);
		var title = current.find('.nav_symbol').html();
		current.append('<p class="popup_down"><span>'+title+'</span></p>');
	});
	$('.popup_up, .popup_down').css({opacity: 0});
	$('.nav_symbol').not('.menu_current').css({opacity: 0.3});
	$('#hauptnavigation li, #metanavigation li').mouseenter(function(){
		$(this).find('.nav_symbol').stop().animate({opacity: 1},500);
		$(this).find('.popup_down').stop().animate({opacity: 1, top: "-60px"},500);
		$(this).find('.popup_up').stop().animate({opacity: 1, bottom: "-50px"},500);
	}).mouseleave(function(){
		$(this).find('.nav_symbol').not('.menu_current').stop().animate({opacity: 0.3},500);
		$(this).find('.popup_down').stop().animate({opacity: 0, top: "-80px"},500);
		$(this).find('.popup_up').stop().animate({opacity: 0, bottom: "-70px"},500);
	});
});

