var timerID = null;
var timerRunning = false;
function START() {
  stopclock();
  showtime();
}

function showtime() {
  var now = new Date();
  var year = now.getYear();
  var month = now.getMonth() + 1;
  var date = now.getDate();
  var day = now.getDay();
  var hours = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds();

  var timeValue = ((date < 10) ? "0" : "") + date + "-";
  timeValue += ((month < 10) ? "0" : "") + month + "-";
  timeValue += year;
  dateplace.print(timeValue);

  var timeValue = hours;
  timeValue += ((minutes < 10) ? ":0" : ":") + minutes
  timeValue += ((seconds < 10) ? ":0" : ":") + seconds
  timeplace.print(timeValue);

  timerID = setTimeout("showtime()",1000);
  timerRunning = true;
}

function stopclock() {
  if(timerRunning) clearTimeout(timerID);
  timerRunning = false;
}

function PlaceHolder(obj) {
  if (document.layers) this.place = eval('document.'+obj+'.document');
  if (document.all) this.place = eval(obj);
  this.print = PlacePrint;
}

function PlacePrint(theText) {
  theText = '<font size="-2" face="Verdana" color="#000000">'+theText+'</font>';
  if (document.layers) {
    this.place.write(theText);
    this.place.close();
  }
  if (document.all) {
    this.place.innerHTML=theText;
  }
}

function Init() {
  dateplace = new PlaceHolder('DateDisplay');
  timeplace = new PlaceHolder('TimeDisplay');
  
  window.setTimeout("START()",1000);
}
