/**
 * simply add nice inpage links
 * Usage: 
 * BetterInpage.start()
 * 	optional arguments: 
 *   cssSelector - default 'a.scroller' - how to find your links
 *   duration    - default 0.7          - how fast should we scroll
 */
var BetterInPage = {
	start : function() {
		var options = Object.extend({
			    cssSelector:'a.scroller',
				duration:1.0
		}, arguments[0] || {});			
		$$(options.cssSelector).each(function(element) {
			Event.observe($(element), 'click', function(event) {
				if( element.href.include('#') ) {
					new Effect.ScrollTo(element.href.gsub('.*#',''), { duration:options.duration });
					Event.stop(event);
				}
			});
		});
	}
}
