var SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(options,context){context=context||document;var doc=context.getDocument(),win=context.getWindow();this.parent(doc,options);this.links=(this.options.links)?$$(this.options.links):$$(doc.links);var location=win.location.href.match(/^[^#]*/)[0]+'#';this.links.each(function(link){if(link.href.indexOf(location)!=0)return;var anchor=link.href.substr(location.length);if(anchor&&document.id(anchor))this.useLink(link,anchor);},this);},useLink:function(link,anchor){link.addEvent('click',function(event){this.anchor=anchor;this.toElement(anchor);event.stop();}.bind(this));}});