(function(E){var C,A,G,D=/^.*#/;var B={iframe:null,getDoc:function(){return B.iframe.contentWindow.document},getHash:function(){return B.getDoc().location.hash},setHash:function(H){var I=B.getDoc();I.open();I.close();I.location.hash=H}};var F=function(){var I=B.iframe?B.getHash():location.hash;if(I!=C){C=I;if(B.iframe){location.hash=C}var H=E.history.getCurrent();E.event.trigger("history",[H,A]);A=H}};E.history={add:function(I){I="#"+I.replace(D,"");if(C!=I){var H=E.history.getCurrent();location.hash=C=I;if(B.iframe){B.setHash(C)}E.event.trigger("historyadd",[E.history.getCurrent(),H])}if(!G){G=setInterval(F,100)}},getCurrent:function(){return C.replace(D,"")}};E.fn.history=function(H){E(this).bind("history",H)};E.fn.historyadd=function(H){E(this).bind("historyadd",H)};E(function(){C=location.hash;if(E.browser.msie){B.iframe=E('<iframe style="display:none" src="javascript:false;"></iframe>').prependTo("body")[0];B.setHash(C);C=B.getHash()}})})(jQuery);