﻿// <!-- Quick! Hide the java!

// Speaking of Java, this particular script is (C) Copyright 2002 Jim Tucek
// If you wish to use my CountDown script, these comments must be left
// alone!  That is all.

// Visit www.jracademy.com/~jtucek/ for script information and a bit of help
// setting it up, or www.jracademy.com/~jtucek/email.html for contact
// information.

// GO OUT Production GmbH, Daniel Reisacher
// Dieser Version wurde ?berarbeitet und kommt neu ohne Form Felder aus.
// Version 2004-05-21

// GO OUT Production GmbH, Daniel Reisacher
// Neu werden die einzelnen Werte in einzelnen <div> Tags geschrieben und nicht 
// mehr als gesamtes angezeigt.
// Version 2005-03-14

// GO OUT Production GmbH, Daniel Reisacher
// Sobald die Zahl, Datum und Zeitpunkt, erreicht wird. Werden nur noch
// Tag:0 Stunden:0 Minuten:0 Sekunden:0  Ausgegeben.
// Version 2006-07-23


var myTimer = "";

function start()
{
  // Event-Datum im folgenden Format Eintragen: July 21, 2004 07:00:00
  setup("May 01, 2011 09:00:00");
  repeat()
}


function repeat()
{
  down("form1");
  setTimeout("repeat()",1000);
}

function setup(day)
{
  today = (new Date()).getTime();
  the_day = (new Date(day)).getTime();
  time = (the_day - today);
  myTimer = time;
}

function down(box)
{
  // Berechnung
  myTimer = myTimer - 1000;
  time = myTimer;
  days = (time - (time % 86400000)) / 86400000;
  time = time - (days * 86400000);
  hours = (time - (time % 3600000)) / 3600000;
  time = time - (hours * 3600000);
  mins = (time - (time % 60000)) / 60000;
  time = time - (mins * 60000);
  secs = (time - (time % 1000)) / 1000;
  if(days==1) out = "1 day, ";
  else out = days+" days, ";
  if(hours < 10) out = out+"0";
  out = out+hours+" hours ";
  if(mins < 10) out = out+"0";
  out = out+mins+" mins ";
  if(secs < 10) out = out+"0";
  out = "  " +out+secs+" secs "; 
  
  //  Alte Ausgabe auf eine Zeile
  //  out = " Race Countdown: " +out+secs+" secs "; 

  // Alte Ausgabe auf eine Zeile
  //document.getElementById("countdown").firstChild.nodeValue = out;

  if (the_day > today) {
	  document.getElementById("countdown_days").firstChild.nodeValue = days;
	  document.getElementById("countdown_hours").firstChild.nodeValue = hours;
	  document.getElementById("countdown_min").firstChild.nodeValue = mins;
	  document.getElementById("countdown_sec").firstChild.nodeValue = secs; 
  } 
  else {
	  document.getElementById("countdown_days").firstChild.nodeValue = 0;
	  document.getElementById("countdown_hours").firstChild.nodeValue = 0;
	  document.getElementById("countdown_min").firstChild.nodeValue = 0;
	  document.getElementById("countdown_sec").firstChild.nodeValue = 0; 

  }


  
}

//-->


