A different approach to your problem...
There are 3 ways to bind the hashchange event to a method:
<script>
window.onhashchange = doThisWhenTheHashChanges;
</script>
Or
<script>
window.addEventListener("hashchange", doThisWhenTheHashChanges, false);
</script>
Or
<body onhashchange="doThisWhenTheHashChanges();">
These all work with IE 9, FF 5, Safari 5, and Chrome 12 on Win 7.