
// Fade Object
// ===========

// create fade in and out rollover effect for 2 layers

FadeObject.Count = 0

function FadeObject(divOffId,divOnId,nIterations,tmInterval)
{
	this.offlyr = new Layer(divOffId)
	this.onlyr = new Layer(divOnId)
	this.nIterations = nIterations > 0? nIterations: 10
	this.tmInterval = tmInterval > 0? tmInterval: 30
	this.name = 'FadeObject' + FadeObject.Count++
	eval(this.name + '=this')
	
	this.offlyr.setOpacity(100)
	this.offlyr.show()
	this.onlyr.setOpacity(0)
	this.onlyr.show()
}

function FadeObjectFadeIn()
{
	this.stop()
	this.offlyr.fadeTo(0,10,1)
	this.onlyr.fadeTo(100,10,1)
}
FadeObject.prototype.fadeIn = FadeObjectFadeIn

function FadeObjectFadeOut()
{
	this.stop()
	this.offlyr.fadeTo(100,this.nIterations,this.tmInterval)
	this.onlyr.fadeTo(0,this.nIterations,this.tmInterval)
}
FadeObject.prototype.fadeOut = FadeObjectFadeOut

function FadeObjectStop()
{
	this.offlyr.fadeStop()
	this.onlyr.fadeStop()
}
FadeObject.prototype.stop = FadeObjectStop
