/*
	Designed by Jorge Viramontes 2009: In memoriam Patris mei (1936-1996).
	The Algorithms to obtain Easter and under the Gregorian and Julian calendars,
	and Astronomical events are based on Jean Meeus, Astronomical Algorithms (1991).
*/

function mod(i,j)
{
return i%j;
}

function compare(anno)
{
annon=(anno.getMonth()+1)*100+anno.getDate();
return annon;
}

function heb(k1)
{
k2=mod(k1,4);
if (k2==0){
k2=4;
}
return k2;
}

function erase()
{
for (i=1;i<=29;i++){
idname="txt"+i;
document.getElementById(idname).innerHTML="<p class=titled></p>";
}
document.getElementById('333').value="";
return;
}

function Dia(d,language)
{
if (language==1){
d=mod(d+wd,7);
	if (d==0){
	Dy="Dominica";
	}else if (d==1){
	Dy="Feria II";
	}else if (d==2){
	Dy="Feria III";
	}else if (d==3){
	Dy="Feria IV";
	}else if (d==4){
	Dy="Feria V";
	}else if (d==5){
	Dy="Feria VI";
	}else{
	Dy="Sabbato";
	}
}else if (language==2){
d=mod(d+wd,7);
	if (d==0){
	Dy="Sunday";
	}else if (d==1){
	Dy="Monday";
	}else if (d==2){
	Dy="Tuesday";
	}else if (d==3){
	Dy="Wednesday";
	}else if (d==4){
	Dy="Thursday";
	}else if (d==5){
	Dy="Friday";
	}else{
	Dy="Saturday";
	}
}else if (language==3){
d=mod(d+wd,7);
	if (d==0){
	Dy="Domingo";
	}else if (d==1){
	Dy="Lunes";
	}else if (d==2){
	Dy="Martes";
	}else if (d==3){
	Dy="Miércoles";
	}else if (d==4){
	Dy="Jueves";
	}else if (d==5){
	Dy="Viernes";
	}else{
	Dy="Sábado";
	}
}
return Dy;
}

function Mes(m,language)
{
if (language==1){
       if (m==0) {
	Mt="Januarius";
	}else if (m==1){
	Mt="Februarius";
	}else if (m==2){
	Mt="Martius";
	}else if (m==3){
	Mt="Aprilis";
	}else if (m==4){
	Mt="Majus";
	}else if (m==5){
	Mt="Junius";
	}else if (m==6){
	Mt="Julius";
	}else if (m==7){
	Mt="Augustus";
	}else if (m==8){
	Mt="September";
	}else if (m==9){
	Mt="October";
	}else if (m==10){
	Mt="November";
	}else 
	{
	Mt="December";
	}
}else if (language==2){
if (m==0) {
	Mt="January";
	}else if (m==1){
	Mt="February";
	}else if (m==2){
	Mt="March";
	}else if (m==3){
	Mt="April";
	}else if (m==4){
	Mt="May";
	}else if (m==5){
	Mt="June";
	}else if (m==6){
	Mt="July";
	}else if (m==7){
	Mt="August";
	}else if (m==8){
	Mt="September";
	}else if (m==9){
	Mt="October";
	}else if (m==10){
	Mt="November";
	}else 
	{
	Mt="December";
	}
}else if (language==3){
if (m==0) {
	Mt="Enero";
	}else if (m==1){
	Mt="Febrero";
	}else if (m==2){
	Mt="Marzo";
	}else if (m==3){
	Mt="Abril";
	}else if (m==4){
	Mt="Mayo";
	}else if (m==5){
	Mt="Junio";
	}else if (m==6){
	Mt="Julio";
	}else if (m==7){
	Mt="Agosto";
	}else if (m==8){
	Mt="Septiembre";
	}else if (m==9){
	Mt="Octubre";
	}else if (m==10){
	Mt="Noviembre";
	}else 
	{
	Mt="Diciembre";
	}
}
return Mt;
}

function anglef(angle)
{
	if (angle>=0){
	angle=mod(angle,360);
		} else{
	angle=mod(angle,360)+360;
	}
angle=angle*Math.PI/180;
return angle;
}

function radian(angled)
{
angled=angled*Math.PI/180;
return angled;
}

function equinox(anoy,language)
{
var anoy;
var qx=new Date();
if (anoy<=999){
Y=anoy/1000;
JDEa=1721139.29189+365242.13740*Y+0.06134*Math.pow(Y,2)+0.00111*Math.pow(Y,3)-0.00071*Math.pow(Y,4);
}else{
Y=(anoy-2000)/1000;
JDEa=2451623.80984+365242.37404*Y+0.05169*Math.pow(Y,2)-0.00411*Math.pow(Y,3)-0.00057*Math.pow(Y,4);
}
T=(JDEa-2451545.0)/36525;
S=485*Math.cos(radian(324.96+1934.136*T))+203*Math.cos(radian(337.23+32964.467*T))+199*Math.cos(radian(342.08+20.186*T))+182*Math.cos(radian(27.85+445267.112*T))+156*Math.cos(radian(73.14+45036.886*T))+136*Math.cos(radian(171.52+22518.443*T))+77*Math.cos(radian(222.54+65928.934*T))+74*Math.cos(radian(296.72+3034.906*T))+70*Math.cos(radian(243.58+9037.513*T))+58*Math.cos(radian(119.81+33718.147*T))+52*Math.cos(radian(297.17+150.678*T))+50*Math.cos(radian(21.02+2281.226*T))+45*Math.cos(radian(247.54+29929.562*T))+44*Math.cos(radian(325.15+31555.956*T))+29*Math.cos(radian(60.93+4443.417*T))+18*Math.cos(radian(155.12+67555.328*T))+17*Math.cos(radian(288.79+4562.452*T))+16*Math.cos(radian(198.04+62894.029*T))+14*Math.cos(radian(199.76+31436.921*T))+12*Math.cos(radian(95.39+14577.848*T))+12*Math.cos(radian(287.11+31931.756*T))+12*Math.cos(radian(320.81+34777.259*T))+9*Math.cos(radian(227.73+1222.114*T))+8*Math.cos(radian(15.45+16859.074*T));
W=35999.373*T-2.47;
Dd=1+0.0334*Math.cos(radian(W))+0.0007*Math.cos(radian(2*W));
JDE=JDEa+0.00001*S/Dd;
JD=JDE+0.5;
Z=Math.floor(JD);
F=JD-Z;
alpha=Math.floor((Z-1867216.25)/36524.25);
A=Z+1+alpha-Math.floor(alpha/4);
B=A+1524;
C=Math.floor((B-122.1)/365.25);
D=Math.floor(365.25*C);
E=Math.floor((B-D)/30.6001);
diad=B-D-Math.floor(30.6001*E)+F;
if (E<14){
	mesm=E-1;
}else if (E==14 || E==15){
	mesm=E-13;
}
if (mesm>2){
anoy=C-4716;
}else if (mesm==1 || mesm==2){
	anoy=C-4715;
}
var H=24*(diad-Math.floor(diad));
var Hr=Math.floor(H);
var M=60*(H-Hr);
var Min=Math.floor(M);
var Sec=Math.floor(60*(M-Min));
diad=Math.floor(diad);
qx.setUTCFullYear(anoy,mesm-1,diad);
qx.setUTCHours(Hr,Min,Sec);
if (language==1){
aqx="Vernum æquinoctium: "+Mes(qx.getUTCMonth(),1)+"/"+qx.getUTCDate()+"/"+qx.getUTCFullYear()
+" ("+Dia(qx.getUTCDay(),1)+") "+" "+qx.getUTCHours()+"h "+qx.getUTCMinutes()+"m "+qx.getUTCSeconds()+"s UT";
}else if (language==2){
aqx="Vernal equinox: "+Mes(qx.getUTCMonth(),2)+"/"+qx.getUTCDate()+"/"+qx.getUTCFullYear()
+" ("+Dia(qx.getUTCDay(),2)+") "+" "+qx.getUTCHours()+"h "+qx.getUTCMinutes()+"m "+qx.getUTCSeconds()+"s UTC";
}else{
aqx="Equinoccio de Primavera: "+Mes(qx.getUTCMonth(),3)+"/"+qx.getUTCDate()+"/"+qx.getUTCFullYear()
+" ("+Dia(qx.getUTCDay(),3)+") "+" "+qx.getUTCHours()+"h "+qx.getUTCMinutes()+"m "+qx.getUTCSeconds()+"s UTC";
}
return aqx;
}

