function clsTimer(divId) {
	this.divId = divId;
}

clsTimer.prototype.startTimer = function() {
	this.startTime = Math.round((new Date()).getTime() / 1000);
	this.setTimer();
}

clsTimer.prototype.stopTimer = function() {
	this.startTime = Math.round((new Date()).getTime() / 1000);
	clearInterval(this.intervalHandle);
}

clsTimer.prototype.setTimer = function() {
	var myClass = this;

	function timerRelay() {
		myClass.handleTimer();
	}

	this.intervalHandle = setInterval(timerRelay, 1000);
}

clsTimer.prototype.handleTimer = function() {
	if (! (el = document.getElementById(this.divId)) ) {
		alert('missing divId: '+ this.divId);
	}
	now = Math.round((new Date()).getTime() / 1000);
	passedTime = now - this.startTime;
	passedTimeSeconds = passedTime % 60;
	passedTimeMinutes = Math.floor(passedTime / 60);
	if (passedTimeSeconds <= 9) {
		passedTimeSeconds = '0'+ passedTimeSeconds;
	}
	if (passedTimeMinutes <= 9) {
		passedTimeMinutes = '0'+ passedTimeMinutes;
	}
	el.innerHTML = passedTimeMinutes +':'+ passedTimeSeconds;
} 

