From: "Salvato da Windows Internet Explorer 7"
Subject: Calendar Converter
Date: Fri, 6 Jun 2008 13:51:13 +0200
MIME-Version: 1.0
Content-Type: multipart/related;
	type="text/html";
	boundary="----=_NextPart_000_0000_01C8C7DC.62626FD0"
X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16545

This is a multi-part message in MIME format.

------=_NextPart_000_0000_01C8C7DC.62626FD0
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.fourmilab.ch/documents/calendar/

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" =
"http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML lang=3Den xml:lang=3D"en" =
xmlns=3D"http://www.w3.org/1999/xhtml"><HEAD><TITLE>Calendar =
Converter</TITLE>
<STYLE type=3Dtext/css>BODY.main {
	MARGIN-LEFT: 15%; COLOR: #000000; MARGIN-RIGHT: 10%; BACKGROUND-COLOR: =
#ffffff
}
DT {
	MARGIN-TOP: 1ex
}
INPUT.ctr {
	TEXT-ALIGN: center
}
P {
	TEXT-ALIGN: justify
}
P.c {
	TEXT-ALIGN: center
}
SPAN.bcad {
	TEXT-TRANSFORM: lowercase; FONT-VARIANT: small-caps
}
TABLE.a {
	FLOAT: right; MARGIN-LEFT: 12px; WIDTH: 170px
}
TABLE.l {
	BORDER-RIGHT: black 1px outset; BORDER-TOP: black 1px outset; FLOAT: =
left; BORDER-LEFT: black 1px outset; WIDTH: 45%; COLOR: #000000; =
MARGIN-RIGHT: 8px; BORDER-BOTTOM: black 1px outset; BACKGROUND-COLOR: =
#d0d0d0
}
TABLE.l TD {
	BORDER-RIGHT: 1px inset; PADDING-RIGHT: 5px; BORDER-TOP: 1px inset; =
PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: 1px inset; =
PADDING-TOP: 5px; BORDER-BOTTOM: 1px inset
}
TH {
	BORDER-RIGHT: 1px inset; PADDING-RIGHT: 5px; BORDER-TOP: 1px inset; =
PADDING-LEFT: 5px; PADDING-BOTTOM: 5px; BORDER-LEFT: 1px inset; =
PADDING-TOP: 5px; BORDER-BOTTOM: 1px inset
}
TABLE.r {
	BORDER-RIGHT: black 1px outset; BORDER-TOP: black 1px outset; FLOAT: =
right; MARGIN-LEFT: 8px; BORDER-LEFT: black 1px outset; COLOR: #000000; =
BORDER-BOTTOM: black 1px outset; BACKGROUND-COLOR: #d0d0d0
}
TABLE.r TD {
	BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; =
BORDER-BOTTOM: 1px inset
}
TH {
	BORDER-RIGHT: 1px inset; BORDER-TOP: 1px inset; BORDER-LEFT: 1px inset; =
BORDER-BOTTOM: 1px inset
}
</STYLE>

<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META=20
content=3D"calendar, converter, Julian, Gregorian, Islamic, Hebrew, =
Persian, Mayan, Bahai, French, Indian"=20
name=3Dkeywords>
<META content=3D"Calendar Converter" name=3Ddescription>
<META content=3D"John Walker" name=3Dauthor>
<META content=3Dindex name=3Drobots>
<SCRIPT language=3DJavaScript=20
src=3D"http://www.fourmilab.ch/documents/calendar/astro.js"=20
type=3Dtext/javascript>=0A=
</SCRIPT>

<SCRIPT language=3DJavaScript=20
src=3D"http://www.fourmilab.ch/documents/calendar/calendar.js"=20
type=3Dtext/javascript>=0A=
</SCRIPT>

<META content=3D"MSHTML 6.00.6000.16643" name=3DGENERATOR></HEAD>
<BODY class=3Dmain>
<H1>Calendar Converter</H1>
<HR>

<P>Welcome to <A href=3D"http://www.fourmilab.ch/">Fourmilab</A>'s =
calendar=20
converter! This page allows you to interconvert dates in a variety of =
calendars,=20
both civil and computer-related. All calculations are done in JavaScript =

executed in your own browser; complete source code is embedded in or =
linked to=20
this page, and you're free to <A=20
href=3D"http://www.fourmilab.ch/documents/calendar/calcalc.zip">download<=
/A> these=20
files to your own computer and use them even when not connected to the =
Internet.=20
To use the page, your browser must support JavaScript and you must not =
have=20
disabled execution of that language. Let's see=85=20
<CENTER>
<FORM name=3Dwarning action=3D"javascript:return false;"><INPUT =
class=3Dctr=20
style=3D"COLOR: #000000; BACKGROUND-COLOR: #ffa0a0" readOnly size=3D70=20
value=3D"Your browser doesn't support JavaScript or it is disabled--you =
cannot use this calculator."=20
name=3Dwarning> </FORM></CENTER>
<SCRIPT language=3DJavaScript type=3Dtext/javascript>=0A=
<!--=0A=
    //  Clear out "sorry, no JavaScript" message from text box.=0A=
    document.warning.warning.value =3D "Your browser supports =
JavaScript-" +=0A=
    	"-you can use this calculator.";=0A=
    document.warning.warning.style.backgroundColor =3D "#A0FFA0";=0A=
// -->=0A=
</SCRIPT>
If the box above says =93Your browser supports JavaScript=94, you're in =
business;=20
simply enter a date in any of the boxes below and press the =
=93Calculate=94 button=20
to show that date in all of the other calendars. <!--=0A=
                      <h3>Debugging Console</h3>=0A=
=0A=
<form name=3D"debug" action=3D"javascript:return false;">=0A=
=0A=
<center>=0A=
<textarea name=3D"log" wrap=3D"off" rows=3D16 cols=3D80>=0A=
</textarea>=0A=
<br />=0A=
<input type=3D"button" value=3D" Clear " =
onclick=3D"document.debug.log.value =3D '';" />=0A=
&nbsp;=0A=
<input type=3D"button" value=3D" Test " onclick=3D"TestSomething();" />=0A=
</center>=0A=
</form>=0A=
<br />=0A=
<h4><a href=3D"javascript:">JavaScript Console</a></h4>=0A=
<script type=3D"text/javascript" language=3D"JavaScript">=0A=
function dump(s, v)=0A=
{=0A=
    document.debug.log.value +=3D "" + s + " =3D " + v + "\n";=0A=
}=0A=
</script>=0A=
-->
<H3><A name=3Dgregorian>Gregorian Calendar</A></H3>
<FORM name=3Dgregorian action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TH>Date: </TH>
    <TD align=3Dmiddle><INPUT size=3D5 value=3D1998 name=3Dyear> <SELECT =
size=3D1=20
      name=3Dmonth> <OPTION value=3D1 selected>January</OPTION> <OPTION=20
        value=3D2>February</OPTION> <OPTION value=3D3>March</OPTION> =
<OPTION=20
        value=3D4>April</OPTION> <OPTION value=3D5>May</OPTION> <OPTION=20
        value=3D6>June</OPTION> <OPTION value=3D7>July</OPTION> <OPTION=20
        value=3D8>August</OPTION> <OPTION value=3D9>September</OPTION> =
<OPTION=20
        value=3D10>October</OPTION> <OPTION value=3D11>November</OPTION> =
<OPTION=20
        value=3D12>December</OPTION></SELECT> <INPUT size=3D3 value=3D1 =
name=3Dday>=20
      <BR><INPUT class=3Dctr readOnly size=3D12 name=3Dleap> </TD></TR>
  <TR>
    <TH>Time: </TH>
    <TD align=3Dmiddle><INPUT size=3D2 value=3D00 name=3Dhour>:<INPUT =
size=3D2 value=3D00=20
      name=3Dmin>:<INPUT size=3D2 value=3D00 name=3Dsec> </TD></TR>
  <TR>
    <TH>Weekday: </TH>
    <TD align=3Dmiddle><INPUT class=3Dctr readOnly size=3D9 name=3Dwday> =
</TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT onclick=3DcalcGregorian(); =
type=3Dbutton value=3DCalculate>=20
      &nbsp; &nbsp; <INPUT onclick=3D"setDateToToday(); =
calcGregorian();" type=3Dbutton value=3DToday>=20
    </TD></TR></TBODY></TABLE></FORM>
<SCRIPT language=3DJavaScript type=3Dtext/javascript>=0A=
<!--=0A=
    //  Preset the fields in the request form to today's date.=0A=
    setDateToToday();=0A=
// -->=0A=
</SCRIPT>

<P>The Gregorian calendar was <A=20
href=3D"http://www.fourmilab.ch/documents/calendar/IG_Latin.html"=20
target=3D_blank>proclaimed</A> by Pope Gregory XIII and took effect in =
most=20
Catholic states in 1582, in which October 4, 1582 of the Julian calendar =
was=20
followed by October 15 in the new calendar, correcting for the =
accumulated=20
discrepancy between the Julian calendar and the equinox as of that date. =
When=20
comparing historical dates, it's important to note that the Gregorian =
calendar,=20
used universally today in Western countries and in international =
commerce, was=20
adopted at different times by different countries. Britain and her =
colonies=20
(including what is now the United States), did not switch to the =
Gregorian=20
calendar until 1752, when Wednesday 2nd September in the Julian calendar =
dawned=20
as Thursday the 14th in the Gregorian. </P>
<P>The Gregorian calendar is a minor correction to the Julian. In the =
Julian=20
calendar every fourth year is a leap year in which February has 29, not =
28 days,=20
but in the Gregorian, years divisible by 100 are <EM>not</EM> leap years =
unless=20
they are also divisible by 400. How prescient was Pope Gregory! Whatever =
the=20
problems of Y2K, they won't include sloppy programming which assumes =
every year=20
divisible by 4 is a leap year since 2000, unlike the previous and =
subsequent=20
years divisible by 100, <EM>is</EM> a leap year. As in the Julian =
calendar, days=20
are considered to begin at midnight. </P>
<P>The average length of a year in the Gregorian calendar is 365.2425 =
days=20
compared to the actual solar tropical year (time from equinox to =
equinox) of=20
365.24219878 days, so the calendar accumulates one day of error with =
respect to=20
the solar year about every 3300 years. As a purely solar calendar, no =
attempt is=20
made to synchronise the start of months to the phases of the Moon. </P>
<P>While one can't properly speak of =93Gregorian dates=94 prior to the =
adoption of=20
the calendar in 1582, the calendar can be extrapolated to prior dates. =
In doing=20
so, this implementation uses the convention that the year prior to year =
1 is=20
year 0. This differs from the Julian calendar in which there is no year =
0=97the=20
year before year 1 in the Julian calendar is year &#8722;1. The date =
December 30th, 0=20
in the Gregorian calendar corresponds to January 1st, 1 in the Julian =
calendar.=20
</P>
<P>A slight modification of the Gregorian calendar would make it even =
more=20
precise. If you add the additional rule that years evenly divisible by =
4000 are=20
<EM>not</EM> leap years, you obtain an average solar year of 365.24225 =
days per=20
year which, compared to the actual mean year of 365.24219878, is =
equivalent to=20
an error of one day over a period of about 19,500 years; this is =
comparable to=20
errors due to tidal braking of the rotation of the Earth. <BR =
clear=3Dleft></P>
<H3><A name=3Djulianday>Julian Day</A></H3>
<FORM name=3Djulianday action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TD align=3Dmiddle><B>Julian day:</B> <INPUT size=3D16 name=3Dday> =
</TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT onclick=3DcalcJulian(); =
type=3Dbutton value=3DCalculate>=20
  </TD></TR></TBODY></TABLE></FORM>
<P>Astronomers, unlike historians, frequently need to do arithmetic with =
dates.=20
For example: a double star goes into eclipse every 1583.6 days and its =
last=20
mid-eclipse was measured to be on October 17, 2003 at 21:17 UTC. When is =
the=20
next? Well, you could get out your calendar and count days, but it's far =
easier=20
to convert all the quantities in question to Julian day numbers and =
simply add=20
or subtract. Julian days simply enumerate the days and fraction which =
have=20
elapsed since the start of the <EM>Julian era</EM>, which is defined as=20
beginning at noon on Monday, 1st January of year 4713 <SPAN=20
class=3Dbcad>B.C.E.</SPAN> in the Julian calendar. This date is defined =
in terms=20
of a cycle of years, but has the additional advantage that all known =
historical=20
astronomical observations bear positive Julian day numbers, and periods =
can be=20
determined and events extrapolated by simple addition and subtraction. =
Julian=20
dates are a tad eccentric in starting at noon, but then so are =
astronomers (and=20
systems programmers!)=97when you've become accustomed to rising after =
the =93crack=20
of noon=94 and doing most of your work when the Sun is down, you =
appreciate=20
recording your results in a calendar where the date doesn't change in =
the middle=20
of your workday. But even the Julian day convention bears witness to the =

eurocentrism of 19th century astronomy=97noon at Greenwich is midnight =
on the=20
other side of the world. But the Julian day notation is so deeply =
embedded in=20
astronomy that it is unlikely to be displaced at any time in the =
foreseeable=20
future. It is an ideal system for storing dates in computer programs, =
free of=20
cultural bias and discontinuities at various dates, and can be readily=20
transformed into other calendar systems, as the source code for this =
page=20
illustrates. Use Julian days and fractions (stored in 64 bit or longer =
floating=20
point numbers) in your programs, and be ready for Y10K, Y100K, and Y1MM! =
<BR=20
clear=3Dleft></P>
<FORM name=3Dmodifiedjulianday action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TD align=3Dmiddle><B>Modified Julian day:</B> <INPUT size=3D16 =
name=3Dday>=20
  </TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT =
onclick=3DcalcModifiedJulian(); type=3Dbutton value=3DCalculate>=20
    </TD></TR></TBODY></TABLE></FORM>
<P>While any event in recorded human history can be written as a =
positive Julian=20
day number, when working with contemporary events all those digits can =
be=20
cumbersome. A <EM>Modified Julian Day</EM> (MJD) is created by =
subtracting=20
2400000.5 from a Julian day number, and thus represents the number of =
days=20
elapsed since midnight (00:00) Universal Time on November 17, 1858. =
Modified=20
Julian Days are widely used to specify the epoch in tables of orbital =
elements=20
of artificial Earth satellites. Since no such objects existed prior to =
October=20
4, 1957, all satellite-related MJDs are positive. <BR clear=3Dleft></P>
<H3><A name=3Djuliancalendar>Julian Calendar</A></H3>
<FORM name=3Djuliancalendar action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TH>Date: </TH>
    <TD align=3Dmiddle><INPUT size=3D5 name=3Dyear> <SELECT size=3D1 =
name=3Dmonth>=20
        <OPTION value=3D1 selected>January</OPTION> <OPTION=20
        value=3D2>February</OPTION> <OPTION value=3D3>March</OPTION> =
<OPTION=20
        value=3D4>April</OPTION> <OPTION value=3D5>May</OPTION> <OPTION=20
        value=3D6>June</OPTION> <OPTION value=3D7>July</OPTION> <OPTION=20
        value=3D8>August</OPTION> <OPTION value=3D9>September</OPTION> =
<OPTION=20
        value=3D10>October</OPTION> <OPTION value=3D11>November</OPTION> =
<OPTION=20
        value=3D12>December</OPTION></SELECT> <INPUT size=3D3 =
name=3Dday> <BR><INPUT=20
      class=3Dctr readOnly size=3D12 name=3Dleap> <BR><INPUT class=3Dctr =
readOnly size=3D9=20
      name=3Dwday> </TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT =
onclick=3DcalcJulianCalendar(); type=3Dbutton value=3DCalculate>=20
    </TD></TR></TBODY></TABLE></FORM>
<P>The Julian calendar was proclaimed by Julius C=E6sar in 46 <SPAN=20
class=3Dbcad>B.C.</SPAN> and underwent several modifications before =
reaching its=20
final form in 8 <SPAN class=3Dbcad>C.E.</SPAN> The Julian calendar =
differs from=20
the Gregorian only in the determination of leap years, lacking the =
correction=20
for years divisible by 100 and 400 in the Gregorian calendar. In the =
Julian=20
calendar, any positive year is a leap year if divisible by 4. (Negative =
years=20
are leap years if the absolute value divided by 4 yields a remainder of =
1.) Days=20
are considered to begin at midnight. </P>
<P>In the Julian calendar the average year has a length of 365.25 days. =
compared=20
to the actual solar tropical year of 365.24219878 days. The calendar =
thus=20
accumulates one day of error with respect to the solar year every 128 =
years.=20
Being a purely solar calendar, no attempt is made to synchronise the =
start of=20
months to the phases of the Moon. <BR clear=3Dleft></P><!--=0A=
                         <h3>Gregorian Serial Day</h3>=0A=
=0A=
<form name=3D"gregserial" action=3D"javascript:return false;">=0A=
<table class=3D"l">=0A=
=0A=
<tr>=0A=
<td align=3D"center">=0A=
    <b>Gregorian serial day:</b>=0A=
    <input type=3D"text" name=3D"day" value=3D"" size=3D"16" />=0A=
</td>=0A=
</tr>=0A=
<tr>=0A=
<td colspan=3D"2" align=3D"center">=0A=
<input type=3D"button" value=3D"Calculate" onclick=3D"calcGregSerial();" =
/>=0A=
</td>=0A=
</tr>=0A=
</table>=0A=
</form>=0A=
<br clear=3D"left" />=0A=
-->
<H3>Hebrew Calendar</H3>
<FORM name=3Dhebrew action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TH>Date: </TH>
    <TD align=3Dmiddle><INPUT size=3D5 name=3Dyear> <SELECT size=3D1 =
name=3Dmonth>=20
        <OPTION value=3D1 selected>Nisan</OPTION> <OPTION =
value=3D2>Iyyar</OPTION>=20
        <OPTION value=3D3>Sivan</OPTION> <OPTION =
value=3D4>Tammuz</OPTION> <OPTION=20
        value=3D5>Av</OPTION> <OPTION value=3D6>Elul</OPTION> <OPTION=20
        value=3D7>Tishri</OPTION> <OPTION value=3D8>Heshvan</OPTION> =
<OPTION=20
        value=3D9>Kislev</OPTION> <OPTION value=3D10>Teveth</OPTION> =
<OPTION=20
        value=3D11>Shevat</OPTION> <OPTION value=3D12>Adar</OPTION> =
<OPTION=20
        value=3D13>Veadar</OPTION></SELECT> <INPUT size=3D3 name=3Dday> =
<BR><INPUT=20
      class=3Dctr readOnly size=3D36 name=3Dleap> </TD></TR>
  <TR>
    <TH>Hebrew month: </TH>
    <TD align=3Dmiddle><IMG height=3D51 alt=3D""=20
      =
src=3D"http://www.fourmilab.ch/documents/calendar/figures/hebrew_month_0.=
gif"=20
      width=3D186 name=3Dhebmonth> </TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT onclick=3DcalcHebrew(); =
type=3Dbutton value=3DCalculate>=20
  </TD></TR></TBODY></TABLE></FORM>
<P>The Hebrew (or Jewish) calendar attempts to simultaneously maintain =
alignment=20
between the months and the seasons and synchronise months with the =
Moon=97it is=20
thus deemed a =93<EM>luni-solar calendar</EM>=94. In addition, there are =
constraints=20
on which days of the week on which a year can begin and to shift =
otherwise=20
required extra days to prior years to keep the length of the year within =
the=20
prescribed bounds. This isn't easy, and the computations required are=20
correspondingly intricate. </P>
<P>Years are classified as <EM>common</EM> (normal) or =
<EM>embolismic</EM>=20
(leap) years which occur in a 19 year cycle in years 3, 6, 8, 11, 14, =
17, and=20
19. In an embolismic (leap) year, an extra <EM>month</EM> of 29 days, =
=93Veadar=94=20
or =93Adar&nbsp;II=94, is added to the end of the year after the month =
=93Adar=94, which=20
is designated =93Adar&nbsp;I=94 in such years. Further, years may be=20
<EM>deficient</EM>, <EM>regular</EM>, or <EM>complete</EM>, having =
respectively=20
353, 354, or 355 days in a common year and 383, 384, or 385 days in =
embolismic=20
years. Days are defined as beginning at sunset, and the calendar begins =
at=20
sunset the night before Monday, October 7, 3761 <SPAN =
class=3Dbcad>B.C.E.</SPAN>=20
in the Julian calendar, or Julian day 347995.5. Days are numbered with =
Sunday as=20
day 1, through Saturday: day 7. </P>
<P>The average length of a month is 29.530594 days, extremely close to =
the mean=20
<EM>synodic month</EM> (time from new Moon to next new Moon) of =
29.530588 days.=20
Such is the accuracy that more than 13,800 years elapse before a single =
day=20
discrepancy between the calendar's average reckoning of the start of =
months and=20
the mean time of the new Moon. Alignment with the solar year is better =
than the=20
Julian calendar, but inferior to the Gregorian. The average length of a =
year is=20
365.2468 days compared to the actual solar tropical year (time from =
equinox to=20
equinox) of 365.24219 days, so the calendar accumulates one day of error =
with=20
respect to the solar year every 216 years. <BR clear=3Dleft></P>
<H3>Islamic Calendar</H3>
<FORM name=3Dislamic action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TH>Date: </TH>
    <TD align=3Dmiddle><INPUT size=3D5 name=3Dyear> <SELECT size=3D1 =
name=3Dmonth>=20
        <OPTION value=3D1 selected>Muharram</OPTION> <OPTION=20
        value=3D2>Safar</OPTION> <OPTION =
value=3D3>Rabi`al-Awwal</OPTION> <OPTION=20
        value=3D4>Rabi`ath-Thani</OPTION> <OPTION value=3D5>Jumada =
l-Ula</OPTION>=20
        <OPTION value=3D6>Jumada t-Tania</OPTION> <OPTION =
value=3D7>Rajab</OPTION>=20
        <OPTION value=3D8>Sha`ban</OPTION> <OPTION =
value=3D9>Ramadan</OPTION>=20
        <OPTION value=3D10>Shawwal</OPTION> <OPTION value=3D11>Dhu =
l-Qa`da</OPTION>=20
        <OPTION value=3D12>Dhu l-Hijja</OPTION></SELECT> <INPUT size=3D3 =
