/* ABCalendar - Christian(Coptic,Orthodox,Quaker,Western), Bahai, Balinese, Hebrew, Hindu, Islamic, Mayan, Secular, Tibetan, Zoroastrian dates, holidays and prayer times
(C)OPYRIGHT Virtual Church of the Blind Chihuahua(TM), 2003-2011. CONTACT: http://www.dogchurch.org/narthex/contact.html
USE UNDER GPL. ACKNOWLEDGE: dogchurch.org for this script, maxmind.com for GeoIP location service, MapQuest.com Open Elevation API,
Dershowitz & Reingold,"Calendrical Calculations," Cambridge, 2008 (see http://emr.cs.iit.edu/home/reingold/calendar-book/Calendrica.html) for date conversions,
and United States National Oceanographic and Atmospheric Administration (NOAA) for solar time calculations. More references below. 
DISCLAIMER: We do not certify the accuracy, reliability or suitability of this script for any purpose. Use at your own risk. See Example HTML below.
2011 Quaker,Hindu,Balinese,Zoroastrian, single getEaster & clockMod/amod; Date.get("fix") .get("minutes") .locale .clone(); toString/HTML,contains for Cal/Clk items, MapQuest Elevation
2010 Tibetan,Mayan Long Count,Zoroastrian dates; toHTML for Date,CalEvent,CalEventList,CalSeason; single Salutation, ABCalWidget location input
2008 Mayan & Hindu apocalypse countdowns, ABCalWidget, DateFmFix, topocoding.com elevation, Seasons can overlap, ClkTime can straddle midnight
2007 Bahai,Coptic, Clock & geoLocale objects, MaxMind GeoIP, NOAA solar time
2006 Julian (Orthodox), Calendar object, separate Western Secular & Liturgical calendars 
2003 Hebrew,Islamic,combined Western Secular-Liturgical calendars */
//******************************************************* Date extensions
var nl="<br />", sp=" ", twk=0.000001, msd=86400000, tzo=(new Date()).getTimezoneOffset(), Rearth=6372.7976, deBug=false;
var myLocale=new geoLocale("myLocale"), Jerusalem=new geoLocale("Jerusalem",31.8,35.2,"IL",800,120), Mecca=new geoLocale("Mecca",21.423,39.823,"SA",298,180), Beijing=new geoLocale("Beijing",39.917,116.417,"CN",43.5,480);
function dlert(msg,mrk){return "<a href=\"javascript:alert('"+msg+"')\">"+mrk+"</a>";}
Date.prototype.kind="Gregorian"; Date.prototype.locale=myLocale; Date.prototype.clone=function(){return new Date(this.getFullYear(),this.getMonth(),this.getDate());}
Date.prototype.get=function(what,kind,where){var k=kind||this.kind,w=where||this.locale,ffdate=fixFmDate(this),fdate=Math.floor(ffdate),tod=(ffdate-fdate)*1440,a=0,b;
	if(what=="minutes")return Math.round(tod); //minutes from midnight
	switch (k){
		case "Hebrew":		a=(tod>getSolarTimes(this,w)[2])?1:0; if(what=="fix")b=ffdate+a; else b=HebrewFmFix(fdate+a,what); break;
		case "Islamic":		a=(tod>getSolarTimes(this,w)[2])?1:0; if(what=="fix")b=ffdate+a; else b=IslamicFmFix(fdate+a,what); break;
		case "Bahai":		a=(tod>getSolarTimes(this,w)[2])?1:0; if(what=="fix")b=ffdate+a; else b=BahaiFmFix(fdate+a,what); break;
		case "Zoroastrian":	a=(tod<getSolarTimes(this,w)[0])?1:0; if(what=="fix")b=ffdate-a; else b=ZoroastrianFmFix(fdate-a,what); break;
		case "Hindu":		a=(tod<getSolarTimes(this,w)[0])?1:0; if(what=="fix")b=ffdate-a; else b=oldHinduSolarFmFix(fdate-a,what); break;
		case "Long Count": 	if(what=="fix")b=ffdate; else b=LongCountFmFix(fdate,what); break;
		case "Balinese":	if(what=="fix")b=ffdate; else b=BalinesePawukonFmFix(fdate,what); break;
		case "Tibetan":		if(what=="fix")b=ffdate; else b=TibetanFmFix(fdate,what); break;
		case "Julian": case "Orthodox":	if(what=="fix")b=ffdate; else b=JulianFmFix(fdate,what); break;
		case "Coptic":		if(what=="fix")b=ffdate; else b=CopticFmFix(fdate,what); break;
		default:			if(what=="fix")b=ffdate; else b=GregorianFmFix(ffdate,what);} return b;}
Date.prototype.set = function(yyyy,mm,dd,kind,major,cycle){var ffdate; if(kind) this.kind=kind;
	switch(this.kind){
		case "Hebrew":		ffdate = fixFmHebrew(yyyy,mm,dd); break;
		case "Islamic":		ffdate = fixFmIslamic(yyyy,mm,dd); break;
		case "Bahai":		ffdate = fixFmBahai(major,cycle,yyyy,mm,dd); break;
		case "Zoroastrian":	ffdate = fixFmZoroastrian(yyyy,mm,dd); break;
		case "Hindu":		ffdate = fixFmOldHinduSolar(yyyy,mm,dd); break;
		case "Long Count": 	ffdate = fixFmLongCount(major,cycle,yyyy,mm,dd); break;
		case "Balinese":	ffdate = fixFmBalinesePawukon(yyyy,mm,dd); break; // Calendar fiction. yyyy is our cycle count, mm=0 is dummy, dd is CC Balinese Day Count in cycle
		case "Tibetan":		ffdate = fixFmTibetan(major,cycle,yyyy,mm,dd); break;
		case "Julian": case "Orthodox":	ffdate = fixFmJulian(yyyy,mm,dd); break;
		case "Coptic":		ffdate = fixFmCoptic(yyyy,mm,dd); break;
		default:			ffdate = fixFmGregorian(yyyy,mm,dd);} this.setTime((ffdate-epoch.javascript)*msd);}
Date.prototype.from=function(n,kday,kon,cycle,offset){var jetzt=fixFmDate(this)+twk; if(typeof(kday)!="number") return DateFmFix(jetzt+n,this.kind);
	var m=cycle||7,Delta=offset||0,d=Math.floor(jetzt+Delta)%m,mn=m*((kon && d==kday)?(n-sgn(n)):n); return DateFmFix(jetzt+mn-(d+mn+Delta-kday)%m,this.kind);}
Date.prototype.toHTML=function(what){ var Month,WeekDay,daytype,yearName=false,dateName=false,majorName=false,cycleName=false,altYearName=false,msg="";
	var yeartype=sp+dlert("Anno Domini — The Year of our Lord. The Western Churches, most of the Eastern Orthodox Churches and the international community use the annual calendar commissioned by Pope Gregory XIII in A.D. 1542 as a reform of the Julian Calendar. Years are reckoned from the Birth of Christ, as determined by a monk in Rome named Dionysius Exiguus in A.D. 525.","A.D.")+sp;
	switch(this.kind){
	case "Hebrew":
		Month = ["Nisan","Iyyar","Sivan","Tammuz","Av","Elul","Tishri","Marheshvan","Kislev","Tevet","Shevat",(HebrewLeapYear(this.get("year")))?"Adar I":"Adar","Adar II"];
		WeekDay=["yom rishon", "yom sheni","yom shelishi","yom revi'i","yom hamishi","yom shishi","yom shabbat (sabbath)"];
		yeartype=sp+dlert("Anno Mundi - Hebrew time is reckoned from the Creation of the World as calculated from the lifespans of Biblical patriarchs.","A.M.")+sp;
		daytype=dlert("Hebrew and Islamic days begin at sunset, and are numbered beginning with Sunday, not named, except as noted (in parenthesis). Seven day weeks are also used in the Hindu, Tibetan, and Chinese calendars.","*");
	break;
	case "Islamic":
		Month = ["Muharram","Safar","Rabi I","Rabi II","Jumada I","Jumada II","Rajab","Sha'ban","Ramadan","Shawwal","Dhu al-Qa'da","Dhu al-Hijja"];
		WeekDay=["yaum al-ahad","yaum al-ithnayna","yaum ath-thalatha","yaum al-arba'a","yaum al-hamis","yaum al-jum'a (assembly)","yaum as-sabt (sabbath)"];
		yeartype=sp+dlert("Anno Higrae - Islamic time is reckoned from the Hijra, or Emigration from Mecca to Medina.","A.H.")+sp;
		daytype=dlert("Hebrew and Islamic days begin at sunset, and are numbered beginning with Sunday, not named, except as noted (in parenthesis). Seven day weeks are also used in the Hindu, Tibetan, and Chinese calendars.","*");
	break;
	case "Bahai": // Western Version
		yearName=["","Alif","Ba","Ab (Father)","Dal","Bab (Gate)","Vav","Abad (Eternity)","Jad (Generosity)","Baha (Splendor)","Hubb (Love)","Bahhaj (Delight)",
		"Javab (Answer)","Ahad (Single)","Vahhab (Bountiful)","Vidad (Affection)","Badi (Beginning)","Bahi (Luminous)","Abha (Most Luminous)","Vahid (Unity)"];
		Month=["Ayyam-i-Ha (Days of God)","Baha (Splendor)","Jalal (Glory)","Jamal (Beauty)","'Azmat (Grandeur)","Nur (Light)","Rahmat (Mercy)","Kalimat (Words)","Kamal (Perfection)",
		"Asma (Names)","'Izzat (Might)","Mashiyyat (Will)","'Ilm (Knowledge)","Qudrat (Power)","Qawl (Speech)","Masa'il (Questions)","Sharaf (Honor)","Sultan (Power)","Mulk (Dominion)","'Ala' (Loftiness)"];
		WeekDay=["Jamal (Beauty)","Kamal (Perfection)","Fidal (Grace)","'Idal (Justice)","Istijlal (Majesty)","Istiqlal (Independence)","Jalal (Glory)"];
		dateName=Month; cycleName="Vahid"; majorName="Kull-i-Shay";
		yeartype=sp+dlert("Bahai Era - Bahai time is reckoned from the spring equinox of 1844 A.D, the year the Bab declared he was the herald of a new Messenger of God for this age.","B.E.");
		daytype=dlert("Bahai dates, 19-day months, 19-month years and days are named after attributes of God, and begin at sunset (as do Hebrew and Islamic days). Years are grouped into 19- and 361-year minor and major cycles. The Bahai 7-day week begins on Saturday (as does the Persian week).","*");
	break;
 	case "Tibetan":
		Month=["","dbo","nag pa","sa ga","snron","chu stod","gro bzhin","khrums","tha skar","smin drug","mgo","rgyal","mchu"];
		WeekDay=["gza' nyi ma","gza' xla ba","gza' mig dmar","gza' lhg pa","gza' phur bu","gza' pa sangs","gza' spen pa"];
		yeartype=sp+dlert("Anno Yarlungum - Our Phukluk version of the Kalacakra (Wheel of Time) reckons Tibetan time from 7 December of B.C. 127, the ascension of the first Yarlung King, Nyatri Tsenpo.","A.Y.")+sp;
		daytype=dlert("As in the Chinese, Hebrew, Hindu, Islamic and many subsequent calendars, Tibetan days are grouped into seven-day weeks.","*");
		var root=["Wood","Wood","Fire","Fire","Earth","Earth","Iron","Iron","Water","Water"];
		var stem=["Mouse","Ox","Tiger","Hare","Dragon","Snake","Horse","Sheep","Monkey","Bird","Dog","Pig"];
		var tya=this.get("year"); altYearName=root[(tya-1)%10]+sp+stem[(tya+1)%12];
	break;
	case "Coptic":
		Month = ["Thoout","Paope","Athor","Koiak","Tobe","Meshir","Paremotep","Parmoute","Pashons","Paone","Epep","Mesore","Epagomene"];
		WeekDay=["Tkyriake","Pesnau","Pshoment","Peftoou","Ptiou","Psoou","Psabbaton"];
		yeartype=sp+dlert("Anno Martyrum - Coptic Orthodox time is reckoned from the Year of the Martyrs, when Diocletian became Emperor of Rome.","A.M.")+sp;
		daytype=dlert("Coptic Orthodox month and day names are derived from a Hellenized/Christianized form of Pharonic Egyptian.","*");
	break;
	case "Zoroastrian": WeekDay=false;// see http://www.persiandna.com/calendar.htm
		Month=["Fravardin","Ardibehest","Khordehd","Tir","Amardad","Shehrevar","Meher","Avan","Adar","Dae","Bahman","Aspandarmad","Hamaspathmaidyen"];
		if(this.get("month")<12) dateName=["","Hormuzd","Bahman","Ardibehesht","Shehrevar","Asfandarmad","Khordehd","Amardad","Daepadar","Adar","Avan","Khorshed","Mohor","Tir","Gosh","Daepmeher","Meher","Sarosh","Rashna","Farvardin","Behram","Ram","Govad","Daepdin","Din","Ashishvangh","Ashtad","Asman","Zamyad","Mahrespand","Aneran"];
		else dateName=["","Ahunavad","Ushtavad","Spentomad","Vohukhshathra","Vahishtoist"];
		yeartype=sp+dlert("Yezdegerdi Era. Zoroastrians reckon time from the ascension of Yezdegerd III as king of Persia, but use the same calendar structure as the ancient Egyptians.","Y.Z.")+sp;
		daytype=dlert("Zoroastrian days and months are named, and begin at sunrise. Zoroastrians do not observe a seven day week.","*");
	break;
	case "Hindu": // old Hindu Solar arithmetic calendar, with Lunar month names and Vedic day names. Cycle starts one month off from lunar cycle
		Month  = ["Vaisakha","Jyestha","Asadha","Sravana","Bhadrapada","Avsina","Kartika","Margasira","Pausa","Magha","Phalunga","Caitra"];
		WeekDay= ["Ravivara","Somavara","Mangalavara","Buddhavara","Guruvara","Sukravara","Sanivara"];
		yeartype=sp+dlert("Kali Yuga or Iron Age, dating from the beginning of the fourth and final 432,000 year stage of the 4,320,000 year period since the last recreation of the world.","K.Y.")+sp;
		daytype=dlert("The old Hindu solar calendar uses a seven day week. We use Vedic rather than Sanskrit day names.","*");
		altYearName=this.get("countdown")+nl+"Days to Apocalypse";	
	break;
	case "Long Count": var x=".";
		daytype=dlert("The Mayan Long Count was simply a count of nameless days, grouped into units called baktun, katun, tun, uinal, and kin. The baktun changes in 2012, but the Long Count goes on.","*");
		msg=this.get("baktun")+x+this.get("katun")+x+this.get("tun")+x+this.get("uinal")+x+this.get("kin")+daytype+nl+"day "+this.get("day"); 
		msg+=nl+this.get("countdown")+nl+"Days to Apocalypse"; return msg; break;
	case "Balinese":
		daytype=dlert("The Balinese Pawukon calendar consists of concurrent 1,2,3,4,5,6,7,8,9 and 10-day cycles of day-names, repeating in numberless 210-day periods, that describe, rather than count the time for ceremonial purposes.","*");
		msg=this.get("luang")+this.get("dwiwara")+this.get("triwara")+this.get("caturwara")+this.get("pancawara")+this.get("sadwara")+this.get("saptawara")+this.get("asatawara")+this.get("sangawara")+this.get("dasawara")+daytype;
		msg+=nl+"day "+this.get("date"); msg+=this.get("holidays"); return msg; break;
	case "Quaker": case "Friends": // see www.tractassociation.org
		Month  =["First Month","Second Month","Third Month","Fourth Month","Fifth Month","Sixth Month","Seventh Month","Eighth Month","Ninth Month","Tenth Month","Eleventh Month","Twelfth Month"];
		WeekDay=["First Day","Second Day","Third Day","Fourth Day","Fifth Day","Sixth Day","Seventh Day"];
		daytype=dlert("Quakers number their months and days, and recognize the holy nature of every day.","*");
	break;	
	case "Julian": case "Orthodox":
		yeartype=sp+dlert("Anno Domini - The Year of Our Lord. The Orthodox Churches of Russia, Serbia and Jerusalem still use the Julian calendar, based on the Roman calendar established by Julius Caesar in 45 B.C. Years are reckoned from the Birth of Christ, as determined by a monk in Rome named Dionysius Exiguus in A.D. 525.","A.D.")+sp;
	default: // Gregorian, Lutheran
		Month  = ["January","February","March","April","May","June","July","August","September","October","November","December"];
		WeekDay= ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
		daytype=dlert("English day names are of Teutonic pagan origin, while organizing days into 7-day was taken by Christian Europe from Judaism. Seven day weeks are also used in the Hindu, Tibetan, and Chinese calendars. To fix the date, reset the clock on your computer.","*");}
	if(what=="day") return WeekDay[this.get("day")]+daytype; if(WeekDay && (what!="noday")) msg += WeekDay[this.get("day")]+daytype+nl;
	var dd=this.get("date"); msg+=(dateName?dateName[dd]+(!WeekDay?daytype:"")+sp:"")+dd+sp+Month[this.get("month")];
	if(!cycleName) msg+=sp+yeartype+(yearName?yearName[this.get("year")]:this.get("year"));
	else msg+=nl+yearName[this.get("year")]+" of "+cycleName+sp+this.get("cycle")+nl+majorName+sp+this.get("major")+sp+yeartype;
	return msg+=(altYearName?nl+altYearName:"");}
