
var inc;
var speed;
function LayerScroll(window,content){
a=arguments;
 this.window=window;
 this.content=content;
 this.inc=a[2]||1;
 this.speed=a[3]||20;
 this.contentHeight=(browser.nav)?this.content.doc.height : this.content.elm.scrollHeight;
 this.contentWidth=(browser.nav)?this.content.doc.width : this.content.elm.scrollWidth;
 this.offsetHeight=this.contentHeight-this.window.h;
 this.offsetWidth=this.contentWidth-this.window.w;
}
LayerScroll.prototype.up=function(){
 a=arguments;
 inc=a[0]||this.inc;
 speed=a[1]||this.speed;
 if(this.vScrollEnabled())this.content.slideTo(null,0,inc,speed);
}
LayerScroll.prototype.down=function(){
 a=arguments;
 inc=a[0]||this.inc;
 speed=a[1]||this.speed;
 if(this.vScrollEnabled())this.content.slideTo(null,-this.offsetHeight,inc,speed);
}
LayerScroll.prototype.left=function(){
 a=arguments;
 inc=a[0]||this.inc;
 speed=a[1]||this.speed;
 if(this.hScrollEnabled())this.content.slideTo(0,null,inc,speed);
}
LayerScroll.prototype.right=function(){
 a=arguments;
 inc=a[0]||this.inc;
 speed=a[1]||this.speed;
if(this.hScrollEnabled())this.content.slideTo(-this.offsetWidth,null,inc,speed);
}
LayerScroll.prototype.hScrollEnabled=function(){
 return(this.offsetWidth>0);
}
LayerScroll.prototype.vScrollEnabled=function(){
 return(this.offsetHeight>0);
}
LayerScroll.prototype.stop=function(){
window.clearTimeout(this.content.timeoutId);
this.content.slideActive=false;
}