
var Hash=(function(){var
window=this,documentMode=document.documentMode,history=window.history,location=window.location,callback,hash,iframe,getHash=function(){var index=location.href.indexOf('#');return(index==-1?'':location.href.substr(index+1));},poll=function(){var curHash=getHash();if(curHash!=hash){hash=curHash;callback(curHash);}},setIframe=function(newHash){try{var doc=iframe.contentWindow.document;doc.open();doc.write('<html><body>'+newHash+'</body></html>');doc.close();hash=newHash;}catch(e){setTimeout(function(){setIframe(newHash);},10);}},setUpIframe=function(){try{iframe.contentWindow.document;}catch(e){setTimeout(setUpIframe,10);return;}
setIframe(hash);var data=hash;setInterval(function(){var curData,curHash;try{curData=iframe.contentWindow.document.body.innerText;if(curData!=data){data=curData;location.hash=hash=curData;callback(curData);}else{curHash=getHash();if(curHash!=hash)setIframe(curHash);}}catch(e){}},50);};return{init:function(cb,ifr){if(callback)return;callback=cb;hash=getHash();cb(hash);if(window.ActiveXObject){if(!documentMode||documentMode<8){iframe=ifr;setUpIframe();}else{window.attachEvent('onhashchange',poll);}}else{if(history.navigationMode)history.navigationMode='compatible';setInterval(poll,50);}},go:function(newHash){if(newHash==hash)return;if(iframe){setIframe(newHash);}else{location.hash=hash=newHash;callback(newHash);}},getHashP:function(){return getHash();}};})();