(function(d){var e={put:function(h,g){(g||window).location.hash=this.encoder(h)},get:function(i){var h=((i||window).location.hash).replace(/^#/,"");try{return d.browser.mozilla?h:decodeURIComponent(h)}catch(g){return h}},encoder:encodeURIComponent};var a={id:"__jQuery_history",init:function(){var g='<iframe id="'+this.id+'" style="display:none" src="javascript:false;" />';d("body").prepend(g);return this},_document:function(){return d("#"+this.id)[0].contentWindow.document},put:function(h){var g=this._document();g.open();g.close();e.put(h,g)},get:function(){return e.get(this._document())}};function f(i){i=d.extend({unescape:false},i||{});e.encoder=h(i.unescape);function h(j){if(j===true){return function(k){return k}}if(typeof j=="string"&&(j=g(j.split("")))||typeof j=="function"){return function(k){return j(encodeURIComponent(k))}}return encodeURIComponent}function g(k){var j=new RegExp(d.map(k,encodeURIComponent).join("|"),"ig");return function(l){return l.replace(j,decodeURIComponent)}}}var c={};c.base={callback:undefined,type:undefined,check:function(){},load:function(g){},init:function(h,g){f(g);b.callback=h;b._options=g;b._init()},_init:function(){},_options:{}};c.timer={_appState:undefined,_init:function(){var g=e.get();b._appState=g;b.callback(g);setInterval(b.check,100)},check:function(){var g=e.get();if(g!=b._appState){b._appState=g;b.callback(g)}},load:function(g){if(g!=b._appState){e.put(g);b._appState=g;b.callback(g)}}};c.iframeTimer={_appState:undefined,_init:function(){var g=e.get();b._appState=g;a.init().put(g);b.callback(g);setInterval(b.check,100)},check:function(){var h=a.get(),g=e.get();if(g!=h){if(g==b._appState){b._appState=h;e.put(h);b.callback(h)}else{b._appState=g;a.put(g);b.callback(g)}}},load:function(g){if(g!=b._appState){e.put(g);a.put(g);b._appState=g;b.callback(g)}}};c.hashchangeEvent={_init:function(){b.callback(e.get());d(window).bind("hashchange",b.check)},check:function(){b.callback(e.get())},load:function(g){e.put(g)}};var b=d.extend({},c.base);if(d.browser.msie&&(d.browser.version<8||document.documentMode<8)){b.type="iframeTimer"}else{if("onhashchange" in window){b.type="hashchangeEvent"}else{b.type="timer"}}d.extend(b,c[b.type]);d.history=b})(jQuery);