function phase(anoy,mesm,diad,language)
{
var anoy;
var mesm;
var diad;
var astfm=new Date();
mesm=mesm+1;
if (mesm==4){
	anoy=anoy+(90+diad)/365;
}else if (mesm==3){
	anoy=anoy+(58+diad)/365;
}
k=Math.floor((anoy-2000)*12.3685)+0.5;
T=k/1236.85;
JDE=2451550.09766+29.530588861*k+0.00015437*Math.pow(T,2)-0.000000150*Math.pow(T,3)+0.00000000073*Math.pow(T,4);
E=1-0.002516*T-0.0000074*Math.pow(T,2);
/* Sun's mean anomaly at time JDE */
M=anglef(2.5534+29.10535670*k-0.0000014*Math.pow(T,2)-0.00000011*Math.pow(T,3));
/* Moon's mean anomaly */
MP=anglef(201.5643+385.81693528*k+0.0107582*Math.pow(T,2)+0.00001238*Math.pow(T,3)-0.000000058*Math.pow(T,4));
/* Moon's argument of latitude */
F=anglef(160.7108+390.67050284*k-0.0016118*Math.pow(T,2)-0.00000227*Math.pow(T,3)+0.000000011*Math.pow(T,4));
/* Longitude of the ascending node of the lunar orbit */
O=anglef(124.7746-1.56375588*k+0.0020672*Math.pow(T,2)+0.00000215*Math.pow(T,3));
SUM1=-0.40614*Math.sin(MP)+0.17302*E*Math.sin(M)+0.01614*Math.sin(2*MP)+0.01043*Math.sin(2*F)+0.00734*E*Math.sin(MP-M)-0.00515*E*Math.sin(MP+M)+0.00209*Math.pow(E,2)*Math.sin(2*M)-0.00111*Math.sin(MP-2*F)-0.00057*Math.sin(MP+2*F)+0.00056*E*Math.sin(2*MP+M)-0.00042*Math.sin(3*MP)+0.00042*E*Math.sin(M+2*F)+0.00038*E*Math.sin(M-2*F)-0.00024*E*Math.sin(2*MP-M)-0.00017*Math.sin(O)-0.00007*Math.sin(MP+2*M)+0.00004*Math.sin(2*MP-2*F)+0.00004*Math.sin(3*M)+0.00003*Math.sin(MP+M-2*F)+0.00003*Math.sin(2*MP+2*F)-0.00003*Math.sin(MP+M+2*F)+0.00003*Math.sin(MP-M+2*F)-0.00002*Math.sin(MP-M-2*F)-0.00002*Math.sin(3*MP+M)+0.00002*Math.sin(4*MP);
A1=anglef(299.77+0.107408*k-0.009173*Math.pow(T,2));
A2=anglef(251.88+0.016321*k);
A3=anglef(251.83+26.651886*k);
A4=anglef(349.42+36.412478*k);
A5=anglef(84.66+18.206239*k);
A6=anglef(141.74+53.303771*k);
A7=anglef(207.14+2.453732*k);
A8=anglef(154.84+7.306860*k);
A9=anglef(34.52+27.261239*k);
A10=anglef(207.19+0.121824*k);
A11=anglef(291.34+1.844379*k);
A12=anglef(161.72+24.198154*k);
A13=anglef(239.56+25.513099*k);
A14=anglef(331.55+3.592518*k);
SUM2=0.000325*Math.sin(A1)+0.000165*Math.sin(A2)+0.000164*Math.sin(A3)+0.000126*Math.sin(A4)+0.000110*Math.sin(A5)+0.000062*Math.sin(A6)+0.000060*Math.sin(A7)+0.000056*Math.sin(A8)+0.000047*Math.sin(A9)+0.000042*Math.sin(A10)+0.000040*Math.sin(A11)+0.000037*Math.sin(A12)+0.000035*Math.sin(A13)+0.000023*Math.sin(A14);
JDE=JDE+SUM1+SUM2;
JD=JDE+0.5;
Z=Math.floor(JD);
F=JD-Z;
if (Z<2299161){
	A=Z;
	}else{
	a=Math.floor((Z-1867216.25)/36524.25);
	A=Z+1+a-Math.floor(a/4);
	}
B=A+1524;
C=Math.floor((B-122.1)/365.25);
D=Math.floor(365.25*C);
E=Math.floor((B-D)/30.6001);
diad=B-D-Math.floor(30.6001*E)+F;
if (E<14){
	mesm=E-1;
}else if (E==14 || E==15){
	mesm=E-13;
}
if (mesm>2){
anoy=C-4716;
}else if (mesm==1 || mesm==2){
anoy=C-4715;
}
var H=24*(diad-Math.floor(diad));
var Hr=Math.floor(H);
var M=60*(H-Hr);
var Min=Math.floor(M);
var Sec=Math.floor(60*(M-Min));
diad=Math.floor(diad);
astfm.setUTCFullYear(anoy,mesm-1,diad);
astfm.setUTCHours(Hr,Min,Sec);
if (language==1){
afm="Astronomica Luna Plena: "
+Mes(astfm.getUTCMonth(),1)+"/"+astfm.getUTCDate()+"/"+astfm.getUTCFullYear()+" ("+Dia(astfm.getUTCDay(),1)
+") "+astfm.getUTCHours()+"h "+astfm.getUTCMinutes()+"m "+astfm.getUTCSeconds()+"s UT";
}else if(language==2){
afm="Astronomical Full Moon: "
+Mes(astfm.getUTCMonth(),2)+"/"+astfm.getUTCDate()+"/"+astfm.getUTCFullYear()+" ("+Dia(astfm.getUTCDay(),2)
+") "+astfm.getUTCHours()+"h "+astfm.getUTCMinutes()+"m "+astfm.getUTCSeconds()+"s UTC";
}else{
afm="Luna Llena Astronómica: "
+Mes(astfm.getUTCMonth(),3)+"/"+astfm.getUTCDate()+"/"+astfm.getUTCFullYear()+" ("+Dia(astfm.getUTCDay(),3)
+") "+astfm.getUTCHours()+"h "+astfm.getUTCMinutes()+"m "+astfm.getUTCSeconds()+"s UTC";
}
return afm;
}

function pesach(anoy,language)
{
var anoy;
var pesachd=new Date();
Cp=Math.floor(anoy/100);
if (anoy<=1582){
Sp=0;
}else{
Sp=Math.floor((3*Cp-5)/4);
}
Ap=anoy+3760;
ap=mod(12*anoy+12,19);
bp=mod(anoy,4);
Qp=-1.904412361576+1.554241796621*ap+0.25*bp-0.003177794022*anoy+Sp;
jp=mod(Math.floor(Qp)+3*anoy+5*bp+2-Sp,7);
rp=Qp-Math.floor(Qp);
if (jp==2 || jp==4 || jp==6){
Dp=Math.floor(Qp)+23;
}else if (jp==1 && ap>=7 && rp>=0.632870370){
Dp=Math.floor(Qp)+24;
}else if (jp==0 && ap>=12 && rp>=0.897723765){
Dp=Math.floor(Qp)+23;
}else{
Dp=Math.floor(Qp)+22;
}
if (Dp<=31){
pesajm=2;
}else{
pesajm=3;
Dp=Dp-31;
}
pesachd.setFullYear(anoy,pesajm,Dp);
pesaj=" ";
if (language==1){
pesaj="Pascha Iudæum (Nisan XV, "+(anoy+3760)+"): "+Mes(pesachd.getMonth(),language)+"/"+Dp+"/"+anoy
+" ("+Dia(pesachd.getDay(),language)+") ";
}else if (language==2){
pesaj="Jewish Passover  (15 Nisan, "+(anoy+3760)+"): "+Mes(pesachd.getMonth(),language)+"/"+Dp+"/"+anoy
+" ("+Dia(pesachd.getDay(),language)+") ";
}else{
pesaj="Pascua Judía  (Nisán 15, "+(anoy+3760)+"): "+Mes(pesachd.getMonth(),language)+"/"+Dp+"/"+anoy
+" ("+Dia(pesachd.getDay(),language)+") ";
}
return pesaj;
}

function letteryear(year,lang)
{
if (lang==1){
if (mod(year,3)==1){
document.getElementById('txt1').innerHTML="<p class=titleb> "+year+" anno A est, incipit Tempore Advento "+(year-1)+"<br/> usque ad <br/>Domini nostri Iesu Christi universorum Regis "+year+"</p>";
}else if (mod(year,3)==2){
document.getElementById('txt1').innerHTML="<p class=titleb> "+year+" anno B est, incipit Tempore Advento "+(year-1)+"<br/> usque ad <br/>Domini nostri Iesu Christi universorum Regis "+year+"</p>";
}else{
document.getElementById('txt1').innerHTML="<p class=titleb> "+year+" anno C est, incipit Tempore Advento "+(year-1)+"<br/> usque ad <br/>Domini nostri Iesu Christi universorum Regis "+year+"</p>";
}
if (mod(year,2)==0){
document.getElementById('txt2').innerHTML="<p class=titleb> Anno II est hebdomadæ lectioni</p>";
}else{
document.getElementById('txt2').innerHTML="<p class=titleb> Anno I est hebdomadæ lectioni</p>";
}
}else if(lang==2){
if (mod(year,3)==1){
document.getElementById('txt1').innerHTML="<p class=titleb> "+year+" is a year A from Advent "+(year-1)+"<br/> until<br/> the Feast of Christ the King of "+year+"</p>";
}else if (mod(year,3)==2){
document.getElementById('txt1').innerHTML="<p class=titleb> "+year+" is a year B from Advent "+(year-1)+"<br/> until<br/> the Feast of Christ the King of "+year+"</p>";
}else{
document.getElementById('txt1').innerHTML="<p class=titleb> "+year+" is a year C from Advent "+(year-1)+"<br/> until<br/> the Feast of Christ the King of "+year+"</p>";
}
if (mod(year,2)==0){
document.getElementById('txt2').innerHTML="<p class=titleb> It is Year II for Weekday's Readings</p>";
}else{
document.getElementById('txt2').innerHTML="<p class=titleb> It is Year I for Weekday's Readings</p>";
}
}else{
if (mod(year,3)==1){
document.getElementById('txt1').innerHTML="<p class=titleb> "+year+" es año A desde Adviento "+(year-1)+"<br/> hasta<br/> la fiesta de Cristo Rey en "+year+"</p>";
}else if (mod(year,3)==2){
document.getElementById('txt1').innerHTML="<p class=titleb> "+year+" es año B desde Adviento "+(year-1)+"<br/> hasta<br/> la fiesta de Cristo Rey en "+year+"</p>";
}else{
document.getElementById('txt1').innerHTML="<p class=titleb> "+year+" es año C desde Adviento "+(year-1)+"<br/> hasta<br/> la fiesta de Cristo Rey en "+year+"</p>";
}
if (mod(year,2)==0){
document.getElementById('txt2').innerHTML="<p class=titleb> Es año II para las lecturas entre semana</p>";
}else{
document.getElementById('txt2').innerHTML="<p class=titleb> Es año I para las lecturas entre semana</p>";
}
}
}

function caljg(year)
{
var fixj=new Date();
if (year>1582){
	a=mod(year,19);
	b=Math.floor(year/100);
	c=mod(year,100);
	d=Math.floor(b/4);
	e=mod(b,4);
	f=Math.floor((b+8)/25);
	g=Math.floor((b-f+1)/3);
	h=mod(19*a+b-d-g+15,30);
	i=Math.floor(c/4);
	k=mod(c,4);
	L=mod(32+2*e+2*i-h-k,7);
	m=Math.floor((a+11*h+22*L)/451);
	month=Math.floor((h+L-7*m+114)/31);
	month=month-1;
	day=mod(h+L-7*m+114,31)+1;
	wd=0;
	K=Math.floor((b-17)/25)
	I=mod(b-d-Math.floor((b-K)/3)+19*a+15,30);
	I=I-Math.floor(I/28)*(1-Math.floor(I/28)*Math.floor(29/(I+1))*Math.floor((21-a)/11));
	ecm=I+1;
}else{
	aj=mod(year,4);
	bj=mod(year,7);
	cj=mod(year,19);
	dj=mod(19*cj+15,30);
	ecm=dj+1;
	ej=mod(2*aj+4*bj-dj+34,7);
	month=Math.floor((dj+ej+114)/31);
	month=month-1;
	day=mod(dj+ej+114,31)+1;
	fixj.setFullYear(year,month,day);
	wd=Math.abs(7-fixj.getDay());
}
}

/********************************************************************************************************/
/********************************************************************************************************/

