// JavaScript Document

//トップ画面の画像と移動ページ先を一定時間で入れ替えるプログラム

window.onload = function (){
//設定時間この場合3500ミリ秒ごとに、関数page.swapImage()の処理を行う
	setInterval("page.swapImage()",3500);
}

//移動するページの相対アドレスとそれに対応する画像をそれぞれ配列に入れる
	var page = {
		pageURL : [
					"http://www.k-i-a.or.jp/kokusai/jigyou/seminar/renzoku.html",
					"http://www.k-i-a.or.jp/kokusai/k-edu/kyouzai/sougou/index.html",
					"http://www.k-i-a.or.jp/kokusai/news/index.html",
					"http://www.k-i-a.or.jp/kokusai/k-edu/kyouzai/papercraft/index.html"
					],
		imageURL : [
					"picture/1.jpg",
					"picture/2.jpg",
					"picture/3.jpg",
					"picture/5.jpg"
					],
		
//<a>と<img>の内容の入れ替えを配列の数だけ繰り返し、一周すると最初に戻るようにする。
	swapImage : function(){
			this.count++;
			if (this.count >= this.imageURL.length) this.count = 0;
			document.getElementById("changepage").href = this.pageURL[this.count];
			document.getElementById("changeimage").src = this.imageURL[this.count];
		},
		count : 0
	};
