/*
 * Copyright (c) 2009 Andreas Blixt <andreas@blixt.org>
 * This and more JavaScript libraries: http://blixt.org/js
 * MIT License: http://www.opensource.org/licenses/mit-license.php
 * 
 * Hash handler
 * Keeps track of the history of changes to the hash part in the address bar.
 */
var Hash=(function(){var G=this,E=document.documentMode,F=G.history,J=G.location,K,C,B,D=function(){var L=J.href.indexOf("#");return(L==-1?"":J.href.substr(L+1))},H=function(){var L=D();if(L!=C){C=L;K(L)}},A=function(L){try{var N=B.contentWindow.document;N.open();N.write("<html><body>"+L+"</body></html>");N.close();C=L}catch(M){setTimeout(function(){A(L)},10)}},I=function(){try{var L=B.contentWindow.document}catch(N){setTimeout(I,10);return }A(C);var M=C;setInterval(function(){var O,P;try{O=B.contentWindow.document.body.innerText;if(O!=M){M=O;J.hash=C=O;K(O)}else{P=D();if(P!=C){A(P)}}}catch(Q){}},50)};return{init:function(L,M){if(K){return }K=L;C=D();L(C);if(G.ActiveXObject){if(!E||E<8){B=M;I()}else{G.attachEvent("onhashchange",H)}}else{if(!F.navigationMode){F.navigationMode="compatible"}setInterval(H,50)}},go:function(L){if(L==C){return }if(B){A(L)}else{J.hash=C=L;K(L)}}}})();
/*
 * Copyright (c) 2009 Andreas Blixt <andreas@blixt.org>
 * This and more JavaScript libraries: http://blixt.org/js
 * MIT License: http://www.opensource.org/licenses/mit-license.php
 * 
 * jQuery hash plugin (Depends on jQuery, Hash)
 * Plugin for detecting changes to the hash and for adding history support for
 * hashes to certain browsers.
 */
(function(I,E){var D="jquery-history",F="/js/blank.html",A="hashchange",J="hash.fn",H,C=this,B=document.documentMode,G=function(K){I.event.trigger(A,[K])};I.hash={init:function(L){if(H){return }H=1;var K;if(C.ActiveXObject&&(!B||B<8)){I("body").prepend('<iframe id="'+D+'" style="display:none;" src="'+(L||F)+'"></iframe>');K=I("#"+D)[0]}E.init(G,K)},go:E.go};I.fn.hash=function(L,M){var K=this.data(J);if(K){this.unbind("click",K)}if(typeof L=="string"){K=function(){E.go(L);return false};this.data(J,K);this.click(K);if(M||M===undefined){this.attr("href","#"+L)}}return this};I.fn[A]=function(K){return this.bind(A,K)}})(jQuery,Hash);