if(!Date.now)
Date.now= function() {return newDate().getTime(); };
(function() {'use strict';varvendors=['webkit','moz'];for(vari= 0; i
window.requestAnimationFrame=window[vp+'RequestAnimationFrame'];
window.cancelAnimationFrame=(window[vp+'CancelAnimationFrame']||window[vp+'CancelRequestAnimationFrame']);
}if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)//iOS6 is buggy
|| !window.requestAnimationFrame|| !window.cancelAnimationFrame) {varlastTime= 0;
window.requestAnimationFrame= function(callback) {varnow=Date.now();varnextTime=Math.max(lastTime+ 16, now);returnsetTimeout(function() { callback(lastTime=nextTime); },
nextTime-now);
};
window.cancelAnimationFrame=clearTimeout;
}
}());
(function($){
$.snowfall= function(element, options){varflakes=[],
defaults={
flakeCount :20,
flakeColor :'#ffffff',
flakePosition:'absolute',
flakeIndex:999999,
minSize :1,
maxSize :2,
minSpeed :1,
maxSpeed :5,
round :false,
shadow :false,
collection :false,
collectionHeight :40,
deviceorientation :false},
options=$.extend(defaults, options),
random= functionrandom(min, max){returnMath.round(min+Math.random()*(max-min));
};
$(element).data("snowfall",this);//Snow flake object
functionFlake(_x, _y, _size, _speed){//Flake properties
this.x=_x;this.y=_y;this.size=_size;this.speed=_speed;this.step= 0;this.stepSize=random(1,10)/ 100;if(options.collection){this.target=canvasCollection[random(0,canvasCollection.length-1)];
}varflakeMarkup= null;if(options.image){
flakeMarkup=document.createElement("img");
flakeMarkup.src=options.image;
}else{
flakeMarkup=document.createElement("div");