        Amount=8;
	Ypos_float=new Array();
	Xpos_float=new Array();
	Speed_float=new Array();
	Step_float=new Array();
	CStep_float=new Array();
  var newDiv=document.createElement("<div id='floatlayer' style='position:absolute;top:0px;left:0px;z-index:300'></div>");
	//漂浮物的层
	var str="<div style='position:relative'>";
	for (i = 0; i < Amount; i++)
	{
	    var P= Math.floor(Math.random()*4);
	    str+='<img id="si" src="about:blank" style="position:absolute;top:0px;left:0px;visibility=hidden">';
	}
	str+='</div>';
newDiv.innerHTML=str;
document.write(str);

WinHeight=480;
WinWidth=580;

	for (i=0; i < Amount; i++)
	{
		Ypos_float[i] = Math.round(Math.random()*WinHeight);
		Xpos_float[i] = Math.round(Math.random()*WinWidth);
		Speed_float[i]= Math.random()*1.5+1;
		CStep_float[i]=0;
		Step_float[i]=Math.random()*0.05+0.05;
	}

//定义轨迹
function fall()
{
	if (g_FallingMode == null) {
		return;
	}
	var mode= g_FallingMode;
    var totalnum=8;
	var WinHeight=480;
	var WinWidth=580;
    var hscrll=(document.layers)?window.pageYOffset:document.body.scrollTop;
    var wscrll=(document.layers)?window.pageXOffset:document.body.scrollLeft;
    for (i=0; i <totalnum; i++)
    {
        if(mode==0||mode==1)
        {
            sy = Speed_float[i]*Math.sin(90*Math.PI/180);
            sx = Speed_float[i]*Math.cos(CStep_float[i]);
            Ypos_float[i]+=sy;
            Xpos_float[i]+=sx;
            if (Ypos_float[i] > WinHeight)
            {
                Ypos_float[i]=0;
                Xpos_float[i]=Math.round(Math.random()*WinWidth);
                Speed_float[i]=Math.random()*1+1;
            }
         }
         else
         {
             sx = Speed_float[i]*Math.sin(90*Math.PI/180);
             sy = Speed_float[i]*Math.cos(CStep_float[i]);
             Ypos_float[i]+=sy;
             Xpos_float[i]+=sx;
             if (Xpos_float[i] > WinWidth)
             {
                  Xpos_float[i]=0;
                  Ypos_float[i]=Math.round(Math.random()*WinHeight);
             }
         }

          //控制方向
          if (mode==0)
          {
               si[i].style.pixelLeft=Xpos_float[i];
               si[i].style.pixelTop=Ypos_float[i]+hscrll;
          }
          else if(mode==1)
          {
               si[i].style.pixelLeft=Xpos_float[i];
               si[i].style.pixelTop=-Ypos_float[i]+hscrll;
          }
          else if(mode==2)
          {
               si[i].style.pixelLeft=Xpos_float[i]+wscrll;
               si[i].style.pixelTop=Ypos_float[i];
          }
          else if(mode==3)
          {
               si[i].style.pixelLeft=-Xpos_float[i]+wscrll;
               si[i].style.pixelTop=Ypos_float[i];
          }
     }
}

function start_Falling() {

	falling= setInterval("fall()", 200);
}

function stop_Falling() {
	if (falling) {
		clearTimeout(falling);
		falling= null;
		g_FallingMode= null;
	}
}

function Jafloat(itemno, mode, num)
{
var totalnum=8;

if (itemno==0) {
		return false;
	}
for(i=0; i<totalnum;i++)
	{
          if(si[i]) {
               si[i].style.visibility="";
               var P=Math.floor(Math.random()*num);
               si[i].src="Fly/"+itemno+"_"+(P+1)+".gif";
          }
    }
    g_FallingMode= mode;
    start_Falling();
}


function Jahid(mode)
{
var totalnum=8;
var i;
 for(i=0; i<totalnum; i++)
    {
       if (si[i])
          {
           si[i].style.visibility="hidden";
           si[i].src="";
            }
    }
 stop_Falling();
	if (mode==0)
	{
        document.all.floatlayer.style.pixelLeft=0;
        document.all.floatlayer.style.pixelTop=0;
    }
    else if(mode==1)
    {
        document.all.floatlayer.style.pixelLeft=0;
        document.all.floatlayer.style.pixelTop=625;

    }
    else if(mode==2)
    {
        document.all.floatlayer.style.pixelLeft=0;
        document.all.floatlayer.style.pixelTop=0;
    }
    else if(mode==3)
    {
        document.all.floatlayer.style.pixelLeft=925;
        document.all.floatlayer.style.pixelTop=0;

    }
}