﻿var running = false
var endTime = null
var timerID = null

function startTimer() {
    running = true
    now = new Date()
    endTime = now.getHours() + 1
    showCountDown()
}

function showCountDown() {
    var now = new Date()
    now = now.getTime()
    var delta = new Date(endTime - now)
    var theMin = delta.getMinutes()
    var theSec = delta.getSeconds()
    var theTime = theMin
    theTime += ((theSec < 10) ? ":0" : ":") + theSec
    document.getElementById('dd').innerHTML = theTime
    if (running) {
        timerID = setTimeout("showCountDown()",900)
    }
}

startTimer();
