var vx=[],vy=[],vs=[],elid=[],el=[],imgs=[],nv=65,sv=45,canv,timout=150,tim5,wid,hei,maxsz=100;function init(){sneeuw()}function doexit(){clearTimeout(tim5)}
function sneeuw(){var a=document.getElementById("sneeuw");wid=document.body.clientWidth-20;hei=document.body.clientHeight;a.setAttribute("width",wid);a.setAttribute("height",hei);for(var b,c=0;c<nv;c++)vx[c]=Math.floor(Math.random()*wid),vy[c]=Math.floor(Math.random()*hei),elid[c]="e"+c,el[c]=document.createElement("div"),el[c].setAttribute("id",elid[c]),el[c].setAttribute("z-index",20),el[c].style.position="absolute",el[c].style.top=Math.floor(Math.random()*hei)+"px",el[c].style.left=Math.floor(Math.random()*
wid)+"px",a.appendChild(el[c]),b=document.createElement("img"),b.setAttribute("src","http://dvsb.nl/images/sneeuwvlok.png"),b.setAttribute("alt","*"),vs[c]=c<sv?10+Math.floor(Math.random()*maxsz/3):10+Math.floor(Math.random()*maxsz),b.setAttribute("height",vs[c]+"px"),b.setAttribute("width",vs[c]+"px"),el[c].appendChild(b);tim5=setTimeout("sneeuwit2()",timout)}
function sneeuwit2(){for(var a=0;a<nv;a++)vx[a]+=Math.floor((Math.random()*vs[a]-vs[a]/2)/4.4-1),vy[a]+=Math.floor(Math.random()*vs[a]/4.2),el[a].style.top=vy[a]+"px",el[a].style.left=vx[a]+"px",vy[a]>hei&&(vy[a]=15),vx[a]>wid-maxsz&&(vx[a]=4),1>vx[a]&&(vx[a]=wid-maxsz-3);tim5=setTimeout("sneeuwit2()",timout)}
function sneeuwit(){canv.setAttribute("width",wid);canv.setAttribute("height",hei);var a=canv.getContext("2d");a.font="30px Arial";a.fillStyle="rgba(255, 255, 255 , 1.0 )";for(var b=0;b<nv;b++)vx[b]+=Math.floor(2*Math.random()),vy[b]+=Math.floor(5*Math.random()),a.fillText(".",vx[b],vy[b]),a.fill(),vy[b]>hei&&(vy[b]=10);tim5=setTimeout("sneeuwit()",timout)}function sdebug(a){var b=document.getElementById("debug").innerHTML;document.getElementById("debug").innerHTML=b+"<em>"+a+"</em><br>"};

