var div = window.document.getElementById("counter");
var html = "0";

var target_month = 7; //Zero based: 0 (January) to 11 (December)
var target_monthday = 18;
var target_year = 2012;
var target_hours =  7; //In military time: 0 (12am) to 23 (11pm)
var target_timezone = -1; //Current time zone = EDT; Target time zone = CDT

var ms_in_a_day = 86400000;

//Returns a Date object representing the target in the current time zone
var target_date = new Date(target_year, target_month, target_monthday, target_hours);

//Returns a Date object representing today's time in the current time zone
var today_date = new Date();

//Adjust current UTC hours for the target time zone
today_date.setUTCHours(today_date.getUTCHours() + target_timezone);

//Returns the number of milliseconds from January, 1 1970 12:00:00:00 AM UTC to the target_date
var ms_in_target = Date.UTC(target_date.getUTCFullYear(), target_date.getUTCMonth(), target_date.getUTCDate(), target_date.getUTCHours());

//Returns the number of milliseconds from January, 1 1970 12:00:00:00 AM UTC to the today_date
var ms_in_today = Date.UTC(today_date.getUTCFullYear(), today_date.getUTCMonth(), today_date.getUTCDate(), today_date.getUTCHours());

var days_in_target = ms_in_target / ms_in_a_day;
var days_in_today = ms_in_today / ms_in_a_day;

var days = Math.floor(days_in_target - days_in_today);

if (days >= 0) {
    html = days;
}

div.innerHTML = html;
