var animationSpeed = 250;	// Geschwindigkeit der Animation
var fadeInSpeed = 500;		// Geschwindigkeit des Einblendens des austauchbaren Bereichs
var fadeOutSpeed = 500;		// Geschwindigkeit des Ausblendens des austauchbaren Bereichs
var outHeight = 53;		// Hoehe eines Buttons im Mouseout-Zustand
var overHeight = 78;		// Hoehe eines Buttons beim Mouseover-Zustand

$(document).ready(function(){
	$(".mainNav").find("li").find("h1").find("a").each(function(index) {
		var elementLink = $(this).attr("href");
		var elementContent = $(this).html();
		$(this).parent().parent().parent().click(function() {
			window.location.href = elementLink;
		});
		$(this).parent().html(elementContent);
	});
	$(".mainNav").find("li").hover(function() {
		mouseoverAnimation(this);
	}, function() {
		mouseoutAnimation(this);
	});
});

function mouseoverAnimation(e) {
	var buttonIndex = $(".mainNav").find("li").index(e);
	$(e).animate({height: overHeight+"px"},{queue:false,duration:animationSpeed});
	$(e).addClass("hover");
}

function mouseoutAnimation(e) {
	$(e).animate({height: outHeight+"px"},{queue:false,duration:animationSpeed});
	$(e).removeClass("hover");
	var buttonIndex = $(".mainNav").find("li").index(e);
}

