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

     File:               loadCalendar.asp
     Description:        Maak kalender
     Parameters:
        mld_key:         mld_melding_key van de betreffende melding waarvan de gereed/eind datum
        doorlooptijd:    doorlooptijd in dagen
     Context:
     Note:
*/ %>

<%
DOCTYPE_Disable = true;
%>

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

<%
// Maak een kalender

// De functie FCLTcalendar verwacht dat alle parameters htmlsafe zijn
// Bij wijze van uitzondering forceren we dat hier
var cal_id = safe.htmlattr(getQParam("cal_id"));
var label = safe.htmlattr(getQParam("label", ""));
var datum = getQParamDate("datum", new Date);
var onChangeCode = getQParam("onChangeCode", "");
var onChange = "";
switch (onChangeCode)
{
    case "1": onChange = "onChangeEnddate();"; break;
    case "2": onChange = "get_freeprk_info();"; break;
    case "3": onChange = "DateChanged();"; break;
}
var onChangeDate = ""; // unsupported
var onChangeTime = ""; // unsupported
//var onChangeDate = safe.htmlattr(getQParam("onChangeDate", ""));
//var onChangeTime = safe.htmlattr(getQParam("onChangeTime", ""));
var volgnr = getQParamInt("volgnr", -1);
var calendars = getQParamInt("calendars", -1);
var readonly = (getQParamInt("readonly", 0) == 1);
var timeField = (getQParamInt("timeField", 0) == 1);
var initEmpty = (getQParamInt("initEmpty", 0) == 1);
var initTimeEmpty = (getQParamInt("initTimeEmpty", 0) == 1);
var required = (getQParamInt("required", 0) == 1);
var autoopen = (getQParamInt("autoopen", 0) == 1);
var selectableDays = getQParamInt("selectableDays", 0);
var saveValue = (getQParamInt("saveValue", 0) == 1);
// minPast en minFuture worden vooralsnog niet doorgegeven.
var maxPast = getQParamInt("maxPast", -1);
var maxFuture = getQParamInt("maxFuture", -1);
var minDate = getQParamDate("minDate", null);
var maxDate = getQParamDate("maxDate", null);
var addClass = safe.htmlattr(getQParam("addClass", ""));
var hidden = (getQParamInt("hidden", 0) == 1);

params = { datum: datum };
if (label != "")
  params.label = label;
if (calendars > 0)
  params.calendars = calendars;
if (volgnr > 0)
  params.volgnr = volgnr;
if (onChange != "")
  params.onChange = onChange;
if (onChangeDate != "")
  params.onChangeDate = onChangeDate;
if (onChangeTime != "")
  params.onChangeTime = onChangeTime;
if (timeField)
{
  params.timeField = timeField;
  params.timeStep = parseFloat(getQParam("timeStep"));
  params.startTime = parseFloat(getQParam("startTime"));
  params.endTime = parseFloat(getQParam("endTime"));
}
if (initTimeEmpty)
  params.initTimeEmpty = true;
if (initEmpty)
  params.initEmpty = true;
if (required)
  params.required = true;
if (autoopen)
  params.autoopen = true;
if (selectableDays)
  params.selectableDays = selectableDays;
if (readonly)
  params.readonly = true;
if (saveValue)
  params.saveValue = true;
if (maxPast >= 0)
  params.maxPast = maxPast;
if (maxFuture >= 0)
  params.maxFuture = maxFuture;
if (minDate)
  params.minDate = minDate;
if (maxDate)
  params.maxDate = maxDate;
if (addClass != "")
  params.addClass = addClass;
if (hidden)
  params.hidden = true;

FCLTcalendar(cal_id, params);
%>
<% ASPPAGE_END(); %>
