<!-- hide script from old browsers;

function CalculateEaster()
{


var EasterYear = document.InputYear.Year.value; // Take the year from input form


var a = EasterYear % 19 ; // the place in the 19 year cycle.

var b = Math.floor(EasterYear / 100); //the century, without remainder

var c = EasterYear % 100 ; //the year in the century

var d = Math.floor(b / 4); // number of leap-century cycles

var e = b % 4 ;  // place in leap-century cycle;

var f = Math.floor((b+8) / 25 ); // century in 2500 year corrective cycle

var g = Math.floor((b - f + 1) / 3) ; // days correction in 2500 year cycle

var h = (19 * a + b - d - g + 15) % 30 ; //

var i = Math.floor(c / 4); //  leap cycles in century

var k = c % 4 ; // Year in leap cycle

var l = (32 + 2 * e + 2 * i - h - k) % 7 ; // 

var m = Math.floor((a + 11 * h + 22 * l) / 451) ; // adjust on basis of golden number, lunar month, day of week

var DayInYear = h + l - 7 * m + 114 ; // not real days, but allows calculation of months and days

var EasterMonth = Math.floor(DayInYear / 31); // 3 for March, 4 for April
if (EasterMonth == 3) {var MonthName = "March"}
else {var MonthName = "April"}

var EasterDay = (DayInYear % 31) + 1 ; // Day of month

/* Output results */


document.InputYear.Results.value = "Easter in " + EasterYear; // Pass output to form field
document.InputYear.Results.type = "text"; // reveal the hidden field

document.InputYear.DayMonth.value = EasterDay + " " + MonthName;
document.InputYear.DayMonth.type = "text"; // reveal the hidden field


document.InputYear.Golden.value = "Golden number is " + ((a % 19)+1) + ".";
document.InputYear.Golden.type = "text"; // reveal the hidden field

var weekdayadj = Math.floor((3 * b - 53) / 4); // Adjust for non-leap centuries
var weekdayadjplus = 7 - (weekdayadj % 7); // This is the extra number added 
// to the year plus its fourth part in calculating Sunday letters for a century,
// as follows:

weekwork = Math.floor(EasterYear * 5/4);
weekwork = weekwork + weekdayadjplus;

weekday = weekwork  % 7;

if (weekday == 0) {var Sundayletter = "A"}

if (weekday == 1) {var Sundayletter = "G"}

if (weekday == 2) {var Sundayletter = "F"}

if (weekday == 3) {var Sundayletter = "E"}

if (weekday == 4) {var Sundayletter = "D"}

if (weekday == 5) {var Sundayletter = "C"}

if (weekday == 6)  {var Sundayletter = "B"} // Letters from prayer-book table


document.InputYear.Sunday.value = "Sunday letter is " + Sundayletter + ".";
document.InputYear.Sunday.type = "text"; // reveal the hidden field

//    Other movable dates to calculate:
// Ash Wednesday (allow for leap days) -46
// Mothering Sunday -21
// Palm Sunday  -7
// Maundy Thursday -3
// Good Friday -2
// Ascension +39
// Pentecost +49
// Trinity +56
// Corpus Christi  +60

// Reckon days from last day of February
var easterNumberdays = EasterDay + ((EasterMonth == 4) * 31);

var ashwNumberdays = easterNumberdays - 46;
var motheringNumberdays = easterNumberdays - 21;
var palmsNumberdays = easterNumberdays - 7;
var MaundyNumberdays = easterNumberdays - 3;
var GoodFNumberdays = easterNumberdays - 2;
var AscnNumberdays = easterNumberdays + 39;
var PentNumberdays = easterNumberdays + 49;
var TrinNumberdays = easterNumberdays + 56;
var CorpNumberdays = easterNumberdays + 60;

// is it a leap year?
var leapyear = 1; // Assume leap year
if (k > 0) {var leapyear = 0} // Not a leap year
if (c==0)  {
if (e > 0) {var leapyear = 0} // Not a leap year
}

if (ashwNumberdays > 0) {
var ashwMonth = " March";
var ashwDays = ashwNumberdays;
}
else {
var ashwMonth = " February";
var ashwDays = 28 + leapyear + ashwNumberdays;
}

if (motheringNumberdays > 31) {
var motheringMonth = " April";
var motheringDays = motheringNumberdays - 31;
}
else {
var motheringMonth = " March";
var motheringDays = motheringNumberdays;
}

if (palmsNumberdays > 31) {
var palmsMonth = " April";
var palmsDays = palmsNumberdays - 31;
}
else {
var palmsMonth = " March";
var palmsDays = palmsNumberdays;
}

if (MaundyNumberdays > 31) {
var MaundyMonth = " April";
var MaundyDays = MaundyNumberdays - 31;
}
else {
var MaundyMonth = " March";
var MaundyDays = MaundyNumberdays;
}

if (GoodFNumberdays > 31) {
var GoodFMonth = " April";
var GoodFDays = GoodFNumberdays - 31;
}
else {
var GoodFMonth = " March";
var GoodFDays = GoodFNumberdays;
}

if (AscnNumberdays > 92) {
var AscnMonth = " June";
var AscnDays = AscnNumberdays - 92;
}
else {
if (AscnNumberdays > 61) {
var AscnMonth = " May";
var AscnDays = AscnNumberdays - 61;
}
else {
var AscnMonth = " April";
var AscnDays = AscnNumberdays - 31;
}}

if (PentNumberdays > 92) {
var PentMonth = " June";
var PentDays = PentNumberdays - 92;
}
else {
var PentMonth = " May";
var PentDays = PentNumberdays - 61;
}

if (TrinNumberdays > 92) {
var TrinMonth = " June";
var TrinDays = TrinNumberdays - 92;
}
else {
var TrinMonth = " May";
var TrinDays = TrinNumberdays - 61;
}

if (CorpNumberdays > 92) {
var CorpMonth = " June";
var CorpDays = CorpNumberdays - 92;
}
else {
var CorpMonth = " May";
var CorpDays = CorpNumberdays - 61;
}

// Pass out some results
document.InputYear.ashw.value = "Ash Wednesday: " + ashwDays + ashwMonth + ".";
document.InputYear.ashw.type = "text"; // reveal the hidden field
document.InputYear.mothering.value = "Mothering Sunday: " + motheringDays + motheringMonth + ".";
document.InputYear.mothering.type = "text"; // reveal the hidden field
document.InputYear.palms.value = "Palm Sunday: " + palmsDays + palmsMonth +".";
document.InputYear.palms.type = "text"; // reveal the hidden field
document.InputYear.Maundy.value = "Maundy Thursday: " + MaundyDays + MaundyMonth + ".";
document.InputYear.Maundy.type = "text"; // reveal the hidden field
document.InputYear.GoodF.value = "Good Friday: " + GoodFDays + GoodFMonth + ".";
document.InputYear.GoodF.type = "text"; // reveal the hidden field
document.InputYear.Ascn.value = "Ascension: " + AscnDays + AscnMonth + ".";
document.InputYear.Ascn.type = "text"; // reveal the hidden field
document.InputYear.Pent.value = "Pentecost: " + PentDays + PentMonth + ".";
document.InputYear.Pent.type = "text"; // reveal the hidden field
document.InputYear.Trin.value = "Trinity Sunday: " + TrinDays + TrinMonth + ".";
document.InputYear.Trin.type = "text"; // reveal the hidden field
document.InputYear.corp.value = "Corpus Christi: " + CorpDays + CorpMonth + ".";
document.InputYear.corp.type = "text"; // reveal the hidden field
}

// end hiding script -->
