/**
 * runLater runs a generic function until that function returns 
 * true.
 * 
 * @param someFunction the function to execute until success.
 * it is expected to return true on success and false otherwise
 * and does not any args
 * @param timeOut the time between retry
 * @return
 */
function runLater(someFunction,timeOut){
	var status={isRunning:false};
	var run=function(){
		if(!someFunction())
		{
			status.isRunning=true;
			setTimeout(run,timeOut);
		}else{
			status.isRunning=false;
		}
	};
	this.start=function(){
		setTimeout(run,timeOut);
	}();	
	return status;
}


