
// CLASS DSTimer
var DSTimer = function(elementId, startTime, endTime) {
	this.element = document.getElementById(elementId);

	this.todayTime = this.getGmtDate(new Date());
	this.setStartTime(startTime);
	this.setEndTime(endTime);

	this.updateDisplay();
}

	DSTimer.prototype.setStartTime = function(startTime) {
		this.startTime = new Date(startTime);
	}
	
	DSTimer.prototype.setEndTime = function(endTime) {
		this.endTime = new Date(endTime);
	}
	
	DSTimer.prototype.updateDisplay = function() {
		if ((this.startTime.getTime() < this.todayTime.getTime()) && (this.todayTime.getTime() < this.endTime.getTime()))
		this.element.style.display = "";
	}
	
	DSTimer.prototype.getGmtDate = function(theDate) {
		timeDifference = (new Date()).getTimezoneOffset();
		if (typeof(theDate) == "undefined") theDate = new Date();
		
		theDate.setUTCHours(theDate.getUTCHours() + (timeDifference / 60));
		
		return theDate;
	}
