
(function($){var callbacks={};var currentHash='';var iframe=null;var interval=200;var getLocationHash=function(){return($.browser.msie&&iframe)?iframe.contentWindow.location.hash:window.location.hash;};var iframeGo=function(hash){if(!iframe||!iframe.contentWindow)return false;iframe.contentWindow.document.open();iframe.contentWindow.document.close();iframe.contentWindow.location=hash;};var observe=function(){var hash=getLocationHash();if(hash=='')hash='#';if($.browser.msie&&window.location.hash!=hash)
{if(hash!='#'){window.location.hash=hash;}
else if(window.location.hash!=''&&window.location.hash!='#'){window.location.hash='';}}
if(hash!=currentHash){currentHash=hash;var callback=callbacks[currentHash];if(typeof callback=='function')callback();}};$.extend({history:{add:function(hash,callback){if(hash.substr(0,1)!='#')hash='#'+hash;callbacks[hash]=callback;currentHash=hash;if($.browser.msie)iframeGo(hash);if(hash!='#'){window.location.hash=hash;}},initialize:function(callback){var hash=window.location.hash;if($.browser.msie)iframe=$('<iframe src="/jquery.history.blank.html"></iframe>').hide().appendTo(document.body).get(0);$.history.add(hash,callback);window.setInterval(observe,interval);}}});})(jQuery);