document.observe("dom:loaded", function() {
	$$('a[href^=#]:not([href=#])').each(function(element) {
		element.observe('click', function(event) {
			new Effect.ScrollTo(this.hash.substr(1),
			{
				offset: -12
			});
			
			if (this.hash.substr(1) !== 'top') {
				if (Prototype.Browser.IE) {
					$(this.hash.substr(1)).setStyle({
						backgroundColor: '#fff'
					});
				}
				Effect.Pulsate(this.hash.substr(1), 
				{
					from: 0.5,
					pulses: 5
				});
			}

			Event.stop(event);
		}.bindAsEventListener(element));
	});
});

