OpacityTween.prototype = new Tween();
OpacityTween.prototype.constructor = Tween;
OpacityTween.superclass = Tween.prototype;

function OpacityTween(obj,func,fromOpacity,toOpacity,duration){
	this.targetObject = obj;
	this.init(new Object(),'x',func,fromOpacity,toOpacity,duration);
}
var o = OpacityTween.prototype;
o.targetObject = {};
o.onMotionChanged = function(evt){
	
	var v = evt.target._pos;
	var t = this.targetObject;
	var tmp=true;
	
	if(t.style['opacity'] )
	{
		op=t.style['opacity'];
	}
	t.style['opacity'] = v / 100;
	t.style['-moz-opacity'] = v / 100;
	//if(t.style.filter)
	//{
		t.style.filter='alpha(opacity='+parseInt(v)+')';
	//}
}

function getopacity(t)
{
	var op;
	var tmp=true;
	if(t.style['opacity'] && tmp==true)
	{
		op=t.style['opacity'];
		tmp=false;
	}
	if(t.style['-moz-opacity'] && tmp==true)
	{
		op=t.style['-moz-opacity'];
		tmp==false;
	}
	if(t.filter && tmp==true)
	{
		op=t.filter.alpha['opacity'];
		tmp==true
	}
return op*100;
}
