//基本設定var headerImgBoxName = "headerImgBox";//ヘッダーイメージボックス名var headerImgName = "headerImg"; //ヘッダーイメージ名var browsSeconds = 5;//イメージがステイしている時間（秒）var opacityGrade = 4;//フェードの段階（100まで）var imgOpacity = 100;var randomImg = 0;var photos = new Array(	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/1.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/2.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/3.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/4.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/5.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/6.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/7.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/8.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/9.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/10.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/11.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/12.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/13.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/14.jpg",	"http://www.digi-k.com/seisaku/jma/hcj/eng/i/ph/15.jpg");//最初のイメージを決定function headerRotate() {	randomImg = Math.floor(Math.random() * photos.length);	document.write('<a href="../hcj/movie.html" title="Photo Gallery"><img id="headerImg" width="650" height="260" alt="Photo Gallery" src="' +photos[randomImg] + '" /></a>');}//ヘッダーイメージアニメーションfunction headerAnimation() {	var imgObj = document.getElementById(headerImgName);	document.getElementById(headerImgBoxName).style.backgroundImage = 'url(' + photos[randomImg] + ')';	imgFade();}//フェードfunction imgFade() {	var imgObj = document.getElementById(headerImgName);	if (imgOpacity <= opacityGrade) {//フェード外		imgOpacity = 100;		imgSelect();		setTimeout("imgFade()",browsSeconds*1000);	}else{//フェード中		imgOpacity -= opacityGrade;		setOpacity(imgObj,imgOpacity);		setTimeout("imgFade()",50);	}}//次イメージ選択function imgSelect() {	var divObj = document.getElementById(headerImgBoxName);	var imgObj = document.getElementById(headerImgName);	imgObj.src = photos[randomImg];	setOpacity(imgObj,100);	randomImg = Math.floor(Math.random() * photos.length);	divObj.style.backgroundImage = 'url(' + photos[randomImg] + ')';}//不透明度設定function setOpacity(obj, opacity) {	opacity = (opacity == 100)?100:opacity;	obj.style.filter = "alpha(opacity:"+opacity+")";		obj.style.KHTMLOpacity = opacity/100;	obj.style.MozOpacity = opacity/100;	obj.style.opacity = opacity/100;}window.onload = headerAnimation; 