function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
var zxcIncrement=2;
var zxcFadeSpeed=20;
var zxcImgDelay=2800;

// Functional Code - No Need to Change

var zxcCnt=0;

function zxcBannerRotateOpacity(zxcid,zxcsi,zxccy,zxcinc,zxcspd,zxcdly){
 zxcp=document.getElementById(zxcid);
 if (!zxcp){ return; }
 if (zxcp.obj){ return; }
 zxcp.obj=new zxcAddBannerFade();
 zxcp.obj.imgary=zxcp.getElementsByTagName('IMG');
 if (!zxccy){ zxcccy=1; }
 zxcp.obj.cy=zxccy*zxcp.obj.imgary.length-1;
 zxcp.obj.cnt=0;
 if (!zxcsi){ zxcsi=1; }
 if (zxcsi>=zxcp.obj.imgary.length||zxcsi<1){ zxcsi=1; }
 zxcp.obj.cntT=zxcsi-1;
 zxcp.obj.cntB=zxcsi;
 if (zxcp.obj.cntB==zxcp.obj.imgary.length){ zxcp.obj.cntB=0; }
 if (!zxcinc){ zxcinc=zxcIncrement; }
 if (zxcinc<1||zxcinc>30){ zxcinc=zxcIncrement; }
 zxcp.obj.inc=zxcinc;
 if (!zxcspd){ zxcspd=zxcFadeSpeed; }
 if (zxcspd<5||zxcspd>70){ zxcspd=zxcFadeSpeed; }
 zxcp.obj.spd=zxcspd;
 if (!zxcdly){ zxcdly=zxcImgDelay; }
 if (zxcdly<50){ zxcdly=zxcImgDelay; }
 zxcp.obj.dly=zxcdly;
 for (zxc0=0;zxc0<zxcp.obj.imgary.length;zxc0++){
  zxcOpacity(zxcp.obj.imgary[zxc0],0)
 }
 zxcp.obj.IT=zxcp.obj.imgary[zxcp.obj.cntT];
 zxcOpacity(zxcp.obj.IT.style,100);
 zxcp.obj.IT.style.zIndex=1;
 zxcp.obj.IT.style.visibility='visible';
 zxcp.obj.setTimeOut0();
}

function zxcAddBannerFade(){
 this.ref0 = 'timeout0'+zxcCnt;
 window[this.ref0]=this;
 this.ref1 = 'timeout1'+zxcCnt;
 window[this.ref1]=this;

 this.setTimeOut0= function(zxcf,zxcd){
  setTimeout('window.'+this.ref0+'.rotate()',this.dly);
 }

 this.setTimeOut1= function(zxcf,zxcd){
  setTimeout('window.'+this.ref1+'.'+zxcf,zxcd);
 }

 this.rotate=function(){
 if (this.cnt>=this.cy){ return; }
  this.fcnt=0;
  this.cnt++;
  this.IT=this.imgary[this.cntT]
  this.IB=this.imgary[this.cntB]
  this.IT.style.zIndex=0;
  this.IB.style.zIndex=1;
  this.IB.style.visibility='visible';
  this.fadebanner();
 }

 this.fadebanner=function(){
  this.fcnt+=this.inc;
  zxcOpacity(this.IT.style,100-this.fcnt);
  zxcOpacity(this.IB.style,this.fcnt);
  if (this.fcnt<100){ this.setTimeOut1('fadebanner()',this.spd); }
  else {
   zxcOpacity(this.IB.style,100);
   zxcOpacity(this.IT.style,0);
   this.cntT=(this.cntT+1)%this.imgary.length;
   this.cntB=(this.cntB+1)%this.imgary.length;
   this.setTimeOut1('rotate()',this.dly);
  }
 }
 zxcCnt++;
}

function zxcOpacity(zxcobj,zxcop) {
 if (zxcop>100||zxcop<0){ return }
 if (zxcobj.MozOpacity!=null){ zxcobj.MozOpacity=(zxcop/100)-.001; }
 else if (zxcobj.opacity!=null){ zxcobj.opacity=(zxcop/100)-.001; }
 else if (zxcobj.filter!=null){ zxcobj.filter = 'alpha(opacity='+zxcop+')';     }
 else if (zxcobj.KHTMLOpacity!=null){ zxcobj.KHTMLOpacity=(zxcop/100)-.001; }
}


