// JavaScript Document

//Background Fade

function BGFade(o){
 var p=document.getElementById(o.ID)
 if (p){
  var bgs=p.getElementsByTagName('IMG');
  this.bgs=[];
  for (var z0=0;z0<bgs.length;z0++){
   this.bgs[z0]=new zxcAnimate('opacity',bgs[z0]);
  }
  this.nu=z0-1;
  this.ms=o.Duration||1000;
  this.hold=o.Hold||this.ms*2;
  if(this.nu>0){
   this.Rotate();
  }
 }
}

BGFade.prototype.Rotate=function(){
 this.bgs[this.nu].obj.style.zIndex='0';
 this.bgs[this.nu].animate(100,0,this.ms);
 this.nu=++this.nu%this.bgs.length;
 this.bgs[this.nu].obj.style.zIndex='1';
 this.bgs[this.nu].animate(0,100,this.ms);
 var oop=this;
 this.to=setTimeout(function(){ oop.Rotate(); },this.hold);
}

function zxcByClassName(nme,el,tag){
 if (typeof(el)=='string') el=document.getElementById(el);
 el=el||document;
 for (var tag=tag||'*',reg=new RegExp('\\b'+nme+'\\b'),els=el.getElementsByTagName(tag),ary=[],z0=0; z0<els.length;z0++){
  if(reg.test(els[z0].className)) ary.push(els[z0]);
 }
 return ary;
}


new BGFade({
 ID:'bg',
 Duration:3000,
 Hold:4000
});
//-->
//-->
