function MakeArray(n) 
{
   this.length = n
   return this
}
monthNames = new MakeArray(12)
monthNames[1] = "Janurary";
monthNames[2] = "February";
monthNames[3] = "March";
monthNames[4] = "April";
monthNames[5] = "May";
monthNames[6] = "June";
monthNames[7] = "July";
monthNames[8] = "August";
monthNames[9] = "Sept.";
monthNames[10] = "Oct.";
monthNames[11] = "Nov.";
monthNames[12] = "Dec.";
daysNames = new MakeArray(7)
daysNames[1] = "Sunday"
daysNames[2] = "Monday"
daysNames[3] = "Tuesday"
daysNames[4] = "Wednesday"
daysNames[5] = "Thursday"
daysNames[6] = "Friday"
daysNames[7] = "Saturday"
function showtime ()
{
   var now = new Date();
   var hours= now.getHours();
   var minutes= now.getMinutes();
   var seconds= now.getSeconds();
   var months= now.getMonth();
   var dates= now.getDate();
   var years= now.getYear();
   var ap="A.M.";
   if (hours == 12) 
   {
      ap = "P.M.";
   }
   if (hours == 0) 
   {
      hours = 12;
   }
   if(hours >= 13)
   {
      hours -= 12;
      ap="P.M.";
   }
   var timeValue2 = " " + hours;
   timeValue2 += ((minutes < 10) ? ":0":":") + minutes + " " + ap;
   return timeValue2;
}
function customDateSpring() 
{
   oneDate = new Date();
   var theDay = daysNames[oneDate.getDay() +1];
   var theDate =oneDate.getDate();
   var theMonth = monthNames[oneDate.getMonth() +1];
   dyears = oneDate.getFullYear();
   var dayth="th";
   if ((theDate == 1) || (theDate == 21) || (theDate == 31)) 
   {
      dayth="st";
   }
   if ((theDate == 2) || (theDate ==22)) 
   {
      dayth="nd";
   }
   if ((theDate== 3) || (theDate  == 23)) 
   {
      dayth="rd";
   }
   return theDay + ", " + theMonth + " " + theDate  + ", "+dyears;
}
function moving(take)
{
    var timer;
    msg = customDateSpring();
    clearTimeout(timer);
    msg += " " + showtime() + " ";
    var m1 ="  If you come across, or know of Vietnamese Buddhist Temples anywhere";
    var m2 ="   in the world that are not listed or incorrectly listed here, ";
    var m3 ="   we would appreciate your contribution to the chuavietnam.com database.";
    msg += m1 + m2 + m3 ;
    var outspace =" ";
    var c = 1;
     if (take>100) {
         take--;
          window.setTimeout("moving("+take +")",100); }
     else if (take <=100 && take >0) {
         for (c = 0; c<take; c++) { outspace +=" "; }
         outspace +=msg;
         take--;
         
         window.status = outspace;
          window.setTimeout("moving("+take +")",100);
         }
     else if (take<=0) {
          if(-take<msg.length) {
            outspace+=msg.substring(-take,msg.length);
            take--;
            
            window.status = outspace;
            window.setTimeout("moving("+take +")",100);
           }
          else {
                   window.status =" ";
                   window.setTimeout("moving(100)",75);
                   }
          }
}