name=3Dday>=20
      <BR><INPUT class=3Dctr readOnly size=3D12 name=3Dleap> </TD></TR>
  <TR>
    <TH>Weekday: </TH>
    <TD align=3Dmiddle><INPUT class=3Dctr readOnly size=3D18 =
name=3Dwday> </TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT onclick=3DcalcIslamic(); =
type=3Dbutton value=3DCalculate>=20
  </TD></TR></TBODY></TABLE></FORM>
<P>The Islamic calendar is purely lunar and consists of twelve =
alternating=20
months of 30 and 29 days, with the final 29 day month extended to 30 =
days during=20
leap years. Leap years follow a 30 year cycle and occur in years 1, 5, =
7, 10,=20
13, 16, 18, 21, 24, 26, and 29. Days are considered to begin at sunset. =
The=20
calendar begins on Friday, July 16th, 622 <SPAN class=3Dbcad>C.E.</SPAN> =
in the=20
Julian calendar, Julian day 1948439.5, the day of Muhammad's flight from =
Mecca=20
to Medina, with sunset on the preceding day reckoned as the first day of =
the=20
first month of year 1 A.H.=97=93<EM lang=3Dla xml:lang=3D"la">Anno =
Hegir=E6</EM>=94=97the=20
Arabic word for =93separate=94 or =93go away=94. The names for the days =
are just their=20
numbers: Sunday is the first day and Saturday the seventh; the week is=20
considered to begin on Saturday. </P>
<P>Each cycle of 30 years thus contains 19 normal years of 354 days and =
11 leap=20
years of 355, so the average length of a year is therefore ((19 =D7 354) =
+ (11 =D7=20
355)) / 30 =3D 354.365=85 days, with a mean length of month of 1/12 this =
figure, or=20
29.53055=85 days, which closely approximates the mean <EM>synodic =
month</EM> (time=20
from new Moon to next new Moon) of 29.530588 days, with the calendar =
only=20
slipping one day with respect to the Moon every 2525 years. Since the =
calendar=20
is fixed to the Moon, not the solar year, the months shift with respect =
to the=20
seasons, with each month beginning about 11 days earlier in each =
successive=20
solar year. </P>
<P>The calendar presented here is the most commonly used civil calendar =
in the=20
Islamic world; for religious purposes months are defined to start with =
the first=20
observation of the crescent of the new Moon. <BR clear=3Dleft></P>
<H3><A name=3Dpersian>Persian Calendar</A></H3>
<FORM name=3Dpersian action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TH>Date: </TH>
    <TD align=3Dmiddle><INPUT size=3D5 name=3Dyear> <SELECT size=3D1 =
name=3Dmonth>=20
        <OPTION value=3D1 selected>Farvardin</OPTION> <OPTION=20
        value=3D2>Ordibehesht</OPTION> <OPTION =
value=3D3>Khordad</OPTION> <OPTION=20
        value=3D4>Tir</OPTION> <OPTION value=3D5>Mordad</OPTION> <OPTION =

        value=3D6>Shahrivar</OPTION> <OPTION value=3D7>Mehr</OPTION> =
<OPTION=20
        value=3D8>Aban</OPTION> <OPTION value=3D9>Azar</OPTION> <OPTION=20
        value=3D10>Dey</OPTION> <OPTION value=3D11>Bahman</OPTION> =
<OPTION=20
        value=3D12>Esfand</OPTION></SELECT> <INPUT size=3D3 name=3Dday> =
<BR><INPUT=20
      class=3Dctr readOnly size=3D12 name=3Dleap> </TD></TR>
  <TR>
    <TH>Weekday: </TH>
    <TD align=3Dmiddle><INPUT class=3Dctr readOnly size=3D13 =
name=3Dwday> </TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT onclick=3DcalcPersian(); =
type=3Dbutton value=3DCalculate>=20
  </TD></TR></TBODY></TABLE></FORM>
<P>The modern Persian calendar was adopted in 1925, supplanting (while =
retaining=20
the month names of) a traditional calendar dating from the eleventh =
century. The=20
calendar consists of 12 months, the first six of which are 31 days, the =
next=20
five 30 days, and the final month 29 days in a normal year and 30 days =
in a leap=20
year. </P>
<P>As one of the few calendars designed in the era of accurate =
positional=20
astronomy, the Persian calendar uses a very complex leap year structure =
which=20
makes it the most accurate solar calendar in use today. Years are =
grouped into=20
<EM>cycles</EM> which begin with four normal years after which every =
fourth=20
subsequent year in the cycle is a leap year. Cycles are grouped into =
<EM>grand=20
cycles</EM> of either 128 years (composed of cycles of 29, 33, 33, and =
33 years)=20
or 132 years, containing cycles of of 29, 33, 33, and 37 years. A =
<EM>great=20
grand cycle</EM> is composed of 21 consecutive 128 year grand cycles and =
a final=20
132 grand cycle, for a total of 2820 years. The pattern of normal and =
leap years=20
which began in 1925 will not repeat until the year 4745! </P>
<P>Each 2820 year great grand cycle contains 2137 normal years of 365 =
days and=20
683 leap years of 366 days, with the average year length over the great =
grand=20
cycle of 365.24219852. So close is this to the actual solar tropical =
year of=20
365.24219878 days that the Persian calendar accumulates an error of one =
day only=20
every 3.8 million years. As a purely solar calendar, months are not =
synchronised=20
with the phases of the Moon. <BR clear=3Dleft></P>
<H3>Mayan Calendars</H3>
<FORM name=3Dmayancount action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TD align=3Dmiddle><B>Mayan Long Count</B> <BR><INPUT size=3D4 =
name=3Dbaktun>=20
      <B>.</B> <INPUT size=3D3 name=3Dkatun> <B>.</B> <INPUT size=3D3 =
name=3Dtun>=20
      <B>.</B> <INPUT size=3D3 name=3Duinal> <B>.</B> <INPUT size=3D3 =
name=3Dkin>=20
      <P><B>Haab:</B>&nbsp;&nbsp;<INPUT class=3Dctr readOnly size=3D9 =
name=3Dhaab>=20
      <BR><B>Tzolkin:</B>&nbsp;&nbsp;<INPUT class=3Dctr readOnly =
size=3D10=20
      name=3Dtzolkin> </P></TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT onclick=3DcalcMayanCount(); =
type=3Dbutton value=3DCalculate>=20
  </TD></TR></TBODY></TABLE></FORM>
<P>The Mayans employed three calendars, all organised as hierarchies of =
cycles=20
of days of various lengths. The <EM>Long Count</EM> was the principal =
calendar=20
for historical purposes, the <EM>Haab</EM> was used as the civil =
calendar, while=20
the <EM>Tzolkin</EM> was the religious calendar. All of the Mayan =
calendars are=20
based on serial counting of days without means for synchronising the =
calendar to=20
the Sun or Moon, although the Long Count and Haab calendars contain =
cycles of=20
360 and 365 days, respectively, which are roughly comparable to the =
solar year.=20
Based purely on counting days, the Long Count more closely resembles the =
Julian=20
Day system and contemporary computer representations of date and time =
than other=20
calendars devised in antiquity. Also distinctly modern in appearance is =
that=20
days and cycles count from zero, not one as in most other calendars, =
which=20
simplifies the computation of dates, and that numbers as opposed to =
names were=20
used for all of the cycles. </P>
<TABLE class=3Dr>
  <TBODY>
  <TR>
    <TH>Cycle</TH>
    <TH>Composed of</TH>
    <TH>Total<BR>Days</TH>
    <TH>Years<BR>(approx.)</TH></TR>
  <TR>
    <TD><B>kin</B></TD>
    <TD>&nbsp;</TD>
    <TD align=3Dmiddle>1</TD>
    <TD>&nbsp;</TD></TR>
  <TR>
    <TD><B>uinal</B></TD>
    <TD align=3Dmiddle>20 kin</TD>
    <TD align=3Dmiddle>20</TD>
    <TD align=3Dmiddle>&nbsp;</TD></TR>
  <TR>
    <TD><B>tun</B></TD>
    <TD align=3Dmiddle>18 uinal</TD>
    <TD align=3Dmiddle>360</TD>
    <TD align=3Dmiddle>0.986</TD></TR>
  <TR>
    <TD><B>katun</B></TD>
    <TD align=3Dmiddle>20 tun</TD>
    <TD align=3Dmiddle>7200</TD>
    <TD align=3Dmiddle>19.7</TD></TR>
  <TR>
    <TD><B>baktun</B></TD>
    <TD align=3Dmiddle>20 katun</TD>
    <TD align=3Dmiddle>144,000</TD>
    <TD align=3Dmiddle>394.3</TD></TR>
  <TR>
    <TD><B>pictun</B></TD>
    <TD align=3Dmiddle>20 baktun</TD>
    <TD align=3Dmiddle>2,880,000</TD>
    <TD align=3Dmiddle>7,885</TD></TR>
  <TR>
    <TD><B>calabtun</B></TD>
    <TD align=3Dmiddle>20 piktun</TD>
    <TD align=3Dmiddle>57,600,000</TD>
    <TD align=3Dmiddle>157,704</TD></TR>
  <TR>
    <TD><B>kinchiltun</B></TD>
    <TD align=3Dmiddle>20 calabtun</TD>
    <TD align=3Dmiddle>1,152,000,000</TD>
    <TD align=3Dmiddle>3,154,071</TD></TR>
  <TR>
    <TD><B>alautun</B></TD>
    <TD align=3Dmiddle>20 kinchiltun</TD>
    <TD align=3Dmiddle>23,040,000,000</TD>
    <TD align=3Dmiddle>63,081,429</TD></TR></TBODY></TABLE>
<P>The Long Count calendar is organised into the hierarchy of cycles =
shown at=20
the right. Each of the cycles is composed of 20 of the next shorter =
cycle with=20
the exception of the <EM>tun</EM>, which consists of 18 <EM>uinal</EM> =
of 20=20
days each. This results in a <EM>tun</EM> of 360 days, which maintains=20
approximate alignment with the solar year over modest intervals=97the =
calendar=20
comes undone from the Sun 5 days every <EM>tun</EM>. </P>
<P>The Mayans believed at at the conclusion of each <EM>pictun</EM> =
cycle of=20
about 7,885 years the universe is destroyed and re-created. Those with=20
apocalyptic inclinations will be relieved to observe that the present =
cycle will=20
not end until Columbus Day, October 12, 4772 in the Gregorian calendar. =
Speaking=20
of apocalyptic events, it's amusing to observe that the longest of the =
cycles in=20
the Mayan calendar, <EM>alautun</EM>, about 63 million years, is =
comparable to=20
the 65 million years since the impact which brought down the curtain on =
the=20
dinosaurs=97an impact which occurred near the Yucatan peninsula where, =
almost an=20
<EM>alautun</EM> later, the Mayan civilisation flourished. If the =
universe is=20
going to be destroyed and the end of the current <EM>pictun</EM>, =
there's no=20
point in writing dates using the longer cycles, so we dispense with them =
here.=20
</P>
<P>Dates in the Long Count calendar are written, by convention, as: </P>
<P=20
class=3Dc><EM>baktun</EM>&nbsp;<B>.</B>&nbsp;<EM>katun</EM>&nbsp;<B>.</B>=
&nbsp;<EM>tun</EM>&nbsp;<B>.</B>&nbsp;<EM>uinal</EM>&nbsp;<B>.</B>&nbsp;<=
EM>kin</EM>=20
</P>
<P>and thus resemble present-day Internet IP addresses! </P>
<P>For civil purposes the Mayans used the <EM>Haab</EM> calendar in =
which the=20
year was divided into 18 named periods of 20 days each, followed by five =

<EM>Uayeb</EM> days not considered part of any period. Dates in this =
calendar=20
are written as a day number (0 to 19 for regular periods and 0 to 4 for =
the days=20
of <EM>Uayeb</EM>) followed by the name of the period. This calendar has =
no=20
concept of year numbers; it simply repeats at the end of the complete =
365 day=20
cycle. Consequently, it is not possible, given a date in the Haab =
calendar, to=20
determine the Long Count or year in other calendars. The 365 day cycle =
provides=20
better alignment with the solar year than the 360 day <EM>tun</EM> of =
the Long=20
Count but, lacking a leap year mechanism, the Haab calendar shifted one =
day with=20
respect to the seasons about every four years. </P>
<P>The Mayan religion employed the <EM>Tzolkin</EM> calendar, composed =
of 20=20
named periods of 13 days. Unlike the Haab calendar, in which the day =
numbers=20
increment until the end of the period, at which time the next period =
name is=20
used and the day count reset to 0, the names and numbers in the Tzolkin =
calendar=20
advance in parallel. On each successive day, the day number is =
incremented by 1,=20
being reset to 0 upon reaching 13, and the next in the cycle of twenty =
names is=20
affixed to it. Since 13 does not evenly divide 20, there are thus a =
total of 260=20
day number and period names before the calendar repeats. As with the =
Haab=20
calendar, cycles are not counted and one cannot, therefore, convert a =
Tzolkin=20
date into a unique date in other calendars. The 260 day cycle formed the =
basis=20
for Mayan religious events and has no relation to the solar year or =
lunar month.=20
</P>
<P>The Mayans frequently specified dates using <EM>both</EM> the Haab =
and=20
Tzolkin calendars; dates of this form repeat only every 52 solar years. =
<BR=20
clear=3Dall></P>
<H3>Bah=E1'=ED Calendar</H3>
<FORM name=3Dbahai action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TH>Date: </TH>
    <TD align=3Dmiddle>Kull-i-Shay:&nbsp;<INPUT size=3D3 =
name=3Dkull_i_shay> &nbsp;=20
      &nbsp; V=E1hid:&nbsp;<INPUT size=3D3 name=3Dvahid> =
<BR>Year:&nbsp;<SELECT size=3D1=20
      name=3Dyear> <OPTION value=3D1 selected>Alif</OPTION> <OPTION=20
        value=3D2>B=E1'</OPTION> <OPTION value=3D3>Ab</OPTION> <OPTION=20
        value=3D4>D=E1l</OPTION> <OPTION value=3D5>B=E1b</OPTION> =
<OPTION=20
        value=3D6>V=E1v</OPTION> <OPTION value=3D7>Abad</OPTION> <OPTION =

        value=3D8>J=E1d</OPTION> <OPTION value=3D9>Bah=E1</OPTION> =
<OPTION=20
        value=3D10>Hubb</OPTION> <OPTION value=3D11>Bahh=E1j</OPTION> =
<OPTION=20
        value=3D12>Jav=E1b</OPTION> <OPTION value=3D13>Ahad</OPTION> =
<OPTION=20
        value=3D14>Vahh=E1b</OPTION> <OPTION value=3D15>Vid=E1d</OPTION> =
<OPTION=20
        value=3D16>Bad=ED'</OPTION> <OPTION value=3D17>Bah=ED</OPTION> =
<OPTION=20
        value=3D18>Abh=E1</OPTION> <OPTION =
value=3D19>Vah=EDd</OPTION></SELECT>=20
      <BR>Month:&nbsp;<SELECT size=3D1 name=3Dmonth> <OPTION value=3D1=20
        selected>Bah=E1</OPTION> <OPTION value=3D2>Jal=E1l</OPTION> =
<OPTION=20
        value=3D3>Jam=E1l</OPTION> <OPTION value=3D4>`Azamat</OPTION> =
<OPTION=20
        value=3D5>N=FAr</OPTION> <OPTION value=3D6>Rahmat</OPTION> =
<OPTION=20
        value=3D7>Kalim=E1t</OPTION> <OPTION value=3D8>Kam=E1l</OPTION> =
<OPTION=20
        value=3D9>Asm=E1'</OPTION> <OPTION value=3D10>`Izzat</OPTION> =
<OPTION=20
        value=3D11>Mash=EDyyat</OPTION> <OPTION value=3D12>`Ilm</OPTION> =
<OPTION=20
        value=3D13>Qudrat</OPTION> <OPTION value=3D14>Qawl</OPTION> =
<OPTION=20
        value=3D15>Mas=E1il</OPTION> <OPTION value=3D16>Sharaf</OPTION> =
<OPTION=20
        value=3D17>Sult=E1n</OPTION> <OPTION value=3D18>Mulk</OPTION> =
<OPTION=20
        value=3D19>Ayy=E1m-i-H=E1</OPTION> <OPTION =
value=3D20>`Al=E1'</OPTION></SELECT>=20
      <BR>Day:&nbsp;<SELECT size=3D1 name=3Dday> <OPTION value=3D1=20
        selected>Bah=E1</OPTION> <OPTION value=3D2>Jal=E1l</OPTION> =
<OPTION=20
        value=3D3>Jam=E1l</OPTION> <OPTION value=3D4>`Azamat</OPTION> =
<OPTION=20
        value=3D5>N=FAr</OPTION> <OPTION value=3D6>Rahmat</OPTION> =
<OPTION=20
        value=3D7>Kalim=E1t</OPTION> <OPTION value=3D8>Kam=E1l</OPTION> =
<OPTION=20
        value=3D9>Asm=E1'</OPTION> <OPTION value=3D10>`Izzat</OPTION> =
<OPTION=20
        value=3D11>Mash=EDyyat</OPTION> <OPTION value=3D12>`Ilm</OPTION> =
<OPTION=20
        value=3D13>Qudrat</OPTION> <OPTION value=3D14>Qawl</OPTION> =
<OPTION=20
        value=3D15>Mas=E1il</OPTION> <OPTION value=3D16>Sharaf</OPTION> =
<OPTION=20
        value=3D17>Sult=E1n</OPTION> <OPTION value=3D18>Mulk</OPTION> =
<OPTION=20
        value=3D19>`Al=E1'</OPTION></SELECT> =
<BR>Weekday:&nbsp;&nbsp;<INPUT class=3Dctr=20
      readOnly size=3D9 name=3Dweekday> <BR><INPUT class=3Dctr readOnly =
size=3D12=20
      name=3Dleap> </TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT onclick=3DcalcBahai(); =
type=3Dbutton value=3DCalculate>=20
  </TD></TR></TBODY></TABLE></FORM>
<P>The Bah=E1'=ED calendar is a solar calendar organised as a hierarchy =
of cycles,=20
each of length 19, commemorating the 19 year period between the 1844=20
proclamation of the B=E1b in <A=20
href=3D"http://www.fourmilab.ch/images/eclipse99/iranimages.html#Shiraz" =

target=3D_blank>Shiraz</A> and the revelation by Bah=E1'u'll=E1h in =
1863. Days are=20
named in a cycle of 19 names. Nineteen of these cycles of 19 days, =
usually=20
called =93months=94 even though they have nothing whatsoever to do with =
the Moon,=20
make up a year, with a period between the 18th and 19th months referred =
to as=20
<EM>Ayy=E1m-i-H=E1</EM> not considered part of any month; this period is =
four days=20
in normal years and five days in leap years. The rule for leap years is=20
identical to that of the Gregorian calendar, so the Bah=E1'=ED calendar =
shares its=20
accuracy and remains synchronised. The same cycle of 19 names is used =
for days=20
and months. </P>
<P>The year begins at the equinox, March 21, the Feast of Naw-R=FAz; =
days begin at=20
sunset. Years have their own cycle of 19 names, called the =
<EM>V=E1hid</EM>.=20
Successive cycles of 19 years are numbered, with cycle 1 commencing on =
March 21,=20
1844, the year in which the B=E1b announced his prophecy. Cycles, in =
turn, are=20
assembled into <EM>Kull-I-Shay</EM> super-cycles of 361 (19=B2) years. =
The first=20
<EM>Kull-I-Shay</EM> will not end until Gregorian calendar year 2205. A =
week of=20
seven days is superimposed on the calendar, with the week considered to =
begin on=20
Saturday. Confusingly, three of the names of weekdays are identical to =
names in=20
the 19 name cycles for days and months. <BR clear=3Dleft></P>
<H3>Indian Civil Calendar</H3>
<FORM name=3Dindiancivilcalendar action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TH>Date: </TH>
    <TD align=3Dmiddle><INPUT size=3D5 name=3Dyear> <SELECT size=3D1 =
name=3Dmonth>=20
        <OPTION value=3D1 selected>Caitra</OPTION> <OPTION=20
        value=3D2>Vaisakha</OPTION> <OPTION value=3D3>Jyaistha</OPTION> =
<OPTION=20
        value=3D4>Asadha</OPTION> <OPTION value=3D5>Sravana</OPTION> =
<OPTION=20
        value=3D6>Bhadra</OPTION> <OPTION value=3D7>Asvina</OPTION> =
<OPTION=20
        value=3D8>Kartika</OPTION> <OPTION value=3D9>Agrahayana</OPTION> =
<OPTION=20
        value=3D10>Pausa</OPTION> <OPTION value=3D11>Magha</OPTION> =
<OPTION=20
        value=3D12>Phalguna</OPTION></SELECT> <INPUT size=3D3 =
name=3Dday> <BR>Weekday:=20
      <INPUT class=3Dctr readOnly size=3D15 name=3Dweekday> <BR><INPUT =
class=3Dctr=20
      readOnly size=3D12 name=3Dleap> </TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT =
onclick=3DcalcIndianCivilCalendar(); type=3Dbutton value=3DCalculate>=20
    </TD></TR></TBODY></TABLE></FORM>
<P>A bewildering variety of calendars have been and continue to be used =
in the=20
Indian subcontinent. In 1957 the Indian government's Calendar Reform =
Committee=20
adopted the National Calendar of India for civil purposes and, in =
addition,=20
defined guidelines to standardise computation of the religious calendar, =
which=20
is based on astronomical observations. The civil calendar is used =
throughout=20
India today for administrative purposes, but a variety of religious =
calendars=20
remain in use. We present the civil calendar here. </P>
<P>The National Calendar of India is composed of 12 months. The first =
month,=20
<EM>Caitra</EM>, is 30 days in normal and 31 days in leap years. This is =

