function zxcBAnimator(zxcmde,zxcobj,zxcsrt,zxcfin,zxctime){
 if (typeof(zxcobj)=='string'){ zxcobj=document.getElementById(zxcobj); }
 if (!zxcobj||(!zxcsrt&&!zxcfin)) return;
 var zxcoop=zxcobj[zxcmde.replace(/[-#]/g,'')+'oop'];
 if (zxcoop){
  clearTimeout(zxcoop.to);
  if (zxcoop.srtfin[0]==zxcsrt&&zxcoop.srtfin[1]==zxcfin&&zxcmde.match('#')) zxcoop.update([zxcoop.data[0],(zxcoop.srtfin[0]==zxcoop.data[2])?zxcfin:zxcsrt],zxctime);
  else zxcoop.update([zxcsrt,zxcfin],zxctime);
 }
 else zxcobj[zxcmde.replace(/[-#]/g,'')+'oop']=new zxcBAnimatorOOP(zxcmde,zxcobj,zxcsrt,zxcfin,zxctime);
}

function zxcBAnimatorOOP(zxcmde,zxcobj,zxcsrt,zxcfin,zxctime){
 this.srtfin=[zxcsrt,zxcfin];
 this.to=null;
 this.obj=zxcobj;
 this.mde=zxcmde.replace(/[-#]/g,'');
 this.update([zxcsrt,zxcfin],zxctime);
}

zxcBAnimatorOOP.prototype.update=function(zxcsrtfin,zxctime){
 this.time=zxctime||this.time||2000;
 if (zxcsrtfin[0]==zxcsrtfin[1]) return;
 this.data=[zxcsrtfin[0],zxcsrtfin[0],zxcsrtfin[1]];
 this.srttime=new Date().getTime();
 this.cng();
}

zxcBAnimatorOOP.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];
 if (this.mde!='left'&&this.mde!='top'&&this.data[0]<0) this.data[0]=0;
 if (this.mde!='opacity') this.obj.style[this.mde]=this.data[0]+'px';
 else  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];
  if (this.mde!='opacity') this.obj.style[this.mde]=this.data[0]+'px';
  else  this.opacity(this.data[0]);
 }
}

zxcBAnimatorOOP.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;
}


//user settings

function zxcSlide(zxcobj,zxcpos,zxcone,zxctwo){
 zxcobj.style.display='block';
 zxcBAnimator('top',zxcobj,zxcobj.offsetTop,zxcpos,500);
 zxcBAnimator('opacity',zxcobj,zxcone,zxctwo,500);
 //if (zxcobj.to) clearTimeout(zxcobj.to);
 //zxcobj.to=setTimeout(function(){zxcSlide(zxcobj,200,100,0);},1500)
}
function zxcSlideOut(zxcobj,zxcpos,zxcone,zxctwo){
 //zxcBAnimator('opacity',zxcobj,zxcone,zxctwo,500);
 //zxcBAnimator('top',zxcobj,zxcobj.offsetTop,zxcpos,500);
 if (zxcobj.to) clearTimeout(zxcobj.to);
 zxcobj.to=setTimeout(function(){zxcSlide(zxcobj,200,100,0);zxcobj.style.display='block';},50)
}