/**
 * Extensions to the prototype library
 * @author Erik Rosengren
 *  
 */
 
 
 /**
  * Checks if a value exists in an array
  */
Array.prototype.inArray = function (value) {
	var i;
	for (i=0; i < this.length; i++) {
		if (this[i] == value) {
			return true;
		}
	}

	return false;
};


/**
 * not quite sure ...
 */ 
PeriodicalExecuter.prototype.registerCallback = function() {
    this.intervalID = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
}

/**
 * Extends the PeriodicalExecuter to include a function for stop() 
 */
PeriodicalExecuter.prototype.stop = function() {
    clearInterval(this.intervalID);
}