/*<![CDATA[*/


function zxcInitSlideShow(zxcid,zxcspd,zxchold,zxcauto){
 var zxcp=document.getElementById(zxcid);
 if (!zxcp.ssoop) zxcp.ssoop=new zxcSlideShowOOP(zxcp,zxcspd,zxchold,zxcauto);
}

function zxcSlideShowOOP(zxcp,zxcspd,zxchold,zxcauto){
 this.ary=[];
 var zxcclds=zxcp.childNodes;
 for (var zxcfst,zxc0=0;zxc0<zxcclds.length;zxc0++){
  if (zxcclds[zxc0].nodeType==1){
   this.ary.push(zxcES(zxcclds[zxc0],{position:'absolute',zIndex:zxcfst?'0':'1',left:(zxcp.offsetWidth-zxcclds[zxc0].offsetWidth)/2+'px',top:(zxcp.offsetHeight-zxcclds[zxc0].offsetHeight)/2+'px'}));
   zxcclds[zxc0].ssoop=new zxcObjOOP(zxcclds[zxc0],zxcfst?0:100,zxcspd);
   zxcfst=true;
  }
 }
 this.lst=this.ary[0];
 this.cnt=0;
 this.ud=1;
 this.hold=zxchold||3000;
 zxcp.to=null;
 if (zxcauto) zxcp.to=setTimeout(function(){ zxcRotate(zxcp.id); },zxchold);
}

function zxcObjOOP(zxcobj,zxcopac,zxcspd){
 this.obj=zxcobj;
 this.data=[zxcopac];
 this.time=zxcspd;
 this.to=null;
 this.opacity(zxcopac);
}

zxcObjOOP.prototype.update=function(zxcfin){
 zxcES(this.obj,{zIndex:zxcfin==0?0:100});
 clearTimeout(this.to);
 this.data=[this.data[0],this.data[0],zxcfin];
 this.srttime=new Date().getTime();
 this.cng();
}

zxcObjOOP.prototype.cng=function(){
 var zxcms=new Date().getTime()-this.srttime;
 this.data[0]=(this.data[2]-this.data[1])/this.time*zxcms+this.data[1];
 this.opacity(this.data[0]);
 if (zxcms<this.time) this.to=setTimeout(function(zxcoop){return function(){zxcoop.cng();}}(this), 10);
 else {
  this.data[0]=this.data[2];
  this.opacity(this.data[0]);
 }
}

zxcObjOOP.prototype.opacity=function(zxcopc){
 if (zxcopc<0||zxcopc>100){ return; }
 this.obj.style.filter='alpha(opacity='+zxcopc+')';
 this.obj.style.opacity=this.obj.style.MozOpacity=this.obj.style.KhtmlOpacity=zxcopc/100-.001;
}

function zxcGoTo(zxcid,zxcnu,zxcud){
 var zxcp=document.getElementById(zxcid);
 if (!zxcp) return;
 clearTimeout(zxcp.to);
 var zxcoop=zxcp.ssoop;
 if (!zxcoop) return;
 if (zxcud){ zxcoop.cnt=zxcoop.cnt+=zxcud; zxcoop.ud=zxcud;  }
 else  zxcoop.cnt=zxcnu||0;
 zxcoop.cnt=(zxcoop.cnt==zxcoop.ary.length)?0:(zxcoop.cnt<0)?zxcoop.ary.length-1:zxcoop.cnt;
 zxcoop.lst.ssoop.update(0);
 zxcoop.lst=zxcoop.ary[zxcoop.cnt];
 zxcoop.lst.ssoop.update(100);
}

function zxcRotate(zxcid,zxcstop){
 var zxcp=document.getElementById(zxcid);
 if (!zxcp) return;
 var zxcoop=zxcp.ssoop;
 if (!zxcoop) return;
 clearTimeout(zxcp.to);
 if (zxcstop) return;
 zxcGoTo(zxcid,zxcoop.cnt+=zxcoop.ud);
 zxcp.to=setTimeout(function(){ zxcRotate(zxcid); },zxcoop.hold);
}

function zxcES(zxcele,zxcstyle,zxcp,zxctxt){
 if (typeof(zxcele)=='string') zxcele=document.createElement(zxcele);
 for (key in zxcstyle) zxcele.style[key]=zxcstyle[key];
 if (zxcp) zxcp.appendChild(zxcele);
 if (zxctxt) zxcele.appendChild(document.createTextNode(zxctxt));
 return zxcele;
}




/*]]>*/
