Event.observe(window, 'load', function()
{
   $$('a[href^=#]:not([href=#])').each(function(element)
   {
      element.observe('click', function(event)
      {
      	 var objElement = this;
         new Effect.ScrollTo(this.hash.substr(1),
         {
            offset: -12,
            duration: 0.8,
            afterFinish: function(){
            	if ( objElement.hash.substr(1) !== 'top' )
		         {
		            if ( Prototype.Browser.IE )
		            {
		               $(objElement.hash.substr(1)).setStyle({
		                  //backgroundColor: '#fff'
		               });
		            }
		 			//alert(objElement.hash.substr(9));
		            Effect.Pulsate(objElement.hash.substr(1),
		            {
		               from: 0.6,
		               pulses: 2,
		               duration: 1
		            });
		         }
            }
         });
 
         
 
         Event.stop(event);
      }.bindAsEventListener(element));
   });
});