/* define variables */
var _SubmenuTimer = null;
var _NewsAnimateTimer = null;
var _Submenu = null;

$(document).ready(function(){						 
	$("#submenu").hover(
		function(){
			$(this).addClass('hover');
			_SubmenuTimer = setTimeout(function() {
				if ($('#submenu').hasClass('hover')) {
					$('#submenu-addon')
						.addClass('active')
						.stop()
						.animate({height:'318px'},400,'swing',function(){})
				};
			},200);
		},
		function(){
			clearTimeout(_SubmenuTimer);
			$(this).removeClass('hover');
			if ($('#submenu-addon').hasClass('active')){
				$('#submenu-addon')
					.removeClass('active')
					.stop()
					.animate({height:'0px'},300,null,function(){
						$('#submenu-addon')
						//	.css('height','auto')
						//	.css('display','none') ;
					 });
			}	
		});
	$(".important-line .bericht").css('opacity',0).css('display','block')
	$(".important-line").hover(
		function(){
		if($(this).find('.bericht-active').length==0) {
			$('.news-animate').stop().removeClass('news-animate');
			$(this).addClass('news-animate');
			$(this).find('bericht')
				.removeClass('bericht-hide');
			$('.bericht').not('.news-animate').stop()
				.css('z-index',0)
				.removeClass('bericht-active')
				.addClass('bericht-hide');		
			$(this).
				find('.bericht')
					.css('z-index',2) 
					.addClass('bericht-active')
					.animate({opacity: 1},500,null,function(){
						$('.news-animate').removeClass('news-animate');
						$('.bericht').not('.bericht-active').css('opacity',0).removeClass('bericht-hide');
					});		
			}
		},function(){});
});

