!function(){function e(){u=window.innerWidth,v=document.getElementById("home").clientHeight,g={x:u/2,y:v/2},h=document.getElementById("particles"),h.width=u,h.height=v,f=h.getContext("2d"),m=[];for(var e=0;u>e;e+=u/20)for(var t=0;v>t;t+=v/20){var n=e+Math.random()*u/20,o=t+Math.random()*v/20,i={x:n,originX:n,y:o,originY:o};m.push(i)}for(var r=0;r<m.length;r++){for(var a=[],c=m[r],l=0;l<m.length;l++){var y=m[l];if(c!=y){for(var w=!1,p=0;5>p;p++)w||void 0==a[p]&&(a[p]=y,w=!0);for(var p=0;5>p;p++)w||s(c,y)<s(c,a[p])&&(a[p]=y,w=!0)}}c.closest=a}for(var r in m){var M=new d(m[r],2+2*Math.random(),"rgba(255,255,255,0.3)");m[r].circle=M}}function t(){"ontouchstart"in window||window.addEventListener("mousemove",n),window.addEventListener("scroll",o),window.addEventListener("resize",i)}function n(e){var t=posy=0;e.pageX||e.pageY?(t=e.pageX,posy=e.pageY):(e.clientX||e.clientY)&&(t=e.clientX+document.body.scrollLeft+document.documentElement.scrollLeft,posy=e.clientY+document.body.scrollTop+document.documentElement.scrollTop),g.x=t,g.y=posy}function o(){y=document.body.scrollTop>v?!1:!0}function i(){u=window.innerWidth,v=document.getElementById("home").clientHeight,h.width=u,h.height=v}function r(){a();for(var e in m)c(m[e])}function a(){if(y){f.clearRect(0,0,u,v);for(var e in m)Math.abs(s(g,m[e]))<4e3?(m[e].active=.3,m[e].circle.active=.6):Math.abs(s(g,m[e]))<2e4?(m[e].active=.1,m[e].circle.active=.3):Math.abs(s(g,m[e]))<4e4?(m[e].active=.02,m[e].circle.active=.1):(m[e].active=0,m[e].circle.active=0),l(m[e]),m[e].circle.draw()}requestAnimationFrame(a)}function c(e){TweenLite.to(e,1+1*Math.random(),{x:e.originX-50+100*Math.random(),y:e.originY-50+100*Math.random(),ease:Circ.easeInOut,onComplete:function(){c(e)}})}function l(e){if(e.active)for(var t in e.closest)f.beginPath(),f.moveTo(e.x,e.y),f.lineTo(e.closest[t].x,e.closest[t].y),f.strokeStyle="rgba(156,217,249,"+e.active+")",f.stroke()}function d(e,t,n){var o=this;!function(){o.pos=e||null,o.radius=t||null,o.color=n||null}(),this.draw=function(){o.active&&(f.beginPath(),f.arc(o.pos.x,o.pos.y,o.radius,0,2*Math.PI,!1),f.fillStyle="rgba(156,217,249,"+o.active+")",f.fill())}}function s(e,t){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)}var u,v,h,f,m,g,y=!0;Modernizr.touchevents||(e(),r(),t())}();