fx.Scroll = Class.create(); fx.Scroll.prototype = Object.extend(new fx.Base(), { initialize: function(options) {this.setOptions(options);}, scrollTo: function(el){ var desty = Position.cumulativeOffset($(el)); var dest = desty[1]; var client = window.innerHeight || document.documentElement.clientHeight; var full = document.documentElement.scrollHeight; var top = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop; if (dest+client > full) this.custom(top, dest - client + (full-dest)); else this.custom(top, dest); }, increase: function(){ window.scrollTo(0, this.now); } }); var ScrollLinks = { currentHash: false, start: function(){ this.scroll = new fx.Scroll({duration: 800, onComplete: function(){ScrollLinks.end();}}); this.allinks = document.getElementsByTagName('a'); for (i=0; i