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

    File:               fac_menu.asp
    Status:             95%
    Description:        dit is de 'wrapper' voor de diverse andere schermen

    Parameters:         menu_key
                        menuitem_key
    Context:
    Note:

*/ %>

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

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

var autfunction = "WEB_PRSSYS";
var authparams = user.checkAutorisation(autfunction);

var copy = getQParamInt("copy", 0) == 1;

var menu_key = getQParamInt("menu_key", -1);
var menuitem_key = getQParamInt("menuitem_key", -1);
var mobilemenu = S("mobile_enabled") && getQParamInt("mobile", 0) == 1;

var readonly = !(authparams.PRSwritelevel< 9 || authparams.ALGwritelevel < 9);

%>

<html>
  <head>
<%
   FCLTHeader.Generate();
%>
    <script>
      <% if (menu_key == -1 || copy) { %>FcltMgr.startEdit(window);<% } %>

      function facClose(params)
      {
          <% if (menu_key == -1 || copy)
             { %>
              if (params.cancel)
              {
                  FcltMgr.closeDetail(window, params );
                  return true;
              }
              if (!params.keepForm)
                  window.location.href = "fac_menu.asp?verynew=1&menu_key=" + params.menu_key + "&menuitem_key=" +params.menuitem_key;
          <% } else { /* Bestaande melding bewerkt, switch naar show-mode */ %>
              if (params.close)
              {
                FcltMgr.closeDetail(window, { close: true})
              }
              if (!params.keepForm && !params.deleted)
                  $("#menuFrame")[0].src = "fac_show_menu.asp?menu_key=<%=menu_key%>&menuitem_key=<%=menuitem_key%>";
          <% } %>
      }
    </script>
  </head>

<body>
<%
PAGE_START();
if (menu_key == -1 || copy)
    var page="fac_edit_menu.asp"; // Maak een nieuw
else
    var page="fac_show_menu.asp";
page += "?"+(mobilemenu ? "mobile=1&" : "")+(copy ? "copy=1&" : "")+"menu_key="+menu_key+"&menuitem_key="+menuitem_key;

IFRAMER("menuFrame", page, { FcltClose: "facClose", title: L("lcl_fac_menuoptie") });
PAGE_END();%>
</body>
</html>
<% ASPPAGE_END(); %>
