/******************************************************************************
	初期設定
******************************************************************************/
var gsTickerSwf_AN = "http://www.watarigraphic.com/blogparts/05/sakura.swf";

var gsTickerId_AN = "Ticker_AN";

// Tikerを作成する
MakeTicker_AN();

/******************************************************************************
	関数名		MakeTicker_AN
	機能		ティッカーを作成する
	
	入力		なし
	出力		document.writeによるHTML出力
******************************************************************************/
function MakeTicker_AN(){
	var sTickerUrl = gsTickerSwf_AN;
	
	var sHtml = "";
	sHtml += '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="160" height="394" id="' + gsTickerId_AN + '" align="middle">';
	sHtml += '<param name="allowScriptAccess" value="always" />';
	sHtml += '<param name="movie" value="' + sTickerUrl + '" />';
	sHtml += '<param name="quality" value="high" />';
	sHtml += '<param name="bgcolor" value="#ffffff" />';
	sHtml += '<param name="wmode" value="transparent" />';
	sHtml += '<embed wmode="transparent" src="' + sTickerUrl + '" quality="high" bgcolor="#ffffff" width="160" height="394" name="' + gsTickerId_AN + '" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />';
	sHtml += '</object>';
	
	document.write(sHtml);
}



var noh = 10; 
var spd = 5;

imgpre = new Image();
imgpre.scr = "http://www.watarigraphic.com/blogparts/05/img/01.png";
imgpre.scr = "http://www.watarigraphic.com/blogparts/05/img/02.png";
imgpre.scr = "http://www.watarigraphic.com/blogparts/05/img/03.png";

ball = new Array();
ball[0] = "http://www.watarigraphic.com/blogparts/05/img/01.png";
ball[1] = "http://www.watarigraphic.com/blogparts/05/img/02.png";
ball[2] = "http://www.watarigraphic.com/blogparts/05/img/03.png";

var mbn = 2;
var dxh, xph, yph, dex, dey, ssx, ssy, amh, stx, sty, ihe, dwi, dhe, ssb, ssE, deb, deE;

dhe = 600;
dwi = 800;

dxh = new Array();
xph = new Array();
yph = new Array();
amh = new Array();
stx = new Array();
sty = new Array();
jhe = mbn;

setTimeout("snowh()", spd);

for (ihe = 0; ihe < noh; ++ ihe) {
dxh[ihe] = 0;
xph[ihe] = Math.random()*(dwi-50);
yph[ihe] = Math.random()*dhe;
amh[ihe] = Math.random()*80;// 横の揺れ
stx[ihe] = 0.02 + Math.random()/200;// 落ちるスピード
sty[ihe] = 0.7 + Math.random();
if (ihe == 0) {
document.write("<div id=\"doth"+ ihe +"\" style=\"position:absolute; z-index:"+ ihe +"; visibility:visible; top:5px; left:5px;\"><img src=\"" + ball[jhe] + "\" border=\"0\"></div>");
} else {
document.write("<div id=\"doth"+ ihe +"\" style=\"position:absolute; z-index:"+ ihe +"; visibility:visible; top:5px; left:5px;\"><img src=\"" + ball[jhe] + "\" border=\"0\"></div>");
}
if (jhe == 0) { jhe = mbn; } else { jhe -= 1; }
}

function snowh() {
for (ihe = 0; ihe < noh; ++ ihe) {
yph[ihe] += sty[ihe];

ssb = document.body.scrollTop;
ssE = document.documentElement.scrollTop;
if(ssb>ssE){
ssy = document.body.scrollTop;
ssx = document.body.scrollLeft;
}else{
ssy = document.documentElement.scrollTop;
ssx = document.documentElement.scrollLeft;
}

deb = document.body.clientHeight;
deE = document.documentElement.clientHeight;
if(deb>1200){
dey = document.documentElement.clientHeight-50;
dex = document.documentElement.clientWidth;
}else{
dey = document.body.clientHeight-50;
dex = document.body.clientWidth;
}

if (yph[ihe] < ssy || yph[ihe] > ssy+dey) {
xph[ihe] = Math.random()*(dwi-amh[ihe]-30);
yph[ihe] = ssy+500*Math.random();
stx[ihe] = 0.02 + Math.random()/200;
sty[ihe] = 0.7 + Math.random();

dwi = dex+ssx;
dhe = ssy;
}
dxh[ihe] += stx[ihe];
document.getElementById('doth'+ihe).style.top = yph[ihe]+"px";
document.getElementById('doth'+ihe).style.left = xph[ihe] + amh[ihe]*Math.sin(dxh[ihe])+"px";
}
setTimeout("snowh()", spd);
}

