//基本設定var headerImgBoxName = "headerImgBox";//ヘッダーイメージボックス名var headerImgName = "headerImg"; //ヘッダーイメージ名var browsSeconds = 3;//イメージがステイしている時間（秒）var opacityGrade = 10;//フェードの段階（100まで）var imgOpacity = 100;var randomImg = 0;var photos = new Array(	"http://tacten.net/images/header1.jpg",	"http://tacten.net/images/header2.jpg",	"http://tacten.net/images/header3.jpg",	"http://tacten.net/images/header4.jpg",	"http://tacten.net/images/header5.jpg",	"http://tacten.net/images/header6.jpg",	"http://tacten.net/images/header7.jpg",	"http://tacten.net/images/header8.jpg",	"http://tacten.net/images/header9.jpg",	"http://tacten.net/images/header10.jpg");//最初のイメージを決定function headerRotate() {	randomImg = Math.floor(Math.random() * photos.length);	document.write('<a href="http://www.tacten.net"><img id="headerImg" width="750" height="98" alt="tacten" 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; 