
DynLayer.prototype.slideTo=function(endx,endy,inc,speed){
if(endx==null)endx=this.x;
 if(endy==null)endy=this.y;
 var distx=endx-this.x;
 var disty=endy-this.y;
 this.slideStart(endx,endy,distx,disty,inc,speed);
}
DynLayer.prototype.slideBy=function(distx,disty,inc,speed){
 var endx=this.x+distx;
 var endy=this.y+disty;
 this.slideStart(endx,endy,distx,disty,inc,speed);
}
DynLayer.prototype.slideStart=function(endx,endy,distx,disty,inc,speed){
if(this.slideActive)return;
 if(!inc)inc=1;
 if(!speed)speed=20;
 var num=Math.sqrt(Math.pow(distx,2)+Math.pow(disty,2))/inc;
 if(num==0)return;
 var dx=distx/num;
 var dy=disty/num;
 this.slideActive=true;
 this.slide(dx,dy,endx,endy,num,1,speed);
}
DynLayer.prototype.slide=function(dx,dy,endx,endy,num,i,speed){
if(!this.slideActive)return;
 if(i++< num){
 this.moveBy(dx,dy);
 this.onSlide();
 if(this.slideActive){
this.timeoutId=setTimeout(this.obj+".slide("+dx+","+dy+","+endx+","+endy+","+num+","+i+","+speed+")",speed)
}
 else{
 this.onSlideEnd(i,speed);
}
}
 else{
 this.slideActive=false;
 this.moveTo(endx,endy);
 this.onSlide();
 this.onSlideEnd();
}
}
DynLayer.prototype.onSlide=new Function()
DynLayer.prototype.onSlideEnd=new Function()
DynLayer.prototype.clipInit=function(clipTop,clipRight,clipBottom,clipLeft){
 if(browser.ie){
 if(arguments.length==4)this.clipTo(clipTop,clipRight,clipBottom,clipLeft);
 else if(browser.ie4)this.clipTo(0,this.css.pixelWidth,this.css.pixelHeight,0);
}
}
DynLayer.prototype.clipTo=function(t,r,b,l){
if(t==null)t=this.clipValues('t');
 if(r==null)r=this.clipValues('r');
 if(b==null)b=this.clipValues('b');
 if(l==null)l=this.clipValues('l');
 if(browser.nav){
 this.css.clip.top=t;
 this.css.clip.right=r;
 this.css.clip.bottom=b;
 this.css.clip.left=l;
}
 else if(browser.ie)this.css.clip="rect("+t+"px "+r+"px "+b+"px "+l+"px)";
}
DynLayer.prototype.clipBy=function(t,r,b,l){
 this.clipTo(this.clipValues('t')+t,this.clipValues('r')+r,this.clipValues('b')+b,this.clipValues('l')+l)
}
DynLayer.prototype.clipValues=function(which){
 if(browser.ie)var clipv=this.css.clip.split("rect(")[1].split(")")[0].split("px")
if(which=="t")return(browser.nav)?this.css.clip.top : Number(clipv[0])
 if(which=="r")return(browser.nav)?this.css.clip.right : Number(clipv[1])
 if(which=="b")return(browser.nav)?this.css.clip.bottom : Number(clipv[2])
 if(which=="l")return(browser.nav)?this.css.clip.left : Number(clipv[3])
}
DynLayer.prototype.wipeInit=function(clipTop,clipRight,clipBottom,clipLeft){
 if(arguments.length==4)this.clipInit(clipTop,clipRight,clipBottom,clipLeft)
 else this.clipInit()
}
DynLayer.prototype.wipeTo=function(endt,endr,endb,endl,num,speed){
var distt=(endt!=null)?endt-this.clipValues('t'):0;
 var distr=(endr!=null)?endr-this.clipValues('r'):0;
 var distb=(endb!=null)?endb-this.clipValues('b'):0;
 var distl=(endl!=null)?endl-this.clipValues('l'):0;
 this.wipeStart(distt,distr,distb,distl,endt,endr,endb,endl,num,speed);
}
DynLayer.prototype.wipeBy=function(distt,distr,distb,distl,num,speed){
 this.wipeStart(distt,distr,distb,distl,distt+this.clipValues('t'),distr+this.clipValues('r'),distb+this.clipValues('b'),distl+this.clipValues('l'),num,speed);
}
DynLayer.prototype.wipeStart=function(distt,distr,distb,distl,endt,endr,endb,endl,num,speed){
 if(this.wipeActive)return;
 this.wipeActive=true;
 this.wipe(distt/num,distr/num,distb/num,distl/num,endt,endr,endb,endl,this.clipValues('t'),this.clipValues('r'),this.clipValues('b'),this.clipValues('l'),num,1,speed);
}
DynLayer.prototype.wipe=function(dt,dr,db,dl,endt,endr,endb,endl,st,sr,sb,sl,num,i,speed){
 if(!this.wipeActive)return;
 if(i++< num){
 this.clipTo(st+i*dt,sr+i*dr,sb+i*db,sl+i*dl);
 this.onWipe();
 if(this.wipeActive)setTimeout(this.obj+".wipe("+dt+","+dr+","+db+","+dl+","+endt+","+endr+","+endb+","+endl+","+st+","+sr+","+sb+","+sl+","+num+","+i+","+speed+")",speed)
else this.onWipeEnd();
}
 else{
 this.wipeActive=false;
 this.clipTo(endt,endr,endb,endl);
 this.onWipe();
 this.onWipeEnd();
}
}
DynLayer.prototype.onWipe=new Function();
DynLayer.prototype.onWipeEnd=new Function();
DynLayer.prototype.write=function(html){
 if(browser.nav){
 this.doc.open();
 this.doc.write(html);
 this.doc.close();
}
 else if(browser.ie){
 this.event.innerHTML=html;
}
}
DynLayer.prototype.load=function(url){
 this.loadEnd=DynLayerLoadEnd;
 if(browser.nav)this.css.load(url,this.w);
 else if(browser.ie)bufferFrame.document.location=url;
}
function DynLayerLoadEnd(){
 if(browser.ie)this.event.innerHTML=bufferFrame.document.body.innerHTML
 this.onLoad();
}
DynLayer.prototype.onLoad=new Function();
DynLayer.prototype.setBg=function(color){
 if(browser.nav)this.doc.bgColor=color
 else this.css.backgroundColor=color
}
DynLayer.prototype.swapImg=function(imgName,imgObj){
 this.doc.images[imgName].src=eval(imgObj+'.src')
}
DynLayer.prototype.getRelativeX=function(){
 return(browser.nav)?this.css.pageX : this.elm.offsetLeft
}
DynLayer.prototype.getRelativeY=function(){
 return(browser.nav)?this.css.pageY : this.elm.offsetTop
}