$.hashdata=new function(){this.get=function(a){return this.data[a]};this.set=function(a,b){this.data[a]=b;this._setHash(this._serialize())};this.remove=function(a){delete this[a];this._setHash(this._serialize())};this.setPosition=function(a,b){this.data.position=a;this._setHash(this._serialize(),b);this._scrollTo(a)};this.addHandlers=function(a){$(a).find("a[href^=#]").click(function(){var b=$(this).attr("href");if(b&&b.length>1){$.hashdata.setPosition($(this).attr("href").substr(1),true);return false}})};
this._setHash=function(a,b){if(b)location.hash="#"+a;else if(history.replaceState)try{history.replaceState({},document.title,"#"+a)}catch(c){}else location.replace("#"+a)};this._serialize=function(a){if(!a)a=this.data;var b="",c;for(c in a){b+=c+"=";b+=encodeURIComponent(a[c].toString())+"&"}return b.slice(0,-1)};this._scrollTo=function(a){var b=$("a[name="+a+"]");b.length||(b=$("#"+a));try{if($.browser.webkit){b.get(0).scrollIntoView(false);window.scrollBy(0,$(window).height()-b.outerHeight())}else window.scrollTo(0,
b.offset().top)}catch(c){}};this._parseHash=function(a){this.data={};var b=location.hash.substr(1)?location.hash.substr(1).split("&"):[];if(b[0]&&b[0].indexOf("=")==-1)b[0]="position="+b[0];for(var c in b){var d=b[c].split("=");this.data[d[0]]=decodeURIComponent(d[1])}if(this.data.position){var e=this;if(a)$(window).one("load",function(){e._scrollTo(e.data.position)});else this._scrollTo(this.data.position)}}};$.hashdata._parseHash(true);
$(function(){$("a[href^=#]").click(function(){var a=$(this).attr("href");if(a&&a.length>1){$.hashdata.setPosition($(this).attr("href").substr(1),true);return false}})});

