

function getFcnRef(ob_,fcn_){
	try{
	if (ob_ != null){
		return( function(){ob_[ fcn_]()});
	}
}catch(error){
	alert('erreur detecte : '+error);
}
	
}

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

PeriodicalExecuter.prototype.stop = function() {
    clearInterval(this.intervalID);
}
*/
PeriodicalExecuterToggled = Class.create();
Object.extend(Object.extend(PeriodicalExecuterToggled.prototype, PeriodicalExecuter.prototype), 
 {
     initialize: function(callback, frequency) {
         this.callback = callback;
         this.frequency = frequency;
         this.currentlyExecuting = false;
         this.timer = null;
         this.registerCallback();
     },
 
     registerCallback: function() {
         this.timer = setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
     },
 
     clearCallback: function() {
         clearInterval(this.timer);
         this.timer = null;
     },
 
     setFrequency: function(f) {
         this.frequency = f;
         if (this.timer != null) {
             this.clearCallback();
             this.registerCallback();
         }
     }
 });
//end fix