//******************************************* Date Conversions adapted from Dershowitz & Reingold,"Calendrical Calculations," Cambridge, 2008.
var epoch={Gregorian:1,Julian:-1,javascript:719163-tzo/1440,Hebrew:-1373427,Mayan:-1137142,Hindu:-1132959,Zoroastrian:230638,Coptic:103605,Islamic:227015,Bahai:673222,Tibetan:-46410,Chinese:-963099,Balinese:-119};
function IntDiv(x,y){if(y==0) return null; var q=x/y; return (q>0)?Math.floor(q):Math.ceil(q);} function ddFmDMS(d,m,s){return d+(m+s/60)/60;}
function sgn(x){var s; if(x>0) s=1; else if(x<0) s=-1; else s=0; return s;} function amod(x,y){var q=x%y; return (q>0)?q:(y+q);} // CC p19
// Date (Javascript)
function fixFmDate(aDate){return epoch.javascript+aDate.getTime()/msd;}
function DateFmFix(ffdate,kind){var r=new Date(); r.setTime((ffdate-epoch.javascript)*msd); r.kind=kind; return r;}
// Gregorian
function GregorianLeapYear(ayear){return ((ayear%4==0)&&(ayear%100!=0))||(ayear%400==0);}
function fixFmGregorian(yy,mm,df){var y1=yy-1, fdate=epoch.Gregorian-1+365*y1+Math.floor(y1/4)-Math.floor(y1/100)+Math.floor(y1/400)+Math.floor((367*(mm+1)-362)/12)+df;
	if(mm>1) fdate-=GregorianLeapYear(yy)?1:2; return fdate;}
function GregorianFmFix(ffdate,what){ var d=DateFmFix(ffdate,"Gregorian");
	switch(what){case "month":return d.getMonth();case "date":return d.getDate();case "day":return d.getDay();case "year":return d.getFullYear();}}
// Julian
function JulianLeapYear(jYear){return (jYear>0)?(jYear%4==0):(jYear%4==3);}
function fixFmJulian(yy,mm,dd){var y1=(yy<0)?yy:yy-1, fdate=epoch.Julian-1+365*y1+Math.floor(y1/4)+Math.floor((367*(mm+1)-362)/12)+dd;
	if(mm>1) fdate-=JulianLeapYear(yy)?1:2; return fdate;}
function JulianFmFix(fdate,what){									if(what=="day") return fdate%7;
	var approx = Math.floor((4*(fdate-epoch.Julian)+1464)/1461); 
	var yy = (approx>0)?approx:approx-1;							if(what=="year") return yy;
	var pdays = fdate-fixFmJulian(yy,0,1); if(fdate >= fixFmJulian(yy,2,1)) pdays+=(JulianLeapYear(yy))?1:2;
	var mm = Math.floor((12*pdays+373)/367)-1;						if(what=="month") return mm;
	var dd = fdate-fixFmJulian(yy,mm,1)+1;							if(what=="date") return dd;}
// Zoroastrian
function fixFmZoroastrian(yy,mm,dd){return epoch.Zoroastrian+365*(yy-1)+mm*30+dd-1;}
function ZoroastrianFmFix(fdate,what){var days=fdate-epoch.Zoroastrian;
	var yy=Math.floor(days/365)+1;									if(what=="year") return yy;
	var mm = Math.floor((days%365)/30);								if(what=="month") return mm;
	var dd = days-365*(yy-1)-30*mm+1;								if(what=="date" || what=="day") return dd;}
// Coptic
function CopticLeapYear(cYear){return cYear%4==3;} // not needed
function fixFmCoptic(yy,mm,dd){return epoch.Coptic-1+365*(yy-1)+Math.floor(yy/4)+30*mm+dd;}
function CopticFmFix(fdate,what){									if(what=="day") return fdate%7;
	var yy = Math.floor((4*(fdate-epoch.Coptic)+1463)/1461);		if(what=="year") return yy;
	var mm = Math.floor((fdate-fixFmCoptic(yy,0,1))/30);			if(what=="month") return mm;
	var dd = fdate+ 1-fixFmCoptic(yy,mm,1);							if(what=="date") return dd;}
// Islamic (arithmetic - NOT approved by the ulema)
function fixFmIslamic(yy,mm,dd){return epoch.Islamic-1 + (yy-1)*354 + Math.floor((3+11*yy)/30)+ 29*mm+Math.floor((mm+1)/2.0)+dd;}
function IslamicFmFix(fdate,what){									if(what=="day") return fdate%7;
	var yy=Math.floor((30*(fdate-epoch.Islamic)+10646)/10631);		if(what=="year") return yy;
	var pdays=fdate-fixFmIslamic(yy,0,1);
	var mm=Math.floor((11*pdays+330)/325)-1;						if(what=="month") return mm;
	var dd=fdate-fixFmIslamic(yy,mm,1)+1;							if(what=="date") return dd;}
// Hebrew (arithmetic, NOT approved by the rabbis)
function HebrewLeapYear(hyear){return (7*hyear+1)%19<7;}
function HebCalElapsDays(hyear){var months_elapsed=Math.floor((235*hyear-234)/19), parts_elapsed=12084+13753*months_elapsed;
	var days=29*months_elapsed+Math.floor(parts_elapsed/25920)+1; return (3*days)%7<3?days:--days;}
function HebNYDelay(hyear){var n=0, ny1=HebCalElapsDays(hyear); if((HebCalElapsDays(hyear+1)-ny1)==356) n=2; if((ny1-HebCalElapsDays(hyear-1))==382) n=1; return n;}
function HebNewYear(hyear){return epoch.Hebrew+HebCalElapsDays(hyear)+HebNYDelay(hyear);}
function daysInHebYear(hyear){return HebNewYear(hyear+1)-HebNewYear(hyear);}
function lastDayHebMonth(hyear,hmonth){switch (hmonth){
	case 1: case 3: case 5: case 9: case 12: return 29;
	case 11: return (HebrewLeapYear(hyear))?30:29;
	case 7:  var y=daysInHebYear(hyear); return (y==355||y==385)?30:29; // long marheshvan
	case 8:  var y=daysInHebYear(hyear); return (y==353||y==383)?29:30; // short kislev
	default: return 30;}}
function fixFmHebrew(yy,mm,dd){var m, dh=HebNewYear(yy)+dd-1; if(mm>=6){for(m=6;m<mm;m++) dh+=lastDayHebMonth(yy,m); return dh;} 
	var mlast=(HebrewLeapYear(yy))?13:12; for(m=6;m<mlast;m++) dh+=lastDayHebMonth(yy,m); for(m=0;m<mm;m++) dh+=lastDayHebMonth(yy,m); return dh;}
function HebrewFmFix(fdate,what){												if(what=="day") return fdate%7;
	var mm, dd, start, approx=Math.floor((fdate-epoch.Hebrew)*(98496/35975351)), yy=approx;
	while(fdate>=HebNewYear(++yy)); --yy; 										if(what=="year") return yy;
	start=(fdate<fixFmHebrew(yy,0,1))?6:0;
	for(mm=start; fdate>fixFmHebrew(yy,mm,lastDayHebMonth(yy,mm)); mm++);		if(what=="month") return mm;
	dd=fdate-fixFmHebrew(yy,mm,1)+1;											if(what=="date") return dd;}
// Bahai (Western)
function fixFmBahai(major,cycle,yy,mm,dd){var gyear=361*(major-1) + 19*(cycle-1) + yy-1+1844, fdate=fixFmGregorian(gyear,2,20)+dd;
	if(mm==0) fdate+=342; else if(mm==19) fdate+=GregorianLeapYear(gyear+1)?347:346; else fdate+=19*(mm-1); return fdate;}
