(function(A){A.extend(A.fx.step,{backgroundPosition:function(D){if(D.state===0&&typeof D.end=="string"){var F=A.curCSS(D.elem,"backgroundPosition");F=C(F);D.start=[F[0],F[2]];var B=C(D.end);D.end=[B[0],B[2]];D.unit=[B[1],B[3]]}var E=[];E[0]=((D.end[0]-D.start[0])*D.pos)+D.start[0]+D.unit[0];E[1]=((D.end[1]-D.start[1])*D.pos)+D.start[1]+D.unit[1];D.elem.style.backgroundPosition=E[0]+" "+E[1];function C(H){H=H.replace(/left|top/g,"0px");H=H.replace(/right|bottom/g,"100%");H=H.replace(/([0-9\.]+)(\s|\)|$)/g,"$1px$2");var G=H.match(/(-?[0-9\.]+)(px|\%|em|pt)\s(-?[0-9\.]+)(px|\%|em|pt)/);return[parseFloat(G[1],10),G[2],parseFloat(G[3],10),G[4]]}}})})(jQuery);
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);