function fade( sp )
{
	this.img_ = new Array();
	this.dir  = new Array();
	this.op   = new Array();
	this.speed = sp;
}

fade.prototype.continua=function()
{
		
	for( i=0; i<this.img_.length; i++ )
	{
		 this.op[i]+=this.dir[i]*this.speed;
 		 
		 if( this.op[i]<=0 ) this.op[i]=0;
		 if( this.op[i]>=100 ) this.op[i]=100;

		 this.img_[i].style.MozOpacity = (this.op[i])/100; 
		 this.img_[i].style.filter = "alpha(opacity=" + this.op[i] + ")";
	}
}

fade.prototype.add=function( object )
{

	if( (index=this.is( object )) != -1 )
	{
		this.dir[ index ]=-1;
		return;
	}
	
	this.img_[ this.img_.length ] = object ;
	this.dir[ this.dir.length ] = -1;
	this.op [ this.op.length  ] = 100;
}

fade.prototype.is=function( object )
{

 for( i=0; i<this.img_.length; i++ )
	if( this.img_[i].id == object.id ) 
		return i;

 return -1;
}

fade.prototype.inc=function( object )
{
	this.dir[ this.is( object ) ]=1;
}

/*
onmouseover="a.add(this)" onmouseout="a.inc(this)"
*/