window.onload=function(){tinyScrolling.init()};
var tinyScrolling={speed:50,maxStep:150,brakeK:3,hash:null,currentBlock:null,requestedY:0,init:function(){for(var a=document.getElementsByTagName("a"),b=0,c;c=a[b];b++)if(c.href&&c.href.indexOf("#")!=-1&&(c.pathname==location.pathname||"/"+c.pathname==location.pathname)&&c.search==location.search)c.onclick=tinyScrolling.initScroll},getElementYpos:function(a){for(var b=0;a.offsetParent;){b+=a.offsetTop;a=a.offsetParent}return b},getScrollTop:function(){return document.all?document.documentElement.scrollTop?
document.documentElement.scrollTop:document.body.scrollTop:window.pageYOffset},getWindowHeight:function(){if(window.innerHeight)return window.innerHeight;if(document.documentElement&&document.documentElement.clientHeight)return document.documentElement.clientHeight},getDocumentHeight:function(){if(document.height)return document.height;if(document.body.offsetHeight)return document.body.offsetHeight},initScroll:function(a){var b;if(!a)a=window.event;if(a.target)b=a.target;else if(a.srcElement)b=a.srcElement;
tinyScrolling.hash=b.href.substr(b.href.indexOf("#")+1,b.href.length);tinyScrolling.currentBlock=document.getElementById(tinyScrolling.hash);if(tinyScrolling.currentBlock){tinyScrolling.requestedY=tinyScrolling.getElementYpos(tinyScrolling.currentBlock);tinyScrolling.scroll();return false}},scroll:function(){var a=tinyScrolling.getScrollTop();if(tinyScrolling.requestedY>a){var b=Math.round((tinyScrolling.getDocumentHeight()-(a+tinyScrolling.getWindowHeight()))/tinyScrolling.brakeK);b=Math.min(Math.round((tinyScrolling.requestedY-
a)/tinyScrolling.brakeK),b);b=Math.max(2,Math.min(b,tinyScrolling.maxStep))}else b=-Math.min(Math.abs(Math.round((tinyScrolling.requestedY-a)/tinyScrolling.brakeK)),tinyScrolling.maxStep);window.scrollTo(0,a+b);if(Math.abs(a-tinyScrolling.requestedY)<=1||tinyScrolling.getScrollTop()==a){window.scrollTo(0,tinyScrolling.requestedY);if(!document.all||window.opera)location.hash=tinyScrolling.hash;tinyScrolling.hash=null}else setTimeout(tinyScrolling.scroll,tinyScrolling.speed)}};
