%doctype;
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <!-- $Id: calendar.txt,v 5.9 2007-07-25 15:01:02 ddr Exp $ -->
  <!-- Copyright (c) 1998-2007 INRIA -->
  <title>[*calendar/calendars]1</title>
  <meta name="robots" content="none"%/>
  <meta http-equiv="Content-Type" content="text/html; charset=%charset;"%/>
  <meta http-equiv="Content-Style-Type" content="text/css"%/>
  <link rel="shortcut icon" href="%image_prefix;/favicon_gwd.png"%/>
%include.css;
%base_header;
</head>
<body%body_prop;>
%message_to_wizard;

%if;not cancel_links;
  <table style="float:%right;"><tr><td>
    %if;(referer != "")
      <a href="%referer;"><img
       src="%image_prefix;/left.png"%wid_hei;left.png; 
       alt="&lt;&lt;" title="&lt;&lt;"%/></a>
    %end;
    <a href="%prefix;"><img%sp;
    src="%image_prefix;/up.png"%wid_hei;up.png; 
    alt="^^" title="^^"%/></a>
  </td></tr></table>
%end;

<h1>[*calendar/calendars]1</h1>

%define;fun_day(ccc, nnn)
  <td><input type="submit" name="dccc1" value=" &lt; "%/></td>
  <td><input name="dccc" size="2" maxlength="2" value="%date.nnn.day;"%/></td>
  <td><input type="submit" name="dccc2" value=" &gt; "%/></td>
%end;

%define;fun_month(ccc, nnn, vvv, lll)
  <td><input type="submit" name="mccc1" value=" &lt; "%/></td>
  <td align="center">
    <select name="mccc">
      %foreach;integer_range(1, vvv)
        <option value="%integer;"%nn;
         %if;(integer = date.nnn.month) selected="selected"%end;>%nn;
           %apply;capitalize%with;%apply;nth("lll", integer-1)%end;
        </option>
      %end;
    </select>
  </td>
  <td><input type="submit" name="mccc2" value=" &gt; "%/></td>
%end;

%define;fun_year(ccc, nnn)
  <td><input type="submit" name="yccc1" value=" &lt; "%/></td>
  <td><input name="yccc" size="6" maxlength="6" value="%date.nnn.year;"%/></td>
  <td><input type="submit" name="yccc2" value=" &gt; "%/></td>
%end;

%define;fun_julian_year(ccc, nnn)
  %let;year;
    %if;(date.julian.month < 3 or
         date.julian.month = 3 and date.julian.day < 25)
      %expr(date.nnn.year - 1)/%expr(date.nnn.year % 10)
    %else;%date.nnn.year;%end;
  %in;
  <td><input type="submit" name="yccc1" value=" &lt; "%/></td>
  <td><input name="yccc" size="6" maxlength="6" value="%year;"%/></td>
  <td><input type="submit" name="yccc2" value=" &gt; "%/></td>
%end;

%define;calendar(ccc, nnn, vvv, lll, fun_yyy)
  %if;([ !dates order] = "ddmmyy" or [ !dates order]0 = "ddmmyyyy" or [ !dates order]0 = "dmyyyy")
    %apply;fun_day("ccc", "nnn")
    %apply;fun_month("ccc", "nnn", "vvv", "lll")
    %apply;fun_yyy("ccc", "nnn")
  %elseif;([ !dates order] = "mmddyyyy")
    %apply;fun_month("ccc", "nnn", "vvv", "lll")
    %apply;fun_day("ccc", "nnn")
    %apply;fun_yyy("ccc", "nnn")
  %else;
    %apply;fun_yyy("ccc", "nnn")
    %apply;fun_month("ccc", "nnn", "vvv", "lll")
    %apply;fun_day("ccc", "nnn")
  %end;
  <td><input type="submit" name="tccc" value=" = "%/></td>
%end;

<table border="%border;" width="100%%"><tr><td align="center">

<table border="%border;">
<tr>
<td align="%left;">
  - %apply;capitalize%with;%apply;nth([(week day)], date.week_day)%end; -
  %if;(date.julian_day = today.julian_day)<tt>%time;</tt>%end;
</td>
</tr>
<tr><td align="%left;">&nbsp;</td></tr>
<tr>
<td align="center">
  <form method="get" action="%action;">
  <p>
  %hidden;
  <input type="hidden" name="m" value="CAL"%/>
  </p>
  <table border="1">
  <tr align="%left;">
  <td>&nbsp;</td>
  %if;([ !dates order] = "ddmmyy" or [ !dates order]0 = "ddmmyyyy" or [ !dates order]0 = "dmyyyy")
    <th align="center" colspan="3">[*year/month/day]2</th>
    <th align="center" colspan="3">[*year/month/day]1</th>
    <th align="center" colspan="3">[*year/month/day]0</th>
  %elseif;([ !dates order] = "mmddyyyy")
    <th align="center" colspan="3">[*year/month/day]1</th>
    <th align="center" colspan="3">[*year/month/day]2</th>
    <th align="center" colspan="3">[*year/month/day]0</th>
  %else;
    <th align="center" colspan="3">[*year/month/day]0</th>
    <th align="center" colspan="3">[*year/month/day]1</th>
    <th align="center" colspan="3">[*year/month/day]2</th>
  %end;
  <td>&nbsp;</td>
  </tr>
  <tr align="%left;">
  <th>[*gregorian/julian/french/hebrew]0</th>
  %apply;calendar("g", "gregorian", 12, [(month)], "fun_year")
  </tr>
  <tr align="%left;">
  <th>[*gregorian/julian/french/hebrew]1</th>
  %apply;calendar("j", "julian", 12, [(month)], "fun_julian_year")
  </tr>
  <tr align="%left;">
  <th>[*gregorian/julian/french/hebrew]2</th>
  %apply;calendar("f", "french", 13, [(french revolution month)], "fun_year")
  </tr>
  <tr align="%left;">
  <th>[*gregorian/julian/french/hebrew]3</th>
  %apply;calendar("h", "hebrew", 13, [(hebrew month)], "fun_year")
  </tr>
  </table>
  </form>
</td>
</tr>
<tr>
<td align="center">
  %if;(date.moon_phase.index != 0)
    %apply;capitalize%with;
      %apply;nth([moon age/new moon/first quarter/full moon/last quarter],
                 date.moon_phase.index) -%sp;
      <tt>%date.moon_phase.hour;:%date.moon_phase.minute;</tt> UT
    %end;
  %end;
  <br%/>
  <span style="font-size:80%%">(%nn;
    [moon age/new moon/first quarter/full moon/last quarter]0%sp;
    = %date.moon_age;)</span>
  <br%/><br%/>
  [*julian day]:%sp;
    %if;(date.julian_day < 1000)%date.julian_day;
    %else;%date.julian_day.sep1000;%end;
</td>
</tr>
</table>

</td></tr></table>

%base_trailer;
%copyright;
</body>
</html>
