 <!-- hide the script from old browsers --
 // NUMBER - returns a string in place of a number
 function number(x) { 
   if (x==1) return "one";     if (x==2) return "two"; 
   if (x==3) return "three";   if (x==4) return "four"; 
   if (x==5) return "five";    if (x==6) return "six";
   if (x==7) return "seven";   if (x==8) return "eight"; 
   if (x==9) return "nine";    if (x==10) return "ten"; 
   if (x==11) return "eleven"; if (x==12) return "twelve";
   return x; //default   
 }
 function ishtime(h,m){    
   h = number(h)     
   if (m<=3 || m>57) return h+" o'clock"; 
   if (m<=7)  return "five past "+h;    if (m<=12) return "ten past "+h;  
   if (m<=17) return "quarter past "+h; if (m<=23) return "twenty past "+h;
   if (m<=28) return "twenty-five past "+h;
   if (m<=33) return "half past "+h; if (m<=38) return "twenty-five to "+h;
   if (m<=43) return "twenty to "+h; if (m<=48) return "quarter to "+h;
   if (m<=53) return "ten to "+h;    if (m<=58) return "five to "+h;
   return "h:m"; // never reached?
 }  
 function daytime(h) {   
   if (!h || h>21) return " at night"  
   if (h<12) return " in the morning";      
   if (h<=17) return " in the afternoon";      
   return " in the evening"; // default   
 }   
 function ish(h,m) {  
   if (!h && !m) { // if no time supplied, use the system time
     time = new Date()    
     h = time.getHours()       
     m = time.getMinutes()  
   }   
   z = daytime(h);   
   h = h % 12 // fix to 12 hour clock      
   if (m>57 && time.getSeconds()>30) m++; // round seconds
   if (m>60) m=0 // round up minutes     
   if (m>33) h++ // round up hours     
   if (h>12)  h = 1 // the clock turns round..    
   if (h==0) h = 12     
   return "It's now about "+ishtime(h,m)+z+" "
 }
 // This script is for the second line (The Greeting)
 function greeting(){
   var today = new Date();
   var hrs = today.getHours();
	now=new Date();
                  day=now.getDay();
if(day==6) day="Wednesday";
if(day==5) day="Tuesday";
if(day==4) day="Tuesday";
if(day==3) day="Monday";
if(day==2) day="Friday";
if(day==1) day="Thursday";
if(day==0) day="Wednesday";

// this part shows only 8am - 4 pm as the collection times. All else defaults to 8am
   var hrs2 = today.getHours();
	now=new Date();
                  hrs2=now.getHours();

   if (hrs2==1) hrs2="8am";   if (hrs2==2) hrs2="8am"; 
   if (hrs2==3) hrs2="8am";   if (hrs2==4) hrs2="8am"; 
   if (hrs2==5) hrs2="8am";   if (hrs2==6) hrs2="8am"; 
   if (hrs2==7) hrs2="8am";   if (hrs2==8) hrs2="9am"; 
   if (hrs2==9) hrs2="10am";  if (hrs2==10) hrs2="11am"; 
   if (hrs2==11) hrs2="12noon"; if (hrs2==12) hrs2="1pm";
   if (hrs2==13) hrs2="2pm";  if (hrs2==14) hrs2="3pm"; 
   if (hrs2==15) hrs2="4pm";  if (hrs2==16) hrs2="8am"; 
   if (hrs2==17) hrs2="8am";  if (hrs2==18) hrs2="8am"; 
   if (hrs2==19) hrs2="8am";  if (hrs2==21) hrs2="8am"; 
   if (hrs2==21) hrs2="8am"; if (hrs2==22) hrs2="8am"; 
   if (hrs2==23) hrs2="8am"; if (hrs2==24) hrs2="8am";

                  day2=now.getDay();
if(day2==6) day2="Wednesday";
if(day2==5) day2="Tuesday";
if(day2==4) day2="Tuesday";
if(day2==3) day2="Monday";
if(day2==2) day2="Friday";
if(day2==1) day2="Thursday";
if(day2==0) day2="Wednesday";

   if (hrs<16) document.write("and there is still time to order for delivery at ",hrs2," on ",day,".");
   else document.write("and it's too late for our next delivery. We can deliver on ",day2," after ",hrs2,"."); 

   document.writeln("<p>All deliveries are FREE in the City of Hamilton</p>");

   document.writeln("</CENTER>");
 }
 //--end hiding here -->
