<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title></head><body>
<script language="javascript">
var snowflake=new Array();
function getimg(val)
{
snowflake=val.split(',');
}
var no = 28 ;//同期显示图片数
var speed=100;//下降速度
var oTime = new Date();
var lastTime = oTime.getTime();
var x_sin, x_point, y_point;
var x_length, x_increased, y_increased;
var i, body_width = 932, body_height = 700;
var lastTime = 0;
var fallInterval = 2.4;
var num;
var x_sin = new Array();
var x_point = new Array();
var y_point = new Array();
var x_length = new Array();
var x_increased = new Array();
var y_increased = new Array();
var oBody = document.body;
var d=document;
var floatDiv="";
var body_width = oBody.clientWidth;
var body_height = oBody.clientHeight;
for (i = 0; i < no; ++ i) {
       snowFlakeImgNo = Math.round(Math.random()*(snowflake.length-1));
       x_sin[i] = 0;
       x_point[i] = Math.random()*(body_width-250)+100;
       y_point[i] = Math.random()*body_height;
       x_length[i] = Math.random()*20;
       x_increased[i] = 0.08 + Math.random()/5;
       y_increased[i] = 2.7 + Math.random()*2;
   d.write("<div id=\"snowFlakeDiv_"+ i +"\" style=\"position:absolute; z-index:11; visibility:visible; top: 15px; left: 215px;\"></div>");
    }function snowFlakeFloat(num) {
       var now = new Date();
       var second = now.getTime();
       var scrollTop = document.body.scrollTop;
if (num==1) {
       for (i = 0; i < no; i++) {
  if (y_point[i] >= 0) {
                     y_point[i] += y_increased[i];
              }
              if (y_point[i] > scrollTop + body_height - 10 || y_point[i] < scrollTop || y_point[i] < 0) {              // 移出窗口,或在等待队列
                     if ((second - lastTime) / 2000 > fallInterval) {       // 从队列中下落
                            snowFlakeImgNo = Math.round(Math.random()*(snowflake.length-1));
document.getElementById('snowFlakeDiv_'+i).innerHTML="<img src=\"" + snowflake[snowFlakeImgNo] + "\" border=\"0\" id='snowImg_"+ i +"'>";
                            if (document.getElementById('snowImg_'+i)) {
                                   document.getElementById('snowImg_'+i).src = snowflake[snowFlakeImgNo];
                            }
                            x_point[i] = Math.random()*(body_width-x_length[i]-250) + 100;
                            y_point[i] = scrollTop;
                            x_increased[i] = 0.05 + Math.random()/2;
                            y_increased[i] = 2.7 + Math.random()/2;
//                            x_increased[i] = 0.05;
//                            y_increased[i] = 2.7;
                            body_width = oBody.clientWidth;
                            body_height = oBody.clientHeight;
                            lastTime = second;
                     }else {
                            y_point[i] = -50;
                     }
              }
              x_sin[i] += x_increased[i];
              document.getElementById("snowFlakeDiv_"+i).style.pixelTop = y_point[i];
              document.getElementById("snowFlakeDiv_"+i).style.pixelLeft = x_point[i] + x_length[i]*Math.sin(x_sin[i]);
       }
}else{
for (i=0;i<no;i++) {
document.getElementById("snowFlakeDiv_"+i).style.display="none";
}
}
}
window.onload=function() {
for (i=0;i<no;i++) {
document.getElementById("snowFlakeDiv_"+i).style.display="none";
}
}var t=null;function cl(val) {window.clearTimeout(t);
getimg(val);
for (i=0;i<no;i++) {
document.getElementById("snowFlakeDiv_"+i).style.display="block";
}
t=window.setInterval("snowFlakeFloat(1)",speed);
showimg=0;
}
function hiddencl()
{
snowFlakeFloat(2);

       for (i = 0; i < no; i++) {
document.getElementById('snowFlakeDiv_'+i).innerHTML="";
                            if (document.getElementById('snowImg_'+i)) {
                                   document.getElementById('snowImg_'+i).src = "";
                            }
   }
showimg=1;
window.clearTimeout(t);
}</script>
<a href="javascript:;" onclick="cl('http://bbs.51js.com/images/smilies/sweat.gif,http://bbs.51js.com/images/smilies/loveliness.gif,http://bbs.51js.com/images/smilies/time.gif')"><span class='anniv'>试用</span></a>    
<a href="javascript:;" onclick="hiddencl()"><span class='anniv'>取消</span></a> </body>
</html>