<%@language = "javascript" %>
<%
/*  $Revision$
    $Id$

    File:               kpn_kpn.asp
    Description:        dit is de grote 'wrapper' voor de diverse andere schermen

    Parameters:         kpn_key

    Context:
    Note:

*/ %>

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

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

  var kpn_key = getQParamInt("key", -1);
%>

<html>
  <head>
<%
   FCLTHeader.Generate();
%>
  <script  type="text/javascript" >
<%    if (kpn_key == -1) { %>FcltMgr.startEdit(window);<% } %>
      function kpnClose(params)
      {
          <% if (kpn_key == -1)
             { %>
              if (params.cancel)
              {
                  FcltMgr.closeDetail(window, params );
                  return true;
              }
              if (!params.keepForm)
                  window.location.href = "kpn_kpn.asp?verynew=1&key=" + params.kpn_key;
          <% } else { /* Bestaande kpn bewerkt, switch naar show-mode */ %>
              if (params.close)
              {
                FcltMgr.closeDetail(window, { close: true})
              }
              if (!params.keepForm && !params.deleted)
                  $("#kpnFrame")[0].src = "kpn_show_kpn.asp?kpn_key=<%=kpn_key%>";
          <% } %>
      }
    </script>
  </head>

<body>
<%
if (kpn_key == -1)
    var page="kpn_edit_kpn.asp"; // Maak een nieuw
else
    var page="kpn_show_kpn.asp";
page += "?kpn_key="+kpn_key;
IFRAMER("kpnFrame", page, { initHeight: "200px", FcltClose: "kpnClose" } );

var authparams = user.checkAutorisation("WEB_FINMSU", true);

if (authparams && authparams.ALGwritelevel < 9 && kpn_key > -1)
{
    page = "kpn_kpncat_list.asp?kpn_key=" + kpn_key;
    IFRAMER("kpncatlist", page, { refreshOnClose: true} );
}

%>
</body>
</html>
