var varDate = new Date();
    
    now_d = varDate.getDate();
    now_m = varDate.getMonth();
    now_y = varDate.getFullYear() - 2000;

    now_th = varDate.getHours();
    now_tm = varDate.getMinutes();
    now_ts = varDate.getSeconds();

    off_y = now_y;
    off_m = now_m;
    off_d = now_d;

    off_th = 23;
    off_tm = 59;
    off_ts = 59;

    //dateNow = new Date(parseInt(now_y) + 2000,parseInt(now_m) - 1,now_d,now_th,now_tm,now_ts);
    dateNow = new Date();
    dateFuture = new Date(parseInt(off_y) + 2000,parseInt(off_m),off_d,off_th,off_tm,off_ts);	
    amount = dateFuture - dateNow;		
    amount2 = amount;

    function set_date()
    {
      var Monthes = new Array ('January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December');
      set_inner("date", Monthes[off_m]+' '+off_d+', '+(parseInt(off_y)+2000));
    }

    function update_time() {
      set_inner("time",'00:00:00');
	    amount = amount2 - 1000;
	    amount2 = amount;
	    if(amount < 0){
		    set_inner('time', 'Expired!');	
		    //window.location.reload();
	    }else{	
		    hrs=0;
		    mins=0;
		    secs=0;
		    amount = Math.floor(amount/1000);
		    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('time', hrs+':'+mins+':'+secs);
	    }
	    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;
      }	
