<%
    def xclass = OPTIONS.class? OPTIONS.class: 'default'; 
    def parentPath = OPTIONS.parentPath ? OPTIONS.parentPath : ''; 
%>
<table class="navbar ${xclass}-navbar" cellpadding="0" cellspacing="0">
<%
int counter = 0;
def scripts = new StringBuffer();
for( o in DATA ) {
    if (o.target) { 
        scripts.append('\$register({id:"'+o.hashid+'", page:"'+(o.href? o.href: o.path)+'", context:"'+o.context+'", title:"'+o.title+'", options:'+ com.rameses.anubis.JsonUtil.toString(o.options) +'}); '); 
    } 
%> 
    <tr class="navbar-row"> 
        <td class="navbar-col ${PAGE.path.startsWith( OPTIONS.buildMenuPath(o.path, o.folderid) ) ? 'selected' : 'unselected'}"> 
            <% if (o.target) {%> 
                <a class="navbar-action" href="#" onclick="javascript:Inv.showOpener(this)" r:target="${o.target}" r:hashid="${o.hashid}">${o.title}</a> 
            <% } else { %> 
                <a class="navbar-action" href="${parentPath}${o.href?o.href:o.path}">${o.title}</a> 
            <% } %>        
        </td>
        <td class="gap"><div>&nbsp;</div></td>
    </tr>
<%
	counter++;
}
println '<script>'+ scripts + '</script>';
%>
</table>
