function Snowflake($container,$maxheight){var container,snowdiv,snowimg;var skal,alpha,zufall,maxheight;maxheight=0;if(typeof($container)=='undefined'){container=document.body;}
else if(typeof($container)!='object'){if(document.getElementById($container)){container=document.getElementById($container);}
else{container=document.body;}}
if(typeof($maxheight)!='undefined'){maxheight=$maxheight;}
else if(typeof(container)=='object'){maxheight=container.offsetHeight;}
function init(){if(typeof(container)=='object'){$snowdiv=document.createElement('div');$snowdiv.style.position='absolute';$snowdiv.style.overflow='hidden';snowdiv=container.appendChild($snowdiv);$snowimg=document.createElement('img');$snowimg.border='0';$snowimg.alt='';snowimg=snowdiv.appendChild($snowimg);start();}}
function start($startTop){skal=3+parseInt((Math.random()*100%4));alpha=20+parseInt(Math.random()*50);snowdiv.style.width=skal+'px';snowdiv.style.height=skal+'px';snowimg.width=skal;snowimg.height=skal;snowimg.src='/images/snow_large.png';if(snowdiv.skal<4){snowimg.src='/images/snow_small.png';}
snowdiv.style.opacity=parseFloat(alpha/100);snowdiv.style.alpha='alpha(opacity='+alpha+')';snowdiv.style.left=(-10+parseInt(Math.random()*container.offsetWidth))+'px';if(typeof($startTop)!='undefined'){snowdiv.style.top=$startTop+'px';}
else{snowdiv.style.top=(-10+parseInt(Math.random()*container.offsetHeight))+'px';}
zufall=2+parseInt(Math.random()*3);move();}
function move(){$moveto=parseInt(snowdiv.style.top);snowdiv.style.top=($moveto+zufall)+'px';if(maxheight-$moveto<(maxheight/10)){fade=alpha/((maxheight/10)-(maxheight-$moveto));snowdiv.style.opacity=parseFloat(fade/100);snowdiv.style.alpha='alpha(opacity='+fade+')';}
if($moveto-10>maxheight){start(0);}
else{setTimeout(function(){move();},60);}}
init();}
