for(int i = 0; i < rs.size(); i ++)
{
BN_Base node=(BN_Base)(rs.get(i));
int indexLast=node.getBaseId().lastIndexOf('-');
int indexFirst=node.getBaseId().indexOf('-');
String parent_id=node.getBaseId().substring(0,indexLast);
hasChild = "no";
if (indexLast == indexFirst){
hasChild = "yes";
}
%>
appendNode('<%=(node.getBaseId())%>',
'<%=parent_id%>',
'<%=(node.getBaseName())%>',
'javascript:linkToRight("<%=(node.getBaseId())%>","<%=hasChild%>")');
<%
%>
<%
}// end for