followed by five consecutive 31 day months, then six 30 day months. Leap =
years=20
in the Indian calendar occur in the same years as as in the Gregorian =
calendar;=20
the two calendars thus have identical accuracy and remain synchronised. =
</P>
<P>Years in the Indian calendar are counted from the start of the Saka =
Era, the=20
equinox of March 22nd of year 79 in the Gregorian calendar, designated =
day 1 of=20
month Caitra of year 1 in the Saka Era. The calendar was officially =
adopted on 1=20
Caitra, 1879 Saka Era, or March 22nd, 1957 Gregorian. Since year 1 of =
the Indian=20
calendar differs from year 1 of the Gregorian, to determine whether a =
year in=20
the Indian calendar is a leap year, add 78 to the year of the Saka era =
then=20
apply the Gregorian calendar rule to the sum. <BR clear=3Dleft></P>
<H3>French Republican Calendar</H3>
<FORM name=3Dfrench action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TH>Date: </TH>
    <TD align=3Dmiddle>Ann=E9e <INPUT size=3D5 name=3Dan> de la =
R=E9publique <BR>Mois de=20
      <SELECT size=3D1 name=3Dmois> <OPTION value=3D1 =
selected>Vend=E9miaire</OPTION>=20
        <OPTION value=3D2>Brumaire</OPTION> <OPTION =
value=3D3>Frimaire</OPTION>=20
        <OPTION value=3D4>Niv=F4se</OPTION> <OPTION =
value=3D5>Pluvi=F4se</OPTION>=20
        <OPTION value=3D6>Vent=F4se</OPTION> <OPTION =
value=3D7>Germinal</OPTION>=20
        <OPTION value=3D8>Flor=E9al</OPTION> <OPTION =
value=3D9>Prairial</OPTION>=20
        <OPTION value=3D10>Messidor</OPTION> <OPTION =
value=3D11>Thermidor</OPTION>=20
        <OPTION value=3D12>Fructidor</OPTION> <OPTION=20
        value=3D13>(Sans-culottides)</OPTION></SELECT> <BR>D=E9cade =
<SELECT size=3D1=20
      name=3Ddecade> <OPTION value=3D1 selected>I</OPTION> <OPTION=20
        value=3D2>II</OPTION> <OPTION value=3D3>III</OPTION></SELECT> =
Jour <SELECT=20
      size=3D1 name=3Djour> <OPTION value=3D1 selected>du =
Primidi</OPTION> <OPTION=20
        value=3D2>du Duodi</OPTION> <OPTION value=3D3>du Tridi</OPTION> =
<OPTION=20
        value=3D4>du Quartidi</OPTION> <OPTION value=3D5>du =
Quintidi</OPTION>=20
        <OPTION value=3D6>du Sextidi</OPTION> <OPTION value=3D7>du =
Septidi</OPTION>=20
        <OPTION value=3D8>du Octidi</OPTION> <OPTION value=3D9>du =
Nonidi</OPTION>=20
        <OPTION value=3D10>du D=E9cadi</OPTION> <OPTION=20
        value=3D11>------------</OPTION> <OPTION value=3D12>de la =
Vertu</OPTION>=20
        <OPTION value=3D13>du G=E9nie</OPTION> <OPTION value=3D14>du =
Travail</OPTION>=20
        <OPTION value=3D15>de l'Opinion</OPTION> <OPTION value=3D16>des=20
        R=E9compenses</OPTION> <OPTION value=3D17>de la =
R=E9volution</OPTION></SELECT>=20
    </TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT onclick=3DcalcFrench(); =
type=3Dbutton value=3DCalculate>=20
  </TD></TR></TBODY></TABLE></FORM>
<P>The French Republican calendar was adopted by a <A=20
href=3D"http://www.fourmilab.ch/documents/calendar/fr_decret.html"=20
target=3D_blank>decree</A> of <EM lang=3Dfr xml:lang=3D"fr">La =
Convention=20
Nationale</EM> on Gregorian date October 5, 1793 and went into effect =
the=20
following November 24th, on which day Fabre d'=C9glantine proposed to =
the <EM=20
lang=3Dfr xml:lang=3D"fr">Convention</EM> the names for the months. It =
incarnates=20
the revolutionary spirit of =93Out with the old! In with the =
relentlessly=20
rational!=94 which later gave rise in 1795 to the metric system of =
weights and=20
measures which has proven more durable than the Republican calendar. =
</P>
<P>The calendar consists of 12 months of 30 days each, followed by a =
five- or=20
six-day holiday period, the <EM lang=3Dfr xml:lang=3D"fr">jours =
compl=E9mentaires</EM>=20
or <EM lang=3Dfr xml:lang=3D"fr">sans-culottides</EM>. Months are =
grouped into four=20
seasons; the three months of each season end with the same letters and =
rhyme=20
with one another. The calendar begins on Gregorian date September 22nd, =
1792,=20
the September equinox and date of the founding of the First Republic. =
This day=20
is designated the first day of the month of Vend=E9miaire in year 1 of =
the=20
Republic. Subsequent years begin on the day in which the September =
equinox=20
occurs as reckoned at the Paris meridian. Days begin at true solar =
midnight.=20
Whether the <EM lang=3Dfr xml:lang=3D"fr">sans-culottides</EM> period =
contains five=20
or six days depends on the actual date of the equinox. Consequently, =
there is no=20
leap year rule <EM lang=3Dla xml:lang=3D"la">per se</EM>: 366 day years =
do not recur=20
in a regular pattern but instead follow the dictates of astronomy. The =
calendar=20
therefore stays perfectly aligned with the seasons. No attempt is made =
to=20
synchronise months with the phases of the Moon. </P>
<P>The Republican calendar is rare in that it has no concept of a seven =
day=20
week. Each thirty day month is divided into three <EM lang=3Dfr=20
xml:lang=3D"fr">d=E9cades</EM> of ten days each, the last of which, <EM =
lang=3Dfr=20
xml:lang=3D"fr">d=E9cadi</EM>, was the day of rest. (The word =93<EM =
lang=3Dfr=20
xml:lang=3D"fr">d=E9cade</EM>=94 may confuse English speakers; the =
French noun=20
denoting ten years is =93<EM lang=3Dfr =
xml:lang=3D"fr">d=E9cennie</EM>=94.) The names of=20
days in the <EM lang=3Dfr xml:lang=3D"fr">d=E9cade</EM> are derived from =
their number=20
in the ten day sequence. The five or six days of the <EM lang=3Dfr=20
xml:lang=3D"fr">sans-culottides</EM> do not bear the names of the <EM =
lang=3Dfr=20
xml:lang=3D"fr">d=E9cade</EM>. Instead, each of these holidays =
commemorates an=20
aspect of the republican spirit. The last, <EM lang=3Dfr =
xml:lang=3D"fr">jour de la=20
R=E9volution</EM>, occurs only in years of 366 days. </P>
<P>Napol=E9on abolished the Republican calendar in favour of the =
Gregorian on=20
January 1st, 1806. Thus France, one of the first countries to adopt the=20
Gregorian calendar (in December 1582), became the only country to =
subsequently=20
abandon and then re-adopt it. During the period of the Paris Commune =
uprising in=20
1871 the Republican calendar was again briefly used. </P>
<P>The <A =
href=3D"http://www.fourmilab.ch/documents/calendar/fr_decret.html"=20
target=3D_blank>original decree</A> which established the Republican =
calendar=20
contained a contradiction: it defined the year as starting on the day of =
the=20
true autumnal equinox in Paris, but further prescribed a four year cycle =
called=20
<EM lang=3Dfr xml:lang=3D"fr">la Franciade</EM>, the fourth year of =
which would end=20
with <EM lang=3Dfr xml:lang=3D"fr">le jour de la R=E9volution</EM> and =
hence contain=20
366 days. These two specifications are incompatible, as 366 day years =
defined by=20
the equinox do not recur on a regular four year schedule. This problem =
was=20
recognised shortly after the calendar was proclaimed, but the calendar =
was=20
abandoned five years before the first conflict would have occurred and =
the issue=20
was never formally resolved. Here we assume the equinox rule prevails, =
as a=20
rigid four year cycle would be no more accurate than the Julian =
calendar, which=20
couldn't possibly be the intent of its enlightened Republican designers. =
<BR=20
clear=3Dleft></P>
<H3>ISO-8601 Week and Day, and Day of Year</H3>
<FORM name=3Disoweek action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TD align=3Dmiddle>Day <INPUT size=3D3 name=3Dday> of week <INPUT =
size=3D3=20
      name=3Dweek> of year <INPUT size=3D5 name=3Dyear> </TD></TR>
  <TR>
    <TD align=3Dmiddle><INPUT onclick=3DcalcIsoWeek(); type=3Dbutton =
value=3DCalculate>=20
  </TD></TR></TBODY></TABLE></FORM>
<P>The <A href=3D"http://www.iso.ch/" target=3D_blank>International =
Standards=20
Organisation</A> (ISO) issued Standard ISO 8601, =93Representation of =
Dates=94 in=20
1988, superseding the earlier ISO 2015. The bulk of the standard =
consists of=20
standards for representing dates in the Gregorian calendar including the =
highly=20
recommended =93<B>YYYY-MM-DD</B>=94 form which is unambiguous, free of =
cultural=20
bias, can be sorted into order without rearrangement, and is Y9K =
compliant. In=20
addition, ISO 8601 formally defines the =93calendar week=94 often =
encountered in=20
commercial transactions in Europe. The first calendar week of a year: =
week 1, is=20
that week which contains the first Thursday of the year (or, =
equivalently, the=20
week which includes January 4th of the year; the first day of that week =
is the=20
previous Monday). The last week: week 52 or 53 depending on the date of =
Monday=20
in the first week, is that which contains December 28th of the year. The =
first=20
ISO calendar week of a given year starts with a Monday which can be as =
early as=20
December 29th of the previous year or as late as January 4th of the =
present; the=20
last calendar week can end as late as Sunday, January 3rd of the =
subsequent=20
year. ISO 8601 dates in year, week, and day form are written with a =
=93W=94=20
preceding the week number, which bears a leading zero if less than 10, =
for=20
example February 29th, 2000 is written as 2000-02-29 in year, month, day =
format=20
and 2000-W09-2 in year, week, day form; since the day number can never =
exceed 7,=20
only a single digit is required. The hyphens may be elided for brevity =
and the=20
day number omitted if not required. You will frequently see date of =
manufacture=20
codes such as =9300W09=94 stamped on products; this is an abbreviation =
of 2000-W09,=20
the ninth week of year 2000. <BR clear=3Dleft></P>
<FORM name=3Disoday action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TD align=3Dmiddle>Day <INPUT size=3D3 name=3Dday> of year <INPUT =
size=3D5=20
      name=3Dyear> </TD></TR>
  <TR>
    <TD align=3Dmiddle><INPUT onclick=3DcalcIsoDay(); type=3Dbutton =
value=3DCalculate>=20
    </TD></TR></TBODY></TABLE></FORM>
<P>In solar calendars such as the Gregorian, only days and years have =
physical=20
significance: days are defined by the rotation of the Earth, and years =
by its=20
orbit about the Sun. Months, decoupled from the phases of the Moon, are =
but a=20
memory of forgotten lunar calendars, while weeks of seven days are =
entirely a=20
social construct=97while most calendars in use today adopt a cycle of =
seven day=20
names or numbers, calendars with name cycles ranging from four to sixty =
days=20
have been used by other cultures in history. </P>
<P>ISO 8601 permits us to jettison the historical and cultural baggage =
of weeks=20
and months and express a date simply by the year and day number within =
that=20
year, ranging from 001 for January 1st through 365 (366 in a leap year) =
for=20
December 31st. This format makes it easy to do arithmetic with dates =
within a=20
year, and only slightly more complicated for periods which span year =
boundaries.=20
You'll see this representation used in project planning and for =
specifying=20
delivery dates. ISO dates in this form are written as =
=93<B>YYYY-DDD</B>=94, for=20
example 2000-060 for February 29th, 2000; leading zeroes are always =
written in=20
the day number, but the hyphen may be omitted for brevity. </P>
<P>All ISO 8601 date formats have the advantages of being fixed length =
(at least=20
until the Y10K crisis rolls around) and, when stored in a computer, of =
being=20
sorted in date order by an alphanumeric sort of their textual =
representations.=20
The ISO week and day and day of year calendars are derivative of the =
Gregorian=20
calendar and share its accuracy. <BR clear=3Dleft></P>
<H3><A name=3Dunixtime>Unix <TT>time()</TT> value</A></H3>
<FORM name=3Dunixtime action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TD align=3Dmiddle><B>Unix time() value:</B> <INPUT size=3D14 =
name=3Dtime>=20
</TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT onclick=3DcalcUnixTime(); =
type=3Dbutton value=3DCalculate>=20
  </TD></TR></TBODY></TABLE></FORM>
<P>Development of the Unix operating system began at Bell Laboratories =
in 1969=20
by Dennis Ritchie and Ken Thompson, with the first PDP-11 version =
becoming=20
operational in February 1971. Unix wisely adopted the convention that =
all=20
internal dates and times (for example, the time of creation and last=20
modification of files) were kept in Universal Time, and converted to =
local time=20
based on a per-user time zone specification. This far-sighted choice has =
made it=20
vastly easier to integrate Unix systems into far-flung networks without =
a chaos=20
of conflicting time settings. </P>
<P>Many machines on which Unix was initially widely deployed could not =
support=20
arithmetic on integers longer than 32 bits without costly =
multiple-precision=20
computation in software. The internal representation of time was =
therefore=20
chosen to be the number of seconds elapsed since 00:00 Universal time on =
January=20
1, 1970 in the Gregorian calendar (Julian day 2440587.5), with time =
stored as a=20
32 bit signed integer (<TT>long</TT> in early C implementations). </P>
<P>The influence of Unix time representation has spread well beyond Unix =
since=20
most C and C++ libraries on other systems provide Unix-compatible time =
and date=20
functions. The major drawback of Unix time representation is that, if =
kept as a=20
32 bit signed quantity, on January 19, 2038 it will go negative, =
resulting in=20
chaos in programs unprepared for this. Unix and C implementations wisely =
(for=20
reasons described below) define the result of the <TT>time()</TT> =
function as=20
type <TT>time_t</TT>, which leaves the door open for remediation (by =
changing=20
the definition to a 64 bit integer, for example) before the clock ticks =
the=20
dreaded doomsday second. </P>
<P>C compilers on Unix systems prior to 7th Edition lacked the 32-bit=20
<TT>long</TT> type. On earlier systems <TT>time_t</TT>, the value =
returned by=20
the <TT>time()</TT> function, was an array of two 16-bit <TT>int</TT>s =
which,=20
concatenated, represented the 32-bit value. This is the reason why=20
<TT>time()</TT> accepts a pointer argument to the result (prior to 7th =
Edition=20
it returned a status, not the 32-bit time) and <TT>ctime()</TT> requires =
a=20
pointer to its input argument. Thanks to Eric Allman (author of=20
<TT>sendmail</TT>) for pointing out these historical nuggets. <BR=20
clear=3Dleft></P>
<H3><A name=3Dexcelserial1900>Excel Serial Day Number</A></H3>
<FORM name=3Dexcelserial1900 action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TD align=3Dmiddle><B><FONT size=3D+1>1900 Date System =
(PC)</FONT></B>=20
      <BR><B>Excel serial day:</B> <INPUT size=3D16 name=3Dday> =
</TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT =
onclick=3DcalcExcelSerial1900(); type=3Dbutton value=3DCalculate>=20
    </TD></TR></TBODY></TABLE></FORM>
<P>Spreadsheet calculations frequently need to do arithmetic with date =
and time=20
quantities=97for example, calculating the interest on a loan with a =
given term.=20
When Microsoft Excel was introduced for the PC Windows platform, it =
defined=20
dates and times as =93serial values=94, which express dates and times as =
the number=20
of days elapsed since midnight on January 1, 1900 with time given as a =
fraction=20
of a day. Midnight on January 1, 1900 is day 1.0 in this scheme. Time =
zone is=20
unspecified in Excel dates, with the <TT>NOW()</TT> function returning =
whatever=20
the computer's clock is set to=97in most cases local time, so when =
combining data=20
from machines in different time zones you usually need to add or =
subtract the=20
bias, which can differ over the year due to observance of summer time. =
Here we=20
assume Excel dates represent Universal (Greenwich Mean) time, since =
there isn't=20
any other rational choice. But don't assume you can always get away with =
this.=20
</P>
<P>You'd be entitled to think, therefore, that conversion back and forth =
between=20
PC Excel serial values and Julian day numbers would simply be a matter =
of adding=20
or subtracting the Julian day number of December 31, 1899 (since the PC =
Excel=20
days are numbered from 1). But this is a <EM>Microsoft</EM> calendar, =
remember,=20
so one must first look to make sure it doesn't contain one of those =
bonehead=20
blunders characteristic of Microsoft. As is usually the case, one =
doesn't have=20
to look very far. If you have a copy of PC Excel, fire it up, format a =
cell as=20
containing a date, and type 60 into it: out pops =93February 29, =
1900=94. News=20
apparently travels <EM>very</EM> slowly from Rome to Redmond=97ever =
since Pope=20
Gregory <A =
href=3D"http://www.fourmilab.ch/documents/calendar/IG_Latin.html"=20
target=3D_blank>revised the calendar</A> in 1582, years divisible by 100 =
have=20
<EM>not</EM> been leap years, and consequently the year 1900 contained =
no=20
February 29th. Due to this morsel of information having been lost =
somewhere=20
between the Holy See and the <A=20
href=3D"http://www.fourmilab.ch/documents/top10.html">Infernal</A> =
Seattle=20
monopoly, all Excel day numbers for days subsequent to February 28th, =
1900 are=20
one day greater than the actual day count from January 1, 1900. Further, =
note=20
that any computation of the number of days in a period which begins in =
January=20
or February 1900 and ends in a subsequent month will be off by one=97the =
day count=20
will be one greater than the actual number of days elapsed. </P>
<P>By the time the 1900 blunder was discovered, Excel users had created =
millions=20
of spreadsheets containing incorrect day numbers, so Microsoft decided =
to leave=20
the error in place rather than force users to convert their =
spreadsheets, and=20
the error remains to this day. Note, however, that <EM>only 1900</EM> is =

affected; while the first release of Excel probably also screwed up all =
years=20
divisible by 100 and hence implemented a purely Julian calendar, =
contemporary=20
versions do correctly count days in 2000 (which is a leap year, being =
divisible=20
by 400), 2100, and subsequent end of century years. </P>
<P>PC Excel day numbers are valid only between 1 (January 1, 1900) and =
2958465=20
(December 31, 9999). Although a serial day counting scheme has no =
difficulty=20
coping with arbitrary date ranges or days before the start of the epoch =
(given=20
sufficient precision in the representation of numbers), Excel doesn't do =
so. Day=20
0 is deemed the idiotic January 0, 1900 (at least in Excel 97), and =
negative=20
days and those in Y10K and beyond are not handled at all. Further, old =
versions=20
of Excel did date arithmetic using 16 bit quantities and did not support =
day=20
numbers greater than 65380 (December 31, 2078); I do not know in which =
release=20
of Excel this limitation was remedied. <BR clear=3Dleft></P><A=20
name=3Dexcelserial1904></A>
<FORM name=3Dexcelserial1904 action=3D"javascript:return false;">
<TABLE class=3Dl>
  <TBODY>
  <TR>
    <TD align=3Dmiddle><B><FONT size=3D+1>1904 Date System =
(Macintosh)</FONT></B>=20
      <BR><B>Excel serial day:</B> <INPUT size=3D16 name=3Dday> =
</TD></TR>
  <TR>
    <TD align=3Dmiddle colSpan=3D2><INPUT =
onclick=3DcalcExcelSerial1904(); type=3Dbutton value=3DCalculate>=20
    </TD></TR></TBODY></TABLE></FORM>
<P>Having saddled every PC Excel user with a defective date numbering =
scheme=20
wasn't enough for Microsoft=97nothing ever is. Next, they proceeded to =
come out=20
with a Macintosh version of Excel which uses an <EM>entirely =
different</EM> day=20
numbering system based on the MacOS native time format which counts =
seconds=20
elapsed since January 1, 1904. To further obfuscate matters, on the =
Macintosh=20
they chose to number days from zero rather than 1, so midnight on =
January 1,=20
1904 has serial value 0.0. By starting in 1904, they avoided screwing up =
1900 as=20
they did on the PC. So now Excel users who interchange data have to cope =
with=20
two incompatible schemes for counting days, one of which thinks 1900 was =
a leap=20
year and the other which doesn't go back that far. To compound the fun, =
you can=20
now select either date system on either platform, so you can't be =
certain dates=20
are compatible even when receiving data from another user with same kind =
of=20
machine you're using. I'm sure this was all done in the interest of the=20
=93efficiency=94 of which Microsoft is so fond. As we all know, it would =
take a=20
computer <EM>almost forever</EM> to add or subtract four in order to =
make=20
everything seamlessly interchangeable. </P>
<P>Macintosh Excel day numbers are valid only between 0 (January 1, =
1904) and=20
2957003 (December 31, 9999). Although a serial day counting scheme has =
no=20
difficulty coping with arbitrary date ranges or days before the start of =
the=20
epoch (given sufficient precision in the representation of numbers), =
Excel=20
doesn't do so. Negative days and those in Y10K and beyond are not =
handled at=20
all. Further, old versions of Excel did date arithmetic using 16 bit =
quantities=20
and did not support day numbers greater than 63918 (December 31, 2078); =
I do not=20
know in which release of Excel this limitation was remedied. <BR =
clear=3Dleft></P>
<SCRIPT language=3DJavaScript type=3Dtext/javascript>=0A=
<!--=0A=
    if (location.search !=3D "") {=0A=
    	presetDataToRequest(location.search.substring(1));=0A=
    } else {=0A=
    	calcGregorian();                  // Calculate today's values in =
other calendars=0A=
    }=0A=
// -->=0A=
</SCRIPT>

<H3>References</H3>
<TABLE class=3Da>
  <TBODY>
  <TR>
    <TD align=3Dmiddle bgColor=3D#e0e0e0><FONT face=3D"Arial, Helvetica, =
sans-serif"=20
      size=3D-1>Click on titles to order books on-line from <BR><A=20
      =
href=3D"http://www.amazon.com/exec/obidos/redirect-home/fourmilabwwwfour"=
=20
      target=3DAmazon_Fourmilab><IMG height=3D29 alt=3DAmazon.com.=20
      src=3D"http://www.fourmilab.ch/images/icons/amazon.gif" width=3D90 =
