//<!-- Original:  Altan (snow@altan.hr) -->
//<!-- Web Site:  http://www.altan.hr/snow -->
//<!-- Aranged:  オリジナルJavaScript -->
var no = 5; // STAR number　１画面に出る画像の枚数
var speed = 50; // smaller number moves the STAR faster

var dx, xp, yp;    // coordinate and position variables
var am, stx, sty;  // amplitude and step variables
var i, doc_width = 600, doc_height = 1800;
dx = new Array();
xp = new Array();
yp = new Array();
am = new Array();
stx = new Array();
sty = new Array();
sayu=new Array();
myobj=new Array();
function star(){
doc_width =document.body.clientWidth;
doc_height =document.body.clientHeight;
for (i = 1; i < (no+1); ++ i) {
dx[i] = 0;                        // set coordinate variables
xp[i] = Math.random()*(doc_width-30);  // set position variables
yp[i] = Math.random()*doc_height;
am[i] = Math.random()*30;         // set amplitude variables
stx[i] = 0.02 + Math.random()/10; // set step variables
sty[i] = 0.7 + Math.random();     // set step variables
sayu[i]=2.5*Math.random()-1;
k=i%3+1;
mysrc=document.getElementById("pp"+k).src;
document.write("<img src='"+mysrc+"' name='dot"+i+"' style='position:absolute;display:block;'>");
myobj[i]=document.getElementById("dot"+i);
}
STAR_IE();
}
function STAR_IE() {
for (i = 1; i <( no+1); ++ i) {  // iterate for every dot
yp[i] += sty[i];
xp[i]=xp[i]+sayu[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-am[i]-30);
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;
}
dx[i] += stx[i];
myobj[i].style.pixelTop =document.body.scrollTop+ yp[i];
myobj[i].style.pixelLeft =document.body.scrollLeft+xp[i] + am[i]*Math.sin(dx[i]);
}
setTimeout("STAR_IE()", speed);
}
star();
// End -->