a&m nav - activeNodeId
I finally found a solution of my problem that makes the A&amp;M Nav plugin the perfect choice for me.

The general problem is that amnav offers this function to fetch the activenode id:

{% set activeNodeId = craft.amNav.getActiveNodeIdForLevel('mainmenu',1) %}


This doesn't help because:

Unfortunately the level1 (last parameter) is related to the structure in craft, not in the plugin. In my case the child of a menuitem is not necessarly a child in craft (e.g. a single content). 

That means, this function doesn't help me to get the children of a parent that has active children.

This code works to get the active menu item of the first level in the A&amp;M Nav structure:

{# for first level #}
{% set activeNodeId = craft.amNav.getActiveNodeIdForLevel('mainmenu',1) %}

{# for second level #}
{% set nav = craft.amNav.getNavRaw("mainmenu") %}

{% for item in nav %}
    {% if item.hasActiveChild or item.active %}
        {% set activeNodeId = item.id %}
        {% set activeNode = item %}
    {% endif %}
{% endfor %}