<%@ LANGUAGE = JavaScript %>
<% /*
     $Revision$
     $Id$

     Afdelingbrowser
*/ %>

<!-- #include file="../Shared/common.inc" -->
<!-- #include file="../Shared/iface.inc" -->
<!-- #include file="../Shared/kostenplaatsselector.inc" -->

<%
FCLTHeader.Requires({ plugins:["jQuery"] });

var autfunction = "WEB_PRSUSE";
var authparams = user.checkAutorisation(autfunction);
%>

<html>
  <head>
<%  FCLTHeader.Generate(); %>
    <script type="text/javascript">
      function doSubmit(plevel)
      {
          $("#afd_niveau").val(plevel);
          document.forms.u2.submit();
      }
    </script>
  </head>

  <body id="searchbody">
    <form name="u2" id="prsform" target="workFrame" action="prs_afdeling_search_list.asp" method="get">
      <% SEARCH_PAGE_START({ header: L("lcl_filterblok") });
      SEARCH_BLOCK_START();%>
        <input type="hidden" id="afd_niveau" name="afd_niveau" value="">
              <tr class="primsearch">
                <td class="label"><label for="deptName"><%=L("lcl_prs_dept_name")%></label></td>
                <td><input type="text" class="fld wildcard" id="deptName" name="deptName" value=""></td>
              </tr>
              <tr class="primsearch">
                <td class="label"><label for="deptDesc"><%=L("lcl_prs_dept_desc")%></label></td>
                <td><input class="fld wildcard" type="text" id="deptDesc" name="deptDesc" value=""></td>
              </tr>
<%
      SEARCH_BLOCK_END();
      SEARCH_BLOCK_START();
                FCLTkostenplaatsselector("prs_kstpl",
                                         "prs_kstpl",
                                         user_key,
                                         { label: L("lcl_prs_dept_kosten"),
                                           whenEmpty: L("lcl_search_generic"),
                                           trclass: "primsearch"
                                         });
      SEARCH_BLOCK_END();

      var buttons =  [];
      for (i = 1 ; i <= S("prs_max_dep_level") ; i++)
      {
        buttons.push ({title: L("lcl_dep_name_level" + i), action: "doSubmit("+i+")", id: "bSearch", icon: "fa-users" });
      }
      SIMPLE_BLOCK_START();
        CreateButtons(buttons, { entersubmit: true, showIcons: true });
      SIMPLE_BLOCK_END();
      SEARCH_PAGE_END();
%>
    </form>
    <div id="result">
      <iframe width="100%" height="100%"
              src="../Shared/empty.asp"
              name="workFrame" id="workFrame"
              onload="FcltMgr.iframeLoaded(this)"
              frameborder="0" scrolling="no">
      </iframe>
    </div>
  </body>
</html>
<% ASPPAGE_END(); %>
