var snowStorm=null;function SnowStorm(){this.flakesMax=64;this.flakesMaxActive=32;this.animationInterval=30;this.flakeBottom=null;this.targetElement=null;this.followMouse=false;this.snowColor="#fff";this.snowCharacter="•";this.snowStick=false;this.useMeltEffect=false;this.useTwinkleEffect=false;this.usePositionFixed=false;this.flakeLeftOffset=0;this.flakeRightOffset=0;this.flakeWidth=8;this.flakeHeight=8;this.vMaxX=5;this.vMaxY=4;this.zIndex=-1;var x=(typeof(window.attachEvent)=="undefined"?function(E,s,i){return E.addEventListener(s,i,false)}:function(E,s,i){return E.attachEvent("on"+s,i)});var A=(typeof(window.attachEvent)=="undefined"?function(E,s,i){return E.removeEventListener(s,i,false)}:function(E,s,i){return E.detachEvent("on"+s,i)});function l(s,i){if(isNaN(i)){i=0}return(Math.random()*s)+i}function y(i){return(parseInt(l(2),10)==1?i*-1:i)}var p=this;var f=this;this.timers=[];this.flakes=[];this.disabled=false;this.active=false;var u=navigator.userAgent.match(/msie/i);var t=navigator.userAgent.match(/msie 6/i);var m=(u&&(t||navigator.userAgent.match(/msie 5/i)));var q=navigator.appVersion.match(/windows 98/i);var n=navigator.userAgent.match(/iphone/i);var d=(u&&document.compatMode=="BackCompat");var o=((d||t||n)?true:false);var b=null;var v=null;var D=null;var w=null;var c=null;var a=null;var C=1;var j=2;var h=6;var k=false;var B=(function(){try{document.createElement("div").style.opacity="0.5"}catch(i){return false}return true})();var e=document.createDocumentFragment();if(p.flakeLeftOffset===null){p.flakeLeftOffset=0}if(p.flakeRightOffset===null){p.flakeRightOffset=0}this.meltFrameCount=20;this.meltFrames=[];for(var z=0;z=0&&F.vX<0.2){F.vX=0.2}else{if(F.vX<0&&F.vX>-0.2){F.vX=-0.2}}if(F.vY>=0&&F.vY<0.2){F.vY=0.2}};this.move=function(){var s=F.vX*C;F.x+=s;F.y+=(F.vY*F.vAmp);if(F.x>=b||b-F.x0.998){F.melting=true;F.melt()}if(E.useTwinkleEffect){if(!F.twinkleFrame){if(Math.random()>0.9){F.twinkleFrame=parseInt(Math.random()*20,10)}}else{F.twinkleFrame--;F.o.style.visibility=(F.twinkleFrame&&F.twinkleFrame%2===0?"hidden":"visible")}}}};this.animate=function(){F.move()};this.setVelocities=function(){F.vX=c+l(E.vMaxX*0.12,0.1);F.vY=a+l(E.vMaxY*0.12,0.1)};this.setOpacity=function(J,s){if(!B){return false}J.style.opacity=s};this.melt=function(){if(!E.useMeltEffect||!F.melting){F.recycle()}else{if(F.meltFramep.flakesMaxActive){p.flakes[p.flakes.length-1].active=-1}}f.targetElement.appendChild(e)};this.timerInit=function(){p.timers=(!q?[setInterval(p.snow,p.animationInterval)]:[setInterval(p.snow,p.animationInterval*3),setInterval(p.snow,p.animationInterval)])};this.init=function(){p.randomizeWind();p.createSnow(p.flakesMax);x(window,"resize",p.resizeHandler);x(window,"scroll",p.scrollHandler);if(!m){x(window,"blur",p.freeze);x(window,"focus",p.resume)}p.resizeHandler();p.scrollHandler();if(p.followMouse){x(document,"mousemove",p.mouseMove)}p.animationInterval=Math.max(20,p.animationInterval);p.timerInit()};var r=false;this.start=function(s){if(!r){r=true}else{if(s){return true}}if(typeof p.targetElement=="string"){var i=p.targetElement;p.targetElement=document.getElementById(i);if(!p.targetElement){throw new Error('Snowstorm: Unable to get targetElement "'+i+'"')}}if(!p.targetElement){p.targetElement=(!u?(document.documentElement?document.documentElement:document.body):document.body)}if(p.targetElement!=document.documentElement&&p.targetElement!=document.body){p.resizeHandler=p.resizeHandlerAlt}p.resizeHandler();p.usePositionFixed=(p.usePositionFixed&&!o);k=p.usePositionFixed;if(b&&D&&!p.disabled){p.init();p.active=true}};function g(){p.start(true)}if(document.addEventListener){document.addEventListener("DOMContentLoaded",g,false);window.addEventListener("load",g,false)}else{x(window,"load",g)}}snowStorm=new SnowStorm();