function calendar(year)
{
Rom=["","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX","XXI","XXII","XXIII","XXIV","XXV","XXVI","XXVII","XXVIII","XXIX","XXX","XXXI","XXXII","XXXIII","XXXIV"];
var newyeardate=new Date();
var epiphaniadate=new Date();
var epiphanidate=new Date();
var febl=new Date();
var anunadate=new Date();
var anundate=new Date();
var anunbdate=new Date();
var baptlorddate=new Date();
var ashweddate=new Date();
var lentdate=new Date();
var goodfdate=new Date();
var ecclmoon=new Date();
var easterdate=new Date();
var eastersdate=new Date();
var ascensiondate=new Date();
var pentecostdate=new Date();
var pentecostbdate=new Date();
var corpuscdate=new Date();
var corpuscntdate=new Date();
var navidaddate=new Date();
var advent=new Date();
var otbdate=new Date();
var ot=new Date();
var eeq=new Date();
year=Math.abs(year);
/*********************************************************************************/

letteryear(year,1);
document.getElementById('txt28').innerHTML="<p class=titleb>_____________________________________</p><br />";
caljg(year);

/*********************************************************************************/

eeq.setFullYear(year,2,21);
newyeardate.setFullYear(year,0,1);
febl.setFullYear(year,1,29);
epiphaniadate.setFullYear(year,0,1);
epiphanidate.setFullYear(year,0,6);
anundate.setFullYear(year,2,25);
eastn=7;
ecclmoon.setFullYear(year,2,20+ecm);
mnavid=12-1;
dnavid=25;
navidaddate.setFullYear(year,mnavid,dnavid);
adventn=dnavid-mod(navidaddate.getDay()+wd,7)-28+Math.ceil(mod(navidaddate.getDay()+wd,7)/7)*7;
otn=dnavid-mod(navidaddate.getDay()+wd,7)-224+Math.ceil(mod(navidaddate.getDay()+wd,7)/7)*7;
lentn=42;
ashweddate.setFullYear(year,month,day-46);

/*********************************************************************************/

document.getElementById('txt3').innerHTML="<p><sup>1 </sup>Epiphania Domini: "
+Mes(epiphanidate.getMonth(),1)+"/"+epiphanidate.getDate()+"/"+epiphanidate.getFullYear()+
" ("+Dia(epiphanidate.getDay(),1)+") "+"</p>";

epiphn=epiphaniadate.getDate()+7-mod(epiphaniadate.getDay()+wd,7);
baptn=epiphanidate.getDate()+7-mod(epiphanidate.getDay()+wd,7);
epiphanidate.setFullYear(year,0,epiphn);

/***Mix of Ephi and OT***/

if (epiphanidate.getDate()==7 || epiphanidate.getDate()==8)
{
baptlorddate.setFullYear(year,0,epiphn+1);
document.getElementById('txt4').innerHTML="<p><sup>2 </sup>Epiphania Domini aut<br><font color=#004000>"
+Dia(epiphanidate.getDay(),1)+" I in Tempus per Annum: </font>"
+Mes(epiphanidate.getMonth(),1)+"/"+epiphanidate.getDate()+"/"+epiphanidate.getFullYear()
+" ("+Dia(epiphanidate.getDay(),1)+") "+"</p>";
}else
{
document.getElementById('txt4').innerHTML="<p><sup>2 </sup>Epiphania Domini: "
+Mes(epiphanidate.getMonth(),1)+"/"+epiphanidate.getDate()
+"/"+epiphanidate.getFullYear()+" ("+Dia(epiphanidate.getDay(),1)+") "+"</p>";
}

/*********************************************************************************/

baptlorddate.setFullYear(year,0,baptn);
document.getElementById('txt5').innerHTML="<p><sup>1 </sup>Baptismate Domini: "
+Mes(baptlorddate.getMonth(),1)+"/"+baptlorddate.getDate()
+"/"+baptlorddate.getFullYear()+" ("+Dia(baptlorddate.getDay(),1)+") "+"</p>";


if (epiphanidate.getDate()==7 || epiphanidate.getDate()==8)
{
baptlorddate.setFullYear(year,0,epiphn+1);
otbdate.setFullYear(year,0,epiphn);
document.getElementById('txt6').innerHTML="<p><sup>2 </sup>Baptismate Domini: "+Mes(baptlorddate.getMonth(),1)+"/"
+baptlorddate.getDate()+"/"+baptlorddate.getFullYear()+" ("+Dia(baptlorddate.getDay(),1)+") "+"</p>";
}else
{
baptlorddate.setFullYear(year,0,epiphn+7);
document.getElementById('txt6').innerHTML="<p><sup>2 </sup>Baptismate Domini aut <font color=#004000>"
+Dia(baptlorddate.getDay(),1)+" I in Tempus per Annum: </font>"+Mes(baptlorddate.getMonth(),1)+"/"+baptlorddate.getDate()
+"/"+baptlorddate.getFullYear()+"</p>";
}

/*********************************************************************************/

if (febl.getMonth()==1){
wm=29;
}else{
wm=28;
}
if (ashweddate.getMonth()==1)
	{
	wm=0;
	}else if (ashweddate.getMonth()==2){
	wm=wm;
	}else{
	wm=wm+31;
	}
	
if (mod(baptlorddate.getDay()+wd,7)==1)
	{
	otbn=ashweddate.getDate()+wm+(31-baptlorddate.getDate())-7+1;
	}else{
	otbn=ashweddate.getDate()+wm+(31-baptlorddate.getDate())-7;
	}
otbm=Math.floor(otbn/7)+2;

var ot1_str = "";
for (i=2;i<=otbm;i++)
{
otbdate.setFullYear(year,month,day-46-otbn);
ot1_str = ot1_str + "<p class=ot>"+Dia(otbdate.getDay(),1)+" "+Rom[i]+" in Tempus per Annum et OLH Hebdomada "
+Rom[heb(i)]+": "+Mes(otbdate.getMonth(),1)+"/"+otbdate.getDate()+"/"+otbdate.getFullYear()+"</p>";
otbn=otbn-7;
}
document.getElementById('txt7').innerHTML=ot1_str;

/*********************************************************************************/

document.getElementById('txt8').innerHTML="<p>"+Dia(ashweddate.getDay(),1)+" Cinerum: "
+Mes(ashweddate.getMonth(),1)+"/"+ashweddate.getDate()+"/"+ashweddate.getFullYear()+"</p>";

/*********************************************************************************/

var lent_str = "";
for (i=1;i<=6;i++)
{
	lentdate.setFullYear(year,month,day-lentn);
	if (i==4){
	lent_str = lent_str + "<p class=manere>"+Dia(lentdate.getDay(),1)+" "+Rom[i]
	+" in Quadragesima aut <font color=#FF016D>"+Dia(lentdate.getDay(),1)+" Lætare: </font>"
	+Mes(lentdate.getMonth(),1)+"/"+lentdate.getDate()+"/"+lentdate.getFullYear()+"</p>";
	} else if (i==6){
	anunadate=lentdate;
	lent_str = lent_str + "<p class=manere>"+Dia(lentdate.getDay(),1)+" "+Rom[i]
	+" in Quadragesima, "+Dia(lentdate.getDay(),1)+" in Palmis aut de Passione: "
	+Mes(lentdate.getMonth(),1)+"/"+lentdate.getDate()+"/"+lentdate.getFullYear()+"</p>";
	} else{
	lent_str = lent_str + "<p class=manere>"+Dia(lentdate.getDay(),1)+" "+Rom[i]
	+" in Quadragesima: "+Mes(lentdate.getMonth(),1)+"/"+lentdate.getDate()+"/"+lentdate.getFullYear()+"</p>";
	}
	lentn=lentn-7;
}
document.getElementById('txt9').innerHTML=lent_str;

/*********************************************************************************/

goodfdate.setFullYear(year,month,day-3);
document.getElementById('txt10').innerHTML="<p>"+Dia(goodfdate.getDay(),1)+" in Coena Domini: "
+Mes(goodfdate.getMonth(),1)+"/"+goodfdate.getDate()+"/"+goodfdate.getFullYear()+"</p>";

goodfdate.setFullYear(year,month,day-2);
document.getElementById('txt11').innerHTML="<p class=pass>&#8224 "+Dia(goodfdate.getDay(),1)
+" in Passione Domini aut in Parasceve: "+Mes(goodfdate.getMonth(),1)
+"/"+goodfdate.getDate()+"/"+goodfdate.getFullYear()+"</p>";

goodfdate.setFullYear(year,month,day-1);
document.getElementById('txt12').innerHTML="<p>"+Dia(goodfdate.getDay(),1)+" Sancto: "
+Mes(goodfdate.getMonth(),1)+"/"+goodfdate.getDate()+"/"+goodfdate.getFullYear()+"</p>";

/********************************Pascha********************************************/

phase(year,ecclmoon.getMonth(),ecclmoon.getDate(),1);
pesach(year,1);
equinox(year,1);
easterdate.setFullYear(year,month,day);
document.getElementById('txt13').innerHTML="<p class=easter>"+aqx+"<br/>"
+afm+"<br/>"+pesaj+"<br/><br/>Ecclesiasticum æquinoctium: Martius/21/"
+year+" ("+Dia(eeq.getDay(),1)+")<br/>Paschalis Luna Plena: "
+Mes(ecclmoon.getMonth(),1)+"/"+ecclmoon.getDate()+"/"+ecclmoon.getFullYear()+" ("+Dia(ecclmoon.getDay(),1)
+")<br/><span style='font-weight:bold;color:#000000'>Pascha aut "
+Dia(easterdate.getDay(),1)+" Resurrectionis: "+Mes(easterdate.getMonth(),1)+"/"+easterdate.getDate()
+"/"+easterdate.getFullYear()+"</span></p>";

/*********************************************************************************/

var easter_str = "";
for (i=2;i<=6;i++)
{
eastersdate.setFullYear(year,month,day+eastn);
	if (i==2)
	{
	anunbdate.setFullYear(year,month,day+eastn);
	}
	easter_str = easter_str + "<p class=nonf>"+Dia(eastersdate.getDay(),1)+" "+Rom[i]+" post Pascha: "
	+Mes(eastersdate.getMonth(),1)+"/"+eastersdate.getDate()+"/"+eastersdate.getFullYear()+"</p>";
eastn=eastn+7;
}
document.getElementById('txt15').innerHTML=easter_str;

ascensiondate.setFullYear(year,month,day+40-1);
document.getElementById('txt18').innerHTML="<p>Ascensionis Domini: "
+Mes(ascensiondate.getMonth(),1)+"/"+ascensiondate.getDate()+"/"+ascensiondate.getFullYear()+
" ("+Dia(ascensiondate.getDay(),1)+") "+"</p>";

eastersdate.setFullYear(year,month,day+eastn);
document.getElementById('txt19').innerHTML="<p class=nonf>"+Dia(eastersdate.getDay(),1)+" "+Rom[7]+" post Pascha: "
+Mes(eastersdate.getMonth(),1)+"/"+eastersdate.getDate()+"/"+eastersdate.getFullYear()+"</p>";

pentecostdate.setFullYear(year,month,day+50-1);
document.getElementById('txt20').innerHTML="<p class=red>"+Dia(pentecostdate.getDay(),1)+" Pentecostes: "
+Mes(pentecostdate.getMonth(),1)+"/"+pentecostdate.getDate()+"/"+pentecostdate.getFullYear()+"</p>";

/*********************************************************************************/
pentecostbdate.setFullYear(year,month,day+50-1+7);
corpuscdate.setFullYear(year,month,day+50-1+11);
corpuscntdate.setFullYear(year,month,day+50-1+14);

var ot2_str = "";
for (i=7;i<=33;i++)
{
	ot.setFullYear(year,mnavid,otn);
	if (ot<=pentecostdate)
	{
	ot2_str = ot2_str + "";
	}
	else if (compare(ot)==compare(pentecostbdate))
	{
	ot2_str = ot2_str + "<p>Sanctissimæ Trinitatis aut <font color=#004000>"
	+Dia(ot.getDay(),1)+" "+Rom[i]+" in Tempus per Annum: </font>"+Mes(ot.getMonth(),1)+"/"+ot.getDate()+"/"
	+ot.getFullYear()+"</p>";
	ot2_str = ot2_str + "<p><sup>1 </sup>Corpus Christi: "+Mes(corpuscdate.getMonth(),1)
	+"/"+corpuscdate.getDate()+"/"+corpuscdate.getFullYear()+" ("+Dia(corpuscdate.getDay(),1)+") </p>";
	}
	else if (compare(ot)==compare(corpuscntdate))
	{
	ot2_str = ot2_str + "<p><sup>2 </sup>Corpus Christi aut <font color=#004000>"
	+Dia(corpuscntdate.getDay(),1)+" "+Rom[i]+" in Tempus per Annum: </font>"+Mes(corpuscntdate.getMonth(),1)
	+"/"+corpuscntdate.getDate()+"/"+corpuscntdate.getFullYear()+"</p>";
	corpuscntdate.setFullYear(year,month,day+50-1+14+5);
	ot2_str = ot2_str + "<p>Sacratissimo Corde Jesu: "
	+Mes(corpuscntdate.getMonth(),1)+"/"+corpuscntdate.getDate()
	+"/"+corpuscntdate.getFullYear()+" ("+Dia(corpuscntdate.getDay(),1)+") </p>";
	}
	else
	{
	ot2_str = ot2_str + "<p class=ot>"+Dia(ot.getDay(),1)+" "+Rom[i]+" in Tempus per Annum et OLH Hebdomada "
	+Rom[heb(i)]+": "+Mes(ot.getMonth(),1)+"/"+ot.getDate()+"/"+ot.getFullYear()+"</p>";
	}
otn=otn+7;
}
document.getElementById('txt21').innerHTML=ot2_str;

ot.setFullYear(year,mnavid,otn);
document.getElementById('txt22').innerHTML="<p>Domini nostri Iesu Christi universorum Regis aut <font color=#004000>"
+Dia(ot.getDay(),1)+" "+Rom[34]+" in Tempus per Annum: </font>"
+Mes(ot.getMonth(),1)+"/"+ot.getDate()+"/"+ot.getFullYear()+"</p>";
/*********************************************************************************/

var advent_str = "";
for (i=1;i<=4;i++)
{
	if (i==3){
	advent.setFullYear(year,mnavid,adventn);
	advent_str = advent_str + "<p class=manere>"+Dia(advent.getDay(),1)+" "+Rom[i]+" in Adventus "
	+" aut <font color=#FF016D>"+Dia(advent.getDay(),1)+" Gaudete: </font>"
	+Mes(advent.getMonth(),1)+"/"+advent.getDate()+"/"+advent.getFullYear()+"</p>";
	} else{
	advent.setFullYear(year,mnavid,adventn);
	advent_str = advent_str + "<p class=manere>"+Dia(advent.getDay(),1)+" "+Rom[i]+" in Adventus: "
	+Mes(advent.getMonth(),1)+"/"+advent.getDate()+"/"+advent.getFullYear()+"</p>";
	}
adventn=adventn+7;
}
document.getElementById('txt23').innerHTML=advent_str;

/*********************************************************************************/

anunt_str = "<p>_____________________________________</p>";
if(compare(anunadate)<=compare(anundate) && compare(anundate)<=compare(anunbdate))
{
anunbdate.setDate(anunbdate.getDate()+1);
anunt_str = anunt_str + "<p>Annuntiatio Nativitatis Domini: "
+Mes(anunbdate.getMonth(),1)+"/"+anunbdate.getDate()+"/"+anunbdate.getFullYear()
+" ("+Dia(anunbdate.getDay(),1)+") </p>";
} else if (mod(anundate.getDay()+wd,7)==0)
{
anundate.setDate(anundate.getDate()-1);
anunt_str = anunt_str + "<p>Annuntiatio Nativitatis Domini: "
+Mes(anundate.getMonth(),1)+"/"+anundate.getDate()+"/"+anundate.getFullYear()+" ("+Dia(anundate.getDay(),1)+") </p>";
} else
{
anunt_str = anunt_str+ "<p>Annuntiatio Nativitatis Domini: "
+Mes(anundate.getMonth(),1)+"/"+anundate.getDate()+"/"+anundate.getFullYear()+" ("+Dia(anundate.getDay(),1)+") </p>";
}
document.getElementById('txt24').innerHTML=anunt_str;

document.getElementById('txt25').innerHTML="<p><sup>3 </sup>Nativitatis Domini: "
+Mes(navidaddate.getMonth(),1)+"/"+navidaddate.getDate()+"/"+navidaddate.getFullYear()
+" ("+Dia(navidaddate.getDay(),1)+") <br>_____________________________________</p>";

if (mod(navidaddate.getDay()+wd,7)==0)
{
navidaddate.setFullYear(year,11,30);
document.getElementById('txt26').innerHTML="<p>Sanctæ Familiæ Iesu, Mariæ, Ioseph: "
+Mes(navidaddate.getMonth(),1)+"/"+navidaddate.getDate()+"/"+navidaddate.getFullYear()+
" ("+Dia(navidaddate.getDay(),1)+") </p>";
}else{
navidaddate.setFullYear(year,11,navidaddate.getDate()+7-mod(navidaddate.getDay()+wd,7));
document.getElementById('txt26').innerHTML="<p>Sanctæ Familiæ Iesu, Mariæ, Ioseph: "
+Mes(navidaddate.getMonth(),1)+"/"+navidaddate.getDate()+"/"+navidaddate.getFullYear()
+" ("+Dia(navidaddate.getDay(),1)+") </p>";
}
return;
}