vspace=3D3=20
      border=3D0></A> </FONT></TD></TR></TBODY></TABLE>
<DL>
  <DT>Meeus, Jean. <CITE><A=20
  =
href=3D"http://www.amazon.com/exec/obidos/ASIN/0943396611/fourmilabwwwfou=
r"=20
  target=3DAmazon_Fourmilab>Astronomical Algorithms</A></CITE> 2nd ed. =
Richmond:=20
  Willmann-Bell, 1998. ISBN 0943396-61-1.=20
  <DD>The essential reference for computational positional astronomy.=20
  <DT>P. Kenneth Seidelmann (ed.) <CITE><A=20
  =
href=3D"http://www.amazon.com/exec/obidos/ASIN/1891389459/fourmilabwwwfou=
r"=20
  target=3DAmazon_Fourmilab>Explanatory Supplement to the Astronomical =
Almanac=20
  </A></CITE>. Sausalito CA: University Science Books, [1992] 2005. ISBN =

  1-891389-45-9.=20
  <DD>Authoritative reference on a wealth of topics related to =
computational=20
  geodesy and astronomy. Various calendars are described in depth, =
including=20
  techniques for interconversion.=20
  <DT>The <A href=3D"http://www.imcce.fr/imcce_en.html" =
target=3D_blank>Institut de=20
  m=E9canique c=E9leste et de calcul des =E9ph=E9m=E9rides</A> in Paris =
provides excellent=20
  on-line descriptions of a variety of <A=20
  =
href=3D"http://www.imcce.fr/page.php?nav=3Dfr/ephemerides/astronomie/Prom=
enade/pages2/277.html"=20
  target=3D_blank>calendars</A>. </DT></DL><BR clear=3Dright>
<HR>

<P>
<TABLE align=3Dright>
  <TBODY>
  <TR>
    <TD align=3Dmiddle>
      <FORM name=3Dfeedback action=3D/cgi-bin/FeedbackForm.pl =
method=3Dpost><INPUT=20
      type=3Dhidden value=3D"<cite>Calendar Converter</cite>" =
name=3Dpagetitle> <INPUT=20
      type=3Dhidden value=3D"Back to <cite>Calendar Converter</cite>" =
name=3Dbacklink>=20
<INPUT type=3Dsubmit value=3D" Send Feedback "> </FORM></TD></TR>
  <TR>
    <TD align=3Dmiddle><A =
href=3D"http://validator.w3.org/check?uri=3Dreferer"=20
      target=3DFourmilabValidation><IMG height=3D31 alt=3D"Valid XHTML =
1.0"=20
      src=3D"http://www.fourmilab.ch/images/icons/valid-xhtml10.png" =
width=3D88=20
      border=3D0></A> </TD></TR></TBODY></TABLE>
<ADDRESS>by <A href=3D"http://www.fourmilab.ch/">John =
Walker</A><BR>June, MMVI=20
</ADDRESS>
<CENTER><EM>This document is in the public domain.</EM> =
</CENTER></BODY></HTML>

------=_NextPart_000_0000_01C8C7DC.62626FD0
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Location: http://www.fourmilab.ch/documents/calendar/figures/hebrew_month_0.gif

R0lGODlhugAzAOcAANDQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAAAAALAAAAAC6ADMA
QAieAAEIHEiwoMGDCBMqXMiwocOHECNKnEixosWLGDNq3Mixo8ePIEOKHEmypMmTKFOqXMmypcuX
MGPKnEmzps2bOHPq3Mmzp8+fQIMKHUq0qNGjSJMqXcq0qdOnUKNKnUq1qtWrWLNq3cq1q9evYMOK
HUu2rNmzaNOqXcu2rdu3cOPKnUu3rt27ePPq3cu3r9+/gAMLHky4sOHDiBOHDAgAOw==

------=_NextPart_000_0000_01C8C7DC.62626FD0
Content-Type: image/gif
Content-Transfer-Encoding: base64
Content-Location: http://www.fourmilab.ch/images/icons/amazon.gif

R0lGODlhWgAdALP/AP///zEAAJwAAKWlpWNjY/8AAHsAAN4AAM7OzkJCQjExMb0AAISEhAAAAAAA
AAAAACwAAAAAWgAdAEAE/7DJSau9OOvNuxxAGBINKJ4A0igo0CSt0iCoOrdMRYT0cCM01a41siiC
DIAv6WI2nKXQYIBQHIHYxEfkk0BDuQRDG0UMZArTWQLINdpst2dOr9vv+Lxez+U9Q39NgExmIWQ0
Ll6AbHBfcBNJZBI0FClvbo+PGgEBBgYLCwcFBaALAp4GnJx7FaqdqAKgoqO0taOgnqusu7y9vr/A
wcK8MJZOx4sSCkOSLAAkTGhggYxyDTskEyCVPpmY1i/TfsiCLkGBCc4IDOzpUmkhMo5hYzBdK9gS
+d5xww2unFAJHEhwIEBfnQL4W2ghYCwDDCNKnEixosWLGC0kAJKiC4F1DMJ6EACRjcq7F1iyeEEy
4SO7HjIqJJiS7ZqZbGlKDCDxsWaFAQmKqWAixhCUnUVdJCDAFNEKKTPjoSsGztI1po+SEGDhg+tT
cCsQjRtENpEJEZLOUau2dhokADEnJWKjgt+lCs60jC1HrUc4AFqYvYX7tNEit4ok3ahU91u/CkSo
kQt0YmsLLWelKEo0LUmOHiDqKjHx2G7G03YCeooFypbrA6Vih3JNuzZsXLkUeli9gJSp3Kg3vWJN
W0Dw48iTK98TAQA7

------=_NextPart_000_0000_01C8C7DC.62626FD0
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-Location: http://www.fourmilab.ch/images/icons/valid-xhtml10.png

iVBORw0KGgoAAAANSUhEUgAAAFgAAAAfCAMAAAEjEcpEAAACiFBMVEUAAADe5+fOezmtra3ejEKl
hELvvWO9WlrehELOe3vepaWclHvetVLGc3PerVKcCAj3vVqUjHOUe1JjlL0xOUpjjL2UAAC91ueM
rc7vrVKlvdbW3u+EpcbO3ufO1ucYWpSMKQi9SiF7e3taWkoQEAiMczkQSoxaUkpzc3O1lEoICACE
azEhGAgIAACEYzFra2utjELWcznGnEr/7+9jY2POazHOYzGta2NShLVrlL05OUqctdacCADGa2uc
AADGpVqUtc61ORg5OTmlUikYGAiUezl7YzEYEAiUczkxMTG9nEqtIRDe3t4AMXu9lEoQCACMazEA
KXspKSmljFrW1ta1jELOzs7n7/fGxsa9pVqEOSkpY5xznL29tZxahLXOpVr/99ZrY1L/79ZjUilj
SikAOYTvxmMAMYScezmchFqUczGtlFp7c2utjFqUlJStxt73///39/9Ce61CSkq9xsZznMbW5+9C
c62MjIxCQkrv9/fv7/fOzsbnlErWjIz/3mtCORhza1IpIRBzWjH/1mtCMRhzY1L/zmvnvVpSQiHO
pVJrUinntVr3zmOEc1L3xmNaWlq1nFo5QkrGWim1lFoISpRSUlK1zt4hWpwASoz///////8xa6WU
aykAQoxKe61KSkp7nMbWtWPe5+9jWlL39/f39/fWrWNCQkLera3nvWPv7+85MRjntWPetVp7c1Ix
KRCUlHtKORh7a1IxIRCUjHtaSiHWrVIpIQhzWinvvVpaQiH/1mPWpVKMe1L/zmP/xmNrUiGErc4Y
GBj/73PG1ucQWpT/53O9nFoQUpS1SiEQEBC9zt69vb05c6UISoxSUko5a6UICAhSSkohUpS1tbXe
tWMAQoSUgD+kAAAA2HRSTlP/////////iP9sSf//dP//////////////////////////////////
//////////////8M////////////ef//////////////////////////////////////////////
//////////////////////////////////////9d////////////////////////////////////
AP//////////////CP//RP//////////////////////////////////////////////////////
//////9xPp1gAAAFvUlEQVR42pVWi18URRwfy7vsYUbaiqBRBFmICUQGVKcZckQeaRJQUCLeycMS
fKGH0uo5NELpIvGQGzokvTTA85VHKTpbRoeJnPno/p1+M7t3txj20e/Nzu7Ofve7v/k9Zg4Vc+wR
QMW0eyLx1ZSANeBDxVmxZZSwEUYkGAewm1eIBOMRvhv1UA+q8KXIVuxGdCelFYwxAnxOrxgbY8Ti
1t4VA0QHYz4x3FnVC8OVLXv9fkKGSWDoW/4lG6VbdtBblesOs+MjmEmzJKNIJWFEfEQTCWNPFKvc
KEymjLO1b8bwYQd1hCiiDCl5KsrDCIlhj4fSuvcpfSpgJmyv6dzeZv+nMPx3dhbt94II07/JZliE
tm1N2RIYPkTYshwYm245a/zkWjJwcyFh6ZIcYxxmqiaDSYxhOhFUsqngi3Fzcj3ljdYDNE9uzA1Y
D/5MhnzW1KRqF7mYG8jFYXLcfLpjOe2LA0fuGqQrQHl10sdK0sFcFSOSlzF0BgXQH9h3QZDBI0cc
NEhftjXuippBDD2/eMRiETmwwNEYHyqhdDyo22w+3QHuNbdve5a7eOkHmDVJ0ixNmfbz1h0qo/Q6
GuSB2wQJQbpOjOQAl7woWSRJ0m2ewhvAOUiYYtZtaZL0CZZmtmVOQttLfr/dbveLZodrfrL7W75w
G/JjqkQxoNTtNsTKELQpQL6/D5loaSmyTT8TUhsmi8iFA0hZiyltf7OiNKdarRm5w2So2lTNdPLu
IzR+AiLj8VTRJaj0LmX4VhJ27f/VJV/yycilWPOrk8NkXi7Qqmj5bHqVZlJKZIRk1wFzKrt0WUbn
XMPJ1fk4TJ5oWBA61p1V76DeIs0MX+s3GxRlA1vtw83KhgNphc1nyErLO5zcvbOsrq+scbZnpzc6
QVFPenLwGxmC+BOfYI+DN55QYddh4Q/NE/yGYYj4TOGNngQavAZnzzTovEA+kcMJ+247uYexNA+4
Fsvjmuv662jsWxPZx2xg890bYMYnTgya7bjmCiEY0qgJ0vMF3c+NoFdPyzxz6V3Uxs3AOWCDchRv
OsQtBrbFsrT2fhHEc7ByGzu/dA4IO0A3HdfeP9yMqAwP6NPEb6cbwn0PWVU17/FDBQh/CPIrbfcg
027IZrsAT/Bf3FNWyn9RSR4cvvwn3e4HFmYPDl/thYcRVi8qPEoXVUWBl6FTBFTtnqmKKg5wnlF4
wZ1yeLv7TiwXKektE+iDBNicWEyLpnFhfDkpJc3q2khSPyQBbE0dMJnOoDzTwGsI7cdyMkL5gWqU
jCF6Txst/twxCv1WzzHoy21ZDQ1xnuDzdPDWR4knr14v0tYn3IxaMFFdiMOlEOJHw1jOQ4sWt5rQ
opRkXZhMEi7pmeDCVWBlfUKwhMZ7rsF6elKsvbwiKxgxIdewa3ErsaYomCVZFYJb0GUu3JqGUNop
lBxYiYby8vLBFWef+Cri4/I1sbQ/1OtYTrNtdXS+rSe7kQ52eSObL99/iErCWUjCy5W4JLygmCou
GfG9x9fmx17XhBuDCaOerbt538erta7TFktLvdHghZcCbcPQO33zIJG9kxF5hoVXnzTzRz0r5js8
oTj6uyPkGRf346HOLcasgFexueNUWFPtuFKzjoSFYYedhwVlhsRVYWWJpltv1XPQT1Rl0bjZIBlb
1XujVDzY/Kj4k6Ku3+Z0jo1owjVzDpFTXe1juvBSWNFmNWGZy8LvzUl5PN4JCwyNDzbQ0aAj4Zrj
z0FatGJJYhvq4j7mGSpvytGFlZtHf2C4o/28Zu8z7wo7eYPfXysnF0i9NnPh1t1zR7VBb9GqaOXh
tTmHQdgMFXE+Z608cnpODdZdjL+TuDY44Q38kJXHhccWLoOd9uv1AwwvO+48uu+faCSJPJ1bmy6T
hyvpivBmYWgjxPDPAp7JTemY/yGKFEiRt/jG/2P79s8KCwoLCgoLC/khUBA5F0SfQZ+RYfpNE/4X
osmq7jsZAJsAAAAASUVORK5CYII=

------=_NextPart_000_0000_01C8C7DC.62626FD0
Content-Type: application/octet-stream
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.fourmilab.ch/documents/calendar/astro.js

/*=0A=
            JavaScript functions for positional astronomy=0A=
=0A=
                  by John Walker  --  September, MIM=0A=
                       http://www.fourmilab.ch/=0A=
=0A=
                This program is in the public domain.=0A=
*/=0A=
=0A=
//  Frequently-used constants=0A=
=0A=
var=0A=
    J2000             =3D 2451545.0,              // Julian day of J2000 =
epoch=0A=
    JulianCentury     =3D 36525.0,                // Days in Julian =
century=0A=
    JulianMillennium  =3D (JulianCentury * 10),   // Days in Julian =
millennium=0A=
    AstronomicalUnit  =3D 149597870.0,            // Astronomical unit =
in kilometres=0A=
    TropicalYear      =3D 365.24219878;           // Mean solar tropical =
year=0A=
=0A=
/*  ASTOR  --  Arc-seconds to radians.  */=0A=
=0A=
function astor(a)=0A=
{=0A=
    return a * (Math.PI / (180.0 * 3600.0));=0A=
}=0A=
=0A=
/*  DTR  --  Degrees to radians.  */=0A=
=0A=
function dtr(d)=0A=
{=0A=
    return (d * Math.PI) / 180.0;=0A=
}=0A=
=0A=
/*  RTD  --  Radians to degrees.  */=0A=
=0A=
function rtd(r)=0A=
{=0A=
    return (r * 180.0) / Math.PI;=0A=
}=0A=
=0A=
/*  FIXANGLE  --  Range reduce angle in degrees.  */=0A=
=0A=
function fixangle(a)=0A=
{=0A=
        return a - 360.0 * (Math.floor(a / 360.0));=0A=
}=0A=
=0A=
/*  FIXANGR  --  Range reduce angle in radians.  */=0A=
=0A=
function fixangr(a)=0A=
{=0A=
        return a - (2 * Math.PI) * (Math.floor(a / (2 * Math.PI)));=0A=
}=0A=
=0A=
//  DSIN  --  Sine of an angle in degrees=0A=
=0A=
function dsin(d)=0A=
{=0A=
    return Math.sin(dtr(d));=0A=
}=0A=
=0A=
//  DCOS  --  Cosine of an angle in degrees=0A=
=0A=
function dcos(d)=0A=
{=0A=
    return Math.cos(dtr(d));=0A=
}=0A=
=0A=
/*  MOD  --  Modulus function which works for non-integers.  */=0A=
=0A=
function mod(a, b)=0A=
{=0A=
    return a - (b * Math.floor(a / b));=0A=
}=0A=
=0A=
//  AMOD  --  Modulus function which returns numerator if modulus is zero=0A=
=0A=
function amod(a, b)=0A=
{=0A=
    return mod(a - 1, b) + 1;=0A=
}=0A=
=0A=
/*  JHMS  --  Convert Julian time to hour, minutes, and seconds,=0A=
              returned as a three-element array.  */=0A=
=0A=
function jhms(j) {=0A=
    var ij;=0A=
=0A=
    j +=3D 0.5;                 /* Astronomical to civil */=0A=
    ij =3D ((j - Math.floor(j)) * 86400.0) + 0.5;=0A=
    return new Array(=0A=
                     Math.floor(ij / 3600),=0A=
                     Math.floor((ij / 60) % 60),=0A=
                     Math.floor(ij % 60));=0A=
}=0A=
=0A=
//  JWDAY  --  Calculate day of week from Julian day=0A=
=0A=
var Weekdays =3D new Array( "Sunday", "Monday", "Tuesday", "Wednesday",=0A=
                          "Thursday", "Friday", "Saturday" );=0A=
=0A=
function jwday(j)=0A=
{=0A=
    return mod(Math.floor((j + 1.5)), 7);=0A=
}=0A=
=0A=
/*  OBLIQEQ  --  Calculate the obliquity of the ecliptic for a given=0A=
                 Julian date.  This uses Laskar's tenth-degree=0A=
                 polynomial fit (J. Laskar, Astronomy and=0A=
                 Astrophysics, Vol. 157, page 68 [1986]) which is=0A=
                 accurate to within 0.01 arc second between AD 1000=0A=
                 and AD 3000, and within a few seconds of arc for=0A=
                 +/-10000 years around AD 2000.  If we're outside the=0A=
                 range in which this fit is valid (deep time) we=0A=
                 simply return the J2000 value of the obliquity, which=0A=
                 happens to be almost precisely the mean.  */=0A=
=0A=
var oterms =3D new Array (=0A=
        -4680.93,=0A=
           -1.55,=0A=
         1999.25,=0A=
          -51.38,=0A=
         -249.67,=0A=
          -39.05,=0A=
            7.12,=0A=
           27.87,=0A=
            5.79,=0A=
            2.45=0A=
);=0A=
=0A=
function obliqeq(jd)=0A=
{=0A=
    var eps, u, v, i;=0A=
=0A=
    v =3D u =3D (jd - J2000) / (JulianCentury * 100);=0A=
=0A=
    eps =3D 23 + (26 / 60.0) + (21.448 / 3600.0);=0A=
=0A=
    if (Math.abs(u) < 1.0) {=0A=
        for (i =3D 0; i < 10; i++) {=0A=
            eps +=3D (oterms[i] / 3600.0) * v;=0A=
            v *=3D u;=0A=
        }=0A=
    }=0A=
    return eps;=0A=
}=0A=
=0A=
/* Periodic terms for nutation in longiude (delta \Psi) and=0A=
   obliquity (delta \Epsilon) as given in table 21.A of=0A=
   Meeus, "Astronomical Algorithms", first edition. */=0A=
