function linearTween(t, b, c, d, s, p)
{
	return (c * t / d + b);
};

function easeInQuad(t, b, c, d, s, p)
{
    return (c * (t = t / d) * t + b);
};

function easeOutQuad(t, b, c, d, s)
{
    return (-c * (t = t / d) * (t - 2) + b);
};

function easeInOutQuad(t, b, c, d, s, p)
{
    if ((t = t / (d / 2)) < 1)
    {
        return (c / 2 * t * t + b);
    } // end if
    return (-c / 2 * (--t * (t - 2) - 1) + b);
};

function easeInCubic(t, b, c, d, s, p)
{
    return (c * (t = t / d) * t * t + b);
};

function easeOutCubic(t, b, c, d, s, p)
{
    return (c * ((t = t / d - 1) * t * t + 1) + b);
};

function easeInOutCubic(t, b, c, d, s, p)
{
    if ((t = t / (d / 2)) < 1)
    {
        return (c / 2 * t * t * t + b);
    } // end if
    return (c / 2 * ((t = t - 2) * t * t + 2) + b);
};

function easeInQuart(t, b, c, d, s, p)
{
    return (c * (t = t / d) * t * t * t + b);
};

function easeOutQuart(t, b, c, d, s, p)
{
    return (-c * ((t = t / d - 1) * t * t * t - 1) + b);
};

function easeInOutQuart(t, b, c, d, s, p)
{
    if ((t = t / (d / 2)) < 1)
    {
        return (c / 2 * t * t * t * t + b);
    } // end if
    return (-c / 2 * ((t = t - 2) * t * t * t - 2) + b);
};

function easeInQuint(t, b, c, d, s, p)
{
    return (c * (t = t / d) * t * t * t * t + b);
};

function easeOutQuint(t, b, c, d, s, p)
{
    return (c * ((t = t / d - 1) * t * t * t * t + 1) + b);
};

function easeInOutQuint(t, b, c, d, s, p)
{
    if ((t = t / (d / 2)) < 1)
    {
        return (c / 2 * t * t * t * t * t + b);
    } // end if
    return (c / 2 * ((t = t - 2) * t * t * t * t + 2) + b);
};

function easeInSine(t, b, c, d, s, p)
{
    return (-c * Math.cos(t / d * 1.570796E+000) + c + b);
};

function easeOutSine(t, b, c, d, s, p)
{
    return (c * Math.sin(t / d * 1.570796E+000) + b);
};

function easeInOutSine(t, b, c, d, s, p)
{
    return (-c / 2 * (Math.cos(3.141593E+000 * t / d) - 1) + b);
};


function easeInExpo(t, b, c, d, s, p)
{
    return (t == 0 ? (b) : (c * Math.pow(2, 10 * (t / d - 1)) + b));
};


function easeOutExpo(t, b, c, d, s, p)
{
    return (t == d ? (b + c) : (c * (-Math.pow(2, -10 * t / d) + 1) + b));
};

function easeInOutExpo(t, b, c, d, s, p)
{
    if (t == 0)
    {
        return (b);
    } // end if
    if (t == d)
    {
        return (b + c);
    } // end if
    if ((t = t / (d / 2)) < 1)
    {
        return (c / 2 * Math.pow(2, 10 * (t - 1)) + b);
    } // end if
    return (c / 2 * (-Math.pow(2, -10 * --t) + 2) + b);
};

function easeInCirc(t, b, c, d, s, p)
{
    return (-c * (Math.sqrt(1 - (t = t / d) * t) - 1) + b);
};

function easeOutCirc(t, b, c, d, s, p)
{
    return (c * Math.sqrt(1 - (t = t / d - 1) * t) + b);
};


function easeInOutCirc(t, b, c, d, s, p)
{
    if ((t = t / (d / 2)) < 1)
    {
        return (-c / 2 * (Math.sqrt(1 - t * t) - 1) + b);
    } // end if
    return (c / 2 * (Math.sqrt(1 - (t = t - 2) * t) + 1) + b);
};


function easeInElastic(t, b, c, d, s, p)
{
	var a = 0
	var p = 50
	
    if (t == 0)
    {
        return (b);
    } // end if
    if ((t = t / d) == 1)
    {
        return (b + c);
    } // end if
    if (!p)
    {
        p = d * 3.000000E-001;
    } // end if
    if (a < Math.abs(c))
    {
        a = c;
        var s = p / 4;
    }
    else
    {
        var s = p / 6.283185E+000 * Math.asin(c / a);
    } // end else if
    return (-a * Math.pow(2, 10 * (t = t - 1)) * Math.sin((t * d - s) * 6.283185E+000 / p) + b);
};