/********************************************************************************************************/
/********************************************************************************************************/

function calendare(year)
{
Rom=["","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX","XXI","XXII","XXIII","XXIV","XXV","XXVI","XXVII","XXVIII","XXIX","XXX","XXXI","XXXII","XXXIII","XXXIV"];
var newyeardate=new Date();
var epiphaniadate=new Date();
var epiphanidate=new Date();
var febl=new Date();
var anunadate=new Date();
var anundate=new Date();
var anunbdate=new Date();
var baptlorddate=new Date();
var ashweddate=new Date();
var lentdate=new Date();
var goodfdate=new Date();
var ecclmoon=new Date();
var easterdate=new Date();
var eastersdate=new Date();
var ascensiondate=new Date();
var pentecostdate=new Date();
var pentecostbdate=new Date();
var corpuscdate=new Date();
var corpuscntdate=new Date();
var navidaddate=new Date();
var advent=new Date();
var otbdate=new Date();
var ot=new Date();
var eeq=new Date();
year=Math.abs(year);

/*********************************************************************************/

letteryear(year,2);
document.getElementById('txt28').innerHTML="<p class=titleb>_____________________________________</p><br />";
caljg(year);

/*********************************************************************************/

eeq.setFullYear(year,2,21);
newyeardate.setFullYear(year,0,1);
febl.setFullYear(year,1,29);
epiphaniadate.setFullYear(year,0,1);
epiphanidate.setFullYear(year,0,6);
anundate.setFullYear(year,2,25);
eastn=7;
ecclmoon.setFullYear(year,2,20+ecm);
mnavid=12-1;
dnavid=25;
navidaddate.setFullYear(year,mnavid,dnavid);
adventn=dnavid-mod(navidaddate.getDay()+wd,7)-28+Math.ceil(mod(navidaddate.getDay()+wd,7)/7)*7;
otn=dnavid-mod(navidaddate.getDay()+wd,7)-224+Math.ceil(mod(navidaddate.getDay()+wd,7)/7)*7;
lentn=42;
ashweddate.setFullYear(year,month,day-46);

/*********************************************************************************/

document.getElementById('txt3').innerHTML="<p><sup>1 </sup>Epiphani of the Lord: "
+Mes(epiphanidate.getMonth(),2)+"/"+epiphanidate.getDate()+"/"+epiphanidate.getFullYear()+
" ("+Dia(epiphanidate.getDay(),2)+") "+"</p>";

epiphn=epiphaniadate.getDate()+7-mod(epiphaniadate.getDay()+wd,7);
baptn=epiphanidate.getDate()+7-mod(epiphanidate.getDay()+wd,7);
epiphanidate.setFullYear(year,0,epiphn);

/***Mix of Ephi and OT***/

if (epiphanidate.getDate()==7 || epiphanidate.getDate()==8)
{
baptlorddate.setFullYear(year,0,epiphn+1);
document.getElementById('txt4').innerHTML="<p><sup>2 </sup>Epiphani of the Lord, or<br><font color=#004000>"
+Dia(epiphanidate.getDay(),2)+" of Ordinary Time I: </font>"
+Mes(epiphanidate.getMonth(),2)+"/"+epiphanidate.getDate()+"/"+epiphanidate.getFullYear()
+" ("+Dia(epiphanidate.getDay(),2)+") "+"</p>";
}else
{
document.getElementById('txt4').innerHTML="<p><sup>2 </sup>Epiphani of the Lord: "
+Mes(epiphanidate.getMonth(),2)+"/"+epiphanidate.getDate()
+"/"+epiphanidate.getFullYear()+" ("+Dia(epiphanidate.getDay(),2)+") "+"</p>";
}

/*********************************************************************************/

baptlorddate.setFullYear(year,0,baptn);
document.getElementById('txt5').innerHTML="<p><sup>1 </sup>Baptism of the Lord: "
+Mes(baptlorddate.getMonth(),2)+"/"+baptlorddate.getDate()
+"/"+baptlorddate.getFullYear()+" ("+Dia(baptlorddate.getDay(),2)+") "+"</p>";


if (epiphanidate.getDate()==7 || epiphanidate.getDate()==8)
{
baptlorddate.setFullYear(year,0,epiphn+1);
otbdate.setFullYear(year,0,epiphn);
document.getElementById('txt6').innerHTML="<p><sup>2 </sup>Baptism of the Lord: "+Mes(baptlorddate.getMonth(),2)+"/"
+baptlorddate.getDate()+"/"+baptlorddate.getFullYear()+" ("+Dia(baptlorddate.getDay(),2)+") "+"</p>";
}else
{
baptlorddate.setFullYear(year,0,epiphn+7);
document.getElementById('txt6').innerHTML="<p><sup>2 </sup>Baptism of the Lord, or <font color=#004000>"
+Dia(baptlorddate.getDay(),2)+" of Ordinary Time I: </font>"+Mes(baptlorddate.getMonth(),2)+"/"+baptlorddate.getDate()
+"/"+baptlorddate.getFullYear()+"</p>";
}

/*********************************************************************************/

if (febl.getMonth()==1){
wm=29;
}else{
wm=28;
}
if (ashweddate.getMonth()==1)
	{
	wm=0;
	}else if (ashweddate.getMonth()==2){
	wm=wm;
	}else{
	wm=wm+31;
	}
	
if (mod(baptlorddate.getDay()+wd,7)==1)
	{
	otbn=ashweddate.getDate()+wm+(31-baptlorddate.getDate())-7+1;
	}else{
	otbn=ashweddate.getDate()+wm+(31-baptlorddate.getDate())-7;
	}
otbm=Math.floor(otbn/7)+2;

var ot1_str = "";
for (i=2;i<=otbm;i++)
{
otbdate.setFullYear(year,month,day-46-otbn);
ot1_str = ot1_str + "<p class=ot>"+Dia(otbdate.getDay(),2)+" of Ordinary Time "+Rom[i]+", and Week "+Rom[heb(i)]+" of the DO: "+Mes(otbdate.getMonth(),2)+"/"+otbdate.getDate()+"/"+otbdate.getFullYear()+"</p>";
otbn=otbn-7;
}
document.getElementById('txt7').innerHTML=ot1_str;

/*********************************************************************************/

document.getElementById('txt8').innerHTML="<p> Ash "+Dia(ashweddate.getDay(),2)+": "+Mes(ashweddate.getMonth(),2)+"/"+ashweddate.getDate()+"/"+ashweddate.getFullYear()+"</p>";

/*********************************************************************************/

var lent_str = "";
for (i=1;i<=6;i++)
{
	lentdate.setFullYear(year,month,day-lentn);
	if (i==4){
	lent_str = lent_str + "<p class=manere>"+Dia(lentdate.getDay(),2)+" of Lent "+Rom[i]
	+", or <font color=#FF016D>"+" Lætare </font>"+Dia(lentdate.getDay(),2)+": "
	+Mes(lentdate.getMonth(),2)+"/"+lentdate.getDate()+"/"+lentdate.getFullYear()+"</p>";
	} else if (i==6){
	anunadate=lentdate;
	lent_str = lent_str + "<p class=manere>"+Dia(lentdate.getDay(),2)+" of Lent "+Rom[i]
	+", or "+" Palm "+Dia(lentdate.getDay(),2)+": "
	+Mes(lentdate.getMonth(),2)+"/"+lentdate.getDate()+"/"+lentdate.getFullYear()+"</p>";
	} else{
	lent_str = lent_str + "<p class=manere>"+Dia(lentdate.getDay(),2)+" of Lent "+Rom[i]
	+": "+Mes(lentdate.getMonth(),2)+"/"+lentdate.getDate()+"/"+lentdate.getFullYear()+"</p>";
	}
	lentn=lentn-7;
}
document.getElementById('txt9').innerHTML=lent_str;

/*********************************************************************************/

goodfdate.setFullYear(year,month,day-3);
document.getElementById('txt10').innerHTML="<p>Holy "+Dia(goodfdate.getDay(),2)+", or Last Supper: "
+Mes(goodfdate.getMonth(),2)+"/"+goodfdate.getDate()+"/"+goodfdate.getFullYear()+"</p>";

goodfdate.setFullYear(year,month,day-2);
document.getElementById('txt11').innerHTML="<p class=pass>&#8224 Good "+Dia(goodfdate.getDay(),2)
+": "+Mes(goodfdate.getMonth(),2)
+"/"+goodfdate.getDate()+"/"+goodfdate.getFullYear()+"</p>";

goodfdate.setFullYear(year,month,day-1);
document.getElementById('txt12').innerHTML="<p>Holy "+Dia(goodfdate.getDay(),2)+": "
+Mes(goodfdate.getMonth(),2)+"/"+goodfdate.getDate()+"/"+goodfdate.getFullYear()+"</p>";

/********************************Passover******************************************/

phase(year,ecclmoon.getMonth(),ecclmoon.getDate(),2);
pesach(year,2);
equinox(year,2);
easterdate.setFullYear(year,month,day);
document.getElementById('txt13').innerHTML="<p class=easter>"+aqx+"<br/>"
+afm+"<br/>"+pesaj+"<br/><br/>Ecclesiastical equinox: March/21/"
+year+" ("+Dia(eeq.getDay(),2)+")<br/>Paschal Full Moon: "
+Mes(ecclmoon.getMonth(),2)+"/"+ecclmoon.getDate()+"/"+ecclmoon.getFullYear()+" ("+Dia(ecclmoon.getDay(),2)
+")<br/><span style='font-weight:bold;color:#000000'>Easter "
+Dia(easterdate.getDay(),2)+" or Resurrection "+Dia(easterdate.getDay(),2)+": "+Mes(easterdate.getMonth(),2)
+"/"+easterdate.getDate()+"/"+easterdate.getFullYear()+"</span></p>";

/*********************************************************************************/

var easter_str = "";
for (i=2;i<=6;i++)
{
eastersdate.setFullYear(year,month,day+eastn);
	if (i==2)
	{
	anunbdate.setFullYear(year,month,day+eastn);
	}
	easter_str = easter_str + "<p class=nonf>"+Dia(eastersdate.getDay(),2)+" of Easter "+Rom[i]+": "
	+Mes(eastersdate.getMonth(),2)+"/"+eastersdate.getDate()+"/"+eastersdate.getFullYear()+"</p>";
eastn=eastn+7;
}
document.getElementById('txt15').innerHTML=easter_str;

ascensiondate.setFullYear(year,month,day+40-1);
document.getElementById('txt18').innerHTML="<p>Ascension of the Lord: "
+Mes(ascensiondate.getMonth(),2)+"/"+ascensiondate.getDate()+"/"+ascensiondate.getFullYear()+
" ("+Dia(ascensiondate.getDay(),2)+") "+"</p>";

eastersdate.setFullYear(year,month,day+eastn);
document.getElementById('txt19').innerHTML="<p class=nonf>"+Dia(eastersdate.getDay(),2)+" of Easter "+Rom[7]+": "
+Mes(eastersdate.getMonth(),2)+"/"+eastersdate.getDate()+"/"+eastersdate.getFullYear()+"</p>";

pentecostdate.setFullYear(year,month,day+50-1);
document.getElementById('txt20').innerHTML="<p class=red> Pentecost "+Dia(pentecostdate.getDay(),2)+": "+
Mes(pentecostdate.getMonth(),2)+"/"+pentecostdate.getDate()+"/"+pentecostdate.getFullYear()+"</p>";

/*********************************************************************************/
pentecostbdate.setFullYear(year,month,day+50-1+7);
corpuscdate.setFullYear(year,month,day+50-1+11);
corpuscntdate.setFullYear(year,month,day+50-1+14);

var ot2_str = "";
for (i=7;i<=33;i++)
{
	ot.setFullYear(year,mnavid,otn);
	if (ot<=pentecostdate)
	{
	ot2_str = ot2_str + "";
	}
	else if (compare(ot)==compare(pentecostbdate))
	{
	ot2_str = ot2_str + "<p>Holy Trinity, or <font color=#004000>"
	+Dia(ot.getDay(),2)+" "+Rom[i]+" of Ordinary Time: </font>"+Mes(ot.getMonth(),2)+"/"+ot.getDate()+"/"
	+ot.getFullYear()+"</p>";
	ot2_str = ot2_str + "<p><sup>1 </sup>Corpus Christi: "+Mes(corpuscdate.getMonth(),2)
	+"/"+corpuscdate.getDate()+"/"+corpuscdate.getFullYear()+" ("+Dia(corpuscdate.getDay(),2)+") </p>";
	}
	else if (compare(ot)==compare(corpuscntdate))
	{
	ot2_str = ot2_str + "<p><sup>2 </sup>Corpus Christi, or <font color=#004000>"
	+Dia(corpuscntdate.getDay(),2)+" of Ordinary Time "+Rom[i]+": </font>"+Mes(corpuscntdate.getMonth(),2)
	+"/"+corpuscntdate.getDate()+"/"+corpuscntdate.getFullYear()+"</p>";
	corpuscntdate.setFullYear(year,month,day+50-1+14+5);
	ot2_str = ot2_str + "<p>Most Holy Heart of Jesus: "
	+Mes(corpuscntdate.getMonth(),2)+"/"+corpuscntdate.getDate()
	+"/"+corpuscntdate.getFullYear()+" ("+Dia(corpuscntdate.getDay(),2)+") </p>";
	}
	else
	{
	ot2_str = ot2_str + "<p class=ot>"+Dia(ot.getDay(),2)+" of Ordinary Time "+Rom[i]+", and Week "
	+Rom[heb(i)]+" of DO: "+Mes(ot.getMonth(),2)+"/"+ot.getDate()+"/"+ot.getFullYear()+"</p>";
	}
otn=otn+7;
}
document.getElementById('txt21').innerHTML=ot2_str;

ot.setFullYear(year,mnavid,otn);
document.getElementById('txt22').innerHTML="<p>Christ the King, or <font color=#004000>"
+Dia(ot.getDay(),2)+" of Ordinary Time "+Rom[34]+": </font>"
+Mes(ot.getMonth(),2)+"/"+ot.getDate()+"/"+ot.getFullYear()+"</p>";
/*********************************************************************************/

var advent_str = "";
for (i=1;i<=4;i++)
{
	if (i==3){
	advent.setFullYear(year,mnavid,adventn);
	advent_str = advent_str + "<p class=manere>"+Dia(advent.getDay(),2)+" of Advent "+Rom[i]
	+", or <font color=#FF016D> Gaudete </font>"+Dia(advent.getDay(),2)+": "
	+Mes(advent.getMonth(),2)+"/"+advent.getDate()+"/"+advent.getFullYear()+"</p>";
	} else{
	advent.setFullYear(year,mnavid,adventn);
	advent_str = advent_str + "<p class=manere>"+Dia(advent.getDay(),2)+" of Advent "+Rom[i]+": "
	+Mes(advent.getMonth(),2)+"/"+advent.getDate()+"/"+advent.getFullYear()+"</p>";
	}
adventn=adventn+7;
}
document.getElementById('txt23').innerHTML=advent_str;

/*********************************************************************************/

anunt_str = "<p>_____________________________________</p>";
if(compare(anunadate)<=compare(anundate) && compare(anundate)<=compare(anunbdate))
{
anunbdate.setDate(anunbdate.getDate()+1);
anunt_str = anunt_str + "<p>Annunciation of the Lord: "
+Mes(anunbdate.getMonth(),2)+"/"+anunbdate.getDate()+"/"+anunbdate.getFullYear()
+" ("+Dia(anunbdate.getDay(),2)+") </p>";
} else if (mod(anundate.getDay()+wd,7)==0)
{
anundate.setDate(anundate.getDate()-1);
anunt_str = anunt_str + "<p>Annunciation of the Lord: "
+Mes(anundate.getMonth(),2)+"/"+anundate.getDate()+"/"+anundate.getFullYear()+" ("+Dia(anundate.getDay(),2)+") </p>";
} else
{
anunt_str = anunt_str+ "<p>Annunciation of the Lord: "
+Mes(anundate.getMonth(),2)+"/"+anundate.getDate()+"/"+anundate.getFullYear()+" ("+Dia(anundate.getDay(),2)+") </p>";
}
document.getElementById('txt24').innerHTML=anunt_str;

document.getElementById('txt25').innerHTML="<p><sup>3 </sup>Christmas: "
+Mes(navidaddate.getMonth(),2)+"/"+navidaddate.getDate()+"/"+navidaddate.getFullYear()
+" ("+Dia(navidaddate.getDay(),2)+") <br>_____________________________________</p>";

if (mod(navidaddate.getDay()+wd,7)==0)
{
navidaddate.setFullYear(year,11,30);
document.getElementById('txt26').innerHTML="<p>Holy Family, Jesus, Mary, and Joseph: "
+Mes(navidaddate.getMonth(),2)+"/"+navidaddate.getDate()+"/"+navidaddate.getFullYear()+
" ("+Dia(navidaddate.getDay(),2)+") </p>";
}else{
navidaddate.setFullYear(year,11,navidaddate.getDate()+7-mod(navidaddate.getDay()+wd,7));
document.getElementById('txt26').innerHTML="<p>Holy Family, Jesus, Mary, and Joseph: "
+Mes(navidaddate.getMonth(),2)+"/"+navidaddate.getDate()+"/"+navidaddate.getFullYear()
+" ("+Dia(navidaddate.getDay(),2)+") </p>";
}

return;
}