=0A=
var nutArgMult =3D new Array(=0A=
     0,  0,  0,  0,  1,=0A=
    -2,  0,  0,  2,  2,=0A=
     0,  0,  0,  2,  2,=0A=
     0,  0,  0,  0,  2,=0A=
     0,  1,  0,  0,  0,=0A=
     0,  0,  1,  0,  0,=0A=
    -2,  1,  0,  2,  2,=0A=
     0,  0,  0,  2,  1,=0A=
     0,  0,  1,  2,  2,=0A=
    -2, -1,  0,  2,  2,=0A=
    -2,  0,  1,  0,  0,=0A=
    -2,  0,  0,  2,  1,=0A=
     0,  0, -1,  2,  2,=0A=
     2,  0,  0,  0,  0,=0A=
     0,  0,  1,  0,  1,=0A=
     2,  0, -1,  2,  2,=0A=
     0,  0, -1,  0,  1,=0A=
     0,  0,  1,  2,  1,=0A=
    -2,  0,  2,  0,  0,=0A=
     0,  0, -2,  2,  1,=0A=
     2,  0,  0,  2,  2,=0A=
     0,  0,  2,  2,  2,=0A=
     0,  0,  2,  0,  0,=0A=
    -2,  0,  1,  2,  2,=0A=
     0,  0,  0,  2,  0,=0A=
    -2,  0,  0,  2,  0,=0A=
     0,  0, -1,  2,  1,=0A=
     0,  2,  0,  0,  0,=0A=
     2,  0, -1,  0,  1,=0A=
    -2,  2,  0,  2,  2,=0A=
     0,  1,  0,  0,  1,=0A=
    -2,  0,  1,  0,  1,=0A=
     0, -1,  0,  0,  1,=0A=
     0,  0,  2, -2,  0,=0A=
     2,  0, -1,  2,  1,=0A=
     2,  0,  1,  2,  2,=0A=
     0,  1,  0,  2,  2,=0A=
    -2,  1,  1,  0,  0,=0A=
     0, -1,  0,  2,  2,=0A=
     2,  0,  0,  2,  1,=0A=
     2,  0,  1,  0,  0,=0A=
    -2,  0,  2,  2,  2,=0A=
    -2,  0,  1,  2,  1,=0A=
     2,  0, -2,  0,  1,=0A=
     2,  0,  0,  0,  1,=0A=
     0, -1,  1,  0,  0,=0A=
    -2, -1,  0,  2,  1,=0A=
    -2,  0,  0,  0,  1,=0A=
     0,  0,  2,  2,  1,=0A=
    -2,  0,  2,  0,  1,=0A=
    -2,  1,  0,  2,  1,=0A=
     0,  0,  1, -2,  0,=0A=
    -1,  0,  1,  0,  0,=0A=
    -2,  1,  0,  0,  0,=0A=
     1,  0,  0,  0,  0,=0A=
     0,  0,  1,  2,  0,=0A=
    -1, -1,  1,  0,  0,=0A=
     0,  1,  1,  0,  0,=0A=
     0, -1,  1,  2,  2,=0A=
     2, -1, -1,  2,  2,=0A=
     0,  0, -2,  2,  2,=0A=
     0,  0,  3,  2,  2,=0A=
     2, -1,  0,  2,  2=0A=
);=0A=
=0A=
var nutArgCoeff =3D new Array(=0A=
    -171996,   -1742,   92095,      89,          /*  0,  0,  0,  0,  1 */=0A=
     -13187,     -16,    5736,     -31,          /* -2,  0,  0,  2,  2 */=0A=
      -2274,      -2,     977,      -5,          /*  0,  0,  0,  2,  2 */=0A=
       2062,       2,    -895,       5,          /*  0,  0,  0,  0,  2 */=0A=
       1426,     -34,      54,      -1,          /*  0,  1,  0,  0,  0 */=0A=
        712,       1,      -7,       0,          /*  0,  0,  1,  0,  0 */=0A=
       -517,      12,     224,      -6,          /* -2,  1,  0,  2,  2 */=0A=
       -386,      -4,     200,       0,          /*  0,  0,  0,  2,  1 */=0A=
       -301,       0,     129,      -1,          /*  0,  0,  1,  2,  2 */=0A=
        217,      -5,     -95,       3,          /* -2, -1,  0,  2,  2 */=0A=
       -158,       0,       0,       0,          /* -2,  0,  1,  0,  0 */=0A=
        129,       1,     -70,       0,          /* -2,  0,  0,  2,  1 */=0A=
        123,       0,     -53,       0,          /*  0,  0, -1,  2,  2 */=0A=
         63,       0,       0,       0,          /*  2,  0,  0,  0,  0 */=0A=
         63,       1,     -33,       0,          /*  0,  0,  1,  0,  1 */=0A=
        -59,       0,      26,       0,          /*  2,  0, -1,  2,  2 */=0A=
        -58,      -1,      32,       0,          /*  0,  0, -1,  0,  1 */=0A=
        -51,       0,      27,       0,          /*  0,  0,  1,  2,  1 */=0A=
         48,       0,       0,       0,          /* -2,  0,  2,  0,  0 */=0A=
         46,       0,     -24,       0,          /*  0,  0, -2,  2,  1 */=0A=
        -38,       0,      16,       0,          /*  2,  0,  0,  2,  2 */=0A=
        -31,       0,      13,       0,          /*  0,  0,  2,  2,  2 */=0A=
         29,       0,       0,       0,          /*  0,  0,  2,  0,  0 */=0A=
         29,       0,     -12,       0,          /* -2,  0,  1,  2,  2 */=0A=
         26,       0,       0,       0,          /*  0,  0,  0,  2,  0 */=0A=
        -22,       0,       0,       0,          /* -2,  0,  0,  2,  0 */=0A=
         21,       0,     -10,       0,          /*  0,  0, -1,  2,  1 */=0A=
         17,      -1,       0,       0,          /*  0,  2,  0,  0,  0 */=0A=
         16,       0,      -8,       0,          /*  2,  0, -1,  0,  1 */=0A=
        -16,       1,       7,       0,          /* -2,  2,  0,  2,  2 */=0A=
        -15,       0,       9,       0,          /*  0,  1,  0,  0,  1 */=0A=
        -13,       0,       7,       0,          /* -2,  0,  1,  0,  1 */=0A=
        -12,       0,       6,       0,          /*  0, -1,  0,  0,  1 */=0A=
         11,       0,       0,       0,          /*  0,  0,  2, -2,  0 */=0A=
        -10,       0,       5,       0,          /*  2,  0, -1,  2,  1 */=0A=
         -8,       0,       3,       0,          /*  2,  0,  1,  2,  2 */=0A=
          7,       0,      -3,       0,          /*  0,  1,  0,  2,  2 */=0A=
         -7,       0,       0,       0,          /* -2,  1,  1,  0,  0 */=0A=
         -7,       0,       3,       0,          /*  0, -1,  0,  2,  2 */=0A=
         -7,       0,       3,       0,          /*  2,  0,  0,  2,  1 */=0A=
          6,       0,       0,       0,          /*  2,  0,  1,  0,  0 */=0A=
          6,       0,      -3,       0,          /* -2,  0,  2,  2,  2 */=0A=
          6,       0,      -3,       0,          /* -2,  0,  1,  2,  1 */=0A=
         -6,       0,       3,       0,          /*  2,  0, -2,  0,  1 */=0A=
         -6,       0,       3,       0,          /*  2,  0,  0,  0,  1 */=0A=
          5,       0,       0,       0,          /*  0, -1,  1,  0,  0 */=0A=
         -5,       0,       3,       0,          /* -2, -1,  0,  2,  1 */=0A=
         -5,       0,       3,       0,          /* -2,  0,  0,  0,  1 */=0A=
         -5,       0,       3,       0,          /*  0,  0,  2,  2,  1 */=0A=
          4,       0,       0,       0,          /* -2,  0,  2,  0,  1 */=0A=
          4,       0,       0,       0,          /* -2,  1,  0,  2,  1 */=0A=
          4,       0,       0,       0,          /*  0,  0,  1, -2,  0 */=0A=
         -4,       0,       0,       0,          /* -1,  0,  1,  0,  0 */=0A=
         -4,       0,       0,       0,          /* -2,  1,  0,  0,  0 */=0A=
         -4,       0,       0,       0,          /*  1,  0,  0,  0,  0 */=0A=
          3,       0,       0,       0,          /*  0,  0,  1,  2,  0 */=0A=
         -3,       0,       0,       0,          /* -1, -1,  1,  0,  0 */=0A=
         -3,       0,       0,       0,          /*  0,  1,  1,  0,  0 */=0A=
         -3,       0,       0,       0,          /*  0, -1,  1,  2,  2 */=0A=
         -3,       0,       0,       0,          /*  2, -1, -1,  2,  2 */=0A=
         -3,       0,       0,       0,          /*  0,  0, -2,  2,  2 */=0A=
         -3,       0,       0,       0,          /*  0,  0,  3,  2,  2 */=0A=
         -3,       0,       0,       0           /*  2, -1,  0,  2,  2 */=0A=
);=0A=
=0A=
/*  NUTATION  --  Calculate the nutation in longitude, deltaPsi, and=0A=
                  obliquity, deltaEpsilon for a given Julian date=0A=
                  jd.  Results are returned as a two element Array=0A=
                  giving (deltaPsi, deltaEpsilon) in degrees.  */=0A=
=0A=
function nutation(jd)=0A=
{=0A=
    var deltaPsi, deltaEpsilon,=0A=
        i, j,=0A=
        t =3D (jd - 2451545.0) / 36525.0, t2, t3, to10,=0A=
        ta =3D new Array,=0A=
        dp =3D 0, de =3D 0, ang;=0A=
=0A=
    t3 =3D t * (t2 =3D t * t);=0A=
=0A=
    /* Calculate angles.  The correspondence between the elements=0A=
       of our array and the terms cited in Meeus are:=0A=
=0A=
       ta[0] =3D D  ta[0] =3D M  ta[2] =3D M'  ta[3] =3D F  ta[4] =3D =
\Omega=0A=
=0A=
    */=0A=
=0A=
    ta[0] =3D dtr(297.850363 + 445267.11148 * t - 0.0019142 * t2 + =0A=
                t3 / 189474.0);=0A=
    ta[1] =3D dtr(357.52772 + 35999.05034 * t - 0.0001603 * t2 -=0A=
                t3 / 300000.0);=0A=
    ta[2] =3D dtr(134.96298 + 477198.867398 * t + 0.0086972 * t2 +=0A=
                t3 / 56250.0);=0A=
    ta[3] =3D dtr(93.27191 + 483202.017538 * t - 0.0036825 * t2 +=0A=
                t3 / 327270);=0A=
    ta[4] =3D dtr(125.04452 - 1934.136261 * t + 0.0020708 * t2 +=0A=
                t3 / 450000.0);=0A=
=0A=
    /* Range reduce the angles in case the sine and cosine functions=0A=
       don't do it as accurately or quickly. */=0A=
=0A=
    for (i =3D 0; i < 5; i++) {=0A=
        ta[i] =3D fixangr(ta[i]);=0A=
    }=0A=
=0A=
    to10 =3D t / 10.0;=0A=
    for (i =3D 0; i < 63; i++) {=0A=
        ang =3D 0;=0A=
        for (j =3D 0; j < 5; j++) {=0A=
            if (nutArgMult[(i * 5) + j] !=3D 0) {=0A=
                ang +=3D nutArgMult[(i * 5) + j] * ta[j];=0A=
            }=0A=
        }=0A=
        dp +=3D (nutArgCoeff[(i * 4) + 0] + nutArgCoeff[(i * 4) + 1] * =
to10) * Math.sin(ang);=0A=
        de +=3D (nutArgCoeff[(i * 4) + 2] + nutArgCoeff[(i * 4) + 3] * =
to10) * Math.cos(ang);=0A=
    }=0A=
=0A=
    /* Return the result, converting from ten thousandths of arc=0A=
       seconds to radians in the process. */=0A=
=0A=
    deltaPsi =3D dp / (3600.0 * 10000.0);=0A=
    deltaEpsilon =3D de / (3600.0 * 10000.0);=0A=
=0A=
    return new Array(deltaPsi, deltaEpsilon);=0A=
}=0A=
=0A=
/*  ECLIPTOEQ  --  Convert celestial (ecliptical) longitude and=0A=
                   latitude into right ascension (in degrees) and=0A=
                   declination.  We must supply the time of the=0A=
                   conversion in order to compensate correctly for the=0A=
                   varying obliquity of the ecliptic over time.=0A=
                   The right ascension and declination are returned=0A=
                   as a two-element Array in that order.  */=0A=
=0A=
function ecliptoeq(jd, Lambda, Beta)=0A=
{=0A=
    var eps, Ra, Dec;=0A=
=0A=
    /* Obliquity of the ecliptic. */=0A=
=0A=
    eps =3D dtr(obliqeq(jd));=0A=
log +=3D "Obliquity: " + rtd(eps) + "\n";=0A=
=0A=
    Ra =3D rtd(Math.atan2((Math.cos(eps) * Math.sin(dtr(Lambda)) -=0A=
                        (Math.tan(dtr(Beta)) * Math.sin(eps))),=0A=
                      Math.cos(dtr(Lambda))));=0A=
log +=3D "RA =3D " + Ra + "\n";=0A=
    Ra =3D fixangle(rtd(Math.atan2((Math.cos(eps) * =
Math.sin(dtr(Lambda)) -=0A=
                        (Math.tan(dtr(Beta)) * Math.sin(eps))),=0A=
                      Math.cos(dtr(Lambda)))));=0A=
    Dec =3D rtd(Math.asin((Math.sin(eps) * Math.sin(dtr(Lambda)) * =
Math.cos(dtr(Beta))) +=0A=
                 (Math.sin(dtr(Beta)) * Math.cos(eps))));=0A=
=0A=
    return new Array(Ra, Dec);=0A=
}=0A=
=0A=
=0A=
/*  DELTAT  --  Determine the difference, in seconds, between=0A=
                Dynamical time and Universal time.  */=0A=
=0A=
/*  Table of observed Delta T values at the beginning of=0A=
    even numbered years from 1620 through 2002.  */=0A=
=0A=
var deltaTtab =3D new Array(=0A=
    121, 112, 103, 95, 88, 82, 77, 72, 68, 63, 60, 56, 53, 51, 48, 46,=0A=
    44, 42, 40, 38, 35, 33, 31, 29, 26, 24, 22, 20, 18, 16, 14, 12,=0A=
    11, 10, 9, 8, 7, 7, 7, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 10, 10, 10,=0A=
    10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 13, 13,=0A=
    13, 14, 14, 14, 14, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16,=0A=
    16, 16, 15, 15, 14, 13, 13.1, 12.5, 12.2, 12, 12, 12, 12, 12, 12,=0A=
    11.9, 11.6, 11, 10.2, 9.2, 8.2, 7.1, 6.2, 5.6, 5.4, 5.3, 5.4, 5.6,=0A=
    5.9, 6.2, 6.5, 6.8, 7.1, 7.3, 7.5, 7.6, 7.7, 7.3, 6.2, 5.2, 2.7,=0A=
    1.4, -1.2, -2.8, -3.8, -4.8, -5.5, -5.3, -5.6, -5.7, -5.9, -6,=0A=
    -6.3, -6.5, -6.2, -4.7, -2.8, -0.1, 2.6, 5.3, 7.7, 10.4, 13.3, 16,=0A=
    18.2, 20.2, 21.1, 22.4, 23.5, 23.8, 24.3, 24, 23.9, 23.9, 23.7,=0A=
    24, 24.3, 25.3, 26.2, 27.3, 28.2, 29.1, 30, 30.7, 31.4, 32.2,=0A=
    33.1, 34, 35, 36.5, 38.3, 40.2, 42.2, 44.5, 46.5, 48.5, 50.5,=0A=
    52.2, 53.8, 54.9, 55.8, 56.9, 58.3, 60, 61.6, 63, 65, 66.6=0A=
                         );=0A=
=0A=
function deltat(year)=0A=
{=0A=
    var dt, f, i, t;=0A=
=0A=
    if ((year >=3D 1620) && (year <=3D 2000)) {=0A=
        i =3D Math.floor((year - 1620) / 2);=0A=
        f =3D ((year - 1620) / 2) - i;  /* Fractional part of year */=0A=
        dt =3D deltaTtab[i] + ((deltaTtab[i + 1] - deltaTtab[i]) * f);=0A=
    } else {=0A=
        t =3D (year - 2000) / 100;=0A=
        if (year < 948) {=0A=
            dt =3D 2177 + (497 * t) + (44.1 * t * t);=0A=
        } else {=0A=
            dt =3D 102 + (102 * t) + (25.3 * t * t);=0A=
            if ((year > 2000) && (year < 2100)) {=0A=
                dt +=3D 0.37 * (year - 2100);=0A=
            }=0A=
        }=0A=
    }=0A=
    return dt;=0A=
}=0A=
=0A=
/*  EQUINOX  --  Determine the Julian Ephemeris Day of an=0A=
                 equinox or solstice.  The "which" argument=0A=
                 selects the item to be computed:=0A=
=0A=
                    0   March equinox=0A=
                    1   June solstice=0A=
                    2   September equinox=0A=
                    3   December solstice=0A=
=0A=
*/=0A=
=0A=
//  Periodic terms to obtain true time=0A=
=0A=
var EquinoxpTerms =3D new Array(=0A=
                       485, 324.96,   1934.136,=0A=
                       203, 337.23,  32964.467,=0A=
                       199, 342.08,     20.186,=0A=
                       182,  27.85, 445267.112,=0A=
                       156,  73.14,  45036.886,=0A=
                       136, 171.52,  22518.443,=0A=
                        77, 222.54,  65928.934,=0A=
                        74, 296.72,   3034.906,=0A=
                        70, 243.58,   9037.513,=0A=
                        58, 119.81,  33718.147,=0A=
                        52, 297.17,    150.678,=0A=
                        50,  21.02,   2281.226,=0A=
                        45, 247.54,  29929.562,=0A=
                        44, 325.15,  31555.956,=0A=
                        29,  60.93,   4443.417,=0A=
                        18, 155.12,  67555.328,=0A=
                        17, 288.79,   4562.452,=0A=
                        16, 198.04,  62894.029,=0A=
                        14, 199.76,  31436.921,=0A=
                        12,  95.39,  14577.848,=0A=
                        12, 287.11,  31931.756,=0A=
                        12, 320.81,  34777.259,=0A=
                         9, 227.73,   1222.114,=0A=
                         8,  15.45,  16859.074=0A=
                             );=0A=
=0A=
JDE0tab1000 =3D new Array(=0A=
   new Array(1721139.29189, 365242.13740,  0.06134,  0.00111, -0.00071),=0A=
   new Array(1721233.25401, 365241.72562, -0.05323,  0.00907,  0.00025),=0A=
   new Array(1721325.70455, 365242.49558, -0.11677, -0.00297,  0.00074),=0A=
   new Array(1721414.39987, 365242.88257, -0.00769, -0.00933, -0.00006)=0A=
                       );=0A=
=0A=
JDE0tab2000 =3D new Array(=0A=
   new Array(2451623.80984, 365242.37404,  0.05169, -0.00411, -0.00057),=0A=
   new Array(2451716.56767, 365241.62603,  0.00325,  0.00888, -0.00030),=0A=
   new Array(2451810.21715, 365242.01767, -0.11575,  0.00337,  0.00078),=0A=
   new Array(2451900.05952, 365242.74049, -0.06223, -0.00823,  0.00032)=0A=
                       );=0A=
=0A=
function equinox(year, which)=0A=
{=0A=
    var deltaL, i, j, JDE0, JDE, JDE0tab, S, T, W, Y;=0A=
=0A=
    /*  Initialise terms for mean equinox and solstices.  We=0A=
        have two sets: one for years prior to 1000 and a second=0A=
        for subsequent years.  */=0A=
=0A=
    if (year < 1000) {=0A=
        JDE0tab =3D JDE0tab1000;=0A=
        Y =3D year / 1000;=0A=
    } else {=0A=
        JDE0tab =3D JDE0tab2000;=0A=
        Y =3D (year - 2000) / 1000;=0A=
    }=0A=
=0A=
    JDE0 =3D  JDE0tab[which][0] +=0A=
           (JDE0tab[which][1] * Y) +=0A=
           (JDE0tab[which][2] * Y * Y) +=0A=
           (JDE0tab[which][3] * Y * Y * Y) +=0A=
           (JDE0tab[which][4] * Y * Y * Y * Y);=0A=
=0A=
//document.debug.log.value +=3D "JDE0 =3D " + JDE0 + "\n";=0A=
=0A=
    T =3D (JDE0 - 2451545.0) / 36525;=0A=
//document.debug.log.value +=3D "T =3D " + T + "\n";=0A=
    W =3D (35999.373 * T) - 2.47;=0A=
//document.debug.log.value +=3D "W =3D " + W + "\n";=0A=
    deltaL =3D 1 + (0.0334 * dcos(W)) + (0.0007 * dcos(2 * W));=0A=
//document.debug.log.value +=3D "deltaL =3D " + deltaL + "\n";=0A=
=0A=
    //  Sum the periodic terms for time T=0A=
=0A=
    S =3D 0;=0A=
    for (i =3D j =3D 0; i < 24; i++) {=0A=
        S +=3D EquinoxpTerms[j] * dcos(EquinoxpTerms[j + 1] + =
(EquinoxpTerms[j + 2] * T));=0A=
        j +=3D 3;=0A=
    }=0A=
=0A=
//document.debug.log.value +=3D "S =3D " + S + "\n";=0A=
//document.debug.log.value +=3D "Corr =3D " + ((S * 0.00001) / deltaL) + =
"\n";=0A=
=0A=
    JDE =3D JDE0 + ((S * 0.00001) / deltaL);=0A=
=0A=
    return JDE;=0A=
}=0A=
=0A=
/*  SUNPOS  --  Position of the Sun.  Please see the comments=0A=
                on the return statement at the end of this function=0A=
                which describe the array it returns.  We return=0A=
                intermediate values because they are useful in a=0A=
                variety of other contexts.  */=0A=
=0A=
function sunpos(jd)=0A=
{=0A=
    var T, T2, L0, M, e, C, sunLong, sunAnomaly, sunR,=0A=
        Omega, Lambda, epsilon, epsilon0, Alpha, Delta,=0A=
        AlphaApp, DeltaApp;=0A=
=0A=
    T =3D (jd - J2000) / JulianCentury;=0A=
//document.debug.log.value +=3D "Sunpos.  T =3D " + T + "\n";=0A=
    T2 =3D T * T;=0A=
    L0 =3D 280.46646 + (36000.76983 * T) + (0.0003032 * T2);=0A=
//document.debug.log.value +=3D "L0 =3D " + L0 + "\n";=0A=
    L0 =3D fixangle(L0);=0A=
//document.debug.log.value +=3D "L0 =3D " + L0 + "\n";=0A=
    M =3D 357.52911 + (35999.05029 * T) + (-0.0001537 * T2);=0A=
//document.debug.log.value +=3D "M =3D " + M + "\n";=0A=
    M =3D fixangle(M);=0A=
//document.debug.log.value +=3D "M =3D " + M + "\n";=0A=
    e =3D 0.016708634 + (-0.000042037 * T) + (-0.0000001267 * T2);=0A=
//document.debug.log.value +=3D "e =3D " + e + "\n";=0A=
    C =3D ((1.914602 + (-0.004817 * T) + (-0.000014 * T2)) * dsin(M)) +=0A=
        ((0.019993 - (0.000101 * T)) * dsin(2 * M)) +=0A=
        (0.000289 * dsin(3 * M));=0A=
//document.debug.log.value +=3D "C =3D " + C + "\n";=0A=
    sunLong =3D L0 + C;=0A=
//document.debug.log.value +=3D "sunLong =3D " + sunLong + "\n";=0A=
    sunAnomaly =3D M + C;=0A=
//document.debug.log.value +=3D "sunAnomaly =3D " + sunAnomaly + "\n";=0A=
    sunR =3D (1.000001018 * (1 - (e * e))) / (1 + (e * =
dcos(sunAnomaly)));=0A=
//document.debug.log.value +=3D "sunR =3D " + sunR + "\n";=0A=
    Omega =3D 125.04 - (1934.136 * T);=0A=
//document.debug.log.value +=3D "Omega =3D " + Omega + "\n";=0A=
    Lambda =3D sunLong + (-0.00569) + (-0.00478 * dsin(Omega));=0A=
//document.debug.log.value +=3D "Lambda =3D " + Lambda + "\n";=0A=
    epsilon0 =3D obliqeq(jd);=0A=
//document.debug.log.value +=3D "epsilon0 =3D " + epsilon0 + "\n";=0A=
    epsilon =3D epsilon0 + (0.00256 * dcos(Omega));=0A=
//document.debug.log.value +=3D "epsilon =3D " + epsilon + "\n";=0A=
    Alpha =3D rtd(Math.atan2(dcos(epsilon0) * dsin(sunLong), =
dcos(sunLong)));=0A=
//document.debug.log.value +=3D "Alpha =3D " + Alpha + "\n";=0A=
    Alpha =3D fixangle(Alpha);=0A=
////document.debug.log.value +=3D "Alpha =3D " + Alpha + "\n";=0A=
    Delta =3D rtd(Math.asin(dsin(epsilon0) * dsin(sunLong)));=0A=
////document.debug.log.value +=3D "Delta =3D " + Delta + "\n";=0A=
    AlphaApp =3D rtd(Math.atan2(dcos(epsilon) * dsin(Lambda), =
dcos(Lambda)));=0A=
//document.debug.log.value +=3D "AlphaApp =3D " + AlphaApp + "\n";=0A=
    AlphaApp =3D fixangle(AlphaApp);=0A=
//document.debug.log.value +=3D "AlphaApp =3D " + AlphaApp + "\n";=0A=
    DeltaApp =3D rtd(Math.asin(dsin(epsilon) * dsin(Lambda)));=0A=
//document.debug.log.value +=3D "DeltaApp =3D " + DeltaApp + "\n";=0A=
=0A=
    return new Array(                 //  Angular quantities are =
expressed in decimal degrees=0A=
        L0,                           //  [0] Geometric mean longitude =
of the Sun=0A=
        M,                            //  [1] Mean anomaly of the Sun=0A=
        e,                            //  [2] Eccentricity of the =
Earth's orbit=0A=
        C,                            //  [3] Sun's equation of the =
Centre=0A=
        sunLong,                      //  [4] Sun's true longitude=0A=
        sunAnomaly,                   //  [5] Sun's true anomaly=0A=
        sunR,                         //  [6] Sun's radius vector in AU=0A=
        Lambda,                       //  [7] Sun's apparent longitude =
at true equinox of the date=0A=
        Alpha,                        //  [8] Sun's true right ascension=0A=
        Delta,                        //  [9] Sun's true declination=0A=
        AlphaApp,                     // [10] Sun's apparent right =
ascension=0A=
        DeltaApp                      // [11] Sun's apparent declination=0A=
    );=0A=
}=0A=
=0A=
/*  EQUATIONOFTIME  --  Compute equation of time for a given moment.=0A=
                        Returns the equation of time as a fraction of=0A=
                        a day.  */=0A=
