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