/*Copyright © 2004 Cliff Leitch*/pixtitles=new Array("Adam and Eve driven from Eden","Moses receives the Ten Commandments","Mary and baby Jesus","Parable of the Good Samaritan","Noah's ark","Ruth gleans in the field of Boaz","Young Jesus with Mary and Joseph","Zacchaeus climbs a tree","Abraham saved from sacrificing Isaac","Samson destroys the Philistine temple","Jesus blesses the children","Parable of the Prodigal Son","Pharaoh's daughter finds Moses","Samuel is called by God","Jesus carries His cross","Parable of the Lost Coin","Jesus prays at Gethsemane","Jesus is crucified","Women discover empty tomb","Jesus ascends to heaven")
pixlinks=new Array("Genesis_3_21_24","Deuteronomy_5_1_22","Luke_2_1_7","Luke_10_25_37","Genesis_7_1_5","Ruth_2_1_6","Luke_2_41_52","Luke_19_1_10","Genesis_22_1_12","Judges_16_25_31","Matthew_19_13_15","Luke_15_11_32","Exodus_2_1_10","1Samuel_3_1_14","John_19_16_30","Luke_15_8_10","Matthew_26_36_46","John_19_19_30","Matthew_28_1_10","Acts_1_1_11")
now=new Date
year=now.getFullYear()
mon=now.getMonth()
mday=now.getDate()
wday=now.getDay()
hour=now.getHours()
a=year%19
b=Math.floor(year/100)
c=year%100
d=Math.floor(b/4)
e=b%4
f=Math.floor((b+8)/25)
g=Math.floor((b-f+1)/3)
h=(19*a+b-d-g+15)%30
i=Math.floor(c/4)
k=c%4
l=(32+2*e+2*i-h-k)%7
m=Math.floor((a+11*h+22*l)/451)
p=(h+l-7*m+114)
EasterMonth=Math.floor(p/31)
EasterDay=(p%31)+1
PixWidth=0
PixHeight=0
PixName=""
Title=""
xLink=""
if(mon==2||mon==3){Edays=EasterDay+31*(EasterMonth-3)
NowDays=mday+31*(mon-2)
if(Edays-NowDays<=7&&Edays-NowDays>=0){PixWidth=450
PixHeight=100
PixName="imagefiles/Seasonal_easter.gif"
if(EasterMonth==3){Emonth="March"}
else{Emonth="April"}
Title="What is the history of Easter? (Sunday, "+Emonth+" "+EasterDay+")"
xLink="faq_easter.htm"}}
AdWeek=0
if(mon>=10){xday=mday
if(mon==10){xday-=30}
if(xday<=28){if(wday>0){xday-=wday}
if(xday>=-3){if(mon==11&&(mday>=25||(mday==24&&hour>=18))){AdWeek=5}
else{if(xday<=3){AdWeek=1}
else{if(xday<=10){AdWeek=2}
else{if(xday<=17){AdWeek=3}
else{AdWeek=4}}}}}}}
if((mon==11&&mday>=29)||(mon==0&&mday<=5)){PixWidth=344
PixHeight=125
PixName="imagefiles/Seasonal_newyear.gif"}
if(mon==10){ThDay=mday+4-wday
if(ThDay>=22&&ThDay<=28){if(wday<=5){PixWidth=400
PixHeight=195
PixName="imagefiles/Seasonal_thanksgiving.gif"
Title="What is the history of Thanksgiving? (Thursday, November "+ThDay+" in the U.S.)"
xLink="faq_thanksgiving.htm"}}}
if(mon==4){xday=mday
if(wday>0){xday=mday-wday+7}
if(xday>=8&&xday<=14){PixWidth=318
PixHeight=140
PixName="imagefiles/Seasonal_MothersDay.gif"
Title="Mother's Day in the U.S. is Sunday, May "+xday
}}

if(mon==5) { /* Jun; check Father's Day*/
xday=mday
if(wday>0){xday=mday-wday+7}
if(xday>=15&&xday<=21){PixWidth=450
PixHeight=67
PixName="imagefiles/Seasonal_FathersDay.gif"
Title="Father's Day in the U.S. is Sunday, June "+xday
}}

if(mon==2 && mday>=13 && mday<=17) { /* St. Patrick's Day Mar 17:Diplay 3/13-3/17*/
PixWidth=256
PixHeight=55
PixName="imagefiles/Seasonal_StPat.gif"
Title="Happy Saint Patrick's Day! (March 17)"
}

