(function(C){var A=C.scrollTo=function(D,E,F){C(window).scrollTo(D,E,F);};A.defaults={axis:"xy",duration:parseFloat(C.fn.jquery)>=1.3?0:1};A.window=function(D){return C(window)._scrollable();};C.fn._scrollable=function(){return this.map(function(){var D=this,E=!D.nodeName||C.inArray(D.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;
if(!E){return D;}var F=(D.contentWindow||D).document||D.ownerDocument||D;return C.browser.safari||F.compatMode=="BackCompat"?F.body:F.documentElement;});};C.fn.scrollTo=function(F,E,D){if(typeof E=="object"){D=E;E=0;}if(typeof D=="function"){D={onAfter:D};}if(F=="max"){F=9000000000;
}D=C.extend({},A.defaults,D);E=E||D.speed||D.duration;D.queue=D.queue&&D.axis.length>1;if(D.queue){E/=2;}D.offset=B(D.offset);D.over=B(D.over);return this._scrollable().each(function(){var M=this,K=C(M),L=F,I,J={},G=K.is("html,body");switch(typeof L){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(L)){L=B(L);
break;}L=C(L,this);case"object":if(L.is||L.style){I=(L=C(L)).offset();}}C.each(D.axis.split(""),function(P,Q){var S=Q=="x"?"Left":"Top",R=S.toLowerCase(),U="scroll"+S,O=M[U],N=A.max(M,Q);if(I){J[U]=I[R]+(G?0:O-K.offset()[R]);if(D.margin){J[U]-=parseInt(L.css("margin"+S))||0;
J[U]-=parseInt(L.css("border"+S+"Width"))||0;}J[U]+=D.offset[R]||0;if(D.over[R]){J[U]+=L[Q=="x"?"width":"height"]()*D.over[R];}}else{var T=L[R];J[U]=T.slice&&T.slice(-1)=="%"?parseFloat(T)/100*N:T;}if(/^\d+$/.test(J[U])){J[U]=J[U]<=0?0:Math.min(J[U],N);}if(!P&&D.queue){if(O!=J[U]){H(D.onAfterFirst);
}delete J[U];}});H(D.onAfter);function H(N){K.animate(J,E,D.easing,N&&function(){N.call(this,F,D);});}}).end();};A.max=function(F,G){var I=G=="x"?"Width":"Height",H="scroll"+I;if(!C(F).is("html,body")){return F[H]-C(F)[I.toLowerCase()]();}var J="client"+I,E=F.ownerDocument.documentElement,D=F.ownerDocument.body;
return Math.max(E[H],D[H])-Math.min(E[J],D[J]);};function B(D){return typeof D=="object"?D:{top:D,left:D};}})(jQuery);