var ScrollUp = function() { this.reg = new Regulator(this.scroll); } ScrollUp.prototype.start = function() { this.reg.setVal(fLib.getTopScroll()); this.reg.start(0); } ScrollUp.prototype.scroll = function(p) { window.scroll(0, Math.round(p)); } var scrollUp = new ScrollUp();