var timerID = null;
var timerRunning = false;

function openpopup( URL, w, h)
{
  window.open( URL,'','toolbar=no,menubar=no,location=no,height='+h+',width='+w);
}

function MakeArray(size)
{ 
  this.length = size; 
  for (var i = 1; i <= size; i++) { this[i] = ""; } 
  return this;
}

function stopclock ()
{ 
  if (timerRunning) clearTimeout( timerID); 
  timerRunning = false;
}

function showtime ()
{ 
  var now   = new Date(); 
  var year  = now.getYear(); 
  var month = now.getMonth() + 1; 
  var date  = now.getDate(); 
  var hours = now.getHours(); 
  var min   = now.getMinutes(); 
  var day   = now.getDay(); 

  if (year < 2000) year = year + 1900;

  Day = new MakeArray(7); 
  Day[0] = "Sonntag"; 
  Day[1] = "Montag"; 
  Day[2] = "Dienstag"; 
  Day[3] = "Mittwoch"; 
  Day[4] = "Donnerstag"; 
  Day[5] = "Freitag"; 
  Day[6] = "Samstag"; 

  var timeValue = ""; 
  timeValue += (Day[day]) + ", "; 
  timeValue += date + "."; 
  timeValue += month + "."; 
  timeValue += year + "  |  ";
  timeValue += hours; 
  timeValue += ((min < 10) ? ":0" : ":") + min;

  document.datum.face.value = timeValue; 
  timerID = setTimeout( "showtime()", 2000);
  timerRunning = true;
}

function startclock ()
{
  stopclock();
  showtime();
}
