function timerClass() {
	function timerAtom(refId, timerId) { 
 	 	// page identifier (html id for instance)
 	 	this.refId = refId; 
		this.timerId = timerId;
  		return this;
 	}
 	

	function addTimer(refId, timeout, callback) {
		// see if the refId already is running
		//this.logTimers();
		internal = this.findTimer(refId);
		//console.log('addTimer: internal is '+internal);
		if (internal!==false) {
			// kill it
			//console.log('killing (no really)' + internal + '('+this.timers[internal].timerId+')');
			window.clearTimeout(this.timers[internal].timerId);
			throwaway = this.timers.splice(internal,1);
		} 
		
		// start a new countdown
		//console.log(timeout + ' ' + callback);
		timerId=window.setTimeout(callback,timeout);
		this.timers.push(timerAtom(refId, timerId));
 	}
 	
 	/* returns a internal id or false*/
 	function findTimer(refId) {
 		for (i=0; i<this.timers.length; i++) {
 			if (this.timers[i].refId==refId) {
 				return i;
 			}
 		}
 		return false;
 	}

	function killTimer(refId) {
		var aboutToDie = this.findTimer(refId)
		var ret = false;
		if (aboutToDie!==false) {
			window.clearTimeout(this.timers[aboutToDie].timerId);
			ret = this.timers.splice(aboutToDie,1);
		}
		return ret;
	}
	
 	function logTimers() {
 		for (i=0; i<this.timers.length; i++) {
 			console.log('killing' + i + '('+this.timers[i].timerId+')');
 		}
 		return true;
 	}
 	this.timers=new Array();
 	this.addTimer=addTimer;
 	this.findTimer=findTimer;
 	this.logTimers=logTimers;
	return this;
}

