(function (global) {
	var
	hash = global.location.hash,
	func = function () {
		if (hash !== global.location.hash) {
			hash = global.location.hash;

			global.dispatchEvent(new Event('hashchange'));
		}

		setTimeout(func, 200);
	};

	// Make sure a check for 'onhashchange' in window will pass (note: setting to undefined IE<9 causes 'Not implemented' error)
	global.onhashchange = function() {};

	func();
})(this);

(function (global) {
	var hash = global.location.hash;

	function poll () {
		if (hash !== global.location.hash) {
			hash = global.location.hash;

			global.dispatchEvent(new Event('hashchange'));
		}

		setTimeout(poll, 500);
	};

	// Make sure a check for 'onhashchange' in window will pass (note: setting to undefined IE<9 causes 'Not implemented' error)
	global.onhashchange = function() {};

	poll();
})(this);

Tidy up hashchange a bit
Tidy up hashchange a bit
