(function(name,context,definition){if(typeof module!="undefined"&&module.exports)module.exports=definition();else if(typeof define=="function"&&define.amd)define(definition);else context[name]=definition()})("jquery-scrollto",this,function(){var jQuery,$,ScrollTo;jQuery=$=window.jQuery||require("jquery");$.propHooks.scrollTop=$.propHooks.scrollLeft={get:function(elem,prop){var result=null;if(elem.tagName==="HTML"||elem.tagName==="BODY"){if(prop==="scrollLeft"){result=window.scrollX}else if(prop==="scrollTop"){result=window.scrollY}}if(result==null){result=elem[prop]}return result}};$.Tween.propHooks.scrollTop=$.Tween.propHooks.scrollLeft={get:function(tween){return $.propHooks.scrollTop.get(tween.elem,tween.prop)},set:function(tween){if(tween.elem.tagName==="HTML"||tween.elem.tagName==="BODY"){tween.options.bodyScrollLeft=tween.options.bodyScrollLeft||window.scrollX;tween.options.bodyScrollTop=tween.options.bodyScrollTop||window.scrollY;if(tween.prop==="scrollLeft"){tween.options.bodyScrollLeft=Math.round(tween.now)}else if(tween.prop==="scrollTop"){tween.options.bodyScrollTop=Math.round(tween.now)}window.scrollTo(tween.options.bodyScrollLeft,tween.options.bodyScrollTop)}else if(tween.elem.nodeType&&tween.elem.parentNode){tween.elem[tween.prop]=tween.now}}};ScrollTo={config:{duration:400,easing:"swing",callback:undefined,durationMode:"each",offsetTop:0,offsetLeft:0},configure:function(options){$.extend(ScrollTo.config,options||{});return this},scroll:function(collections,config){var collection,$container,container,$target,$inline,position,containerTagName,containerScrollTop,containerScrollLeft,containerScrollTopEnd,containerScrollLeftEnd,startOffsetTop,targetOffsetTop,targetOffsetTopAdjusted,startOffsetLeft,targetOffsetLeft,targetOffsetLeftAdjusted,scrollOptions,callback;collection=collections.pop();$container=collection.$container;$target=collection.$target;containerTagName=$container.prop("tagName");$inline=$("").css({position:"absolute",top:"0px",left:"0px"});position=$container.css("position");$container.css({position:"relative"});$inline.appendTo($container);startOffsetTop=$inline.offset().top;targetOffsetTop=$target.offset().top;targetOffsetTopAdjusted=targetOffsetTop-startOffsetTop-parseInt(config.offsetTop,10);startOffsetLeft=$inline.offset().left;targetOffsetLeft=$target.offset().left;targetOffsetLeftAdjusted=targetOffsetLeft-startOffsetLeft-parseInt(config.offsetLeft,10);containerScrollTop=$container.prop("scrollTop");containerScrollLeft=$container.prop("scrollLeft");$inline.remove();$container.css({position:position});scrollOptions={};callback=function(event){if(collections.length===0){if(typeof config.callback==="function"){config.callback()}}else{ScrollTo.scroll(collections,config)}return true};if(config.onlyIfOutside){containerScrollTopEnd=containerScrollTop+$container.height();containerScrollLeftEnd=containerScrollLeft+$container.width();if(containerScrollTop