var ss={fixAllLinks:function(){var B=document.getElementsByTagName("a");for(var A=0;A<B.length;A++){var C=B[A];if((C.href&&C.href.indexOf("#")!=-1)&&((C.pathname==location.pathname)||("/"+C.pathname==location.pathname))&&(C.search==location.search)){ss.addEvent(C,"click",ss.smoothScroll)}}},smoothScroll:function(G){if(window.event){target=window.event.srcElement}else{if(G){target=G.target}else{return}}if(target.nodeName.toLowerCase()!="a"){target=target.parentNode}if(target.nodeName.toLowerCase()!="a"){return}anchor=target.hash.substr(1);var F=document.getElementsByTagName("a");var A=null;for(var E=0;E<F.length;E++){var H=F[E];if(H.name&&(H.name==anchor)){A=H;break}}if(!A){A=document.getElementById(anchor)}if(!A){return true}var C=A.offsetLeft;var B=A.offsetTop;var D=A;while(D.offsetParent&&(D.offsetParent!=document.body)){D=D.offsetParent;C+=D.offsetLeft;B+=D.offsetTop}clearInterval(ss.INTERVAL);cypos=ss.getCurrentYPos();ss_stepsize=parseInt((B-cypos)/ss.STEPS);ss.INTERVAL=setInterval("ss.scrollWindow("+ss_stepsize+","+B+',"'+anchor+'")',10);if(window.event){window.event.cancelBubble=true;window.event.returnValue=false}if(G&&G.preventDefault&&G.stopPropagation){G.preventDefault();G.stopPropagation()}},scrollWindow:function(A,C,B){wascypos=ss.getCurrentYPos();isAbove=(wascypos<C);window.scrollTo(0,wascypos+A);iscypos=ss.getCurrentYPos();isAboveNow=(iscypos<C);if((isAbove!=isAboveNow)||(wascypos==iscypos)){window.scrollTo(0,C);clearInterval(ss.INTERVAL);location.hash=B}},getCurrentYPos:function(){if(document.body&&document.body.scrollTop){return document.body.scrollTop}if(document.documentElement&&document.documentElement.scrollTop){return document.documentElement.scrollTop}if(window.pageYOffset){return window.pageYOffset}return 0},addEvent:function(E,D,B,A){if(E.addEventListener){E.addEventListener(D,B,A);return true}else{if(E.attachEvent){var C=E.attachEvent("on"+D,B);return C}else{alert("Handler could not be removed")}}}};ss.STEPS=25;ss.addEvent(window,"load",ss.fixAllLinks);
