function bugBase() {
	this.version = "1.0"
}
window.bugimus = new bugBase()

bugBase.prototype.attachBTF = function() {
	this.BTFnum = 0
	this.BTFobj = new Array()
}
window.bugimus.attachBTF()
function textFader( refObj, rate ) {
	this.objname = "window.bugimus.BTFobj[" + window.bugimus.BTFnum + "]"
	window.bugimus.BTFobj[window.bugimus.BTFnum++] = this
	this.sliderate = rate
	this.faderate = 100
	this.itemindex = -1
	this.numitems = 0
	this.goingup = false
	this.firstFlag = true
	this.timer = null
	this.slidetimer = null
	this.item = new Array()
	refObj.appendChild(this.itemObj=document.createElement("DIV"))
	this.itemObj.appendChild( this.itemNode = document.createTextNode("%%%") )
	this.itemObj.appendChild( document.createElement("BR") )
	this.trans = new Array()
	this.trans[0] = "#89ac88"
	this.trans[1] = "#8eb08e"
	this.trans[2] = "#96b696"
	this.trans[3] = "#a0bc9f"
	this.trans[4] = "#abc4a9"
	this.trans[5] = "#b5cbb5"
	this.trans[6] = "#bfd3bf"
	this.trans[7] = "#c7d8c5"
	this.trans[8] = "#cddccb"
}
textFader.prototype.fall = function( delay ) {
	for( k=0; k<this.trans.length; k++ ) {
		timeoutTime = k*this.faderate + delay
		this.timer=setTimeout( this.objname+".setItemColor('"+k+"')", timeoutTime )
	}
	return timeoutTime
}
textFader.prototype.rise = function( delay ) {
	m=0
	for( k=this.trans.length-1; k>=0; k-- ) {
		timeoutTime = m++*this.faderate + delay
		this.timer=setTimeout( this.objname+".setItemColor('"+k+"')", timeoutTime )
	}
	return timeoutTime
}
textFader.prototype.setItemColor = function( itemnum ) {
	this.itemObj.style.color = this.trans[itemnum]
}
textFader.prototype.nextItem = function() {
	clearTimeout(this.timer)
	delay = 0
	delay = this.fall(delay)
	this.incItem()
	delay += 100
	this.timer = setTimeout( this.objname+".showItem('"+this.itemindex+"')", delay )
	delay += 500
	this.rise(delay)
}
textFader.prototype.showItem = function( itemnum ) {
	if( itemnum<=this.numitems ) {
		this.itemNode.nodeValue = this.item[itemnum]
	}
	this.itemindex=itemnum
}
textFader.prototype.loadItem = function( itemstring ) {
	this.item[this.numitems] = itemstring
	if(this.numitems==0) this.showItem(this.numitems)
	this.numitems++
}
textFader.prototype.incItem = function() {
	if( this.itemindex >= this.numitems-1 ) this.itemindex=0
	else this.itemindex++
}
textFader.prototype.loop = function() {
	if(!this.firstFlag) this.nextItem()
	else this.firstFlag = false
	this.slidetimer = setTimeout( this.objname+".loop()", this.sliderate )
}
