function transicion(curva,ms,callback){
    this.ant=0.01;
    this.done_=false;
    var _this=this;
    this.start=new Date().getTime();
    this.init=function(){
        setTimeout(function(){
                if(!_this.next()){
                    callback(1);
                    _this.done_=true;
                    window.globalIntervalo=0;
                    return;
                }
                callback(_this.next());
                _this.init();
            },13);
    }
    this.next=function(){
        var now=new Date().getTime();
        if((now-this.start)>ms)
            return false;
        return this.ant=curva((now-this.start+.001)/ms,this.ant);
    }
}

function desacelerado(p,ant){
    var maxValue=1, minValue=.001, totalP=1, k=.25;
    var delta = maxValue - minValue; 
    var stepp = minValue+(Math.pow(((1 / totalP) * p), k) * delta); 
    return stepp; 
} 	

function elasticoFuerte(p,ant){
    if(p<=0.6){
        return Math.pow(p*5/3,2);}
    else{
        return Math.pow((p-0.8)*5,2)*0.6+0.6;
    }
}

function elasticoSuave(p,ant){
    if(p<=0.6){
        return Math.pow(p*5/3,2);
    }else{
        return Math.pow((p-0.8)*5,2)*0.4+0.6;
    }
}

function senoidal(p,ant){
    return (1 - Math.cos(p * Math.PI)) / 2;
}
