//Easing Object (v1.0, 19-02-2008)
//
//Properties
//	- easing.easType
//
//Methods
//	- linear(t, b, c, d)
//	- easeIn(t, b, c, d)
//	- easeOut(t, b, c, d)
//	- easeBoth(t, b, c, d)

function Easing(easType){
	this.easType = easType;
}

Easing.prototype.selectedEase = function(t, b, c, d){
	switch (this.easType) {
		case "linear":
			return this.linear(t, b, c, d);
			break;
		case "easIn":
			return this.easIn(t, b, c, d);
			break;
		case "easOut":
			return this.easOut(t, b, c, d);
			break;
		case "easBoth":
			return this.easBoth(t, b, c, d);
			break;
	}
}

Easing.prototype.linear = function(t, b, c, d){
	return c*t/d + b;
}

Easing.prototype.easIn = function(t, b, c, d){
	return c*(t/=d)*t + b;
}

Easing.prototype.easOut = function(t, b, c, d){
	return -c * (t/=d)*(t-2) + b;
}

Easing.prototype.easBoth = function(t, b, c, d){
	if ((t/=d/2) < 1) return c/2*t*t + b;
	return -c/2 * ((--t)*(t-2) - 1) + b;
}