var imagePath="http://static.pixelon.ru/images/snow/";function getDocumentSize(j){var a={width:0,height:0};var e=0,d=0,c=0,b=0,m=0;var i=0,h=0,g=0,f=0,l=0;if(j.width){m=j.width}if(j.body){if(j.body.scrollWidth){e=j.body.scrollWidth}if(j.body.offsetWidth){d=j.body.offsetWidth}}if(j.documentElement){c=j.documentElement.scrollWidth;b=j.documentElement.clientWidth}m=Math.max(Math.max(Math.max(e,d),Math.max(c,b)),m);if(j.height){l=j.height}if(j.body){if(j.body.scrollHeight){i=j.body.scrollHeight}if(j.body.offsetHeight){h=j.body.offsetHeight}}if(j.documentElement){g=j.documentElement.scrollHeight;f=j.documentElement.clientHeight}l=Math.max(Math.max(Math.max(i,h),Math.max(g,f)),l);a.width=m;a.height=l;return a}var win={w:function(){return getDocumentSize(document).width},h:function(){return getDocumentSize(document).height}};var snow={flakes:[],timer:false,init:function(b){this.flakes=[];k=0;for(var c=0;c3){k=0}a.style.position="absolute";a.style.zIndex=c;document.body.appendChild(a);this.flakes[c]={img:a,pos:function(d,e){this.img.style.left=d+"px";this.img.style.top=e+"px";return this},x:Math.random()*(win.w()-50),y:Math.random()*win.h(),a:Math.random()*20,s:{x:Math.random()*0.1+0.02,y:Math.random()+0.7},d:0}}},start:function(a){this.init(a||10);this.timer=setInterval(function(){snow.live()},50)},stop:function(){if(this.timer){clearInterval(this.timer);this.timer=false}},live:function(){for(var a in this.flakes){var b=this.flakes[a];if((b.y+=b.s.y)>(win.h()-50)){b.pos(b.x=(Math.random()*(win.w()-50)),b.y=0)}else{b.pos(b.a*Math.sin(b.d+=b.s.x)+b.x,b.y)}}}};window.onload=function(){snow.start(50)};