=0A=
function equationOfTime(jd)=0A=
{=0A=
    var alpha, deltaPsi, E, epsilon, L0, tau=0A=
=0A=
    tau =3D (jd - J2000) / JulianMillennium;=0A=
//document.debug.log.value +=3D "equationOfTime.  tau =3D " + tau + "\n";=0A=
    L0 =3D 280.4664567 + (360007.6982779 * tau) +=0A=
         (0.03032028 * tau * tau) +=0A=
         ((tau * tau * tau) / 49931) +=0A=
         (-((tau * tau * tau * tau) / 15300)) +=0A=
         (-((tau * tau * tau * tau * tau) / 2000000));=0A=
//document.debug.log.value +=3D "L0 =3D " + L0 + "\n";=0A=
    L0 =3D fixangle(L0);=0A=
//document.debug.log.value +=3D "L0 =3D " + L0 + "\n";=0A=
    alpha =3D sunpos(jd)[10];=0A=
//document.debug.log.value +=3D "alpha =3D " + alpha + "\n";=0A=
    deltaPsi =3D nutation(jd)[0];=0A=
//document.debug.log.value +=3D "deltaPsi =3D " + deltaPsi + "\n";=0A=
    epsilon =3D obliqeq(jd) + nutation(jd)[1];=0A=
//document.debug.log.value +=3D "epsilon =3D " + epsilon + "\n";=0A=
    E =3D L0 + (-0.0057183) + (-alpha) + (deltaPsi * dcos(epsilon));=0A=
//document.debug.log.value +=3D "E =3D " + E + "\n";=0A=
    E =3D E - 20.0 * (Math.floor(E / 20.0));=0A=
//document.debug.log.value +=3D "Efixed =3D " + E + "\n";=0A=
    E =3D E / (24 * 60);=0A=
//document.debug.log.value +=3D "Eday =3D " + E + "\n";=0A=
=0A=
    return E;=0A=
}=0A=

------=_NextPart_000_0000_01C8C7DC.62626FD0
Content-Type: application/octet-stream
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.fourmilab.ch/documents/calendar/calendar.js

/*=0A=
       JavaScript functions for the Fourmilab Calendar Converter=0A=
=0A=
                  by John Walker  --  September, MIM=0A=
              http://www.fourmilab.ch/documents/calendar/=0A=
=0A=
                This program is in the public domain.=0A=
*/=0A=
=0A=
/*  You may notice that a variety of array variables logically local=0A=
    to functions are declared globally here.  In JavaScript, construction=0A=
    of an array variable from source code occurs as the code is=0A=
    interpreted.  Making these variables pseudo-globals permits us=0A=
    to avoid overhead constructing and disposing of them in each=0A=
    call on the function in which whey are used.  */=0A=
=0A=
var J0000 =3D 1721424.5;                // Julian date of Gregorian =
epoch: 0000-01-01=0A=
var J1970 =3D 2440587.5;                // Julian date at Unix epoch: =
1970-01-01=0A=
var JMJD  =3D 2400000.5;                // Epoch of Modified Julian Date =
system=0A=
var J1900 =3D 2415020.5;                // Epoch (day 1) of Excel 1900 =
date system (PC)=0A=
var J1904 =3D 2416480.5;                // Epoch (day 0) of Excel 1904 =
date system (Mac)=0A=
=0A=
var NormLeap =3D new Array("Normal year", "Leap year");=0A=
=0A=
/*  WEEKDAY_BEFORE  --  Return Julian date of given weekday (0 =3D =
Sunday)=0A=
                        in the seven days ending on jd.  */=0A=
=0A=
function weekday_before(weekday, jd)=0A=
{=0A=
    return jd - jwday(jd - weekday);=0A=
}=0A=
=0A=
/*  SEARCH_WEEKDAY  --  Determine the Julian date for: =0A=
=0A=
            weekday      Day of week desired, 0 =3D Sunday=0A=
            jd           Julian date to begin search=0A=
            direction    1 =3D next weekday, -1 =3D last weekday=0A=
            offset       Offset from jd to begin search=0A=
*/=0A=
=0A=
function search_weekday(weekday, jd, direction, offset)=0A=
{=0A=
    return weekday_before(weekday, jd + (direction * offset));=0A=
}=0A=
=0A=
//  Utility weekday functions, just wrappers for search_weekday=0A=
=0A=
function nearest_weekday(weekday, jd)=0A=
{=0A=
    return search_weekday(weekday, jd, 1, 3);=0A=
}=0A=
=0A=
function next_weekday(weekday, jd)=0A=
{=0A=
    return search_weekday(weekday, jd, 1, 7);=0A=
}=0A=
=0A=
function next_or_current_weekday(weekday, jd)=0A=
{=0A=
    return search_weekday(weekday, jd, 1, 6);=0A=
}=0A=
=0A=
function previous_weekday(weekday, jd)=0A=
{=0A=
    return search_weekday(weekday, jd, -1, 1);=0A=
}=0A=
=0A=
function previous_or_current_weekday(weekday, jd)=0A=
{=0A=
    return search_weekday(weekday, jd, 1, 0);=0A=
}=0A=
=0A=
function TestSomething()=0A=
{=0A=
}=0A=
=0A=
//  LEAP_GREGORIAN  --  Is a given year in the Gregorian calendar a leap =
year ?=0A=
=0A=
function leap_gregorian(year)=0A=
{=0A=
    return ((year % 4) =3D=3D 0) &&=0A=
            (!(((year % 100) =3D=3D 0) && ((year % 400) !=3D 0)));=0A=
}=0A=
=0A=
//  GREGORIAN_TO_JD  --  Determine Julian day number from Gregorian =
calendar date=0A=
=0A=
var GREGORIAN_EPOCH =3D 1721425.5;=0A=
=0A=
function gregorian_to_jd(year, month, day)=0A=
{=0A=
    return (GREGORIAN_EPOCH - 1) +=0A=
           (365 * (year - 1)) +=0A=
           Math.floor((year - 1) / 4) +=0A=
           (-Math.floor((year - 1) / 100)) +=0A=
           Math.floor((year - 1) / 400) +=0A=
           Math.floor((((367 * month) - 362) / 12) +=0A=
           ((month <=3D 2) ? 0 :=0A=
                               (leap_gregorian(year) ? -1 : -2)=0A=
           ) +=0A=
           day);=0A=
}=0A=
=0A=
//  JD_TO_GREGORIAN  --  Calculate Gregorian calendar date from Julian =
day=0A=
=0A=
function jd_to_gregorian(jd) {=0A=
    var wjd, depoch, quadricent, dqc, cent, dcent, quad, dquad,=0A=
        yindex, dyindex, year, yearday, leapadj;=0A=
=0A=
    wjd =3D Math.floor(jd - 0.5) + 0.5;=0A=
    depoch =3D wjd - GREGORIAN_EPOCH;=0A=
    quadricent =3D Math.floor(depoch / 146097);=0A=
    dqc =3D mod(depoch, 146097);=0A=
    cent =3D Math.floor(dqc / 36524);=0A=
    dcent =3D mod(dqc, 36524);=0A=
    quad =3D Math.floor(dcent / 1461);=0A=
    dquad =3D mod(dcent, 1461);=0A=
    yindex =3D Math.floor(dquad / 365);=0A=
    year =3D (quadricent * 400) + (cent * 100) + (quad * 4) + yindex;=0A=
    if (!((cent =3D=3D 4) || (yindex =3D=3D 4))) {=0A=
        year++;=0A=
    }=0A=
    yearday =3D wjd - gregorian_to_jd(year, 1, 1);=0A=
    leapadj =3D ((wjd < gregorian_to_jd(year, 3, 1)) ? 0=0A=
                                                  :=0A=
                  (leap_gregorian(year) ? 1 : 2)=0A=
              );=0A=
    month =3D Math.floor((((yearday + leapadj) * 12) + 373) / 367);=0A=
    day =3D (wjd - gregorian_to_jd(year, month, 1)) + 1;=0A=
=0A=
    return new Array(year, month, day);=0A=
}=0A=
=0A=
//  ISO_TO_JULIAN  --  Return Julian day of given ISO year, week, and day=0A=
=0A=
function n_weeks(weekday, jd, nthweek)=0A=
{=0A=
    var j =3D 7 * nthweek;=0A=
=0A=
    if (nthweek > 0) {=0A=
        j +=3D previous_weekday(weekday, jd);=0A=
    } else {=0A=
        j +=3D next_weekday(weekday, jd);=0A=
    }=0A=
    return j;=0A=
}=0A=
=0A=
function iso_to_julian(year, week, day)=0A=
{=0A=
    return day + n_weeks(0, gregorian_to_jd(year - 1, 12, 28), week);=0A=
}=0A=
=0A=
//  JD_TO_ISO  --  Return array of ISO (year, week, day) for Julian day=0A=
=0A=
function jd_to_iso(jd)=0A=
{=0A=
    var year, week, day;=0A=
=0A=
    year =3D jd_to_gregorian(jd - 3)[0];=0A=
    if (jd >=3D iso_to_julian(year + 1, 1, 1)) {=0A=
        year++;=0A=
    }=0A=
    week =3D Math.floor((jd - iso_to_julian(year, 1, 1)) / 7) + 1;=0A=
    day =3D jwday(jd);=0A=
    if (day =3D=3D 0) {=0A=
        day =3D 7;=0A=
    }=0A=
    return new Array(year, week, day);=0A=
}=0A=
=0A=
//  ISO_DAY_TO_JULIAN  --  Return Julian day of given ISO year, and day =
of year=0A=
=0A=
function iso_day_to_julian(year, day)=0A=
{=0A=
    return (day - 1) + gregorian_to_jd(year, 1, 1);=0A=
}=0A=
=0A=
//  JD_TO_ISO_DAY  --  Return array of ISO (year, day_of_year) for =
Julian day=0A=
=0A=
function jd_to_iso_day(jd)=0A=
{=0A=
    var year, day;=0A=
=0A=
    year =3D jd_to_gregorian(jd)[0];=0A=
    day =3D Math.floor(jd - gregorian_to_jd(year, 1, 1)) + 1;=0A=
    return new Array(year, day);=0A=
}=0A=
=0A=
/*  PAD  --  Pad a string to a given length with a given fill character. =
 */=0A=
=0A=
function pad(str, howlong, padwith) {=0A=
    var s =3D str.toString();=0A=
=0A=
    while (s.length < howlong) {=0A=
        s =3D padwith + s;=0A=
    }=0A=
    return s;=0A=
}=0A=
=0A=
//  JULIAN_TO_JD  --  Determine Julian day number from Julian calendar =
date=0A=
=0A=
var JULIAN_EPOCH =3D 1721423.5;=0A=
=0A=
function leap_julian(year)=0A=
{=0A=
    return mod(year, 4) =3D=3D ((year > 0) ? 0 : 3);=0A=
}=0A=
=0A=
function julian_to_jd(year, month, day)=0A=
{=0A=
=0A=
    /* Adjust negative common era years to the zero-based notation we =
use.  */=0A=
=0A=
    if (year < 1) {=0A=
        year++;=0A=
    }=0A=
=0A=
    /* Algorithm as given in Meeus, Astronomical Algorithms, Chapter 7, =
page 61 */=0A=
=0A=
    if (month <=3D 2) {=0A=
        year--;=0A=
        month +=3D 12;=0A=
    }=0A=
=0A=
    return ((Math.floor((365.25 * (year + 4716))) +=0A=
            Math.floor((30.6001 * (month + 1))) +=0A=
            day) - 1524.5);=0A=
}=0A=
=0A=
//  JD_TO_JULIAN  --  Calculate Julian calendar date from Julian day=0A=
=0A=
function jd_to_julian(td) {=0A=
    var z, a, alpha, b, c, d, e, year, month, day;=0A=
=0A=
    td +=3D 0.5;=0A=
    z =3D Math.floor(td);=0A=
=0A=
    a =3D z;=0A=
    b =3D a + 1524;=0A=
    c =3D Math.floor((b - 122.1) / 365.25);=0A=
    d =3D Math.floor(365.25 * c);=0A=
    e =3D Math.floor((b - d) / 30.6001);=0A=
=0A=
    month =3D Math.floor((e < 14) ? (e - 1) : (e - 13));=0A=
    year =3D Math.floor((month > 2) ? (c - 4716) : (c - 4715));=0A=
    day =3D b - d - Math.floor(30.6001 * e);=0A=
=0A=
    /*  If year is less than 1, subtract one to convert from=0A=
        a zero based date system to the common era system in=0A=
        which the year -1 (1 B.C.E) is followed by year 1 (1 C.E.).  */=0A=
=0A=
    if (year < 1) {=0A=
        year--;=0A=
    }=0A=
=0A=
    return new Array(year, month, day);=0A=
}=0A=
=0A=
//  HEBREW_TO_JD  --  Determine Julian day from Hebrew date=0A=
=0A=
var HEBREW_EPOCH =3D 347995.5;=0A=
=0A=
//  Is a given Hebrew year a leap year ?=0A=
=0A=
function hebrew_leap(year)=0A=
{=0A=
    return mod(((year * 7) + 1), 19) < 7;=0A=
}=0A=
=0A=
//  How many months are there in a Hebrew year (12 =3D normal, 13 =3D =
leap)=0A=
=0A=
function hebrew_year_months(year)=0A=
{=0A=
    return hebrew_leap(year) ? 13 : 12;=0A=
}=0A=
=0A=
//  Test for delay of start of new year and to avoid=0A=
//  Sunday, Wednesday, and Friday as start of the new year.=0A=
=0A=
function hebrew_delay_1(year)=0A=
{=0A=
    var months, days, parts;=0A=
=0A=
    months =3D Math.floor(((235 * year) - 234) / 19);=0A=
    parts =3D 12084 + (13753 * months);=0A=
    day =3D (months * 29) + Math.floor(parts / 25920);=0A=
=0A=
    if (mod((3 * (day + 1)), 7) < 3) {=0A=
        day++;=0A=
    }=0A=
    return day;=0A=
}=0A=
=0A=
//  Check for delay in start of new year due to length of adjacent years=0A=
=0A=
function hebrew_delay_2(year)=0A=
{=0A=
    var last, present, next;=0A=
=0A=
    last =3D hebrew_delay_1(year - 1);=0A=
    present =3D hebrew_delay_1(year);=0A=
    next =3D hebrew_delay_1(year + 1);=0A=
=0A=
    return ((next - present) =3D=3D 356) ? 2 :=0A=
                                     (((present - last) =3D=3D 382) ? 1 =
: 0);=0A=
}=0A=
=0A=
//  How many days are in a Hebrew year ?=0A=
=0A=
function hebrew_year_days(year)=0A=
{=0A=
    return hebrew_to_jd(year + 1, 7, 1) - hebrew_to_jd(year, 7, 1);=0A=
}=0A=
=0A=
//  How many days are in a given month of a given year=0A=
=0A=
function hebrew_month_days(year, month)=0A=
{=0A=
    //  First of all, dispose of fixed-length 29 day months=0A=
=0A=
    if (month =3D=3D 2 || month =3D=3D 4 || month =3D=3D 6 ||=0A=
        month =3D=3D 10 || month =3D=3D 13) {=0A=
        return 29;=0A=
    }=0A=
=0A=
    //  If it's not a leap year, Adar has 29 days=0A=
=0A=
    if (month =3D=3D 12 && !hebrew_leap(year)) {=0A=
        return 29;=0A=
    }=0A=
=0A=
    //  If it's Heshvan, days depend on length of year=0A=
=0A=
    if (month =3D=3D 8 && !(mod(hebrew_year_days(year), 10) =3D=3D 5)) {=0A=
        return 29;=0A=
    }=0A=
=0A=
    //  Similarly, Kislev varies with the length of year=0A=
=0A=
    if (month =3D=3D 9 && (mod(hebrew_year_days(year), 10) =3D=3D 3)) {=0A=
        return 29;=0A=
    }=0A=
=0A=
    //  Nope, it's a 30 day month=0A=
=0A=
    return 30;=0A=
}=0A=
=0A=
//  Finally, wrap it all up into...=0A=
=0A=
function hebrew_to_jd(year, month, day)=0A=
{=0A=
    var jd, mon, months;=0A=
=0A=
    months =3D hebrew_year_months(year);=0A=
    jd =3D HEBREW_EPOCH + hebrew_delay_1(year) +=0A=
         hebrew_delay_2(year) + day + 1;=0A=
=0A=
    if (month < 7) {=0A=
        for (mon =3D 7; mon <=3D months; mon++) {=0A=
            jd +=3D hebrew_month_days(year, mon);=0A=
        }=0A=
        for (mon =3D 1; mon < month; mon++) {=0A=
            jd +=3D hebrew_month_days(year, mon);=0A=
        }=0A=
    } else {=0A=
        for (mon =3D 7; mon < month; mon++) {=0A=
            jd +=3D hebrew_month_days(year, mon);=0A=
        }=0A=
    }=0A=
=0A=
    return jd;=0A=
}=0A=
=0A=
/*  JD_TO_HEBREW  --  Convert Julian date to Hebrew date=0A=
                      This works by making multiple calls to=0A=
                      the inverse function, and is this very=0A=
                      slow.  */=0A=
=0A=
function jd_to_hebrew(jd)=0A=
{=0A=
    var year, month, day, i, count, first;=0A=
=0A=
    jd =3D Math.floor(jd) + 0.5;=0A=
    count =3D Math.floor(((jd - HEBREW_EPOCH) * 98496.0) / 35975351.0);=0A=
    year =3D count - 1;=0A=
    for (i =3D count; jd >=3D hebrew_to_jd(i, 7, 1); i++) {=0A=
        year++;=0A=
    }=0A=
    first =3D (jd < hebrew_to_jd(year, 1, 1)) ? 7 : 1;=0A=
    month =3D first;=0A=
    for (i =3D first; jd > hebrew_to_jd(year, i, hebrew_month_days(year, =
i)); i++) {=0A=
        month++;=0A=
    }=0A=
    day =3D (jd - hebrew_to_jd(year, month, 1)) + 1;=0A=
    return new Array(year, month, day);=0A=
}=0A=
=0A=
/*  EQUINOXE_A_PARIS  --  Determine Julian day and fraction of the=0A=
                          September equinox at the Paris meridian in=0A=
                          a given Gregorian year.  */=0A=
=0A=
function equinoxe_a_paris(year)=0A=
{=0A=
    var equJED, equJD, equAPP, equParis, dtParis;=0A=
=0A=
    //  September equinox in dynamical time=0A=
    equJED =3D equinox(year, 2);=0A=
=0A=
    //  Correct for delta T to obtain Universal time=0A=
    equJD =3D equJED - (deltat(year) / (24 * 60 * 60));=0A=
=0A=
    //  Apply the equation of time to yield the apparent time at =
Greenwich=0A=
    equAPP =3D equJD + equationOfTime(equJED);=0A=
=0A=
    /*  Finally, we must correct for the constant difference between=0A=
        the Greenwich meridian and that of Paris, 2=B020'15" to the=0A=
        East.  */=0A=
=0A=
    dtParis =3D (2 + (20 / 60.0) + (15 / (60 * 60.0))) / 360;=0A=
    equParis =3D equAPP + dtParis;=0A=
=0A=
    return equParis;=0A=
}=0A=
=0A=
/*  PARIS_EQUINOXE_JD  --  Calculate Julian day during which the=0A=
                           September equinox, reckoned from the Paris=0A=
                           meridian, occurred for a given Gregorian=0A=
                           year.  */=0A=
=0A=
function paris_equinoxe_jd(year)=0A=
{=0A=
    var ep, epg;=0A=
=0A=
    ep =3D equinoxe_a_paris(year);=0A=
    epg =3D Math.floor(ep - 0.5) + 0.5;=0A=
=0A=
    return epg;=0A=
}=0A=
=0A=
/*  ANNEE_DE_LA_REVOLUTION  --  Determine the year in the French=0A=
                                revolutionary calendar in which a=0A=
                                given Julian day falls.  Returns an=0A=
                                array of two elements:=0A=
=0A=
                                    [0]  Ann=E9e de la R=E9volution=0A=
                                    [1]  Julian day number containing=0A=
                                         equinox for this year.=0A=
*/=0A=
=0A=
var FRENCH_REVOLUTIONARY_EPOCH =3D 2375839.5;=0A=
=0A=
function annee_da_la_revolution(jd)=0A=
{=0A=
    var guess =3D jd_to_gregorian(jd)[0] - 2,=0A=
        lasteq, nexteq, adr;=0A=
=0A=
    lasteq =3D paris_equinoxe_jd(guess);=0A=
    while (lasteq > jd) {=0A=
        guess--;=0A=
        lasteq =3D paris_equinoxe_jd(guess);=0A=
    }=0A=
    nexteq =3D lasteq - 1;=0A=
    while (!((lasteq <=3D jd) && (jd < nexteq))) {=0A=
        lasteq =3D nexteq;=0A=
        guess++;=0A=
        nexteq =3D paris_equinoxe_jd(guess);=0A=
    }=0A=
    adr =3D Math.round((lasteq - FRENCH_REVOLUTIONARY_EPOCH) / =
TropicalYear) + 1;=0A=
=0A=
    return new Array(adr, lasteq);=0A=
}=0A=
=0A=
/*  JD_TO_FRENCH_REVOLUTIONARY  --  Calculate date in the French =
Revolutionary=0A=
                                    calendar from Julian day.  The five =
or six=0A=
                                    "sansculottides" are considered a =
thirteenth=0A=
                                    month in the results of this =
function.  */=0A=
=0A=
function jd_to_french_revolutionary(jd)=0A=
{=0A=
    var an, mois, decade, jour,=0A=
        adr, equinoxe;=0A=
=0A=
    jd =3D Math.floor(jd) + 0.5;=0A=
    adr =3D annee_da_la_revolution(jd);=0A=
    an =3D adr[0];=0A=
    equinoxe =3D adr[1];=0A=
    mois =3D Math.floor((jd - equinoxe) / 30) + 1;=0A=
    jour =3D (jd - equinoxe) % 30;=0A=
    decade =3D Math.floor(jour / 10) + 1;=0A=
    jour =3D (jour % 10) + 1;=0A=
=0A=
    return new Array(an, mois, decade, jour);=0A=
}=0A=
=0A=
/*  FRENCH_REVOLUTIONARY_TO_JD  --  Obtain Julian day from a given French=0A=
                                    Revolutionary calendar date.  */=0A=
