<!-- hide

// -------------------------------------------------------
//  Javascript written by Jae Yoon			  
//  Copyright © 1995-2007, Jae Yoon. All rights reserved. 
//  You can copy the source but just keep the recognition 
//  to the programmer					  
//  Ideas are priceless, Say NO to piracy!		  
// -------------------------------------------------------


  // Greeting and Time of the day in english

<!-- Original:  Rob Patrick (rpatrick@mit.edu) -->

<!--  hide

days = new Array();
days[1] = "Sunday";    days[5] = "Thursday";
days[2] = "Monday";    days[6] = "Friday";
days[3] = "Tuesday";   days[7] = "Saturday";
days[4] = "Wednesday";


   today=new Date();
   hrs=today.getHours();
   day=today.getDate();
   year=today.getYear();
   month=today.getMonth()+1;

   day2  = today.getDay() + 1;

if ((hrs >=6) && (hrs <=18))
   {}
else
   document.write("</BR>");
   document.write("<TABLE CELLPADDING=5 CLASS=\"ssBks\"><TR><TD>Good ");
if (hrs < 6)
   document.write("(Early) Morning");
   else if (hrs < 12)
      document.write("Morning");
   else if (hrs <= 18)
      document.write("Afternoon");
else
   document.write("Evening");
   document.writeln("!");
   document.write("</TD></TR><TR>");

if (day==1) end=("st");
  else if (day==2) end=("nd");
  else if (day==3) end=("rd");
  else if (day==21) end=("st");
  else if (day==22) end=("nd");
  else if (day==23) end=("rd");
  else if (day==31) end=("st");
  else end=("th");
if (month==1) name=("January");
  else if (month==2) name=("February");
  else if (month==3) name=("March");
  else if (month==4) name=("April");
  else if (month==5) name=("May");
  else if (month==6) name=("June");
  else if (month==7) name=("July");
  else if (month==8) name=("August");
  else if (month==9) name=("September");
  else if (month==10) name=("October");
  else if (month==11) name=("November");
  else name=("December");
if (year<100) year="19" + year;

      document.write("<TD>Today is ");
      document.write("<SPAN CLASS=\"ssbBls\">");
      document.write(days[day2] + "</BR>" + name + " " + day + end + ", " + year);
      document.write("</SPAN>.</TD>");


   day = new Date();
   miVisit = day.getTime();

function clock() {
   dayTwo = new Date();
   hrNow = dayTwo.getHours();
   mnNow = dayTwo.getMinutes();	
   scNow = dayTwo.getSeconds();
   miNow = dayTwo.getTime();

   if (hrNow == 0) {
      hour = 12;
      ap = " AM";
      } 
   else if(hrNow <= 11) {
      ap = " AM";
      hour = hrNow;
      } 
   else if(hrNow == 12) {
      ap = " PM";
      hour = 12;
      } 
   else if (hrNow >= 13) {
      hour = (hrNow - 12);
      ap = " PM";
   }


   if (hrNow >= 13) {
      hour = hrNow - 12;
   }
   if (mnNow <= 9) {
      min = "0" + mnNow;
   }
   else (min = mnNow)


   if (scNow <= 9) {
      secs = "0" + scNow;
      } 
   else {
      secs = scNow;
   }

      time = hour + ":" + min + ":" + secs + ap;

   document.form.button.value = time;
   self.status = time;
   setTimeout('clock()', 1000);
}

function timeInfo() {
   milliSince = miNow;
   milliNow = miNow - miVisit;
   secsVisit = Math.round(milliNow / 1000);
   minsVisit = Math.round((milliNow / 1000) / 60);
   alert("Thank you for visiting CEE Website!");
}

   document.write("</TR><TR><TD VALIGN=top>Current local time is ");

   document.write("<form name=\"form\">"
   + "<input type=button value=\"Click for info!\""
   + " name=button onClick=\"timeInfo()\"></form>");
   onError = null;

clock();
document.write("</TD></TR></TABLE>");
// End -->


// End -->

