﻿<!-- Begin
var Temp2;
var timerID = null;
var timerRunning = false;
var element = null;
function arry() {
    this.length = 12;
    this[0] = 31;
    this[1] = 28;
    this[2] = 31;
    this[3] = 30;
    this[4] = 31;
    this[5] = 30;
    this[6] = 31;
    this[7] = 31;
    this[8] = 30;
    this[9] = 31;
    this[10] = 30;
    this[11] = 31;
}
var date = new arry();

function stopclock() {
    if(timerRunning)
        clearTimeout(timerID);
    timerRunning = false;
}

function startclock(id) {
    element = document.getElementById(id);
    
    stopclock();
    showtime();
}

function showtime() {
    now = new Date();
    var CurDate = now.getDate();
    var CurMonth = now.getMonth();
    var CurHours = now.getHours();
    var CurMinutes = now.getMinutes();
    var CurSeconds = now.getSeconds();
    now = null;
    
    var Hoursleft = 16 - CurHours + 12;
    if (CurHours >= 12) { 
        Hoursleft += 11; CurDate += 1;
    }
    
    if (8 < CurDate) {
        CurDate -= date[CurMonth]; CurMonth++;
    }
    if (3 < CurMonth) {
        CurMonth -= 12;
    }

    var Monthleft = 3 - CurMonth;
    var Dateleft = 8 - CurDate;
    var Minutesleft = 60 - CurMinutes;
    var Secondsleft = 60 - CurSeconds;

    element.innerHTML = Monthleft + " months, " + Dateleft + " days, " + Hoursleft + " hours, " + Minutesleft + " minutes, " + Secondsleft + " seconds";

    timerID = setTimeout("showtime()",1000);
    timerRunning = true;
}
// End -->