=0A=
function french_revolutionary_to_jd(an, mois, decade, jour)=0A=
{=0A=
    var adr, equinoxe, guess, jd;=0A=
=0A=
    guess =3D FRENCH_REVOLUTIONARY_EPOCH + (TropicalYear * ((an - 1) - =
1));=0A=
    adr =3D new Array(an - 1, 0);=0A=
=0A=
    while (adr[0] < an) {=0A=
        adr =3D annee_da_la_revolution(guess);=0A=
        guess =3D adr[1] + (TropicalYear + 2);=0A=
    }=0A=
    equinoxe =3D adr[1];=0A=
=0A=
    jd =3D equinoxe + (30 * (mois - 1)) + (10 * (decade - 1)) + (jour - =
1);=0A=
    return jd;=0A=
}=0A=
=0A=
//  LEAP_ISLAMIC  --  Is a given year a leap year in the Islamic =
calendar ?=0A=
=0A=
function leap_islamic(year)=0A=
{=0A=
    return (((year * 11) + 14) % 30) < 11;=0A=
}=0A=
=0A=
//  ISLAMIC_TO_JD  --  Determine Julian day from Islamic date=0A=
=0A=
var ISLAMIC_EPOCH =3D 1948439.5;=0A=
var ISLAMIC_WEEKDAYS =3D new Array("al-'ahad", "al-'ithnayn",=0A=
                                 "ath-thalatha'", "al-'arb`a'",=0A=
                                 "al-khamis", "al-jum`a", "as-sabt");=0A=
=0A=
function islamic_to_jd(year, month, day)=0A=
{=0A=
    return (day +=0A=
            Math.ceil(29.5 * (month - 1)) +=0A=
            (year - 1) * 354 +=0A=
            Math.floor((3 + (11 * year)) / 30) +=0A=
            ISLAMIC_EPOCH) - 1;=0A=
}=0A=
=0A=
//  JD_TO_ISLAMIC  --  Calculate Islamic date from Julian day=0A=
=0A=
function jd_to_islamic(jd)=0A=
{=0A=
    var year, month, day;=0A=
=0A=
    jd =3D Math.floor(jd) + 0.5;=0A=
    year =3D Math.floor(((30 * (jd - ISLAMIC_EPOCH)) + 10646) / 10631);=0A=
    month =3D Math.min(12,=0A=
                Math.ceil((jd - (29 + islamic_to_jd(year, 1, 1))) / =
29.5) + 1);=0A=
    day =3D (jd - islamic_to_jd(year, month, 1)) + 1;=0A=
    return new Array(year, month, day);=0A=
}=0A=
=0A=
//  LEAP_PERSIAN  --  Is a given year a leap year in the Persian =
calendar ?=0A=
=0A=
function leap_persian(year)=0A=
{=0A=
    return ((((((year - ((year > 0) ? 474 : 473)) % 2820) + 474) + 38) * =
682) % 2816) < 682;=0A=
}=0A=
=0A=
//  PERSIAN_TO_JD  --  Determine Julian day from Persian date=0A=
=0A=
var PERSIAN_EPOCH =3D 1948320.5;=0A=
var PERSIAN_WEEKDAYS =3D new Array("Yekshanbeh", "Doshanbeh",=0A=
                                 "Seshhanbeh", "Chaharshanbeh",=0A=
                                 "Panjshanbeh", "Jomeh", "Shanbeh");=0A=
=0A=
function persian_to_jd(year, month, day)=0A=
{=0A=
    var epbase, epyear;=0A=
=0A=
    epbase =3D year - ((year >=3D 0) ? 474 : 473);=0A=
    epyear =3D 474 + mod(epbase, 2820);=0A=
=0A=
    return day +=0A=
            ((month <=3D 7) ?=0A=
                ((month - 1) * 31) :=0A=
                (((month - 1) * 30) + 6)=0A=
            ) +=0A=
            Math.floor(((epyear * 682) - 110) / 2816) +=0A=
            (epyear - 1) * 365 +=0A=
            Math.floor(epbase / 2820) * 1029983 +=0A=
            (PERSIAN_EPOCH - 1);=0A=
}=0A=
=0A=
//  JD_TO_PERSIAN  --  Calculate Persian date from Julian day=0A=
=0A=
function jd_to_persian(jd)=0A=
{=0A=
    var year, month, day, depoch, cycle, cyear, ycycle,=0A=
        aux1, aux2, yday;=0A=
=0A=
=0A=
    jd =3D Math.floor(jd) + 0.5;=0A=
=0A=
    depoch =3D jd - persian_to_jd(475, 1, 1);=0A=
    cycle =3D Math.floor(depoch / 1029983);=0A=
    cyear =3D mod(depoch, 1029983);=0A=
    if (cyear =3D=3D 1029982) {=0A=
        ycycle =3D 2820;=0A=
    } else {=0A=
        aux1 =3D Math.floor(cyear / 366);=0A=
        aux2 =3D mod(cyear, 366);=0A=
        ycycle =3D Math.floor(((2134 * aux1) + (2816 * aux2) + 2815) / =
1028522) +=0A=
                    aux1 + 1;=0A=
    }=0A=
    year =3D ycycle + (2820 * cycle) + 474;=0A=
    if (year <=3D 0) {=0A=
        year--;=0A=
    }=0A=
    yday =3D (jd - persian_to_jd(year, 1, 1)) + 1;=0A=
    month =3D (yday <=3D 186) ? Math.ceil(yday / 31) : Math.ceil((yday - =
6) / 30);=0A=
    day =3D (jd - persian_to_jd(year, month, 1)) + 1;=0A=
    return new Array(year, month, day);=0A=
}=0A=
=0A=
//  MAYAN_COUNT_TO_JD  --  Determine Julian day from Mayan long count=0A=
=0A=
var MAYAN_COUNT_EPOCH =3D 584282.5;=0A=
=0A=
function mayan_count_to_jd(baktun, katun, tun, uinal, kin)=0A=
{=0A=
    return MAYAN_COUNT_EPOCH +=0A=
           (baktun * 144000) +=0A=
           (katun  *   7200) +=0A=
           (tun    *    360) +=0A=
           (uinal  *     20) +=0A=
           kin;=0A=
}=0A=
=0A=
//  JD_TO_MAYAN_COUNT  --  Calculate Mayan long count from Julian day=0A=
=0A=
function jd_to_mayan_count(jd)=0A=
{=0A=
    var d, baktun, katun, tun, uinal, kin;=0A=
=0A=
    jd =3D Math.floor(jd) + 0.5;=0A=
    d =3D jd - MAYAN_COUNT_EPOCH;=0A=
    baktun =3D Math.floor(d / 144000);=0A=
    d =3D mod(d, 144000);=0A=
    katun =3D Math.floor(d / 7200);=0A=
    d =3D mod(d, 7200);=0A=
    tun =3D Math.floor(d / 360);=0A=
    d =3D mod(d, 360);=0A=
    uinal =3D Math.floor(d / 20);=0A=
    kin =3D mod(d, 20);=0A=
=0A=
    return new Array(baktun, katun, tun, uinal, kin);=0A=
}=0A=
=0A=
//  JD_TO_MAYAN_HAAB  --  Determine Mayan Haab "month" and day from =
Julian day=0A=
=0A=
var MAYAN_HAAB_MONTHS =3D new Array("Pop", "Uo", "Zip", "Zotz", "Tzec", =
"Xul",=0A=
                                  "Yaxkin", "Mol", "Chen", "Yax", "Zac", =
"Ceh",=0A=
                                  "Mac", "Kankin", "Muan", "Pax", =
"Kayab", "Cumku", "Uayeb");=0A=
=0A=
function jd_to_mayan_haab(jd)=0A=
{=0A=
    var lcount, day;=0A=
=0A=
    jd =3D Math.floor(jd) + 0.5;=0A=
    lcount =3D jd - MAYAN_COUNT_EPOCH;=0A=
    day =3D mod(lcount + 8 + ((18 - 1) * 20), 365);=0A=
=0A=
    return new Array (Math.floor(day / 20) + 1, mod(day, 20));=0A=
}=0A=
=0A=
//  JD_TO_MAYAN_TZOLKIN  --  Determine Mayan Tzolkin "month" and day =
from Julian day=0A=
=0A=
var MAYAN_TZOLKIN_MONTHS =3D new Array("Imix", "Ik", "Akbal", "Kan", =
"Chicchan",=0A=
                                     "Cimi", "Manik", "Lamat", "Muluc", =
"Oc",=0A=
                                     "Chuen", "Eb", "Ben", "Ix", "Men",=0A=
                                     "Cib", "Caban", "Etznab", "Cauac", =
"Ahau");=0A=
=0A=
function jd_to_mayan_tzolkin(jd)=0A=
{=0A=
    var lcount;=0A=
=0A=
    jd =3D Math.floor(jd) + 0.5;=0A=
    lcount =3D jd - MAYAN_COUNT_EPOCH;=0A=
    return new Array (amod(lcount + 20, 20), amod(lcount + 4, 13));=0A=
}=0A=
=0A=
//  BAHAI_TO_JD  --  Determine Julian day from Bahai date=0A=
=0A=
var BAHAI_EPOCH =3D 2394646.5;=0A=
var BAHAI_WEEKDAYS =3D new Array("Jam=E1l", "Kam=E1l", "Fid=E1l", =
"Id=E1l",=0A=
                               "Istijl=E1l", "Istiql=E1l", "Jal=E1l");=0A=
=0A=
function bahai_to_jd(major, cycle, year, month, day)=0A=
{=0A=
    var gy;=0A=
=0A=
    gy =3D (361 * (major - 1)) + (19 * (cycle - 1)) + (year - 1) +=0A=
         jd_to_gregorian(BAHAI_EPOCH)[0];=0A=
    return gregorian_to_jd(gy, 3, 20) + (19 * (month - 1)) +=0A=
           ((month !=3D 20) ? 0 : (leap_gregorian(gy + 1) ? -14 : -15))  =
+=0A=
           day;=0A=
}=0A=
=0A=
//  JD_TO_BAHAI  --  Calculate Bahai date from Julian day=0A=
=0A=
function jd_to_bahai(jd)=0A=
{=0A=
    var major, cycle, year, month, day,=0A=
        gy, bstarty, bys, days, bld;=0A=
=0A=
    jd =3D Math.floor(jd) + 0.5;=0A=
    gy =3D jd_to_gregorian(jd)[0];=0A=
    bstarty =3D jd_to_gregorian(BAHAI_EPOCH)[0];=0A=
    bys =3D gy - (bstarty + (((gregorian_to_jd(gy, 1, 1) <=3D jd) && (jd =
<=3D gregorian_to_jd(gy, 3, 20))) ? 1 : 0));=0A=
    major =3D Math.floor(bys / 361) + 1;=0A=
    cycle =3D Math.floor(mod(bys, 361) / 19) + 1;=0A=
    year =3D mod(bys, 19) + 1;=0A=
    days =3D jd - bahai_to_jd(major, cycle, year, 1, 1);=0A=
    bld =3D bahai_to_jd(major, cycle, year, 20, 1);=0A=
    month =3D (jd >=3D bld) ? 20 : (Math.floor(days / 19) + 1);=0A=
    day =3D (jd + 1) - bahai_to_jd(major, cycle, year, month, 1);=0A=
=0A=
    return new Array(major, cycle, year, month, day);=0A=
}=0A=
=0A=
//  INDIAN_CIVIL_TO_JD  --  Obtain Julian day for Indian Civil date=0A=
=0A=
var INDIAN_CIVIL_WEEKDAYS =3D new Array(=0A=
    "ravivara", "somavara", "mangalavara", "budhavara",=0A=
    "brahaspativara", "sukravara", "sanivara");=0A=
=0A=
function indian_civil_to_jd(year, month, day)=0A=
{=0A=
    var Caitra, gyear, leap, start, jd, m;=0A=
=0A=
    gyear =3D year + 78;=0A=
    leap =3D leap_gregorian(gyear);     // Is this a leap year ?=0A=
    start =3D gregorian_to_jd(gyear, 3, leap ? 21 : 22);=0A=
    Caitra =3D leap ? 31 : 30;=0A=
=0A=
    if (month =3D=3D 1) {=0A=
        jd =3D start + (day - 1);=0A=
    } else {=0A=
        jd =3D start + Caitra;=0A=
        m =3D month - 2;=0A=
        m =3D Math.min(m, 5);=0A=
        jd +=3D m * 31;=0A=
        if (month >=3D 8) {=0A=
            m =3D month - 7;=0A=
            jd +=3D m * 30;=0A=
        }=0A=
        jd +=3D day - 1;=0A=
    }=0A=
=0A=
    return jd;=0A=
}=0A=
=0A=
//  JD_TO_INDIAN_CIVIL  --  Calculate Indian Civil date from Julian day=0A=
=0A=
function jd_to_indian_civil(jd)=0A=
{=0A=
    var Caitra, Saka, greg, greg0, leap, start, year, yday, mday;=0A=
=0A=
    Saka =3D 79 - 1;                    // Offset in years from Saka era =
to Gregorian epoch=0A=
    start =3D 80;                       // Day offset between Saka and =
Gregorian=0A=
=0A=
    jd =3D Math.floor(jd) + 0.5;=0A=
    greg =3D jd_to_gregorian(jd);       // Gregorian date for Julian day=0A=
    leap =3D leap_gregorian(greg[0]);   // Is this a leap year?=0A=
    year =3D greg[0] - Saka;            // Tentative year in Saka era=0A=
    greg0 =3D gregorian_to_jd(greg[0], 1, 1); // JD at start of =
Gregorian year=0A=
    yday =3D jd - greg0;                // Day number (0 based) in =
Gregorian year=0A=
    Caitra =3D leap ? 31 : 30;          // Days in Caitra this year=0A=
=0A=
    if (yday < start) {=0A=
        //  Day is at the end of the preceding Saka year=0A=
        year--;=0A=
        yday +=3D Caitra + (31 * 5) + (30 * 3) + 10 + start;=0A=
    }=0A=
=0A=
    yday -=3D start;=0A=
    if (yday < Caitra) {=0A=
        month =3D 1;=0A=
        day =3D yday + 1;=0A=
    } else {=0A=
        mday =3D yday - Caitra;=0A=
        if (mday < (31 * 5)) {=0A=
            month =3D Math.floor(mday / 31) + 2;=0A=
            day =3D (mday % 31) + 1;=0A=
        } else {=0A=
            mday -=3D 31 * 5;=0A=
            month =3D Math.floor(mday / 30) + 7;=0A=
            day =3D (mday % 30) + 1;=0A=
        }=0A=
    }=0A=
=0A=
    return new Array(year, month, day);=0A=
}=0A=
=0A=
/*  updateFromGregorian  --  Update all calendars from Gregorian.=0A=
                             "Why not Julian date?" you ask.  Because=0A=
                             starting from Gregorian guarantees we're=0A=
                             already snapped to an integral second, so=0A=
                             we don't get roundoff errors in other=0A=
                             calendars.  */=0A=
=0A=
function updateFromGregorian()=0A=
{=0A=
    var j, year, mon, mday, hour, min, sec,=0A=
        weekday, julcal, hebcal, islcal, hmindex, utime, isoweek,=0A=
        may_countcal, mayhaabcal, maytzolkincal, bahcal, frrcal,=0A=
        indcal, isoday, xgregcal;=0A=
=0A=
    year =3D new Number(document.gregorian.year.value);=0A=
    mon =3D document.gregorian.month.selectedIndex;=0A=
    mday =3D new Number(document.gregorian.day.value);=0A=
    hour =3D min =3D sec =3D 0;=0A=
    hour =3D new Number(document.gregorian.hour.value);=0A=
    min =3D new Number(document.gregorian.min.value);=0A=
    sec =3D new Number(document.gregorian.sec.value);=0A=
=0A=
    //  Update Julian day=0A=
=0A=
    j =3D gregorian_to_jd(year, mon + 1, mday) +=0A=
           (Math.floor(sec + 60 * (min + 60 * hour) + 0.5) / 86400.0);=0A=
=0A=
    document.julianday.day.value =3D j;=0A=
    document.modifiedjulianday.day.value =3D j - JMJD;=0A=
=0A=
    //  Update day of week in Gregorian box=0A=
=0A=
    weekday =3D jwday(j);=0A=
    document.gregorian.wday.value =3D Weekdays[weekday];=0A=
=0A=
    //  Update leap year status in Gregorian box=0A=
=0A=
    document.gregorian.leap.value =3D NormLeap[leap_gregorian(year) ? 1 =
: 0];=0A=
=0A=
    //  Update Julian Calendar=0A=
=0A=
    julcal =3D jd_to_julian(j);=0A=
    document.juliancalendar.year.value =3D julcal[0];=0A=
    document.juliancalendar.month.selectedIndex =3D julcal[1] - 1;=0A=
    document.juliancalendar.day.value =3D julcal[2];=0A=
    document.juliancalendar.leap.value =3D =
NormLeap[leap_julian(julcal[0]) ? 1 : 0];=0A=
    weekday =3D jwday(j);=0A=
    document.juliancalendar.wday.value =3D Weekdays[weekday];=0A=
=0A=
    //  Update Hebrew Calendar=0A=
=0A=
    hebcal =3D jd_to_hebrew(j);=0A=
    if (hebrew_leap(hebcal[0])) {=0A=
        document.hebrew.month.options.length =3D 13;=0A=
        document.hebrew.month.options[11] =3D new Option("Adar I");=0A=
        document.hebrew.month.options[12] =3D new Option("Veadar");=0A=
    } else {=0A=
        document.hebrew.month.options.length =3D 12;=0A=
        document.hebrew.month.options[11] =3D new Option("Adar");=0A=
    }=0A=
    document.hebrew.year.value =3D hebcal[0];=0A=
    document.hebrew.month.selectedIndex =3D hebcal[1] - 1;=0A=
    document.hebrew.day.value =3D hebcal[2];=0A=
    hmindex =3D hebcal[1];=0A=
    if (hmindex =3D=3D 12 && !hebrew_leap(hebcal[0])) {=0A=
        hmindex =3D 14;=0A=
    }=0A=
    document.hebrew.hebmonth.src =3D "figures/hebrew_month_" +=0A=
        hmindex + ".gif";=0A=
    switch (hebrew_year_days(hebcal[0])) {=0A=
        case 353:=0A=
            document.hebrew.leap.value =3D "Common deficient (353 days)";=0A=
            break;=0A=
=0A=
        case 354:=0A=
            document.hebrew.leap.value =3D "Common regular (354 days)";=0A=
            break;=0A=
=0A=
        case 355:=0A=
            document.hebrew.leap.value =3D "Common complete (355 days)";=0A=
            break;=0A=
=0A=
        case 383:=0A=
            document.hebrew.leap.value =3D "Embolismic deficient (383 =
days)";=0A=
            break;=0A=
=0A=
        case 384:=0A=
            document.hebrew.leap.value =3D "Embolismic regular (384 =
days)";=0A=
            break;=0A=
=0A=
        case 385:=0A=
            document.hebrew.leap.value =3D "Embolismic complete (385 =
days)";=0A=
            break;=0A=
=0A=
        default:=0A=
            document.hebrew.leap.value =3D "Invalid year length: " +=0A=
                hebrew_year_days(hebcal[0]) + " days.";=0A=
            break;=0A=
    }=0A=
=0A=
    //  Update Islamic Calendar=0A=
=0A=
    islcal =3D jd_to_islamic(j);=0A=
    document.islamic.year.value =3D islcal[0];=0A=
    document.islamic.month.selectedIndex =3D islcal[1] - 1;=0A=
    document.islamic.day.value =3D islcal[2];=0A=
    document.islamic.wday.value =3D "yawm " + ISLAMIC_WEEKDAYS[weekday];=0A=
    document.islamic.leap.value =3D NormLeap[leap_islamic(islcal[0]) ? 1 =
: 0];=0A=
=0A=
    //  Update Persian Calendar=0A=
=0A=
    perscal =3D jd_to_persian(j);=0A=
    document.persian.year.value =3D perscal[0];=0A=
    document.persian.month.selectedIndex =3D perscal[1] - 1;=0A=
    document.persian.day.value =3D perscal[2];=0A=
    document.persian.wday.value =3D PERSIAN_WEEKDAYS[weekday];=0A=
    document.persian.leap.value =3D NormLeap[leap_persian(perscal[0]) ? =
1 : 0];=0A=
=0A=
    //  Update Mayan Calendars=0A=
=0A=
    may_countcal =3D jd_to_mayan_count(j);=0A=
    document.mayancount.baktun.value =3D may_countcal[0];=0A=
    document.mayancount.katun.value =3D may_countcal[1];=0A=
    document.mayancount.tun.value =3D may_countcal[2];=0A=
    document.mayancount.uinal.value =3D may_countcal[3];=0A=
    document.mayancount.kin.value =3D may_countcal[4];=0A=
    mayhaabcal =3D jd_to_mayan_haab(j);=0A=
    document.mayancount.haab.value =3D "" + mayhaabcal[1] + " " + =
