// DD-MM-YY || 07-06-02 rjbg start || 08-06-02 more || 15-06-02 works. Yay!// 08-07-02 preachers loaded// 28-07-02 Version 1.1a now has landed. hides today if after 13:00. version 1.0 now archived @ /scripts/1.0/preacher.js// 28-07-02 new format for id. date-DD-MM-YYYY . Old method still works, but this is tidier// 03-01-03 Work on 1.1.1 to work with new markup scheme.// Rational for hiding content from new brwosers is that it looks tidier to have only the next two month's services visible, and adding them with javascript and the dom would be an accessibility problem. || 25/07/02 // Javascript and DOM by RJBG.//get date etctoday = new Date();month = today.getMonth()+1;date = today.getDate();year = today.getFullYear();hour = today.getHours();mins = today.getMinutes();function showPreacher(){//ensure browser supports the W3C DOM/if (document.getElementsByTagName){//select elementsfg = document.getElementById("services");d = fg.getElementsByTagName("div");//loop through each <h4> in preacher boxfor (i=0;i<d.length;i++){l = document.getElementsByTagName("h4");//hide all the <h4>sd.item(i).style.display = "none";//and all their <dl>s//l.item(i).style.display = "none";//rip out the <h4>'s id and split it up into arrayid = l.item(i).getAttribute("id");idar = id.split(":");idar = idar[1].split("-");//get next year and next monthnyr = year+1;nmth = month+1;//display again if the month and year is correct,  and the date is greater than to today's.if (idar[1]==month && idar[2]==year && idar[0]>date){d.item(i).style.display = "block";//l.item(i).style.display = "block";}//display again is to today's and time is before 13:00else if (idar[1]==month && idar[2]==year && idar[0]==date && hour<13){d.item(i).style.display = "block";//l.item(i).style.display = "block";}//display again if the month is next month and the year is correct and date is the same as today's or less.else if (idar[1]==nmth && idar[2]==year && idar[0]<=date){d.item(i).style.display = "block";//l.item(i).style.display = "block";}//display again if the month is December and the year is next year and the month of the <li> is january.else if (month==12 && idar[2]==nyr && idar[1]==1){d.item(i).style.display = "block";l.item(i).style.display = "block";}}}}// below should be reviewed, as it is non DOM, but other methods are not well supported, esp by ie5/mac and ie5.1/macwindow.onload = showPreacher;