if(mon==1 && mday>=10 && mday<=14) { /* Valentine's Day Feb 14:Display 2/10-2/14*/
PixWidth=400
PixHeight=63
PixName="imagefiles/Seasonal_Valentine.gif"
Title="Happy Valentine's Day! (February 14)"
}


if(AdWeek) { /* Advent/Christmas */
  document.write("<TABLE BORDER=\"0\" CELLPADDING=\"5\" CELLSPACING=\"0\" WIDTH=\"20%\">\n")
  document.write("<TR><CENTER>\n")
  document.write("<TD WIDTH=\"100%\" NOWRAP>\n")
  document.write("<A HREF=\"faq_advent.htm\"><IMG SRC=\"\/imagefiles\/advent_" + AdWeek + ".gif\" WIDTH=\"152\" HEIGHT=\"150\" ALIGN=\"BOTTOM\" BORDER=\"0\" ALT=\"What is an Advent Wreath?\" TITLE=\"What is an Advent Wreath?\"><\/A>")
  document.write("<A HREF=\"faq_christmas.htm\"><IMG SRC=\"imagefiles\/Seasonal_christmas.gif\" WIDTH=\"325\" HEIGHT=\"150\" ALIGN=\"BOTTOM\" BORDER=\"0\" ALT=\"What is the history of Christmas?\" TITLE=\"What is the history of Christmas?\"><\/A>\n")
  document.write("<\/TD>\n")
  document.write("<\/TR>\n")
  document.write("<\/TABLE>\n")
}
else{if(PixWidth) { /* Other seasonal images */
  document.write("<TABLE BORDER=\"0\" CELLPADDING=\"5\" CELLSPACING=\"0\" WIDTH=\"20%\">\n")
  document.write("<TR>\n")
  document.write("<TD WIDTH=\"100%\" NOWRAP>")
  if(xLink) {document.write("<A HREF=\""+xLink+"\">")}
  document.write("<IMG SRC=\"" + PixName + "\" WIDTH=\"" + PixWidth + "\" HEIGHT=\"" + PixHeight + "\" ALIGN=\"BOTTOM\" BORDER=\"0\" ALT=\""+Title+"\" TITLE=\""+Title+"\" >")
  if(xLink) {document.write("<\/A>")}
  document.write("<\/TD>\n<\/TR>\n")
  document.write("<\/TABLE>\n")
}else{ /* default images */
  document.write("<TABLE BORDER=\"0\" CELLPADDING=\"0\" CELLSPACING=\"0\" WIDTH=\"90%\" COLS=\"4\">\n")
  document.write("<TR>\n")

  Etim=new Date /* Set to Easter Day, 12:59:59 PM */
  Etim.setMonth(EasterMonth-1) /* month 0-11 */
  Etim.setDate(EasterDay) /* day of month 1-31 */
  Etim.setHours(23) /* hour of day 0-23*/
  Etim.setMinutes(59) /* minutes 0-59*/
  Etim.setSeconds(59) /* seconds 0-59*/
  Emsec = Etim.getTime() /* returns # msec from 1/1/70 to Easter 12:59:59 PM */
  Lmsec = Emsec - 47*86400000 /* beginning of Lent (Ash Wednesday) */
  Tmsec = now.getTime() /* returns # msec from 1/1/70 to now */

  if(Tmsec>=Lmsec && Tmsec<=Emsec) { /* Ash Wednesday thru Easter Day */
    ImID = "L" /* image set for Lent */
    ndx = 15 /* starting index - 1 in pixtitles */
  } else {
    ImID = mon%4 + 1 /* default image sets 1-4 rotate each month */
    ndx = ImID*4 - 5 /* starting index - 1 in pixtitles */
  }
  for (j=1; j<=4; j++) { /* 4 image panels */
    document.write("<TD>\n")
    document.write("<P ALIGN=\"CENTER\"><A HREF=\"javascript:squote('"+pixlinks[ndx+j]+"')\"><IMG SRC=\"imagefiles\/panel"+ImID+j+".gif\" WIDTH=\"110\" HEIGHT=\"110\" ALIGN=\"BOTTOM\" BORDER=\"0\" ALT=\""+pixtitles[ndx+j]+"\" TITLE=\""+pixtitles[ndx+j]+"\" ><\/A>")
    document.write("<\/TD>\n")
  }
  document.write("<\/TR>\n")
  document.write("<\/TABLE>\n")
}}




