class_transparentDiv.instances = new Array()

function class_transparentDiv(div_id,nSteps,reducer)
{

	this.div_id = div_id;

	this.currentStep = 0;
	this.nSteps = nSteps;
	this.reducer = reducer;

	this.moving_timer = null;
	this.is_moving = false;

	this.div_parent = null;
	
	this.id = class_transparentDiv.instances.length;
	class_transparentDiv.instances[this.id] = this;
	
	//this.div_parent = _div_getParent(this.div_id);
}

class_transparentDiv.prototype.draw = function()
{
	ieOpacityValue = Math.floor(100*(this.currentStep/this.nSteps)/this.reducer);
	
	//div_setContent('debug',ieOpacityValue);
	div_setOpacity(this.div_id,ieOpacityValue);
}

class_transparentDiv.prototype.appear = function()
{
	if(1)
	{
		div_unhide(this.div_id);
		clearInterval(this.moving_timer);
		this.is_moving = true;	
		this.moving_timer = self.setInterval( "class_transparentDiv.instances["+this.id+"].oneStepAppear()", 10);
	}
	else
	{
		//alert('err appear');
	}
}


class_transparentDiv.prototype.disappear = function()
{
	if(1)
	{
		clearInterval(this.moving_timer);
		this.is_moving = true;
		this.moving_timer = setInterval( "class_transparentDiv.instances["+this.id+"].oneStepDisappear()", 10);
	}
	else
	{
		//alert('err disappear');
	}
}

class_transparentDiv.prototype.oneStepAppear = function()
{	
	if( this.currentStep < this.nSteps )
	{
		this.currentStep++;
		this.draw();
	}
	else
	{
		clearInterval(this.moving_timer);
		this.is_moving = false;
		this.draw();
	}
}

class_transparentDiv.prototype.oneStepDisappear = function()
{
	if( this.currentStep > 0 )
	{
		this.currentStep--;
		this.draw();
	}
	else
	{
		clearInterval(this.moving_timer);
		this.is_moving = false;
		this.draw();
		div_hide(this.div_id);
	}
}
