// smooth scrolling function, requires Prototype.js 1.6.0_rc0 and effects.js

function smoothscroll()
{
	$$('a[href^=#]:not([href=#])').invoke('observe', 'click', function(event)
	{
		var hash = this.hash.substr(1);
		if ( hash !== 'top' ) { $(hash).setStyle({ backgroundColor: '#dbdbdb' }); }
		
		new Effect.ScrollTo(hash, {
			afterFinish: function() {
				window.location.hash = hash;
				Effect.Pulsate(hash, { from: 0.5, pulses: 5 });
			}
		});
		
		event.stop();
	});
}