function easeOutElastic(t, b, c, d, s, p)
{
	var a = 0
	var p = 50
	
	if (t == 0)
    {
        return (b);
    } // end if
    if ((t = t / d) == 1)
    {
        return (b + c);
    } // end if
    if (!p)
    {
        p = d * 3.000000E-001;
    } // end if
    if (a < Math.abs(c))
    {
        a = c;
        var s = p / 4;
    }
    else
    {
        var s = p / 6.283185E+000 * Math.asin(c / a);
    } // end else if
    return (a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * 6.283185E+000 / p) + c + b);
};

function easeInOutElastic(t, b, c, d, s, p)
{
	
	var a = 0
	var p = 50
	
	if (t == 0)
    {
        return (b);
    } // end if
    if ((t = t / (d / 2)) == 2)
    {
        return (b + c);
    } // end if
    if (!p)
    {
        p = d * 4.500000E-001;
    } // end if
    if (a < Math.abs(c))
    {
        a = c;
        var s = p / 4;
    }
    else
    {
        var s = p / 6.283185E+000 * Math.asin(c / a);
    } // end else if
    if (t < 1)
    {
        return (-5.000000E-001 * (a * Math.pow(2, 10 * (t = t - 1)) * Math.sin((t * d - s) * 6.283185E+000 / p)) + b);
    } // end if
    return (a * Math.pow(2, -10 * (t = t - 1)) * Math.sin((t * d - s) * 6.283185E+000 / p) * 5.000000E-001 + c + b);
};

function easeInBack(t, b, c, d, s, p)
{
    if (s == "undefined")
    {
        s = 1.701580E+000;
    } // end if
    return (c * (t = t / d) * t * ((s + 1) * t - s) + b);
};

function easeOutBack(t, b, c, d, s, p)
{
    if (s == "undefined")
    {
        s = 1.701580E+000;
    } // end if
    return (c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b);
};

function easeInOutBack(t, b, c, d, s, p)
{
    if (s == "undefined")
    {
        s = 1.701580E+000;
    } // end if
    if ((t = t / (d / 2)) < 1)
    {
        return (c / 2 * (t * t * (((s = s * 1.525000E+000) + 1) * t - s)) + b);
    } // end if
    return (c / 2 * ((t = t - 2) * t * (((s = s * 1.525000E+000) + 1) * t + s) + 2) + b);
};

function easeInBounce(t, b, c, d, s, p)
{
    return (c - easeOutBounce(d - t, 0, c, d) + b);
};

function easeOutBounce(t, b, c, d, s, p)
{
    if ((t = t / d) < 3.636364E-001)
    {
        return (c * (7.562500E+000 * t * t) + b);
    }
    else if (t < 7.272727E-001)
    {
        return (c * (7.562500E+000 * (t = t - 5.454545E-001) * t + 7.500000E-001) + b);
    }
    else if (t < 9.090909E-001)
    {
        return (c * (7.562500E+000 * (t = t - 8.181818E-001) * t + 9.375000E-001) + b);
    }
    else
    {
        return (c * (7.562500E+000 * (t = t - 9.545455E-001) * t + 9.843750E-001) + b);
    } // end else if
};

function easeInOutBounce(t, b, c, d, s, p)
{
    if (t < d / 2)
    {
        return (easeInBounce(t * 2, 0, c, d) * 5.000000E-001 + b);
    } // end if
    return (easeOutBounce(t * 2 - d, 0, c, d) * 5.000000E-001 + c * 5.000000E-001 + b);
};


function easeSinc(t, b, c, d, s, p)
{
	Xtot = 0
	var ss = []
	var nn = [b]
	var ff = [c+b]
	ss = nn.concat(s,ff)
	for(xx=0; xx<ss.length; xx++){
		
		p1 = d/(ss.length-1)
		t1 = xx*p1//-(p1)-(p1/2)
		h1 = ss[xx]
						
		a1 = ((t+1)-t1)*(Math.PI/p1)
		if(a1==0){a1=1*(Math.PI/p1)}
		X1 = ((Math.sin(a1))/a1)*h1
		
		//document.body.innerHTML += '<div id="test" style=" position:absolute; bottom:'+(Math.round(X1)+500)+'px; left:'+t+'px; background:#0000ff; width:1px; height:1px;"></div>'
		
		Xtot = Xtot+X1
		
	}
	//document.body.innerHTML += '<div id="test" style=" position:absolute; bottom:'++'px; left:'+(Math.round(Xtot))+'px; background:#ff0000; width:1px; height:1px;"></div>'
	return Xtot
};