MAYAN_HAAB_MONTHS[mayhaabcal[0] - 1];=0A=
    maytzolkincal =3D jd_to_mayan_tzolkin(j);=0A=
    document.mayancount.tzolkin.value =3D "" + maytzolkincal[1] + " " + =
MAYAN_TZOLKIN_MONTHS[maytzolkincal[0] - 1];=0A=
=0A=
    //  Update Bahai Calendar=0A=
=0A=
    bahcal =3D jd_to_bahai(j);=0A=
    document.bahai.kull_i_shay.value =3D bahcal[0];=0A=
    document.bahai.vahid.value =3D bahcal[1];=0A=
    document.bahai.year.selectedIndex =3D bahcal[2] - 1;=0A=
    document.bahai.month.selectedIndex =3D bahcal[3] - 1;=0A=
    document.bahai.day.selectedIndex =3D bahcal[4] - 1;=0A=
    document.bahai.weekday.value =3D BAHAI_WEEKDAYS[weekday];=0A=
    document.bahai.leap.value =3D NormLeap[leap_gregorian(year) ? 1 : =
0];  // Bahai uses same leap rule as Gregorian=0A=
=0A=
    //  Update Indian Civil Calendar=0A=
=0A=
    indcal =3D jd_to_indian_civil(j);=0A=
    document.indiancivilcalendar.year.value =3D indcal[0];=0A=
    document.indiancivilcalendar.month.selectedIndex =3D indcal[1] - 1;=0A=
    document.indiancivilcalendar.day.value =3D indcal[2];=0A=
    document.indiancivilcalendar.weekday.value =3D =
INDIAN_CIVIL_WEEKDAYS[weekday];=0A=
    document.indiancivilcalendar.leap.value =3D =
NormLeap[leap_gregorian(indcal[0] + 78) ? 1 : 0];=0A=
=0A=
    //  Update French Republican Calendar=0A=
=0A=
    frrcal =3D jd_to_french_revolutionary(j);=0A=
    document.french.an.value =3D frrcal[0];=0A=
    document.french.mois.selectedIndex =3D frrcal[1] - 1;=0A=
    document.french.decade.selectedIndex =3D frrcal[2] - 1;=0A=
    document.french.jour.selectedIndex =3D ((frrcal[1] <=3D 12) ? =
frrcal[3] : (frrcal[3] + 11)) - 1;=0A=
=0A=
    //  Update Gregorian serial number=0A=
=0A=
    if (document.gregserial !=3D null) {=0A=
        document.gregserial.day.value =3D j - J0000;=0A=
    }=0A=
=0A=
    //  Update Excel 1900 and 1904 day serial numbers=0A=
=0A=
    document.excelserial1900.day.value =3D (j - J1900) + 1 +=0A=
            /*  Microsoft marching morons thought 1900 was a leap year.=0A=
                Adjust dates after 1900-02-28 to compensate for their=0A=
                idiocy.  */=0A=
            ((j > 2415078.5) ? 1 : 0)=0A=
        ;=0A=
    document.excelserial1904.day.value =3D j - J1904;=0A=
=0A=
    //  Update Unix time()=0A=
=0A=
    utime =3D (j - J1970) * (60 * 60 * 24 * 1000);=0A=
    document.unixtime.time.value =3D Math.round(utime / 1000);=0A=
=0A=
    //  Update ISO Week=0A=
=0A=
    isoweek =3D jd_to_iso(j);=0A=
    document.isoweek.year.value =3D isoweek[0];=0A=
    document.isoweek.week.value =3D isoweek[1];=0A=
    document.isoweek.day.value =3D isoweek[2];=0A=
=0A=
    //  Update ISO Day=0A=
=0A=
    isoday =3D jd_to_iso_day(j);=0A=
    document.isoday.year.value =3D isoday[0];=0A=
    document.isoday.day.value =3D isoday[1];=0A=
}=0A=
=0A=
//  calcGregorian  --  Perform calculation starting with a Gregorian date=0A=
=0A=
function calcGregorian()=0A=
{=0A=
    updateFromGregorian();=0A=
}=0A=
=0A=
//  calcJulian  --  Perform calculation starting with a Julian date=0A=
=0A=
function calcJulian()=0A=
{=0A=
    var j, date, time;=0A=
=0A=
    j =3D new Number(document.julianday.day.value);=0A=
    date =3D jd_to_gregorian(j);=0A=
    time =3D jhms(j);=0A=
    document.gregorian.year.value =3D date[0];=0A=
    document.gregorian.month.selectedIndex =3D date[1] - 1;=0A=
    document.gregorian.day.value =3D date[2];=0A=
    document.gregorian.hour.value =3D pad(time[0], 2, " ");=0A=
    document.gregorian.min.value =3D pad(time[1], 2, "0");=0A=
    document.gregorian.sec.value =3D pad(time[2], 2, "0");=0A=
    updateFromGregorian();=0A=
}=0A=
=0A=
//  setJulian  --  Set Julian date and update all calendars=0A=
=0A=
function setJulian(j)=0A=
{=0A=
    document.julianday.day.value =3D new Number(j);=0A=
    calcJulian();=0A=
}=0A=
=0A=
//  calcModifiedJulian  --  Update from Modified Julian day=0A=
=0A=
function calcModifiedJulian()=0A=
{=0A=
    setJulian((new Number(document.modifiedjulianday.day.value)) + JMJD);=0A=
}=0A=
=0A=
//  calcJulianCalendar  --  Update from Julian calendar=0A=
=0A=
function calcJulianCalendar()=0A=
{=0A=
    setJulian(julian_to_jd((new =
Number(document.juliancalendar.year.value)),=0A=
                           document.juliancalendar.month.selectedIndex + =
1,=0A=
                           (new =
Number(document.juliancalendar.day.value))));=0A=
}=0A=
=0A=
//  calcHebrew  --  Update from Hebrew calendar=0A=
=0A=
function calcHebrew()=0A=
{=0A=
    setJulian(hebrew_to_jd((new Number(document.hebrew.year.value)),=0A=
                          document.hebrew.month.selectedIndex + 1,=0A=
                          (new Number(document.hebrew.day.value))));=0A=
}=0A=
=0A=
//  calcIslamic  --  Update from Islamic calendar=0A=
=0A=
function calcIslamic()=0A=
{=0A=
    setJulian(islamic_to_jd((new Number(document.islamic.year.value)),=0A=
                           document.islamic.month.selectedIndex + 1,=0A=
                           (new Number(document.islamic.day.value))));=0A=
}=0A=
=0A=
//  calcPersian  --  Update from Persian calendar=0A=
=0A=
function calcPersian()=0A=
{=0A=
    setJulian(persian_to_jd((new Number(document.persian.year.value)),=0A=
                           document.persian.month.selectedIndex + 1,=0A=
                           (new Number(document.persian.day.value))));=0A=
}=0A=
=0A=
//  calcMayanCount  --  Update from the Mayan Long Count=0A=
=0A=
function calcMayanCount()=0A=
{=0A=
    setJulian(mayan_count_to_jd((new =
Number(document.mayancount.baktun.value)),=0A=
                                (new =
Number(document.mayancount.katun.value)),=0A=
                                (new =
Number(document.mayancount.tun.value)),=0A=
                                (new =
Number(document.mayancount.uinal.value)),=0A=
                                (new =
Number(document.mayancount.kin.value))));=0A=
}=0A=
=0A=
//  calcBahai  --  Update from Bahai calendar=0A=
=0A=
function calcBahai()=0A=
{=0A=
    setJulian(bahai_to_jd((new Number(document.bahai.kull_i_shay.value)),=0A=
                          (new Number(document.bahai.vahid.value)),=0A=
                          document.bahai.year.selectedIndex + 1,=0A=
                          document.bahai.month.selectedIndex + 1,=0A=
                          document.bahai.day.selectedIndex + 1));=0A=
}=0A=
=0A=
//  calcIndianCivilCalendar  --  Update from Indian Civil Calendar=0A=
=0A=
function calcIndianCivilCalendar()=0A=
{=0A=
    setJulian(indian_civil_to_jd(=0A=
                           (new =
Number(document.indiancivilcalendar.year.value)),=0A=
                           =
document.indiancivilcalendar.month.selectedIndex + 1,=0A=
                           (new =
Number(document.indiancivilcalendar.day.value))));=0A=
}=0A=
=0A=
//  calcFrench  -- Update from French Republican calendar=0A=
=0A=
function calcFrench()=0A=
{=0A=
    var decade, j, mois;=0A=
=0A=
    j =3D document.french.jour.selectedIndex;=0A=
    decade =3D document.french.decade.selectedIndex;=0A=
    mois =3D document.french.mois.selectedIndex;=0A=
=0A=
    /*  If the currently selected day is one of the sansculottides,=0A=
        adjust the index to be within that period and force the=0A=
        decade to zero and the month to 12, designating the=0A=
        intercalary interval.  */=0A=
=0A=
    if (j > 9) {=0A=
        j -=3D 11;=0A=
        decade =3D 0;=0A=
        mois =3D 12;=0A=
    }=0A=
=0A=
    /*  If the selected month is the pseudo-month of the five or=0A=
        six sansculottides, ensure that the decade is 0 and the day=0A=
        number doesn't exceed six.  To avoid additional overhead, we=0A=
        don't test whether a day number of 6 is valid for this year,=0A=
        but rather simply permit it to wrap into the first day of=0A=
        the following year if this is a 365 day year.  */=0A=
=0A=
    if (mois =3D=3D 12) {=0A=
        decade =3D 0;=0A=
        if (j > 5) {=0A=
            j =3D 0;=0A=
        }=0A=
    }=0A=
=0A=
    setJulian(french_revolutionary_to_jd((new =
Number(document.french.an.value)),=0A=
                                         mois + 1,=0A=
                                         decade + 1,=0A=
                                         j + 1));=0A=
}=0A=
=0A=
//  calcGregSerial  --  Update from Gregorian serial day number=0A=
=0A=
function calcGregSerial()=0A=
{=0A=
    setJulian((new Number(document.gregserial.day.value)) + J0000);=0A=
}=0A=
=0A=
//  calcExcelSerial1900  --  Perform calculation starting with an Excel =
1900 serial date=0A=
=0A=
function calcExcelSerial1900()=0A=
{=0A=
    var d =3D new Number(document.excelserial1900.day.value);=0A=
=0A=
    /* Idiot Kode Kiddies didn't twig to the fact=0A=
       (proclaimed in 1582) that 1900 wasn't a leap year,=0A=
       so every Excel day number in every database on Earth=0A=
       which represents a date subsequent to February 28,=0A=
       1900 is off by one.  Note that there is no=0A=
       acknowledgement of this betrayal or warning of its=0A=
       potential consequences in the Excel help file.  Thank=0A=
       you so much Mister Talking Paper Clip.  Some day=0A=
       we're going to celebrate your extinction like it was=0A=
       February 29 ... 1900.  */=0A=
=0A=
    if (d > 60) {=0A=
        d--;=0A=
    }=0A=
=0A=
    setJulian((d - 1) + J1900);=0A=
}=0A=
=0A=
//  calcExcelSerial1904  --  Perform calculation starting with an Excel =
1904 serial date=0A=
=0A=
function calcExcelSerial1904()=0A=
{=0A=
    setJulian((new Number(document.excelserial1904.day.value)) + J1904);=0A=
}=0A=
=0A=
//  calcUnixTime  --  Update from specified Unix time() value=0A=
=0A=
function calcUnixTime()=0A=
{=0A=
    var t =3D new Number(document.unixtime.time.value);=0A=
=0A=
    setJulian(J1970 + (t / (60 * 60 * 24)));=0A=
}=0A=
=0A=
//  calcIsoWeek  --  Update from specified ISO year, week, and day=0A=
=0A=
function calcIsoWeek()=0A=
{=0A=
    var year =3D new Number(document.isoweek.year.value),=0A=
        week =3D new Number(document.isoweek.week.value),=0A=
        day =3D new Number(document.isoweek.day.value);=0A=
=0A=
    setJulian(iso_to_julian(year, week, day));=0A=
}=0A=
=0A=
//  calcIsoDay  --  Update from specified ISO year and day of year=0A=
=0A=
function calcIsoDay()=0A=
{=0A=
    var year =3D new Number(document.isoday.year.value),=0A=
        day =3D new Number(document.isoday.day.value);=0A=
=0A=
    setJulian(iso_day_to_julian(year, day));=0A=
}=0A=
=0A=
=0A=
/*  setDateToToday  --  Preset the fields in=0A=
    the request form to today's date.  */=0A=
=0A=
function setDateToToday()=0A=
{=0A=
    var today =3D new Date();=0A=
=0A=
    /*  The following idiocy is due to bizarre incompatibilities=0A=
        in the behaviour of getYear() between Netscrape and=0A=
        Exploder.  The ideal solution is to use getFullYear(),=0A=
        which returns the actual year number, but that would=0A=
        break this code on versions of JavaScript prior to=0A=
        1.2.  So, for the moment we use the following code=0A=
        which works for all versions of JavaScript and browsers=0A=
        for all year numbers greater than 1000.  When we're willing=0A=
        to require JavaScript 1.2, this may be replaced by=0A=
        the single line:=0A=
=0A=
            document.gregorian.year.value =3D today.getFullYear();=0A=
=0A=
        Thanks to Larry Gilbert for pointing out this problem.=0A=
    */=0A=
=0A=
    var y =3D today.getYear();=0A=
    if (y < 1000) {=0A=
        y +=3D 1900;=0A=
    }=0A=
=0A=
    document.gregorian.year.value =3D y;=0A=
    document.gregorian.month.selectedIndex =3D today.getMonth();=0A=
    document.gregorian.day.value =3D today.getDate();=0A=
    document.gregorian.hour.value =3D=0A=
    document.gregorian.min.value =3D=0A=
    document.gregorian.sec.value =3D "00";=0A=
}=0A=
=0A=
/*  presetDataToRequest  --  Preset the Gregorian date to the=0A=
    	    	    	     date requested by the URL=0A=
			     search field.  */=0A=
			     =0A=
function presetDataToRequest(s)=0A=
{=0A=
    var eq =3D s.indexOf("=3D");=0A=
    var set =3D false;=0A=
    if (eq !=3D -1) {=0A=
    	var calendar =3D s.substring(0, eq),=0A=
	    date =3D decodeURIComponent(s.substring(eq + 1));=0A=
	if (calendar.toLowerCase() =3D=3D "gregorian") {=0A=
	    var d =3D =
date.match(/^(\d+)\D(\d+)\D(\d+)(\D\d+)?(\D\d+)?(\D\d+)?/);=0A=
	    if (d !=3D null) {=0A=
	    	// Sanity check date and time components=0A=
	    	if ((d[2] >=3D 1) && (d[2] <=3D 12) &&=0A=
		    (d[3] >=3D 1) && (d[3] <=3D 31) &&=0A=
		    ((d[4] =3D=3D undefined) ||=0A=
		    	((d[4].substring(1) >=3D 0) && (d[4].substring(1) <=3D 23))) &&=0A=
		    ((d[5] =3D=3D undefined) ||=0A=
		    	((d[5].substring(1) >=3D 0) && (d[5].substring(1) <=3D 59))) &&=0A=
		    ((d[6] =3D=3D undefined) ||=0A=
		    	((d[6].substring(1) >=3D 0) && (d[6].substring(1) <=3D 59)))) {=0A=
		    document.gregorian.year.value =3D d[1];=0A=
		    document.gregorian.month.selectedIndex =3D d[2] - 1;=0A=
		    document.gregorian.day.value =3D Number(d[3]);=0A=
		    document.gregorian.hour.value =3D d[4] =3D=3D undefined ? "00" :=0A=
			d[4].substring(1);=0A=
		    document.gregorian.min.value =3D d[5] =3D=3D undefined ? "00" :=0A=
			d[5].substring(1);=0A=
    	    	    document.gregorian.sec.value =3D d[6] =3D=3D undefined ? =
"00" :=0A=
			d[6].substring(1);=0A=
		    calcGregorian();=0A=
		    set =3D true;=0A=
		} else {=0A=
	    	    alert("Invalid Gregorian date \"" + date +=0A=
			"\" in search request");=0A=
		}=0A=
	    } else {=0A=
	    	alert("Invalid Gregorian date \"" + date +=0A=
		    "\" in search request");=0A=
	    }=0A=
	    =0A=
	} else if (calendar.toLowerCase() =3D=3D "julian") {=0A=
	    var d =3D =
date.match(/^(\d+)\D(\d+)\D(\d+)(\D\d+)?(\D\d+)?(\D\d+)?/);=0A=
	    if (d !=3D null) {=0A=
	    	// Sanity check date and time components=0A=
	    	if ((d[2] >=3D 1) && (d[2] <=3D 12) &&=0A=
		    (d[3] >=3D 1) && (d[3] <=3D 31) &&=0A=
		    ((d[4] =3D=3D undefined) ||=0A=
		    	((d[4].substring(1) >=3D 0) && (d[4].substring(1) <=3D 23))) &&=0A=
		    ((d[5] =3D=3D undefined) ||=0A=
		    	((d[5].substring(1) >=3D 0) && (d[5].substring(1) <=3D 59))) &&=0A=
		    ((d[6] =3D=3D undefined) ||=0A=
		    	((d[6].substring(1) >=3D 0) && (d[6].substring(1) <=3D 59)))) {=0A=
		    document.juliancalendar.year.value =3D d[1];=0A=
		    document.juliancalendar.month.selectedIndex =3D d[2] - 1;=0A=
		    document.juliancalendar.day.value =3D Number(d[3]);=0A=
		    calcJulianCalendar();=0A=
		    document.gregorian.hour.value =3D d[4] =3D=3D undefined ? "00" :=0A=
			d[4].substring(1);=0A=
		    document.gregorian.min.value =3D d[5] =3D=3D undefined ? "00" :=0A=
			d[5].substring(1);=0A=
    	    	    document.gregorian.sec.value =3D d[6] =3D=3D undefined ? =
"00" :=0A=
			d[6].substring(1);=0A=
		    set =3D true;=0A=
		} else {=0A=
	    	    alert("Invalid Julian calendar date \"" + date +=0A=
			"\" in search request");=0A=
		}=0A=
	    } else {=0A=
	    	alert("Invalid Julian calendar date \"" + date +=0A=
		    "\" in search request");=0A=
	    }=0A=
=0A=
	} else if (calendar.toLowerCase() =3D=3D "jd") {=0A=
	    var d =3D date.match(/^(\-?\d+\.?\d*)/);=0A=
	    if (d !=3D null) {=0A=
	    	setJulian(d[1]);=0A=
		set =3D 1;=0A=
	    } else {=0A=
	    	alert("Invalid Julian day \"" + date +=0A=
		    "\" in search request");=0A=
	    }=0A=
	    =0A=
	} else if (calendar.toLowerCase() =3D=3D "mjd") {=0A=
	    var d =3D date.match(/^(\-?\d+\.?\d*)/);=0A=
	    if (d !=3D null) {=0A=
	    	document.modifiedjulianday.day.value =3D d[1];=0A=
	    	calcModifiedJulian();=0A=
		set =3D 1;=0A=
	    } else {=0A=
	    	alert("Invalid Modified Julian day \"" + date +=0A=
		    "\" in search request");=0A=
	    }=0A=
	    =0A=
	} else if (calendar.toLowerCase() =3D=3D "unixtime") {=0A=
	    var d =3D date.match(/^(\-?\d+\.?\d*)/);=0A=
	    if (d !=3D null) {=0A=
	    	document.unixtime.time.value =3D d[1];=0A=
	    	calcUnixTime();=0A=
		set =3D 1;=0A=
	    } else {=0A=
	    	alert("Invalid Modified Julian day \"" + date +=0A=
		    "\" in search request");=0A=
	    }=0A=
	    =0A=
	} else if (calendar.toLowerCase() =3D=3D "iso") {=0A=
	    var d;=0A=
	    if ((d =3D date.match(/^(\-?\d+)\-(\d\d\d)/)) !=3D null) {=0A=
	    	document.isoday.year.value =3D d[1];=0A=
		document.isoday.day.value=3D d[2];=0A=
	    	calcIsoDay();=0A=
		set =3D 1;=0A=
	    } else if ((d =3D date.match(/^(\-?\d+)\-?W(\d\d)\-?(\d)/i)) !=3D =
null) {=0A=
    	    	document.isoweek.year.value =3D d[1];=0A=
    	    	document.isoweek.week.value =3D d[2];=0A=
    	    	document.isoweek.day.value =3D d[3];=0A=
	    	calcIsoWeek();=0A=
		set =3D 1;=0A=
	    } else {=0A=
	    	alert("Invalid ISO-8601 date \"" + date +=0A=
		    "\" in search request");=0A=
	    }=0A=
	    =0A=
	} else if (calendar.toLowerCase() =3D=3D "excel") {=0A=
	    var d =3D date.match(/^(\-?\d+\.?\d*)/);=0A=
	    if (d !=3D null) {=0A=
	    	document.excelserial1900.day.value =3D d[1];=0A=
	    	calcExcelSerial1900();=0A=
		set =3D 1;=0A=
	    } else {=0A=
	    	alert("Invalid Excel serial day (1900/PC) \"" + date +=0A=
		    "\" in search request");=0A=
	    }=0A=
	    =0A=
	} else if (calendar.toLowerCase() =3D=3D "excel1904") {=0A=
	    var d =3D date.match(/^(\-?\d+\.?\d*)/);=0A=
	    if (d !=3D null) {=0A=
	    	document.excelserial1904.day.value =3D d[1];=0A=
	    	calcExcelSerial1904();=0A=
		set =3D 1;=0A=
	    } else {=0A=
	    	alert("Invalid Excel serial day (1904/Mac) \"" + date +=0A=
		    "\" in search request");=0A=
	    }=0A=
	=0A=
	} else {=0A=
	    alert("Invalid calendar \"" + calendar +=0A=
	    	"\" in search request");=0A=
	}=0A=
    } else {=0A=
    	alert("Invalid search request: " + s);=0A=
    }=0A=
    =0A=
    if (!set) {=0A=
    	setDateToToday();=0A=
	calcGregorian();=0A=
    }=0A=
}=0A=

------=_NextPart_000_0000_01C8C7DC.62626FD0--
