var no = 10;//一画面に常に出ている画像数です 
var hayasa = 4; 
obj_s = new Array();//以下で好きな画像を指定します　見本画像をそのまま使用しないで下さい
obj_s[0] = "./imgs/hane1.gif";
obj_s[1] = "./imgs/hane2.gif";
obj_s[2] = "./imgs/hane3.gif";

var ns4up = (document.layers) ? 1 : 0;
var ie4up = (document.all) ? 1 : 0;
var dx, xp, yp;
var apo, stx, sty;
var i, doc_width = 800, doc_height = 1800;

if (ns4up) {
        doc_width = self.innerWidth;
        doc_height = self.innerHeight;
} else if (ie4up) {
        doc_width = document.body.clientWidth;
        doc_height = document.body.clientHeight;
}

dx = new Array();
xp = new Array();
yp = new Array();
apo = new Array();
stx = new Array();
sty = new Array();
h = 0;

for (i = 0; i < no; ++ i) {
dx[i] = 0;
xp[i] = Math.random()*(doc_width-50);
yp[i] = Math.random()*doc_height;
apo[i] = Math.random()*20;
stx[i] = 0.02 + Math.random()/10;
sty[i] = 0.7 + Math.random();
if (ns4up) {
if (i == 0) {
document.write("<layer name=\"hart"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\"" + obj_s[h] + "\" border=\"0\"></layer>");
} else {
document.write("<layer name=\"hart"+ i +"\" left=\"15\" top=\"15\" visibility=\"show\"><img src=\"" + obj_s[h] + "\" border=\"0\"></layer>");
}
} else if (ie4up) {
if (i == 0) {
document.write("<div id=\"hart"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +" VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;\"><img src=\"" + obj_s[h] + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"hart"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +" VISIBILITY: visible; TOP: 15px; LEFT: 15px; width:1;\"><img src=\"" + obj_s[h] + "\" border=\"0\"></div>");
}
}
if (h == (obj_s.length-1)) { h = 0; } else { h += 1; }
}

function obj_s_NS() {
for (i = 0; i < no; ++ i) {
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-apo[i]-30);
yp[i] = 0;
stx[i] = 0.01 + Math.random()/10;
sty[i] = 0.5 + Math.random();
doc_width = self.innerWidth;
doc_height = self.innerHeight;
}
dx[i] += stx[i];
document.layers["hart"+i].top = yp[i];
document.layers["hart"+i].left = xp[i] + apo[i]*Math.sin(dx[i]);
}
setTimeout("obj_s_NS()", hayasa);
}

function obj_s_IE() {
for (i = 0; i < no; ++ i) {
yp[i] += sty[i];
if (yp[i] > doc_height-50) {
xp[i] = Math.random()*(doc_width-apo[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];
document.all["hart"+i].style.pixelTop = yp[i];
document.all["hart"+i].style.pixelLeft = xp[i] + apo[i]*Math.sin(dx[i]);
}
setTimeout("obj_s_IE()", hayasa);
}

if (ns4up) {
obj_s_NS();
} else if (ie4up) {
obj_s_IE();
}