// 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events_table = document.getElementById("events");events_body = events_table.getElementsByTagName("tbody").item(0);tablerow = events_body.getElementsByTagName("tr");//loop through each <tr> in preacher boxfor (rowcounter=0;rowcounter< tablerow.length;rowcounter++){thisrow = tablerow.item(rowcounter);//rip out the <h4>'s id and split it up into arrayid = tablerow.item(rowcounter).getAttribute("id");id = id.substr(0,15);idar = id.split(":");idar = idar[1].split("-");rowyear = idar[2];rowmonth = idar[1];rowdate = idar[0];//eliminate last year and beforeif (rowyear<year){thisrow.style.display = "none";}//eliminate earlier months of current yearif (rowyear==year&&rowmonth<month){thisrow.style.display = "none";}//eliminate earlier days of current month of current yearif (rowyear==year&&rowmonth==month&&rowdate<date){thisrow.style.display = "none";}}}}// 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;
