
function SwitchImg()
{   var rem, keep=0, store, obj, switcher=new Array, history=document.Data;
    for (rem=0; rem < (SwitchImg.arguments.length-2); rem+=3) {
    	store = SwitchImg.arguments[(navigator.appName == 'Netscape')?rem:rem+1];
    if ((store.indexOf('document.layers[')==0 && document.layers==null) ||
        (store.indexOf('document.all[')==0 && document.all==null))
         store = 'document'+store.substring(store.lastIndexOf('.'),store.length);
         obj = eval(store);
    if (obj != null) {
   	   switcher[keep++] = obj;
      switcher[keep++] = (history==null || history[keep-1]!=obj)?obj.src:history[keep];
      obj.src = SwitchImg.arguments[rem+2];
  } }
  document.Data = switcher;
}

function RestoreImg()
{
  if (document.Data != null)
    for (var rem=0; rem<(document.Data.length-1); rem+=2)
      document.Data[rem].src=document.Data[rem+1];
}



Mname=new Array ("January","February","March","April","May","June","July","August","September","October","November","December")

function birthday(year,month,date,person) {
    this.year=year
    this.month=month
    this.date=date
    this.person=person
  }
  function birthdaylist() {  }

  blist=new birthdaylist()
  blist[0]= new birthday(1971,1,8,  "Lisa Tibbets             ")
  blist[1]= new birthday(1953,1,14, "Denis Lee                ")
  blist[2]= new birthday(1991,1,16, "Katy Anstice             ")
  blist[3]= new birthday(1985,1,18, "Michael Lee              ")
  blist[4]= new birthday(1987,1,31, "David Lee                ")
  blist[5]= new birthday(1983,2,4,  "Mark Lee                 ")
  blist[6]= new birthday(1981,2,4,  "Rachel Worth             ")
  blist[7]= new birthday(2002,2,11, "Luke Stiles              ")
  blist[9]= new birthday(1961,2,28, "Jackie Lee               ")
  blist[10]= new birthday(1932,2,25,"Joan Powell              ")
  blist[12]= new birthday(1954,3,4, "Raymond John Lewis       ")
  blist[13]= new birthday(1962,3,14,"Marlene Lee              ")
  blist[14]= new birthday(1945,3,17,"Ted Cox                  ")
  blist[15]= new birthday(2001,3,18,"Dilan Lee                ")
  blist[16]= new birthday(1983,3,24,"Rebecca Lee              ")
  blist[17]= new birthday(1960,3,24,"Jane Elgar               ")
  blist[18]= new birthday(1976,4,3, "Brett Stiles             ")
  blist[19]= new birthday(1976,4,3, "Kristan Hughes           ")
  blist[20]= new birthday(1992,4,12,"Daniel Boothroyd         ")
  blist[21]= new birthday(1962,4,18,"Susan Davies             ")
  blist[22]= new birthday(1964,4,22,"Andrew Lee               ")
  blist[23]= new birthday(1983,5,3, "Katie Worth              ")
  blist[24]= new birthday(1935,5,15,"Roy & Brian Teakle       ")
  blist[26]= new birthday(1959,5,25,"Chris                    ")
  blist[27]= new birthday(1957,6,1, "Brian                    ")
  blist[28]= new birthday(1951,6,3, "John Worth               ")
  blist[29]= new birthday(1937,6,11,"Gordan Evans             ")
  blist[30]= new birthday(1998,6,12,"Jack Stiles              ")
  blist[31]= new birthday(1958,6,19,"Peter Harper             ")
  blist[32]= new birthday(1955,6,25,"Robert Lee               ")
  blist[33]= new birthday(1987,7,14,"Amy Anstice              ")
  blist[34]= new birthday(1962,7,25,"Julia Teakle             ")
  blist[35]= new birthday(1926,7,31,"Terry Powell             ")
  blist[36]= new birthday(1995,8,1, "Daniel Lee               ")
  blist[37]= new birthday(1957,8,10,"Philip Elgar             ")
  blist[38]= new birthday(1996,8,11,"Laura Tibbets            ")
  blist[39]= new birthday(1967,8,16,"Pauline Lee              ")
  blist[40]= new birthday(1900,8,16,"Diane Hughes             ")
  blist[41]= new birthday(1986,8,20,"Jessica Lee              ")
  blist[42]= new birthday(1957,8,24,"David Powell             ")
  blist[43]= new birthday(1961,8,25,"Mark Teakle              ")
  blist[44]= new birthday(2003,9,12,"Alex Manley              ")
  blist[45]= new birthday(1964,9,18,"Richard Powell           ")
  blist[46]= new birthday(1985,9,22,"Gareth Lee               ")
  blist[48]= new birthday(2006,9,26,"Jake Lee                 ")
  blist[50]= new birthday(1900,9,29,"Vicky Lee                ")
  blist[51]= new birthday(1900,9,29,"Richard Lee              ")
  blist[52]= new birthday(1999,10,21,"Samuel Tibbetts          ")
  blist[53]= new birthday(1981,10,30,"Nichole Lee              ")
  blist[54]= new birthday(1975,10,31,"Carolyn Stiles           ")
  blist[55]= new birthday(1960,11,8, "Sue Elgar                ")
  blist[56]= new birthday(2003,11,04,"Eleanor Anstice          ")
  blist[57]= new birthday(1957,11,25,"Caryl Lee                ")
  blist[58]= new birthday(1995,11,29,"Amanda Boothroyd         ")
  blist[59]= new birthday(1996,12,4, "CaighLee Stiles          ")
  blist[60]= new birthday(1960,12,8, "Caroline Harper          ")
  blist[61]= new birthday(1971,12,19,"Andrea Hughes            ")
  blist[62]= new birthday(1951,12,24,"Terry Lee                ")

  var now=new Date()
  today=new Date(now.getYear(),now.getMonth(),now.getDate())
  function daysFromToday(sdate) {
    return Math.round((sdate.getTime()-today.getTime())/(24*60*60*1000))
  }

function writeNextBirthday(list) {
    var daysToClosest=889
    var closest=890
    var first=888


    for (l=0; l<2; l++) {

     for (var i in list) {
      if (i!=first) {
         thisDate=new Date(today.getYear(),list[i].month-1,list[i].date)

         if (daysFromToday(thisDate)<0 )
             { thisDate.setYear(today.getYear()+1) }
            if (daysFromToday(thisDate)<daysToClosest ) {
              	daysToClosest=daysFromToday(thisDate)
              	closest=i        }  // endif - next on list closer ?

           }
          }  //endfor each bday entry


     if (today.getYear() > 1999 && today.getYear() < 2020 )
         {

	 var age=(today.getYear()-list[closest].year)
	 if (daysToClosest==0)
          if (age<=21 )
	   document.write("Happy Birthday "+list[closest].person+" ,  "+age+" years old !!<br>")
          else
	   document.write("Happy Birthday "+list[closest].person+" !<br>")
          else if (daysToClosest==1)
           document.write("Tomorrow is "+list[closest].person+"'s Birthday !<br>")
          else
	    if (age<=21 )
	       document.write(list[closest].person+" will be "+age+" years old in just "+daysToClosest+" days time<br>")
		else
               document.write(list[closest].person+" will be celebrating a birthday in "+daysToClosest+" days time<br>")

	} // 1999-2020
         first=closest
	 daysToClosest=889
    	 closest=890

     }  //end 2 loop

} //endf

function writeall(list)
{
for (var i in list)
     { document.write("<pre>           "+list[i].person+"  "+Mname[list[i].month-1]+"  "+list[i].date+" </pre>") }
}

