(function(b){function a(){this._curHash="";this._callback=function(c){}}b.extend(a.prototype,{init:function(d){this._callback=d;this._curHash=location.hash;if(b.browser.msie){if(this._curHash==""){this._curHash="#"}b("body").prepend('<iframe id="jQuery_history" style="display: none;" src="javascript:void(0);"></iframe>');var c=b("#jQuery_history")[0].contentWindow.document;c.open();c.close();c.location.hash=this._curHash}else{if(b.browser.safari){this._historyBackStack=[];this._historyBackStack.length=history.length;this._historyForwardStack=[];this._isFirst=true;this._dontCheck=false}}this._callback(this._curHash.replace(/^#/,""));setInterval(this._check,100)},add:function(c){this._historyBackStack.push(c);this._historyForwardStack.length=0;this._isFirst=true},_check:function(){if(b.browser.msie){var e=b("#jQuery_history")[0];var c=e.contentDocument||e.contentWindow.document;var d=c.location.hash;if(d!=b.history._curHash){location.hash=d;b.history._curHash=d;b.history._callback(d.replace(/^#/,""))}}else{if(b.browser.safari){if(!b.history._dontCheck){var g=history.length-b.history._historyBackStack.length;if(g){b.history._isFirst=false;if(g<0){for(var f=0;f<Math.abs(g);f++){b.history._historyForwardStack.unshift(b.history._historyBackStack.pop())}}else{for(var f=0;f<g;f++){b.history._historyBackStack.push(b.history._historyForwardStack.shift())}}var h=b.history._historyBackStack[b.history._historyBackStack.length-1];if(h!=undefined){b.history._curHash=location.hash;b.history._callback(h)}}else{if(b.history._historyBackStack[b.history._historyBackStack.length-1]==undefined&&!b.history._isFirst){if(location.hash.indexOf("#")>=0){b.history._callback(location.hash.split("#")[1])}else{b.history._callback("")}b.history._isFirst=true}}}}else{var d=location.hash;if(d!=b.history._curHash){b.history._curHash=d;b.history._callback(d.replace(/^#/,""))}}}},isKonqueror:function(){return/KHTML|Konqueror/.test(navigator.userAgent)},load:function(d){var e;if(b.browser.safari){e=d}else{e=(this.isKonqueror()?"":"#")+d;location.hash=e}this._curHash=e;if(b.browser.msie){var f=b("#jQuery_history")[0];var c=f.contentWindow.document;c.open();c.close();c.location.hash=e;this._callback(d)}else{if(b.browser.safari){this._dontCheck=true;this.add(d);var g=function(){b.history._dontCheck=false};window.setTimeout(g,200);this._callback(d);location.hash=e}else{this._callback(d)}}}});b(document).ready(function(){b.history=new a()})})(jQuery);