function BahaiFmFix(fdate,what){										if(what=="day") return fdate%7;
	var gyear=GregorianFmFix(fdate,"year"); var years=gyear-1844-(fdate<=fixFmGregorian(gyear,2,20)?1:0);
	var major=Math.floor(years/361)+1;									if(what=="major") return major;
	var cycle=Math.floor((years%361)/19)+1;								if(what=="cycle") return cycle;
	var yy=years%19 + 1;												if(what=="year") return yy;
	var days=fdate-fixFmBahai(major,cycle,yy,1,1); var mm;
	if(fdate>=fixFmBahai(major,cycle,yy,19,1)) mm=19; else if(fdate>=fixFmBahai(major,cycle,yy,0,1)) mm=0;
	else mm=Math.floor(days/19)+1;										if(what=="month") return mm;
	var dd=fdate+1-fixFmBahai(major,cycle,yy,mm,1);						if(what=="date") return dd;}
// Tibetan
function tibetanLeapMonth(tyear,tmonth){return tmonth==TibetanFmFix(fixFmTibetan(true,false,tyear,tmonth,2),"month");}
function tibetanLeapDay(tyear,tmonth,tday){return tday==TibetanFmFix(fixFmTibetan(tibetanLeapMonth(tyear,tmonth),true,tyear,tmonth,tday),"date") || tday==TibetanFmFix(fixFmTibetan(false,true,tyear,tmonth,tday),"date");}
function tibsuneq(alpha){return Math.sin(Math.PI*alpha/6)*11/60;} function tibmooneq(alpha){return Math.sin(Math.PI*alpha/14)*25/60;}
function fixFmTibetan(leapmonth,leapday,yy,mm,dd){var months=Math.floor((yy-1)*(804/65)+(mm*67/65)+(64/65)-(leapmonth?1:0)); 
	var days=30*months+dd, mean=(days*11135/11312)+(1071/1616)-30-(leapday?0:1);
	var solaranomaly=((days*13/4824)+2117/4284)%1, lunaranomaly=((days*3781/105840)+2837/15120)%1;
	var sun = -tibsuneq(12*solaranomaly), moon = tibmooneq(28*lunaranomaly);
	return Math.floor(epoch.Tibetan+mean+sun+moon);}
function TibetanFmFix(fdate,what){																if(what=="day") return fdate%7;
	var bigY=365+4975/18382, year0=Math.ceil((fdate-epoch.Tibetan)/bigY), month0=1;
	while(fdate >= fixFmTibetan(false,false,++year0,1,1)); --year0;
	while(fdate >= fixFmTibetan(false,false,year0,++month0,1)); --month0;
	var day0=fdate-fixFmTibetan(false,false,year0,month0,1)-2;
	while(fdate >= fixFmTibetan(false,false,year0,month0,++day0)); --day0;
	var leapmonth=(day0>30);																	if(what=="leapmonth")return leapmonth;
	var dd=amod(day0,30);																		if(what=="date")return dd;
	var mm=month0; if(dd>day0)mm=month0-1; if(leapmonth)mm=month0+1; mm=amod(mm,12);			if(what=="month")return mm;
	var yy=year0; if(dd>day0 && month0==1)yy--; else if(leapmonth && month0==12)yy++;			if(what=="year")return yy;
	var leapday=(fdate==fixFmTibetan(leapmonth,true,yy,mm,dd));									if(what=="leapday")return leapday;}
// Mayan Long Count
function fixFmLongCount(baktun,katun,tun,uinal,kin){return epoch.Mayan+baktun*144000+katun*7200+tun*360+uinal*20+kin;}
function LongCountFmFix(fdate,what){
	var long_count = fdate-epoch.Mayan;		if(what=="day") return long_count; else if(what=="countdown")	return 2880000 - long_count;
	var baktun = Math.floor(long_count/144000);										if(what=="baktun")		return baktun;
	var day_of_baktun = long_count%144000,	katun = Math.floor(day_of_baktun/7200);	if(what=="katun")		return katun;
	var day_of_katun = day_of_baktun%7200,	tun = Math.floor(day_of_katun/360);		if(what=="tun")			return tun;
	var day_of_tun = day_of_katun%360, 		uinal = Math.floor(day_of_tun/20);		if(what=="uinal")		return uinal;
	var kin = day_of_tun%20;														if(what=="kin")			return kin;}
// Old Hindu Solar
var aryaSolarYear=365+149/576, aryaSolarMonth=aryaSolarYear/12;
function fixFmOldHinduSolar(y,m,d){return Math.ceil(epoch.Hindu+y*aryaSolarYear+m*aryaSolarMonth+d-5/4);}
function oldHinduSolarFmFix(fdate,what){							if(what=="day")return fdate%7; 
	var HinduDayCount=fdate-epoch.Hindu;							if(what=="countdown")return Math.round(432000*aryaSolarYear-HinduDayCount);
	var sun=HinduDayCount+6/24, y=Math.floor(sun/aryaSolarYear); 	if(what=="year")return y;
	var m=Math.floor(sun/aryaSolarMonth)%12; 						if(what=="month")return m;
	var d=Math.floor(sun%aryaSolarMonth)+1; 						if(what=="date")return d;}
// Balinese Pawukon
var eka=["Luang ",""],dwi=["Menga ","Pepet "],tri=["Pasah ","Beteng ","Kajeng "],catur=["Sri ","Laba ","Jaya ","Menala "],panca=["Umanis ","Paing ","Pon ","Wage ","Keliwan "];
var sad=["Tungleh ","Aryang ","Urukung ","Paniron ","Was ","Maulu "],sapta=["Redite ","Coma ","Anggara ","Buda ","Wraspati ","Sukra ","Saniscara "];
var asata=["Sri ","Indra ","Guru ","Yama ","Ludra ","Brahma ","Kala ","Uma "],sanga=["Dangu ","Jangur ","Gigis ","Nohan ","Ogan ","Erangan ","Urungan ","Tulus ","Dadi "];
var dasa=["Pandita","Pati","Suka","Duka","Sri","Manuh","Manusa","Raja","Dewa","Raksasa"], bpp=[5,9,7,4,8], bss=[5,4,3,7,8,6,9];
function fixFmBalinesePawukon(y,m,d){return y*210+d+epoch.Balinese} // Calendar fiction
function BalinesePawukonFmFix(fdate,what){							if(what=="month") return 0;
	var bdc=fdate-epoch.Balinese,d=bdc%210;							if(what=="date")return d; if(what=="year") return IntDiv(bdc,210);
	var triwara=d%3;												if(what=="triwara")		return tri[triwara];
	var pancawara=(d+6)%5;											if(what=="pancawara")	return panca[pancawara];
	var sadwara=d%6;												if(what=="sadwara")		return sad[sadwara];
	var saptawara=d%7;												if(what=="saptawara")	return sapta[saptawara]; if(what=="day") return saptawara;
	var dasawara=(bpp[pancawara]+bss[saptawara])%10;				if(what=="dasawara")	return dasa[dasawara];
	var dwiwara=dasawara%2;											if(what=="dwiwara")		return dwi[dwiwara];
	var ekawara=(1+dasawara)%2;										if(what=="luang")		return eka[ekawara];
	var sangawara=(Math.max(0,d-3))%9;								if(what=="sangawara")	return sanga[sangawara];
	var asatawara=(Math.max(6,4+(d-70)%210)+2)%8;					if(what=="asatawara")	return asata[asatawara];
	var caturwara=asatawara%4;										if(what=="caturwara")	return catur[caturwara];
	var d35=d%35,BaliDays=""; if(triwara==2 && pancawara==4)BaliDays+=nl+"Kajeng-Keliwon"; 
	if(d==13)BaliDays+=nl+"Tumpek Landep"; else if(d==48)BaliDays+=nl+"Tumpek Uduh"; else if(d==73)BaliDays+=nl+"Galungan"; else if(d==83)BaliDays+=nl+"Tumpek Kuningan";
	else if(d==118)BaliDays+=nl+"Tumpek Krulut"; else if(d==153)BaliDays+=nl+"Tumpek Kandang"; else if(d==188)BaliDays+=nl+"Tumpek Ringgit";
	if(d35==3)BaliDays+=nl+"Buda-Keliwon"; else if(d35==17)BaliDays+=nl+"Buda-Cemeng"; else if(d35==23)BaliDays+=nl+"Anggara Kasih"; else if(d35==28)BaliDays+=nl+"Pengembang";
	if(73<=d && d<=83)BaliDays+=nl+"<i>Galungan Days</i>"; 			if(what=="holidays")return BaliDays;}
//*************************************** Solar calculations adapted from http://www.srrb.noaa.gov/highlights/sunrise/calcdetails.html
var MEAN_TROPICAL_YEAR=365.242189, ms2century=1/(msd*MEAN_TROPICAL_YEAR*100), min2century=1/(144000*MEAN_TROPICAL_YEAR), MEAN_SYNODIC_MONTH=29.530588853;
var J2Knoon=new Date(2000,0,1); J2Knoon.setUTCHours(12); var J2Ktime=J2Knoon.getTime(), au2km=149597870.7; // astro "epoch", Astronomical Unit to km
function degree(R){return R*180.0/Math.PI;} function radian(D){return D*Math.PI/180.0;}
function cJulianCentury(aDate){return (aDate.getTime()-J2Ktime)*ms2century;}
function cGeomMeanLongSun(t){return amod(280.46646 + t*(36000.76983 + 0.0003032*t),360);} // degrees
function cGeomMeanAnomalySun(t){return 357.52911 + t*(35999.05029 - 0.0001537*t);} // degrees
function cEccentricityEarthOrbit(t){return 0.016708634 - t*(0.000042037 + 0.0000001267*t);} // unitless
function cSunEqOfCenter(t){var m=radian(cGeomMeanAnomalySun(t)); return Math.sin(m)*(1.914602-t*(0.004817+0.000014*t))+Math.sin(2*m)*(0.019993-0.000101*t)+Math.sin(3*m)*0.000289;} // degrees
function cSunTrueLong(t){return cGeomMeanLongSun(t) + cSunEqOfCenter(t);} // degrees
function cSunTrueAnomaly(t){return cGeomMeanAnomalySun(t) + cSunEqOfCenter(t);} // degrees
function cSunApparentLong(t){return cSunTrueLong(t)-0.00569 - 0.00478*Math.sin(radian(125.04 - 1934.136*t));} // degrees
function cMeanObliquityOfEcliptic(t){var seconds=21.448 - t*(46.8150 + t*(0.00059 - t*0.001813)); return 23 + (26 + (seconds/60))/60;}// degrees
function cObliquityCorrection(t){return cMeanObliquityOfEcliptic(t) + 0.00256*Math.cos(radian(125.04 - 1934.136*t));} // degrees
function cSunDeclination(t){return Math.asin(Math.sin(radian(cObliquityCorrection(t)))*Math.sin(radian(cSunApparentLong(t))));} // radians
function cSunRtAscension(t){var lam=radian(cSunApparentLong(t)),tanm=Math.cos(radian(cObliquityCorrection(t)))*Math.sin(lam); return Math.atan2(tanm,Math.cos(lam));} // radians
function cSunRadVector(t){var e=cEccentricityEarthOrbit(t); return (1.000001018*(1-e*e))/(1+e*Math.cos(radian(cSunTrueAnomaly(t))));} // AUs
function cEquationOfTime(t){var l0=radian(cGeomMeanLongSun(t)),e=cEccentricityEarthOrbit(t),m=radian(cGeomMeanAnomalySun(t)),y=Math.tan(radian(cObliquityCorrection(t))/2); y*=y;
	return 4*degree(y*Math.sin(2*l0) - 2*e*Math.sin(m)*(1+2*y*Math.cos(2*l0)) - 0.5*y*y*Math.sin(4*l0) - 1.25*e*e*Math.sin(2*m));} // minutes of time
function cHourAngle(dep,decl,w){return 4*degree(Math.acos(-Math.sin(radian(dep+w.ec))/(Math.cos(w.lat)*Math.cos(decl))-Math.tan(w.lat)*Math.tan(decl)));} // minutes of time
function getSolarTimes(aDate,aLocale){var a=(aDate)?aDate.clone():new Date(),w=aLocale||a.locale,tz=w.timezone,snoon,decl,ha4; a.setUTCHours(0); a.setUTCMinutes(0); 
	var t0=cJulianCentury(a), snoonUTC=720+tz; snoonUTC-=cEquationOfTime(t0+snoonUTC*min2century); decl=cSunDeclination(t0+snoonUTC*min2century); snoon=amod(snoonUTC-tz,1440); 
	ha4=cHourAngle(0.833,decl,w); if(typeof(ha4)!="number")ha4=360; return [snoon-ha4,snoon,snoon+ha4,decl];} //sunrise,noon,sunset (minutes from midnight), sun declination (radians, positive below horizon)
