(function(a){(function(b){var c=b.scrollTo=function(g,e,f){b(window).scrollTo(g,e,f)};c.defaults={axis:"xy",duration:parseFloat(b.fn.jquery)>=1.3?0:1};c.window=function(e){return b(window)._scrollable()};b.fn._scrollable=function(){return this.map(function(){var f=this,g=!f.nodeName||b.inArray(f.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!g){return f}var e=(f.contentWindow||f).document||f.ownerDocument||f;return b.browser.safari||e.compatMode=="BackCompat"?e.body:e.documentElement})};b.fn.scrollTo=function(g,e,f){if(typeof e=="object"){f=e;e=0}if(typeof f=="function"){f={onAfter:f}}if(g=="max"){g=9000000000}f=b.extend({},c.defaults,f);e=e||f.speed||f.duration;f.queue=f.queue&&f.axis.length>1;if(f.queue){e/=2}f.offset=d(f.offset);f.over=d(f.over);return this._scrollable().each(function(){var k=this,h=b(k),l=g,m,j={},n=h.is("html,body");switch(typeof l){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(l)){l=d(l);break}l=b(l,this);case"object":if(l.is||l.style){m=(l=b(l)).offset()}}b.each(f.axis.split(""),function(p,o){var u=o=="x"?"Left":"Top",t=u.toLowerCase(),q="scroll"+u,s=k[q],r=c.max(k,o);if(m){j[q]=m[t]+(n?0:s-h.offset()[t]);if(f.margin){j[q]-=parseInt(l.css("margin"+u))||0;j[q]-=parseInt(l.css("border"+u+"Width"))||0}j[q]+=f.offset[t]||0;if(f.over[t]){j[q]+=l[o=="x"?"width":"height"]()*f.over[t]}}else{var v=l[t];j[q]=v.slice&&v.slice(-1)=="%"?parseFloat(v)/100*r:v}if(/^\d+$/.test(j[q])){j[q]=j[q]<=0?0:Math.min(j[q],r)}if(!p&&f.queue){if(s!=j[q]){i(f.onAfterFirst)}delete j[q]}});i(f.onAfter);function i(o){h.animate(j,e,f.easing,o&&function(){o.call(this,g,f)})}}).end()};c.max=function(h,e){var g=e=="x"?"Width":"Height",j="scroll"+g;if(!b(h).is("html,body")){return h[j]-b(h)[g.toLowerCase()]()}var k="client"+g,i=h.ownerDocument.documentElement,f=h.ownerDocument.body;return Math.max(i[j],f[j])-Math.min(i[k],f[k])};function d(e){return typeof e=="object"?e:{top:e,left:e}}})(a)})($smarthouse.j);
