﻿function randomImageAd(val)
{
//  ここからデータ
var random_image_array = new Array();
random_image_array[0] = new Array();
random_image_array[0]["image"] = "Images/adv/musepark.gif";
random_image_array[0]["alt"] = "秩父ミューズパーク";
random_image_array[0]["text"] = "秩父ミューズパーク";
random_image_array[0]["url"] = "http://www.sports-no-mori.jp/";
random_image_array[1] = new Array();
random_image_array[1]["image"] = "Images/adv/yumedukuri.gif";
random_image_array[1]["alt"] = "ちちぶ夢創り倶楽部";
random_image_array[1]["text"] = "ちちぶ夢創り倶楽部";
random_image_array[1]["url"] = "http://city.chichibu.lg.jp/menu1097.html";
random_image_array[2] = new Array();
random_image_array[2]["image"] = "Images/adv/chicchi.gif";
random_image_array[2]["alt"] = "秩父地域SNSちっち";
random_image_array[2]["text"] = "秩父地域SNSちっち";
random_image_array[2]["url"] = "https://sns.city.chichibu.lg.jp/";
random_image_array[3] = new Array();
random_image_array[3]["image"] = "Images/adv/yoimachi.gif";
random_image_array[3]["alt"] = "よいまちモニター";
random_image_array[3]["text"] = "よいまちモニター";
random_image_array[3]["url"] = "https://yoimachi.city.chichibu.lg.jp/em/yoimachi.html";
random_image_array[4] = new Array();
random_image_array[4]["image"] = "Images/adv/BMXcourse.jpg";
random_image_array[4]["alt"] = "秩父滝沢サイクルパーク";
random_image_array[4]["text"] = "秩父滝沢サイクルパーク";
random_image_array[4]["url"] = "http://city.chichibu.lg.jp/menu2518.html";
random_image_array[5] = new Array();
random_image_array[5]["image"] = "Images/adv/chichibu_hanajyohou.gif";
random_image_array[5]["alt"] = "ちちぶ花情報";
random_image_array[5]["text"] = "ちちぶ花情報";
random_image_array[5]["url"] = "http://navi.city.chichibu.lg.jp/flower/index.html";
random_image_array[6] = new Array();
random_image_array[6]["image"] = "Images/adv/geopark_keikaku.gif";
random_image_array[6]["alt"] = "秩父まるごとジオパーク計画";
random_image_array[6]["text"] = "秩父まるごとジオパーク計画";
random_image_array[6]["url"] = "http://www.chichibu-geo.com/";

// ここまでデータ

// ここからプログラム
	rand_num = Math.floor(Math.random() * random_image_array.length);
	div = document.getElementById( 'random_image' );
	url = document.createElement("A");
	url.target = '_blank';
	url.href = random_image_array[rand_num]['url'];
	dateObj = new Date();
	img = document.createElement( "IMG" );
	img.src = random_image_array[rand_num]['image'];  
	img.alt = random_image_array[rand_num]['alt'];
	url.appendChild(img );
	div.appendChild( url );
	div_url = document.createElement( "DIV" );
	url = document.createElement("A");
	url.target = '_blank';
	url.href = random_image_array[rand_num]['url'];
	url_title = document.createTextNode(random_image_array[rand_num]['alt'] );
	url.appendChild( url_title );
	div_url.appendChild( url );
	div.appendChild( div_url );
}
