var hash = { oldHash: '', newHash: '', clicked: false, locat: function(href) { if(href !== undefined) location.href = href; }, changed: function() { var result = this.newHash.split('#/'); var hv = result[1]; if(result !== undefined && $("[link='"+hv+"']").length > 0 && this.clicked === false) { $("[link='"+hv+"']").click(); } }, exists: function() { if(this.newHash !== undefined && this.newHash !== '') return true;else return false; }, check: function() { var gethash = document.location.hash; if(gethash) { this.oldHash = this.newHash; if(this.oldHash !== gethash) { this.newHash = gethash; this.changed(); } } }, start: function() { setInterval('hash.check()',10); } } try { window.addEventListener('load', hash.start(), false); } catch(e) { window.onload = hash.start(); }