Update tab.js

Creates a hashchange event binding which allows links within any part of the page to switch to a specific tab.