function faderObject(container_id,name){  
  var instance = this;  
  this.objectName=name;
  this.container=document.getElementById(container_id);
  
  this.fadeList=new Array;
  var j;
  
  var x=this.container.childNodes;
  for(var i=0; i<x.length; i++){   
    if(x[i].nodeType==1){
      j=this.fadeList.length;
      this.fadeList[j]=x[i];
      this.fadeList[j].style["position"]="absolute";
      DHTML.setOpacity(this.fadeList[j],0);
    }
  }   
  DHTML.setOpacity(this.fadeList[0],1);
  this.fadeList[0].style["zIndex"]=1;
  this.currentIndex=0;
  this.oppacity=1;  
  this.fading=false;
  this.TimeOutID=window.setInterval(this.objectName+'.fade();',1900);  
}

faderObject.prototype.fade=function(){
  if(!this.fading){
    this.fading=true;
    this.nextIndex=this.currentIndex+1;
    if(this.nextIndex==this.fadeList.length) this.nextIndex=0;
    this.oppacity=0;
    this.fadeList[this.nextIndex].style["zIndex"]=2;
    this.fadeList[this.currentIndex].style["zIndex"]=1;
    this.timer=window.setInterval(this.objectName+'.fadeUp()',10);
  }
}
faderObject.prototype.fadeUp=function(){
  var speed=0.05;
  this.oppacity+=speed;
  DHTML.setOpacity(this.fadeList[this.nextIndex],this.oppacity);
      if(this.oppacity>=1){
        window.clearInterval(this.timer);
        DHTML.setOpacity(this.fadeList[this.currentIndex],0);
        this.currentIndex=this.nextIndex;
        this.fading=false;
      }
}  




