<!--

//調整用変数
var changeSec = 7;	//切替秒数
var max_cnt   = 4;	//切替枚数

//配列作成
var topimg = 	new Array(
			new Array("","","","","","","","",""),
			new Array("","","","","","","","",""),
			new Array("","","","","","","","",""),
			new Array("","","","","","","","",""),
			new Array("","","","","","","","",""),
			new Array("","","","","","","","",""),
			new Array("","","","","","","","",""),
			new Array("","","","","","","","",""),
			new Array("","","","","","","","",""),
			new Array("","","","","","","","",""),
			new Array("","","","","","","","","")
		)

//1枚目
topimg[0]["url"   ] = "http://www.sc-sagamihara.com/game.php";			//リンク先URL
topimg[0]["target"] = "";							//ターゲット
topimg[0]["pict"  ] = "img/index/main_pic1.jpg";				//画像URL
topimg[0]["alt"   ] = "2011シーズン全日程終了";				//ALTテキスト
topimg[0]["show"  ] = "no";							//表示するしない（初期値 no 固定）

//2枚目
topimg[1]["url"   ] = "http://203.138.125.123/fan/volunt.html";		//リンク先URL
topimg[1]["target"] = "";							//ターゲット
topimg[1]["pict"  ] = "img/index/main_pic2.jpg";				//画像URL
topimg[1]["alt"   ] = "2012ボランティア";				//ALTテキスト
topimg[1]["show"  ] = "no";							//表示するしない（初期値 no 固定）

//3枚目
topimg[2]["url"   ] = "http://203.138.125.123/fan/supporter.html";			//リンク先URL
topimg[2]["target"] = "";							//ターゲット
topimg[2]["pict"  ] = "img/index/main_pic3.jpg";				//画像URL
topimg[2]["alt"   ] = "サポーターズクラブ";				//ALTテキスト
topimg[2]["show"  ] = "no";							//表示するしない（初期値 no 固定）

//4枚目
topimg[3]["url"   ] = "http://www.sc-sagamihara.com/game.php";			//リンク先URL
topimg[3]["target"] = "";							//ターゲット
topimg[3]["pict"  ] = "img/index/main_pic4.jpg";				//画像URL
topimg[3]["alt"   ] = "2011シーズン全日程終了";				//ALTテキスト
topimg[3]["show"  ] = "no";							//表示するしない（初期値 no 固定）

//5枚目
topimg[4]["url"   ] = "http://www.sc-sagamihara.com/2011select.html";			//リンク先URL
topimg[4]["target"] = "";							//ターゲット
topimg[4]["pict"  ] = "img/index/main_pic5.jpg";				//画像URL
topimg[4]["alt"   ] = "You'll Never Walk Alone";				//ALTテキスト
topimg[4]["show"  ] = "no";							//表示するしない（初期値 no 固定）

//6枚目
topimg[5]["url"   ] = "http://www.sc-sagamihara.com/game.php";			//リンク先URL
topimg[5]["target"] = "";							//ターゲット
topimg[5]["pict"  ] = "img/index/main_pic6.jpg";				//画像URL
topimg[5]["alt"   ] = "You'll Never Walk Alone";				//ALTテキスト
topimg[5]["show"  ] = "no";							//表示するしない（初期値 no 固定）

//7枚目
topimg[6]["url"   ] = "http://www.sc-sagamihara.com/game.php";			//リンク先URL
topimg[6]["target"] = "";							//ターゲット
topimg[6]["pict"  ] = "img/index/main_pic7.jpg";				//画像URL
topimg[6]["alt"   ] = "You'll Never Walk Alone";				//ALTテキスト
topimg[6]["show"  ] = "no";							//表示するしない（初期値 no 固定）

//8枚目
topimg[7]["url"   ] = "http://www.sc-sagamihara.com/game.php";			//リンク先URL
topimg[7]["target"] = "";							//ターゲット
topimg[7]["pict"  ] = "img/index/main_pic8.jpg";				//画像URL
topimg[7]["alt"   ] = "You'll Never Walk Alone";				//ALTテキスト
topimg[7]["show"  ] = "no";							//表示するしない（初期値 no 固定）

//9枚目
topimg[8]["url"   ] = "http://www.sc-sagamihara.com/game.php";			//リンク先URL
topimg[8]["target"] = "";							//ターゲット
topimg[8]["pict"  ] = "img/index/main_pic9.jpg";				//画像URL
topimg[8]["alt"   ] = "You'll Never Walk Alone";				//ALTテキスト
topimg[8]["show"  ] = "no";							//表示するしない（初期値 no 固定）

//10枚目
topimg[9]["url"   ] = "http://www.sc-sagamihara.com/game.php";			//リンク先URL
topimg[9]["target"] = "";							//ターゲット
topimg[9]["pict"  ] = "img/index/main_pic10.jpg"			;	//画像URL
topimg[9]["alt"   ] = "You'll Never Walk Alone";				//ALTテキスト
topimg[9]["show"  ] = "no";							//表示するしない（初期値 no 固定）

//表示処理実行
printArray();

// ################################## ここから関数定義 ##################################
function printArray(){
	//その他変数
	var showNums = 0;

	//画像出力文字列作成
	for (i = 0; i < max_cnt; i++ ) {
		var tmp = ''
		//設定されてる？
		if (topimg[i]["pict"]) {
			//この画像は表示するべき
			topimg[i]["show"] = "yes";
			showNums = showNums + 1;

			////コード生成
			//DIV設定（div中で出力=noneにしている）
			tmp = '<div id="digiTopShow' + "-" + i + '" style="display: none;">'
			//URL設定
			if (topimg[i]["url"]) {
				tmp += '<a href="' + topimg[i]["url"] + '"';
				//ブランク指定
				if (topimg[i]["target"] == "_blank") {
					tmp += ' target="_blank"';
				}
				tmp += '>';
			}
			//IMG設定
			tmp += '<img src="' + topimg[i]["pict"] + '"';
			if (topimg[i]["alt"]) {
				tmp += ' alt="' + topimg[i]["alt"] + '"';
			}
			tmp += ' border="0" width="781" height="321" />';
			//URLあれば閉じる
			if (topimg[i]["url"]) {
				tmp += '</a>';
			}
			//DIV閉じる
			tmp += '</div>';
			//出力
			document.writeln(tmp);
		}
	}

	//出力画像切り替え
	i = max_cnt - 1;	//topimg[0]から表示するように
	if (showNums > 0) { changePicture(); }
}

//画像切り替え関数
function changePicture()
{
	var old_i = i;

	i = i + 1;
	if (i >= max_cnt) { i = 0; }
	while (topimg[i]["show"] != "yes") {
		i = i + 1;
		if (i >= max_cnt) { i = 0; }
	}

	document.getElementById('digiTopShow'+"-"+old_i).style.display='none';	//非表示に切り替え
	document.getElementById('digiTopShow'+"-"+i).style.display='block';	//表示に切り替え

	//タイムアウト設定（時間が過ぎたら本関数を呼ぶ）
	setTimeout('changePicture()',(changeSec * 1000));
}

//-->

