function MyScroll(o) {

  this.z=document.getElementById(o);     
  this.n=document.getElementById(o+'W'); 
  this.s=this.n.style;                 

  this.l=0;  //stoper
  this.y=0;  //pozycja

  this.w=this.n.offsetHeight-this.z.offsetHeight; 

  this.obj=o+"Ob"; //ten obiekt nazwiemy... jak warstwa + Objt
  eval(this.obj+"=this") //odwołanie do samego siebie

  this.krok=ScrollKrok;
  this.przesun=ScrollPrzesun;
  this.stop=ScrollStop;

	function ScrollStop() {

		clearInterval(this.l)
	}

	function ScrollPrzesun(k)  {

		this.stop();
		this.l=setInterval(this.obj+'.krok('+k+')',50)
	}

	function ScrollKrok(k) {

		if (k<0 && this.y<=0) {

			this.y-=k;
			this.s.top=this.y+'px';
		}
		else if (k>0 && this.y>-this.w) {

			this.y-=k;
			this.s.top=this.y+'px';   
		}
	}
} 