/********************************************************************************************************/
/********************************************************************************************************/

function calendars(year)
{
Rom=["","I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII","XIII","XIV","XV","XVI","XVII","XVIII","XIX","XX","XXI","XXII","XXIII","XXIV","XXV","XXVI","XXVII","XXVIII","XXIX","XXX","XXXI","XXXII","XXXIII","XXXIV"];
var newyeardate=new Date();
var epiphaniadate=new Date();
var epiphanidate=new Date();
var febl=new Date();
var anunadate=new Date();
var anundate=new Date();
var anunbdate=new Date();
var baptlorddate=new Date();
var ashweddate=new Date();
var lentdate=new Date();
var goodfdate=new Date();
var ecclmoon=new Date();
var easterdate=new Date();
var eastersdate=new Date();
var ascensiondate=new Date();
var pentecostdate=new Date();
var pentecostbdate=new Date();
var corpuscdate=new Date();
var corpuscntdate=new Date();
var navidaddate=new Date();
var advent=new Date();
var otbdate=new Date();
var ot=new Date();
var eeq=new Date();
year=Math.abs(year);

/*********************************************************************************/

letteryear(year,3);
document.getElementById('txt28').innerHTML="<p class=titleb>_____________________________________</p><br />";
caljg(year);

/*********************************************************************************/

eeq.setFullYear(year,2,21);
newyeardate.setFullYear(year,0,1);
febl.setFullYear(year,1,29);
epiphaniadate.setFullYear(year,0,1);
epiphanidate.setFullYear(year,0,6);
anundate.setFullYear(year,2,25);
eastn=7;
ecclmoon.setFullYear(year,2,20+ecm);
mnavid=12-1;
dnavid=25;
navidaddate.setFullYear(year,mnavid,dnavid);
adventn=dnavid-mod(navidaddate.getDay()+wd,7)-28+Math.ceil(mod(navidaddate.getDay()+wd,7)/7)*7;
otn=dnavid-mod(navidaddate.getDay()+wd,7)-224+Math.ceil(mod(navidaddate.getDay()+wd,7)/7)*7;
lentn=42;
ashweddate.setFullYear(year,month,day-46);

/*********************************************************************************/

document.getElementById('txt3').innerHTML="<p><sup>1 </sup>Epifanía del Señor: "
+Mes(epiphanidate.getMonth(),3)+"/"+epiphanidate.getDate()+"/"+epiphanidate.getFullYear()+
" ("+Dia(epiphanidate.getDay(),3)+") "+"</p>";

epiphn=epiphaniadate.getDate()+7-mod(epiphaniadate.getDay()+wd,7);
baptn=epiphanidate.getDate()+7-mod(epiphanidate.getDay()+wd,7);
epiphanidate.setFullYear(year,0,epiphn);

/***Mix of Ephi and OT***/

if (epiphanidate.getDate()==7 || epiphanidate.getDate()==8)
{
baptlorddate.setFullYear(year,0,epiphn+1);
document.getElementById('txt4').innerHTML="<p><sup>2 </sup>Epifanía del Señor ó<br><font color=#004000>"
+Dia(epiphanidate.getDay(),3)+" de Tiempo Ordinario I: </font>"
+Mes(epiphanidate.getMonth(),3)+"/"+epiphanidate.getDate()+"/"+epiphanidate.getFullYear()
+" ("+Dia(epiphanidate.getDay(),3)+") "+"</p>";
}else
{
document.getElementById('txt4').innerHTML="<p><sup>2 </sup>Epifanía del Señor: "
+Mes(epiphanidate.getMonth(),3)+"/"+epiphanidate.getDate()
+"/"+epiphanidate.getFullYear()+" ("+Dia(epiphanidate.getDay(),3)+") "+"</p>";
}

/*********************************************************************************/

baptlorddate.setFullYear(year,0,baptn);
document.getElementById('txt5').innerHTML="<p><sup>1 </sup>Bautismo del Señor: "
+Mes(baptlorddate.getMonth(),3)+"/"+baptlorddate.getDate()
+"/"+baptlorddate.getFullYear()+" ("+Dia(baptlorddate.getDay(),3)+") "+"</p>";


if (epiphanidate.getDate()==7 || epiphanidate.getDate()==8)
{
baptlorddate.setFullYear(year,0,epiphn+1);
otbdate.setFullYear(year,0,epiphn);
document.getElementById('txt6').innerHTML="<p><sup>2 </sup>Bautismo del Señor: "+Mes(baptlorddate.getMonth(),3)+"/"
+baptlorddate.getDate()+"/"+baptlorddate.getFullYear()+" ("+Dia(baptlorddate.getDay(),3)+") "+"</p>";
}else
{
baptlorddate.setFullYear(year,0,epiphn+7);
document.getElementById('txt6').innerHTML="<p><sup>2 </sup>Bautismo del Señor ó <font color=#004000>"
+Dia(baptlorddate.getDay(),3)+" de Tiempo Ordinario I: </font>"+Mes(baptlorddate.getMonth(),3)+"/"+baptlorddate.getDate()
+"/"+baptlorddate.getFullYear()+"</p>";
}

/*********************************************************************************/

if (febl.getMonth()==1){
wm=29;
}else{
wm=28;
}
if (ashweddate.getMonth()==1)
	{
	wm=0;
	}else if (ashweddate.getMonth()==2){
	wm=wm;
	}else{
	wm=wm+31;
	}
	
if (mod(baptlorddate.getDay()+wd,7)==1)
	{
	otbn=ashweddate.getDate()+wm+(31-baptlorddate.getDate())-7+1;
	}else{
	otbn=ashweddate.getDate()+wm+(31-baptlorddate.getDate())-7;
	}
otbm=Math.floor(otbn/7)+2;

var ot1_str = "";
for (i=2;i<=otbm;i++)
{
otbdate.setFullYear(year,month,day-46-otbn);
ot1_str = ot1_str + "<p class=ot>"+Dia(otbdate.getDay(),3)+" de Tiempo Ordinario "+Rom[i]+" y semana "+Rom[heb(i)]+" del OD: "+Mes(otbdate.getMonth(),3)+"/"+otbdate.getDate()+"/"+otbdate.getFullYear()+"</p>";
otbn=otbn-7;
}
document.getElementById('txt7').innerHTML=ot1_str;

/*********************************************************************************/

document.getElementById('txt8').innerHTML="<p>"+Dia(ashweddate.getDay(),3)+" de Ceniza: "+Mes(ashweddate.getMonth(),3)+"/"+ashweddate.getDate()+"/"+ashweddate.getFullYear()+"</p>";

/*********************************************************************************/

var lent_str = "";
for (i=1;i<=6;i++)
{
	lentdate.setFullYear(year,month,day-lentn);
	if (i==4){
	lent_str = lent_str + "<p class=manere>"+Dia(lentdate.getDay(),3)+" de Cuaresma "+Rom[i]
	+" ó <font color=#FF016D>"+Dia(lentdate.getDay(),3)+" Lætare </font>: "
	+Mes(lentdate.getMonth(),3)+"/"+lentdate.getDate()+"/"+lentdate.getFullYear()+"</p>";
	} else if (i==6){
	anunadate=lentdate;
	lent_str = lent_str + "<p class=manere>"+Dia(lentdate.getDay(),3)+" de Cuaresma "+Rom[i]
	+" ó "+Dia(lentdate.getDay(),3)+" de Ramos: "
	+Mes(lentdate.getMonth(),3)+"/"+lentdate.getDate()+"/"+lentdate.getFullYear()+"</p>";
	} else{
	lent_str = lent_str + "<p class=manere>"+Dia(lentdate.getDay(),3)+" de Cuaresma "+Rom[i]
	+": "+Mes(lentdate.getMonth(),3)+"/"+lentdate.getDate()+"/"+lentdate.getFullYear()+"</p>";
	}
	lentn=lentn-7;
}
document.getElementById('txt9').innerHTML=lent_str;

/*********************************************************************************/

goodfdate.setFullYear(year,month,day-3);
document.getElementById('txt10').innerHTML="<p>"+Dia(goodfdate.getDay(),3)+" Santo ó "
+Dia(goodfdate.getDay(),3)+" de la La Última Cena: "+Mes(goodfdate.getMonth(),3)+"/"
+goodfdate.getDate()+"/"+goodfdate.getFullYear()+"</p>";

goodfdate.setFullYear(year,month,day-2);
document.getElementById('txt11').innerHTML="<p class=pass>&#8224 "+Dia(goodfdate.getDay(),3)
+" Santo: "+Mes(goodfdate.getMonth(),3)+"/"+goodfdate.getDate()+"/"+goodfdate.getFullYear()+"</p>";

goodfdate.setFullYear(year,month,day-1);
document.getElementById('txt12').innerHTML="<p>"+Dia(goodfdate.getDay(),3)+" de Gloria: "
+Mes(goodfdate.getMonth(),3)+"/"+goodfdate.getDate()+"/"+goodfdate.getFullYear()+"</p>";

/********************************Pascua********************************************/

phase(year,ecclmoon.getMonth(),ecclmoon.getDate(),3);
pesach(year,3);
equinox(year,3);
easterdate.setFullYear(year,month,day);
document.getElementById('txt13').innerHTML="<p class=easter>"+aqx+"<br/>"
+afm+"<br/>"+pesaj+"<br/><br/>Equinoccio Eclesiástico: Marzo/21/"
+year+" ("+Dia(eeq.getDay(),3)+")<br/>Luna Llena Pascual: "
+Mes(ecclmoon.getMonth(),3)+"/"+ecclmoon.getDate()+"/"+ecclmoon.getFullYear()+" ("+Dia(ecclmoon.getDay(),3)
+")<br/><span style='font-weight:bold;color:#000000'>"+Dia(easterdate.getDay(),3)
+" de Pascua ó "+Dia(easterdate.getDay(),3)+" de Resurrección: "+Mes(easterdate.getMonth(),3)+"/"
+easterdate.getDate()+"/"+easterdate.getFullYear()+"</span></p>";

/*********************************************************************************/

var easter_str = "";
for (i=2;i<=6;i++)
{
eastersdate.setFullYear(year,month,day+eastn);
	if (i==2)
	{
	anunbdate.setFullYear(year,month,day+eastn);
	}
	easter_str = easter_str + "<p class=nonf>"+Dia(eastersdate.getDay(),3)+" de Pascua "+Rom[i]+": "
	+Mes(eastersdate.getMonth(),3)+"/"+eastersdate.getDate()+"/"+eastersdate.getFullYear()+"</p>";
eastn=eastn+7;
}
document.getElementById('txt15').innerHTML=easter_str;

ascensiondate.setFullYear(year,month,day+40-1);
document.getElementById('txt18').innerHTML="<p>Ascensión del Señor: "
+Mes(ascensiondate.getMonth(),3)+"/"+ascensiondate.getDate()+"/"+ascensiondate.getFullYear()+
" ("+Dia(ascensiondate.getDay(),3)+") "+"</p>";

eastersdate.setFullYear(year,month,day+eastn);
document.getElementById('txt19').innerHTML="<p class=nonf>"+Dia(eastersdate.getDay(),3)+" de Pascua "+Rom[7]+": "
+Mes(eastersdate.getMonth(),3)+"/"+eastersdate.getDate()+"/"+eastersdate.getFullYear()+"</p>";

pentecostdate.setFullYear(year,month,day+50-1);
document.getElementById('txt20').innerHTML="<p class=red>"+Dia(pentecostdate.getDay(),3)+" de Pentecostés: "
+Mes(pentecostdate.getMonth(),3)+"/"+pentecostdate.getDate()+"/"+pentecostdate.getFullYear()+"</p>";

/*********************************************************************************/
pentecostbdate.setFullYear(year,month,day+50-1+7);
corpuscdate.setFullYear(year,month,day+50-1+11);
corpuscntdate.setFullYear(year,month,day+50-1+14);

var ot2_str = "";
for (i=7;i<=33;i++)
{
	ot.setFullYear(year,mnavid,otn);
	if (ot<=pentecostdate)
	{
	ot2_str = ot2_str + "";
	}
	else if (compare(ot)==compare(pentecostbdate))
	{
	ot2_str = ot2_str + "<p>Santísima Trinidad, or <font color=#004000>"
	+Dia(ot.getDay(),3)+" "+Rom[i]+" de Tiempo Ordinario: </font>"+Mes(ot.getMonth(),3)+"/"+ot.getDate()+"/"
	+ot.getFullYear()+"</p>";
	ot2_str = ot2_str + "<p><sup>1 </sup>Corpus Christi: "+Mes(corpuscdate.getMonth(),3)
	+"/"+corpuscdate.getDate()+"/"+corpuscdate.getFullYear()+" ("+Dia(corpuscdate.getDay(),3)+") </p>";
	}
	else if (compare(ot)==compare(corpuscntdate))
	{
	ot2_str = ot2_str + "<p><sup>2 </sup>Corpus Christi ó <font color=#004000>"
	+Dia(corpuscntdate.getDay(),3)+" de Tiempo Ordinario "+Rom[i]+": </font>"+Mes(corpuscntdate.getMonth(),3)
	+"/"+corpuscntdate.getDate()+"/"+corpuscntdate.getFullYear()+"</p>";
	corpuscntdate.setFullYear(year,month,day+50-1+14+5);
	ot2_str = ot2_str + "<p>Sacratísimo Corazón de Jesús: "
	+Mes(corpuscntdate.getMonth(),3)+"/"+corpuscntdate.getDate()
	+"/"+corpuscntdate.getFullYear()+" ("+Dia(corpuscntdate.getDay(),3)+") </p>";
	}
	else
	{
	ot2_str = ot2_str + "<p class=ot>"+Dia(ot.getDay(),3)+" de Tiempo Ordinario "+Rom[i]+" y semana "
	+Rom[heb(i)]+" del OD: "+Mes(ot.getMonth(),3)+"/"+ot.getDate()+"/"+ot.getFullYear()+"</p>";
	}
otn=otn+7;
}
document.getElementById('txt21').innerHTML=ot2_str;

ot.setFullYear(year,mnavid,otn);
document.getElementById('txt22').innerHTML="<p>Cristo Rey ó <font color=#004000>"
+Dia(ot.getDay(),3)+" de Tiempo Ordinario "+Rom[34]+": </font>"
+Mes(ot.getMonth(),3)+"/"+ot.getDate()+"/"+ot.getFullYear()+"</p>";
/*********************************************************************************/

var advent_str = "";
for (i=1;i<=4;i++)
{
	if (i==3){
	advent.setFullYear(year,mnavid,adventn);
	advent_str = advent_str + "<p class=manere>"+Dia(advent.getDay(),3)+" de Adviento "+Rom[i]
	+", ó "+Dia(advent.getDay(),3)+"<font color=#FF016D> Gaudete</font>: "
	+Mes(advent.getMonth(),3)+"/"+advent.getDate()+"/"+advent.getFullYear()+"</p>";
	} else{
	advent.setFullYear(year,mnavid,adventn);
	advent_str = advent_str + "<p class=manere>"+Dia(advent.getDay(),3)+" de Adviento "+Rom[i]+": "
	+Mes(advent.getMonth(),3)+"/"+advent.getDate()+"/"+advent.getFullYear()+"</p>";
	}
adventn=adventn+7;
}
document.getElementById('txt23').innerHTML=advent_str;

/*********************************************************************************/

anunt_str = "<p>_____________________________________</p>";
if(compare(anunadate)<=compare(anundate) && compare(anundate)<=compare(anunbdate))
{
anunbdate.setDate(anunbdate.getDate()+1);
anunt_str = anunt_str + "<p>Anunciación del Señor: "
+Mes(anunbdate.getMonth(),3)+"/"+anunbdate.getDate()+"/"+anunbdate.getFullYear()
+" ("+Dia(anunbdate.getDay(),3)+") </p>";
} else if (mod(anundate.getDay()+wd,7)==0)
{
anundate.setDate(anundate.getDate()-1);
anunt_str = anunt_str + "<p>Anunciación del Señor: "
+Mes(anundate.getMonth(),3)+"/"+anundate.getDate()+"/"+anundate.getFullYear()+" ("+Dia(anundate.getDay(),3)+") </p>";
} else
{
anunt_str = anunt_str+ "<p>Anunciación del Señor: "
+Mes(anundate.getMonth(),3)+"/"+anundate.getDate()+"/"+anundate.getFullYear()+" ("+Dia(anundate.getDay(),3)+") </p>";
}
document.getElementById('txt24').innerHTML=anunt_str;

document.getElementById('txt25').innerHTML="<p><sup>3 </sup>La Natividad del Señor: "
+Mes(navidaddate.getMonth(),3)+"/"+navidaddate.getDate()+"/"+navidaddate.getFullYear()
+" ("+Dia(navidaddate.getDay(),3)+") <br>_____________________________________</p>";

if (mod(navidaddate.getDay()+wd,7)==0)
{
navidaddate.setFullYear(year,11,30);
document.getElementById('txt26').innerHTML="<p>La Sagrada Familia Jesus, María y José: "
+Mes(navidaddate.getMonth(),3)+"/"+navidaddate.getDate()+"/"+navidaddate.getFullYear()+
" ("+Dia(navidaddate.getDay(),3)+") </p>";
}else{
navidaddate.setFullYear(year,11,navidaddate.getDate()+7-mod(navidaddate.getDay()+wd,7));
document.getElementById('txt26').innerHTML="<p>La Sagrada Familia Jesús, María y José: "
+Mes(navidaddate.getMonth(),3)+"/"+navidaddate.getDate()+"/"+navidaddate.getFullYear()
+" ("+Dia(navidaddate.getDay(),3)+") </p>";
}

return;
}

