
var AnchorsClass = Class.create();

AnchorsClass.prototype = {

	initialize : function() 
	{
		$$("a").each(
			function(item,indx)
			{             
                if (item.href.indexOf('#')>=0)
                {
                    var s = item.href.split('#');
    				item.setAttribute("ancora",'#'+s[1]);
    				item.href = "javascript:;";
    				item.observe("click",function(evt) 
    										{ 
    											var item = Event.findElement(evt,'a');
    											document.location.hash = item.readAttribute("ancora");
    										});
                }
			}		
		)
	}

}

Event.observe(window,"load",function() { new AnchorsClass(); });
