// JavaScript Document
/**
 * jQuery.ScrollTo - Easy element scrolling using jQuery.
 * Copyright (c) 2007-2009 Ariel Flesler - aflesler(at)gmail(dot)com | http://flesler.blogspot.com
 * Dual licensed under MIT and GPL.
 * Date: 3/9/2009
 * @author Ariel Flesler
 * @version 1.4.1
 *
 * http://flesler.blogspot.com/2007/10/jqueryscrollto.html
 */
;(function(e){var a=e.scrollTo=function(h,g,f){e(window).scrollTo(h,g,f)};a.defaults={axis:"xy",duration:parseFloat(e.fn.jquery)>=1.3?0:1};a.window=function(f){return e(window)._scrollable()};e.fn._scrollable=function(){return this.map(function(){var g=this,f=!g.nodeName||e.inArray(g.nodeName.toLowerCase(),["iframe","#document","html","body"])!=-1;if(!f||isIPad()){return g}var h=(g.contentWindow||g).document||g.ownerDocument||g;return e.browser.safari||h.compatMode=="BackCompat"?h.body:h.documentElement})};e.fn.scrollTo=function(h,g,f){if(typeof g=="object"){f=g;g=0}if(typeof f=="function"){f={onAfter:f}}if(h=="max"){h=9000000000}f=e.extend({},a.defaults,f);g=g||f.speed||f.duration;f.queue=f.queue&&f.axis.length>1;if(f.queue){g/=2}f.offset=c(f.offset);f.over=c(f.over);return this._scrollable().each(function(){var n=this,l=e(n),m=h,k,i={},o=b(l)||l.is("html,body");switch(typeof m){case"number":case"string":if(/^([+-]=)?\d+(\.\d+)?(px|%)?$/.test(m)){m=c(m);break}m=e(m,this);case"object":if(m.is||m.style){k=(m=e(m)).offset()}}e.each(f.axis.split(""),function(s,t){var u=t=="x"?"Left":"Top",w=u.toLowerCase(),r="scroll"+u,q=n[r],p=a.max(n,t);if(k){i[r]=k[w]+(o?0:q-l.offset()[w]);if(f.margin){i[r]-=parseInt(m.css("margin"+u))||0;i[r]-=parseInt(m.css("border"+u+"Width"))||0}i[r]+=f.offset[w]||0;if(f.over[w]){i[r]+=m[t=="x"?"width":"height"]()*f.over[w]}}else{var v=m[w];i[r]=v.slice&&v.slice(-1)=="%"?parseFloat(v)/100*p:v}if(/^\d+$/.test(i[r])){i[r]=i[r]<=0?0:Math.min(i[r],p)}if(!s&&f.queue){if(q!=i[r]){j(f.onAfterFirst)}delete i[r]}});j(f.onAfter);function j(r){var p=jQuery.speed(g,f.easing,r&&function(){r.call(this,h,f)});p.complete=p.old;if(b(l)){for(var q in i){l.get(0)[q]=l[q]()}p.step=d;l.get(0).ownerDocument=l.get(0).document}l.animate(i,p)}}).end()};a.max=function(l,k){var j=k=="x"?"Width":"Height",g="scroll"+j;if(b(e(l))){l=l.document.documentElement}if(!e(l).is("html,body")){return l[g]-e(l)[j.toLowerCase()]()}var i="client"+j,h=l.ownerDocument.documentElement,f=l.ownerDocument.body;return Math.max(h[g],f[g])-Math.min(h[i],f[i])};function b(f){return f.get(0)&&!!f.get(0).navigator}function d(f,g){e(this)[g.prop](f);e(this).trigger('scroll')}function c(f){return typeof f=="object"?f:{top:f,left:f}}})(jQuery);