function getSolarMidnight(aDate,aLocale){var today=getSolarTimes(aDate,aLocale), tomorrow=getSolarTimes(aDate.from(1),aLocale); return amod((tomorrow[0]+today[2]-1440)/2,1440);}
//**************************************** geoLocale
function elevCorr(h){if(h<=0)return 0; return degree(Math.acos(Rearth/(Rearth+0.001*h)))+Math.sqrt(h)*19/3600;} // degrees, h in meters
function geoLocale(name,lat,lon,cc,alt,tz){this.name=name; this.altitude=0; this.ec=0; var la=0,lo=-tzo/4,c="W"; 
	if(typeof(lat)=="number") la=lat; else try{la=geoip_latitude(); } catch(e){} this.latitude =  la; this.lat=radian(la); // geoip in decimal degrees from MaxMind.com
	if(typeof(lon)=="number") lo=lon; else try{lo=geoip_longitude();} catch(e){} this.longitude = lo; this.lon=radian(lo); this.timezone=tz||Math.round(-lo*4);
	if(cc)c=cc; else try {c=geoip_country_code();} catch(e) {} this.country_code=c;
	if(typeof(alt)=="number"){this.altitude=alt; this.ec=elevCorr(alt);} else {var script=document.createElement('script'); script.type='text/javascript'; 
		script.src='http://open.mapquestapi.com/elevation/v1/getElevationProfile?callback='+this.name+'.handleEl&shapeFormat=raw&latLngCollection='+la+','+lo; 
		document.body.appendChild(script);}}
geoLocale.prototype.handleEl=function(resp){this.altitude=resp.elevationProfile[0].height; this.ec=elevCorr(this.altitude); if(deBug) alert(this.altitude);}
geoLocale.prototype.toString=function(){return this.name+","+this.latitude.toString()+","+this.longitude.toString()+","+this.country_code+","+this.altitude.toString()+","+this.timezone.toString();}
function qibla(which,wLocale){var focus,dist,angle=0,w=wLocale; if(which=="Islamic")focus=Mecca; else if(which=="Hebrew")focus=Jerusalem; else return "";
	var dlon=focus.lon-w.lon, denom=Math.cos(w.lat)*Math.tan(focus.lat)-Math.sin(w.lat)*Math.cos(dlon);
	if(denom!=0){var x=(denom<0)?2:1; angle=Math.round(degree(Math.atan2(Math.sin(dlon)/denom,x))%360);}
	dist=Math.round(Rearth*Math.SQRT2*Math.sqrt(1+Math.cos(w.lat)*Math.cos(focus.lat)*(1-Math.cos(dlon))-Math.cos(focus.lat-w.lat)));
	return nl+focus.name+" "+dist.toString()+" km, "+angle.toString()+"&deg; E";}
//********************************************** Calendar
var Sun=0,Mon=1,Tue=2,Wed=3,Thu=4,Fri=5,Sat=6; var burl=" target='win2' href='http://www.dogchurch.org/", blgurl=" target='win2' href='http://dogchurch.blogspot.com/";
var B="#0000FF",P="#800080",W="#FFFFFF",G="green",BK="#000000",S="#FF0000",GO="#F7C700",R="#DC143C",MR="#990033",DF="#990033"; //www.elca.org/dcm/worship/faq/worship_space/liturgical_colors.html
function Ordinal(n){var th="th",na=Math.abs(n),m=na%10;if(IntDiv(na,10)==1)th="th";else if(m==1)th="st";else if(m==2)th="nd";else if(m==3)th="rd";return (n+th+sp);}
function getEaster(gYear,kind){var shiftedEpact,paschalMoon=new Date(gYear,3,19),year19=gYear%19; // CC methods
	if((kind="Orthodox")||(kind="Julian")){var jYear=(gYear>0)?gYear:gYear-1; paschalMoon.set(jYear,3,19,"Julian"); shiftedEpact=(14+11*year19)%30;}
	else{var century=Math.floor(gYear/100)+1; shiftedEpact=(14+11*year19-Math.floor(0.75*century)+Math.floor((5+8*century)/25))%30;
		if(shiftedEpact==0||(shiftedEpact==1 && 10<year19)) ++shiftedEpact;}
	paschalMoon=paschalMoon.from(-shiftedEpact); return paschalMoon.from(1,Sun);}
function CalEvent(msg,bg,bdr,txt){this.msg=msg; this.bgcolor=bg||DF; this.bdrcolor=bdr||this.bgcolor; this.textcolor=txt||(this.bgcolor==W)?BK:W;}
CalEvent.prototype.toString=function(){return this.msg}
CalEvent.prototype.toHTML=function(){return "<div style='border:2px "+this.bdrcolor+";background-color:"+this.bgcolor+";color:"+this.textcolor+";'>"+this.msg+"</div>";}
function CalEventList(){} // a hash table of arrays
CalEventList.prototype.get=function(aDate){return this[aDate.get("month")+"/"+aDate.get("date")];}
CalEventList.prototype.set=function(mm,dd,msg,bg,bdr,txt){var p,key=mm+"/"+dd; if(!this[key])this[key]=[]; p=this[key].push(new CalEvent(msg,bg,bdr,txt));}
CalEventList.prototype.setd=function(aDate,msg,bg,bdr,txt){this.set(aDate.get("month"),aDate.get("date"),msg,bg,bdr,txt);}
CalEventList.prototype.toString=function(aDate){var m=this.get(aDate),msg="";if(m){for(var i=0,j=m.length;i<j;i++) msg+=m[i].toString()+((j-i>1)?nl:"");} return msg;}
CalEventList.prototype.toHTML=function(aDate)  {var m=this.get(aDate),msg="";if(m){for(var i=0;i<m.length;i++) msg+=m[i].toHTML();} return msg;}
function CalSeason(name,start,stop,bg,bdr,ord,pre,txt){this.name=name; this.start=Math.floor(fixFmDate(start)); this.stop=Math.floor(fixFmDate(stop)); this.nth=""; this.msg=""; 
	this.bgcolor=bg||DF; this.bdrcolor=bdr||this.bgcolor; this.textcolor=txt||(this.bgcolor==W)?BK:W; this.ord=(typeof(ord)=="number")?ord:7; this.prefix=pre||"";}
CalSeason.prototype.contains=function(aDate){var a,n=0,nn,ord,r=false,fd=Math.floor(aDate.get("fix")); 
	if((this.start<=fd)&&(fd<=this.stop)){nn=1+fd-this.start; ord=Math.abs(this.ord); r=true; 
		if(ord==1)n=Math.floor(nn);else if(ord>1){a=(this.prefix.indexOf("after")!=-1)?2:1;n=IntDiv(nn-a,ord)+1;} this.nth=Ordinal(n);} return r;}
CalSeason.prototype.toString=function(cmsg,theDayName){var smsg=""; if(!theDayName){smsg=this.name; if(this.ord==1)smsg+=": "+this.nth+"day";}
	else{var theSname=nl+this.prefix+this.name; if(cmsg.indexOf(this.name)!=-1) smsg=theDayName; else if(this.ord==1) smsg=theDayName+nl+this.nth+"day"+theSname;
		else if(this.ord==0) smsg=theDayName+theSname; else smsg=this.nth+theDayName+theSname;} return smsg;}
CalSeason.prototype.toHTML=function(cmsg,theDayName){var smsg=this.toString(cmsg,theDayName); if(!theDayName)return "<i>"+smsg+"</i>";
	return "<div style='text-align:center; border:5px "+this.bdrcolor+";background-color:"+this.bgcolor+";color:"+this.textcolor+";'>"+smsg+"</div>";}
