/*https://github.com/im4aLL/chromeSmoothScroll*/ var chromeSmoothScroll=function(){"use strict";var a={counter:0,minVal:0,maxVal:$(window).height()+500,speed:800,offset:100,scrollHappen:!1,mainTriggerElem:"html",animateTriggerElem:"html, body",tempPos:0,animating:!1,updatedMaxVal:!1,chromeOnly:!0},b=!1,c=function(){if(window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(a){window.setTimeout(a,1e3/60)}}(),a.chromeOnly===!0&&!g())return!1;var c="mousewheel";a.chromeOnly===!1&&(c+=" DOMMouseScroll"),$(a.mainTriggerElem).bind(c,function(c){c.preventDefault(),a.updatedMaxVal||d(),a.scrollHappen===!1&&0!==$(window).scrollTop()&&e(),a.scrollHappen=!0,c=c.originalEvent?c.originalEvent:c;var g=c.detail?-40*c.detail:c.wheelDelta;g>0?a.counter--:0>g&&a.counter++,a.countera.maxVal&&(a.counter=a.maxVal/a.offset),a.tempPos!=a.counter&&(b||(requestAnimFrame(function(){f()}),b=!0))});var i=null;$(window).scroll(function(){a.animating===!1&&(clearTimeout(i),i=setTimeout(e,1e3))}),h()},d=function(){a.maxVal=$(document).height()<$(window).height()?$(window).height():$(document).height(),a.updatedMaxVal=!0},e=function(){a.counter=$(window).scrollTop()/a.offset},f=function(){a.animating=!0,$(a.animateTriggerElem).stop().animate({scrollTop:a.counter*a.offset},a.speed,function(){a.tempPos=a.counter,a.animating=!1}),b=!1},g=function(){return navigator.userAgent.toLowerCase().indexOf("chrome")>-1},h=function(){$(a.mainTriggerElem).keydown(function(b){switch(b.which){case 38:$(a.animateTriggerElem).stop().animate({scrollTop:$(window).scrollTop()-2*a.offset},a.speed);break;case 40:$(a.animateTriggerElem).stop().animate({scrollTop:$(window).scrollTop()+2*a.offset},a.speed)}return 38==b.which||40==b.which?!1:void 0})};return{init:c}}();chromeSmoothScroll.init();