var sub = new Array(4), link = Array(2)
for (var i=0;i<sub.length;i++){
   sub[i]=Array(12);
   for (var j=0;j<sub[i].length;j++){
     sub[i][j]=Array("");}}
//sub[0][10] = Array("29From Eden To Calvary: A Bible Study in the Doctrine of the Atonement")
sub[1][0] = Array("03Catholicism in End Time Prophecies","10Casinos, Lotteries and Our Calling in Christ","17Difficult Passages: The Pre-Existence of Christ","24In the Beginning: Evidence For Creation and the Flood","31Modern Reasons for Faith in God")
sub[1][1] = Array("07Old Testament prophecies of Christ","14Jewish survival in the Middle Ages: A witness to God's plan","21The extent of our 'giving honour to the king' (1 Peter 2:17)","28Keys to understanding the Bible")
sub[1][2] = Array("07What it means to deny ourselves (Mark 8:34)","14The invisible hand of God","21Practical lessons from the seven ecclesias in Revelation","28The Bible's power to transform us")
sub[1][3] = Array("04Evidence for the resurrection of Jesus","11Changes in Europe foretold in the Bible","18What the Lord requires of you and me (Micah 6:8)","25How the second coming of Christ will change the world")
sub[1][4] = Array("02Why it is vital to be in Christ and not in Adam","09Catholicism in End Time prophecies - Part 1","16Biblical examples of life at a crossroad: Making the right choices","23Is the Bible true? What proof is there?","30Ontario Spring Gathering")
sub[1][5] = Array("06Is there life beyond death?","13The ideal ecclesia")
sub[2][0] = Array("06Lessons From Ecclesiastes","13Film Night","20Examples of Design in God's Creation","27Word Meanings: Faith vs. Faithfulness")
sub[2][1] = Array("05The Brevity of Life","10The Old Covenant","17The New Covenant","24Practical Suggestions for Bible Study: The Kingdom of God")
sub[2][2] = Array("03Mount Moriah - Its Place in History","10Daily Readings","17Film Night","24The Role of the Temple in Jerusalem and the Prophecies of Daniel","31Business Meeting")
sub[2][3] = Array("07Natural & Spiritual Babylon","17Family Night - Tansley Woods","21Ships of Tarshish V","28Character Study: Jonathan - David's Friend")
sub[2][4] = Array("05Prophecies Yet to be Fulfilled in Zechariah","12The Exhortations of Moses","19Obscure Names in the Bible (Huz, Buz, Zebah, Zalmunna, etc.)","28The Race for Eternal Life")
sub[3][0] = Array("")


link[0] = Array("Bible Study Day", "Bible Study","Wednesday Night Class","Young People's Class")
link[1] = Array("events/signup.htm", "events/afternoon-bible-study.htm","events/wednesday-evening-bible-class.htm","events/young-peoples-class.htm")

var d = new Date(), day = d.getDate(), month = d.getMonth();
var aMonth = Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec");
nNews=new Array()
nNews[0]=new Array()
nNews[0]["text"]=""
nNews[0]["link"]="#"

for (var s,i=0,j=0;i<sub.length;i++){

month = d.getMonth();
day = d.getDate();
if (i==0) {month=11; day=1;}

s = findTopic(link[0][i],sub[i])
if (s.length){
nNews[j]=new Array()
nNews[j]["text"]=s
nNews[j]["link"]=link[1][i]
j++}}

function findTopic(h,arrTopic){
var m,d2,s, y
for (m=month;m<12;m++){
if (arrTopic[m].length) break}
if (arrTopic[m][0].length==0) return '';
for (var i=0;i<arrTopic[m].length;i++){
d2=arrTopic[m][i].substr(0,2)
if (m!=month) break
if (parseInt(d2,10) >= day) break}
y = d.getFullYear();
if (i==arrTopic[m].length){
if (m==11) {m=-1; y=d.getFullYear()+1;}
m+=1;i=0;
if (arrTopic[m][i].length==0) return '';
d2=arrTopic[m][0].substr(0,2)}
s=arrTopic[m][i].substr(2)

return(aMonth[m] + ' ' + parseInt(d2,10) + ', ' + y + ": <b>" + h + " -</b> " + s);}