function tweenObj(obj, property, funct, begin, finish, duration)
{
	this.tween = function(obj, property)
	{
		eval('document.getElementById("' + this.obj + '").' + this.property + ' = ' + funct + '(this.time_tween++, this.begin_tween, this.change_tween, this.duration_tween) + "px"');
		if(this.time_tween > this.duration_tween)
		{
			this.tOut_tween = window.clearInterval(this.tOut_tween);
			this.tweening = false;
		}
	}

	var selfobject = this;
	this.obj = obj;
	this.property = property;
	this.begin_tween = begin;
	this.finish_tween = finish;
	this.change_tween = finish - begin;
	this.duration_tween = duration * 30;
	this.time_tween = 0;
	this.tweening = true;
	this.tOut_tween = window.clearInterval(this.tOut_tween);
	this.tOut_tween = window.setInterval(function() { selfobject.tween('" + this.obj + "', '" + this.property + "'); }, 33);
	
	this.onmotionfinished = function()
	{
		alert('terminou')
	}
}

function Regular_easeIn(t, b, c, d)
{
	return c*(t/=d)*t + b;
}
function Regular_easeOut(t, b, c, d)
{
	return -c *(t/=d)*(t-2) + b;
}
function Regular_easeInOut(t, b, c, d)
{
	if ((t/=d/2) < 1)
		return c/2*t*t + b;
	return -c/2 * ((--t)*(t-2) - 1) + b;
}

function Strong_easeIn(t, b, c, d)
{
	return c*(t/=d)*t*t*t*t + b;
}
function Strong_easeOut(t, b, c, d)
{
	return c*((t=t/d-1)*t*t*t*t + 1) + b;
}
function Strong_easeInOut(t, b, c, d)
{
	if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
	return c/2*((t-=2)*t*t*t*t + 2) + b;
}

function Bounce_easeOut(t, b, c, d)
{
	if ((t/=d) < (1/2.75))
	{
		return c*(7.5625*t*t) + b;
	}
	else if (t < (2/2.75))
	{
		return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
	}
	else if (t < (2.5/2.75))
	{
		return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
	}
	else
	{
		return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
	}
}
function Bounce_easeIn(t, b, c, d)
{
	return c - Bounce_easeOut(d-t, 0, c, d) + b;
}
function Bounce_easeInOut(t, b, c, d)
{
	if (t < d/2)
		return Bounce_easeIn(t*2, 0, c, d) * .5 + b;
	else
		return Bounce_easeOut(t*2-d, 0, c, d) * .5 + c*.5 + b;
}