function CalSeasonList(){} CalSeasonList.prototype = new Array();
CalSeasonList.prototype.set = function(name,start,stop,bg,bdr,ord,pre,txt){var p=this.push(new CalSeason(name,start,stop,bg,bdr,ord,pre,txt));}
CalSeasonList.prototype.get = function(qDate){var i,r=false; for(i=0;i<this.length;i++){if(this[i].contains(qDate)){if(!r)r=[]; p=r.push(this[i]);}} return r;}
function Calendar(inDate,inKind){ // sets for a year
	this.myDate = inDate||new Date(); this.kind=inKind||this.myDate.kind; this.Days=new CalEventList(); this.Season=new CalSeasonList(); 
	var theYear=this.myDate.get("year",this.kind), aDate=new Date(), bDate=new Date();
	switch (this.kind){
	case "Hebrew": var mlast=(HebrewLeapYear(theYear))?12:11; // with help from www.ou.org/chagim/default.htm
		this.Days.set(0,15,"1st Seder");
		this.Days.set(0,16,"2nd Seder"); aDate.set(theYear,0,27,"Hebrew"); var dd=(aDate.getDay()==Sun)?28:27;
		this.Days.set(0,dd,"<a target='win2' href='http://www.ushmm.org/'>Yom Ha-Shoah</a>");
		aDate.set(theYear,1,4,"Hebrew"); if(aDate.getDay()<=Wed) aDate=aDate.from(0,Wed);
		this.Days.setd(aDate,"Yom Ha-Zikaron (Israeli Memorial Day");
		this.Days.set(1,5,"Yom Ha-Atzmaut (Israeli Independence Day)");
		this.Days.set(1,18,"Lag B'Omer");
		this.Days.set(1,28,"Yom Yerushalayim (Jerusalem Day)");
		this.Days.set(2,6,"Shavu'ot (Israel & Diaspora)");
		this.Days.set(2,7,"Shavu'ot (Diaspora)");
		this.Days.set(3,17,"Asar B'Tammuz"); aDate.set(theYear,4,9,"Hebrew"); dd=(aDate.getDay()==Sat)?10:9; 
		this.Days.set(4,dd,"Tisha B'Av (Destruction of the Temple)");
		this.Days.set(4,15,"Tu B'Av");
		this.Days.set(6,1,"Rosh Ha-Shanah");
		this.Days.set(6,2,"Rosh Ha-Shanah");
		this.Days.set(6,3,"Tzom Gedaliah");
		this.Days.set(6,10,"Yom Kippur");
		this.Days.set(6,21,"Hoshana Rabba");
		this.Days.set(6,22,"Shemini Azeret"+nl+"Simchat Torah (Israel)");
		this.Days.set(6,23,"Simchat Torah (Diaspora)");
		this.Days.set(9,8,"Septuagint Translation of the Torah");
		this.Days.set(9,10,"Asarah B'Tevet");
		this.Days.set(10,15,"Tu B'Shevat"); aDate.set(theYear,mlast,14,"Hebrew"); dd=(aDate.getDay()==Sun)?10:13;
		this.Days.set(mlast,dd,"Fast of Esther");
		this.Days.set(mlast,14,"Purim");
		this.Days.set(mlast,15,"Shushan Purim"); var cYear=this.myDate.get("year","Coptic"); aDate.set(cYear,2,26,"Coptic"); aDate.kind="Hebrew";
		this.Days.setd(aDate,"Sh'ela (request for rain - Diaspora)");
		if(cYear%28==17){aDate.set(cYear,6,30,"Coptic"); aDate.kind="Hebrew"; this.Days.setd(aDate,"Birkath-hahama");}
		for(var i=0; i<=mlast; i++){this.Days.set(i,1,"Rosh Hodesh"); this.Days.set(i,30,"Rosh Hodesh");}
		aDate.set(theYear,0,15,"Hebrew"); bDate.set(theYear,0,21,"Hebrew");	this.Season.set("Pesah (Passover)",aDate,bDate);
		aDate.set(theYear,0,16,"Hebrew"); bDate=aDate.from(48);				this.Season.set("Sefirat Ha-Omer",aDate,bDate,DF,DF,1);
		aDate.set(theYear,6,1,"Hebrew");  bDate.set(theYear,6,10,"Hebrew");	this.Season.set("Days of Awe",aDate,bDate);
		aDate.set(theYear,6,16,"Hebrew"); bDate.set(theYear,6,21,"Hebrew");	this.Season.set("Sukkot",aDate,bDate);
		aDate.set(theYear,8,25,"Hebrew"); bDate=aDate.from(7);				this.Season.set("Hanukkah",aDate,bDate,DF,DF,1);
	break;
	case "Islamic":
		this.Days.set(0,1,"Islamic New Year");
		this.Days.set(0,10,"Ashura begins (Martyrdom of Husayn)");
		this.Days.set(2,12,"Mawlid al-Nabiy (Birth of the Prophet)");
		this.Days.set(6,27,"Lailat al-Miraj (Ascension of the Prophet)");
		this.Days.set(7,15,"Lailat al-Bara'a (Preparation for Ramadan)"); aDate.set(theYear,8,30,"Islamic"); aDate=aDate.from(-1,Fri,true);
		this.Days.setd(aDate,"Jum'at al-Wada"); // last Friday in Ramadan
		this.Days.set(8,27,"Lailat al-Qadr (Night of Power)");
		this.Days.set(9,1,"Eid al-Fitr (Ramadan ends)" + nl + "<i>Eid Mubarak</i>");	
		this.Days.set(11,9,"Day of Arafat");
		this.Days.set(11,10,"Eid al-Adha (Hajj ends)");
		aDate.set(theYear,0,10,"Islamic"); bDate.set(theYear,0,20,"Islamic");  this.Season.set("Ashura (Shia)",aDate,bDate);
		aDate.set(theYear,8,1,"Islamic");  bDate.set(theYear,8,30,"Islamic");  this.Season.set("Ramadan Mubarak",aDate,bDate);
		aDate.set(theYear,11,1,"Islamic"); bDate.set(theYear,11,10,"Islamic"); this.Season.set("Hajj",aDate,bDate);
	break;
	case "Bahai": var gYear=this.myDate.getFullYear(),major=this.myDate.get("major"),cycle=this.myDate.get("cycle"); // Western Version
		this.Days.set(0,4,"Holiday");
		this.Days.set(1,1,"Naw-Ruz (New Year)");
		this.Days.set(2,13,"Feast of Ridvan");		// Ridvan 1
		this.Days.set(3,2,"Holiday");				// Ridvan 9
		this.Days.set(3,5,"Holiday");				// Ridvan 12
		this.Days.set(4,7,"Declaration of the Bab");
		this.Days.set(4,7,"Birth of 'Abdu'l-Baha");
		this.Days.set(4,13,"Ascension of the Baha'u'llah");
		this.Days.set(6,16,"Martyrdom of the Bab");
		this.Days.set(12,5,"Birth of the Bab");
		this.Days.set(13,9,"Birth of the Baha'u'llah");
		this.Days.set(14,4,"Day of the Covenant"); 
		this.Days.set(14,6,"Ascension of 'Abdu'l-Baha");
		aDate.set(gYear,0,1,"Gregorian"); aDate=aDate.from(3,Sun); aDate.kind="Bahai";				this.Days.setd(aDate,"World Religion Day");
		aDate.set(gYear,5,1,"Gregorian"); aDate=aDate.from(2,Sun); aDate.kind="Bahai";				this.Days.setd(aDate,"Race Unity Day");
		for(var i=1;i<19;i++){this.Days.set(i,1,"Feast");}
		aDate.set(theYear,2,13,"Bahai",major,cycle); bDate.set(theYear,3,5,"Bahai",major,cycle);	this.Season.set("Ridvan",aDate,bDate,DF,DF,1);
		aDate.set(theYear,19,1,"Bahai",major,cycle); bDate.set(theYear,19,19,"Bahai",major,cycle);	this.Season.set("Fast",aDate,bDate);
	break;
	case "Tibetan": var leapmonth, leapday1, leapday2; // check leapmonth and leapday corrections
		this.Days.set(1,1,"Losar, Tibetan New Year");
		if(!tibetanLeapMonth(theYear,4)) {this.Days.set(4,7,"Vesak, Gautama Buddha's Birthday"); this.Days.set(4,15,"Gautama Buddha's Nivana");}
		if(!tibetanLeapMonth(theYear,6)) this.Days.set(6,4,"Turning of the Wheel of Dharma");
		if(!tibetanLeapMonth(theYear,9)) this.Days.set(9,2,"Buddha's Descent");
		if(!tibetanLeapMonth(theYear,1)) {leapday1=tibetanLeapDay(theYear,1,1); leapday2=tibetanLeapDay(theYear,1,15);
 			aDate.set(theYear,1,1,"Tibetan",false,leapday1); bDate.set(theYear,1,15,"Tibetan",false,leapday2);
 			this.Season.set("Celebration of the Miracles of the Buddha",aDate,bDate);}
	break;
	case "Zoroastrian": var gYear=this.myDate.getFullYear(); // Wikipedia, iranicaonline, heritageinstitute/zoroastrianism - should check with persiandna
		this.Days.set(0,1,"Nawruz (New Year)");
		this.Days.set(0,6,"Khordad Sal");
		this.Days.set(0,19,"Farwardigan");
		this.Days.set(1,3,"Jashan of Ardavisht");
		this.Days.set(2,6,"Jashan of Khordad");
		this.Days.set(3,13,"Tiregan");
		this.Days.set(4,7,"Jashan of Armurdad");
		this.Days.set(5,4,"Jashan of Shahrevar");
		this.Days.set(6,16,"Mehregan");
		this.Days.set(7,8,"Abanagan");
		this.Days.set(8,10,"Adargan");
		this.Days.set(9,1,"Jashan of Dadvah");
		this.Days.set(9,8,"Jashan of Dadvah");
		this.Days.set(9,11,"Zartosht No-Diso (Death of Zoroaster)");
		this.Days.set(9,15,"Jashan of Dadvah");
		this.Days.set(9,23,"Jashan of Dadvah");
		this.Days.set(10,2,"Jashan of Bahman");
		this.Days.set(10,10,"Sadeh");
		this.Days.set(11,5,"Jashan of Spendarmad");
		this.Days.set(12,5,"Pateti");
		aDate.set(gYear,11,21,"Gregorian"); aDate.kind="Zoroastrian"; this.Days.setd(aDate,"Yalda");
		aDate.set(gYear-1,11,31,"Gregorian");	bDate.set(gYear,0,4,"Gregorian");	this.Season.set("Maidyarem",aDate,bDate);
		aDate.set(gYear,2,16,"Gregorian");		bDate.set(gYear,2,20,"Gregorian");	this.Season.set("Hamaspathmaidyem",aDate,bDate);
		aDate.set(gYear,3,30,"Gregorian");		bDate.set(gYear,4,4,"Gregorian");	this.Season.set("Maidyozarem",aDate,bDate);
		aDate.set(gYear,5,29,"Gregorian");		bDate.set(gYear,6,3,"Gregorian");	this.Season.set("Maidyoshem",aDate,bDate);
		aDate.set(gYear,8,12,"Gregorian");		bDate.set(gYear,8,16,"Gregorian");	this.Season.set("Patishem",aDate,bDate);
		aDate.set(gYear,9,12,"Gregorian");		bDate.set(gYear,9,16,"Gregorian");	this.Season.set("Ayathrem",aDate,bDate);
	break;
	case "Hindu": // CC p 307, holidays will be off a day or so pending modern Lunisolar and Solar implementations. Months jiggered for solar year, which begins with 2nd lunar month
		this.Days.set(0,1,"Mesha Samkranti (New Year)");
		this.Days.set(0,15,"Birth of Buddha");
		aDate.set(theYear,3,15,"Hindu"); this.Days.setd(aDate.from(-1,Fri),"Varalakshmi Vratam");
		this.Days.set(3,23,"Janmashtami (Birth of Krishna)");
		this.Days.set(4,4,"Ganesha Chaturthi");
		this.Days.set(5,8,"Durga Ashtami");
		this.Days.set(5,9,"Sarasvati Puja");
		this.Days.set(5,10,"Dasra");
		this.Days.set(5,29,"Diwali");this.Days.set(5,30,"Diwali");this.Days.set(6,1,"Diwali");
		this.Days.set(6,15,"Kartikai Deepam");
		this.Days.set(7,11,"Vaikunta Ekadashi");
		this.Days.set(9,29,"Maha Shivarati");
		this.Days.set(10,15,"Holi");
		this.Days.set(11,9,"Rama Navami (Birth of Ram)");		
	break;
	case "Julian": case "Orthodox":
		this.Days.set(0,6,"The Theophany (Epiphany) of our Lord");
		this.Days.set(1,2,"The Presentation of our Lord");
		this.Days.set(2,25,"The Annunciation");
		this.Days.set(7,8,"The Transfiguration");
		this.Days.set(7,15,"The Repose of the Virgin Mary)");
		this.Days.set(8,8,"Nativity of the Virgin Mary");
		this.Days.set(8,14,"The Elevation of the Life-Giving Cross");
		this.Days.set(10,21,"The Presentation of the Virgin Mary in the Temple");
		this.Days.set(11,25,"Christmas");	
		var joEaster = getEaster(this.myDate.getFullYear(),"Orthodox"); joEaster.kind = "Julian";
		this.Days.setd(joEaster.from(-42),"Feast of Orthodoxy");
		this.Days.setd(joEaster.from(-7),"Palm Sunday");
		this.Days.setd(joEaster.from(-2),"<a"+burl+"scriptorium/cross.html'>Good Friday</a>");
		this.Days.setd(joEaster,"<a"+burl+"scriptorium/res.html'>Pascha (Easter)</a>");
		this.Days.setd(joEaster.from(39),"Ascension of our Lord");
		this.Days.setd(joEaster.from(49),"Pentecost");
		aDate.set(theYear,7,1,"Julian");  bDate.set(theYear,7,14,"Julian");		this.Season.set("Fast of the Repose of the Virgin Mary",aDate,bDate);
		aDate.set(theYear,11,5,"Julian"); bDate.set(theYear,11,24,"Julian");	this.Season.set("Fast of Christmas",aDate,bDate);
		aDate=joEaster.from(-48);		  bDate=joEaster.from(-8);				this.Season.set("Quadragesima (Lent)",aDate,bDate);
		aDate=joEaster.from(57);		  bDate.set(theYear,5,28,"Julian");		this.Season.set("Fast of the Apostles",aDate,bDate);
	break;
	case "Coptic": var CopticEaster = getEaster(this.myDate.getFullYear(),"Orthodox"); CopticEaster.kind = "Coptic";
		this.Days.setd(CopticEaster,"Easter");
		this.Days.set(0,17,"Building of the Cross");
		this.Days.set(3,29,"Christmas");
		this.Days.set(4,6,"Jesus's Circumcision");
		this.Days.set(4,11,"Epiphany");
		this.Days.set(6,29,"Mary's Announcement");
		this.Days.set(11,13,"Jesus's Transfiguration");
	break;
	case "Lutheran": // Days from Lutheran Book of Worship and http://www.smart.net/~mmontes/ec-cal.html
		this.Days.set(0,1,"The Holy Name (Christ's Briss)",W);
		this.Days.set(0,2,"Johann Konrad Wilhelm Loehe, pastor, 1872",W);
		this.Days.set(0,5,"Kaj Munk, martyr, 1944",R);
		this.Days.set(0,6,"The Epiphany of Christ",W);
		this.Days.set(0,13,"George Fox, Renewer of Society, 1691",W);
		this.Days.set(0,14,"Elvind, Josef Berggrav, Bishop of Oslo, 1959",W)
		this.Days.set(0,15,"<a"+burl+"scriptorium/king.html'>Martin Luther King, Jr.</a>, Renewer of Society, martyr, 1968",R);
		this.Days.set(0,18,"Confession of St. Peter"+nl+"<i>Week of Prayer for Christian Unity begins</i>",W);
		this.Days.set(0,19,"Henry, Bishop of Uppsala, missionary to Finland, martyr 1156",R);
		this.Days.set(0,25,"Conversion of St. Paul"+nl+"<i>Week of Prayer for Christian Unity Ends</i>",W);
		this.Days.set(0,26,"Timothy, Titus and Silas",W);
		this.Days.set(0,27,"Lydia, Dorcas and Phoebe",W);
		this.Days.setd((new Date(theYear,0,6)).from(1,Sun),"Christ's Baptism",W); // 1st Sunday after Epiphany
		this.Days.set(1,2,"Candlemas (Presentation of Christ in the Temple)",W);
		this.Days.set(1,3,"Angsar, Archbishop of Hamburg,"+nl+" missionary to Denmark & Sweden, 865",W);
		this.Days.set(1,5,"The Martyrs of Japan, 1597",R);
		this.Days.set(1,14,"Cyril, monk, 869"+nl+"Methodius, bishop, 885"+nl+"missionaries to the Slavs",W)
		this.Days.set(1,18,"Martin Luther, Renewer of the Church, 1546",W);
		this.Days.set(1,20,"Rasmus Jensen, first Lutheran pastor in North America, 1620",W);
		this.Days.set(1,23,"Bartolomaeus Ziegenbalg, missionary to India, 1719",W);
		this.Days.set(1,23,"Polycarp, Bishop of Smyrna, martyr, 156",R);
		this.Days.set(1,24,"St. Matthias, Apostle",R);
		this.Days.set(1,25,"Elizabeth Fedde, deaconess,1921",W);
		this.Days.set(2,1,"George Herbert, priest, 1633",W);	
		this.Days.set(2,2,"John Wesley, 1791"+nl+"Charles Wesley, 1788"+nl+"Renewers of the Church",W);
		this.Days.set(2,7,"Thomas Acquinas, teacher, 1274",W);
		this.Days.set(2,7,"Perpetua and her companions, martyrs at Carthage, 202",R);
		this.Days.set(2,12,"Gregory the Great, Bishop of Rome, 604",W);
		this.Days.set(2,17,"St. Patrick, Bishop and missionary to Ireland, 461",W);
		this.Days.set(2,19,"Joseph, husband of Mary",W);
		this.Days.set(2,22,"Jonathan Edwards, missionary to the Native Americans, 1758",W);
		this.Days.set(2,25,"Annunciation to Mary",W);
		this.Days.set(2,29,"Hans Nielsen Hauge, renewer of the Church, 1824",W);
		this.Days.set(2,31,"John Donne, poet and priest,1631",W);	
		this.Days.set(3,6,"Albrecht Dürer, painter 1528"+nl+"Michelangelo Buonarroti, artist, 1564",W);
		this.Days.set(3,9,"Dietrich Bonhoeffer, teacher, martyr, 1945",R);
		this.Days.set(3,10,"Mikael Agricola, Bishop of Turku, 1557",W);
		this.Days.set(3,19,"Olavus Petri, priest 1552"+nl+"Laurentius Petri, Archbishop of Uppsala, 1573"+nl+"renewers of the Church",W);
		this.Days.set(3,21,"Anselm, Archbishop of Canterbury, 1109",W);
		this.Days.set(3,23,"Toyohiko Kagawa, renewer of society, 1960",W);
		this.Days.set(3,25,"St. Mark, Evangelist",R);
		this.Days.set(3,29,"Catherine of Siena, teacher, 1380",W);		
		this.Days.set(4,1,"St. Philip and St. James, Apostles",R);
		this.Days.set(4,2,"Athanasius, Bishop of Alexandria, 373",W);
		this.Days.set(4,4,"Monica, mother of Augustine, 387",W);
		this.Days.set(4,18,"Erik, King of Sweden, martyr, 1160",R);
		this.Days.set(4,19,"Dunstan, Archbishop of Canturbury, 988",W);
		this.Days.set(4,21,"John Eliot, missionary to the Native Americans, 1690",W);
		this.Days.set(4,23,"Ludwig Nommensen, missionary to Sumatra, 1918",W);
		this.Days.set(4,24,"Nicolaus Copernicus, 1543"+nl+"Leonhard Euler, 1783"+nl+"teachers",W);
		this.Days.set(4,27,"John Calvin, Renewer of the Church 1564",W);
		this.Days.set(4,29,"Jiri Tranovsky, hymnwriter, 1637",W);
		this.Days.set(4,31,"The Visitation of Mary to Elizabeth",W);	
		this.Days.set(5,1,"Justin, martyr at Rome, c. 165",R);
		this.Days.set(5,3,"John XXIII, Bishop of Rome, 1963",W);
		this.Days.set(5,5,"Boniface, Archbishop of Mainz, missionary to Germany, martyr, 754",R);
		this.Days.set(5,7,"Seattle, Chief of the Duwamish Confederacy, 1866",W);
		this.Days.set(5,9,"Columba, 597; Aidan, 651; Bede, 735"+nl+"confessors",W);
		this.Days.set(5,11,"St. Barnabas, Apostle",W);
		this.Days.set(5,14,"Basil the Great, Bishop of Caesarea, 379",W);
		this.Days.set(5,14,"Gregory of Nazianzus, Bishop of Constantinople, c. 389",W);
		this.Days.set(5,14,"Gregory, Bishop of Nyssa, c. 385",W);
		this.Days.set(5,21,"Onesimos Nesib, translator, evangelist, 1931",W);
		this.Days.set(5,24,"Nativity of St. John the Baptist",W);
		this.Days.set(5,25,"Presentation of the Augsburg Confession, 1530",W);
		this.Days.set(5,25,"Philip Melancthon, Renewer of the Church, 1560",W);
		this.Days.set(5,28,"Irenaeus, Bishop of Lyons, c. 202",W);
		this.Days.set(5,29,"St. Peter and St. Paul, Apostles",R);
		this.Days.set(5,30,"Johan Olof Wallin, Archbishop of Uppsala, hymnwriter, 1839",W);		
		this.Days.set(6,1,"Catherine Winkworth, 1878; Mason Neale, 1866, hymnwriters",W);
		this.Days.set(6,6,"Jan Hus, martyr, 1415",R);
		this.Days.set(6,11,"Benedict of Nursia, Abbot of Monte Cassino, c. 540",W);
		this.Days.set(6,12,"Nathan Soederblom, Archbishop of Uppsala, 1931",W);
		this.Days.set(6,15,"Vladimir, first Christian ruler of Russia, 1015",W);
		this.Days.set(6,17,"Bartholome de Las Casas, missionary to the West Indies, 1566",W);
		this.Days.set(6,22,"St. Mary Magdalene",W);
		this.Days.set(6,23,"Birgitta of Sweden, 1373",W);
		this.Days.set(6,25,"St. James the Elder, Apostle",R);
		this.Days.set(6,28,"Johann Sebastian Bach, 1750"+nl+"Heinrich Schuetz, 1672"+nl+"Georg Friedrich Handel, 1759"+nl+"composers",W);
		this.Days.set(6,29,"Olaf, King of Norway, martyr, 1030",R);
		this.Days.set(6,29,"Mary, Martha and Lazarus of Bethany",W);		
		this.Days.set(7,10,"Lawrence, deacon, martyr, 258",R);
		this.Days.set(7,13,"Florence Nightingale, 1910; Clara Maass, 1901"+nl+"renewers of society",W);
		this.Days.set(7,15,"Assumption of Mary, Mother of Christ",W);
		this.Days.set(7,20,"Bernard, Abbot of Clairvaux, 1153",W);
		this.Days.set(7,24,"St. Bartholomew, Apostle",R);
		this.Days.set(7,28,"St. Augustine, Bishop of Hippo, 430",W);
		this.Days.set(7,31,"John Bunyan, teacher, 1688",W);
		this.Days.set(8,2,"Nikolai Frederik Severin Grundtvig, bishop, renewer of the Church, 1872",W);
		this.Days.set(8,4,"Albert Schweitzer, missionary to Africa, 1965",W);	
		this.Days.set(8,13,"John Chrysotom, Bishop of Constantinople, 407",W);
		this.Days.set(8,14,"The Holy Cross",R);
		this.Days.set(8,21,"St. Matthew, Apostle and Evangelist",R);
		this.Days.set(8,25,"Sergius of Radonezh, Abbot of the Holy Trinity, Moscow, 1392",W);
		this.Days.set(8,29,"Mass of St. Michael and all Angels",W);
		this.Days.set(8,30,"Jerome, translator, teacher, 420",W);	
		this.Days.set(9,4,"St. Francis of Assisi, renewer of the Church, 1226",W);
		this.Days.set(9,4,"Teodor Fliedner, renewer of society, 1864",W);
		this.Days.set(9,6,"William Tyndale, translator of the Bible into English, martyr, 1536",R);
		this.Days.set(9,7,"Henry Melchior Muhlenberg, missionary to America, 1787",W);
		this.Days.set(9,17,"Ignatius, Bishop of Antioch, martyr, c. 115",R);
		this.Days.set(9,18,"St. Luke, Evangelist",R);
		this.Days.set(9,23,"James of Jerusalem, martyr",R);
		this.Days.set(9,26,"Philipp Nicolai, 1608; Johann Heermanhn, 1647; Paul Gerhardt, 1676; hymnwriters",W);
		this.Days.set(9,28,"St. Simon and St. Jude, Apostles",R);
		this.Days.set(9,31,"Reformation Day",R);		
		this.Days.set(10,1,"All Saints' Day",W);
		this.Days.set(10,2,"All Souls' Day",W);
		this.Days.set(10,7,"John Christian Frederick Heyer, missionary to India, 1873",W);
		this.Days.set(10,11,"Martin, Bishop of Tours, 397",W);
		this.Days.set(10,11,"Soren Aabye Kierkegaard, teacher, 1855",W);
		this.Days.set(10,17,"Elizabeth of Thuringia, Princess of Hungary, 1231",W);
		this.Days.set(10,23,"Clement, Bishop of Rome, c. 100",W);
		this.Days.set(10,25,"Isaac Watts, hymnwriter, 1748",W);
		this.Days.set(10,30,"St. Andrew, Apostle",R);
		this.Days.setd((new Date(theYear,10,20)).from(1,Sun),"Christ the King Sunday",W); // 1st Sunday after Nov. 20 (last Sunday after Pentecost)		
		this.Days.set(11,3,"Francis Xavier, missionary to Asia, 1552",W);
		this.Days.set(11,6,"Nicholas, Bishop of Myra, c. 342",W);
		this.Days.set(11,7,"Ambrose, Bishop of Milan, 397",W);
		this.Days.set(11,8,"The Immaculate Conception",W);
		this.Days.set(11,11,"Lars Olsen Skefsrud, missionary to India, 1910",W);
		this.Days.set(11,12,"Our Lady of Guadalupe",W);
		this.Days.set(11,14,"John of the Cross, renewer of the Church, 1591",W)
		this.Days.set(11,14,"Teresa of Avila, renewer of the Church, 1582",W);
		this.Days.set(11,21,"St. Thomas, Apostle",R);
		this.Days.set(11,24,"<a"+blgurl+"2008/12/just-this-baby.html'>Christmas Eve</a>",W);
		this.Days.set(11,25,"Christmas (Birth of Christ)",W);
		this.Days.set(11,26,"St. Stephen, Deacon and martyr",R);
		this.Days.set(11,27,"St. John, Apostle and Evangelist",W);
		this.Days.set(11,28,"The Holy Innocents, martyrs (Childermas)",R,R);		
		var Easter = getEaster(theYear); //	Moveable feasts of the Western Church
		this.Days.setd(Easter.from(-49),"Transfiguration of Christ",W);
		this.Days.setd(Easter.from(-47),"Shrove Tuesday (Mardi Gras, Fasching)");
		this.Days.setd(Easter.from(-46),"Ash Wednesday",BK,P);
		this.Days.setd(Easter.from(-14),"Passion Sunday",S,P);
		this.Days.setd(Easter.from(-7),"Palm Sunday",S,P);
		this.Days.setd(Easter.from(-3),"<a"+burl+"scriptorium/KillingChrist.htm#parting'>Maundy Thursday (The Last Supper)</a>",S,W);
		this.Days.setd(Easter.from(-2),"<a"+burl+"scriptorium/cross.html'>Good Friday (Christ's Crucifixion)</a>",BK);
		this.Days.setd(Easter.from(-1),"Vigil of Easter",W);
		this.Days.setd(Easter,"<a"+burl+"scriptorium/res.html'>Easter (Christ's Resurrection)</a>",W,GO,GO);
		this.Days.setd(Easter.from(35),"Rogation Sunday",W);
		this.Days.setd(Easter.from(39),"Ascension of Christ",W);
		this.Days.setd(Easter.from(42),"Sunday after the Ascension",W)
		this.Days.setd(Easter.from(48),"Vigil of Pentecost",R);
		this.Days.setd(Easter.from(49),"Pentecost (Whitsunday)",R);
		this.Days.setd(Easter.from(56),"Holy Trinity Sunday",W);
		this.Days.setd(Easter.from(60),"Corpus Christi",W);	 
		this.Season.set("Christmas",new Date(theYear-1,11,25),new Date(theYear,0,5),W,W,1,"of "); // Seasons from http://www.elca.org/co/faq/chyear.html
		this.Season.set("Epiphany",new Date(theYear,0,6),Easter.from(-47),G,G,7,"after the ");
		this.Season.set("Lent",Easter.from(-46),Easter.from(-7),P,P,7,"in ");
		this.Season.set("Holy Week",Easter.from(-7),Easter.from(-1),S,P,0,"of ");
		this.Season.set("Easter",Easter.from(-1),Easter.from(48),W,W,7,"in ");
		var adventDate=new Date(theYear,10,27); adventDate=adventDate.from(1,Sun); // 1st Sunday after Nov. 27
		this.Season.set("Pentecost",Easter.from(49),adventDate.from(-1),G,G,7,"after ");
		this.Season.set("Advent",adventDate,new Date(theYear,11,24),B,P,7,"in ");
		this.Season.set("Christmas",new Date(theYear,11,25),new Date(theYear+1,0,5),W,W,1,"of ");
		this.Season.set("Ordinary Time",new Date(theYear,0,1),new Date(theYear,11,31),G,G,0,"in ");
	break;
	case "Long Count": case "Quaker": case "Friends": case "Balinese": break;		
	default: // Western Semi-Secular
		this.Days.set(0,1,"<a"+burl+"scriptorium/icecrystals.html'>New Year's Day</a>");
		this.Days.set(0,2,"Fall of Granada, 1492");
		this.Days.set(0,5,"Twelfth Night");
		if(theYear%4==1 && theYear>1936) this.Days.set(0,20,"Inauguration Day (US)");
		this.Days.set(0,27,"Liberation of Auschwitz, 1945");
		this.Days.setd((new Date(theYear,0,1)).from(3,Mon,true),"<a"+burl+"scriptorium/king.html'>Martin Luther King, Jr.'s</a> Birthday (observed)");  // 3rd Monday in January
		this.Days.set(1,2,"Ground Hog Day");
		this.Days.set(1,12,"Abraham Lincoln's Birthday");
		this.Days.set(1,14,"St. Valentine's Day");
		this.Days.set(1,19,"Internment of Japanese Americans, WWII");
		this.Days.set(1,22,"George Washington's Birthday");
		if(GregorianLeapYear(theYear)) this.Days.set(1,24,"Leap Day");
		this.Days.setd((new Date(theYear,1,1)).from(3,Mon,true),"President's Day"); // 3rd Monday in February
		this.Days.set(2,17,"St. Patrick, Bishop and missionary to Ireland, 461",W);
		this.Days.set(2,17,"<a target='win2' href='http://www.lambda.net/~maximum/rustin.html'>Bayard Rustin</a>, Renewer of Society, 1912",W);
		this.Days.set(2,20,"Vernal Equinox");
		this.Days.setd((new Date(theYear,2,1)).from(2,Sun,true),"Daylight Saving Time Begins"); // 2nd Sunday in March, 2005 Fed Eng Policy Act	
		this.Days.set(3,1,"April Fool's Day"); this.Days.set(3,1,"VCBC's Day to be Amazed that Anything Exists");
		var aDate=new Date(theYear,3,15); var taxday=aDate.getDay(); if(taxday==Sat||taxday==Sun) aDate=aDate.from(1,Tue);
		this.Days.setd(aDate,"Tax Day (US)"); // Apr 15 on a weekday, 1st Tue after if not
		this.Days.set(3,22,"Earth Day"); aDate=new Date(theYear,3,30); bDate=aDate.from(-1,Sat,true); // last Saturday in April
		this.Days.setd(bDate.from(-3),"Administrative Professional's Day"); // Wednesday before the last Saturday in April
		this.Days.setd(aDate.from(-1,Fri,true),"Arbor Day"); // last Friday in April
		this.Days.set(4,5,"Cinco de Mayo (Latin America)");
		this.Days.set(4,8,"German Surrender Ends WWII in Europe, 1945");
		this.Days.set(4,14,"Israel Independence Day, 1948 (Gregorian)");
		this.Days.set(4,19,"Malcolm X, renewer of society, <i>shahid</i> (martyr)");
		this.Days.set(4,30,"Memorial Day (traditional)"); aDate = new Date(theYear,4,1); bDate=aDate.from(1,Thu,true); if(bDate.getDate()==5) bDate=bDate.from(1);
		this.Days.setd(bDate,"<a target='win2' href='http://www.nationaldayofprayer.org/'>National Day of Prayer (US)</a>"); // 1st Thu in May not May 5
		this.Days.setd(aDate.from(2,Sun,true),"Mother's Day"); // 2nd Sunday in May
		this.Days.setd(aDate.from(3,Sat,true),"Armed Forces Day"); bDate=new Date(theYear,4,31); // 3rd Saturday in May
		this.Days.setd(bDate.from(-1,Mon,true),"Memorial Day (observed)"); // last Monday in May
		this.Days.set(5,6,"WWII D-Day Invasion of Europe, 1944");		
		this.Days.set(5,14,"Flag Day (US)");
		this.Days.set(5,16,"Soweto Uprising (South Africa)");		
		this.Days.set(5,19,"Juneteenth (Emancipation Day, Texas)");
		this.Days.set(5,21,"Summer Solstice, Neanderthal Heritage Day (VCBC)");
		this.Days.set(5,27,"Stonewall Rebellion, 1969"); aDate=new Date(theYear,5,1);
		this.Days.setd(aDate.from(3,Sun,true),"Father's Day"); // 3rd Sunday in June
		this.Days.set(6,4,"Independence Day (US)");
		this.Days.set(6,4,"<a"+burl+"chapel/pulpit/sermon.html'>VCBC debuts, 1996</a>");
		this.Days.set(6,14,"Bastille Day (France)");
		this.Days.set(6,16,"Trinity Event, first human-initiated nuclear explosion, 1945");
		this.Days.set(6,24,"Pioneer Day (LDS)");
		this.Days.setd((new Date(theYear,6,1)).from(4,Sun,true),"Parent's Day"); // 4th Sunday in July
		this.Days.set(7,6,"US Atomic Bombing of <a"+blgurl+"/2005/08/hiroshima-remembered.html'>Hiroshima</a>, 1945");
		this.Days.set(7,9,"US Atomic Bombing of <a"+blgurl+"/2005/08/hiroshima-remembered.html'>Nagasaki</a>, 1945");
		this.Days.set(7,10,"Destruction of the Second Temple (Gregorian Calendar) A.D. 70");
		this.Days.set(7,15,"Japanese Surrender Ends WWII, 1945");
		this.Days.set(7,20,"Muhammad's (pbuh) Birthday (Gregorian)"); aDate=(new Date(theYear,8,1)).from(1,Mon,true); // 1st Monday in September
		this.Days.setd(aDate,"Labor Day");
		this.Days.setd(aDate.from(6),"Grandparent's Day"); // 1st Sunday after Labor Day
		this.Days.set(8,11,"<a"+burl+"scriptorium/wtc1.html'>Jihadi Takfiris attack the US, 2001</a>");
		this.Days.set(8,11,"Battle to break Ottoman siege of Vienna Begins, 1683");
		this.Days.set(8,12,"Ottomans lose Battle of Vienna, 1683");
		this.Days.set(8,23,"Autumnal Equinox");
		this.Days.set(9,12,"Columbus Day (traditional)");
		this.Days.setd((new Date(theYear,9,1)).from(2,Mon,true),"Columbus Day (observed)"); // 2nd Monday in October
		this.Days.set(9,29,"Ottomans quit Siege of Vienna, 1529");
		this.Days.set(9,24,"United Nations Day");
		this.Days.set(9,29,"Turkish Republic succeeds Ottoman Empire, 1923");
		this.Days.set(9,31,"Halloween");
		this.Days.set(10,1,"Dia de los Inocentes (Latin America)");
		this.Days.set(10,2,"Dia de los Muertos (Latin America)");
		this.Days.setd((new Date(theYear,10,2)).from(1,Tue,true),"Election Day (US)"); // 1st Tuesday on or after Nov 2
		this.Days.set(10,5,"Guy Fawkes Day (UK)");
		this.Days.set(10,11,"Veteran's Day"); aDate=new Date(theYear,10,1);
		this.Days.setd(aDate.from(1,Sun,true),"Daylight Savings Time Ends"); // First Sunday in November
		this.Days.setd(aDate.from(4,Thu,true),"<a"+burl+"narthex/aovertheriver.html'>Thanksgiving Day (US)</a>"); // 4th Thursday in November
		this.Days.set(11,7,"Japan bombs Pearl Harbor, 1941");
		this.Days.set(11,8,"Buddha's Enlightenment (Japan)");
		this.Days.set(11,22,"Winter Solstice");
		this.Days.set(11,24,"Christmas Eve",W);
		this.Days.set(11,25,"Christmas (Birth of Christ)",W);
		this.Days.set(11,26,"Kwanzaa Begins");
		this.Days.set(11,26,"Boxing Day (Canada)");
		this.Days.set(11,31,"<a"+burl+"narthex/auldlangsyne.html'>New Year's Eve</a>"); var gYear=this.myDate.getFullYear();
		var Easter = getEaster(gYear); var oEaster = getEaster(gYear,"Orthodox"); oEaster.kind="Gregorian";
		this.Days.setd(Easter.from(-47),"Shrove Tuesday (Mardi Gras, Fasching)");
		this.Days.setd(Easter.from(-3),"<a"+burl+"scriptorium/KillingChrist.htm#parting'>Maundy Thursday (The Last Supper)</a>",S,W);
		this.Days.setd(Easter.from(-2),"<a"+burl+"scriptorium/cross.html'>Good Friday (Christ's Crucifixion)</a>",BK);
		this.Days.setd(oEaster,"<a"+burl+"scriptorium/res.html'>Easter (Orthodox)</a>",W,GO);
		this.Days.setd(Easter,"<a"+burl+"scriptorium/res.html'>Easter (Christ's Resurrection)</a>",W,GO);
		this.Days.setd(Easter.from(1),"Easter Monday");
		var snames; if(this.myDate.locale.latitude>=0) snames=["Winter","Spring","Summer","Autumn","Winter"]; else snames=["Summer","Autumn","Winter","Spring","Summer"];
		this.Season.set(snames[0],new Date(theYear-1,11,22),new Date(theYear,2,19),W,W);
		this.Season.set(snames[1],new Date(theYear,2,20),new Date(theYear,5,20),W,W);
		this.Season.set(snames[2],new Date(theYear,5,21),new Date(theYear,8,22),W,W);
		this.Season.set(snames[3],new Date(theYear,8,23),new Date(theYear,11,21),W,W);
		this.Season.set(snames[4],new Date(theYear,11,22),new Date(theYear+1,2,20),W,W);
		this.Season.set("<a"+burl+"chapel/pulpit/easter.html'>Happy Easter!</a>",Easter,Easter.from(7));
		this.Season.set("Merry Christmas from <a"+burl+"chapel/pulpit/xmas.html'>us</a> and our <a"+burl+"restroom/lawyerxmas.html'>lawyers</a>!",new Date(theYear,11,1),new Date(theYear,11,31));}}