/*******************************************************************************************/

function init(year,language)
{
if (year==null || year=="" || year!=Math.floor(year) || year<1 || year>3999){
if (language==1){
document.getElementById('txt1').innerHTML="<p class=other>Anno Domini &#8712 N &#8745 [1,3999] </p>";
}else if (language==2){
document.getElementById('txt1').innerHTML="<p class=other>Year of the Lord &#8712 N &#8745 [1,3999] </p>";
}else{
document.getElementById('txt1').innerHTML="<p class=other>Año del Señor &#8712 N &#8745 [1,3999] </p>";
}
document.getElementById('txt2').innerHTML="<p class=titled>_____________________________________</p>";
for (i=3;i<=29;i++){
idname="txt"+i;
document.getElementById(idname).innerHTML="<p class=titled></p>";
}
}else
{
year=Math.abs(year);
if (language==1){
calendar(year);
}else if (language==2){
calendare(year);
}else{
calendars(year);
}
if (language==1){
var text_str = "";
text_str = text_str + "<p class=nonf><sup>1</sup> Ubi Sollemnitate de præcepto est</p>";
text_str = text_str + "<p class=nonf><sup>2</sup> Ubi Sollemnitate non est de præcepto</p>";
text_str = text_str + "<p class=nonf><sup>3</sup> Sollemnitate non mobilibus est</p>";
text_str = text_str + "<p class=nonf>OLH: Ordinarium Liturgiæ Horarum per Quattuor Hebdomadas Distributum</p>";
text_str = text_str + "<p class=nonf>_____________________________________</p>";
text_str = text_str + "<p class=manere><sup>A </sup>Tempus Quadragesimæ decurrit a feria IV Cinerum ad Missam in Cena Domini exclusive.</p>";
text_str = text_str + "<p class=nonf><sup>B </sup>Quinquaginta dies a dominica Resurrectionis ad dominicam Pentecostes in lætitia et exsultatione celebrantur sicut unus dies festus, immo «magna dominica».</p>";
text_str = text_str + "<p class=manere><sup>C </sup>Tempus Adventus incipit a I Vesperis dominicæ quæ incidit in diem 30 novembris vel est huic vicinior, et explicit ante I Vesperas Nativitatis Domini.</p>";
text_str = text_str + "<p class=red><sup>D </sup>Tempus Nativitatis decurrit a I Vesperis Nativitatis Domini usque ad dominicam post Epiphaniam, seu post diem 6 ianuarii, inclusive.</p>";
text_str = text_str + "<p class=nonf><font color=#004000><sup>E </sup>Tempus «per annum» incipit feria II quæ sequitur dominicam post diem 6 ianuarii occurrentem et protrahitur usque ad feriam III ante Quadragesimam inclusive; iterum incipit feria II post dominicam Pentecostes et explicit ante I Vesperas dominicæ I Adventus.</font></p>";
text_str = text_str + "<p class=nonf><sup>F </sup>Ubi autem sollemnitates Epiphaniae, Ascensionis et Ss.mi Corporis et Sanguinis Christi non sunt de praecepto servandae, assignentur dominicae tamquam diei proprio, hac ratione:<br/>a) Epiphania, dominicae a die 2 ad diem 8 ianuarii occurrenti;<br/>b) Ascensio, dominicae VII Paschae;<br/>c) Sollemnitas Ss.mi Corporis et Sanguinis Christi, dominicae post Ss.mam Trinitatem.</p>"
text_str = text_str + "<p><sup>G </sup>Ad colorem sacrarum vestium quod attinet, servetur usus traditus, nempe:</p>";
text_str = text_str + "<ul>";
text_str = text_str + "<li><p> Color albus adhibetur in Officiis et Missis temporis paschalis et Nativitatis Domini; insuper in celebrationibus Domini, quæ non sint de eius Passione, beatæ Mariæ Virginis, SS. Angelorum, Sanctorum non Martyrum, in sollemnitatibus Omnium Sanctorum (1 nov.) et S. Ioannis Baptistæ (24 iunii), in festis S. Ioannis Evangelistæ (27 dec.), Cathedræ S. Petri (22 febr.) et Conversionis S. Pauli (25 ian.).</p></li>";
text_str = text_str + "<li><p>Color ruber adhibetur in dominica Passionis et feria VI Hebdomadæ sanctæ, in dominica Pentecostes, in celebrationibus Passionis Domini, in festis nataliciis Apostolorum et Evangelistarum et in celebrationibus Sanctorum Martyrum.</p></li>";
text_str = text_str + "<li><p> Color viridis adhibetur in Officiis et Missis temporis «per annum».</p></li>";
text_str = text_str + "<li><p> Color violaceus adhibetur tempore Adventus et Quadragesimæ. Assumi potest etiam in Officiis et Missis defunctorum.</p></li>";
text_str = text_str + "<li><p> Color rosaceus adhiberi potest, ubi mos est, in dominicis Gaudéte (III Adventus) et Lætáre (IV in Quadragesima).</p></li>";
text_str = text_str + "</ul>";
text_str = text_str + "<p><sup>A, B , C, D, E, F, G </sup>Missale Romanum ex decreto Sacrosancti œcumenici Concilii Vaticani II instauratum auctoritate Pauli pp. VI promulgatum, Ioannis Pauli pp. II recognitum. EDITIO TYPICA TERTIA</p>";
text_str = text_str + "<p class=nonf>_____________________________________</p>";
text_str = text_str + "<p>&nbsp;&nbsp</p>";
document.getElementById('txt29').innerHTML=text_str;
/*******************************************************************************************/
}else if(language==2){
var text_str = "";
text_str = text_str + "<p class=nonf><sup>1 </sup> Places where the Feast is of precept</p>";
text_str = text_str + "<p class=nonf><sup>2 </sup> Places where the Feast is not of precept</p>";
text_str = text_str + "<p class=nonf><sup>3 </sup> This is not a moveable Feast</p>";
text_str = text_str + "<p class=nonf>DO: Divine Office or Liturgy of the Hours for the four Weeks distribution</p>";
text_str = text_str + "<p class=nonf>_____________________________________</p>";
document.getElementById('txt29').innerHTML=text_str;
text_str = text_str + "<p class=manere><sup>A </sup>Lent runs from Ash Wednesday until the Mass of the Lord's Supper exclusive.</p>";
text_str = text_str + "<p class=nonf><sup>B </sup>The fifty days from Easter Sunday to Pentecost are celebrated in joyful exultation as one feast day, or better as one «great Sunday».</p>";
text_str = text_str + "<p class=manere><sup>C </sup>El tiempo de Adviento comienza con las primeras Vísperas del domingo que cae el 30 de noviembre o es el más próximo a este día, y acaba antes de las primeras Vísperas de Navidad.</p>";
text_str = text_str + "<p class=red><sup>D </sup>The Christmas season runs from Evening Prayer I of Christmas until the Sunday after Epiphany or after 6 January, inclusive.</p>";
text_str = text_str + "<p class=nonf><font color=#004000><sup>E </sup>Ordinary Time begins on Monday after the Sunday following 6 January and continues until Tuesday before Ash Wednesday inclusive. It begins again on Monday after Pentecost and ends before Evening Prayer I of the First Sunday of Advent.</font></p>";
text_str = text_str + "<p class=nonf><sup>F </sup>In those places where the solemnities of Epiphany, Ascension, and Corpus Christi are not observed as holydays of obligation, they are assigned to a Sunday, which is then considered their proper day in calendar. Thus:<br/>a) Epiphany, to the Sunday falling between 2 January and 8 January.<br/>b) Ascension, to the Seventh Sunday of Easter.<br/>c) The solemnity of Corpus Christi, to the Sunday after Trinity Sunday.</p>";
text_str = text_str + "<p><sup>G </sup>Liturgical Colors:</p>";
text_str = text_str + "<ul>";
text_str = text_str + "<li><p> White is used in the Offices and Masses during the Easter and Christmas seasons; also on celebrations of the Lord other than of his Passion, of the Blessed Virgin Mary, of the Holy Angels, and of Saints who were not Martyrs; on the Solemnities of All Saints (November 1) and of the Nativity of Saint John the Baptist (June 24); and on the Feasts of Saint John the Evangelist (December 27), of the Chair of Saint Peter (February 22), and of the Conversion of Saint Paul (January 25).</p></li>";
text_str = text_str + "<li><p> Red is used on Palm Sunday of the Lord's Passion and on Good Friday, on Pentecost Sunday, on celebrations of the Lord's Passion, on the feasts of the Apostles and Evangelists, and on celebrations of Martyr Saints.</p></li>";
text_str = text_str + "<li><p> Green is used in the Offices and Masses of Ordinary Time.</p></li>";
text_str = text_str + "<li><p> Violet or purple is used in Advent and in Lent. It may also be worn in Offices and Masses for the Dead. Besides violet, white or black vestments may be worn at funeral services and at other Offices and Masses for the Dead in the Dioceses of the United States of America.</p></li>";
text_str = text_str + "<li><p> Rose may be used, where it is the practice, on Gaudete Sunday (Third Sunday of Advent) and on Laetare Sunday (Fourth Sunday of Lent).</p></li>";
text_str = text_str + "</ul>";
text_str = text_str + "<p><sup>A, B , C, D, E, F, G </sup>Missale Romanum ex decreto Sacrosancti œcumenici Concilii Vaticani II instauratum auctoritate Pauli pp. VI promulgatum, Ioannis Pauli pp. II recognitum. EDITIO TYPICA TERTIA</p>";
text_str = text_str + "<p class=nonf>_____________________________________</p>";
text_str = text_str + "<p>&nbsp;&nbsp</p>";
document.getElementById('txt29').innerHTML=text_str;
/*******************************************************************************************/
}else{
var text_str = "";
text_str = text_str + "<p class=nonf><sup>1 </sup> Lugares donde esta Fiesta es de precepto</p>";
text_str = text_str + "<p class=nonf><sup>2 </sup> Lugares donde esta Fiesta no es de precepto</p>";
text_str = text_str + "<p class=nonf><sup>3 </sup> Esta Fiesta no es movible</p>";
text_str = text_str + "<p class=nonf>OD: El Oficio Divino o Litúrgia de las Horas para la distribución de cuatro semanas</p>";
text_str = text_str + "<p class=nonf>_____________________________________</p>";
document.getElementById('txt29').innerHTML=text_str;
text_str = text_str + "<p class=manere><sup>A </sup>El tiempo de Cuaresma va desde el miércoles de Ceniza hasta la Misa de la Cena del Señor exclusive.</p>";
text_str = text_str + "<p class=nonf><sup>B </sup>Los cincuenta días que van desde el domingo de Resurrección hasta el domingo de Pentecostés han de ser celebrados con alegría y exultación como si se tratase de un solo y único día festivo, más aún, como «un gran domingo».</p>";
text_str = text_str + "<p class=manere><sup>C </sup>El tiempo de Adviento comienza con las primeras Vísperas del domingo que cae el 30 de noviembre o es el más próximo a este día, y acaba antes de las primeras Vísperas de Navidad.</p>";
text_str = text_str + "<p class=red><sup>D </sup>El tiempo de Navidad va desde las primeras Vísperas de la Natividad del Señor hasta el domingo después de Epifanía, o después del día 6 de enero, inclusive.</p>";
text_str = text_str + "<p class=nonf><font color=#004000><sup>E </sup>El tiempo ordinario comienza el lunes que sigue al domingo posterior al 6 de enero y se extiende hasta el martes antes de Cuaresma inclusive: de nuevo comienza el lunes después del domingo de Pentecostés y termina antes de las primeras Vísperas del domingo 1 de Adviento.</font></p>";
text_str = text_str + "<p class=nonf><sup>F </sup>Allí donde las solemnidades de Epifanía, de la Ascensión y del Santísimo Cuerpo y Sangre de Cristo no son de precepto, se celebrarán en un domingo como en día propio, de este modo:<br/>a) La Epifanía, el domingo que cae entre el 2 y el 8 de enero.<br/>b) La Ascensión, el VII domingo de Pascua.<br/>c) La solemnidad del Santísimo Cuerpo y Sangre de Cristo, el domingo después de la Santísima Trinidad.</p>";
text_str = text_str + "<p><sup>G </sup>Colores Litúrgicos:</p>";
text_str = text_str + "<ul>";
text_str = text_str + "<li><p> Blanco es usado durante todo el tiempo pascual y navideño, para las fiestas del Señor (salvo excepciones), de la Virgen, de los santos y santas, confesores y vírgenes como partícipes de la Pascua de Cristo así como para el sacramento de la Unción.</p></li>";
text_str = text_str + "<li><p> Rojo es usado para el Domingo de Ramos, Viernes Santo, Pentecostés, Exaltación de la Santa Cruz, fiestas del Espíritu Santo y fiestas de apóstoles y mártires pudiéndose usar también en el sacramento de la Confirmación.</p></li>";
text_str = text_str + "<li><p> Verde es usado durante los domingos y ferias del tiempo ordinario.</p></li>";
text_str = text_str + "<li><p> Violeta o morado es usado durante Adviento, Cuaresma y en las misas de difuntos. En la diocesis de Estados Unidos negro o blanco también pueden ser usado en las misas de difuntos.</p></li>";
text_str = text_str + "<li><p> Rosa es usado el III domingo de Adviento y el IV de Cuaresma en los llamados domingos de Gaudete y Laetare respectivamente.</p></li>";
text_str = text_str + "</ul>";
text_str = text_str + "<p><sup>A, B , C, D, E, F </sup>Missale Romanum ex decreto Sacrosancti œcumenici Concilii Vaticani II instauratum auctoritate Pauli pp. VI promulgatum, Ioannis Pauli pp. II recognitum. EDITIO TYPICA TERTIA</p>";
text_str = text_str + "<p class=nonf>_____________________________________</p>";
text_str = text_str + "<p>&nbsp;&nbsp</p>";
document.getElementById('txt29').innerHTML=text_str;
}

}

return;
}

