<%@ page import="ro.emid.common.action.browse.adrese.BrowseAdresaAction" %>
<%@ page import="ro.emid.common.db.OpenSCGAccessDB" %>
<%@ page import="ro.emid.common.constants.GlobalAppConstants" %>
<%@ page import="ro.emid.common.utils.ObjectUtils" %>
<%@ page import="ro.emid.common.types.Localitate" %>
<%@ page import="ro.emid.common.db.adrese.AdreseHelper" %>

<%
    final String codMunicipiu = ObjectUtils.getStringValue( request.getParameter("idMunicipiu"));

    final Localitate[] localitati =  AdreseHelper.getAdreseDao().searchLocalitate2(codMunicipiu);
%>
fsdfsldflsd;fks;ldfk;lsdkf;lsdkf;sds
<respmesg>
    <% for (int i = 0; i < localitati.length; i++) {
        final Localitate localitate = localitati[i]; %>

        <div class="localitate">
            <span id="plusLocalitate<%=localitate.getCodLocal()%>">
                <nobr>
                    <% if( BrowseAdresaAction.Util.isCheckMode(request)){ %>
                        <input type="checkbox" name="<%=BrowseAdresaAction.P_CHECK_LOCAL%>" value="<%=localitate.getCodLocal()%>" onclick="browseAdresaCancelPropagation( this, event, 'straziLocalitate<%=localitate.getCodLocal()%>')"/>
                        <%--see browseAdresa.jsp for browseAdresaCancelPropagation--%>
                    <% } %>
                    <%=localitate.getDenumireLocalitate()%>
                </nobr>
            </span>
            <div id="straziLocalitate<%=localitate.getCodLocal()%>" class="childsContainer">
                 strazi ..
            </div>
        </div>

        <script type="text/javascript">
           var plusLocalitate<%=localitate.getCodLocal()%> = new Plus( "plusLocalitate<%=localitate.getCodLocal()%>", "straziLocalitate<%=localitate.getCodLocal()%>", function(){
               selectNode( this.obj);
               if( !this.loaded && this.getStatus() == PlusConstants.STATUS_MINUS){
                   $("straziLocalitate<%=localitate.getCodLocal()%>").innerHTML = "Se incarca ...";

                   new Ajax.Request('<%=GlobalAppConstants.APP_NAME%>?action=callcenter_browseGeo_loadStrazi', {
                            method: 'post',
                            parameters: "idLocalitate=<%=localitate.getCodLocal()%>" ,
                            onComplete: function (originalRequest){
                                var response = getResponseMesg( originalRequest.responseText);

                                $( "straziLocalitate<%=localitate.getCodLocal()%>").innerHTML = response;

                                plusLocalitate<%=localitate.getCodLocal()%>.loaded = 1;

                                ScriptsUtils.evalScripts( response, false);
                            }
                   });
               }
           });
        </script>
    <% } %>
</respmesg>
