{ var mydate=new Date(); 
var year=mydate.getYear(); 
if (year < 1000)  year+=1900; 
var day=mydate.getDay(); 
var month=mydate.getMonth();  //0-11
var daym=mydate.getDate(); 
if (daym<10)  daym="0"+daym; 
var fcolor='FFFFFF'; 
var bcolor='Green';
var season=' Week of Ordinary Time' ;
var Sunday=' ?st' ;
var  cycle=' - Cycle ?';
switch (year){
 case 2010: 
       cycle=' - Cycle C'; 
       switch (month) {
         case 0: fcolor='Black';bcolor='White';season='Christmas Season';Sunday=' ';
                 switch (daym) {
                   case '01':  bcolor='White'; fcolor='Black'; season='Solemnity of Mary, Mother of God'; Sunday=' ' ;   break
                   case '03':  bcolor='White'; fcolor='Black'; season='Solemnity of the Epiphany - Traditional'; Sunday=' ' ;   break
                   case 10:  bcolor='White'; fcolor='Black'; season='Baptism of the Lord'; Sunday=' ';  break
                   case 25:  bcolor='White'; fcolor='Black'; season='Conversion of Paul, Apostle'; Sunday=' ';  break
                   default: if (daym>30) {fcolor='White';bcolor='Green';season='Week in Ordinary Time';Sunday=' 4th '; }
                            else if (daym >23) {fcolor='White';bcolor='Green';season='Week in Ordinary Time';Sunday=' 3rd ';}
                            else if (daym >16) {fcolor='White';bcolor='Green';season='Week in Ordinary Time';Sunday=' 2nd ';} 
                            else if (daym >=11) {fcolor='White';bcolor='Green';season='Week in Ordinary Time';Sunday=' 1st ';} 
                       }
              break
         case 1: switch (daym) {
                   case '02':  bcolor='White'; fcolor='Black'; season='Presentation of the Lord'; Sunday=' ' ;   break
                   case 17: bcolor='Purple'; fcolor='White'; season='Ash Wednesday'; Sunday=' '; break
                   case 22: bcolor='White'; fcolor='Black'; season='Chair of Peter, Apostle'; Sunday=' '; break
                   default: if (daym>27) {fcolor='White';bcolor='Purple';season='Week in Lent';Sunday=' 2nd '; }
                            else if (daym >17) {fcolor='White';bcolor='Purple';season='Week in Lent';Sunday=' 1st ';}
                            else if (daym >13) {fcolor='White';bcolor='Green';season='Week in Ordinary Time';Sunday=' 6th '; }
                            else if (daym >6) {fcolor='White';bcolor='Green';season='Week in Ordinary Time';Sunday=' 5th '; }
                            else if (daym>=1) {fcolor='White';bcolor='Green';season='Week in Ordinary Time';Sunday=' 4th '; }
              }
                 break
         case 2: fcolor='White';bcolor='Purple';season='Week in Lent'; 
                 switch (daym) {
                   case 19: bcolor='White'; fcolor='Black'; season='Feast of Joseph, Husband of Mary'; Sunday=' '; break
                   case 25: bcolor='White'; fcolor='Black'; season='The Annunciation'; Sunday=' '; break
                   case 28: bcolor='Red'; fcolor='White'; season='Passion Sunday'; Sunday=' '; break
                   default: if (daym>27) Sunday=' 6th ';
                            else if (daym >20) Sunday=' 5th ';
                            else if (daym >13) Sunday=' 4th '; 
                            else if (daym >6) Sunday=' 3rd '; else if (daym >=1) Sunday=' 2nd ';
                      }
              break
         case 3: fcolor='Black';bcolor='White';season='Week in Easter Season';  
                 switch (daym) {
                   case '01':  bcolor='White'; fcolor='Black'; season='Holy Thursday'; Sunday=' ' ;   break
                   case '02':  bcolor='Red'; fcolor='Black'; season='Good Friday'; Sunday=' ' ;   break
                   case '03':  bcolor='White'; fcolor='Black'; season='Holy Saturday'; Sunday=' ' ;   break
                   case '04':  bcolor='White'; fcolor='Black'; season='Easter - He is Risen!'; Sunday=' ' ;   break
                   case 25: bcolor='White'; fcolor='Black'; season='Feast of Mark, Evangelist'; Sunday=' '; break
                   default: if (daym>24) Sunday=' 4th ';
                            else if (daym >17) Sunday=' 3rd ';
                            else if (daym >10) Sunday=' 2nd '; 
                            else if (daym >=1) Sunday=' 1st ';
                      }
              break
         case 4: fcolor='Black';bcolor='White';season='Week in Easter Season';  
                 switch (daym) {
                   case '01':  bcolor='White'; fcolor='Black'; season='Joseph the Worker'; Sunday=' ' ;   break
                   case 14: bcolor='White'; fcolor='Black'; season='Feast of Matthias, Apostle'; Sunday=' '; break
                   case 23: bcolor='Red'; fcolor='White'; season='Pentecost'; Sunday=' '; break
                   case 30: bcolor='White'; fcolor='Black'; season='Solemnity of the Holy Trinity'; Sunday=' '; break
                   case 31: bcolor='White'; fcolor='Black'; season='Feast of the Visitation'; Sunday=' '; break
                   default: if (daym>23) {fcolor='White';bcolor='Green';season='Week in Ordinary Time';Sunday=' 8th '; }
                            else if (daym >17) Sunday=' 6th ';
                            else if (daym >10) Sunday=' 5th '; 
                            else if (daym >=1) Sunday=' 4th ';
                     }
              break
         case 5: switch (daym) {
                   case '06':  bcolor='White'; fcolor='Black'; season='Solemnity of Corpus Christi'; Sunday=' ' ;   break
                   case 11:  bcolor='White'; fcolor='Black'; season='Solemnity of the Sacred Heart'; Sunday=' ' ;   break
                   case 12:  bcolor='White'; fcolor='Black'; season='Solemnity of the Immaculate Heart of Mary'; Sunday=' ' ;   break
                   case 24:  bcolor='White';fcolor='Black';season='Solemnity of the Birth of John the Baptist';Sunday=''; break
                   case 29:  bcolor='White';fcolor='Black';season='Solemnity of Peter and Paul, Apostles';Sunday=''; break
                   default: if (daym >26) Sunday=' 12th '; else if (daym >19) Sunday=' 11th '; 
                            else if (daym >12) Sunday=' 10th '; else if (daym >05) Sunday=' 9th '; 
                            else if (daym >=01) Sunday=' 8th '; }
              break
         case 6: switch (daym){
                  case '03': bcolor='White'; fcolor='Black'; season='Feast of Saint Thomas';Sunday=''; break
                  case 25: bcolor='Red'; fcolor='White'; season='Feast of Saint James';Sunday=''; break
                   default: if (daym >24) Sunday=' 16th '; else if (daym >17) Sunday=' 15th '; 
                            else if (daym >10) Sunday=' 14th '; else if (daym >03) Sunday=' 13th '; 
                            else if (daym >=01) Sunday=' 12th '; }
              break
         case 7: switch (daym) {
                   case '06':  bcolor='White'; fcolor='Black'; season='Feast of the Transfiguration'; Sunday=' ' ;   break
                   case 15:  bcolor='White';fcolor='Black';season='Solemnity of the Assumption';Sunday=''; break
                   default: if (daym >28) Sunday=' 21st '; else if (daym >21) Sunday=' 20th '; 
                            else if (daym >14) Sunday=' 19th '; else if (daym >=07) Sunday=' 18th '; 
                            else if (daym >=01) Sunday=' 17th '; }
              break
         case 8: switch (daym) {
                   case '08':  bcolor='White'; fcolor='Black'; season='Feast of the Birth of Mary'; Sunday=' ' ;   break
                   case 14:  bcolor='Red';fcolor='White';season='Triumph of the Cross';Sunday=''; break
                   case 21:  bcolor='White';fcolor='Black';season='Feast of Matthew, Apostle and Evangelist';Sunday=''; break
                   case 29:  bcolor='White';fcolor='Black';season='Feast of Michael, Gabriel and Raphael, Archangels';Sunday=''; break
                   default: if (daym >25) Sunday=' 26th '; else if (daym >18) Sunday=' 25th '; else if (daym >11) Sunday=' 24th '; 
                            else if (daym >04) Sunday=' 23rd '; else if (daym >=01) Sunday=' 22nd '; }
              break
         case 9: switch (daym) {
                   case 18:  bcolor='White';fcolor='Black';season='Feast of Luke, Evangelist';Sunday=''; break
                   case 28:  bcolor='White';fcolor='Black';season='Feast of Simon and Jude, Apostles';Sunday=''; break
                   default: if (daym >30) Sunday=' 31st '; else if (daym >23) Sunday=' 30th '; else if (daym >16) Sunday=' 29th '; else if (daym >09) Sunday=' 28th '; 
                            else if (daym >02) Sunday=' 27th '; else if (daym >=01) Sunday=' 26th '; }
              break
         case 10: switch (daym) {
                   case '01':  bcolor='White'; fcolor='Black'; season='Solemnity of All Saints'; Sunday=' ' ;   break
                   case '02':  bcolor='White'; fcolor='Black'; season='Solemnity of All Souls'; Sunday=' ' ;   break
                   case '09':  bcolor='White'; fcolor='Black'; season='Dedication of St John Lateran'; Sunday=' ' ;   break
                   case 28: cycle=' - Cycle C'; bcolor='Purple'; fcolor='White'; season='1st Sunday of Advent'; Sunday=' '; break
                   case 30: cycle=' - Cycle C'; bcolor='White'; fcolor='Black'; season='Feast of Andrew Apostle'; Sunday=' '; break
                   default: if (daym>20) {season='Christ the King'; Sunday=' ';} else if (daym >13) Sunday=' 33rd ';
                            else if (daym >06) Sunday=' 32nd '; else if (daym >=01) Sunday=' 31st '; }
              break
         case 11: cycle=' - Cycle C'; season='Week of Advent'; bcolor='Purple'; fcolor='White';
                  switch (daym) {
                   case '08':  bcolor='White'; fcolor='Black'; season='Solemnity of the Immaculate Conception'; Sunday=' ' ;   break
                   case '24':  bcolor='White'; fcolor='Black'; season='Anticipation of the Feast of Christmas'; Sunday=' ' ;   break
                   case '25':  bcolor='White'; fcolor='Black'; season='Solemnity of Christmas'; Sunday=' ' ;   break
                   case '27':  bcolor='White'; fcolor='Black'; season='Feast of the Holy Family'; Sunday=' ' ;   break
                   default: if (daym>=25) {bcolor='White'; fcolor='Black';Sunday=' ';season='Christmas Season'; }
                            else if (daym >18) Sunday=' 4th '; else if (daym >11) Sunday=' 3rd '; 
                            else if (daym >04) Sunday=' 2nd '; else if (daym >=01) Sunday=' 1st '; }
              break
         default: cycle='??'; season='??'; 
       }
      break
 case 2011: cycle=' - Cycle A'; 
      break
   case 2012:
                // NEEDS editting to the real calandar !!!!!!!!!!
             //could we load this as another external script here based on the year?
       cycle=' - Cycle B';
       switch (month) {
         case 0:
              break
         case 1:
              break
         case 2:  
              break
         case 3:  
              break
         case 4:
              break
         case 5:
              break
         case 6: switch (daym){
                  case '03': bcolor='White'; fcolor='Black'; season='Feast of Saint Thomas';Sunday=''; break
                  case 25: bcolor='Red'; fcolor='White'; season='Feast of Saint James';Sunday=''; break
                  default: if (daym >25) Sunday=' 17th '; }
              break
         case 7: switch (daym) {
                   case '06':  bcolor='White'; fcolor='Black'; season='Feast of the Transfiguration'; Sunday=' ' ;   break
                   case 15:  bcolor='White';fcolor='Black';season='Solemnity of the Assumption';Sunday=''; break
                   default: if (daym >29) Sunday=' 22nd '; else if (daym >22) Sunday=' 21st '; else if (daym >15) Sunday=' 20th '; 
                            else if (daym >08) Sunday=' 19th '; else if (daym >=02) Sunday=' 18th '; 
                            else if (daym =01) Sunday=' 17th '; }
              break
         case 8: switch (daym) {
                   case '08':  bcolor='White'; fcolor='Black'; season='Feast of the Birth of Mary'; Sunday=' ' ;   break
                   case 14:  bcolor='Red';fcolor='White';season='Triumph of the Cross';Sunday=''; break
                   case 21:  bcolor='White';fcolor='Black';season='Feast of Matthew, Apostle and Evangelist';Sunday=''; break
                   case 29:  bcolor='White';fcolor='Black';season='Feast of Michael, Gabriel and Raphael, Archangels';Sunday=''; break
                   default: if (daym >26) Sunday=' 26th '; else if (daym >19) Sunday=' 25th '; else if (daym >12) Sunday=' 24th '; 
                            else if (daym >05) Sunday=' 23rd '; else if (daym >=01) Sunday=' 22nd '; }
              break
         case 9: switch (daym) {
                   case 18:  bcolor='White';fcolor='Black';season='Feast of Luke, Evangelist';Sunday=''; break
                   case 28:  bcolor='White';fcolor='Black';season='Feast of Simon and Jude, Apostles';Sunday=''; break
                   default: if (daym >24) Sunday=' 30th '; else if (daym >17) Sunday=' 29th '; else if (daym >10) Sunday=' 28th '; 
                            else if (daym >03) Sunday=' 27th '; else if (daym >=01) Sunday=' 26th '; }
              break
         case 10: switch (daym) {
                   case '01':  bcolor='White'; fcolor='Black'; season='Solemnity of All Saints'; Sunday=' ' ;   break
                   case '02':  bcolor='White'; fcolor='Black'; season='Solemnity of All Souls'; Sunday=' ' ;   break
                   case '09':  bcolor='White'; fcolor='Black'; season='Dedication of St John Lateran'; Sunday=' ' ;   break
                   case 29: cycle=' - Cycle C'; bcolor='Purple'; fcolor='White'; season='1st Sunday of Advent'; Sunday=' '; break
                   case 30: cycle=' - Cycle C'; bcolor='White'; fcolor='Black'; season='Feast of Andrew Apostle'; Sunday=' '; break

                   default: if (daym>21) {season='Christ the King'; Sunday=' ';} else if (daym >14) Sunday=' 33rd ';
                            else if (daym >07) Sunday=' 32nd '; else if (daym >=01) Sunday=' 31st '; }
              break
         case 11: cycle=' - Cycle C'; season='Week of Advent'; bcolor='Purple'; fcolor='White';
                  switch (daym) {
                   case '08':  bcolor='White'; fcolor='Black'; season='Solemnity of the Immaculate Conception'; Sunday=' ' ;   break
                   case 24:  bcolor='White'; fcolor='Black'; season='Anticipation of the Feast of Christmas'; Sunday=' ' ;   break
                   case 25:  bcolor='White'; fcolor='Black'; season='Solemnity of Christmas'; Sunday=' ' ;   break
                   case 27:  bcolor='White'; fcolor='Black'; season='Feast of the Holy Family'; Sunday=' ' ;   break
                   default: if (daym>=25) {bcolor='White'; fcolor='Black';Sunday=' ';season='Christmas Season'; }
                            else if (daym >19) Sunday=' 4th '; else if (daym >12) Sunday=' 3rd '; 
                            else if (daym >05) Sunday=' 2nd '; else if (daym >=01) Sunday=' 1st '; }
              break
         default: cycle='??'; season='??'; 
       }
       break
default:
};
var seasondesc=Sunday+season+cycle; 
var dayarray=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"); 
var montharray=new Array("January","February","March","April","May","June","July","August","September","October","November","December"); 
document.write("<span style='background-color:"+bcolor+";'><font color='"+fcolor+"' face='Arial'><b>"+"&nbsp;&nbsp;"+dayarray[day]+", "+montharray[month]+" "+daym+", "+year+"&nbsp;");
document.write(seasondesc+"<span style='font-size:24pt;' align='right' >"+"&nbsp;&nbsp;"+"Welcome to our Parish Community");
document.write("&nbsp;&nbsp;&nbsp;"+"<\/span><\/b><\/font><\/span>") ;}
//style="line-height:2; margin-top:0; margin-bottom:0;" align="center"//
 
 
 







