PageSourceSearch

http://www.machida-catholic.jp/stjacob/js/litcal.js

js machida-catholic.jp collected 2026-10-08 13:47:51 UTC 28,863 bytes, 592 lines download raw bytes

1<!--
2/*=======================================
3 Liturgical year class
4========================================*/
5function LitYear(year){
6   this.year=year;
7   this.adv=getAdvent(year-1);
8   this.chr=new Date(year-1,11,25);
9   this.est=getEaster(year);
10   this.ash=getAshWsd(this.est);
11   this.pnt=getPentacost(this.est);
12   this.ortest=getOrtodoxEaster(year);
13}
14function CurDay(dt){
15   this.dt=dt;       // date
16   this.clr="grn";   // color
17   this.dsc="";      // description
18   this.prt=0;       // priority
19   //this.dif="";
20   this.getCurDay=getCurDay;
21   this.getFeast=getFeast;
22}
23function YearEvnt(dt,spcdt,dsc){
24   this.dt=dt;            // date
25   this.spcDt=spcdt;  // date exception
26   this.dsc=dsc;          // description
27}
28
29function getCurDay(){
30   var nWeek=0;
31   var nDays=0;
32   var dtTmp=new Date();
33
34   var nDif=this.dt.getTime()-lityr.est.getTime();
35   // Before Easter
36   if(nDif<0){
37      nDif=this.dt.getTime()-lityr.ash.getTime();
38      if(nDif<0){
39	     dtTmp=getEpiphany(this.dt.getFullYear());
40         nDif=this.dt.getTime()-dtTmp.getTime();
41         // New Year to Epiphany
42		 if(nDif<0){
43	        dtTmp=new Date(this.dt.getFullYear(),0,1);
44            nDif=this.dt.getTime()-dtTmp.getTime();
45            if(nDif>0){this.dsc="Christmas Weekday";this.clr="whi";this.prt=1;}
46            else{this.dsc=yrlEvntDesc(8);this.clr="whi";this.prt=9;}
47		 }
48         // Epiphany to Ash Wednesday
49		 else if(nDif>0){
50		    if (dtTmp.getDate()<8){dtTmp.setDate(dtTmp.getDate()+7);}
51			else{dtTmp.setDate(dtTmp.getDate()+1);}
52            nDif=this.dt.getTime()-dtTmp.getTime();
53			if(nDif<0){this.dsc=dni[this.dt.getDay()] + " after " + yrlEvntDesc(9);this.clr="whi";this.prt=1;}
54			else if(nDif>0){
55			   if(dtTmp.getDay()!=0){dtTmp.setDate(dtTmp.getDate()-1);}  // special case when Christmas is on Sunday
56			   nWeek=weekDif(dtTmp,this.dt);
57			   if(this.dt.getDay()==0){this.dsc=numer[nWeek] + " Sunday in Ordinary Time";this.clr="grn";this.prt=5;}
58			   else{this.dsc=numer[nWeek] + " week in Ordinary Time";this.clr="grn";this.prt=1;}
59			   }
60			else{this.dsc=yrlEvntDesc(10);this.clr="whi";this.prt=9;}
61		 }
62		 else{this.dsc=yrlEvntDesc(9);this.clr="whi";this.prt=9;}}
63      //Ash Wednesday to Easter
64      else if(nDif>0){
65         this.clr="vio";
66         this.prt=3;
67         dtTmp=new Date(lityr.ash);
68         dtTmp.setDate(dtTmp.getDate()+4);
69         nDays=Math.floor(nDif/ONE_DAY);
70		 if(nDays<4){this.dsc=dni[this.dt.getDay()] + " after " + yrlEvntDesc(31);}
71         else{nWeek=weekDif(dtTmp,this.dt);
72            if(nWeek<5){
73               if(this.dt.getDay()!=0){this.dsc=numer[nWeek] + " week of Lent";}
74               else{this.dsc=numer[nWeek] + " Sunday of Lent";this.prt=7;}}
75            else{
76               if(this.dt.getDay()==0){this.dsc=yrlEvntDesc(32);this.clr="red";this.prt=9;}
77               else if(this.dt.getDay()==4){this.dsc=yrlEvntDesc(33);this.clr="whi";this.prt=9;}
78               else if(this.dt.getDay()==5){this.dsc=yrlEvntDesc(34);this.clr="red";this.prt=9;}
79               else if(this.dt.getDay()==6){this.dsc=yrlEvntDesc(35);this.clr="whi";this.prt=9;}
80               else{this.dsc=dni[this.dt.getDay()] + " of Holy Week";this.prt=3;}
81            }}
82      }
83      else{this.dsc=yrlEvntDesc(31);this.clr="vio";this.prt=9;}
84   }
85   // After Easter
86   else if(nDif>0){
87      // Easter and ordinary time
88      var dtAdv=getAdvent(this.dt.getFullYear());
89      nDif=this.dt.getTime()-dtAdv.getTime();
90      if(nDif<0){
91         nDif=this.dt.getTime()-lityr.pnt.getTime();
92         // Easter Time
93         if(nDif<0){
94            this.clr="whi";
95		    nWeek=weekDif(lityr.est,this.dt);
96		    if(this.dt.getDay()==0){
97                if(nWeek==0){this.dsc=yrlEvntDesc(51)}
98                else if(nWeek==6){this.dsc=yrlEvntDesc(52)}
99			    else{this.dsc=numer[nWeek] + " Sunday of Easter";}
100                this.prt=7;}
101		 else{
102		    if(nWeek>0){this.dsc=numer[nWeek] + " week of Easter";this.prt=1;}
103			else{this.dsc=dni[this.dt.getDay()] + " in the Octave of Easter";this.prt=3;}}
104         }
105         // Ordiary Time
106         else if(nDif>0){
107            this.clr="grn";
108            dtAdv.setDate(dtAdv.getDate()-1);
109			var nWeek=33-weekDif(this.dt,dtAdv);
110		    if(this.dt.getDay()==0){
111               dtTmp=new Date(lityr.pnt);
112               dtTmp.setDate(dtTmp.getDate()+7);
113               if(this.dt.valueOf()==dtTmp.valueOf()){this.dsc=yrlEvntDesc(54);this.clr="whi";this.prt=5;}
114               else{
115                  dtTmp.setDate(dtTmp.getDate()+7);
116                  if(this.dt.valueOf()==dtTmp.valueOf()){this.dsc=yrlEvntDesc(55);this.clr="whi";this.prt=5;}}
117               if(this.prt<5){
118                  if(nWeek==33){this.dsc=this.dsc=yrlEvntDesc(58);this.clr="whi";this.prt=7;}
119                  else{this.dsc=numer[nWeek] + " Sunday in Ordinary Time";this.prt=5;}}}
120			else{
121			   //Sacret Heart of Jesus and Sacred Heart of Mary
122               dtTmp=new Date(lityr.pnt);
123               dtTmp.setDate(dtTmp.getDate()+19);
124               if(this.dt.valueOf()==dtTmp.valueOf()){this.dsc=yrlEvntDesc(56);this.clr="whi";this.prt=5;}
125               else{
126                  dtTmp.setDate(dtTmp.getDate()+1);
127                  if(this.dt.valueOf()==dtTmp.valueOf()){this.dsc=yrlEvntDesc(57);this.clr="whi";this.prt=2;}}
128               //else{this.dsc=numer[nWeek] + " week in Ordinary Time";this.prt=1;}}
129               if(this.prt<2){this.dsc=numer[nWeek] + " week in Ordinary Time";this.prt=1;}}
130         }
131         // Pentacost
132         else {this.dsc=yrlEvntDesc(53);this.clr="red";this.prt=9;}
133      }
134      // Advent and Christmas
135      else{
136         dtTmp=new Date(this.dt.getFullYear(),11,25);
137         nDif=this.dt.getTime()-dtTmp.getTime();
138         // Advent
139         if(nDif<0){
140            this.clr="vio";
141		    nWeek=weekDif(dtAdv,this.dt);
142		    if(this.dt.getDay()==0){this.dsc=numer[nWeek] + " Sunday of Advent";this.prt=7;}
143		    else{this.dsc=numer[nWeek] + " week of Advent";this.prt=1;}
144            // Christmas Eve
145            if((nWeek==3)&&(this.dt.getDay()!=0)){
146               nDays=Math.floor(nDif/ONE_DAY);
147               if(nDays==-1){this.dsc=yrlEvntDesc(2);this.prt=1;}}}
148         // Christmas
149         else if(nDif>0){
150            this.clr="whi";
151            nDays=Math.floor(nDif/ONE_DAY);
152            if(this.dt.getDay()==0){this.dsc=yrlEvntDesc(4);this.prt=5;}
153            else{
154               this.dsc="The " + numer[nDays] + " Day in the Octave of Christmas";this.prt=2;}}
155         else{this.dsc=yrlEvntDesc(3);this.clr="whi";this.prt=9;}
156      }
157   }
158   // Easter
159   else{this.dsc=yrlEvntDesc(51);this.clr="whi";this.prt=9;}
160
161}
162function getFeast(){
163   switch(this.dt.getMonth()){
164   case 0:
165      switch(this.dt.getDate()){
166      case 1:
167	     if(this.prt<6){this.dsc=yrlEvntDesc(8);this.clr="whi";this.prt=6;};break;
168	  case 2:
169	     if(this.prt<2){this.dsc="Saints Basil the Great and Gregory of Nazianzen, Bishops and Doctors of the Church";this.clr="whi";this.prt=2;};break;
170	  case 4:
171	     if(this.prt<2){this.dsc="Memorial of Saint Elizabeth Ann Seton, Religious";this.clr="whi";this.prt=2;};break;
172	  case 5:
173	     if(this.prt<2){this.dsc="Memorial of Saint John Neumann, Bishop";this.clr="whi";this.prt=2;};break;
174      //case 6:
175	  //   if(this.prt<6){this.dsc=yrlEvntDesc(9);this.clr="whi";this.prt=6;};break;
176	  case 17:
177	     if(this.prt<2){this.dsc="Memorial of Saint Anthony, Abbott";this.clr="whi";this.prt=2;};break;
178	  case 21:
179	     if(this.prt<2){this.dsc="Memorial of Saint Agnes, Virgin and Martyr";this.clr="red";this.prt=2;};break;
180	  case 24:
181	     if(this.prt<2){this.dsc="Memorial of Saint Francis de Sales, Bishop and Doctor of the Church";this.clr="whi";this.prt=2;};break;
182	  case 25:
183	     if(this.prt<4){this.dsc="Feast of the Conversion of Saint Paul, Apostle";this.clr="whi";this.prt=4;};break;
184	  case 26:
185	     if(this.prt<2){this.dsc="Memorial of Saint Timothy and Saint Titus, Bishops";this.clr="whi";this.prt=2;};break;
186	  case 28:
187	     if(this.prt<2){this.dsc="Memorial of Saint Thomas Aquinas, Priest and Doctor of the Church";this.clr="whi";this.prt=2;};break;
188	  case 31:
189	     if(this.prt<2){this.dsc="Memorial of Saint John Bosco, Priest";this.clr="whi";this.prt=2;};break;
190	  default:break;}
191	  break;
192   case 1:
193      switch(this.dt.getDate()){
194      case 2:
195	     if(this.prt<6){this.dsc=yrlEvntDesc(71);this.clr="whi";this.prt=6;};break;
196      case 5:
197	     if(this.prt<2){this.dsc="Memorial of 26 Japanese Martyrs";this.clr="red";this.prt=2;};break;
198      case 6:
199	     if(this.prt<2){this.dsc="Memorial of Saint Agatha, Virgin and Martyr";this.clr="red";this.prt=2;};break;
200      case 10:
201	     if(this.prt<2){this.dsc="Memorial of Saint Scholastica, Virgin";this.clr="whi";this.prt=2;};break;
202      case 14:
203	     if(this.prt<2){this.dsc="Memorial of Saint Cyril, monk, and Saint Methodius, Bishop";this.clr="whi";this.prt=2;};break;
204      case 22:
205	     if(this.prt<2){this.dsc="Feast of the Chair of Saint Peter, Apostle";this.clr="whi";this.prt=2;};break;
206      case 23:
207	     if(this.prt<2){this.dsc="Memorial of Saint Polycarp, Bishop and Martyr";this.clr="red";this.prt=2;};break;
208	  default:break;}
209	  break;
210   case 2:
211      switch(this.dt.getDate()){
212	  case 2:
213	     if(this.prt<2){this.dsc="Memorial of Saint Perpetua and Saint Felicity, Martyrs";this.clr="red";this.prt=2;};break;
214	  case 17:
215	     if(this.prt<6){this.dsc="Feast of Our Lady of the Discovery of the Japanese Christians";this.clr="whi";this.prt=4;};break;
216	  case 19:
217	     if(this.prt<6){this.dsc="Solemnity of Saint Joseph, Husband of the Blessed Virgin Mary";this.clr="whi";this.prt=6;};break;
218	  case 20:
219	     if((this.dt.getDay()==1)&&(this.prt<6)){this.dsc="Solemnity of Saint Joseph, Husband of the Blessed Virgin Mary";this.clr="whi";this.prt=6;};break;
220	  case 25:
221	     if(this.prt<6){this.dsc="Solemnity of the Annunciation of the Lord";this.clr="whi";this.prt=6;};break;
222	  case 26:
223	     if((this.dt.getDay()==1)&&(this.prt<6)){this.dsc="Solemnity of the Annunciation of the Lord";this.clr="whi";this.prt=6;};break;
224	  default:break;}
225	  break;
226   case 3:
227      switch(this.dt.getDate()){
228	  case 25:
229	     if(this.prt<4){this.dsc="Feast of Saint Mark, Evangelist";this.clr="red";this.prt=4;};break;
230	  default:break;}
231	  break;
232   case 4:
233      switch(this.dt.getDate()){
234	  case 2:
235	     if(this.prt<2){this.dsc="Memorial of Saint Athanasius, Bishop and Doctor of the Church";this.clr="whi";this.prt=2;};break;
236	  case 3:
237	     if(this.prt<2){this.dsc="Feast of Saint Philip and Saint James, Apostles";this.clr="red";this.prt=2;};break;
238	  case 14:
239	     if(this.prt<4){this.dsc="Feast of Saint Matthias, Apostle";this.clr="whi";this.prt=4;};break;
240	  case 26:
241	     if(this.prt<2){this.dsc="Memorial of Saint Philip Neri, Priest";this.clr="whi";this.prt=2;};break;
242	  case 31:
243	     if(this.prt<4){this.dsc="Feast of the Visitation of the Blessed Virgin Mary";this.clr="whi";this.prt=4;};break;
244	  default:break;}
245	  break;
246   case 5:
247      switch(this.dt.getDate()){
248      case 1:
249         if(this.prt<2){this.dsc="Memorial of Saint Justin, Martyr";this.clr="red";this.prt=2;};break;
250      case 3:
251         if(this.prt<2){this.dsc="Memorial of Saint Charles Lwanga and Companions, Martyrs";this.clr="red";this.prt=2;};break;
252      case 5:
253         if(this.prt<2){this.dsc="Memorial of Saint Boniface, Bishop and Martyr";this.clr="red";this.prt=2;};break;
254      case 10:
255         if(this.prt<2){this.dsc="Memorial of Blessed Virgin Mary, Mother of the Church";this.clr="whi";this.prt=2;};break;
256      case 11:
257         if(this.prt<2){this.dsc="Memorial of Saint Barnabas, Apostle";this.clr="red";this.prt=2;};break;
258      case 13:
259         if(this.prt<2){this.dsc="Memorial of Saint Anthony of Padua, Priest and Doctor of the Church";this.clr="whi";this.prt=2;};break;
260      case 21:
261         if(this.prt<2){this.dsc="Memorial of Saint Aloysius Gonzaga, Religious";this.clr="whi";this.prt=2;};break;
262      case 24:
263         if(this.prt<6){this.dsc="Solemnity of the Nativity of Saint John the Baptist";this.clr="whi";this.prt=6;};break;
264      case 28:
265         if(this.prt<2){this.dsc="Memorial of Saint Irenaeus, Bishop and Martyr";this.clr="red";this.prt=2;};break;
266      case 29:
267         if(this.prt<6){this.dsc="Solemnity of Saints Peter and Paul, Apostles";this.clr="red";this.prt=6;};break;
268      default:break;}
269	  break;
270   case 6:
271      switch(this.dt.getDate()){
272      case 1:
273         if(this.prt<4){this.dsc="Memorial of Blessed Peter Kibe Kasui and his 187 companion martyrs";this.clr="red";this.prt=4;};break;
274      case 3:
275         if(this.prt<4){this.dsc="Feast of Saint Thomas, Apostle";this.clr="red";this.prt=4;};break;
276      case 11:
277         if(this.prt<2){this.dsc="Memorial of Saint Benedict, Abbot";this.clr="whi";this.prt=2;};break;
278      //case 14:
279      //   if(this.prt<2){this.dsc="Memorial of Blessed Kateri Tekakwitha, Virgin";this.clr="whi";this.prt=2;};break;
280      case 15:
281         if(this.prt<2){this.dsc="Memorial of Saint Bonaventure, Bishop and Doctor of the Church";this.clr="whi";this.prt=2;};break;
282      case 16:
283         if(this.prt<2){this.dsc="Memorial of Saint Bonaventure, Bishop and Doctor of the Church";this.clr="red";this.prt=2;};break;
284      case 22:
285         if(this.prt<2){this.dsc="Memorial of Saint Mary Magdalene";this.clr="whi";this.prt=2;};break;
286      case 25:
287         if(this.prt<4){this.dsc="Feast of Saint James, Apostle";this.clr="red";this.prt=4;};break;
288      case 26:
289         if(this.prt<2){this.dsc="Memorial of Saint Joachim and Saint Anne, parents of the Blessed Virgin Mary";this.clr="whi";this.prt=2;};break;
290      case 29:
291         if(this.prt<2){this.dsc="Memorial of Saint Martha";this.clr="whi";this.prt=2;};break;
292      case 31:
293         if(this.prt<2){this.dsc="Memorial of Saint Ignatius of Loyola, Priest";this.clr="whi";this.prt=2;};break;
294      default:break;}
295	  break;
296    case 7:
297      switch(this.dt.getDate()){
298      case 1:
299         if(this.prt<2){this.dsc="Memorial of Saint Alphonsus Liguori, Bishop and Doctor of the Church";this.clr="whi";this.prt=2;};break;
300      case 4:
301         if(this.prt<2){this.dsc="Memorial of Saint John Mary Vianney, Priest";this.clr="whi";this.prt=2;};break;
302      case 6:
303         if(this.prt<6){this.dsc=yrlEvntDesc(75);this.clr="whi";this.prt=6;};break; 		//Transfiguration of the Lord
304      case 8:
305         if(this.prt<2){this.dsc="Memorial of Saint Dominic, Priest";this.clr="whi";this.prt=2;};break;
306      case 10:
307         if(this.prt<2){this.dsc="Feast of Saint Lawrence, deacon and Martyr";this.clr="red";this.prt=2;};break;
308      case 11:
309         if(this.prt<2){this.dsc="Memorial of Saint Clare, Virgin";this.clr="whi";this.prt=2;};break;
310      case 14:
311         if(this.prt<2){this.dsc="Memorial of Saint Maximilian Mary Kolbe, Priest and Martyr";this.clr="red";this.prt=2;};break;
312      case 15:
313         if(this.prt<6){this.dsc=yrlEvntDesc(76);this.clr="whi";this.prt=6;};break;         //Assumption of the Blessed Virgin Mary
314      case 20:
315         if(this.prt<2){this.dsc="Memorial of Saint Bernard, Abbot and Doctor of the Church";this.clr="whi";this.prt=2;};break;
316      case 21:
317         if(this.prt<2){this.dsc="Memorial of Saint Pius X, Pope";this.clr="whi";this.prt=2;};break;
318      case 22:
319         if(this.prt<2){this.dsc="Memorial of the Queenship of the Blessed Virgin Mary";this.clr="whi";this.prt=2;};break;
320      case 24:
321         if(this.prt<4){this.dsc="Feast of Saint Bartholomew, Apostle";this.clr="red";this.prt=4;};break;
322      case 27:
323         if(this.prt<2){this.dsc="Memorial of Saint Monica";this.clr="whi";this.prt=2;};break;
324      case 28:
325         if(this.prt<2){this.dsc="Memorial of St. Augustine, Bishop and Doctor of the Church";this.clr="whi";this.prt=2;};break;
326      case 29:
327         if(this.prt<2){this.dsc="The Memorial of the Martyrdom of Saint John the Baptist";this.clr="red";this.prt=2;};break;
328      default:break;}
329	  break;
330   case 8:
331      switch(this.dt.getDate()){
332      case 3:
333         if(this.prt<2){this.dsc="Memorial of Saint Gregory the Great, Pope and Doctor of the Church";this.clr="whi";this.prt=2;};break;
334      case 8:
335         if(this.prt<4){this.dsc="Feast of the Nativity of the Blessed Virgin Mary";this.clr="whi";this.prt=4;};break;
336      case 9:
337         if(this.prt<2){this.dsc="Memorial of Saint Peter Claver, Priest";this.clr="whi";this.prt=2;};break;
338      case 13:
339         if(this.prt<2){this.dsc="Memorial of Saint John Chrysostom, Bishop and Doctor of the Church";this.clr="whi";this.prt=2;};break;
340      case 14:
341         if(this.prt<4){this.dsc="The exaltation of the Holy Cross";this.clr="red";this.prt=4;};break;
342      case 15:
343         if(this.prt<2){this.dsc="Memorial of Our Lady of Sorrows";this.clr="whi";this.prt=2;};break;
344      case 16:
345         if(this.prt<2){this.dsc="Memorial of Saint Cornelius, Pope and Martyr<br>and  Saint Cyprian, Bishop and Martyr";this.clr="red";this.prt=2;};break;
346      case 20:
347         if(this.prt<2){this.dsc="Memorial of Saint Andrew Kim Taegon, Priest and Martyr and  Saint Paul Chong Hasang, Martyr and their companions, Martyrs";this.clr="red";this.prt=2;};break;
348      case 21:
349         if(this.prt<4){this.dsc="Feast of Saint Matthew, Apostle and Evangelist";this.clr="red";this.prt=4;};break;
350      case 23:
351         if(this.prt<2){this.dsc="Memorial of Saint Pio of Pietrelcina, Priest";this.clr="whi";this.prt=2;};break;
352      case 27:
353         if(this.prt<2){this.dsc="Memorial of Saint Vincent de Paul, Priest";this.clr="whi";this.prt=2;};break;
354      case 28:
355         if(this.prt<2){this.dsc="Memorial of Saint Thomas Nishi and fifteen companion martyrs";this.clr="red";this.prt=2;};break;
356      case 29:
357         if(this.prt<4){this.dsc="Feast of Saint Michael, Saint Gabriel and Saint Raphael, Archangels";this.clr="whi";this.prt=4;};break;
358      case 30:
359         if(this.prt<2){this.dsc="Memorial of Saint Jerome, Priest and Doctor of the Church";this.clr="whi";this.prt=2;};break;
360      default:break;}
361	  break;
362   case 9:
363      switch(this.dt.getDate()){
364      case 1:
365         if(this.prt<2){this.dsc="Memorial of Saint Therese of the Child Jesus, Virgin and Doctor of the Church";this.clr="whi";this.prt=2;};break;
366      case 2:
367         if(this.prt<2){this.dsc="Memorial of the Guardian Angels";this.clr="whi";this.prt=2;};break;
368      case 4:
369         if(this.prt<2){this.dsc="Memorial of Saint Francis of Assisi, Religious";this.clr="whi";this.prt=2;};break;
370      case 7:
371         if(this.prt<2){this.dsc="Memorial of Our Lady of the Rosary";this.clr="whi";this.prt=2;};break;
372      case 15:
373         if(this.prt<2){this.dsc="Memorial of Saint Teresa of Jesus, Virgin and Doctor of the Church";this.clr="whi";this.prt=2;};break;
374      case 17:
375         if(this.prt<2){this.dsc="Memorial of Saint Ignatius of Antioch, Bishop and Martyr";this.clr="red";this.prt=2;};break;
376      case 18:
377         if(this.prt<4){this.dsc="Feast of Saint Luke, Evangelist";this.clr="red";this.prt=4;};break;
378      //case 19:
379      //   if(this.prt<2){this.dsc="Memorial of Saint John de Brebeuf and Saint Isaac Jogues, Priests and Martyrs, and their companions, Martyrs";this.clr="red";this.prt=2;};break;
380      //case 21:
381      //   if(this.prt<4){this.dsc="Feast of Saint Simon and Saint Jude, Apostles";this.clr="red";this.prt=4;};break;
382      default:break;}
383	  break;
384   case 10:
385      switch(this.dt.getDate()){
386      case 1:
387         if(this.prt<6){this.dsc=yrlEvntDesc(78);this.clr="whi";this.prt=6;};break; 		//All Saints
388      case 2:
389         if(this.prt<2){this.dsc=yrlEvntDesc(79);this.clr="vio";this.prt=2;};break; 		//Commemoration of All the Faithful Departed (All Souls)
390      case 4:
391         if(this.prt<2){this.dsc="Memorial of Saint Charles Borromeo, Bishop";this.clr="whi";this.prt=2;};break;
392      case 9:
393	     if(this.prt<4){this.dsc="Feast of the Dedication of the Lateran Basilica in Rome";this.clr="whi";this.prt=2;};break;
394      case 10:
395	     if(this.prt<2){this.dsc="Memorial of Saint Leo the Great, Pope and Doctor of the Church";this.clr="whi";this.prt=2;};break;
396      case 11:
397	     if(this.prt<2){this.dsc="Memorial of Saint Martin of Tours, Bishop";this.clr="whi";this.prt=2;};break;
398      case 12:
399	     if(this.prt<2){this.dsc="Memorial of Saint Josaphat, Bishop and Martyr";this.clr="red";this.prt=2;};break;
400      case 13:
401	     if(this.prt<2){this.dsc="Memorial of Saint Frances Xavier Cabrini, Virgin";this.clr="whi";this.prt=2;};break;
402      case 17:
403	     if(this.prt<2){this.dsc="Memorial of Saint Elizabeth of Hungary, Religious";this.clr="whi";this.prt=2;};break;
404      case 21:
405	     if(this.prt<2){this.dsc="Memorial of The Presentation of the Blessed Virgin Mary";this.clr="whi";this.prt=2;};break;
406      case 22:
407	     if(this.prt<2){this.dsc="Memorial of Saint Cecilia, Virgin and Martyr";this.clr="red";this.prt=2;};break;
408      case 24:
409	     if(this.prt<2){this.dsc="Memorial of Saint Andrew Dung-Lac, Priest and Martyr, and his companions, Martyrs";this.clr="red";this.prt=2;};break;
410      case 30:
411	     if(this.prt<4){this.dsc="Feast of Saint Andrew, Apostle";this.clr="red";this.prt=4;};break;
412	  default:break;}
413	  break;
414  case 11:
415      switch(this.dt.getDate()){
416	  case 3:
417	     if(this.prt<2){this.dsc="Memorial of Saint Francis Xavier, Priest";this.clr="whi";this.prt=2;};break;
418	  case 7:
419	     if(this.prt<2){this.dsc="Memorial of Saint Ambrose, Bishop and Doctor of the Church";this.clr="whi";this.prt=2;};break;
420	  case 8:
421	     if(this.prt<6){this.dsc="Solemnity of the Immaculate Conception of the Blessed Virgin Mary";this.clr="whi";this.prt=6;};break;
422	  case 9:
423	     if((this.dt.getDay()==1)&&(this.prt<6)){this.dsc="Solemnity of the Immaculate Conception of the Blessed Virgin Mary";this.clr="whi";this.prt=6;}break;
424	  case 12:
425	     if(this.prt<4){this.dsc="Feast of Our Lady of Guadalupe";this.clr="whi";this.prt=4;};break;
426	  case 13:
427	     if(this.prt<2){this.dsc="Memorial of Saint Lucy, Virgin and Martyr";this.clr="red";this.prt=2;};break;
428	  case 14:
429	     if(this.prt<2){this.dsc="Memorial of Saint John of the Cross, Priest and Doctor of the Church";this.clr="whi";this.prt=2;};break;
430	  case 26:
431	     if(this.prt<4){this.dsc="Feast of Saint Stephen, first martyr";this.clr="red";this.prt=4;};break;
432	  case 27:
433	     if(this.prt<4){this.dsc="Feast of Saint John, Apostle and evangelist";this.clr="whi";this.prt=4;};break;
434	  case 28:
435	     if(this.prt<4){this.dsc="Feast of the Holy Innocents, martyrs";this.clr="red";this.prt=4;};break;
436	  default:break;}
437	  break;
438   default:break;}
439
440}
441
442function weekDif(dtOrg,dtCur){
443   var nDif=Math.floor(Math.abs(dtCur.getTime()-dtOrg.getTime())/(ONE_DAY*7));
444   return nDif;
445}
446
447/*=======================================
448 Get Easter Dates
449 it works for all years from 326 to 4099 AD
450========================================*/
451function getEaster(nYear){
452   var g = nYear % 19;
453   var c = divInt(nYear,100);
454   var h = (c - divInt(c,4) - divInt(8*c+13,25) + 19 * g + 15) % 30;
455   var i = h - divInt(h,28) * (1 - divInt(h,28) * divInt(29,h+1) * divInt(21-g, 11));
456   var j = (nYear + divInt(nYear,4) + i + 2 - c + divInt(c,4)) % 7;
457   var nDay = i - j + 28;
458   var nMth=2;
459   return new Date(nYear,nMth,nDay);}
460function getJulianEaster(nYear){
461   var g = nYear % 19;
462   var i = (19 * g + 15) % 30;
463   var j = (nYear + divInt(nYear, 4) + i) % 7;
464   var nDay = i - j + 28;
465   var nMth=2;
466   return new Date(nYear,nMth, nDay);}
467function getOrtodoxEaster(nYear){
468   var dt=getJulianEaster(nYear);
469   var nAdd=0;
470   var nTmp=0;
471   if((nYear>1582)&&(nYear<4099)){
472      nAdd=10;
473      if(nYear>1600){
474	     nTmp=divInt(nYear,100)-16;
475		 nAdd+=nTmp-divInt(nTmp,4);}
476	   dt.setDate(dt.getDate()+nAdd);}
477   return dt;}
478function getAshWsd(dt){var dtOut=new Date(dt); dtOut.setDate(dtOut.getDate()-46);return dtOut;}
479function getPentacost(dt){var dtOut=new Date(dt); dtOut.setDate(dtOut.getDate()+49);return dtOut;}
480function divInt(nVal,nDiv){var nRes=Math.floor(Math.abs(nVal)/Math.abs(nDiv));return ((nVal*nDiv)>=0)?nRes:-nRes;}
481
482/*=======================================
483 First Sunday of Advent and Epiphany
484========================================*/
485function getAdvent(nYear){
486   var dt=new Date(nYear,11,25);
487   var nDif=dt.getDay();
488   if(nDif==0){nDif=7;}
489   dt.setDate(dt.getDate()-21-nDif);
490   return dt;
491}
492function getEpiphany(nYear){
493	var dt=new Date(nYear,0,1);
494	var nAdd=7-dt.getDay();
495    dt.setDate(dt.getDate()+nAdd);
496	return dt;}
497/*=======================================
498 Reading Cicle
499========================================*/
500// day: 0: Sunday; 1: Monday....
501function getCicle(year,day){
502   var sCl="W";
503   if(day>0){
504      switch(year % 2){
505        case 1: sCl="I";break;
506        default: sCl="II";break;}}
507   else{
508      switch(year % 3){
509         case 1: sCl="A";break;
510         case 2: sCl="B";break;
511         default: sCl="C";break;}}
512   return sCl;
513}
514
515function getReadingCicle(dDt){
516   var nYear=dDt.getFullYear();
517   var dAdv=getAdvent(nYear);
518   if(dDt.getTime()>=dAdv.getTime()){nYear++;}
519   return getCicle(nYear,dDt.getDay());
520}
521
522/*=======================================
523 Names
524========================================*/
525function yrlEvntDesc(nEvnt){
526   var sEvnt="";
527   switch(nEvnt){
528      case 1:sEvnt="First Sunday of Advent";break;
529      case 2:sEvnt="The Eve of the Nativity of the Lord";break;
530      case 3:sEvnt="Solemnity of the Nativity of the Lord (Christmas)";break;
531      case 4:sEvnt="Feast of the Holy Family of Jesus, Mary and Joseph";break;
532      case 5:sEvnt="Feast of Saint Stephen, the First Martyr";break;
533      case 6:sEvnt="Feast of Saint John, Apostle and Evangelist";break;
534      case 7:sEvnt="Feast of the Holy Innocents";break;
535      case 8:sEvnt="Solemnity of Mary, the Holy Mother of God";break;
536      case 9:sEvnt="Epiphany of the Lord";break;
537      case 10:sEvnt="The Baptism of the Lord";break;
538      case 31:sEvnt="Ash Wednesday";break;
539      case 32:sEvnt="Palm Sunday";break;
540      //case 33:sEvnt="Maundy Thursday - Last Supper";break;
541      case 33:sEvnt="Holy Thursday - Last Supper";break;
542      case 34:sEvnt="Good Friday - Lord's Passion and Death";break;
543      case 35:sEvnt="Holy Saturday - Paschal Vigil";break;
544      //case 51:sEvnt="Easter Sunday";break;
545      case 51:sEvnt="The Resurrection of the Lord";break;
546      case 52:sEvnt="Solemnity of the Ascension of the Lord";break;
547      case 53:sEvnt="Pentecost Sunday";break;
548      case 54:sEvnt="Solemnity of the Most Holy Trinity";break;
549      case 55:sEvnt="Solemnity of the Most Holy Body and Blood of Christ - First Communion";break;
550      case 56:sEvnt="Solemnity of the Most Sacred Heart of Jesus";break;
551      case 57:sEvnt="Memorial of the Immaculate Heart of the Blessed Virgin Mary";break;
552      case 58:sEvnt="Solemnity Our Lord Jesus Christ, King of the Universe";break;
553      case 71:sEvnt="The Presentation of the Lord";break;  //(February 2nd)
554      case 72:sEvnt="Solemnity of the Nativity of Saint John the Baptist";break;  //(June 24th)
555      case 73:sEvnt="Solemnity of Saint Peter and Saint Paul";break;  //(June 29th)
556      case 74:sEvnt="Feast of Saint James, Apostle";break;  //(July 25th)
557      case 75:sEvnt="Transfiguration of the Lord";break;  //(August 6th)
558      case 76:sEvnt="Assumption of the Blessed Virgin Mary";break;  //(August 15th)
559      case 77:sEvnt="Feast of the Exaltation of the Holy Cross";break;  //(September 14th)
560      case 78:sEvnt="All Saints Day";break;  //(November 1st)
561      case 79:sEvnt="Commemoration of All the Faithful Departed (All Souls)";break;  //(November 2nd)
562      case 80:sEvnt="Dedication of the Lateran Basilica";break;  //(November 9th)
563	  
564      case 101:sEvnt="Coming of Age Blessing, New Year's Party";break;
565      case 102:sEvnt="Retreat";break;
566      case 103:sEvnt="Advent Recollection";break;
567      case 104:sEvnt="Lenten Recollection";break;
568      case 105:sEvnt="The Sacrament of Reconciliation";break;
569      //case 106:sEvnt="Assumption of the Blessed Virgin Mary - Summer Festival";break;
570      case 107:sEvnt="The sacrament of Confirmation";break;
571      case 108:sEvnt="Mass for the deceased";break;
572      case 109:sEvnt="Shichigosan";break;
573      case 110:sEvnt="Thanksgiving mass for long life.";break;
574      //case 12:sEvnt="";break;
575      //case 13:sEvnt="";break;
576      //case 14:sEvnt="";break;
577      //case 15:sEvnt="";break;
578      case 201:sEvnt="General Assembly";break;
579      case 202:sEvnt="Cleaning before Christmas";break;
580      case 203:sEvnt="Cleaning before Easter";break;
581      case 224:sEvnt="Summer Festival (Evening)";break;
582      case 225:sEvnt="Summer camp for primary school children";break;
583      case 226:sEvnt="Summer camp for junior and high school students";break;
584      case 227:sEvnt="Bazaar";break;
585      //case 28:sEvnt="";break;
586	  default:break;}
587	  
588   return sEvnt;
589}
590
591
592//-->

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.