$("a[href^='\#']").click(function(e){
  e.preventDefault();
  document.location.hash=this.href.substr(this.href.indexOf('#')+1);
})
