/* ======================================================================
Javascript include: Clock/Date_heading (c) @ctiveWEB
====================================================================== */


  function MakeArray(size) //Klokke & Dato i browser topp - @ctiveWEB 2004
  { this.length=size;
    for(var i=1; i <= size; i++)
    { this[i]="";
    }
    return this;
  }
  function showclock()
  { var now=new Date();
    var day=now.getDay();
    var date=now.getDate();
    var month=now.getMonth()+1;
    var year=now.getYear();
    var hours=now.getHours();
    var minutes=now.getMinutes();
    var seconds=now.getSeconds();

    days=new MakeArray(7);
    days[0]="Sunday,";
    days[1]="Monday,";
    days[2]="Tuesday,";
    days[3]="Wednesday,";
    days[4]="Thursday,";
    days[5]="Friday,";
    days[6]="Saturday,";
    months=new MakeArray(13);
    months[1]="January";
    months[2]="February";
    months[3]="March";
    months[4]="April";
    months[5]="May";
    months[6]="June";
    months[7]="July";
    months[8]="August";
    months[9]="September";
    months[10]="October";
    months[11]="November";
    months[12]="December";

    var vdate="";
    vdate += (days[day]) + "     ";
    vdate += (months[month]) + " ";
    vdate += date + " ";
    if (now.getYear() < 1000)
      vdate += now.getYear() + 1900
    else
      vdate += now.getYear();
    var vtime="";
    vtime += ((hours < 10) ? "0" : "") + hours;
    vtime += ((minutes < 10) ? ":0" : ":") + minutes;
    vtime += ((seconds < 10) ? ":0" : ":") + seconds;
    var vtitle="";
    vtitle="| Ocean Saver |";

    if (document.all || document.getElementById)
    { window.setTimeout("showclock()",1000);               // update frequency
      document.title = vtitle+" - "+vtime+" - "+vdate;
    }
    else
    { if ((seconds == 0) || (seconds == 10) || (seconds == 20) || (seconds == 30) || (seconds == 40) || (seconds == 50))
        window.setTimeout("showclock()",10000)
      else
        window.setTimeout("showclock()",1000);
      self.status = vtitle+"    "+vtime+"     "+vdate
    }
  }
  showclock()


