text: /*!
   * rainyday.js v0.1.2 - https://github.com/maroslaw/rainyday.js
   * Copyright (c) 2013 Marek Brodziakt
   * Licensed under the GPLv2 license
   */
  function RainyDay(a){this.img=document.getElementById(a.element),this.opacity=a.opacity||1,this.blurRadius=a.blur||10,this.w=this.img.clientWidth,this.h=this.img.clientHeight,this.drops=[],this.canvas=this.prepareCanvas(this.img),this.prepareBackground(this.w,this.h),this.prepareGlass(),this.reflection=this.REFLECTION_MINIATURE,this.trail=this.TRAIL_DROPS,this.gravity=this.GRAVITY_NON_LINEAR,this.collision=this.COLLISION_SIMPLE,this.VARIABLE_GRAVITY_THRESHOLD=3,this.VARIABLE_GRAVITY_ANGLE=Math.PI/2,this.VARIABLE_GRAVITY_ANGLE_VARIANCE=0,this.VARIABLE_FPS=a.fps,this.VARIABLE_FILL_STYLE="#8ED6FF",this.VARIABLE_COLLISIONS=!0,this.REFLECTION_SCALEDOWN_FACTOR=5,this.REFLECTION_DROP_MAPPING_WIDTH=200,this.REFLECTION_DROP_MAPPING_HEIGHT=200}function Drop(a,b,c,d,e){this.x=Math.floor(b),this.y=Math.floor(c),this.r=Math.random()*e+d,this.rainyday=a,this.context=a.context,this.reflection=a.reflected}function BlurStack(){this.r=0,this.g=0,this.b=0,this.next=null}function CollisionMatrix(a,b,c){this.resolution=c,this.xc=a,this.yc=b,this.matrix=new Array(a);for(var d=0;a+5>=d;d++){this.matrix[d]=new Array(b);for(var e=0;b+5>=e;++e)this.matrix[d][e]=new DropItem(null)}}function DropItem(a){this.drop=a,this.next=null}RainyDay.prototype.prepareCanvas=function(a){var b=document.createElement("canvas");return b.style.position="absolute",b.width=a.clientWidth,b.height=a.clientHeight,b.style.left=a.offsetLeft,b.style.top=a.offsetTop,document.getElementsByTagName("body")[0].appendChild(b),setInterval(function(c){c.checkSize(b,a)}(this),500),b},RainyDay.prototype.checkSize=function(a,b){a.style.width!==b.clientWidth&&(a.style.width=b.clientWidth),a.style.height!==b.clientHeight&&(a.style.height=b.clientHeight),a.style.left!==b.offsetLeft&&(a.style.left=b.offsetLeft),a.style.top!==b.offsetTop&&(a.style.top=b.offsetTop)},RainyDay.prototype.animateDrops=function(){var a=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame;a||(a=function(a){window.setTimeout(a,1e3/this.VARIABLE_FPS)}),this.addDropCallback&&this.addDropCallback();for(var b=this.drops.slice(),c=[],d=0;d<b.length;++d)b[d].animate()&&c.push(b[d]);this.drops=c,a(this.animateDrops.bind(this))},RainyDay.prototype.prepareReflections=function(){this.reflected=document.createElement("canvas"),this.reflected.width=this.canvas.width/this.REFLECTION_SCALEDOWN_FACTOR,this.reflected.height=this.canvas.height/this.REFLECTION_SCALEDOWN_FACTOR;var a=this.reflected.getContext("2d");a.drawImage(this.img,0,0,this.reflected.width,this.reflected.height)},RainyDay.prototype.prepareGlass=function(){this.glass=document.createElement("canvas"),this.glass.width=this.canvas.width,this.glass.height=this.canvas.height,this.context=this.glass.getContext("2d")},RainyDay.prototype.rain=function(a,b){if(this.reflection!==this.REFLECTION_NONE&&this.prepareReflections(),this.animateDrops(),this.presets=a,this.PRIVATE_GRAVITY_FORCE_FACTOR_Y=.001*this.VARIABLE_FPS/25,this.PRIVATE_GRAVITY_FORCE_FACTOR_X=(Math.PI/2-this.VARIABLE_GRAVITY_ANGLE)*.001*this.VARIABLE_FPS/50,this.VARIABLE_COLLISIONS){for(var c=0,d=0;d<a.length;d++)a[d][0]+a[d][1]>c&&(c=Math.floor(a[d][0]+a[d][1]));if(c>0){var e=Math.ceil(this.w/c),f=Math.ceil(this.h/c);this.matrix=new CollisionMatrix(e,f,c)}else this.VARIABLE_COLLISIONS=!1}for(var d=0;d<a.length;d++)a[d][3]||(a[d][3]=-1);var g=0;this.addDropCallback=function(){var c=(new Date).getTime();if(!(b>c-g)){g=c;var d=this.canvas.getContext("2d");d.clearRect(0,0,this.canvas.width,this.canvas.height),d.drawImage(this.background,0,0,this.canvas.width,this.canvas.height);for(var e,f=0;f<a.length;f++)if(a[f][2]>1||-1===a[f][3]){if(0!==a[f][3]){a[f][3]--;for(var h=0;h<a[f][2];++h)this.putDrop(new Drop(this,Math.random()*this.w,Math.random()*this.h,a[f][0],a[f][1]))}}else if(Math.random()<a[f][2]){e=a[f];break}e&&this.putDrop(new Drop(this,Math.random()*this.w,Math.random()*this.h,e[0],e[1])),d.save(),d.globalAlpha=this.opacity,d.drawImage(this.glass,0,0,this.canvas.width,this.canvas.height),d.restore()}}.bind(this)},RainyDay.prototype.putDrop=function(a){a.draw(),this.gravity&&a.r>this.VARIABLE_GRAVITY_THRESHOLD&&(this.VARIABLE_COLLISIONS&&this.matrix.update(a),this.drops.push(a))},RainyDay.prototype.clearDrop=function(a,b){var c=a.clear(b);if(c){var d=this.drops.indexOf(a);d>=0&&this.drops.splice(d,1)}return c},Drop.prototype.draw=function(){this.context.save(),this.context.beginPath();var a=this.r;if(this.r=.95*this.r,this.r<3)this.context.arc(this.x,this.y,this.r,0,2*Math.PI,!0),this.context.closePath();else if(this.colliding||this.yspeed>2){if(this.colliding){var b=this.colliding;this.r=1.001*(this.r>b.r?this.r:b.r),this.x+=b.x-this.x,this.colliding=null}var c=1+.1*this.yspeed;this.context.moveTo(this.x-this.r/c,this.y),this.context.bezierCurveTo(this.x-this.r,this.y-2*this.r,this.x+this.r,this.y-2*this.r,this.x+this.r/c,this.y),this.context.bezierCurveTo(this.x+this.r,this.y+c*this.r,this.x-this.r,this.y+c*this.r,this.x-this.r/c,this.y)}else this.context.arc(this.x,this.y,.9*this.r,0,2*Math.PI,!0),this.context.closePath();this.context.clip(),this.r=a,this.rainyday.reflection&&this.rainyday.reflection(this),this.context.restore()},Drop.prototype.clear=function(a){return this.context.clearRect(this.x-this.r-1,this.y-this.r-2,2*this.r+2,2*this.r+2),a?(this.terminate=!0,!0):this.y-this.r>this.rainyday.h||this.x-this.r>this.rainyday.w||this.x+this.r<0?!0:!1},Drop.prototype.animate=function(){if(this.terminate)return!1;var a=this.rainyday.gravity(this);if(!a&&this.rainyday.trail&&this.rainyday.trail(this),this.rainyday.VARIABLE_COLLISIONS){var b=this.rainyday.matrix.update(this,a);b&&this.rainyday.collision(this,b)}return!a||this.terminate},RainyDay.prototype.TRAIL_NONE=function(){},RainyDay.prototype.TRAIL_DROPS=function(a){(!a.trailY||a.y-a.trailY>=100*Math.random()*a.r)&&(a.trailY=a.y,this.putDrop(new Drop(this,a.x+(2*Math.random()-1)*Math.random(),a.y-a.r-5,Math.ceil(a.r/5),0)))},RainyDay.prototype.TRAIL_SMUDGE=function(a){var b=a.y-a.r-3,c=a.x-a.r/2+2*Math.random();0>b||0>c||this.context.drawImage(this.clearbackground,c,b,a.r,2,c,b,a.r,2)},RainyDay.prototype.GRAVITY_NONE=function(){return!0},RainyDay.prototype.GRAVITY_LINEAR=function(a){return this.clearDrop(a)?!0:(a.yspeed?(a.yspeed+=this.PRIVATE_GRAVITY_FORCE_FACTOR_Y*Math.floor(a.r),a.xspeed+=this.PRIVATE_GRAVITY_FORCE_FACTOR_X*Math.floor(a.r)):(a.yspeed=this.PRIVATE_GRAVITY_FORCE_FACTOR_Y,a.xspeed=this.PRIVATE_GRAVITY_FORCE_FACTOR_X),a.y+=a.yspeed,a.draw(),!1)},RainyDay.prototype.GRAVITY_NON_LINEAR=function(a){return this.clearDrop(a)?!0:(a.collided?(a.collided=!1,a.seed=Math.floor(a.r*Math.random()*this.VARIABLE_FPS),a.skipping=!1,a.slowing=!1):(!a.seed||a.seed<0)&&(a.seed=Math.floor(a.r*Math.random()*this.VARIABLE_FPS),a.skipping=a.skipping===!1?!0:!1,a.slowing=!0),a.seed--,a.yspeed?a.slowing?(a.yspeed/=1.1,a.xspeed/=1.1,a.yspeed<this.PRIVATE_GRAVITY_FORCE_FACTOR_Y&&(a.slowing=!1)):a.skipping?(a.yspeed=this.PRIVATE_GRAVITY_FORCE_FACTOR_Y,a.xspeed=this.PRIVATE_GRAVITY_FORCE_FACTOR_X):(a.yspeed+=1*this.PRIVATE_GRAVITY_FORCE_FACTOR_Y*Math.floor(a.r),a.xspeed+=1*this.PRIVATE_GRAVITY_FORCE_FACTOR_X*Math.floor(a.r)):(a.yspeed=this.PRIVATE_GRAVITY_FORCE_FACTOR_Y,a.xspeed=this.PRIVATE_GRAVITY_FORCE_FACTOR_X),0!==this.VARIABLE_GRAVITY_ANGLE_VARIANCE&&(a.xspeed+=(2*Math.random()-1)*a.yspeed*this.VARIABLE_GRAVITY_ANGLE_VARIANCE),a.y+=a.yspeed,a.x+=a.xspeed,a.draw(),!1)},RainyDay.prototype.REFLECTION_NONE=function(){this.context.fillStyle=this.VARIABLE_FILL_STYLE,this.context.fill()},RainyDay.prototype.REFLECTION_MINIATURE=function(a){var b=Math.max((a.x-this.REFLECTION_DROP_MAPPING_WIDTH)/this.REFLECTION_SCALEDOWN_FACTOR,0),c=Math.max((a.y-this.REFLECTION_DROP_MAPPING_HEIGHT)/this.REFLECTION_SCALEDOWN_FACTOR,0),d=Math.min(2*this.REFLECTION_DROP_MAPPING_WIDTH/this.REFLECTION_SCALEDOWN_FACTOR,this.reflected.width-b),e=Math.min(2*this.REFLECTION_DROP_MAPPING_HEIGHT/this.REFLECTION_SCALEDOWN_FACTOR,this.reflected.height-c);this.context.drawImage(this.reflected,b,c,d,e,a.x-1.1*a.r,a.y-1.1*a.r,2*a.r,2*a.r)},RainyDay.prototype.COLLISION_SIMPLE=function(a,b){for(var c,d=b;null!=d;){var e=d.drop;if(Math.sqrt(Math.pow(a.x-e.x,2)+Math.pow(a.y-e.y,2))<a.r+e.r){c=e;break}d=d.next}if(c){var f,g;a.y>c.y?(f=a,g=c):(f=c,g=a),this.clearDrop(g),this.clearDrop(f,!0),this.matrix.remove(f),g.draw(),g.colliding=f,g.collided=!0}},RainyDay.prototype.prepareBackground=function(a,b){a&&b?(this.canvas.style.width=a+"px",this.canvas.style.height=b+"px",this.canvas.width=a,this.canvas.height=b):(a=this.canvas.width,b=this.canvas.height),this.background=document.createElement("canvas"),this.background.width=this.canvas.width,this.background.height=this.canvas.height,this.clearbackground=document.createElement("canvas"),this.clearbackground.width=this.canvas.width,this.clearbackground.height=this.canvas.height;var c=this.background.getContext("2d");c.clearRect(0,0,a,b),c.drawImage(this.img,0,0,a,b),c=this.clearbackground.getContext("2d"),c.clearRect(0,0,a,b),c.drawImage(this.img,0,0,a,b),!isNaN(this.blurRadius)&&this.blurRadius>=1&&this.stackBlurCanvasRGB(a,b,this.blurRadius)},RainyDay.prototype.stackBlurCanvasRGB=function(a,b,c){var d=[[0,9],[1,11],[2,12],[3,13],[5,14],[7,15],[11,16],[15,17],[22,18],[31,19],[45,20],[63,21],[90,22],[127,23],[181,24]],e=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259];c|=0;var f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z=this.background.getContext("2d"),A=z.getImageData(0,0,a,b),B=A.data,C=c+1,D=C*(C+1)/2,E=new BlurStack,F=new BlurStack,G=E;for(h=1;2*c+1>h;h++)G=G.next=new BlurStack,h===C&&(F=G);G.next=E;var H=null,I=null;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,I=I.next,k+=a}z.putImageData(A,0,0)},CollisionMatrix.prototype.update=function(a,b){if(a.gid){if(this.matrix[a.gmx][a.gmy].remove(a),b)return null;if(a.gmx=Math.floor(a.x/this.resolution),a.gmy=Math.floor(a.y/this.resolution),!this.matrix[a.gmx]||!this.matrix[a.gmx][a.gmy])return null;this.matrix[a.gmx][a.gmy].add(a);var c=this.collisions(a);if(c&&null!=c.next)return c.next}else{if(a.gid=Math.random().toString(36).substr(2,9),a.gmx=Math.floor(a.x/this.resolution),a.gmy=Math.floor(a.y/this.resolution),!this.matrix[a.gmx]||!this.matrix[a.gmx][a.gmy])return null;this.matrix[a.gmx][a.gmy].add(a)}return null},CollisionMatrix.prototype.collisions=function(a){var b=new DropItem(null),c=b;return b=this.addAll(b,a.gmx-1,a.gmy+1),b=this.addAll(b,a.gmx,a.gmy+1),b=this.addAll(b,a.gmx+1,a.gmy+1),c},CollisionMatrix.prototype.addAll=function(a,b,c){if(b>0&&c>0&&b<this.xc&&c<this.yc)for(var d=this.matrix[b][c];null!=d.next;)d=d.next,a.next=new DropItem(d.drop),a=a.next;return a},CollisionMatrix.prototype.remove=function(a){this.matrix[a.gmx][a.gmy].remove(a)},DropItem.prototype.add=function(a){for(var b=this;null!=b.next;)b=b.next;b.next=new DropItem(a)},DropItem.prototype.remove=function(a){for(var b=this,c=null;null!=b.next;)c=b,b=b.next,b.drop.gid===a.gid&&(c.next=b.next)};