Calendar.prototype.getEvents = function(aDate,aType){return (aType=="text")?this.Days.toString(aDate):this.Days.toHTML(aDate);}
Calendar.prototype.getSeasons = function(qDate){return this.Season.get(qDate);}
//********************************************** Clock
function ClkTime(name,start,stop,comment){this.start=start; this.stop=stop; this.HTM=dlert(comment,name); this.STR=name+sp+"("+comment+")";} // start,stop in minutes from midnight
ClkTime.prototype.startString=function(hrs){var hs=hrs||12,h=IntDiv(this.start,60), m=Math.floor(this.start-h*60), mp=(m<10)?":0":":";
	if(hs<24){var h12=amod(h,12); return ((h12<10)?sp:"")+h12.toString()+mp+m.toString()+((h<12)?" a.m.":" p.m.");} return ((h<10)?"0":"")+h.toString()+mp+m.toString();}
ClkTime.prototype.contains=function(aDate){var t=aDate.get("minutes"),a=this.start,b=this.stop; return ((a<=t)&&(t<b))||((a>b)&&((a<=t)||(t<b)));}
ClkTime.prototype.toString=function(hD){var msg=""; if(hD instanceof Date){if(this.contains(hD)) msg=this.STR+"\n";} else {msg=this.startString(hD)+"\t"+this.STR+"\n";} return msg;}
ClkTime.prototype.toHTML=function(hD){var msg=""; if(hD instanceof Date){if(this.contains(hD)) msg=this.HTM+nl;}
	else {msg="<tr><td align='right'>"+this.startString(hD)+" </td><td align='left'>"+this.HTM+"</td></tr>";} return msg;}
