var no = 5; var speed = 7; snow = new Array(); snow[0] = new Array("http://www.geocities.co.jp/HeartLand-Hanamizuki/8856/ichi_i9.gif",2); snow[1]= new Array("http://www.geocities.co.jp/HeartLand-Hanamizuki/8856/ichi_i8.gif",2); snow[2]= new Array("http://www.geocities.co.jp/HeartLand-Hanamizuki/8856/ichi_i5.gif",2); snow[3]= new Array("http://www.geocities.co.jp/HeartLand-Hanamizuki/8856/ichi_i4.gif",2); snow[4]= new Array("http://www.geocities.co.jp/HeartLand-Hanamizuki/8856/ichi_i6.gif",2); var ns4up = (document.layers) ? 1 : 0; var ie4up = (document.all) ? 1 : 0; var dx, xp, yp; var am, stx, sty; var i, doc_width = 600, doc_height = 800; if (ns4up) { doc_width = self.innerWidth; doc_height = 500; } else if (ie4up) { doc_width = document.body.clientWidth; doc_height = 500; } dx = new Array(); xp = new Array(); yp = new Array(); am = new Array(); stx = new Array(); sty = new Array(); muki = new Array(); var j = 0; for (i = 0; i < no; ++ i) { dx[i] = 0; xp[i] = Math.random()*doc_height; yp[i] = Math.random()*doc_width; am[i] = Math.random()*10; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); muki[i] = snow[j][1]; if (ns4up) document.write(""); else if (ie4up) document.write("
"); if (j == (snow.length-1)) j = 0; else j += 1; } document.write("
"); function snowNS() { for (i = 0; i < no; ++ i) { switch(muki[i]) { case 0: yp[i] += sty[i]; if (yp[i] > doc_width) { xp[i] = Math.random()*doc_height-am[i]; yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = self.innerWidth; doc_height = self.innerHeight; } break; case 1: yp[i] -= sty[i]; if (yp[i] < 0) { xp[i] = Math.random()*(doc_height-am[i]); yp[i] = doc_width; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = self.innerWidth; doc_height = self.innerHeight; } break; case 2: yp[i] -= sty[i]; if (yp[i] > doc_height) { xp[i] = Math.random()*(doc_width-50); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = self.innerWidth; doc_height = self.innerHeight -50; } break; case 3: yp[i] -= sty[i]; if (yp[i] < -50) { xp[i] = Math.random()*(doc_width-am[i]-30); yp[i] = doc_height; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = self.innerWidth; doc_height = self.innerHeight -50; } break; default: } switch(muki[i]) { case 0: case 1: dx[i] += stx[i]; document.layers["dot"+i].top = xp[i] + am[i]*Math.sin(dx[i]); document.layers["dot"+i].left = yp[i]; break; case 2: case 3: dx[i] += stx[i]; document.layers["dot"+i].top = yp[i]; document.layers["dot"+i].left = xp[i] + am[i]*Math.sin(dx[i]); break; default: } } setTimeout("snowNS()", speed); } function snowIE() { for (i = 0; i < no; ++ i) { switch(muki[i]) { case 0: yp[i] += sty[i]; if (yp[i] > doc_width) { xp[i] = Math.random()*(doc_width-am[i]); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } break; case 1: yp[i] -= sty[i]; if (yp[i] < 0) { xp[i] = Math.random()*(doc_width-am[i]); yp[i] = doc_width; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } break; case 2: yp[i] += sty[i]; if (yp[i] > doc_height) { xp[i] = Math.random()*(doc_width-50); yp[i] = 0; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = document.body.clientWidth; doc_height = document.body.clientHeight; } break; case 3: yp[i] -= sty[i]; if (yp[i] < -50) { xp[i] = Math.random()*(doc_height-am[i]-30); yp[i] = doc_height; stx[i] = 0.02 + Math.random()/10; sty[i] = 0.7 + Math.random(); doc_width = document.body.clientWidth; doc_height = document.body.clientHeight -50; } break; default: } switch(muki[i]) { case 0: case 1: dx[i] += stx[i]; document.all["dot"+i].style.pixelTop = xp[i] + am[i]*Math.sin(dx[i]); document.all["dot"+i].style.pixelLeft = yp[i]; break; case 2: case 3: dx[i] += stx[i]; document.all["dot"+i].style.pixelTop = yp[i]; document.all["dot"+i].style.pixelLeft = xp[i] + am[i]*Math.sin(dx[i]); break; default: } } setTimeout("snowIE()", speed); } if (ns4up) snowNS(); else if (ie4up) snowIE();