var globalScope = new Array();
var i=0;
function Rainbow(elementName, color1, time){
	this.Element = elementName;
	this.Color1 = color1;
	this.tempclass ='';
	this.uniqueId =  "el"+i;
	i++;
	if( document.all ){		
		this.tempclass = this.Element.className;
		this.Element.className='changebg';
		globalScope[ this.uniqueId ] = this;		
		this.Timer= setTimeout( 'ieIntervalHandler("'+this.uniqueId+'","change")', time );
	}
	else{		
		this.Element.setAttribute('style', 'color:#074EB7; background-color:#' + this.Color1);
		this.Timer = setTimeout ( function(o) { o.change(); }, time, this );
	}
};
Rainbow.prototype.change =function(){	
	obj = this.Element;	
	if(document.all){
		obj.className = this.tempclass;
	}else{
		obj.setAttribute('style', '');	
	}
};
var obj;
function ieIntervalHandler(id, strFunc )
{
	/* D.1 - correct the scope then make the call */
	var scope = globalScope[id];
	eval( "scope." + strFunc + "()" );
};