function ClkTimeList(){} ClkTimeList.prototype = new Array();
ClkTimeList.prototype.set=function(name,start,stop,comment){if(start != stop) var p=this.push(new ClkTime(name,start,stop,comment));}
ClkTimeList.prototype.toString=function(hD){var i,p,msg="",d=(hD instanceof Date); for(i=0;i<this.length;i++){p=this[i].toString(hD); msg+=p; if(p && d)break;} return msg;}
ClkTimeList.prototype.toHTML=function(hD)  {var i,p,msg="",d=(hD instanceof Date); for(i=0;i<this.length;i++){p=this[i].toHTML(hD);   msg+=p; if(p && d)break;} 
	return (d)?msg:"<div align='center'><table style='font-size: 11px;'>"+msg+"</table></div>";}
function Clock(inDate,inKind){ // sets for a day
	this.myDate=inDate||new Date(); this.kind=inKind||this.myDate.kind; this.Times=new ClkTimeList();
	var tray = getSolarTimes(this.myDate); var sunrise=tray[0], noon=tray[1], sunset=tray[2], decl=tray[3], w=this.myDate.locale;
	switch(this.kind){
	case "Hebrew": // adapted from chabad.org
		var dawn=noon-cHourAngle(16,decl,w), earliest_tefillah=noon-cHourAngle(11,decl,w), dusk=noon+cHourAngle(4.66,decl,w), nightfall=noon+cHourAngle(7.083,decl,w);
		var shabbat_end=noon+cHourAngle(8,decl,w), midnight=getSolarMidnight(this.myDate), jhour=(sunset-sunrise)/12, j20=jhour/3;
		var today=this.myDate.getDay(), candle=sunset-((today==Fri)?j20:0), shabbat_plus=shabbat_end+((today==Sat)?j20:0);
		this.Times.set("Alot Hashachar",dawn,earliest_tefillah,"Dawn, time to recite the Shema");
		this.Times.set("Earliest Tefillah",earliest_tefillah,sunrise,"Morning Prayer");
		this.Times.set("Netz Hachamah",sunrise,sunrise+3*jhour,"Morning");
		this.Times.set("Latest Shema",sunrise+3*jhour,sunrise+4*jhour,"Latest time to recite the Shema");
		this.Times.set("Latest Tefillah",sunrise+4*jhour,noon,"Latest time for Morning Prayer");
		this.Times.set("Chatzot",noon,noon+0.5*jhour,"Mid-day");
		this.Times.set("Minchah Gedolah",noon+0.5*jhour,noon+3.5*jhour,"Earliest Afternoon Prayer");
		this.Times.set("Minchah Ketanah",noon+3.5*jhour,sunset-1.25*jhour,"Latest Afternoon Prayer");
		this.Times.set("Plag Haminchah",sunset-1.25*jhour,candle,"Maariv (evening) Service");
		this.Times.set("Candle Lighting",candle,sunset,"Traditionally done by the leading woman of the household");
		this.Times.set("Shkiah",sunset,dusk,"Sunset");	
		this.Times.set("Tzeit Hakochovim",nightfall,shabbat_end,"Nightfall");
		this.Times.set("Shabbat Ends",shabbat_end,shabbat_plus,"The Sabbath ends slightly after nightfall");
		this.Times.set("Chatzot",midnight,midnight+j20,"Midnight");
	break;
	case "Islamic": // adapted from islamicfinder.org
		var c=w.country_code, la=w.latitude, lo=w.longitude, faj, ish; // fajr,isha solar depressions in degrees
		if(c=="US"||c=="CA"||c=="UK") {faj=15;ish=15;} // Islamic Society of North America (N. America & UK)
		else if(c=="PK"||c=="BD"||c=="IN"||c=="AF"||c=="IR"||c=="RU") {faj=18;ish=18;} // University of Islamic Sciences, Karachi + default for IR,RU
		else if(c=="SA"||c=="YE"||c=="OM"||c=="QA"||c=="BH"||c=="AE"||c=="KW") {faj=19;ish=19;} // Umm al-Qura Committee (Arabian Peninsula)
		else if(c=="IZ"||c=="SY"||c=="LB"||c=="MY"||c=="MA"||c=="DZ"||c=="TN"||c=="LY"||c=="EG") {faj=19.5;ish=17.5;} // Egyptian General Authority of Survey
		else if(-40<la && la<30 && -20<lo && lo<53)  {faj=19.5;ish=17.5;} // EGAoS (Africa)
		else if(-25<lo) {faj=18;ish=17;} else {faj=18;ish=18;} // Muslim World League (Europe & Far East); default
		var dawn=noon-cHourAngle(faj,decl,w), dusk=noon+cHourAngle(ish,decl,w), midnight=getSolarMidnight(this.myDate);
		var ta=Math.tan(Math.PI/2-(w.lat-decl)), ha1=-degree(Math.atan(ta/(ta+1))), ha2=-degree(Math.atan(ta/(2*ta+1))); //CC,202+errata+sign error
		var asr1=noon+cHourAngle(ha1,decl,w), asr2=noon+cHourAngle(ha2,decl,w);
		this.Times.set("Fajr",dawn,sunrise,"Dawn Prayer");
		this.Times.set("Shurooq",sunrise,sunrise+10,"Sunrise, Fajr ends");
		this.Times.set("Dhur",noon,asr1,"Mid-Day Prayer");
		this.Times.set("Asr",asr1,asr2,"Afternoon Prayer, standard (Imamas Shafii, Hanbali & Maliki) method");
		this.Times.set("Asr (Hanafi)",asr2,sunset,"Afternoon Prayer, Hanafi method");
		this.Times.set("Maghrib",sunset,dusk,"Sunset Prayer");
		this.Times.set("Isha",dusk,midnight,"Nightfall Prayer");
	break;
	case "Bahai": // adapted from bahai-library.com/encyclopedia/prayer.html
		var DawnDuskAngle=cHourAngle(18,decl,w), dawn=noon-DawnDuskAngle, dusk=noon+DawnDuskAngle;
		this.Times.set("Morning",dawn,noon,"Medium-length individual prayer, anytime from dawn to noon.");
		this.Times.set("Afternoon",noon,sunset,"Brief individual prayer, anytime from noon to sunset.");
		this.Times.set("Evening",sunset,sunset+120,"Brief individual prayer, anytime from sunset to 2 hours after sunset.");
	break;
	case "Christian": case "Lutheran": case "Julian": case "Coptic": case "Orthodox":
		var DawnDuskAngle=cHourAngle(6,decl,w), dawn=noon-DawnDuskAngle, dusk=noon+DawnDuskAngle;
		this.Times.set("Lauds",dawn,sunrise,"Dawn Prayer");
		this.Times.set("Prime",sunrise,sunrise+60,"Sunrise Prayer, now superseded by Readings, which may be performed anytime");
		this.Times.set("Terce",540,600,"Mid-Morning Prayer");
		this.Times.set("Sext",720,780,"Noon Prayer");
		this.Times.set("None",900,960,"Afternoon Prayer");
		this.Times.set("Vespers",sunset,dusk,"Sunset Prayer");
		this.Times.set("Compline",dusk,dusk+60,"Nightfall Prayer");
		this.Times.set("Matins",0,60,"Midnight Prayer, also called Vigils, now superseded by Readings, which may be performed anytime");
		this.Times.set("Readings",0,1440,"Replacing both Matins and Prime, the Office of the Readings may now be performed at anytime, day or night");
	break;
	case "Zoroastrian":
		this.Times.set("Ushahin",0,sunrise,"Last Watch");
		this.Times.set("Hawan",sunrise,720,"First Watch");
		this.Times.set("Rapithwin",720,900,"Second Watch");
		this.Times.set("Uzerin",900,sunset,"Third Watch");
		this.Times.set("Aiwisruthrem",sunset,1440,"Fourth Watch");
	break;
		case "Tibetan": this.Times.set("Respect Tibet",0,1440,"It is always time to respect Tibetans enjoying their lives, language, culture and religion."); break;
		case "Quaker": case "Friends": this.Times.set("Greetings",0,1440,"Quakers recognize all times to be holy."); break;
		case "Long Count": case "Hindu": case "Balinese": break;
	default: // Secular Times
		var DawnDuskAngle=cHourAngle(6,decl,w); var dawn=noon-DawnDuskAngle, dusk=noon+DawnDuskAngle;
		var secmsg = "Fixed length hours came to Civilization with the popularization of mechanical clocks."; 
		this.Times.set("Greetings in the<br />wee, small hours.",0,dawn,secmsg);
		this.Times.set("Good <i>early</i> Morning.",dawn,sunrise,secmsg);
		this.Times.set("Good Morning.",sunrise,720,secmsg);
		this.Times.set("Good Afternoon.",720,sunset,secmsg);
		this.Times.set("Good late Afternoon.",sunset,dusk,secmsg);
		this.Times.set("Good Evening.",dusk,1440,secmsg);}}
