﻿var photos = [];
photos[photos.length] = {"src": "b1_a303.jpg", "caption": "1:ロンドンから西にA303をはしる。道路付近のある風景。"};
photos[photos.length] = {"src": "b2_stonehenge.jpg", "caption": "2:Amesbury付近にあるミステリアスなストーンヘンジ"};
photos[photos.length] = {"src": "b3_stonehenge2.jpg", "caption": "3:芝生が枯れたストーンヘンジ"};
photos[photos.length] = {"src": "b4_stonehenge3.jpg", "caption": "4:サンセットとストーンヘンジ"};
photos[photos.length] = {"src": "b5_stonehenge4.jpg", "caption": "5:緑が映えるストーンヘンジ"};
photos[photos.length] = {"src": "b6_river_avon_bath.jpg", "caption": "6:ストーンヘンジから西へ進み、バースの街から見えるエイヴォン川"};
photos[photos.length] = {"src": "b7_roman_bath1.jpg", "caption": "7:ローマ時代の浴場、バス（風呂）の語源の街バース"};
photos[photos.length] = {"src": "b8_roman_bath2.jpg", "caption": "8:ローマ時代の浴場2、バス（風呂）の語源の街バース"};
photos[photos.length] = {"src": "b9_garden_stratford.jpg", "caption": "9:バースから北上。ストラトフォード・アポン・エイヴォンに着く"};
photos[photos.length] = {"src": "b10_nash_house_garden.jpg", "caption": "10:ストラトフォード・アポン・エイヴォンのナッシュハウスの庭"};
photos[photos.length] = {"src": "b11_nash_house_garden2.jpg", "caption": "11:ストラトフォード・アポン・エイヴォンのナッシュハウスの庭2"};
photos[photos.length] = {"src": "b12_shakespire_birthplace.jpg", "caption": "12:シェクスピアの誕生地"};
photos[photos.length] = {"src": "b13_shakespire_birthplace2.jpg", "caption": "13:シェクスピアの誕生地2"};
photos[photos.length] = {"src": "b14_theatreroyal.jpg", "caption": "14:ロイヤルシアター"};
photos[photos.length] = {"src": "b15_stratford_upon_avon_charch.jpg", "caption": "15:ストラトフォード・アポン・エイヴォンの教会"};
window.onload = function() {
	var menu = document.createElement("form");
	var menulist = document.createElement("select");
	
	document.body.appendChild(menu);
	menu.appendChild(menulist);
	var options = new Array();
	var caption = document.createTextNode("選んでください");
	options[0] = document.createElement("option");
	options[0].appendChild(caption);
	menulist.appendChild(options[0]);
	for(var i = 0; i<photos.length; i++) {
		var caption = document.createTextNode(photos[i].caption);
		options[i+1] = document.createElement("option");
		options[i+1].appendChild(caption);
		menulist.appendChild(options[i+1]);
	}

	menulist.onchange = function() {
		if(!this.selectedIndex) return false;
		if(document.getElementById("photoframe")) {
			var photoframe = document.getElementById("photoframe");
		} else {
			var photoframe = document.createElement("img");
			photoframe.id = "photoframe";
			photoframe.width = "240";
			photoframe.height = "180";
			document.body.appendChild(photoframe);
		}
		photoframe.src = photos[this.selectedIndex-1].src;
	}
}

