function CountDown(oname){
	this.Label = document.getElementById((oname));
	this.Timer = null;
	
	//can't depend on system clock for timing because of timezones. So load Current time from server.
	this.now = new Date(this.Label.getAttribute("cdate")).getTime(); //current date
	this.dt = new Date(this.Label.getAttribute("sdate")).getTime(); //start date
	this.sec = Math.round( (this.dt - this.now) / 1000 );
	
	this.tmpl = ["<sup>DAY</sup> &nbsp;","<sup>HRS</sup> &nbsp;","<sup>MIN</sup> &nbsp;","<sup>SEC</sup>"];
	this.num = [86400,3600,60,1];
	
	this.Update();
	
	return this;
}//func

CountDown.prototype.Update = function(){
	this.Label.innerHTML = this.GetTime();
}//func

CountDown.prototype.Start = function(){
	if(this.Timer != null) clearInterval(this.Timer);
	var oThis = this;
	this.Timer = setInterval(function(){oThis.Update();},1000);
}//func

CountDown.prototype.Stop = function(){
	if(this.Timer != null) clearInterval(this.Timer);
}//func


CountDown.prototype.GetTime = function(){
	if(sec < 1){
		this.Stop();
		this.Label.innerHTML = "Event has started.";
	}//if

	//var mili = this.dt - this.now;
	//var sec = Math.round( mili / 1000 );
	var sec = this.sec--;
	var buf = "";
	var time = 0;
	
	for(i=0; i < 4; i++){
		time = Math.floor(sec / this.num[i]);
		if(time > 0) sec %= (time * this.num[i]);
		
		if(time < 10) time = "0" + time; 
		buf +=  time + this.tmpl[i];
	}//for	
	return buf;
}//func