<div id="topbar">
    <ul id='action' class='action'>
        {% for action, subactions in actions %}
        <li class='ui-widget ui-button ui-state-default ui-corner-all {% ifequal action.id action_selected.0 %} ui-state-active{% endifequal %}'>
            <a href='{{extra_url}}{{ action.path }}' onclick='jQuery("#map").chimere("saveExtent");'>{{ action.label }}</a>
        </li>
        {% endfor %}
    </ul>
    <ul id='action-2' class='action'>
    {% for action, subactions in actions %}
        {% ifequal action.id action_selected.0 %}{% if subactions %}
        {% for subaction in subactions %}
            <li class='ui-widget ui-button ui-state-default ui-corner-all{% ifequal subaction.id action_selected.1 %} ui-state-active{% endifequal %}'>
                <a href='{{extra_url}}{{ subaction.path }}' onclick='saveExtent();'>{{ subaction.label }}</a>
            </li>
        {% endfor %}
        {% endif %}{% endifequal %}
    {% endfor %}
    </ul>
</div>
