/***********************************************************
 * CountDown
 **********************************************************/ 
var countDownTimer;
var countDownDestTime = Math.floor(Date.parse("24 Jul 2010 12:00:00 GMT") / 1000);

function countDown() {
  now = new Date();
  cTime = Math.floor(now.getTime() / 1000);
  
  rTime = countDownDestTime - cTime;
  
  ret = '<b>Countdown:</b><br />';
  
  if (rTime < 3600) { //Less than 1 hour
    ret += 'Fest in Gange!';
  } else {
    ret += 'Noch ';
    
    //Days
    dD = Math.floor(rTime / 86400); //86400 = 24 * 3600
    rTime -= dD * 86400;
    
    if (dD > 0) { //Min 1 day
      ret += dD + ' Tag';
      if (dD > 1) ret += 'e';
    } else { //Only some hours
      //Hours
      dH = Math.floor(rTime / 3600);
      rTime -= dH * 3600;

      ret += dH + ' Stunde';
      if (dH > 1) ret += 'n';
    }
  }
  
  $('#divCountdown').html(ret);
}

function startCountDown() {
  countDown();
  //countDownTimer = window.setInterval("countDown()", 1000);
}