Clock.prototype.toHTML=function(q){return this.Times.toHTML(q);}; Clock.prototype.toString=function(q){return this.Times.toString(q);} // expects Date or 12 (default) or 24
//********************************************************* Web Interface
function Salutation(kind,doTime,itype,inDate,inLocale){var msg="",mt="",cmsg="",it=itype||"text", doIt=(typeof(doTime)=="number")?doTime:1, clkHRS=12; // 12 or 24 hour clock display
	var aDate=inDate||new Date(); aDate.kind=kind||"Gregorian"; aDate.locale=inLocale||myLocale; 
	var theCalendar=new Calendar(aDate), cmsg=theCalendar.getEvents(aDate,it), sns=theCalendar.getSeasons(aDate); 
	if(doIt>0){var theClock=new Clock(aDate); if(doIt==1) mt=theClock.toHTML(aDate); else mt=theClock.toHTML(clkHRS);}
	if(it=="text"){msg+=aDate.toHTML(); if(cmsg)msg+=nl+cmsg; if(sns){for(var i=0;i<sns.length;i++){msg+=nl+sns[i].toHTML();}}}
	else{var theDayName=aDate.toHTML("day");if(sns)msg+=nl+sns[0].toHTML(cmsg,theDayName); else msg+=theDayName+nl; msg+=cmsg+aDate.toHTML("noday");}
	return mt+msg+qibla(aDate.kind,aDate.locale);}
function ABCalWidget(aform,aDivId){ // Dynamic selectable calendar
	var inDate=new Date(), greeting, inKind, inLocale, myID=aDivId||"ABCalendar"; obj=document.getElementById(myID);
	try{inKind=aform.daKind.value.valueOf();} catch(e){inKind="Gregorian";} // next try expects string "mm/dd/yyyy/cycle/major"
	try{var rd=aform.daDate.value.valueOf(), r=rd.split("/"); inDate.set(r[2],(r[0]-1),r[1],inKind,r[4],r[3]);} catch(e){inDate.kind=inKind;} 
	try{var dlat=ddFmDMS(aform.daLatDegree.value.valueOf(),aform.daLatMinute.value.valueOf(),aform.daLatSecond.value.valueOf());
	    var dlon=ddFmDMS(aform.daLonDegree.value.valueOf(),aform.daLonMinute.value.valueOf(),aform.daLonSecond.value.valueOf());
	    var dalt=aform.daHeight.value.valueOf(); var daCC=aform.daCountry.value.valueOf(); 
	    inLocale=new geoLocale("inLocale",dlat,dlon,daCC,dalt)} catch(e){inLocale=myLocale;} inDate.locale=inLocale;
	switch(inKind){
		case "Long Count": case "Balinese": greeting=inDate.toHTML(); break;
		case "Gregorian": case "Tibetan": case "Quaker": greeting=Salutation(inKind,1,"text",inDate,inLocale); break;
		case "Lutheran": case "Coptic": case "Orthodox": greeting=Salutation(inKind,2,"divs",inDate,inLocale); break;
		case "Hindu": greeting=Salutation(inKind,0,"text",inDate,inLocale); break;
		default: greeting=Salutation(inKind,2,"text",inDate,inLocale);}
	obj.innerHTML = "<div id='calendar' class='"+inKind.toLowerCase()+"'>"+greeting+"</div>";}
/***************************************************************** Example HTML
  <div style="font-size: 11px; background-color:#FFFFFF;padding:7px;font-family:Arial;text-align:center;"> 
  <script type="text/javascript" src="http://j.maxmind.com/app/geoip.js"></script>						<!-- optional location service (recomended) -->
  <script type="text/javascript" src="http://www.dogchurch.org/scripts/abcalendar.js"></script>			<!-- this script! order is important! -->
  <style> .hebrew{color:black; font-size:11px;} .christian{color:black;} .lutheran{color:#990033;} .islamic{color:#006400;} .bahai{color:#008082;}</style>
  <div id="ABCalendar"><script type="text/javascript" language="javascript">document.write(Salutation());</script></div>
  <br /><span style="text-align:center;">
  <form action="javascript:ABCalWidget(document.calTest)" name="calTest">
    <select id="daKind" onchange="javascript:ABCalWidget(document.calTest)">
      <option value="Bahai">Bahai</option>
      <option value="Balinese">Balinese Pawukon</option>
      <option value="Coptic">Coptic Orthodox</option>
      <option value="Hebrew">Hebrew</option>
      <option value="Hindu">Old Hindu Solar</option>
      <option value="Islamic">Islamic</option>
      <option value="Long Count">Long Count</option>
      <option value="Quaker">Quaker</option>
      <option value="Orthodox">Russian Orthodox</option>
      <option value="Gregorian" selected="selected">Secular</option>
      <option value="Tibetan">Tibetan</option>
      <option value="Lutheran">Western Church</option>
      <option value="Zoroastrian">Zoroastrian</option>
    </select>
  </form>
  <br />courtesy of <a href="http://www.dogchurch.org/">dogchurch.org</a>
  </span>
  </div>
****************************************************************************/
