// JavaScript Document
now_d = 10;
now_m = 04;
now_y = 08;
now_th = 0;
now_tm = 0;
now_ts = 0;
off_y = 08;
off_m = 04;
off_d = 10;
off_th = 18;
off_tm = 0;
off_ts = 0;
dateNow = new Date(parseInt(now_y) + 2000,parseInt(now_m) - 1,now_d,now_th,now_tm,now_ts);
dateFuture = new Date(parseInt(off_y) + 2000,parseInt(off_m) - 1,off_d,off_th,off_tm,off_ts);	
dateNow = new Date() - 1 * 11 * 60 * 60 * 1000 - 1 * 60 * 60 * 1000;
<!--amount = 2 * 24 * 60 * 60 * 1000 - dateNow % (7 * 24 * 60 * 60 * 1000); -->
amount = 7 * 24 * 60 * 60 * 1000 - (7 * 24 * 60 * 60 * 1000);
//amount = dateFuture - dateNow;		
amount2 = amount;

function update_time() {
	
	amount = amount2 - 1000;
	amount2 = amount;
	if(amount < 0){
		set_inner('countdown_day', 'Expired!');
		set_inner('countdown', '00:00:00');	
		//window.location.reload();
	}else{	
		days = 0;
		hrs=0;
		mins=0;
		secs=0;
		amount = Math.floor(amount/1000);
		days=parseInt(Math.floor(amount/86400));
		amount=amount % 86400;
		hrs=parseInt(Math.floor(amount/3600));
		amount=amount % 3600;
		mins=parseInt(Math.floor(amount/60));
		if (hrs < 10) hrs = '0'+hrs;		
		if (mins < 10) mins = '0'+mins;		
		amount=amount % 60;
		secs=parseInt(Math.floor(amount));
		if (secs < 10) secs = '0'+secs;		
		set_inner('countdown', hrs+':'+mins+':'+secs);
		if (days == 0 || days == 1) {
			set_inner('countdown_day', 'Today!');
		}
		else {
			set_inner('countdown_day', +days+' Days!'); //set_inner('countdown_day', +days+' Days!');
		}
	}
	setTimeout('update_time()', 1000);
}		

function set_inner(name, value, add){
		var elem;
		if (document.getElementById) elem = document.getElementById(name);
		if (document.all) elem = document.all[name];
		if (elem && add) elem.innerHTML += value;
		if (elem && !add) elem.innerHTML = value;
}	
