text: var Elevator=function(n){"use strict";function t(n,t,e,o){return n/=o/2,1>n?e/2*n*n+t:(n--,-e/2*(n*(n-2)-1)+t)}function e(n,t){for(var e in t){var o=void 0===n[e]&&"function"!=typeof e;o&&(n[e]=t[e])}return n}function o(n){for(var t=0;n;)t+=n.offsetTop||0,n=n.offsetParent;return t}function l(n){T||(T=n);var e=n-T,o=t(e,k,C-k,b);window.scrollTo(0,o),b>e?w=requestAnimationFrame(l):r()}function i(){return window.requestAnimationFrame&&window.Audio&&window.addEventListener}function u(){T=null,k=null,h=!1}function a(){y&&(C=o(y))}function r(){u(),f&&(f.pause(),f.currentTime=0),A&&A.play(),p&&p()}function d(){h&&(cancelAnimationFrame(w),u(),f&&(f.pause(),f.currentTime=0),a(),window.scrollTo(0,C))}function c(n){n.addEventListener?n.addEventListener("click",F.elevate,!1):n.attachEvent("onclick",function(){a(),document.documentElement.scrollTop=C,document.body.scrollTop=C,window.scroll(0,C)})}function s(n){v=document.body;var t={duration:void 0,mainAudio:!1,endAudio:!1,preloadAudio:!0,loopAudio:!0,startCallback:null,endCallback:null};n=e(n,t),n.element&&c(n.element),i()&&(n.duration&&(E=!0,b=n.duration),n.targetElement&&(y=n.targetElement),window.addEventListener("blur",d,!1),n.mainAudio&&(f=new Audio(n.mainAudio),f.setAttribute("preload",n.preloadAudio),f.setAttribute("loop",n.loopAudio)),n.endAudio&&(A=new Audio(n.endAudio),A.setAttribute("preload","true")),n.endCallback&&(p=n.endCallback),n.startCallback&&(m=n.startCallback))}var m,f,A,p,v=null,w=null,b=null,E=!1,T=null,k=null,C=0,y=null,h=!1,F=this;this.elevate=function(){h||(h=!0,k=document.documentElement.scrollTop||v.scrollTop,a(),E||(b=1.5*Math.abs(C-k)),requestAnimationFrame(l),f&&f.play(),m&&m())},s(n)};