function initMenuAnimation(navigation_id, slideDownInterval, slideUpInterval, itemHeight, theFontSize, fontSizeDelta, fUnbindSub, theFontSizeSub) {

    var ul_subelements = navigation_id + " li ul";
    var ul_li = navigation_id + " li";
    var theAncors = navigation_id + " a";
    var theSubAncors = navigation_id + " li ul li a";

    /* animate font size*/
    if (theFontSize > 0) {

        $(theAncors)
	    .css({ fontSize: theFontSize + "px" })
	    .mouseover(function() {
	        $(this).stop().animate(
			    { fontSize: theFontSize + fontSizeDelta + "px" },
			    { duration: 250 })
	    })
	    .mouseout(function() {
	        $(this).stop().animate(
			    { fontSize: theFontSize + "px" },
			    { duration: 70 })
	    })

        if (fUnbindSub == true) {
            $(theSubAncors).unbind('mouseover').unbind('mouseout');
            $(theSubAncors).css({ fontSize: theFontSizeSub + "px" });
        }
    }

    /*
    Animate submenu
    Optiones: easeOutBounce, linear, swing, easeInOutQuad, easeInOutCubic, easeInOutBounce
    */
    if (itemHeight > 0) {
        $(ul_subelements).css({ height: "0px" })//wichtig, damit der Effekt auch bei der ersten Berührung auftritt
        $(ul_li).mouseover(function() {
            $(this).find('>ul').stop().animate({ height: $(this).find('>ul').children().size() * itemHeight }, { queue: false, duration: 500, easing: 'easeInOutCirc' })
        });

        $(ul_li).mouseout(function() {
            $(this).find('>ul').stop().animate({ height: '0px' }, { queue: false, duration: 500, easing: 'easeInOutCirc' })
        });
    }
}


function slideText(navigation_id, pad_out, pad_in) {

    var link_elements = navigation_id + " li ul li a";

    $(link_elements).each(function(i) {
        $(this).hover(
    		function() {
    		    $(this).stop().animate({ marginLeft: pad_out }, 450);
    		},
    		function() {
    		    $(this).stop().animate({ marginLeft: pad_in }, 150);
    		});
    });

    var link_subelementsActive = navigation_id + " li ul li.active a";

    $(link_subelementsActive).each(function(i) {

        $(this).hover(
		function() {
		    $(this).stop().animate({ marginLeft: 0 }, 350);
		},
		function() {
		    $(this).stop().animate({ marginLeft: 0 }, 150);
		});
});
    
    $('#footer li').each(function(i) {

        $(this).hover(
		function() {
		    $(this).stop().animate({ marginLeft: 7 }, 550);
		},
		function() {
		    $(this).stop().animate({ marginLeft: 0 }, 250);
		});
    });
}

function fadeInHover() {

    //http://jqueryfordesigners.com/image-fade-revisited/
    if ($.browser.msie && $.browser.version < 7) return;

    $('#nav li')

    .find('a')
    .append('<span class="hover" />').each(function() {
        var $span = $('> span.hover', this).css('opacity', 0);

        $(this).hover(function() {
            $span.stop().fadeTo(700, 1);
        }, function() {
            $span.stop().fadeTo(1600, 0);
        });
    });
    
    $('#nav li ul li').find('span').removeClass("hover");

    /*   $("#nav li")

	    .css({ opacity: "0" })
    .mouseover(function() {
    $(this).stop().animate(
    { opacity: "1" },
    { duration: 650 })
    })
    .mouseout(function() {
    $(this).stop().animate(
    { opacity: "0" },
    { duration: 150 })
    })*/
}

function fadeInHoverTop() {

    if ($.browser.msie && $.browser.version < 7) return;

    $('#upper-header li')

    .find('a')
    .append('<span class="hover" />').each(function() {
        var $span = $('> span.hover', this).css('opacity', 0);

        $(this).hover(function() {
            $span.stop().fadeTo(700, 1);
        }, function() {
            $span.stop().fadeTo(1600, 0);
        });
    });
}


function fadeInHoverLeftNav() {

    if ($.browser.msie && $.browser.version < 7) return;

    $('#leftNav li')

    .find('a')
    .append('<span class="hover" />').each(function() {
        var $span = $('> span.hover', this).css('opacity', 0);

        $(this).hover(function() {
            $span.stop().fadeTo(900, 1);
        }, function() {
            $span.stop().fadeTo(1100, 0);
        });
    });

    $('#leftNav li.active')
    .find('span')
    .removeClass('hover');
    //.unbind('hover').unbind('mouseout');
}

