<%@language = "javascript" %>
<%  // testing: bes_key=1251054

/*  $Revision$
    $Id$

    File:           alg_district.asp
    Status:
    Description:

    Parameters:

    Context:
    Note:

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

<%
FCLTHeader.Requires({plugins:["suggest","jQuery"], js: ["jquery-ui.js"]})

var dis_key = getQParamInt("key", -1);

if (dis_key > 0)
{
  sql = " select alg_district_omschrijving "
      + "  FROM alg_district "
      + "  WHERE alg_district_key = " + dis_key;

   var oRs = Oracle.Execute(sql);
   var dis_name = oRs("alg_district_omschrijving").value;
   oRs.Close()
}
else
{
  var dis_name = "";
}
%>

<html>
  <head>
<%  FCLTHeader.Generate(); %>
    <script  type="text/javascript" >
      FcltMgr.setTitle(L("lcl_district") + " " + "<%=safe.jsstring(dis_name)%>", {hot: false});
<%    if (dis_key == -1) { %>FcltMgr.startEdit(window);<% } %>
      function algClose(params)
      {
          <% if (dis_key == -1)
             { %>
              if (params.cancel)
              {
                  FcltMgr.closeDetail(window, params );
                  return true;
              }
              if (!params.keepForm)
                  window.location.href = "alg_district.asp?verynew=1&key=" + params.dis_key;
          <% } else { /* Bestaand district bewerkt, switch naar show-mode */ %>
              if (params.close)
              {
                FcltMgr.closeDetail(window, { close: true})
              }
              if (!params.keepForm)
                  $("#algFrame")[0].src = "alg_show_district.asp?dis_key=<%=dis_key%>";
          <% } %>
      }
    </script>
  </head>

  <body>
<%  if (dis_key == -1)
      var page="alg_edit_district.asp"; // Maak een nieuw
    else
      var page="alg_show_district.asp";
    page += "?dis_key="+dis_key;

    IFRAMER("algFrame", page, { title: L("lcl_alg_district_frame"),
                                initHeight: "450px",
                                FcltClose: "algClose" } );
%>
  </body>
</html>
